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.
Files changed (47) hide show
  1. package/_svseeds/Accordion.svelte +12 -1
  2. package/_svseeds/Accordion.svelte.d.ts +12 -1
  3. package/_svseeds/DarkToggle.svelte +29 -15
  4. package/_svseeds/DarkToggle.svelte.d.ts +15 -1
  5. package/_svseeds/TagsInputField.svelte +20 -1
  6. package/_svseeds/TagsInputField.svelte.d.ts +20 -1
  7. package/_svseeds/ToggleGroupField.svelte +20 -1
  8. package/_svseeds/ToggleGroupField.svelte.d.ts +20 -1
  9. package/_svseeds/_Button.svelte +10 -1
  10. package/_svseeds/_Button.svelte.d.ts +10 -1
  11. package/_svseeds/_CheckField.svelte +23 -1
  12. package/_svseeds/_CheckField.svelte.d.ts +23 -1
  13. package/_svseeds/_ColorPicker.svelte +13 -1
  14. package/_svseeds/_ColorPicker.svelte.d.ts +13 -1
  15. package/_svseeds/_ComboBox.svelte +14 -1
  16. package/_svseeds/_ComboBox.svelte.d.ts +14 -1
  17. package/_svseeds/_ContextMenu.svelte +8 -1
  18. package/_svseeds/_ContextMenu.svelte.d.ts +8 -1
  19. package/_svseeds/_Disclosure.svelte +13 -1
  20. package/_svseeds/_Disclosure.svelte.d.ts +13 -1
  21. package/_svseeds/_Drawer.svelte +11 -4
  22. package/_svseeds/_Drawer.svelte.d.ts +8 -1
  23. package/_svseeds/_HotkeyCapture.svelte +6 -1
  24. package/_svseeds/_HotkeyCapture.svelte.d.ts +6 -1
  25. package/_svseeds/_Modal.svelte +10 -1
  26. package/_svseeds/_Modal.svelte.d.ts +10 -1
  27. package/_svseeds/_ProgressTracker.svelte +16 -1
  28. package/_svseeds/_ProgressTracker.svelte.d.ts +16 -1
  29. package/_svseeds/_SelectField.svelte +24 -1
  30. package/_svseeds/_SelectField.svelte.d.ts +24 -1
  31. package/_svseeds/_Slider.svelte +15 -1
  32. package/_svseeds/_Slider.svelte.d.ts +15 -1
  33. package/_svseeds/_Sortable.svelte +13 -1
  34. package/_svseeds/_Sortable.svelte.d.ts +13 -1
  35. package/_svseeds/_Tabs.svelte +15 -1
  36. package/_svseeds/_Tabs.svelte.d.ts +15 -1
  37. package/_svseeds/_TagsInput.svelte +26 -1
  38. package/_svseeds/_TagsInput.svelte.d.ts +26 -1
  39. package/_svseeds/_TextField.svelte +29 -1
  40. package/_svseeds/_TextField.svelte.d.ts +29 -1
  41. package/_svseeds/_Toggle.svelte +12 -1
  42. package/_svseeds/_Toggle.svelte.d.ts +12 -1
  43. package/_svseeds/_ToggleGroup.svelte +12 -1
  44. package/_svseeds/_ToggleGroup.svelte.d.ts +12 -1
  45. package/_svseeds/_Tooltip.svelte +12 -1
  46. package/_svseeds/_Tooltip.svelte.d.ts +12 -1
  47. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface DrawerProps {
6
7
  children: Snippet<[string]>; // Snippet<[variant]>
@@ -17,6 +18,12 @@
17
18
  }
18
19
  type Position = "top" | "right" | "bottom" | "left";
19
20
  ```
21
+ ### Anatomy
22
+ ```svelte
23
+ <div class="whole" {id} {...attributes} bind:this={element}>
24
+ {children}
25
+ </div>
26
+ ```
20
27
  -->
21
28
  <script module lang="ts">
22
29
  export interface DrawerProps {
@@ -50,8 +57,8 @@
50
57
  function getSizeProp(position: Position, size: string): string {
51
58
  const interpolate = ["auto", "min-content", "max-content", "fit-content", "content"].includes(size) ? "interpolate-size:allow-keywords;" : "";
52
59
  return ["top", "bottom"].includes(position)
53
- ? `--width-from:100dvw;--width-to:100dvw;--height-from:0;--height-to:${size};${interpolate}`
54
- : `--width-from:0;--width-to:${size};--height-from:100dvh;--height-to:100dvh;${interpolate}`;
60
+ ? `--width-from:100%;--width-to:100%;--height-from:0;--height-to:${size};${interpolate}`
61
+ : `--width-from:0;--width-to:${size};--height-from:100%;--height-to:100%;${interpolate}`;
55
62
  }
56
63
 
57
64
  import { type Snippet, untrack } from "svelte";
@@ -101,7 +108,7 @@
101
108
 
102
109
  <style>
103
110
  [popover] {
104
- position: absolute;
111
+ position: fixed;
105
112
  top: var(--top);
106
113
  left: var(--left);
107
114
  bottom: var(--bottom);
@@ -18,7 +18,8 @@ import { type Snippet } from "svelte";
18
18
  import { type HTMLAttributes } from "svelte/elements";
19
19
  import { type SVSClass } from "./core";
20
20
  /**
21
- * default value: `(value)`
21
+ * ### Types
22
+ * default value: *`(value)`*
22
23
  * ```ts
23
24
  * interface DrawerProps {
24
25
  * children: Snippet<[string]>; // Snippet<[variant]>
@@ -35,6 +36,12 @@ import { type SVSClass } from "./core";
35
36
  * }
36
37
  * type Position = "top" | "right" | "bottom" | "left";
37
38
  * ```
39
+ * ### Anatomy
40
+ * ```svelte
41
+ * <div class="whole" {id} {...attributes} bind:this={element}>
42
+ * {children}
43
+ * </div>
44
+ * ```
38
45
  */
39
46
  declare const Drawer: import("svelte").Component<DrawerProps, {}, "variant" | "open" | "element">;
40
47
  type Drawer = ReturnType<typeof Drawer>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface HotkeyCaptureProps {
6
7
  value?: string; // bindable
@@ -12,6 +13,10 @@
12
13
  variant?: string; // bindable (VARIANT.NEUTRAL)
13
14
  }
14
15
  ```
16
+ ### Anatomy
17
+ ```svelte
18
+ <input class="main" type="text" {placeholder} {disabled} bind:value bind:this={element} />
19
+ ```
15
20
  -->
16
21
  <script module lang="ts">
17
22
  export interface HotkeyCaptureProps {
@@ -11,7 +11,8 @@ export type HotkeyCaptureReqdProps = never;
11
11
  export type HotkeyCaptureBindProps = "value" | "active" | "disable" | "variant" | "element";
12
12
  import { type SVSClass } from "./core";
13
13
  /**
14
- * default value: `(value)`
14
+ * ### Types
15
+ * default value: *`(value)`*
15
16
  * ```ts
16
17
  * interface HotkeyCaptureProps {
17
18
  * value?: string; // bindable
@@ -23,6 +24,10 @@ import { type SVSClass } from "./core";
23
24
  * variant?: string; // bindable (VARIANT.NEUTRAL)
24
25
  * }
25
26
  * ```
27
+ * ### Anatomy
28
+ * ```svelte
29
+ * <input class="main" type="text" {placeholder} {disabled} bind:value bind:this={element} />
30
+ * ```
26
31
  */
27
32
  declare const HotkeyCapture: import("svelte").Component<HotkeyCaptureProps, {}, "variant" | "active" | "value" | "disabled" | "element">;
28
33
  type HotkeyCapture = ReturnType<typeof HotkeyCapture>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface ModalProps {
6
7
  children: Snippet<[string]>; // Snippet<[variant]>
@@ -14,6 +15,14 @@
14
15
  variant?: string; // bindable (VARIANT.NEUTRAL)
15
16
  }
16
17
  ```
18
+ ### Anatomy
19
+ ```svelte
20
+ <dialog class="whole" {id} aria-label={ariaLabel} {...attributes} bind:this={element}>
21
+ <div class="main">
22
+ {children}
23
+ </div>
24
+ </dialog>
25
+ ```
17
26
  -->
18
27
  <script module lang="ts">
19
28
  export interface ModalProps {
@@ -15,7 +15,8 @@ import { type Snippet } from "svelte";
15
15
  import { type HTMLDialogAttributes } from "svelte/elements";
16
16
  import { type SVSClass } from "./core";
17
17
  /**
18
- * default value: `(value)`
18
+ * ### Types
19
+ * default value: *`(value)`*
19
20
  * ```ts
20
21
  * interface ModalProps {
21
22
  * children: Snippet<[string]>; // Snippet<[variant]>
@@ -29,6 +30,14 @@ import { type SVSClass } from "./core";
29
30
  * variant?: string; // bindable (VARIANT.NEUTRAL)
30
31
  * }
31
32
  * ```
33
+ * ### Anatomy
34
+ * ```svelte
35
+ * <dialog class="whole" {id} aria-label={ariaLabel} {...attributes} bind:this={element}>
36
+ * <div class="main">
37
+ * {children}
38
+ * </div>
39
+ * </dialog>
40
+ * ```
32
41
  */
33
42
  declare const Modal: import("svelte").Component<ModalProps, {}, "variant" | "open" | "element">;
34
43
  type Modal = ReturnType<typeof Modal>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface ProgressTrackerProps {
6
7
  current: number; // bindable (0)
@@ -13,6 +14,20 @@
13
14
  eachVariant?: SvelteMap<number, string> | Map<number, string>;
14
15
  }
15
16
  ```
17
+ ### Anatomy
18
+ ```svelte
19
+ <ol class="whole">
20
+ {#each labels as label}
21
+ <li class="middle">
22
+ <div class="main">
23
+ <div class="aux" conditional>{aux}</div>
24
+ <div class="label">{label} or {children}</div>
25
+ </div>
26
+ <div class="extra" conditional>{extra}</div>
27
+ </li>
28
+ {/each}
29
+ </ol>
30
+ ```
16
31
  -->
17
32
  <script module lang="ts">
18
33
  export interface ProgressTrackerProps {
@@ -14,7 +14,8 @@ import { type Snippet } from "svelte";
14
14
  import { type SvelteMap } from "svelte/reactivity";
15
15
  import { type SVSClass } from "./core";
16
16
  /**
17
- * default value: `(value)`
17
+ * ### Types
18
+ * default value: *`(value)`*
18
19
  * ```ts
19
20
  * interface ProgressTrackerProps {
20
21
  * current: number; // bindable (0)
@@ -27,6 +28,20 @@ import { type SVSClass } from "./core";
27
28
  * eachVariant?: SvelteMap<number, string> | Map<number, string>;
28
29
  * }
29
30
  * ```
31
+ * ### Anatomy
32
+ * ```svelte
33
+ * <ol class="whole">
34
+ * {#each labels as label}
35
+ * <li class="middle">
36
+ * <div class="main">
37
+ * <div class="aux" conditional>{aux}</div>
38
+ * <div class="label">{label} or {children}</div>
39
+ * </div>
40
+ * <div class="extra" conditional>{extra}</div>
41
+ * </li>
42
+ * {/each}
43
+ * </ol>
44
+ * ```
30
45
  */
31
46
  declare const ProgressTracker: import("svelte").Component<ProgressTrackerProps, {}, "variant" | "current">;
32
47
  type ProgressTracker = ReturnType<typeof ProgressTracker>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface SelectFieldProps {
6
7
  options: SvelteMap<string, string> | Map<string, string>;
@@ -21,6 +22,28 @@
21
22
  }
22
23
  type SelectFieldValidation = (value: string, validity: ValidityState) => string | undefined;
23
24
  ```
25
+ ### Anatomy
26
+ ```svelte
27
+ <div class="whole">
28
+ <div class="top" conditional>
29
+ <label class="label" conditional>
30
+ {label}
31
+ <span class="extra" conditional>{extra}</span>
32
+ </label>
33
+ <span class="aux" conditional>{aux}</span>
34
+ </div>
35
+ <div class="middle">
36
+ <span class="left" conditional>{left}</span>
37
+ <select class="main" {...attributes} bind:value bind:this={element} use:action>
38
+ {#each options as { option, text }}
39
+ <option value={option}>{text}</option>
40
+ {/each}
41
+ </select>
42
+ <span class="right" conditional>{right}</span>
43
+ </div>
44
+ <div class="bottom" conditional>{bottom}</div>
45
+ </div>
46
+ ```
24
47
  -->
25
48
  <script module lang="ts">
26
49
  export interface SelectFieldProps {
@@ -24,7 +24,8 @@ import { type SvelteMap } from "svelte/reactivity";
24
24
  import { type HTMLSelectAttributes } from "svelte/elements";
25
25
  import { type SVSClass } from "./core";
26
26
  /**
27
- * default value: `(value)`
27
+ * ### Types
28
+ * default value: *`(value)`*
28
29
  * ```ts
29
30
  * interface SelectFieldProps {
30
31
  * options: SvelteMap<string, string> | Map<string, string>;
@@ -45,6 +46,28 @@ import { type SVSClass } from "./core";
45
46
  * }
46
47
  * type SelectFieldValidation = (value: string, validity: ValidityState) => string | undefined;
47
48
  * ```
49
+ * ### Anatomy
50
+ * ```svelte
51
+ * <div class="whole">
52
+ * <div class="top" conditional>
53
+ * <label class="label" conditional>
54
+ * {label}
55
+ * <span class="extra" conditional>{extra}</span>
56
+ * </label>
57
+ * <span class="aux" conditional>{aux}</span>
58
+ * </div>
59
+ * <div class="middle">
60
+ * <span class="left" conditional>{left}</span>
61
+ * <select class="main" {...attributes} bind:value bind:this={element} use:action>
62
+ * {#each options as { option, text }}
63
+ * <option value={option}>{text}</option>
64
+ * {/each}
65
+ * </select>
66
+ * <span class="right" conditional>{right}</span>
67
+ * </div>
68
+ * <div class="bottom" conditional>{bottom}</div>
69
+ * </div>
70
+ * ```
48
71
  */
49
72
  declare const SelectField: import("svelte").Component<SelectFieldProps, {}, "variant" | "value" | "element">;
50
73
  type SelectField = ReturnType<typeof SelectField>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface SliderProps {
6
7
  range: Range; // bindable
@@ -18,6 +19,19 @@
18
19
  }
19
20
  type Range = { min: number, max: number };
20
21
  ```
22
+ ### Anatomy
23
+ ```svelte
24
+ <span class={cls(PARTS.WHOLE, variant)}>
25
+ <span class="left">{left}</span>
26
+ <input class="main" type="range" min={range.min} max={range.max} {step} {...attrs} bind:value bind:this={element} use:action />
27
+ <datalist conditional>
28
+ {#each options as option}
29
+ <option value={option}></option>
30
+ {/each}
31
+ </datalist>
32
+ <span class="right" conditional>{right}</span>
33
+ </span>
34
+ ```
21
35
  -->
22
36
  <script module lang="ts">
23
37
  export interface SliderProps {
@@ -24,7 +24,8 @@ import { type SvelteSet } from "svelte/reactivity";
24
24
  import { type HTMLInputAttributes } from "svelte/elements";
25
25
  import { type SVSClass } from "./core";
26
26
  /**
27
- * default value: `(value)`
27
+ * ### Types
28
+ * default value: *`(value)`*
28
29
  * ```ts
29
30
  * interface SliderProps {
30
31
  * range: Range; // bindable
@@ -42,6 +43,19 @@ import { type SVSClass } from "./core";
42
43
  * }
43
44
  * type Range = { min: number, max: number };
44
45
  * ```
46
+ * ### Anatomy
47
+ * ```svelte
48
+ * <span class={cls(PARTS.WHOLE, variant)}>
49
+ * <span class="left">{left}</span>
50
+ * <input class="main" type="range" min={range.min} max={range.max} {step} {...attrs} bind:value bind:this={element} use:action />
51
+ * <datalist conditional>
52
+ * {#each options as option}
53
+ * <option value={option}></option>
54
+ * {/each}
55
+ * </datalist>
56
+ * <span class="right" conditional>{right}</span>
57
+ * </span>
58
+ * ```
45
59
  */
46
60
  declare const Slider: import("svelte").Component<SliderProps, {}, "variant" | "value" | "range" | "element">;
47
61
  type Slider = ReturnType<typeof Slider>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface SortableProps {
6
7
  items: SortableItems; // wrapper around string array to handle drag and drop
@@ -17,6 +18,17 @@
17
18
  styling?: SVSClass;
18
19
  variant?: string; // bindable (VARIANT.NEUTRAL)
19
20
  }
21
+ ```
22
+ ### Anatomy
23
+ ```svelte
24
+ <ul class="whole">
25
+ {#each items.values as value, i}
26
+ <li class="main">{item(value)}</li>
27
+ {/each}
28
+ </ul>
29
+ ```
30
+ ### Exports
31
+ ```ts
20
32
  // Methods have the same functionality as standard array methods
21
33
  class SortableItems {
22
34
  constructor(values: string[])
@@ -58,7 +58,8 @@ type DragState = "ready" | "dragging" | "idle";
58
58
  import { type Snippet } from "svelte";
59
59
  import { type SVSClass } from "./core";
60
60
  /**
61
- * default value: `(value)`
61
+ * ### Types
62
+ * default value: *`(value)`*
62
63
  * ```ts
63
64
  * interface SortableProps {
64
65
  * items: SortableItems; // wrapper around string array to handle drag and drop
@@ -75,6 +76,17 @@ import { type SVSClass } from "./core";
75
76
  * styling?: SVSClass;
76
77
  * variant?: string; // bindable (VARIANT.NEUTRAL)
77
78
  * }
79
+ * ```
80
+ * ### Anatomy
81
+ * ```svelte
82
+ * <ul class="whole">
83
+ * {#each items.values as value, i}
84
+ * <li class="main">{item(value)}</li>
85
+ * {/each}
86
+ * </ul>
87
+ * ```
88
+ * ### Exports
89
+ * ```ts
78
90
  * // Methods have the same functionality as standard array methods
79
91
  * class SortableItems {
80
92
  * constructor(values: string[])
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface TabsProps {
6
7
  labels?: string[];
@@ -11,6 +12,19 @@
11
12
  [key: string]: unknown | Snippet; // labels or contents of each tab
12
13
  }
13
14
  ```
15
+ ### Anatomy
16
+ ```svelte
17
+ <div class="whole">
18
+ <div class="top" aria-orientation={ariaOrientation}>
19
+ {#each labels as label}
20
+ <button class="label">{label}</button>
21
+ {/each}
22
+ </div>
23
+ {#each restProps as snippet}
24
+ <div class="main">{snippet}</div>
25
+ {/each}
26
+ </div>
27
+ ```
14
28
  -->
15
29
  <script module lang="ts">
16
30
  export interface TabsProps {
@@ -11,7 +11,8 @@ export type TabsBindProps = "current" | "variant";
11
11
  import { type Snippet } from "svelte";
12
12
  import { type SVSClass } from "./core";
13
13
  /**
14
- * default value: `(value)`
14
+ * ### Types
15
+ * default value: *`(value)`*
15
16
  * ```ts
16
17
  * interface TabsProps {
17
18
  * labels?: string[];
@@ -22,6 +23,19 @@ import { type SVSClass } from "./core";
22
23
  * [key: string]: unknown | Snippet; // labels or contents of each tab
23
24
  * }
24
25
  * ```
26
+ * ### Anatomy
27
+ * ```svelte
28
+ * <div class="whole">
29
+ * <div class="top" aria-orientation={ariaOrientation}>
30
+ * {#each labels as label}
31
+ * <button class="label">{label}</button>
32
+ * {/each}
33
+ * </div>
34
+ * {#each restProps as snippet}
35
+ * <div class="main">{snippet}</div>
36
+ * {/each}
37
+ * </div>
38
+ * ```
25
39
  */
26
40
  declare const Tabs: import("svelte").Component<TabsProps, {}, "variant" | "current">;
27
41
  type Tabs = ReturnType<typeof Tabs>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface TagsInputProps {
6
7
  label?: Snippet<[string, string]>; // Snippet<[value,variant]>
@@ -24,6 +25,30 @@
24
25
  onremove?: (values: string[], value: string, index: number) => void | boolean;
25
26
  }
26
27
  ```
28
+ ### Anatomy
29
+ ```svelte
30
+ <div class="whole">
31
+ <span class="aux" conditional>
32
+ {#each values as text, i}
33
+ <span class="label">
34
+ {#if label}
35
+ {label}
36
+ {:else}
37
+ {text}
38
+ {/if}
39
+ <button class="extra">
40
+ {#if extra}
41
+ {extra}
42
+ {:else}
43
+ // Default Icon
44
+ {/if}
45
+ </button>
46
+ </span>
47
+ {/each}
48
+ </span>
49
+ <input class="main" type="text" {...attributes} aria-errormessage={ariaErrMsgId} bind:value bind:this={element} use:action />
50
+ </div>
51
+ ```
27
52
  -->
28
53
  <script module lang="ts">
29
54
  export interface TagsInputProps {
@@ -26,7 +26,8 @@ import { type Action } from "svelte/action";
26
26
  import { type HTMLInputAttributes } from "svelte/elements";
27
27
  import { type SVSClass } from "./core";
28
28
  /**
29
- * default value: `(value)`
29
+ * ### Types
30
+ * default value: *`(value)`*
30
31
  * ```ts
31
32
  * interface TagsInputProps {
32
33
  * label?: Snippet<[string, string]>; // Snippet<[value,variant]>
@@ -50,6 +51,30 @@ import { type SVSClass } from "./core";
50
51
  * onremove?: (values: string[], value: string, index: number) => void | boolean;
51
52
  * }
52
53
  * ```
54
+ * ### Anatomy
55
+ * ```svelte
56
+ * <div class="whole">
57
+ * <span class="aux" conditional>
58
+ * {#each values as text, i}
59
+ * <span class="label">
60
+ * {#if label}
61
+ * {label}
62
+ * {:else}
63
+ * {text}
64
+ * {/if}
65
+ * <button class="extra">
66
+ * {#if extra}
67
+ * {extra}
68
+ * {:else}
69
+ * // Default Icon
70
+ * {/if}
71
+ * </button>
72
+ * </span>
73
+ * {/each}
74
+ * </span>
75
+ * <input class="main" type="text" {...attributes} aria-errormessage={ariaErrMsgId} bind:value bind:this={element} use:action />
76
+ * </div>
77
+ * ```
53
78
  */
54
79
  declare const TagsInput: import("svelte").Component<TagsInputProps, {}, "variant" | "value" | "element" | "values" | "ariaErrMsgId">;
55
80
  type TagsInput = ReturnType<typeof TagsInput>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface TextFieldProps {
6
7
  label?: string;
@@ -22,6 +23,33 @@
22
23
  }
23
24
  type TextFieldValidation = (value: string, validity: ValidityState) => string | undefined;
24
25
  ```
26
+ ### Anatomy
27
+ ```svelte
28
+ <div class="whole">
29
+ <div class="top" conditional>
30
+ <label class="label" conditional>
31
+ {label}
32
+ <span class="extra" conditional>{extra}</span>
33
+ </label>
34
+ <span class="aux" conditional>{aux}</span>
35
+ </div>
36
+ <div class="middle">
37
+ <span class="left" conditional>{left}</span>
38
+ {#if type === "area"}
39
+ <textarea class={"main"} {...attributes} bind:value bind:this={element} use:action></textarea>
40
+ {:else}
41
+ <input class={"main"} {type} {...attributes} bind:value bind:this={element} use:action />
42
+ <datalist conditional>
43
+ {#each options as option}
44
+ <option value={option}></option>
45
+ {/each}
46
+ </datalist>
47
+ {/if}
48
+ <span class="right" conditional>{right}</span>
49
+ </div>
50
+ <div class="bottom" conditional>{bottom}</div>
51
+ </div>
52
+ ```
25
53
  -->
26
54
  <script module lang="ts">
27
55
  export interface TextFieldProps {
@@ -25,7 +25,8 @@ import { type SvelteSet } from "svelte/reactivity";
25
25
  import { type HTMLInputAttributes, type HTMLTextareaAttributes } from "svelte/elements";
26
26
  import { type SVSClass } from "./core";
27
27
  /**
28
- * default value: `(value)`
28
+ * ### Types
29
+ * default value: *`(value)`*
29
30
  * ```ts
30
31
  * interface TextFieldProps {
31
32
  * label?: string;
@@ -47,6 +48,33 @@ import { type SVSClass } from "./core";
47
48
  * }
48
49
  * type TextFieldValidation = (value: string, validity: ValidityState) => string | undefined;
49
50
  * ```
51
+ * ### Anatomy
52
+ * ```svelte
53
+ * <div class="whole">
54
+ * <div class="top" conditional>
55
+ * <label class="label" conditional>
56
+ * {label}
57
+ * <span class="extra" conditional>{extra}</span>
58
+ * </label>
59
+ * <span class="aux" conditional>{aux}</span>
60
+ * </div>
61
+ * <div class="middle">
62
+ * <span class="left" conditional>{left}</span>
63
+ * {#if type === "area"}
64
+ * <textarea class={"main"} {...attributes} bind:value bind:this={element} use:action></textarea>
65
+ * {:else}
66
+ * <input class={"main"} {type} {...attributes} bind:value bind:this={element} use:action />
67
+ * <datalist conditional>
68
+ * {#each options as option}
69
+ * <option value={option}></option>
70
+ * {/each}
71
+ * </datalist>
72
+ * {/if}
73
+ * <span class="right" conditional>{right}</span>
74
+ * </div>
75
+ * <div class="bottom" conditional>{bottom}</div>
76
+ * </div>
77
+ * ```
50
78
  */
51
79
  declare const TextField: import("svelte").Component<TextFieldProps, {}, "variant" | "type" | "value" | "element">;
52
80
  type TextField = ReturnType<typeof TextField>;
@@ -1,6 +1,7 @@
1
1
  <!--
2
2
  @component
3
- default value: `(value)`
3
+ ### Types
4
+ default value: *`(value)`*
4
5
  ```ts
5
6
  interface ToggleProps {
6
7
  children: Snippet<[boolean, string, HTMLButtonElement | undefined]>; // Snippet<[value,variant,element]>
@@ -16,6 +17,16 @@
16
17
  variant?: string; // bindable (VARIANT.NEUTRAL)
17
18
  }
18
19
  ```
20
+ ### Anatomy
21
+ ```svelte
22
+ <span class="whole" conditional>
23
+ <span class="left" conditional>{left}</span>
24
+ <button class="main" aria-pressed={value} aria-label={ariaLabel} {role} {...attributes} bind:this={element} use:action>
25
+ {children}
26
+ </button>
27
+ <span class="right" conditional>{right}</span>
28
+ </span>
29
+ ```
19
30
  -->
20
31
  <script module lang="ts">
21
32
  export interface ToggleProps {