gradio-pr-bot commited on
Commit
1312b4c
·
verified ·
1 Parent(s): 3061117

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. 5.49.1/row/Index.svelte +108 -0
  2. 5.49.1/row/package.json +31 -0
5.49.1/row/Index.svelte ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script lang="ts">
2
+ import { StatusTracker } from "@gradio/statustracker";
3
+ import type { LoadingStatus } from "@gradio/statustracker";
4
+ import type { Gradio } from "@gradio/utils";
5
+
6
+ export let equal_height = true;
7
+ export let elem_id: string;
8
+ export let elem_classes: string[] = [];
9
+ export let visible: boolean | "hidden" = true;
10
+ export let variant: "default" | "panel" | "compact" = "default";
11
+ export let loading_status: LoadingStatus | undefined = undefined;
12
+ export let gradio: Gradio | undefined = undefined;
13
+ export let show_progress = false;
14
+ export let height: number | string | undefined;
15
+ export let min_height: number | string | undefined;
16
+ export let max_height: number | string | undefined;
17
+ export let scale: number | null = null;
18
+
19
+ const get_dimension = (
20
+ dimension_value: string | number | undefined
21
+ ): string | undefined => {
22
+ if (dimension_value === undefined) {
23
+ return undefined;
24
+ }
25
+ if (typeof dimension_value === "number") {
26
+ return dimension_value + "px";
27
+ } else if (typeof dimension_value === "string") {
28
+ return dimension_value;
29
+ }
30
+ };
31
+ </script>
32
+
33
+ <div
34
+ class:compact={variant === "compact"}
35
+ class:panel={variant === "panel"}
36
+ class:unequal-height={equal_height === false}
37
+ class:stretch={equal_height}
38
+ class:hide={!visible}
39
+ class:grow-children={scale && scale >= 1}
40
+ style:height={get_dimension(height)}
41
+ style:max-height={get_dimension(max_height)}
42
+ style:min-height={get_dimension(min_height)}
43
+ style:flex-grow={scale}
44
+ id={elem_id}
45
+ class="row {elem_classes.join(' ')}"
46
+ >
47
+ {#if loading_status && show_progress && gradio}
48
+ <StatusTracker
49
+ autoscroll={gradio.autoscroll}
50
+ i18n={gradio.i18n}
51
+ {...loading_status}
52
+ status={loading_status
53
+ ? loading_status.status == "pending"
54
+ ? "generating"
55
+ : loading_status.status
56
+ : null}
57
+ />
58
+ {/if}
59
+ <slot />
60
+ </div>
61
+
62
+ <style>
63
+ div {
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ gap: var(--layout-gap);
67
+ width: var(--size-full);
68
+ position: relative;
69
+ }
70
+
71
+ .hide {
72
+ display: none;
73
+ }
74
+ .compact > :global(*),
75
+ .compact :global(.box) {
76
+ border-radius: 0;
77
+ }
78
+ .compact,
79
+ .panel {
80
+ border-radius: var(--container-radius);
81
+ background: var(--background-fill-secondary);
82
+ padding: var(--size-2);
83
+ }
84
+ .unequal-height {
85
+ align-items: flex-start;
86
+ }
87
+
88
+ .stretch {
89
+ align-items: stretch;
90
+ }
91
+
92
+ .stretch > :global(.column > *),
93
+ .stretch > :global(.column > .form > *) {
94
+ flex-grow: 1;
95
+ flex-shrink: 0;
96
+ }
97
+
98
+ div > :global(*),
99
+ div > :global(.form > *) {
100
+ flex: 1 1 0%;
101
+ flex-wrap: wrap;
102
+ min-width: min(160px, 100%);
103
+ }
104
+
105
+ .grow-children > :global(.column) {
106
+ align-self: stretch;
107
+ }
108
+ </style>
5.49.1/row/package.json ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@gradio/row",
3
+ "version": "0.2.2",
4
+ "description": "Gradio UI packages",
5
+ "type": "module",
6
+ "author": "",
7
+ "license": "ISC",
8
+ "private": false,
9
+ "main_changeset": true,
10
+ "devDependencies": {
11
+ "@gradio/preview": "workspace:^",
12
+ "@gradio/statustracker": "workspace:^",
13
+ "@gradio/utils": "workspace:^"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "gradio": "./Index.svelte",
18
+ "svelte": "./dist/Index.svelte",
19
+ "types": "./dist/Index.svelte.d.ts"
20
+ },
21
+ "./package.json": "./package.json"
22
+ },
23
+ "peerDependencies": {
24
+ "svelte": "^4.0.0"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/gradio-app/gradio.git",
29
+ "directory": "js/row"
30
+ }
31
+ }