svseeds 0.4.7 → 0.4.9

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 (49) hide show
  1. package/_svseeds/Accordion.svelte +14 -14
  2. package/_svseeds/Accordion.svelte.d.ts +8 -8
  3. package/_svseeds/DarkToggle.svelte +12 -12
  4. package/_svseeds/DarkToggle.svelte.d.ts +4 -4
  5. package/_svseeds/TagsInputField.svelte +51 -41
  6. package/_svseeds/TagsInputField.svelte.d.ts +15 -13
  7. package/_svseeds/ToggleGroupField.svelte +38 -36
  8. package/_svseeds/ToggleGroupField.svelte.d.ts +13 -13
  9. package/_svseeds/_Button.svelte +20 -19
  10. package/_svseeds/_Button.svelte.d.ts +11 -11
  11. package/_svseeds/_CheckField.svelte +27 -27
  12. package/_svseeds/_CheckField.svelte.d.ts +9 -9
  13. package/_svseeds/_ColorPicker.svelte +14 -13
  14. package/_svseeds/_ColorPicker.svelte.d.ts +9 -8
  15. package/_svseeds/_ComboBox.svelte +63 -44
  16. package/_svseeds/_ComboBox.svelte.d.ts +12 -7
  17. package/_svseeds/_ContextMenu.svelte +13 -13
  18. package/_svseeds/_ContextMenu.svelte.d.ts +9 -9
  19. package/_svseeds/_Disclosure.svelte +26 -24
  20. package/_svseeds/_Disclosure.svelte.d.ts +10 -10
  21. package/_svseeds/_HotkeyCapture.svelte +14 -14
  22. package/_svseeds/_HotkeyCapture.svelte.d.ts +7 -7
  23. package/_svseeds/_Modal.svelte +17 -15
  24. package/_svseeds/_Modal.svelte.d.ts +9 -9
  25. package/_svseeds/_ProgressTracker.svelte +42 -35
  26. package/_svseeds/_ProgressTracker.svelte.d.ts +13 -13
  27. package/_svseeds/_SelectField.svelte +33 -33
  28. package/_svseeds/_SelectField.svelte.d.ts +10 -10
  29. package/_svseeds/_Slider.svelte +21 -20
  30. package/_svseeds/_Slider.svelte.d.ts +12 -12
  31. package/_svseeds/_Sortable.svelte +18 -18
  32. package/_svseeds/_Sortable.svelte.d.ts +9 -9
  33. package/_svseeds/_Tabs.svelte +20 -20
  34. package/_svseeds/_Tabs.svelte.d.ts +8 -8
  35. package/_svseeds/_TagsInput.svelte +22 -22
  36. package/_svseeds/_TagsInput.svelte.d.ts +10 -10
  37. package/_svseeds/_TextField.svelte +33 -33
  38. package/_svseeds/_TextField.svelte.d.ts +10 -10
  39. package/_svseeds/_Toggle.svelte +25 -29
  40. package/_svseeds/_Toggle.svelte.d.ts +13 -15
  41. package/_svseeds/_ToggleGroup.svelte +13 -13
  42. package/_svseeds/_ToggleGroup.svelte.d.ts +8 -8
  43. package/_svseeds/_Tooltip.svelte +14 -14
  44. package/_svseeds/_Tooltip.svelte.d.ts +9 -9
  45. package/_svseeds/core.d.ts +33 -16
  46. package/_svseeds/core.js +1 -1
  47. package/index.d.ts +1 -1
  48. package/index.js +1 -1
  49. package/package.json +1 -1
@@ -5,10 +5,10 @@
5
5
  interface AccordionProps {
6
6
  labels?: string[];
7
7
  current?: number; // bindable (-1)
8
- status?: string; // bindable (STATE.NEUTRAL)
9
- style?: SVSStyle;
8
+ styling?: SVSClass;
9
+ variant?: string; // bindable (VARIANT.NEUTRAL)
10
10
  deps?: AccordionDeps;
11
- [key: string]: unknown | Snippet; // contents of each disclosure
11
+ [key: string]: unknown | Snippet; // labels or contents of each disclosure
12
12
  }
13
13
  interface AccordionDeps {
14
14
  svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
@@ -19,16 +19,16 @@
19
19
  export interface AccordionProps {
20
20
  labels?: string[];
21
21
  current?: number; // bindable (-1)
22
- status?: string; // bindable (STATE.NEUTRAL)
23
- style?: SVSStyle;
22
+ styling?: SVSClass;
23
+ variant?: string; // bindable (VARIANT.NEUTRAL)
24
24
  deps?: AccordionDeps;
25
- [key: string]: unknown | Snippet; // contents of each disclosure
25
+ [key: string]: unknown | Snippet; // labels or contents of each disclosure
26
26
  }
27
27
  export interface AccordionDeps {
28
28
  svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
29
29
  }
30
30
  export type AccordionReqdProps = never;
31
- export type AccordionBindProps = "current" | "status";
31
+ export type AccordionBindProps = "current" | "variant";
32
32
 
33
33
  type NamedId = { id: string, name: string };
34
34
  const preset = "svs-accordion";
@@ -45,16 +45,16 @@
45
45
  }
46
46
 
47
47
  import { type Snippet, untrack } from "svelte";
48
- import { type SVSStyle, STATE, PARTS, elemId, fnClass, omit } from "./core";
48
+ import { type SVSClass, VARIANT, PARTS, elemId, fnClass, omit } from "./core";
49
49
  import Disclosure, { type DisclosureProps, type DisclosureReqdProps, type DisclosureBindProps } from "./_Disclosure.svelte";
50
50
  </script>
51
51
 
52
52
  <script lang="ts">
53
- let { labels = [], current = $bindable(-1), status = $bindable(""), style, deps, ...rest }: AccordionProps = $props();
53
+ let { labels = [], current = $bindable(-1), styling, variant = $bindable(""), deps, ...rest }: AccordionProps = $props();
54
54
 
55
55
  // *** Initialize *** //
56
- if (!status) status = STATE.NEUTRAL;
57
- const cls = fnClass(preset, style);
56
+ if (!variant) variant = VARIANT.NEUTRAL;
57
+ const cls = fnClass(preset, styling);
58
58
  const isStrLabel = labels.length > 0;
59
59
  const lbls = toNamedId(isStrLabel ? labels : getSnippetNames(roleLabel, rest));
60
60
  const panels = getSnippetNames(rolePanel, rest);
@@ -66,8 +66,8 @@
66
66
 
67
67
  // *** Initialize Deps *** //
68
68
  const svsDisclosure = {
69
- ...omit(deps?.svsDisclosure, "attributes", "style"),
70
- style: deps?.svsDisclosure?.style ?? `${preset} svs-disclosure`,
69
+ ...omit(deps?.svsDisclosure, "attributes", "styling"),
70
+ styling: deps?.svsDisclosure?.styling ?? `${preset} svs-disclosure`,
71
71
  };
72
72
 
73
73
  // *** Bind Handlers *** //
@@ -101,7 +101,7 @@
101
101
  <!---------------------------------------->
102
102
 
103
103
  {#if isValidAccordion}
104
- <div class={cls(PARTS.WHOLE, status)} role="group">
104
+ <div class={cls(PARTS.WHOLE, variant)} role="group">
105
105
  {#each lbls as { id, name }, i (id)}
106
106
  {@const ontoggle = exclusiveToggle(i)}
107
107
  <Disclosure bind:open={opens[i]} bind:element={elems[i]} label={isStrLabel ? name : (rest[name] as Snippet)} attributes={{...deps?.svsDisclosure?.attributes, ontoggle}} {...svsDisclosure}>
@@ -1,8 +1,8 @@
1
1
  export interface AccordionProps {
2
2
  labels?: string[];
3
3
  current?: number;
4
- status?: string;
5
- style?: SVSStyle;
4
+ styling?: SVSClass;
5
+ variant?: string;
6
6
  deps?: AccordionDeps;
7
7
  [key: string]: unknown | Snippet;
8
8
  }
@@ -10,9 +10,9 @@ export interface AccordionDeps {
10
10
  svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
11
11
  }
12
12
  export type AccordionReqdProps = never;
13
- export type AccordionBindProps = "current" | "status";
13
+ export type AccordionBindProps = "current" | "variant";
14
14
  import { type Snippet } from "svelte";
15
- import { type SVSStyle } from "./core";
15
+ import { type SVSClass } from "./core";
16
16
  import { type DisclosureProps, type DisclosureReqdProps, type DisclosureBindProps } from "./_Disclosure.svelte";
17
17
  /**
18
18
  * default value: `(value)`
@@ -20,16 +20,16 @@ import { type DisclosureProps, type DisclosureReqdProps, type DisclosureBindProp
20
20
  * interface AccordionProps {
21
21
  * labels?: string[];
22
22
  * current?: number; // bindable (-1)
23
- * status?: string; // bindable (STATE.NEUTRAL)
24
- * style?: SVSStyle;
23
+ * styling?: SVSClass;
24
+ * variant?: string; // bindable (VARIANT.NEUTRAL)
25
25
  * deps?: AccordionDeps;
26
- * [key: string]: unknown | Snippet; // contents of each disclosure
26
+ * [key: string]: unknown | Snippet; // labels or contents of each disclosure
27
27
  * }
28
28
  * interface AccordionDeps {
29
29
  * svsDisclosure?: Omit<DisclosureProps, DisclosureReqdProps | DisclosureBindProps>;
30
30
  * }
31
31
  * ```
32
32
  */
33
- declare const Accordion: import("svelte").Component<AccordionProps, {}, "status" | "current">;
33
+ declare const Accordion: import("svelte").Component<AccordionProps, {}, "variant" | "current">;
34
34
  type Accordion = ReturnType<typeof Accordion>;
35
35
  export default Accordion;
@@ -4,8 +4,8 @@
4
4
  ```ts
5
5
  interface DarkToggleProps {
6
6
  dark?: boolean; // bindable (prefers-color-scheme)
7
- status?: string; // bindable (STATE.NEUTRAL)
8
7
  element?: HTMLButtonElement; // bindable
8
+ variant?: string; // bindable (VARIANT.NEUTRAL)
9
9
  deps?: DarkToggleDeps;
10
10
  }
11
11
  interface DarkToggleDeps {
@@ -16,15 +16,15 @@
16
16
  <script module lang="ts">
17
17
  export interface DarkToggleProps {
18
18
  dark?: boolean; // bindable (prefers-color-scheme)
19
- status?: string; // bindable (STATE.NEUTRAL)
20
19
  element?: HTMLButtonElement; // bindable
20
+ variant?: string; // bindable (VARIANT.NEUTRAL)
21
21
  deps?: DarkToggleDeps;
22
22
  }
23
23
  export interface DarkToggleDeps {
24
24
  svsToggle?: Omit<ToggleProps, ToggleReqdProps | ToggleBindProps>;
25
25
  }
26
26
  export type DarkToggleReqdProps = never;
27
- export type DarkToggleBindProps = "dark" | "status" | "element";
27
+ export type DarkToggleBindProps = "dark" | "variant" | "element";
28
28
 
29
29
  export const THEME = { LIGHT: "light", DARK: "dark" } as const;
30
30
  export function setThemeToRoot(theme?: string) {
@@ -137,22 +137,22 @@
137
137
  }
138
138
  const theme = new Theme();
139
139
 
140
- import { STATE, omit } from "./core";
140
+ import { VARIANT, omit } from "./core";
141
141
  import Toggle, { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./_Toggle.svelte";
142
142
  </script>
143
143
 
144
144
  <script lang="ts">
145
- let { dark = $bindable(), status = $bindable(""), element = $bindable(), deps }: DarkToggleProps = $props();
145
+ let { dark = $bindable(), variant = $bindable(""), element = $bindable(), deps }: DarkToggleProps = $props();
146
146
 
147
147
  // *** Initialize *** //
148
- if (!status) status = STATE.NEUTRAL;
148
+ if (!variant) variant = VARIANT.NEUTRAL;
149
149
  if (dark === undefined) dark = theme.dark;
150
150
  theme.dark = dark;
151
151
 
152
152
  // *** Initialize Deps *** //
153
153
  const svsToggle = {
154
- ...omit(deps?.svsToggle, "main", "style", "attributes"),
155
- style: deps?.svsToggle?.style ?? `${preset} svs-toggle`,
154
+ ...omit(deps?.svsToggle, "children", "styling", "attributes"),
155
+ styling: deps?.svsToggle?.styling ?? `${preset} svs-toggle`,
156
156
  ariaLabel,
157
157
  attributes: {
158
158
  ...deps?.svsToggle?.attributes,
@@ -165,10 +165,10 @@
165
165
 
166
166
  <!---------------------------------------->
167
167
 
168
- <Toggle bind:value={dark} bind:status bind:element {...svsToggle}>
169
- {#snippet main(status: string, value: boolean, element: HTMLButtonElement | undefined)}
170
- {#if deps?.svsToggle?.main}
171
- {@render deps.svsToggle.main(status, value, element)}
168
+ <Toggle bind:value={dark} bind:variant bind:element {...svsToggle}>
169
+ {#snippet children(value: boolean, variant: string, element: HTMLButtonElement | undefined)}
170
+ {#if deps?.svsToggle?.children}
171
+ {@render deps.svsToggle.children(value, variant, element)}
172
172
  {:else}
173
173
  {#if value}
174
174
  {@render svgDark()}
@@ -1,14 +1,14 @@
1
1
  export interface DarkToggleProps {
2
2
  dark?: boolean;
3
- status?: string;
4
3
  element?: HTMLButtonElement;
4
+ variant?: string;
5
5
  deps?: DarkToggleDeps;
6
6
  }
7
7
  export interface DarkToggleDeps {
8
8
  svsToggle?: Omit<ToggleProps, ToggleReqdProps | ToggleBindProps>;
9
9
  }
10
10
  export type DarkToggleReqdProps = never;
11
- export type DarkToggleBindProps = "dark" | "status" | "element";
11
+ export type DarkToggleBindProps = "dark" | "variant" | "element";
12
12
  export declare const THEME: {
13
13
  readonly LIGHT: "light";
14
14
  readonly DARK: "dark";
@@ -20,8 +20,8 @@ import { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./
20
20
  * ```ts
21
21
  * interface DarkToggleProps {
22
22
  * dark?: boolean; // bindable (prefers-color-scheme)
23
- * status?: string; // bindable (STATE.NEUTRAL)
24
23
  * element?: HTMLButtonElement; // bindable
24
+ * variant?: string; // bindable (VARIANT.NEUTRAL)
25
25
  * deps?: DarkToggleDeps;
26
26
  * }
27
27
  * interface DarkToggleDeps {
@@ -29,6 +29,6 @@ import { type ToggleProps, type ToggleReqdProps, type ToggleBindProps } from "./
29
29
  * }
30
30
  * ```
31
31
  */
32
- declare const DarkToggle: import("svelte").Component<DarkToggleProps, {}, "status" | "element" | "dark">;
32
+ declare const DarkToggle: import("svelte").Component<DarkToggleProps, {}, "variant" | "element" | "dark">;
33
33
  type DarkToggle = ReturnType<typeof DarkToggle>;
34
34
  export default DarkToggle;
@@ -5,9 +5,9 @@
5
5
  interface TagsInputFieldProps {
6
6
  label?: string;
7
7
  extra?: string;
8
- aux?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
9
- left?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
10
- right?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
8
+ aux?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
9
+ left?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
10
+ right?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
11
11
  bottom?: string;
12
12
  descFirst?: boolean; // (false)
13
13
  values?: string[]; // bindable
@@ -15,9 +15,10 @@
15
15
  max?: TagsInputFieldCountValidation;
16
16
  constraints?: TagsInputFieldConstraint[];
17
17
  validations?: TagsInputFieldValidation[];
18
- status?: string; // bindable (STATE.NEUTRAL)
19
- style?: SVSStyle;
18
+ name?: string;
20
19
  element?: HTMLInputElement; // bindable
20
+ styling?: SVSClass;
21
+ variant?: string; // bindable (VARIANT.NEUTRAL)
21
22
  deps?: TagsInputFieldDeps;
22
23
  }
23
24
  interface TagsInputFieldDeps extends TagsInputDeps {
@@ -35,9 +36,9 @@
35
36
  export interface TagsInputFieldProps {
36
37
  label?: string;
37
38
  extra?: string;
38
- aux?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
39
- left?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
40
- right?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
39
+ aux?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
40
+ left?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
41
+ right?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
41
42
  bottom?: string;
42
43
  descFirst?: boolean; // (false)
43
44
  values?: string[]; // bindable
@@ -45,16 +46,17 @@
45
46
  max?: TagsInputFieldCountValidation;
46
47
  constraints?: TagsInputFieldConstraint[];
47
48
  validations?: TagsInputFieldValidation[];
48
- status?: string; // bindable (STATE.NEUTRAL)
49
- style?: SVSStyle;
49
+ name?: string;
50
50
  element?: HTMLInputElement; // bindable
51
+ styling?: SVSClass;
52
+ variant?: string; // bindable (VARIANT.NEUTRAL)
51
53
  deps?: TagsInputFieldDeps;
52
54
  }
53
55
  export interface TagsInputFieldDeps {
54
56
  svsTagsInput?: Omit<TagsInputProps, TagsInputReqdProps | TagsInputBindProps>;
55
57
  }
56
58
  export type TagsInputFieldReqdProps = never;
57
- export type TagsInputFieldBindProps = "values" | "status" | "element";
59
+ export type TagsInputFieldBindProps = "values" | "variant" | "element";
58
60
  export type TagsInputFieldConstraint = (value: string, validity: ValidityState) => string | undefined;
59
61
  export type TagsInputFieldValidation = (values: string[], validity: ValidityState) => string | undefined;
60
62
  export type TagsInputFieldCountValidation = { value: number, message: string };
@@ -62,32 +64,33 @@
62
64
  const preset = "svs-tags-input-field";
63
65
 
64
66
  import { type Snippet, untrack } from "svelte";
65
- import { type SVSStyle, STATE, PARTS, elemId, fnClass, isNeutral, omit } from "./core";
67
+ import { type SVSClass, VARIANT, PARTS, elemId, fnClass, isNeutral, omit } from "./core";
66
68
  import TagsInput, { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps } from "./_TagsInput.svelte";
67
69
  </script>
68
70
 
69
71
  <script lang="ts">
70
- let { label, extra, aux, left, right, bottom, descFirst = false, values = $bindable([]), min, max, constraints = [], validations = [], status = $bindable(""), style, element = $bindable(), deps }: TagsInputFieldProps = $props();
72
+ let { label, extra, aux, left, right, bottom, descFirst = false, values = $bindable([]), min, max, constraints = [], validations = [], name, element = $bindable(), styling, variant = $bindable(""), deps }: TagsInputFieldProps = $props();
71
73
 
72
74
  // *** Initialize *** //
73
- if (!status) status = STATE.NEUTRAL;
74
- const cls = fnClass(preset, style);
75
+ if (!variant) variant = VARIANT.NEUTRAL;
76
+ const cls = fnClass(preset, styling);
75
77
  const id = deps?.svsTagsInput?.attributes?.id ? deps.svsTagsInput.attributes.id : elemId.get(label?.trim());
76
78
  const idLabel = elemId.get(label?.trim());
77
79
  const idDesc = elemId.get(bottom?.trim());
78
80
  const idErr = idDesc ?? elemId.id;
79
81
  let message = $state(bottom);
80
82
  let value = $state("");
83
+ if (!name) name = deps?.svsTagsInput?.attributes?.name as string | undefined;
81
84
  if (max) constraints.unshift(() => values.length >= max.value ? max.message : "");
82
85
  if (min) validations.unshift(() => values.length < min.value ? min.message : "");
83
86
 
84
87
  // *** Initialize Deps *** //
85
88
  const svsTagsInput = {
86
- ...omit(deps?.svsTagsInput, "style", "attributes"),
89
+ ...omit(deps?.svsTagsInput, "styling", "attributes"),
87
90
  events: { onadd, onremove: deps?.svsTagsInput?.events?.onremove },
88
- style: deps?.svsTagsInput?.style ?? `${preset} svs-tags-input`,
91
+ styling: deps?.svsTagsInput?.styling ?? `${preset} svs-tags-input`,
89
92
  attributes: {
90
- ...omit(deps?.svsTagsInput?.attributes, "id", "onchange", "oninvalid", "aria-describedby"),
93
+ ...omit(deps?.svsTagsInput?.attributes, "id", "name", "onchange", "oninvalid", "aria-describedby"),
91
94
  id,
92
95
  onchange,
93
96
  oninvalid,
@@ -95,20 +98,20 @@
95
98
  },
96
99
  };
97
100
 
98
- // *** Status *** //
99
- let neutral = isNeutral(status) ? status : STATE.NEUTRAL;
100
- $effect(() => { neutral = isNeutral(status) ? status : neutral });
101
- let live = $derived(status === STATE.INACTIVE ? "alert" : "status");
102
- let idMsg = $derived(status === STATE.INACTIVE && message?.trim() ? idErr : undefined);
101
+ // *** States *** //
102
+ let neutral = isNeutral(variant) ? variant : VARIANT.NEUTRAL;
103
+ $effect(() => { neutral = isNeutral(variant) ? variant : neutral });
104
+ let live = $derived(variant === VARIANT.INACTIVE ? "alert" : "status");
105
+ let idMsg = $derived(variant === VARIANT.INACTIVE && message?.trim() ? idErr : undefined);
103
106
  function shift(oninvalid: boolean = false, msg?: string) {
104
107
  const vmsg = element?.validationMessage ?? "";
105
- status = getStatus(oninvalid, vmsg, msg);
106
- message = status === STATE.INACTIVE ? msg ? msg : vmsg ? vmsg : bottom : bottom;
108
+ variant = getStatus(oninvalid, vmsg, msg);
109
+ message = variant === VARIANT.INACTIVE ? msg ? msg : vmsg ? vmsg : bottom : bottom;
107
110
  }
108
111
  function getStatus(oninvalid: boolean, vmsg: string, msg?: string): string {
109
- if (msg || (oninvalid && vmsg)) return STATE.INACTIVE;
112
+ if (msg || (oninvalid && vmsg)) return VARIANT.INACTIVE;
110
113
  if (!values.length || vmsg) return neutral;
111
- return STATE.ACTIVE;
114
+ return VARIANT.ACTIVE;
112
115
  }
113
116
  function verify() {
114
117
  if (!element) return;
@@ -132,9 +135,9 @@
132
135
  // *** Event Handlers *** //
133
136
  function onadd(values: string[], value: string): void | boolean {
134
137
  if (deps?.svsTagsInput?.events?.onadd?.(values, value)) return true;
135
- status = neutral;
138
+ variant = neutral;
136
139
  shift(false, check());
137
- return status === STATE.INACTIVE;
140
+ return variant === VARIANT.INACTIVE;
138
141
  }
139
142
  function check(): string | undefined {
140
143
  if (!element) return;
@@ -145,7 +148,7 @@
145
148
  }
146
149
  function onchange(ev: Event) {
147
150
  deps?.svsTagsInput?.attributes?.onchange?.(ev as any);
148
- if (!isNeutral(status)) shift();
151
+ if (!isNeutral(variant)) shift();
149
152
  }
150
153
  function oninvalid(ev: Event) {
151
154
  deps?.svsTagsInput?.attributes?.oninvalid?.(ev as any);
@@ -157,19 +160,20 @@
157
160
 
158
161
  <!---------------------------------------->
159
162
 
160
- <div class={cls(PARTS.WHOLE, status)} role="group" aria-labelledby={idLabel}>
163
+ <div class={cls(PARTS.WHOLE, variant)} role="group" aria-labelledby={idLabel}>
161
164
  {#if aux}
162
- <div class={cls(PARTS.TOP, status)}>
165
+ <div class={cls(PARTS.TOP, variant)}>
163
166
  {@render lbl()}
164
- <span class={cls(PARTS.AUX, status)}>{@render aux(status, values, element)}</span>
167
+ <span class={cls(PARTS.AUX, variant)}>{@render aux(values, variant, element)}</span>
165
168
  </div>
166
169
  {:else}
167
170
  {@render lbl()}
168
171
  {/if}
169
172
  {@render desc(descFirst)}
170
- <div class={cls(PARTS.MIDDLE, status)}>
173
+ <div class={cls(PARTS.MIDDLE, variant)}>
171
174
  {@render side(PARTS.LEFT, left)}
172
- <TagsInput bind:values bind:value bind:status bind:element bind:ariaErrMsgId={idMsg} {...svsTagsInput} />
175
+ {@render fnForm()}
176
+ <TagsInput bind:values bind:value bind:variant bind:element bind:ariaErrMsgId={idMsg} {...svsTagsInput} />
173
177
  {@render side(PARTS.RIGHT, right)}
174
178
  </div>
175
179
  {@render desc(!descFirst)}
@@ -177,22 +181,28 @@
177
181
 
178
182
  {#snippet lbl()}
179
183
  {#if label?.trim()}
180
- <label class={cls(PARTS.LABEL, status)} for={id} id={idLabel}>
184
+ <label class={cls(PARTS.LABEL, variant)} for={id} id={idLabel}>
181
185
  {label}
182
186
  {#if extra?.trim()}
183
- <span class={cls(PARTS.EXTRA, status)}>{extra}</span>
187
+ <span class={cls(PARTS.EXTRA, variant)}>{extra}</span>
184
188
  {/if}
185
189
  </label>
186
190
  {/if}
187
191
  {/snippet}
188
- {#snippet side(area: string, body?: Snippet<[string, string[], HTMLInputElement | undefined]>)}
192
+ {#snippet side(area: string, body?: Snippet<[string[], string, HTMLInputElement | undefined]>)}
189
193
  {#if body}
190
- <span class={cls(area, status)}>{@render body(status, values, element)}</span>
194
+ <span class={cls(area, variant)}>{@render body(values, variant, element)}</span>
191
195
  {/if}
192
196
  {/snippet}
193
197
  {#snippet desc(show: boolean)}
194
198
  {#if show && message?.trim()}
195
- <div class={cls(PARTS.BOTTOM, status)} id={idDesc ?? idErr} role={live}>{message}</div>
199
+ <div class={cls(PARTS.BOTTOM, variant)} id={idDesc ?? idErr} role={live}>{message}</div>
200
+ {/if}
201
+ {/snippet}
202
+ {#snippet fnForm()}
203
+ {#if name}
204
+ {#each values as value}
205
+ <input type="hidden" {name} {value} />
206
+ {/each}
196
207
  {/if}
197
208
  {/snippet}
198
-
@@ -1,9 +1,9 @@
1
1
  export interface TagsInputFieldProps {
2
2
  label?: string;
3
3
  extra?: string;
4
- aux?: Snippet<[string, string[], HTMLInputElement | undefined]>;
5
- left?: Snippet<[string, string[], HTMLInputElement | undefined]>;
6
- right?: Snippet<[string, string[], HTMLInputElement | undefined]>;
4
+ aux?: Snippet<[string[], string, HTMLInputElement | undefined]>;
5
+ left?: Snippet<[string[], string, HTMLInputElement | undefined]>;
6
+ right?: Snippet<[string[], string, HTMLInputElement | undefined]>;
7
7
  bottom?: string;
8
8
  descFirst?: boolean;
9
9
  values?: string[];
@@ -11,16 +11,17 @@ export interface TagsInputFieldProps {
11
11
  max?: TagsInputFieldCountValidation;
12
12
  constraints?: TagsInputFieldConstraint[];
13
13
  validations?: TagsInputFieldValidation[];
14
- status?: string;
15
- style?: SVSStyle;
14
+ name?: string;
16
15
  element?: HTMLInputElement;
16
+ styling?: SVSClass;
17
+ variant?: string;
17
18
  deps?: TagsInputFieldDeps;
18
19
  }
19
20
  export interface TagsInputFieldDeps {
20
21
  svsTagsInput?: Omit<TagsInputProps, TagsInputReqdProps | TagsInputBindProps>;
21
22
  }
22
23
  export type TagsInputFieldReqdProps = never;
23
- export type TagsInputFieldBindProps = "values" | "status" | "element";
24
+ export type TagsInputFieldBindProps = "values" | "variant" | "element";
24
25
  export type TagsInputFieldConstraint = (value: string, validity: ValidityState) => string | undefined;
25
26
  export type TagsInputFieldValidation = (values: string[], validity: ValidityState) => string | undefined;
26
27
  export type TagsInputFieldCountValidation = {
@@ -28,7 +29,7 @@ export type TagsInputFieldCountValidation = {
28
29
  message: string;
29
30
  };
30
31
  import { type Snippet } from "svelte";
31
- import { type SVSStyle } from "./core";
32
+ import { type SVSClass } from "./core";
32
33
  import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps } from "./_TagsInput.svelte";
33
34
  /**
34
35
  * default value: `(value)`
@@ -36,9 +37,9 @@ import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps }
36
37
  * interface TagsInputFieldProps {
37
38
  * label?: string;
38
39
  * extra?: string;
39
- * aux?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
40
- * left?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
41
- * right?: Snippet<[string, string[], HTMLInputElement | undefined]>; // Snippet<[status,values,element]>
40
+ * aux?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
41
+ * left?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
42
+ * right?: Snippet<[string[], string, HTMLInputElement | undefined]>; // Snippet<[values,variant,element]>
42
43
  * bottom?: string;
43
44
  * descFirst?: boolean; // (false)
44
45
  * values?: string[]; // bindable
@@ -46,9 +47,10 @@ import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps }
46
47
  * max?: TagsInputFieldCountValidation;
47
48
  * constraints?: TagsInputFieldConstraint[];
48
49
  * validations?: TagsInputFieldValidation[];
49
- * status?: string; // bindable (STATE.NEUTRAL)
50
- * style?: SVSStyle;
50
+ * name?: string;
51
51
  * element?: HTMLInputElement; // bindable
52
+ * styling?: SVSClass;
53
+ * variant?: string; // bindable (VARIANT.NEUTRAL)
52
54
  * deps?: TagsInputFieldDeps;
53
55
  * }
54
56
  * interface TagsInputFieldDeps extends TagsInputDeps {
@@ -62,6 +64,6 @@ import { type TagsInputProps, type TagsInputReqdProps, type TagsInputBindProps }
62
64
  * };
63
65
  * ```
64
66
  */
65
- declare const TagsInputField: import("svelte").Component<TagsInputFieldProps, {}, "status" | "element" | "values">;
67
+ declare const TagsInputField: import("svelte").Component<TagsInputFieldProps, {}, "variant" | "element" | "values">;
66
68
  type TagsInputField = ReturnType<typeof TagsInputField>;
67
69
  export default TagsInputField;