ui-ingredients 0.20.0 → 0.21.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/dist/accordion/accordion-item-content.svelte +55 -55
  2. package/dist/accordion/accordion-root.svelte +66 -66
  3. package/dist/alert-dialog/alert-dialog-backdrop.svelte +49 -49
  4. package/dist/alert-dialog/alert-dialog-root.svelte +48 -48
  5. package/dist/avatar/avatar-root.svelte +46 -46
  6. package/dist/carousel/carousel-root.svelte +56 -56
  7. package/dist/checkbox/checkbox-root.svelte +59 -59
  8. package/dist/clipboard/clipboard-root.svelte +52 -52
  9. package/dist/collapsible/collapsible-root.svelte +75 -75
  10. package/dist/color-picker/color-picker-root.svelte +87 -87
  11. package/dist/combobox/combobox-root.svelte +101 -101
  12. package/dist/combobox/combobox-trigger.svelte +41 -41
  13. package/dist/date-picker/date-picker-root.svelte +89 -89
  14. package/dist/dialog/dialog-backdrop.svelte +45 -45
  15. package/dist/dialog/dialog-root.svelte +48 -48
  16. package/dist/drawer/drawer-backdrop.svelte +45 -45
  17. package/dist/drawer/drawer-root.svelte +48 -48
  18. package/dist/editable/editable-root.svelte +74 -74
  19. package/dist/field/field-error-text.svelte +50 -50
  20. package/dist/field/field-root.svelte +63 -63
  21. package/dist/file-upload/file-upload-root.svelte +66 -66
  22. package/dist/floating-panel/floating-panel-root.svelte +47 -47
  23. package/dist/hover-card/hover-card-root.svelte +52 -52
  24. package/dist/menu/menu-root.svelte +74 -74
  25. package/dist/number-input/number-input-root.svelte +74 -74
  26. package/dist/pagination/pagination-root.svelte +57 -57
  27. package/dist/pin-input/pin-input-root.svelte +68 -68
  28. package/dist/popover/popover-root.svelte +60 -60
  29. package/dist/presence/presence.svelte +48 -48
  30. package/dist/progress/progress-root.svelte +54 -54
  31. package/dist/qr-code/qr-code-root.svelte +48 -48
  32. package/dist/radio-group/radio-group-root.svelte +56 -56
  33. package/dist/rating-group/rating-group-root.svelte +63 -63
  34. package/dist/segment-group/segment-group-root.svelte +58 -58
  35. package/dist/select/select-root.svelte +88 -88
  36. package/dist/signature-pad/signature-pad-root.svelte +59 -59
  37. package/dist/slider/slider-root.svelte +69 -69
  38. package/dist/splitter/splitter-root.svelte +53 -53
  39. package/dist/steps/steps-completed-content.svelte +51 -37
  40. package/dist/steps/steps-completed-content.svelte.d.ts +2 -1
  41. package/dist/steps/steps-content.svelte +55 -32
  42. package/dist/steps/steps-content.svelte.d.ts +2 -1
  43. package/dist/steps/steps-root.svelte +65 -55
  44. package/dist/steps/steps-root.svelte.d.ts +2 -1
  45. package/dist/switch/switch-root.svelte +59 -59
  46. package/dist/tabs/tabs-root.svelte +57 -57
  47. package/dist/tags-input/tags-input-root.svelte +74 -74
  48. package/dist/time-picker/time-picker-root.svelte +81 -81
  49. package/dist/timer/timer-root.svelte +55 -55
  50. package/dist/toast/create-toaster.svelte.d.ts +1 -1
  51. package/dist/toast/toast-actor.svelte +19 -19
  52. package/dist/toast/toast-actor.svelte.d.ts +3 -3
  53. package/dist/toast/toaster.svelte +19 -21
  54. package/dist/toast/toaster.svelte.d.ts +1 -1
  55. package/dist/toggle/toggle-root.svelte +50 -50
  56. package/dist/toggle-group/toggle-group-root.svelte +58 -58
  57. package/dist/tooltip/tooltip-root.svelte +44 -44
  58. package/dist/tour/tour-backdrop.svelte +44 -44
  59. package/dist/tour/tour-root.svelte +47 -47
  60. package/dist/tree-view/tree-view-branch-content.svelte +55 -55
  61. package/dist/tree-view/tree-view-root.svelte +68 -68
  62. package/package.json +5 -5
@@ -1,69 +1,69 @@
1
- <script lang="ts" module>
2
- import type {Assign, HtmlIngredientProps} from '../types.js';
3
- import type {
4
- CreateSliderProps,
5
- CreateSliderReturn,
6
- } from './create-slider.svelte.js';
7
-
8
- export interface SliderProps
9
- extends Assign<
10
- HtmlIngredientProps<'div', HTMLDivElement, CreateSliderReturn>,
11
- CreateSliderProps
12
- > {}
13
- </script>
14
-
15
- <script lang="ts">
16
- import {mergeProps} from '../merge-props.js';
17
- import {reflect} from '@zag-js/svelte';
18
- import {createSplitProps} from '@zag-js/utils';
19
- import {createSlider} from './create-slider.svelte.js';
20
- import {setSliderContext} from './slider-context.svelte.js';
21
-
22
- let {
23
- ref = $bindable(null),
24
- asChild,
25
- children,
26
- ...props
27
- }: SliderProps = $props();
28
-
29
- let [createSliderProps, localProps] = $derived(
30
- createSplitProps<CreateSliderProps>([
31
- 'id',
32
- 'ids',
33
- 'max',
34
- 'min',
35
- 'step',
36
- 'form',
37
- 'name',
38
- 'value',
39
- 'origin',
40
- 'invalid',
41
- 'readOnly',
42
- 'disabled',
43
- 'orientation',
44
- 'thumbAlignment',
45
- 'thumbSize',
46
- 'minStepsBetweenThumbs',
47
- 'onFocusChange',
48
- 'onValueChange',
49
- 'onValueChangeEnd',
50
- 'getAriaValueText',
51
- 'aria-label',
52
- 'aria-labelledby',
53
- ])(props),
54
- );
55
-
56
- let slider = createSlider(reflect(() => createSliderProps));
57
-
58
- let mergedProps = $derived(mergeProps(slider.getRootProps(), localProps));
59
-
60
- setSliderContext(slider);
61
- </script>
62
-
63
- {#if asChild}
64
- {@render asChild(mergedProps, slider)}
65
- {:else}
66
- <div bind:this={ref} {...mergedProps}>
67
- {@render children?.(slider)}
68
- </div>
69
- {/if}
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlIngredientProps} from '../types.js';
3
+ import type {
4
+ CreateSliderProps,
5
+ CreateSliderReturn,
6
+ } from './create-slider.svelte.js';
7
+
8
+ export interface SliderProps
9
+ extends Assign<
10
+ HtmlIngredientProps<'div', HTMLDivElement, CreateSliderReturn>,
11
+ CreateSliderProps
12
+ > {}
13
+ </script>
14
+
15
+ <script lang="ts">
16
+ import {mergeProps} from '../merge-props.js';
17
+ import {reflect} from '@zag-js/svelte';
18
+ import {createSplitProps} from '@zag-js/utils';
19
+ import {createSlider} from './create-slider.svelte.js';
20
+ import {setSliderContext} from './slider-context.svelte.js';
21
+
22
+ let {
23
+ ref = $bindable(null),
24
+ asChild,
25
+ children,
26
+ ...props
27
+ }: SliderProps = $props();
28
+
29
+ let [createSliderProps, localProps] = $derived(
30
+ createSplitProps<CreateSliderProps>([
31
+ 'id',
32
+ 'ids',
33
+ 'max',
34
+ 'min',
35
+ 'step',
36
+ 'form',
37
+ 'name',
38
+ 'value',
39
+ 'origin',
40
+ 'invalid',
41
+ 'readOnly',
42
+ 'disabled',
43
+ 'orientation',
44
+ 'thumbAlignment',
45
+ 'thumbSize',
46
+ 'minStepsBetweenThumbs',
47
+ 'onFocusChange',
48
+ 'onValueChange',
49
+ 'onValueChangeEnd',
50
+ 'getAriaValueText',
51
+ 'aria-label',
52
+ 'aria-labelledby',
53
+ ])(props),
54
+ );
55
+
56
+ let slider = createSlider(reflect(() => createSliderProps));
57
+
58
+ let mergedProps = $derived(mergeProps(slider.getRootProps(), localProps));
59
+
60
+ setSliderContext(slider);
61
+ </script>
62
+
63
+ {#if asChild}
64
+ {@render asChild(mergedProps, slider)}
65
+ {:else}
66
+ <div bind:this={ref} {...mergedProps}>
67
+ {@render children?.(slider)}
68
+ </div>
69
+ {/if}
@@ -1,53 +1,53 @@
1
- <script lang="ts" module>
2
- import type {Assign, HtmlIngredientProps} from '../types.js';
3
- import type {
4
- CreateSplitterProps,
5
- CreateSplitterReturn,
6
- } from './create-splitter.svelte.js';
7
-
8
- export interface SplitterProps
9
- extends Assign<
10
- HtmlIngredientProps<'div', HTMLDivElement, CreateSplitterReturn>,
11
- CreateSplitterProps
12
- > {}
13
- </script>
14
-
15
- <script lang="ts">
16
- import {mergeProps} from '../merge-props.js';
17
- import {reflect} from '@zag-js/svelte';
18
- import {createSplitProps} from '@zag-js/utils';
19
- import {createSplitter} from './create-splitter.svelte.js';
20
- import {setSplitterContext} from './splitter-context.svelte.js';
21
-
22
- let {
23
- ref = $bindable(null),
24
- asChild,
25
- children,
26
- ...props
27
- }: SplitterProps = $props();
28
-
29
- let [createSplitterProps, localProps] = $derived(
30
- createSplitProps<CreateSplitterProps>([
31
- 'id',
32
- 'ids',
33
- 'size',
34
- 'orientation',
35
- 'onSizeChange',
36
- 'onSizeChangeEnd',
37
- ])(props),
38
- );
39
-
40
- let splitter = createSplitter(reflect(() => createSplitterProps));
41
-
42
- let mergedProps = $derived(mergeProps(splitter.getRootProps(), localProps));
43
-
44
- setSplitterContext(splitter);
45
- </script>
46
-
47
- {#if asChild}
48
- {@render asChild(mergedProps, splitter)}
49
- {:else}
50
- <div bind:this={ref} {...mergedProps}>
51
- {@render children?.(splitter)}
52
- </div>
53
- {/if}
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlIngredientProps} from '../types.js';
3
+ import type {
4
+ CreateSplitterProps,
5
+ CreateSplitterReturn,
6
+ } from './create-splitter.svelte.js';
7
+
8
+ export interface SplitterProps
9
+ extends Assign<
10
+ HtmlIngredientProps<'div', HTMLDivElement, CreateSplitterReturn>,
11
+ CreateSplitterProps
12
+ > {}
13
+ </script>
14
+
15
+ <script lang="ts">
16
+ import {mergeProps} from '../merge-props.js';
17
+ import {reflect} from '@zag-js/svelte';
18
+ import {createSplitProps} from '@zag-js/utils';
19
+ import {createSplitter} from './create-splitter.svelte.js';
20
+ import {setSplitterContext} from './splitter-context.svelte.js';
21
+
22
+ let {
23
+ ref = $bindable(null),
24
+ asChild,
25
+ children,
26
+ ...props
27
+ }: SplitterProps = $props();
28
+
29
+ let [createSplitterProps, localProps] = $derived(
30
+ createSplitProps<CreateSplitterProps>([
31
+ 'id',
32
+ 'ids',
33
+ 'size',
34
+ 'orientation',
35
+ 'onSizeChange',
36
+ 'onSizeChangeEnd',
37
+ ])(props),
38
+ );
39
+
40
+ let splitter = createSplitter(reflect(() => createSplitterProps));
41
+
42
+ let mergedProps = $derived(mergeProps(splitter.getRootProps(), localProps));
43
+
44
+ setSplitterContext(splitter);
45
+ </script>
46
+
47
+ {#if asChild}
48
+ {@render asChild(mergedProps, splitter)}
49
+ {:else}
50
+ <div bind:this={ref} {...mergedProps}>
51
+ {@render children?.(splitter)}
52
+ </div>
53
+ {/if}
@@ -1,37 +1,51 @@
1
- <script lang="ts" module>
2
- import type {HtmlIngredientProps} from '../types.js';
3
-
4
- export interface StepsCompletedContentProps
5
- extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
- </script>
7
-
8
- <script lang="ts">
9
- import {mergeProps} from '../merge-props.js';
10
- import {getStepsContext} from './steps-context.svelte.js';
11
-
12
- let {
13
- ref = $bindable(null),
14
- asChild,
15
- children,
16
- ...props
17
- }: StepsCompletedContentProps = $props();
18
-
19
- let steps = getStepsContext();
20
-
21
- let mergedProps = $derived(
22
- mergeProps(
23
- steps.getContentProps({
24
- index: steps.count,
25
- }),
26
- props,
27
- ),
28
- );
29
- </script>
30
-
31
- {#if asChild}
32
- {@render asChild(mergedProps)}
33
- {:else}
34
- <div bind:this={ref} {...mergedProps}>
35
- {@render children?.()}
36
- </div>
37
- {/if}
1
+ <script lang="ts" module>
2
+ import type {HtmlIngredientProps} from '../types.js';
3
+ import type {Action} from 'svelte/action';
4
+
5
+ export interface StepsCompletedContentProps
6
+ extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import {mergeProps} from '../merge-props.js';
11
+ import {createPresence} from '../presence/create-presence.svelte.js';
12
+ import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
13
+ import {reflect} from '@zag-js/svelte';
14
+ import {getStepsContext} from './steps-context.svelte.js';
15
+
16
+ let {
17
+ ref = $bindable(null),
18
+ asChild,
19
+ children,
20
+ ...props
21
+ }: StepsCompletedContentProps = $props();
22
+
23
+ let steps = getStepsContext();
24
+ let index = $derived(steps.count);
25
+
26
+ let presenceStrategyProps = getPresenceStrategyPropsContext();
27
+ let presence = createPresence(
28
+ reflect(() => ({
29
+ ...presenceStrategyProps,
30
+ present: steps.value === index,
31
+ })),
32
+ );
33
+
34
+ let mergedProps = $derived(
35
+ mergeProps(
36
+ steps.getContentProps({index}),
37
+ presence.getPresenceProps(),
38
+ props,
39
+ ),
40
+ );
41
+ </script>
42
+
43
+ {#if presence.mounted}
44
+ {#if asChild}
45
+ {@render asChild(presence.setReference, mergedProps)}
46
+ {:else}
47
+ <div use:presence.setReference bind:this={ref} {...mergedProps}>
48
+ {@render children?.()}
49
+ </div>
50
+ {/if}
51
+ {/if}
@@ -1,5 +1,6 @@
1
1
  import type { HtmlIngredientProps } from '../types.js';
2
- export interface StepsCompletedContentProps extends HtmlIngredientProps<'div', HTMLDivElement> {
2
+ import type { Action } from 'svelte/action';
3
+ export interface StepsCompletedContentProps extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {
3
4
  }
4
5
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
5
6
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
@@ -1,32 +1,55 @@
1
- <script lang="ts" module>
2
- import type {Assign, HtmlIngredientProps} from '../types.js';
3
- import type {ItemProps} from '@zag-js/steps';
4
-
5
- export interface StepsContentProps
6
- extends Assign<HtmlIngredientProps<'div', HTMLDivElement>, ItemProps> {}
7
- </script>
8
-
9
- <script lang="ts">
10
- import {mergeProps} from '../merge-props.js';
11
- import {getStepsContext} from './steps-context.svelte.js';
12
-
13
- let {
14
- ref = $bindable(null),
15
- index,
16
- asChild,
17
- children,
18
- ...props
19
- }: StepsContentProps = $props();
20
-
21
- let steps = getStepsContext();
22
-
23
- let mergedProps = $derived(mergeProps(steps.getContentProps({index}), props));
24
- </script>
25
-
26
- {#if asChild}
27
- {@render asChild(mergedProps)}
28
- {:else}
29
- <div bind:this={ref} {...mergedProps}>
30
- {@render children?.()}
31
- </div>
32
- {/if}
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlIngredientProps} from '../types.js';
3
+ import type {ItemProps} from '@zag-js/steps';
4
+ import type {Action} from 'svelte/action';
5
+
6
+ export interface StepsContentProps
7
+ extends Assign<
8
+ HtmlIngredientProps<'div', HTMLDivElement, never, Action>,
9
+ ItemProps
10
+ > {}
11
+ </script>
12
+
13
+ <script lang="ts">
14
+ import {mergeProps} from '../merge-props.js';
15
+ import {createPresence} from '../presence/create-presence.svelte.js';
16
+ import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
17
+ import {reflect} from '@zag-js/svelte';
18
+ import {getStepsContext} from './steps-context.svelte.js';
19
+
20
+ let {
21
+ ref = $bindable(null),
22
+ index,
23
+ asChild,
24
+ children,
25
+ ...props
26
+ }: StepsContentProps = $props();
27
+
28
+ let steps = getStepsContext();
29
+
30
+ let presenceStrategyProps = getPresenceStrategyPropsContext();
31
+ let presence = createPresence(
32
+ reflect(() => ({
33
+ ...presenceStrategyProps,
34
+ present: steps.value === index,
35
+ })),
36
+ );
37
+
38
+ let mergedProps = $derived(
39
+ mergeProps(
40
+ steps.getContentProps({index}),
41
+ presence.getPresenceProps(),
42
+ props,
43
+ ),
44
+ );
45
+ </script>
46
+
47
+ {#if presence.mounted}
48
+ {#if asChild}
49
+ {@render asChild(presence.setReference, mergedProps)}
50
+ {:else}
51
+ <div use:presence.setReference bind:this={ref} {...mergedProps}>
52
+ {@render children?.()}
53
+ </div>
54
+ {/if}
55
+ {/if}
@@ -1,6 +1,7 @@
1
1
  import type { Assign, HtmlIngredientProps } from '../types.js';
2
2
  import type { ItemProps } from '@zag-js/steps';
3
- export interface StepsContentProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement>, ItemProps> {
3
+ import type { Action } from 'svelte/action';
4
+ export interface StepsContentProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, never, Action>, ItemProps> {
4
5
  }
5
6
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
6
7
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
@@ -1,55 +1,65 @@
1
- <script lang="ts" module>
2
- import type {Assign, HtmlIngredientProps} from '../types.js';
3
- import type {
4
- CreateStepsProps,
5
- CreateStepsReturn,
6
- } from './create-steps.svelte.js';
7
-
8
- export interface StepsProps
9
- extends Assign<
10
- HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>,
11
- CreateStepsProps
12
- > {}
13
- </script>
14
-
15
- <script lang="ts">
16
- import {mergeProps} from '../merge-props.js';
17
- import {reflect} from '@zag-js/svelte';
18
- import {createSplitProps} from '@zag-js/utils';
19
- import {createSteps} from './create-steps.svelte.js';
20
- import {setStepsContext} from './steps-context.svelte.js';
21
-
22
- let {
23
- ref = $bindable(null),
24
- asChild,
25
- children,
26
- ...props
27
- }: StepsProps = $props();
28
-
29
- let [createStepsProps, localProps] = $derived(
30
- createSplitProps<CreateStepsProps>([
31
- 'id',
32
- 'ids',
33
- 'step',
34
- 'count',
35
- 'linear',
36
- 'orientation',
37
- 'onStepChange',
38
- 'onStepComplete',
39
- ])(props),
40
- );
41
-
42
- let steps = createSteps(reflect(() => createStepsProps));
43
-
44
- let mergedProps = $derived(mergeProps(steps.getRootProps(), localProps));
45
-
46
- setStepsContext(steps);
47
- </script>
48
-
49
- {#if asChild}
50
- {@render asChild(mergedProps, steps)}
51
- {:else}
52
- <div bind:this={ref} {...mergedProps}>
53
- {@render children?.(steps)}
54
- </div>
55
- {/if}
1
+ <script lang="ts" module>
2
+ import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
3
+ import type {Assign, HtmlIngredientProps} from '../types.js';
4
+ import type {
5
+ CreateStepsProps,
6
+ CreateStepsReturn,
7
+ } from './create-steps.svelte.js';
8
+
9
+ export interface StepsProps
10
+ extends Assign<
11
+ HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>,
12
+ CreateStepsProps
13
+ >,
14
+ PresenceStrategyProps {}
15
+ </script>
16
+
17
+ <script lang="ts">
18
+ import {mergeProps} from '../merge-props.js';
19
+ import {setPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
20
+ import {reflect} from '@zag-js/svelte';
21
+ import {createSplitProps} from '@zag-js/utils';
22
+ import {createSteps} from './create-steps.svelte.js';
23
+ import {setStepsContext} from './steps-context.svelte.js';
24
+
25
+ let {
26
+ ref = $bindable(null),
27
+ asChild,
28
+ children,
29
+ ...props
30
+ }: StepsProps = $props();
31
+
32
+ let [presenceStrategyProps, rest] = $derived(
33
+ createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
34
+ props,
35
+ ),
36
+ );
37
+
38
+ let [createStepsProps, localProps] = $derived(
39
+ createSplitProps<CreateStepsProps>([
40
+ 'id',
41
+ 'ids',
42
+ 'step',
43
+ 'count',
44
+ 'linear',
45
+ 'orientation',
46
+ 'onStepChange',
47
+ 'onStepComplete',
48
+ ])(rest),
49
+ );
50
+
51
+ let steps = createSteps(reflect(() => createStepsProps));
52
+
53
+ let mergedProps = $derived(mergeProps(steps.getRootProps(), localProps));
54
+
55
+ setStepsContext(steps);
56
+ setPresenceStrategyPropsContext(() => presenceStrategyProps);
57
+ </script>
58
+
59
+ {#if asChild}
60
+ {@render asChild(mergedProps, steps)}
61
+ {:else}
62
+ <div bind:this={ref} {...mergedProps}>
63
+ {@render children?.(steps)}
64
+ </div>
65
+ {/if}
@@ -1,6 +1,7 @@
1
+ import type { PresenceStrategyProps } from '../presence/create-presence.svelte.js';
1
2
  import type { Assign, HtmlIngredientProps } from '../types.js';
2
3
  import type { CreateStepsProps, CreateStepsReturn } from './create-steps.svelte.js';
3
- export interface StepsProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>, CreateStepsProps> {
4
+ export interface StepsProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>, CreateStepsProps>, PresenceStrategyProps {
4
5
  }
5
6
  interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
6
7
  new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {