svseeds 0.4.7 → 0.4.8

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 +38 -39
  6. package/_svseeds/TagsInputField.svelte.d.ts +13 -13
  7. package/_svseeds/ToggleGroupField.svelte +32 -32
  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 +26 -26
  12. package/_svseeds/_CheckField.svelte.d.ts +9 -9
  13. package/_svseeds/_ColorPicker.svelte +11 -11
  14. package/_svseeds/_ColorPicker.svelte.d.ts +7 -7
  15. package/_svseeds/_ComboBox.svelte +14 -14
  16. package/_svseeds/_ComboBox.svelte.d.ts +7 -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 +14 -14
  24. package/_svseeds/_Modal.svelte.d.ts +9 -9
  25. package/_svseeds/_ProgressTracker.svelte +24 -23
  26. package/_svseeds/_ProgressTracker.svelte.d.ts +13 -13
  27. package/_svseeds/_SelectField.svelte +31 -31
  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 +21 -21
  36. package/_svseeds/_TagsInput.svelte.d.ts +9 -9
  37. package/_svseeds/_TextField.svelte +32 -32
  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
@@ -8,10 +8,10 @@
8
8
  multiple?: boolean; // (true)
9
9
  ariaDescId?: string;
10
10
  ariaErrMsgId?: string; // bindable
11
- status?: string; // bindable (STATE.NEUTRAL)
12
- style?: SVSStyle;
13
11
  action?: Action;
14
- [key: string]: unknown | Snippet<[string]>;
12
+ styling?: SVSClass;
13
+ variant?: string; // bindable (VARIANT.NEUTRAL)
14
+ [key: string]: unknown | Snippet<[string]>; // contents instead of the value
15
15
  }
16
16
  ```
17
17
  -->
@@ -22,13 +22,13 @@
22
22
  multiple?: boolean; // (true)
23
23
  ariaDescId?: string;
24
24
  ariaErrMsgId?: string; // bindable
25
- status?: string; // bindable (STATE.NEUTRAL)
26
- style?: SVSStyle;
27
25
  action?: Action;
28
- [key: string]: unknown | Snippet<[string]>;
26
+ styling?: SVSClass;
27
+ variant?: string; // bindable (VARIANT.NEUTRAL)
28
+ [key: string]: unknown | Snippet<[string]>; // contents instead of the value
29
29
  }
30
30
  export type ToggleGroupReqdProps = "options";
31
- export type ToggleGroupBindProps = "values" | "ariaErrMsgId" | "status";
31
+ export type ToggleGroupBindProps = "values" | "ariaErrMsgId" | "variant";
32
32
 
33
33
  const preset = "svs-toggle-group";
34
34
 
@@ -41,15 +41,15 @@
41
41
  import { type Snippet } from "svelte";
42
42
  import { type Action } from "svelte/action";
43
43
  import { type SvelteMap } from "svelte/reactivity";
44
- import { type SVSStyle, STATE, PARTS, fnClass } from "./core";
44
+ import { type SVSClass, VARIANT, PARTS, fnClass } from "./core";
45
45
  </script>
46
46
 
47
47
  <script lang="ts">
48
- let { options, values = $bindable([]), multiple = true, ariaDescId, ariaErrMsgId = $bindable(), status = $bindable(""), style, attributes, action, ...rest }: ToggleGroupProps = $props();
48
+ let { options, values = $bindable([]), multiple = true, ariaDescId, ariaErrMsgId = $bindable(), attributes, action, styling, variant = $bindable(""), ...rest }: ToggleGroupProps = $props();
49
49
 
50
50
  // *** Initialize *** //
51
- if (!status) status = STATE.NEUTRAL;
52
- const cls = fnClass(preset, style);
51
+ if (!variant) variant = VARIANT.NEUTRAL;
52
+ const cls = fnClass(preset, styling);
53
53
  const role = multiple ? "checkbox" : "radio";
54
54
  const roleGroup = multiple ? "group" : "radiogroup";
55
55
 
@@ -69,9 +69,9 @@
69
69
  <!---------------------------------------->
70
70
 
71
71
  {#if opts.length}
72
- <span class={cls(PARTS.WHOLE, status)} role={roleGroup} aria-describedby={ariaDescId} aria-invalid={!multiple ? invalid : undefined} aria-errormessage={!multiple ? ariaErrMsgId : undefined}>
72
+ <span class={cls(PARTS.WHOLE, variant)} role={roleGroup} aria-describedby={ariaDescId} aria-invalid={!multiple ? invalid : undefined} aria-errormessage={!multiple ? ariaErrMsgId : undefined}>
73
73
  {#each opts as { value, text, checked } (value)}
74
- {@const c = cls(PARTS.MAIN, checked ? STATE.ACTIVE : status)}
74
+ {@const c = cls(PARTS.MAIN, checked ? VARIANT.ACTIVE : variant)}
75
75
  {#if action}
76
76
  <button class={c} aria-checked={checked} aria-invalid={multiple ? invalid : undefined} aria-errormessage={multiple ? ariaErrMsgId : undefined} onclick={updateValues(value)} type="button" {role} use:action>
77
77
  {@render content(value, text)}
@@ -4,17 +4,17 @@ export interface ToggleGroupProps {
4
4
  multiple?: boolean;
5
5
  ariaDescId?: string;
6
6
  ariaErrMsgId?: string;
7
- status?: string;
8
- style?: SVSStyle;
9
7
  action?: Action;
8
+ styling?: SVSClass;
9
+ variant?: string;
10
10
  [key: string]: unknown | Snippet<[string]>;
11
11
  }
12
12
  export type ToggleGroupReqdProps = "options";
13
- export type ToggleGroupBindProps = "values" | "ariaErrMsgId" | "status";
13
+ export type ToggleGroupBindProps = "values" | "ariaErrMsgId" | "variant";
14
14
  import { type Snippet } from "svelte";
15
15
  import { type Action } from "svelte/action";
16
16
  import { type SvelteMap } from "svelte/reactivity";
17
- import { type SVSStyle } from "./core";
17
+ import { type SVSClass } from "./core";
18
18
  /**
19
19
  * default value: `(value)`
20
20
  * ```ts
@@ -24,13 +24,13 @@ import { type SVSStyle } from "./core";
24
24
  * multiple?: boolean; // (true)
25
25
  * ariaDescId?: string;
26
26
  * ariaErrMsgId?: string; // bindable
27
- * status?: string; // bindable (STATE.NEUTRAL)
28
- * style?: SVSStyle;
29
27
  * action?: Action;
30
- * [key: string]: unknown | Snippet<[string]>;
28
+ * styling?: SVSClass;
29
+ * variant?: string; // bindable (VARIANT.NEUTRAL)
30
+ * [key: string]: unknown | Snippet<[string]>; // contents instead of the value
31
31
  * }
32
32
  * ```
33
33
  */
34
- declare const ToggleGroup: import("svelte").Component<ToggleGroupProps, {}, "status" | "values" | "ariaErrMsgId">;
34
+ declare const ToggleGroup: import("svelte").Component<ToggleGroupProps, {}, "variant" | "values" | "ariaErrMsgId">;
35
35
  type ToggleGroup = ReturnType<typeof ToggleGroup>;
36
36
  export default ToggleGroup;
@@ -3,14 +3,14 @@
3
3
  default value: `(value)`
4
4
  ```ts
5
5
  interface TooltipProps {
6
- main?: Snippet<[string, string, boolean]>; // Snippet<[status,text,isFlipped]>
6
+ children?: Snippet<[string, string, boolean]>; // Snippet<[text,variant,isFlipped]>
7
7
  name?: string;
8
8
  position?: Position; // ("top")
9
9
  align?: Align; // ("center")
10
10
  offset?: Vector; // ({ x: 0, y: 0 })
11
- status?: string; // bindable (STATE.NEUTRAL)
12
- style?: SVSStyle;
13
11
  element?: HTMLDivElement; // bindable
12
+ styling?: SVSClass;
13
+ variant?: string; // bindable (VARIANT.NEUTRAL)
14
14
  }
15
15
  type Vector = { x: number, y: number };
16
16
  type Position = "top" | "left" | "bottom" | "right";
@@ -19,17 +19,17 @@
19
19
  -->
20
20
  <script module lang="ts">
21
21
  export interface TooltipProps {
22
- main?: Snippet<[string, string, boolean]>; // Snippet<[status,text,isFlipped]>
22
+ children?: Snippet<[string, string, boolean]>; // Snippet<[text,variant,isFlipped]>
23
23
  name?: string;
24
24
  position?: Position; // ("top")
25
25
  align?: Align; // ("center")
26
26
  offset?: Vector; // ({ x: 0, y: 0 })
27
- status?: string; // bindable (STATE.NEUTRAL)
28
- style?: SVSStyle;
29
27
  element?: HTMLDivElement; // bindable
28
+ styling?: SVSClass;
29
+ variant?: string; // bindable (VARIANT.NEUTRAL)
30
30
  }
31
31
  export type TooltipReqdProps = never;
32
- export type TooltipBindProps = "status" | "element";
32
+ export type TooltipBindProps = "variant" | "element";
33
33
  export function tooltip(node: HTMLElement, params: { text: string, delay?: number, cursor?: boolean, name?: string }): ActionReturn {
34
34
  return core.action(node, params.text, params.delay, params.cursor, params.name);
35
35
  }
@@ -247,15 +247,15 @@
247
247
  import { type Snippet, untrack } from "svelte";
248
248
  import { on } from "svelte/events";
249
249
  import { type Action, type ActionReturn } from "svelte/action";
250
- import { type SVSStyle, STATE, PARTS, elemId, fnClass, throttle } from "./core";
250
+ import { type SVSClass, VARIANT, PARTS, elemId, fnClass, throttle } from "./core";
251
251
  </script>
252
252
 
253
253
  <script lang="ts">
254
- let { main, name, position = "top", align = "center", offset = { ...INIT_VEC }, status = $bindable(""), style, element = $bindable() }: TooltipProps = $props();
254
+ let { children, name, position = "top", align = "center", offset = { ...INIT_VEC }, element = $bindable(), styling, variant = $bindable("") }: TooltipProps = $props();
255
255
 
256
256
  // *** Initialize *** //
257
- if (!status) status = STATE.NEUTRAL;
258
- const cls = fnClass(preset, style);
257
+ if (!variant) variant = VARIANT.NEUTRAL;
258
+ const cls = fnClass(preset, styling);
259
259
  const id = core.register(name);
260
260
  let point: Vector = $state.raw(INIT_VEC);
261
261
 
@@ -275,9 +275,9 @@
275
275
  <!---------------------------------------->
276
276
 
277
277
  {#if core.mount(id)}
278
- <div bind:this={element} class={cls(PARTS.WHOLE, status)} style={dynStyle} {id} role="tooltip">
279
- {#if main}
280
- {@render main(status, core.text, core.flipped)}
278
+ <div bind:this={element} class={cls(PARTS.WHOLE, variant)} style={dynStyle} {id} role="tooltip">
279
+ {#if children}
280
+ {@render children(core.text, variant, core.flipped)}
281
281
  {:else}
282
282
  {core.text}
283
283
  {/if}
@@ -1,15 +1,15 @@
1
1
  export interface TooltipProps {
2
- main?: Snippet<[string, string, boolean]>;
2
+ children?: Snippet<[string, string, boolean]>;
3
3
  name?: string;
4
4
  position?: Position;
5
5
  align?: Align;
6
6
  offset?: Vector;
7
- status?: string;
8
- style?: SVSStyle;
9
7
  element?: HTMLDivElement;
8
+ styling?: SVSClass;
9
+ variant?: string;
10
10
  }
11
11
  export type TooltipReqdProps = never;
12
- export type TooltipBindProps = "status" | "element";
12
+ export type TooltipBindProps = "variant" | "element";
13
13
  export declare function tooltip(node: HTMLElement, params: {
14
14
  text: string;
15
15
  delay?: number;
@@ -25,25 +25,25 @@ export type Position = "top" | "left" | "bottom" | "right";
25
25
  export type Align = "start" | "center" | "end";
26
26
  import { type Snippet } from "svelte";
27
27
  import { type Action, type ActionReturn } from "svelte/action";
28
- import { type SVSStyle } from "./core";
28
+ import { type SVSClass } from "./core";
29
29
  /**
30
30
  * default value: `(value)`
31
31
  * ```ts
32
32
  * interface TooltipProps {
33
- * main?: Snippet<[string, string, boolean]>; // Snippet<[status,text,isFlipped]>
33
+ * children?: Snippet<[string, string, boolean]>; // Snippet<[text,variant,isFlipped]>
34
34
  * name?: string;
35
35
  * position?: Position; // ("top")
36
36
  * align?: Align; // ("center")
37
37
  * offset?: Vector; // ({ x: 0, y: 0 })
38
- * status?: string; // bindable (STATE.NEUTRAL)
39
- * style?: SVSStyle;
40
38
  * element?: HTMLDivElement; // bindable
39
+ * styling?: SVSClass;
40
+ * variant?: string; // bindable (VARIANT.NEUTRAL)
41
41
  * }
42
42
  * type Vector = { x: number, y: number };
43
43
  * type Position = "top" | "left" | "bottom" | "right";
44
44
  * type Align = "start" | "center" | "end";
45
45
  * ```
46
46
  */
47
- declare const Tooltip: import("svelte").Component<TooltipProps, {}, "status" | "element">;
47
+ declare const Tooltip: import("svelte").Component<TooltipProps, {}, "variant" | "element">;
48
48
  type Tooltip = ReturnType<typeof Tooltip>;
49
49
  export default Tooltip;
@@ -1,13 +1,13 @@
1
- export { type SVSStyle, BASE, STATE, PARTS, elemId, fnClass, isNeutral, omit, debounce, throttle, UniqueId, };
1
+ export { type SVSClass, BASE, VARIANT, PARTS, elemId, fnClass, isNeutral, isUnsignedInteger, omit, debounce, throttle, UniqueId, };
2
2
  type ClassDictionary = Record<string, unknown>;
3
3
  type ClassArray = (ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined)[];
4
4
  type ClassPartialValue = string | ClassArray;
5
5
  type ClassValue = ClassPartialValue | ClassDictionary;
6
6
  type ClassRule = Record<string, ClassValue> | ClassPartialValue;
7
- type SVSStyle = Record<string, ClassRule> | string;
8
- type ClassFn = (part: string, status: string) => ClassValue | undefined;
7
+ type SVSClass = Record<string, ClassRule> | string;
8
+ type ClassFn = (part: string, variant: string) => ClassValue | undefined;
9
9
  declare const BASE = "base";
10
- declare const STATE: Readonly<{
10
+ declare const VARIANT: Readonly<{
11
11
  NEUTRAL: "neutral";
12
12
  ACTIVE: "active";
13
13
  INACTIVE: "inactive";
@@ -25,16 +25,16 @@ declare const PARTS: Readonly<{
25
25
  EXTRA: "extra";
26
26
  }>;
27
27
  /**
28
- * Creates a function that dynamically generates CSS classes based on component parts and status.
28
+ * Creates a function that dynamically generates CSS classes based on component parts and variant.
29
29
  *
30
30
  * Compatible with ClassValue type available in Svelte 5.16+ class attributes,
31
31
  * this function generates a ClassFn that returns appropriate CSS classes
32
- * based on the combination of component parts and their states.
32
+ * based on the combination of component parts and their variants.
33
33
  *
34
34
  * @param preset - Preset style definition. Can be a string or style rule object
35
35
  * @param style - Optional style definition. Takes precedence over preset when provided
36
36
  *
37
- * @returns Function that takes part and status parameters and returns ClassValue
37
+ * @returns Function that takes part and variant parameters and returns ClassValue
38
38
  *
39
39
  * @example
40
40
  * // String preset case
@@ -70,7 +70,7 @@ declare const PARTS: Readonly<{
70
70
  * const classFn = fnClass(preset, customStyle);
71
71
  * classFn("button", "active"); // ["btn", "btn-active"]
72
72
  */
73
- declare function fnClass(preset: SVSStyle, style?: SVSStyle): ClassFn;
73
+ declare function fnClass(preset: SVSClass, style?: SVSClass): ClassFn;
74
74
  /**
75
75
  * Generates unique random alphabetic ID strings with collision detection.
76
76
  * Uses a carefully selected character set of 50 letters (A-Y, a-y) to ensure
@@ -141,20 +141,37 @@ declare class UniqueId {
141
141
  }
142
142
  declare const elemId: UniqueId;
143
143
  /**
144
- * Determines whether a status is in a neutral state (neither ACTIVE nor INACTIVE).
144
+ * Determines whether a variant is in a neutral variant (neither ACTIVE nor INACTIVE).
145
145
  *
146
- * @param status - The status string to check
147
- * @returns false if the status is ACTIVE or INACTIVE, true otherwise
146
+ * @param variant - The variant string to check
147
+ * @returns false if the variant is ACTIVE or INACTIVE, true otherwise
148
148
  *
149
149
  * @example
150
150
  * ```typescript
151
- * isNeutral(STATE.NEUTRAL); // true
152
- * isNeutral("custom state"); // true
153
- * isNeutral(STATE.ACTIVE); // false
154
- * isNeutral(STATE.INACTIVE); // false
151
+ * isNeutral(VARIANT.NEUTRAL); // true
152
+ * isNeutral("custom variant"); // true
153
+ * isNeutral(VARIANT.ACTIVE); // false
154
+ * isNeutral(VARIANT.INACTIVE); // false
155
155
  * ```
156
156
  */
157
- declare function isNeutral(status: string): boolean;
157
+ declare function isNeutral(variant: string): boolean;
158
+ /**
159
+ * Checks if a given number is an unsigned integer (non-negative integer).
160
+ *
161
+ * @param num - The number to check
162
+ * @returns True if the number is an integer and greater than or equal to zero, false otherwise
163
+ *
164
+ * @example
165
+ * ```typescript
166
+ * isUnsignedInteger(5); // true
167
+ * isUnsignedInteger(0); // true
168
+ * isUnsignedInteger(-1); // false
169
+ * isUnsignedInteger(3.14); // false
170
+ * isUnsignedInteger(NaN); // false
171
+ * isUnsignedInteger(Infinity); // false
172
+ * ```
173
+ */
174
+ declare function isUnsignedInteger(num: number): boolean;
158
175
  /**
159
176
  * Creates a new object with specified keys omitted from the original object.
160
177
  * Returns an empty object if the input object is undefined or null.
package/_svseeds/core.js CHANGED
@@ -1 +1 @@
1
- export{t as BASE,e as STATE,r as PARTS,s as elemId,n as fnClass,a as isNeutral,u as omit,c as debounce,l as throttle,o as UniqueId};const t="base",e=Object.freeze({NEUTRAL:"neutral",ACTIVE:"active",INACTIVE:"inactive"}),r=Object.freeze({WHOLE:"whole",MIDDLE:"middle",MAIN:"main",TOP:"top",LEFT:"left",RIGHT:"right",BOTTOM:"bottom",LABEL:"label",AUX:"aux",EXTRA:"extra"});function n(r,n){const o=i(n)??i(r);return null==o?(t,e)=>{}:"string"==typeof o?(t,e)=>`${o} ${t} ${e}`:(r,n)=>function(r,n,i){const o=r[n]?.[t]??"",s=r[n]?.[i]??r[n]?.[e.NEUTRAL]??"";if(!o&&!s)return;return o&&s?[o,s]:o||s}(o,r,n)}function i(t){if(null==t)return;if("string"==typeof t)return t.trim()?t:void 0;const e=Object.entries(t);return e.length?Object.fromEntries(e.map((([t,e])=>null===e||"object"!=typeof e||Array.isArray(e)?[t,{base:e}]:[t,e]))):void 0}class o{static#t=[...Array.from(Array(25).keys(),(t=>t+65)),...Array.from(Array(25).keys(),(t=>t+97))];#e=new Set;#r=3;#n=1e5;get id(){return this.get(!0)}constructor(t=3,e=1e5){t>2&&(this.#r=t),(e=Math.trunc(e))>0&&e<Math.min(Math.pow(50,this.#r),Number.MAX_SAFE_INTEGER)&&(this.#n=e)}get(t){if(t)return this.#e.size>this.#n&&this.#e.clear(),this.#i()}#o(){return o.#t[Math.trunc(Math.random()*o.#t.length)]}#s(){return String.fromCharCode(...Array(this.#r).fill(null).map((()=>this.#o())))}#i(){let t=this.#s();for(;this.#e.has(t);)t=this.#s();return this.#e.add(t),t}}const s=new o;function a(t){return t!==e.ACTIVE&&t!==e.INACTIVE}function u(t,...e){if(!t)return{};const r={...t};return e.forEach((t=>delete r[t])),r}function c(t,e){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((()=>{e.call(null,...n)}),t)}}function l(t,e){let r,n=0;const i=()=>Date.now()-n,o=t=>{e.call(null,...t),n=Date.now()};return(...e)=>{if(!n)return o(e);clearTimeout(r),r=setTimeout((()=>{i()>=t&&o(e)}),t-i())}}
1
+ export{t as BASE,e as VARIANT,r as PARTS,s as elemId,n as fnClass,u as isNeutral,a as isUnsignedInteger,c as omit,l as debounce,h as throttle,o as UniqueId};const t="base",e=Object.freeze({NEUTRAL:"neutral",ACTIVE:"active",INACTIVE:"inactive"}),r=Object.freeze({WHOLE:"whole",MIDDLE:"middle",MAIN:"main",TOP:"top",LEFT:"left",RIGHT:"right",BOTTOM:"bottom",LABEL:"label",AUX:"aux",EXTRA:"extra"});function n(r,n){const o=i(n)??i(r);return null==o?(t,e)=>{}:"string"==typeof o?(t,e)=>`${o} ${t} ${e}`:(r,n)=>function(r,n,i){const o=r[n]?.[t]??"",s=r[n]?.[i]??r[n]?.[e.NEUTRAL]??"";if(!o&&!s)return;return o&&s?[o,s]:o||s}(o,r,n)}function i(t){if(null==t)return;if("string"==typeof t)return t.trim()?t:void 0;const e=Object.entries(t);return e.length?Object.fromEntries(e.map((([t,e])=>null===e||"object"!=typeof e||Array.isArray(e)?[t,{base:e}]:[t,e]))):void 0}class o{static#t=[...Array.from(Array(25).keys(),(t=>t+65)),...Array.from(Array(25).keys(),(t=>t+97))];#e=new Set;#r=3;#n=1e5;get id(){return this.get(!0)}constructor(t=3,e=1e5){t>2&&(this.#r=t),(e=Math.trunc(e))>0&&e<Math.min(Math.pow(50,this.#r),Number.MAX_SAFE_INTEGER)&&(this.#n=e)}get(t){if(t)return this.#e.size>this.#n&&this.#e.clear(),this.#i()}#o(){return o.#t[Math.trunc(Math.random()*o.#t.length)]}#s(){return String.fromCharCode(...Array(this.#r).fill(null).map((()=>this.#o())))}#i(){let t=this.#s();for(;this.#e.has(t);)t=this.#s();return this.#e.add(t),t}}const s=new o;function u(t){return t!==e.ACTIVE&&t!==e.INACTIVE}function a(t){return Number.isInteger(t)&&t>=0}function c(t,...e){if(!t)return{};const r={...t};return e.forEach((t=>delete r[t])),r}function l(t,e){let r;return(...n)=>{r&&clearTimeout(r),r=setTimeout((()=>{e.call(null,...n)}),t)}}function h(t,e){let r,n=0;const i=()=>Date.now()-n,o=t=>{e.call(null,...t),n=Date.now()};return(...e)=>{if(!n)return o(e);clearTimeout(r),r=setTimeout((()=>{i()>=t&&o(e)}),t-i())}}
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { type SVSStyle, BASE, STATE, PARTS, elemId, fnClass, isNeutral, omit, debounce, throttle, UniqueId } from "./_svseeds/core";
1
+ export { type SVSClass, BASE, VARIANT, PARTS, elemId, fnClass, isNeutral, isUnsignedInteger, omit, debounce, throttle, UniqueId } from "./_svseeds/core";
2
2
  export { default as Button, type ButtonProps, type ButtonReqdProps, type ButtonBindProps } from "./_svseeds/_Button.svelte";
3
3
  export { default as CheckField, type CheckFieldProps, type CheckFieldReqdProps, type CheckFieldBindProps, type CheckFieldValidation } from "./_svseeds/_CheckField.svelte";
4
4
  export { default as ColorPicker, type ColorPickerProps, type ColorPickerReqdProps, type ColorPickerBindProps, getHex } from "./_svseeds/_ColorPicker.svelte";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { BASE, STATE, PARTS, elemId, fnClass, isNeutral, omit, debounce, throttle, UniqueId } from "./_svseeds/core";
1
+ export { BASE, VARIANT, PARTS, elemId, fnClass, isNeutral, isUnsignedInteger, omit, debounce, throttle, UniqueId } from "./_svseeds/core";
2
2
  export { default as Button } from "./_svseeds/_Button.svelte";
3
3
  export { default as CheckField } from "./_svseeds/_CheckField.svelte";
4
4
  export { default as ColorPicker, getHex } from "./_svseeds/_ColorPicker.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svseeds",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Simple components for Svelte.",
5
5
  "type": "module",
6
6
  "main": "./index.js",