svseeds 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_svseeds/Accordion.svelte +12 -1
- package/_svseeds/Accordion.svelte.d.ts +12 -1
- package/_svseeds/DarkToggle.svelte +29 -15
- package/_svseeds/DarkToggle.svelte.d.ts +15 -1
- package/_svseeds/TagsInputField.svelte +20 -1
- package/_svseeds/TagsInputField.svelte.d.ts +20 -1
- package/_svseeds/ToggleGroupField.svelte +20 -1
- package/_svseeds/ToggleGroupField.svelte.d.ts +20 -1
- package/_svseeds/_Button.svelte +10 -1
- package/_svseeds/_Button.svelte.d.ts +10 -1
- package/_svseeds/_CheckField.svelte +23 -1
- package/_svseeds/_CheckField.svelte.d.ts +23 -1
- package/_svseeds/_ColorPicker.svelte +13 -1
- package/_svseeds/_ColorPicker.svelte.d.ts +13 -1
- package/_svseeds/_ComboBox.svelte +14 -1
- package/_svseeds/_ComboBox.svelte.d.ts +14 -1
- package/_svseeds/_ContextMenu.svelte +8 -1
- package/_svseeds/_ContextMenu.svelte.d.ts +8 -1
- package/_svseeds/_Disclosure.svelte +13 -1
- package/_svseeds/_Disclosure.svelte.d.ts +13 -1
- package/_svseeds/_Drawer.svelte +11 -4
- package/_svseeds/_Drawer.svelte.d.ts +8 -1
- package/_svseeds/_HotkeyCapture.svelte +6 -1
- package/_svseeds/_HotkeyCapture.svelte.d.ts +6 -1
- package/_svseeds/_Modal.svelte +10 -1
- package/_svseeds/_Modal.svelte.d.ts +10 -1
- package/_svseeds/_ProgressTracker.svelte +16 -1
- package/_svseeds/_ProgressTracker.svelte.d.ts +16 -1
- package/_svseeds/_SelectField.svelte +24 -1
- package/_svseeds/_SelectField.svelte.d.ts +24 -1
- package/_svseeds/_Slider.svelte +15 -1
- package/_svseeds/_Slider.svelte.d.ts +15 -1
- package/_svseeds/_Sortable.svelte +13 -1
- package/_svseeds/_Sortable.svelte.d.ts +13 -1
- package/_svseeds/_Tabs.svelte +15 -1
- package/_svseeds/_Tabs.svelte.d.ts +15 -1
- package/_svseeds/_TagsInput.svelte +26 -1
- package/_svseeds/_TagsInput.svelte.d.ts +26 -1
- package/_svseeds/_TextField.svelte +29 -1
- package/_svseeds/_TextField.svelte.d.ts +29 -1
- package/_svseeds/_Toggle.svelte +12 -1
- package/_svseeds/_Toggle.svelte.d.ts +12 -1
- package/_svseeds/_ToggleGroup.svelte +12 -1
- package/_svseeds/_ToggleGroup.svelte.d.ts +12 -1
- package/_svseeds/_Tooltip.svelte +12 -1
- package/_svseeds/_Tooltip.svelte.d.ts +12 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface AccordionProps {
|
|
6
7
|
labels?: string[];
|
|
@@ -14,6 +15,16 @@
|
|
|
14
15
|
svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
|
|
15
16
|
}
|
|
16
17
|
```
|
|
18
|
+
### Anatomy
|
|
19
|
+
```svelte
|
|
20
|
+
<div class="whole">
|
|
21
|
+
{#each labels as label, i}
|
|
22
|
+
<Disclosure {label}>
|
|
23
|
+
{@render restProps[i]()}
|
|
24
|
+
</Disclosure>
|
|
25
|
+
{/each}
|
|
26
|
+
</div>
|
|
27
|
+
```
|
|
17
28
|
-->
|
|
18
29
|
<script module lang="ts">
|
|
19
30
|
export interface AccordionProps {
|
|
@@ -15,7 +15,8 @@ import { type Snippet } from "svelte";
|
|
|
15
15
|
import { type SVSClass } from "./core";
|
|
16
16
|
import { type DisclosureProps, type DisclosureReqdProps, type DisclosureBindProps } from "./_Disclosure.svelte";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* ### Types
|
|
19
|
+
* default value: *`(value)`*
|
|
19
20
|
* ```ts
|
|
20
21
|
* interface AccordionProps {
|
|
21
22
|
* labels?: string[];
|
|
@@ -29,6 +30,16 @@ import { type DisclosureProps, type DisclosureReqdProps, type DisclosureBindProp
|
|
|
29
30
|
* svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
|
|
30
31
|
* }
|
|
31
32
|
* ```
|
|
33
|
+
* ### Anatomy
|
|
34
|
+
* ```svelte
|
|
35
|
+
* <div class="whole">
|
|
36
|
+
* {#each labels as label, i}
|
|
37
|
+
* <Disclosure {label}>
|
|
38
|
+
* {@render restProps[i]()}
|
|
39
|
+
* </Disclosure>
|
|
40
|
+
* {/each}
|
|
41
|
+
* </div>
|
|
42
|
+
* ```
|
|
32
43
|
*/
|
|
33
44
|
declare const Accordion: import("svelte").Component<AccordionProps, {}, "variant" | "current">;
|
|
34
45
|
type Accordion = ReturnType<typeof Accordion>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface DarkToggleProps {
|
|
7
|
+
children?: Snippet<[boolean, string, HTMLButtonElement | undefined]>; // Snippet<[value,variant,element]>
|
|
6
8
|
dark?: boolean; // bindable (prefers-color-scheme)
|
|
7
9
|
element?: HTMLButtonElement; // bindable
|
|
8
10
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
@@ -12,9 +14,20 @@
|
|
|
12
14
|
svsToggle?: Omit<ToggleProps, ToggleReqdProps | ToggleBindProps>;
|
|
13
15
|
}
|
|
14
16
|
```
|
|
17
|
+
### Anatomy
|
|
18
|
+
```svelte
|
|
19
|
+
<Toggle {...deps.svsToggle} bind:value={dark} bind:element>
|
|
20
|
+
{#if children}
|
|
21
|
+
{children}
|
|
22
|
+
{:else}
|
|
23
|
+
// Default Icon
|
|
24
|
+
{/if}
|
|
25
|
+
</Toggle>
|
|
26
|
+
```
|
|
15
27
|
-->
|
|
16
28
|
<script module lang="ts">
|
|
17
29
|
export interface DarkToggleProps {
|
|
30
|
+
children?: Snippet<[boolean, string, HTMLButtonElement | undefined]>; // Snippet<[value,variant,element]>
|
|
18
31
|
dark?: boolean; // bindable (prefers-color-scheme)
|
|
19
32
|
element?: HTMLButtonElement; // bindable
|
|
20
33
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
@@ -171,12 +184,13 @@
|
|
|
171
184
|
const twColors = new Set<string>();
|
|
172
185
|
const theme = new Theme();
|
|
173
186
|
|
|
187
|
+
import { type Snippet } from "svelte";
|
|
174
188
|
import { VARIANT, omit } from "./core";
|
|
175
189
|
import Toggle, { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./_Toggle.svelte";
|
|
176
190
|
</script>
|
|
177
191
|
|
|
178
192
|
<script lang="ts">
|
|
179
|
-
let { dark = $bindable(), variant = $bindable(""), element = $bindable(), deps }: DarkToggleProps = $props();
|
|
193
|
+
let { children, dark = $bindable(), variant = $bindable(""), element = $bindable(), deps }: DarkToggleProps = $props();
|
|
180
194
|
|
|
181
195
|
// *** Initialize *** //
|
|
182
196
|
if (!variant) variant = VARIANT.NEUTRAL;
|
|
@@ -185,7 +199,8 @@
|
|
|
185
199
|
|
|
186
200
|
// *** Initialize Deps *** //
|
|
187
201
|
const svsToggle = {
|
|
188
|
-
...omit(deps?.svsToggle, "
|
|
202
|
+
...omit(deps?.svsToggle, "styling", "attributes"),
|
|
203
|
+
children: main,
|
|
189
204
|
styling: deps?.svsToggle?.styling ?? `${preset} svs-toggle`,
|
|
190
205
|
ariaLabel,
|
|
191
206
|
attributes: {
|
|
@@ -199,20 +214,19 @@
|
|
|
199
214
|
|
|
200
215
|
<!---------------------------------------->
|
|
201
216
|
|
|
202
|
-
<Toggle bind:value={dark} bind:variant bind:element {...svsToggle}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
217
|
+
<Toggle bind:value={dark} bind:variant bind:element {...svsToggle} />
|
|
218
|
+
|
|
219
|
+
{#snippet main(value: boolean, variant: string, element: HTMLButtonElement | undefined)}
|
|
220
|
+
{#if children}
|
|
221
|
+
{@render children(value, variant, element)}
|
|
222
|
+
{:else}
|
|
223
|
+
{#if value}
|
|
224
|
+
{@render svgDark()}
|
|
206
225
|
{:else}
|
|
207
|
-
{
|
|
208
|
-
{@render svgDark()}
|
|
209
|
-
{:else}
|
|
210
|
-
{@render svgLight()}
|
|
211
|
-
{/if}
|
|
226
|
+
{@render svgLight()}
|
|
212
227
|
{/if}
|
|
213
|
-
{/
|
|
214
|
-
|
|
215
|
-
|
|
228
|
+
{/if}
|
|
229
|
+
{/snippet}
|
|
216
230
|
{#snippet svgDark()}
|
|
217
231
|
<svg style="width:100%;height:100%;" viewBox="0 0 24 24" aria-hidden="true">
|
|
218
232
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.2256 2.00253C9.59172 1.94346 6.93894 2.9189 4.92893 4.92891C1.02369 8.83415 1.02369 15.1658 4.92893 19.071C8.83418 22.9763 15.1658 22.9763 19.0711 19.071C21.0811 17.061 22.0565 14.4082 21.9975 11.7743C21.9796 10.9772 21.8669 10.1818 21.6595 9.40643C21.0933 9.9488 20.5078 10.4276 19.9163 10.8425C18.5649 11.7906 17.1826 12.4053 15.9301 12.6837C14.0241 13.1072 12.7156 12.7156 12 12C11.2844 11.2844 10.8928 9.97588 11.3163 8.0699C11.5947 6.81738 12.2094 5.43511 13.1575 4.08368C13.5724 3.49221 14.0512 2.90664 14.5935 2.34046C13.8182 2.13305 13.0228 2.02041 12.2256 2.00253ZM17.6569 17.6568C18.9081 16.4056 19.6582 14.8431 19.9072 13.2186C16.3611 15.2643 12.638 15.4664 10.5858 13.4142C8.53361 11.362 8.73568 7.63895 10.7814 4.09281C9.1569 4.34184 7.59434 5.09193 6.34315 6.34313C3.21895 9.46732 3.21895 14.5326 6.34315 17.6568C9.46734 20.781 14.5327 20.781 17.6569 17.6568Z" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export interface DarkToggleProps {
|
|
2
|
+
children?: Snippet<[boolean, string, HTMLButtonElement | undefined]>;
|
|
2
3
|
dark?: boolean;
|
|
3
4
|
element?: HTMLButtonElement;
|
|
4
5
|
variant?: string;
|
|
@@ -14,11 +15,14 @@ export declare const THEME: {
|
|
|
14
15
|
readonly DARK: "dark";
|
|
15
16
|
};
|
|
16
17
|
export declare function setThemeToRoot(theme?: string): void;
|
|
18
|
+
import { type Snippet } from "svelte";
|
|
17
19
|
import { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./_Toggle.svelte";
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* ### Types
|
|
22
|
+
* default value: *`(value)`*
|
|
20
23
|
* ```ts
|
|
21
24
|
* interface DarkToggleProps {
|
|
25
|
+
* children?: Snippet<[boolean, string, HTMLButtonElement | undefined]>; // Snippet<[value,variant,element]>
|
|
22
26
|
* dark?: boolean; // bindable (prefers-color-scheme)
|
|
23
27
|
* element?: HTMLButtonElement; // bindable
|
|
24
28
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
@@ -28,6 +32,16 @@ import { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./
|
|
|
28
32
|
* svsToggle?: Omit<ToggleProps, ToggleReqdProps | ToggleBindProps>;
|
|
29
33
|
* }
|
|
30
34
|
* ```
|
|
35
|
+
* ### Anatomy
|
|
36
|
+
* ```svelte
|
|
37
|
+
* <Toggle {...deps.svsToggle} bind:value={dark} bind:element>
|
|
38
|
+
* {#if children}
|
|
39
|
+
* {children}
|
|
40
|
+
* {:else}
|
|
41
|
+
* // Default Icon
|
|
42
|
+
* {/if}
|
|
43
|
+
* </Toggle>
|
|
44
|
+
* ```
|
|
31
45
|
*/
|
|
32
46
|
declare const DarkToggle: import("svelte").Component<DarkToggleProps, {}, "variant" | "element" | "dark">;
|
|
33
47
|
type DarkToggle = ReturnType<typeof DarkToggle>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface TagsInputFieldProps {
|
|
6
7
|
label?: string;
|
|
@@ -31,6 +32,24 @@
|
|
|
31
32
|
message: string;
|
|
32
33
|
};
|
|
33
34
|
```
|
|
35
|
+
### Anatomy
|
|
36
|
+
```svelte
|
|
37
|
+
<div class="whole">
|
|
38
|
+
<div class="top" conditional>
|
|
39
|
+
<label class="label" conditional>
|
|
40
|
+
{label}
|
|
41
|
+
<span class="extra" conditional>{extra}</span>
|
|
42
|
+
</label>
|
|
43
|
+
<span class="aux" conditional>{aux}</span>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="middle">
|
|
46
|
+
<span class="left" conditional>{left}</span>
|
|
47
|
+
<TagsInput bind:values bind:element {...deps.svsTagsInput} />
|
|
48
|
+
<span class="right" conditional>{right}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="bottom" conditional>{bottom}</div>
|
|
51
|
+
</div>
|
|
52
|
+
```
|
|
34
53
|
-->
|
|
35
54
|
<script module lang="ts">
|
|
36
55
|
export interface TagsInputFieldProps {
|
|
@@ -32,7 +32,8 @@ import { type Snippet } from "svelte";
|
|
|
32
32
|
import { type SVSClass } from "./core";
|
|
33
33
|
import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps } from "./_TagsInput.svelte";
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* ### Types
|
|
36
|
+
* default value: *`(value)`*
|
|
36
37
|
* ```ts
|
|
37
38
|
* interface TagsInputFieldProps {
|
|
38
39
|
* label?: string;
|
|
@@ -63,6 +64,24 @@ import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps }
|
|
|
63
64
|
* message: string;
|
|
64
65
|
* };
|
|
65
66
|
* ```
|
|
67
|
+
* ### Anatomy
|
|
68
|
+
* ```svelte
|
|
69
|
+
* <div class="whole">
|
|
70
|
+
* <div class="top" conditional>
|
|
71
|
+
* <label class="label" conditional>
|
|
72
|
+
* {label}
|
|
73
|
+
* <span class="extra" conditional>{extra}</span>
|
|
74
|
+
* </label>
|
|
75
|
+
* <span class="aux" conditional>{aux}</span>
|
|
76
|
+
* </div>
|
|
77
|
+
* <div class="middle">
|
|
78
|
+
* <span class="left" conditional>{left}</span>
|
|
79
|
+
* <TagsInput bind:values bind:element {...deps.svsTagsInput} />
|
|
80
|
+
* <span class="right" conditional>{right}</span>
|
|
81
|
+
* </div>
|
|
82
|
+
* <div class="bottom" conditional>{bottom}</div>
|
|
83
|
+
* </div>
|
|
84
|
+
* ```
|
|
66
85
|
*/
|
|
67
86
|
declare const TagsInputField: import("svelte").Component<TagsInputFieldProps, {}, "variant" | "element" | "values">;
|
|
68
87
|
type TagsInputField = ReturnType<typeof TagsInputField>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface ToggleGroupFieldProps {
|
|
6
7
|
options: SvelteMap<string, string> | Map<string, string>;
|
|
@@ -25,6 +26,24 @@
|
|
|
25
26
|
}
|
|
26
27
|
type ToggleGroupFieldValidation = (values: string[]) => string | undefined;
|
|
27
28
|
```
|
|
29
|
+
### Anatomy
|
|
30
|
+
```svelte
|
|
31
|
+
<div class="whole">
|
|
32
|
+
<div class="top" conditional>
|
|
33
|
+
<label class="label" conditional>
|
|
34
|
+
{label}
|
|
35
|
+
<span class="extra" conditional>{extra}</span>
|
|
36
|
+
</label>
|
|
37
|
+
<span class="aux" conditional>{aux}</span>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="middle">
|
|
40
|
+
<span class="left" conditional>{left}</span>
|
|
41
|
+
<ToggleGroup {options} {multiple} {...deps.svsToggleGroup} {...restProps} bind:values />
|
|
42
|
+
<span class="right" conditional>{right}</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="bottom" conditional>{bottom}</div>
|
|
45
|
+
</div>
|
|
46
|
+
```
|
|
28
47
|
-->
|
|
29
48
|
<script module lang="ts">
|
|
30
49
|
export interface ToggleGroupFieldProps {
|
|
@@ -27,7 +27,8 @@ import { type SvelteMap } from "svelte/reactivity";
|
|
|
27
27
|
import { type SVSClass } from "./core";
|
|
28
28
|
import { type ToggleGroupProps, type ToggleGroupReqdProps, type ToggleGroupBindProps } from "./_ToggleGroup.svelte";
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* ### Types
|
|
31
|
+
* default value: *`(value)`*
|
|
31
32
|
* ```ts
|
|
32
33
|
* interface ToggleGroupFieldProps {
|
|
33
34
|
* options: SvelteMap<string, string> | Map<string, string>;
|
|
@@ -52,6 +53,24 @@ import { type ToggleGroupProps, type ToggleGroupReqdProps, type ToggleGroupBindP
|
|
|
52
53
|
* }
|
|
53
54
|
* type ToggleGroupFieldValidation = (values: string[]) => string | undefined;
|
|
54
55
|
* ```
|
|
56
|
+
* ### Anatomy
|
|
57
|
+
* ```svelte
|
|
58
|
+
* <div class="whole">
|
|
59
|
+
* <div class="top" conditional>
|
|
60
|
+
* <label class="label" conditional>
|
|
61
|
+
* {label}
|
|
62
|
+
* <span class="extra" conditional>{extra}</span>
|
|
63
|
+
* </label>
|
|
64
|
+
* <span class="aux" conditional>{aux}</span>
|
|
65
|
+
* </div>
|
|
66
|
+
* <div class="middle">
|
|
67
|
+
* <span class="left" conditional>{left}</span>
|
|
68
|
+
* <ToggleGroup {options} {multiple} {...deps.svsToggleGroup} {...restProps} bind:values />
|
|
69
|
+
* <span class="right" conditional>{right}</span>
|
|
70
|
+
* </div>
|
|
71
|
+
* <div class="bottom" conditional>{bottom}</div>
|
|
72
|
+
* </div>
|
|
73
|
+
* ```
|
|
55
74
|
*/
|
|
56
75
|
declare const ToggleGroupField: import("svelte").Component<ToggleGroupFieldProps, {}, "variant" | "elements" | "values">;
|
|
57
76
|
type ToggleGroupField = ReturnType<typeof ToggleGroupField>;
|
package/_svseeds/_Button.svelte
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface ButtonProps {
|
|
6
7
|
children: Snippet<[string]>; // Snippet<[variant]>
|
|
@@ -16,6 +17,14 @@
|
|
|
16
17
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
17
18
|
}
|
|
18
19
|
```
|
|
20
|
+
### Anatomy
|
|
21
|
+
```svelte
|
|
22
|
+
<button class="whole" {type} {onclick} {...attributes} bind:this={element} use:action>
|
|
23
|
+
<span class="left" conditional>{left}</span>
|
|
24
|
+
<span class="main">{children}</span>
|
|
25
|
+
<span class="right" conditional>{right}</span>
|
|
26
|
+
</button>
|
|
27
|
+
```
|
|
19
28
|
-->
|
|
20
29
|
<script module lang="ts">
|
|
21
30
|
export interface ButtonProps {
|
|
@@ -18,7 +18,8 @@ import { type Action } from "svelte/action";
|
|
|
18
18
|
import { type HTMLButtonAttributes, type MouseEventHandler } from "svelte/elements";
|
|
19
19
|
import { type SVSClass } from "./core";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* ### Types
|
|
22
|
+
* default value: *`(value)`*
|
|
22
23
|
* ```ts
|
|
23
24
|
* interface ButtonProps {
|
|
24
25
|
* children: Snippet<[string]>; // Snippet<[variant]>
|
|
@@ -34,6 +35,14 @@ import { type SVSClass } from "./core";
|
|
|
34
35
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
35
36
|
* }
|
|
36
37
|
* ```
|
|
38
|
+
* ### Anatomy
|
|
39
|
+
* ```svelte
|
|
40
|
+
* <button class="whole" {type} {onclick} {...attributes} bind:this={element} use:action>
|
|
41
|
+
* <span class="left" conditional>{left}</span>
|
|
42
|
+
* <span class="main">{children}</span>
|
|
43
|
+
* <span class="right" conditional>{right}</span>
|
|
44
|
+
* </button>
|
|
45
|
+
* ```
|
|
37
46
|
*/
|
|
38
47
|
declare const Button: import("svelte").Component<ButtonProps, {}, "variant" | "form" | "element">;
|
|
39
48
|
type Button = ReturnType<typeof Button>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface CheckFieldProps {
|
|
6
7
|
options: SvelteMap<string, string> | Map<string, string>;
|
|
@@ -20,6 +21,27 @@
|
|
|
20
21
|
}
|
|
21
22
|
type CheckFieldValidation = (values: string[], validity: ValidityState) => string | undefined;
|
|
22
23
|
```
|
|
24
|
+
### Anatomy
|
|
25
|
+
```svelte
|
|
26
|
+
<div class="whole">
|
|
27
|
+
<div class="top" conditional>
|
|
28
|
+
<span class="label" conditional>
|
|
29
|
+
{label}
|
|
30
|
+
<span class="extra" conditional>{extra}</span>
|
|
31
|
+
</span>
|
|
32
|
+
<span class="aux" conditional>{aux}</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="middle">
|
|
35
|
+
{#each options as { value, text }, i}
|
|
36
|
+
<label class="main">
|
|
37
|
+
<input class="left" bind:this={elements[i]} use:action />
|
|
38
|
+
<span class="right">{text}</span>
|
|
39
|
+
</label>
|
|
40
|
+
{/each}
|
|
41
|
+
</div>
|
|
42
|
+
<div class="bottom" conditional>{bottom}</div>
|
|
43
|
+
</div>
|
|
44
|
+
```
|
|
23
45
|
-->
|
|
24
46
|
<script module lang="ts">
|
|
25
47
|
export interface CheckFieldProps {
|
|
@@ -23,7 +23,8 @@ import { type SvelteMap } from "svelte/reactivity";
|
|
|
23
23
|
import { type HTMLInputAttributes } from "svelte/elements";
|
|
24
24
|
import { type SVSClass } from "./core";
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* ### Types
|
|
27
|
+
* default value: *`(value)`*
|
|
27
28
|
* ```ts
|
|
28
29
|
* interface CheckFieldProps {
|
|
29
30
|
* options: SvelteMap<string, string> | Map<string, string>;
|
|
@@ -43,6 +44,27 @@ import { type SVSClass } from "./core";
|
|
|
43
44
|
* }
|
|
44
45
|
* type CheckFieldValidation = (values: string[], validity: ValidityState) => string | undefined;
|
|
45
46
|
* ```
|
|
47
|
+
* ### Anatomy
|
|
48
|
+
* ```svelte
|
|
49
|
+
* <div class="whole">
|
|
50
|
+
* <div class="top" conditional>
|
|
51
|
+
* <span class="label" conditional>
|
|
52
|
+
* {label}
|
|
53
|
+
* <span class="extra" conditional>{extra}</span>
|
|
54
|
+
* </span>
|
|
55
|
+
* <span class="aux" conditional>{aux}</span>
|
|
56
|
+
* </div>
|
|
57
|
+
* <div class="middle">
|
|
58
|
+
* {#each options as { value, text }, i}
|
|
59
|
+
* <label class="main">
|
|
60
|
+
* <input class="left" bind:this={elements[i]} use:action />
|
|
61
|
+
* <span class="right">{text}</span>
|
|
62
|
+
* </label>
|
|
63
|
+
* {/each}
|
|
64
|
+
* </div>
|
|
65
|
+
* <div class="bottom" conditional>{bottom}</div>
|
|
66
|
+
* </div>
|
|
67
|
+
* ```
|
|
46
68
|
*/
|
|
47
69
|
declare const CheckField: import("svelte").Component<CheckFieldProps, {}, "variant" | "elements" | "values">;
|
|
48
70
|
type CheckField = ReturnType<typeof CheckField>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface ColorPickerProps {
|
|
6
7
|
value?: string; // bindable ("#000000")
|
|
@@ -12,6 +13,17 @@
|
|
|
12
13
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
13
14
|
}
|
|
14
15
|
```
|
|
16
|
+
### Anatomy
|
|
17
|
+
```svelte
|
|
18
|
+
<label class="whole">
|
|
19
|
+
<div class="middle"> // this middle element is background for transparency color
|
|
20
|
+
<div class="main"> // this main element is color sample
|
|
21
|
+
<input type="color" {...attributes} bind:value bind:this={element} use:action />
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</label>
|
|
25
|
+
```
|
|
26
|
+
### Exports
|
|
15
27
|
```ts
|
|
16
28
|
type RgbColor = [number, number, number];
|
|
17
29
|
function getHex(rgb: RgbColor): string
|
|
@@ -15,7 +15,8 @@ import { type Action } from "svelte/action";
|
|
|
15
15
|
import { type HTMLInputAttributes } from "svelte/elements";
|
|
16
16
|
import { type SVSClass } from "./core";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* ### Types
|
|
19
|
+
* default value: *`(value)`*
|
|
19
20
|
* ```ts
|
|
20
21
|
* interface ColorPickerProps {
|
|
21
22
|
* value?: string; // bindable ("#000000")
|
|
@@ -27,6 +28,17 @@ import { type SVSClass } from "./core";
|
|
|
27
28
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
28
29
|
* }
|
|
29
30
|
* ```
|
|
31
|
+
* ### Anatomy
|
|
32
|
+
* ```svelte
|
|
33
|
+
* <label class="whole">
|
|
34
|
+
* <div class="middle"> // this middle element is background for transparency color
|
|
35
|
+
* <div class="main"> // this main element is color sample
|
|
36
|
+
* <input type="color" {...attributes} bind:value bind:this={element} use:action />
|
|
37
|
+
* </div>
|
|
38
|
+
* </div>
|
|
39
|
+
* </label>
|
|
40
|
+
* ```
|
|
41
|
+
* ### Exports
|
|
30
42
|
* ```ts
|
|
31
43
|
* type RgbColor = [number, number, number];
|
|
32
44
|
* function getHex(rgb: RgbColor): string
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface ComboBoxProps {
|
|
6
7
|
options: SvelteSet<string> | Set<string>;
|
|
@@ -15,6 +16,18 @@
|
|
|
15
16
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
16
17
|
}
|
|
17
18
|
```
|
|
19
|
+
### Anatomy
|
|
20
|
+
```svelte
|
|
21
|
+
<span class="whole">
|
|
22
|
+
<input class="main" type="text" {...attributes} bind:value bind:this={element} use:action />
|
|
23
|
+
<div class="extra" conditional>{extra}</div>
|
|
24
|
+
<ul class="bottom">
|
|
25
|
+
{#each options as option}
|
|
26
|
+
<li class="label">{option}</li>
|
|
27
|
+
{/each}
|
|
28
|
+
</ul>
|
|
29
|
+
</span>
|
|
30
|
+
```
|
|
18
31
|
-->
|
|
19
32
|
<script module lang="ts">
|
|
20
33
|
export interface ComboBoxProps {
|
|
@@ -18,7 +18,8 @@ import { type SvelteSet } from "svelte/reactivity";
|
|
|
18
18
|
import { type HTMLInputAttributes } from "svelte/elements";
|
|
19
19
|
import { type SVSClass } from "./core";
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* ### Types
|
|
22
|
+
* default value: *`(value)`*
|
|
22
23
|
* ```ts
|
|
23
24
|
* interface ComboBoxProps {
|
|
24
25
|
* options: SvelteSet<string> | Set<string>;
|
|
@@ -33,6 +34,18 @@ import { type SVSClass } from "./core";
|
|
|
33
34
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
34
35
|
* }
|
|
35
36
|
* ```
|
|
37
|
+
* ### Anatomy
|
|
38
|
+
* ```svelte
|
|
39
|
+
* <span class="whole">
|
|
40
|
+
* <input class="main" type="text" {...attributes} bind:value bind:this={element} use:action />
|
|
41
|
+
* <div class="extra" conditional>{extra}</div>
|
|
42
|
+
* <ul class="bottom">
|
|
43
|
+
* {#each options as option}
|
|
44
|
+
* <li class="label">{option}</li>
|
|
45
|
+
* {/each}
|
|
46
|
+
* </ul>
|
|
47
|
+
* </span>
|
|
48
|
+
* ```
|
|
36
49
|
*/
|
|
37
50
|
declare const ComboBox: import("svelte").Component<ComboBoxProps, {}, "variant" | "expanded" | "value" | "element">;
|
|
38
51
|
type ComboBox = ReturnType<typeof ComboBox>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface ContextMenuProps {
|
|
6
7
|
children: Snippet<[string]>; // Snippet<[variant]>
|
|
@@ -12,6 +13,12 @@
|
|
|
12
13
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
13
14
|
}
|
|
14
15
|
```
|
|
16
|
+
### Anatomy
|
|
17
|
+
```svelte
|
|
18
|
+
<nav class="whole" bind:this={element}>
|
|
19
|
+
{children}
|
|
20
|
+
</nav>
|
|
21
|
+
```
|
|
15
22
|
-->
|
|
16
23
|
<script module lang="ts">
|
|
17
24
|
export interface ContextMenuProps {
|
|
@@ -12,7 +12,8 @@ export type ContextMenuBindProps = "open" | "lock" | "variant" | "element";
|
|
|
12
12
|
import { type Snippet } from "svelte";
|
|
13
13
|
import { type SVSClass } from "./core";
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* ### Types
|
|
16
|
+
* default value: *`(value)`*
|
|
16
17
|
* ```ts
|
|
17
18
|
* interface ContextMenuProps {
|
|
18
19
|
* children: Snippet<[string]>; // Snippet<[variant]>
|
|
@@ -24,6 +25,12 @@ import { type SVSClass } from "./core";
|
|
|
24
25
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
25
26
|
* }
|
|
26
27
|
* ```
|
|
28
|
+
* ### Anatomy
|
|
29
|
+
* ```svelte
|
|
30
|
+
* <nav class="whole" bind:this={element}>
|
|
31
|
+
* {children}
|
|
32
|
+
* </nav>
|
|
33
|
+
* ```
|
|
27
34
|
*/
|
|
28
35
|
declare const ContextMenu: import("svelte").Component<ContextMenuProps, {}, "variant" | "open" | "element" | "lock">;
|
|
29
36
|
type ContextMenu = ReturnType<typeof ContextMenu>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component
|
|
3
|
-
|
|
3
|
+
### Types
|
|
4
|
+
default value: *`(value)`*
|
|
4
5
|
```ts
|
|
5
6
|
interface DisclosureProps {
|
|
6
7
|
label: string | Snippet<[boolean, string]>; // Snippet<[open,variant]>
|
|
@@ -14,6 +15,17 @@
|
|
|
14
15
|
variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
15
16
|
}
|
|
16
17
|
```
|
|
18
|
+
### Anatomy
|
|
19
|
+
```svelte
|
|
20
|
+
<details class="whole" {...attributes} bind:this={element} use:action>
|
|
21
|
+
<summary class="label">
|
|
22
|
+
{label}
|
|
23
|
+
</summary>
|
|
24
|
+
<div class="main" transition:slide={{ duration }}>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
</details>
|
|
28
|
+
```
|
|
17
29
|
-->
|
|
18
30
|
<script module lang="ts">
|
|
19
31
|
export interface DisclosureProps {
|
|
@@ -16,7 +16,8 @@ import { type Action } from "svelte/action";
|
|
|
16
16
|
import { type HTMLDetailsAttributes } from "svelte/elements";
|
|
17
17
|
import { type SVSClass } from "./core";
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* ### Types
|
|
20
|
+
* default value: *`(value)`*
|
|
20
21
|
* ```ts
|
|
21
22
|
* interface DisclosureProps {
|
|
22
23
|
* label: string | Snippet<[boolean, string]>; // Snippet<[open,variant]>
|
|
@@ -30,6 +31,17 @@ import { type SVSClass } from "./core";
|
|
|
30
31
|
* variant?: string; // bindable (VARIANT.NEUTRAL)
|
|
31
32
|
* }
|
|
32
33
|
* ```
|
|
34
|
+
* ### Anatomy
|
|
35
|
+
* ```svelte
|
|
36
|
+
* <details class="whole" {...attributes} bind:this={element} use:action>
|
|
37
|
+
* <summary class="label">
|
|
38
|
+
* {label}
|
|
39
|
+
* </summary>
|
|
40
|
+
* <div class="main" transition:slide={{ duration }}>
|
|
41
|
+
* {children}
|
|
42
|
+
* </div>
|
|
43
|
+
* </details>
|
|
44
|
+
* ```
|
|
33
45
|
*/
|
|
34
46
|
declare const Disclosure: import("svelte").Component<DisclosureProps, {}, "variant" | "open" | "element">;
|
|
35
47
|
type Disclosure = ReturnType<typeof Disclosure>;
|