ui-ingredients 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/README.md +75 -75
  2. package/dist/accordion/item-content.svelte +22 -13
  3. package/dist/accordion/item-indicator.svelte +22 -13
  4. package/dist/accordion/item-trigger.svelte +22 -13
  5. package/dist/accordion/item.svelte +35 -24
  6. package/dist/accordion/root.svelte +61 -40
  7. package/dist/avatar/fallback.svelte +21 -12
  8. package/dist/avatar/image.svelte +19 -10
  9. package/dist/avatar/root.svelte +46 -29
  10. package/dist/carousel/indicator-group.svelte +21 -12
  11. package/dist/carousel/indicator.svelte +31 -20
  12. package/dist/carousel/item-group.svelte +21 -12
  13. package/dist/carousel/item.svelte +22 -12
  14. package/dist/carousel/next-trigger.svelte +21 -12
  15. package/dist/carousel/prev-trigger.svelte +21 -12
  16. package/dist/carousel/root.svelte +58 -40
  17. package/dist/carousel/viewport.svelte +21 -12
  18. package/dist/checkbox/control.svelte +21 -12
  19. package/dist/checkbox/hidden-input.svelte +19 -10
  20. package/dist/checkbox/indicator.svelte +21 -12
  21. package/dist/checkbox/label.svelte +21 -12
  22. package/dist/checkbox/root.svelte +62 -44
  23. package/dist/clipboard/control.svelte +21 -12
  24. package/dist/clipboard/indicator.svelte +23 -12
  25. package/dist/clipboard/input.svelte +19 -10
  26. package/dist/clipboard/label.svelte +21 -12
  27. package/dist/clipboard/root.svelte +51 -30
  28. package/dist/clipboard/trigger.svelte +21 -12
  29. package/dist/collapsible/content.svelte +21 -12
  30. package/dist/collapsible/root.svelte +57 -36
  31. package/dist/collapsible/trigger.svelte +19 -12
  32. package/dist/combobox/clear-trigger.svelte +21 -12
  33. package/dist/combobox/content.svelte +21 -12
  34. package/dist/combobox/control.svelte +21 -12
  35. package/dist/combobox/input.svelte +19 -10
  36. package/dist/combobox/item-group-label.svelte +29 -20
  37. package/dist/combobox/item-group.svelte +26 -14
  38. package/dist/combobox/item-indicator.svelte +22 -13
  39. package/dist/combobox/item-text.svelte +26 -17
  40. package/dist/combobox/item.svelte +35 -24
  41. package/dist/combobox/label.svelte +21 -12
  42. package/dist/combobox/list.svelte +21 -12
  43. package/dist/combobox/positioner.svelte +21 -12
  44. package/dist/combobox/root.svelte +122 -104
  45. package/dist/combobox/trigger.svelte +21 -12
  46. package/dist/dialog/backdrop.svelte +21 -12
  47. package/dist/dialog/close-trigger.svelte +21 -12
  48. package/dist/dialog/content.svelte +21 -12
  49. package/dist/dialog/description.svelte +21 -12
  50. package/dist/dialog/positioner.svelte +21 -12
  51. package/dist/dialog/root.svelte +22 -10
  52. package/dist/dialog/title.svelte +21 -12
  53. package/dist/dialog/trigger.svelte +21 -12
  54. package/dist/hover-card/arrow-tip.svelte +21 -12
  55. package/dist/hover-card/arrow.svelte +21 -12
  56. package/dist/hover-card/content.svelte +21 -12
  57. package/dist/hover-card/positioner.svelte +21 -12
  58. package/dist/hover-card/root.svelte +25 -10
  59. package/dist/hover-card/trigger.svelte +21 -12
  60. package/dist/number-input/control.svelte +21 -12
  61. package/dist/number-input/decrement-trigger.svelte +22 -12
  62. package/dist/number-input/increment-trigger.svelte +22 -12
  63. package/dist/number-input/input.svelte +19 -10
  64. package/dist/number-input/label.svelte +21 -12
  65. package/dist/number-input/root.svelte +93 -72
  66. package/dist/number-input/scrubber.svelte +21 -12
  67. package/dist/pagination/ellipsis.svelte +23 -12
  68. package/dist/pagination/item.svelte +31 -20
  69. package/dist/pagination/next-trigger.svelte +21 -12
  70. package/dist/pagination/prev-trigger.svelte +21 -12
  71. package/dist/pagination/root.svelte +63 -42
  72. package/dist/pin-input/clear-trigger.svelte +25 -17
  73. package/dist/pin-input/hidden-input.svelte +19 -10
  74. package/dist/pin-input/input.svelte +20 -10
  75. package/dist/pin-input/label.svelte +21 -12
  76. package/dist/pin-input/root.svelte +82 -64
  77. package/dist/popover/arrow-tip.svelte +21 -12
  78. package/dist/popover/arrow.svelte +21 -12
  79. package/dist/popover/close-trigger.svelte +21 -12
  80. package/dist/popover/content.svelte +21 -12
  81. package/dist/popover/description.svelte +21 -12
  82. package/dist/popover/positioner.svelte +21 -12
  83. package/dist/popover/root.svelte +22 -10
  84. package/dist/popover/title.svelte +21 -12
  85. package/dist/popover/trigger.svelte +21 -12
  86. package/dist/portal/root.svelte +20 -10
  87. package/dist/presence/root.svelte +39 -27
  88. package/dist/progress/circle-range.svelte +21 -12
  89. package/dist/progress/circle-track.svelte +21 -12
  90. package/dist/progress/circle.svelte +21 -12
  91. package/dist/progress/label.svelte +21 -12
  92. package/dist/progress/range.svelte +21 -12
  93. package/dist/progress/root.svelte +54 -36
  94. package/dist/progress/track.svelte +21 -12
  95. package/dist/progress/value-text.svelte +25 -16
  96. package/dist/radio-group/indicator.svelte +21 -12
  97. package/dist/radio-group/item-control.svelte +22 -13
  98. package/dist/radio-group/item-hidden-input.svelte +20 -11
  99. package/dist/radio-group/item-text.svelte +22 -13
  100. package/dist/radio-group/item.svelte +37 -26
  101. package/dist/radio-group/label.svelte +21 -12
  102. package/dist/radio-group/root.svelte +61 -40
  103. package/dist/select/clear-trigger.svelte +21 -12
  104. package/dist/select/content.svelte +21 -12
  105. package/dist/select/control.svelte +21 -12
  106. package/dist/select/hidden-select.svelte +21 -12
  107. package/dist/select/indicator.svelte +21 -12
  108. package/dist/select/item-group-label.svelte +24 -15
  109. package/dist/select/item-group.svelte +26 -14
  110. package/dist/select/item-indicator.svelte +22 -13
  111. package/dist/select/item-text.svelte +26 -17
  112. package/dist/select/item.svelte +35 -24
  113. package/dist/select/label.svelte +21 -12
  114. package/dist/select/list.svelte +21 -12
  115. package/dist/select/positioner.svelte +21 -12
  116. package/dist/select/root.svelte +96 -78
  117. package/dist/select/trigger.svelte +21 -12
  118. package/dist/select/value-text.svelte +27 -18
  119. package/dist/slider/control.svelte +21 -12
  120. package/dist/slider/hidden-input.svelte +20 -11
  121. package/dist/slider/label.svelte +21 -12
  122. package/dist/slider/marker-group.svelte +21 -12
  123. package/dist/slider/marker.svelte +29 -19
  124. package/dist/slider/range.svelte +21 -12
  125. package/dist/slider/root.svelte +84 -66
  126. package/dist/slider/thumb.svelte +35 -24
  127. package/dist/slider/track.svelte +21 -12
  128. package/dist/slider/value-text.svelte +25 -16
  129. package/dist/steps/content.svelte +22 -12
  130. package/dist/steps/indicator.svelte +22 -13
  131. package/dist/steps/item.svelte +24 -13
  132. package/dist/steps/list.svelte +21 -12
  133. package/dist/steps/next-trigger.svelte +21 -12
  134. package/dist/steps/prev-trigger.svelte +21 -12
  135. package/dist/steps/progress.svelte +21 -12
  136. package/dist/steps/root.svelte +56 -38
  137. package/dist/steps/separator.svelte +22 -13
  138. package/dist/steps/trigger.svelte +22 -13
  139. package/dist/switch/control.svelte +21 -12
  140. package/dist/switch/hidden-input.svelte +19 -10
  141. package/dist/switch/label.svelte +21 -12
  142. package/dist/switch/root.svelte +64 -46
  143. package/dist/switch/thumb.svelte +21 -12
  144. package/dist/tabs/content.svelte +22 -12
  145. package/dist/tabs/list.svelte +21 -12
  146. package/dist/tabs/root.svelte +57 -42
  147. package/dist/tabs/trigger.svelte +22 -12
  148. package/dist/toast/action-trigger.svelte +21 -12
  149. package/dist/toast/actor.svelte +22 -11
  150. package/dist/toast/close-trigger.svelte +21 -12
  151. package/dist/toast/description.svelte +25 -16
  152. package/dist/toast/root.svelte +25 -16
  153. package/dist/toast/title.svelte +25 -16
  154. package/dist/toast/toaster.svelte +40 -25
  155. package/dist/toggle-group/item.svelte +22 -12
  156. package/dist/toggle-group/root.svelte +61 -40
  157. package/dist/tooltip/arrow-tip.svelte +21 -12
  158. package/dist/tooltip/arrow.svelte +21 -12
  159. package/dist/tooltip/content.svelte +21 -12
  160. package/dist/tooltip/positioner.svelte +21 -12
  161. package/dist/tooltip/root.svelte +22 -10
  162. package/dist/tooltip/trigger.svelte +21 -12
  163. package/package.json +6 -14
@@ -1,20 +1,31 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePaginationContext } from "./context.svelte.js";
5
- let { value, children, ...props } = $props();
6
- let context = usePaginationContext();
7
- let attrs = $derived(
8
- mergeProps(
9
- props,
10
- context.getItemProps({
11
- type: "page",
12
- value
13
- })
14
- )
15
- );
16
- </script>
17
-
18
- <button type="button" {...attrs}>
19
- {@render children?.()}
20
- </button>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {ItemProps} from '@zag-js/pagination';
4
+ import type {SvelteHTMLElements} from 'svelte/elements';
5
+
6
+ export interface PaginationItemProps
7
+ extends Assign<SvelteHTMLElements['button'], Omit<ItemProps, 'type'>> {}
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import {mergeProps} from '@zag-js/svelte';
12
+ import {usePaginationContext} from './context.svelte.js';
13
+
14
+ let {value, children, ...props}: PaginationItemProps = $props();
15
+
16
+ let context = usePaginationContext();
17
+
18
+ let attrs = $derived(
19
+ mergeProps(
20
+ props,
21
+ context.getItemProps({
22
+ type: 'page',
23
+ value,
24
+ }),
25
+ ),
26
+ );
27
+ </script>
28
+
29
+ <button type="button" {...attrs}>
30
+ {@render children?.()}
31
+ </button>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePaginationContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePaginationContext();
7
- let attrs = $derived(mergeProps(props, context.getNextTriggerProps()));
8
- </script>
9
-
10
- <button type="button" {...attrs}>
11
- {@render children?.()}
12
- </button>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PaginationNextTriggerProps extends Assign<SvelteHTMLElements['button'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePaginationContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PaginationNextTriggerProps = $props();
13
+
14
+ let context = usePaginationContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getNextTriggerProps()));
17
+ </script>
18
+
19
+ <button type="button" {...attrs}>
20
+ {@render children?.()}
21
+ </button>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePaginationContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePaginationContext();
7
- let attrs = $derived(mergeProps(props, context.getPrevTriggerProps()));
8
- </script>
9
-
10
- <button type="button" {...attrs}>
11
- {@render children?.()}
12
- </button>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PaginationPrevTriggerProps extends Assign<SvelteHTMLElements['button'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePaginationContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PaginationPrevTriggerProps = $props();
13
+
14
+ let context = usePaginationContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getPrevTriggerProps()));
17
+ </script>
18
+
19
+ <button type="button" {...attrs}>
20
+ {@render children?.()}
21
+ </button>
@@ -1,42 +1,63 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { uuid } from "../utils.svelte.js";
4
- import { mergeProps } from "@zag-js/svelte";
5
- import { createPaginationContext, setPaginationContext } from "./context.svelte.js";
6
- let {
7
- id = uuid(),
8
- ids,
9
- dir,
10
- type,
11
- page,
12
- pageSize,
13
- count,
14
- siblingCount,
15
- translations,
16
- onPageChange,
17
- onPageSizeChange,
18
- getRootNode,
19
- children,
20
- ...props
21
- } = $props();
22
- let context = createPaginationContext({
23
- id,
24
- ids,
25
- dir,
26
- type,
27
- page,
28
- pageSize,
29
- count,
30
- siblingCount,
31
- translations,
32
- onPageChange,
33
- onPageSizeChange,
34
- getRootNode
35
- });
36
- let attrs = $derived(mergeProps(props, context.getRootProps()));
37
- setPaginationContext(context);
38
- </script>
39
-
40
- <div {...attrs}>
41
- {@render children?.(context)}
42
- </div>
1
+ <script lang="ts" context="module">
2
+ import type {Assign, OptionalId, WithoutChildren} from '../types.js';
3
+ import type {Snippet} from 'svelte';
4
+ import type {SvelteHTMLElements} from 'svelte/elements';
5
+ import type {
6
+ CreatePaginationContextProps,
7
+ CreatePaginationContextReturn,
8
+ } from './context.svelte.js';
9
+
10
+ export interface PaginationProps
11
+ extends Assign<
12
+ WithoutChildren<SvelteHTMLElements['div']>,
13
+ OptionalId<CreatePaginationContextProps>
14
+ > {
15
+ children?: Snippet<[CreatePaginationContextReturn]>;
16
+ }
17
+ </script>
18
+
19
+ <script lang="ts">
20
+ import {uuid} from '../utils.svelte.js';
21
+ import {mergeProps} from '@zag-js/svelte';
22
+ import {createPaginationContext, setPaginationContext} from './context.svelte.js';
23
+
24
+ let {
25
+ id = uuid(),
26
+ ids,
27
+ dir,
28
+ type,
29
+ page,
30
+ pageSize,
31
+ count,
32
+ siblingCount,
33
+ translations,
34
+ onPageChange,
35
+ onPageSizeChange,
36
+ getRootNode,
37
+ children,
38
+ ...props
39
+ }: PaginationProps = $props();
40
+
41
+ let context = createPaginationContext({
42
+ id,
43
+ ids,
44
+ dir,
45
+ type,
46
+ page,
47
+ pageSize,
48
+ count,
49
+ siblingCount,
50
+ translations,
51
+ onPageChange,
52
+ onPageSizeChange,
53
+ getRootNode,
54
+ });
55
+
56
+ let attrs = $derived(mergeProps(props, context.getRootProps()));
57
+
58
+ setPaginationContext(context);
59
+ </script>
60
+
61
+ <div {...attrs}>
62
+ {@render children?.(context)}
63
+ </div>
@@ -1,17 +1,25 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { usePinInputContext } from "./context.svelte.js";
4
- let { children, onclick, ...props } = $props();
5
- let context = usePinInputContext();
6
- </script>
7
-
8
- <button
9
- type="button"
10
- onclick={(e) => {
11
- onclick?.(e);
12
- context.clearValue();
13
- }}
14
- {...props}
15
- >
16
- {@render children?.()}
17
- </button>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PinInputClearTriggerProps extends Assign<SvelteHTMLElements['button'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {usePinInputContext} from './context.svelte.js';
10
+
11
+ let {children, onclick, ...props}: PinInputClearTriggerProps = $props();
12
+
13
+ let context = usePinInputContext();
14
+ </script>
15
+
16
+ <button
17
+ type="button"
18
+ onclick={(e) => {
19
+ onclick?.(e);
20
+ context.clearValue();
21
+ }}
22
+ {...props}
23
+ >
24
+ {@render children?.()}
25
+ </button>
@@ -1,10 +1,19 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePinInputContext } from "./context.svelte.js";
5
- let { ...props } = $props();
6
- let context = usePinInputContext();
7
- let attrs = $derived(mergeProps(props, context.getHiddenInputProps()));
8
- </script>
9
-
10
- <input {...attrs} />
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PinInputHiddenInputProps extends Assign<SvelteHTMLElements['input'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePinInputContext} from './context.svelte.js';
11
+
12
+ let {...props}: PinInputHiddenInputProps = $props();
13
+
14
+ let context = usePinInputContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getHiddenInputProps()));
17
+ </script>
18
+
19
+ <input {...attrs} />
@@ -1,10 +1,20 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePinInputContext } from "./context.svelte.js";
5
- let { index, ...props } = $props();
6
- let context = usePinInputContext();
7
- let attrs = $derived(mergeProps(props, context.getInputProps({ index })));
8
- </script>
9
-
10
- <input {...attrs} />
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {InputProps} from '@zag-js/pin-input';
4
+ import type {SvelteHTMLElements} from 'svelte/elements';
5
+
6
+ export interface PinInputInputProps extends Assign<SvelteHTMLElements['input'], InputProps> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '@zag-js/svelte';
11
+ import {usePinInputContext} from './context.svelte.js';
12
+
13
+ let {index, ...props}: PinInputInputProps = $props();
14
+
15
+ let context = usePinInputContext();
16
+
17
+ let attrs = $derived(mergeProps(props, context.getInputProps({index})));
18
+ </script>
19
+
20
+ <input {...attrs} />
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePinInputContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePinInputContext();
7
- let attrs = $derived(mergeProps(props, context.getLabelProps()));
8
- </script>
9
-
10
- <label {...attrs}>
11
- {@render children?.()}
12
- </label>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PinInputLabelProps extends Assign<SvelteHTMLElements['label'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePinInputContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PinInputLabelProps = $props();
13
+
14
+ let context = usePinInputContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getLabelProps()));
17
+ </script>
18
+
19
+ <label {...attrs}>
20
+ {@render children?.()}
21
+ </label>
@@ -1,64 +1,82 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { uuid } from "../utils.svelte.js";
4
- import { mergeProps } from "@zag-js/svelte";
5
- import { createPinInputContext, setPinInputContext } from "./context.svelte.js";
6
- let {
7
- id = uuid(),
8
- ids,
9
- dir,
10
- otp,
11
- form,
12
- mask,
13
- name,
14
- type,
15
- value,
16
- pattern,
17
- invalid,
18
- disabled,
19
- readOnly,
20
- required,
21
- autoFocus,
22
- placeholder,
23
- translations,
24
- selectOnFocus,
25
- blurOnComplete,
26
- onValueChange,
27
- onValueInvalid,
28
- onValueComplete,
29
- getRootNode,
30
- children,
31
- ...props
32
- } = $props();
33
- let context = createPinInputContext({
34
- id,
35
- ids,
36
- dir,
37
- otp,
38
- form,
39
- mask,
40
- name,
41
- type,
42
- value: $state.snapshot(value),
43
- pattern,
44
- invalid,
45
- disabled,
46
- readOnly,
47
- required,
48
- autoFocus,
49
- placeholder,
50
- translations,
51
- selectOnFocus,
52
- blurOnComplete,
53
- onValueChange,
54
- onValueInvalid,
55
- onValueComplete,
56
- getRootNode
57
- });
58
- let attrs = $derived(mergeProps(props, context.getRootProps()));
59
- setPinInputContext(context);
60
- </script>
61
-
62
- <div {...attrs}>
63
- {@render children?.(context)}
64
- </div>
1
+ <script lang="ts" context="module">
2
+ import type {Assign, OptionalId, WithoutChildren} from '../types.js';
3
+ import type {Snippet} from 'svelte';
4
+ import type {SvelteHTMLElements} from 'svelte/elements';
5
+ import type {CreatePinInputContextProps, CreatePinInputContextReturn} from './context.svelte.js';
6
+
7
+ export interface PinInputProps
8
+ extends Assign<
9
+ WithoutChildren<SvelteHTMLElements['div']>,
10
+ OptionalId<CreatePinInputContextProps>
11
+ > {
12
+ children?: Snippet<[CreatePinInputContextReturn]>;
13
+ }
14
+ </script>
15
+
16
+ <script lang="ts">
17
+ import {uuid} from '../utils.svelte.js';
18
+ import {mergeProps} from '@zag-js/svelte';
19
+ import {createPinInputContext, setPinInputContext} from './context.svelte.js';
20
+
21
+ let {
22
+ id = uuid(),
23
+ ids,
24
+ dir,
25
+ otp,
26
+ form,
27
+ mask,
28
+ name,
29
+ type,
30
+ value,
31
+ pattern,
32
+ invalid,
33
+ disabled,
34
+ readOnly,
35
+ required,
36
+ autoFocus,
37
+ placeholder,
38
+ translations,
39
+ selectOnFocus,
40
+ blurOnComplete,
41
+ onValueChange,
42
+ onValueInvalid,
43
+ onValueComplete,
44
+ getRootNode,
45
+ children,
46
+ ...props
47
+ }: PinInputProps = $props();
48
+
49
+ let context = createPinInputContext({
50
+ id,
51
+ ids,
52
+ dir,
53
+ otp,
54
+ form,
55
+ mask,
56
+ name,
57
+ type,
58
+ value: $state.snapshot(value),
59
+ pattern,
60
+ invalid,
61
+ disabled,
62
+ readOnly,
63
+ required,
64
+ autoFocus,
65
+ placeholder,
66
+ translations,
67
+ selectOnFocus,
68
+ blurOnComplete,
69
+ onValueChange,
70
+ onValueInvalid,
71
+ onValueComplete,
72
+ getRootNode,
73
+ });
74
+
75
+ let attrs = $derived(mergeProps(props, context.getRootProps()));
76
+
77
+ setPinInputContext(context);
78
+ </script>
79
+
80
+ <div {...attrs}>
81
+ {@render children?.(context)}
82
+ </div>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePopoverContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePopoverContext();
7
- let attrs = $derived(mergeProps(props, context.getArrowTipProps()));
8
- </script>
9
-
10
- <div {...attrs}>
11
- {@render children?.()}
12
- </div>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PopoverArrowTipProps extends Assign<SvelteHTMLElements['div'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePopoverContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PopoverArrowTipProps = $props();
13
+
14
+ let context = usePopoverContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getArrowTipProps()));
17
+ </script>
18
+
19
+ <div {...attrs}>
20
+ {@render children?.()}
21
+ </div>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePopoverContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePopoverContext();
7
- let attrs = $derived(mergeProps(props, context.getArrowProps()));
8
- </script>
9
-
10
- <div {...attrs}>
11
- {@render children?.()}
12
- </div>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PopoverArrowProps extends Assign<SvelteHTMLElements['div'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePopoverContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PopoverArrowProps = $props();
13
+
14
+ let context = usePopoverContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getArrowProps()));
17
+ </script>
18
+
19
+ <div {...attrs}>
20
+ {@render children?.()}
21
+ </div>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePopoverContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePopoverContext();
7
- let attrs = $derived(mergeProps(props, context.getCloseTriggerProps()));
8
- </script>
9
-
10
- <button type="button" {...attrs}>
11
- {@render children?.()}
12
- </button>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PopoverCloseTriggerProps extends Assign<SvelteHTMLElements['button'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePopoverContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PopoverCloseTriggerProps = $props();
13
+
14
+ let context = usePopoverContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getCloseTriggerProps()));
17
+ </script>
18
+
19
+ <button type="button" {...attrs}>
20
+ {@render children?.()}
21
+ </button>
@@ -1,12 +1,21 @@
1
- <script lang="ts" context="module"></script>
2
-
3
- <script lang="ts">import { mergeProps } from "@zag-js/svelte";
4
- import { usePopoverContext } from "./context.svelte.js";
5
- let { children, ...props } = $props();
6
- let context = usePopoverContext();
7
- let attrs = $derived(mergeProps(props, context.getContentProps()));
8
- </script>
9
-
10
- <div {...attrs}>
11
- {@render children?.()}
12
- </div>
1
+ <script lang="ts" context="module">
2
+ import type {Assign} from '../types.js';
3
+ import type {SvelteHTMLElements} from 'svelte/elements';
4
+
5
+ export interface PopoverContentProps extends Assign<SvelteHTMLElements['div'], {}> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import {mergeProps} from '@zag-js/svelte';
10
+ import {usePopoverContext} from './context.svelte.js';
11
+
12
+ let {children, ...props}: PopoverContentProps = $props();
13
+
14
+ let context = usePopoverContext();
15
+
16
+ let attrs = $derived(mergeProps(props, context.getContentProps()));
17
+ </script>
18
+
19
+ <div {...attrs}>
20
+ {@render children?.()}
21
+ </div>