ui-ingredients 0.0.66 → 0.0.68

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. package/README.md +0 -2
  2. package/dist/accordion/accordion-item-content.svelte +2 -2
  3. package/dist/accordion/avatar-context.svelte.d.ts +2 -2
  4. package/dist/avatar/avatar-context.svelte.d.ts +1 -1
  5. package/dist/carousel/carousel-context.svelte.d.ts +1 -1
  6. package/dist/checkbox/checkbox-context.svelte.d.ts +1 -1
  7. package/dist/clipboard/clipboard-context.svelte.d.ts +1 -1
  8. package/dist/collapsible/collapsible-content.svelte +19 -8
  9. package/dist/collapsible/collapsible-content.svelte.d.ts +2 -1
  10. package/dist/collapsible/collapsible-context.svelte.d.ts +1 -1
  11. package/dist/collapsible/collapsible-root.svelte +23 -4
  12. package/dist/collapsible/collapsible-root.svelte.d.ts +2 -1
  13. package/dist/collapsible/collapsible-trigger.svelte +0 -1
  14. package/dist/color-picker/color-picker-channel-slider-value-text.svelte +4 -1
  15. package/dist/color-picker/color-picker-content.svelte +2 -2
  16. package/dist/color-picker/color-picker-context.svelte.d.ts +6 -8
  17. package/dist/combobox/combobox-content.svelte +2 -2
  18. package/dist/combobox/combobox-context.svelte.d.ts +3 -3
  19. package/dist/create-context.svelte.d.ts +7 -4
  20. package/dist/create-context.svelte.js +26 -15
  21. package/dist/date-picker/date-picker-content.svelte +2 -2
  22. package/dist/date-picker/date-picker-context.svelte.d.ts +5 -5
  23. package/dist/dialog/dialog-backdrop.svelte +2 -2
  24. package/dist/dialog/dialog-content.svelte +2 -2
  25. package/dist/dialog/dialog-context.svelte.d.ts +1 -1
  26. package/dist/editable/editable-context.svelte.d.ts +1 -1
  27. package/dist/environment-provider/enviroment-provider-context.svelte.d.ts +1 -1
  28. package/dist/field/field-context.svelte.d.ts +1 -1
  29. package/dist/field/field-error-text.svelte +3 -1
  30. package/dist/field/field-helper-text.svelte +3 -1
  31. package/dist/field/field-input.svelte +1 -1
  32. package/dist/field/field-label.svelte +1 -1
  33. package/dist/field/field-select.svelte +1 -1
  34. package/dist/field/field-textarea.svelte +3 -1
  35. package/dist/file-upload/file-upload-context.svelte.d.ts +2 -2
  36. package/dist/floating-panel/floating-panel-content.svelte +2 -2
  37. package/dist/floating-panel/floating-panel-context.svelte.d.ts +1 -1
  38. package/dist/hover-card/hover-card-content.svelte +2 -2
  39. package/dist/hover-card/hover-card-context.svelte.d.ts +1 -1
  40. package/dist/is-pojo.d.ts +2 -0
  41. package/dist/{is-object.js → is-pojo.js} +1 -1
  42. package/dist/locale-provider/local-provider-context.svelte.d.ts +1 -1
  43. package/dist/menu/menu-arrow-tip.svelte +1 -1
  44. package/dist/menu/menu-arrow.svelte +1 -1
  45. package/dist/menu/menu-content.svelte +3 -3
  46. package/dist/menu/menu-context-trigger.svelte +1 -1
  47. package/dist/menu/menu-context.svelte.d.ts +4 -4
  48. package/dist/menu/menu-indicator.svelte +1 -1
  49. package/dist/menu/menu-item-group-label.svelte +1 -1
  50. package/dist/menu/menu-item-group.svelte +1 -1
  51. package/dist/menu/menu-item.svelte +2 -2
  52. package/dist/menu/menu-option-item-indicator.svelte +1 -1
  53. package/dist/menu/menu-option-item-text.svelte +1 -1
  54. package/dist/menu/menu-option-item.svelte +2 -2
  55. package/dist/menu/menu-positioner.svelte +1 -1
  56. package/dist/menu/menu-separator.svelte +1 -1
  57. package/dist/menu/menu-trigger.svelte +1 -1
  58. package/dist/merge-props.js +2 -2
  59. package/dist/number-input/number-input-context.svelte.d.ts +1 -1
  60. package/dist/pagination/pagination-context.svelte.d.ts +1 -1
  61. package/dist/pin-input/pin-input-context.svelte.d.ts +1 -1
  62. package/dist/popover/popover-content.svelte +2 -2
  63. package/dist/popover/popover-context.svelte.d.ts +1 -1
  64. package/dist/presence/create-presence.svelte.d.ts +1 -1
  65. package/dist/presence/create-presence.svelte.js +2 -2
  66. package/dist/presence/presence-context.svelte.d.ts +2 -2
  67. package/dist/presence/presence.svelte +2 -2
  68. package/dist/progress/progress-context.svelte.d.ts +1 -1
  69. package/dist/qr-code/qr-code-context.svelte.d.ts +1 -1
  70. package/dist/radio-group/radio-group-context.svelte.d.ts +2 -2
  71. package/dist/rating-group/rating-group-context.svelte.d.ts +1 -1
  72. package/dist/segment-group/segment-group-context.svelte.d.ts +2 -2
  73. package/dist/select/select-content.svelte +2 -2
  74. package/dist/select/select-context.svelte.d.ts +3 -3
  75. package/dist/signature-pad/signature-pad-context.svelte.d.ts +1 -1
  76. package/dist/slider/slider-context.svelte.d.ts +2 -2
  77. package/dist/splitter/splitter-context.svelte.d.ts +1 -1
  78. package/dist/steps/steps-context.svelte.d.ts +2 -2
  79. package/dist/switch/switch-context.svelte.d.ts +1 -1
  80. package/dist/tabs/tabs-context.svelte.d.ts +1 -1
  81. package/dist/tags-input/tags-input-context.svelte.d.ts +2 -2
  82. package/dist/time-picker/time-picker-content.svelte +2 -2
  83. package/dist/time-picker/time-picker-context.svelte.d.ts +1 -1
  84. package/dist/timer/timer-context.svelte.d.ts +2 -2
  85. package/dist/toast/toast-context.svelte.d.ts +1 -1
  86. package/dist/toggle-group/toggle-group-context.svelte.d.ts +1 -1
  87. package/dist/tooltip/tooltip-content.svelte +2 -2
  88. package/dist/tooltip/tooltip-context.svelte.d.ts +1 -1
  89. package/dist/tour/tour-content.svelte +1 -1
  90. package/dist/tour/tour-context.svelte.d.ts +1 -1
  91. package/dist/tour/tour-overlay.svelte +1 -1
  92. package/dist/tree-view/tree-view-branch-content.svelte +27 -8
  93. package/dist/tree-view/tree-view-branch-content.svelte.d.ts +2 -1
  94. package/dist/tree-view/tree-view-context.svelte.d.ts +3 -3
  95. package/dist/tree-view/tree-view-root.svelte +14 -5
  96. package/dist/tree-view/tree-view-root.svelte.d.ts +2 -1
  97. package/package.json +1 -1
  98. package/dist/is-object.d.ts +0 -2
@@ -18,7 +18,7 @@
18
18
 
19
19
  let menu = getMenuContext();
20
20
 
21
- let mergedProps = $derived(mergeProps(menu.getIndicatorProps(), props));
21
+ let mergedProps = $derived(mergeProps(menu!.getIndicatorProps(), props));
22
22
  </script>
23
23
 
24
24
  {#if asChild}
@@ -25,7 +25,7 @@
25
25
 
26
26
  let mergedProps = $derived(
27
27
  mergeProps(
28
- menu.getItemGroupLabelProps({
28
+ menu!.getItemGroupLabelProps({
29
29
  htmlFor: itemGroupProps.id,
30
30
  }),
31
31
  props,
@@ -30,7 +30,7 @@
30
30
  });
31
31
 
32
32
  let mergedProps = $derived(
33
- mergeProps(menu.getItemGroupProps(itemGroupProps), props),
33
+ mergeProps(menu!.getItemGroupProps(itemGroupProps), props),
34
34
  );
35
35
 
36
36
  setMenuItemGroupPropsContext(() => itemGroupProps);
@@ -32,9 +32,9 @@
32
32
  ])(props),
33
33
  );
34
34
 
35
- let itemState = $derived(menu.getItemState(itemProps));
35
+ let itemState = $derived(menu!.getItemState(itemProps));
36
36
  let mergedProps = $derived(
37
- mergeProps(menu.getItemProps(itemProps), localProps),
37
+ mergeProps(menu!.getItemProps(itemProps), localProps),
38
38
  );
39
39
  </script>
40
40
 
@@ -24,7 +24,7 @@
24
24
  let itemProps = getMenuOptionItemPropsContext();
25
25
 
26
26
  let mergedProps = $derived(
27
- mergeProps(menu.getItemIndicatorProps(itemProps), props),
27
+ mergeProps(menu!.getItemIndicatorProps(itemProps), props),
28
28
  );
29
29
  </script>
30
30
 
@@ -24,7 +24,7 @@
24
24
  let itemProps = getMenuOptionItemPropsContext();
25
25
 
26
26
  let mergedProps = $derived(
27
- mergeProps(menu.getItemTextProps(itemProps), props),
27
+ mergeProps(menu!.getItemTextProps(itemProps), props),
28
28
  );
29
29
  </script>
30
30
 
@@ -38,10 +38,10 @@
38
38
  ])(props),
39
39
  );
40
40
 
41
- let itemState = $derived(menu.getOptionItemState(itemProps));
41
+ let itemState = $derived(menu!.getOptionItemState(itemProps));
42
42
 
43
43
  let mergedProps = $derived(
44
- mergeProps(menu.getOptionItemProps(itemProps), localProps),
44
+ mergeProps(menu!.getOptionItemProps(itemProps), localProps),
45
45
  );
46
46
 
47
47
  setMenuOptionItemPropsContext(() => itemProps);
@@ -21,7 +21,7 @@
21
21
  let presence = getPresenceContext();
22
22
 
23
23
  let mergedProps = $derived(
24
- mergeProps(menu.getPositionerProps(), presence.getPresenceProps(), props),
24
+ mergeProps(menu!.getPositionerProps(), presence.getPresenceProps(), props),
25
25
  );
26
26
  </script>
27
27
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  let menu = getMenuContext();
20
20
 
21
- let mergedProps = $derived(mergeProps(menu.getSeparatorProps(), props));
21
+ let mergedProps = $derived(mergeProps(menu!.getSeparatorProps(), props));
22
22
  </script>
23
23
 
24
24
  {#if asChild}
@@ -18,7 +18,7 @@
18
18
 
19
19
  let menu = getMenuContext();
20
20
 
21
- let mergedProps = $derived(mergeProps(menu.getTriggerProps(), props));
21
+ let mergedProps = $derived(mergeProps(menu!.getTriggerProps(), props));
22
22
  </script>
23
23
 
24
24
  {#if asChild}
@@ -1,9 +1,9 @@
1
1
  import { mergeProps as fn } from '@zag-js/svelte';
2
- import { isObject } from './is-object.js';
2
+ import { isPojo } from './is-pojo.js';
3
3
  export function mergeProps(...args) {
4
4
  const r = fn(...args);
5
5
  const i = 'style';
6
- if (r[i] && isObject(r[i])) {
6
+ if (r[i] && isPojo(r[i])) {
7
7
  let s = '';
8
8
  for (const k in r[i]) {
9
9
  const v = r[i][k];
@@ -1,2 +1,2 @@
1
1
  import type { CreateNumberInputReturn } from './create-number-input.svelte.js';
2
- export declare const getNumberInputContext: () => CreateNumberInputReturn, setNumberInputContext: (context: CreateNumberInputReturn | (() => CreateNumberInputReturn)) => CreateNumberInputReturn;
2
+ export declare const getNumberInputContext: () => CreateNumberInputReturn, setNumberInputContext: (context: CreateNumberInputReturn | (() => CreateNumberInputReturn)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreatePaginationReturn } from './create-pagination.svelte.js';
2
- export declare const getPaginationContext: () => CreatePaginationReturn, setPaginationContext: (context: CreatePaginationReturn | (() => CreatePaginationReturn)) => CreatePaginationReturn;
2
+ export declare const getPaginationContext: () => CreatePaginationReturn, setPaginationContext: (context: CreatePaginationReturn | (() => CreatePaginationReturn)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreatePinInputReturn } from './create-pin-input.svelte.js';
2
- export declare const getPinInputContext: () => CreatePinInputReturn, setPinInputContext: (context: CreatePinInputReturn | (() => CreatePinInputReturn)) => CreatePinInputReturn;
2
+ export declare const getPinInputContext: () => CreatePinInputReturn, setPinInputContext: (context: CreatePinInputReturn | (() => CreatePinInputReturn)) => void;
@@ -28,9 +28,9 @@
28
28
 
29
29
  {#if presence.mounted}
30
30
  {#if asChild}
31
- {@render asChild(presence.ref, mergedProps)}
31
+ {@render asChild(presence.setReference, mergedProps)}
32
32
  {:else}
33
- <div bind:this={ref} use:presence.ref {...mergedProps}>
33
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
34
34
  {@render children?.()}
35
35
  </div>
36
36
  {/if}
@@ -1,2 +1,2 @@
1
1
  import type { CreatePopoverReturn } from './create-popover.svelte.js';
2
- export declare const getPopoverContext: () => CreatePopoverReturn, setPopoverContext: (context: CreatePopoverReturn | (() => CreatePopoverReturn)) => CreatePopoverReturn;
2
+ export declare const getPopoverContext: () => CreatePopoverReturn, setPopoverContext: (context: CreatePopoverReturn | (() => CreatePopoverReturn)) => void;
@@ -10,7 +10,7 @@ export interface CreatePresenceProps extends PresenceStrategyProps {
10
10
  present: boolean;
11
11
  }
12
12
  export interface CreatePresenceReturn {
13
- ref: Action;
13
+ setReference: Action;
14
14
  getPresenceProps(): HTMLAttributes<HTMLElement>;
15
15
  mounted: boolean;
16
16
  }
@@ -34,11 +34,11 @@ export function createPresence(props) {
34
34
  return true;
35
35
  return false;
36
36
  });
37
- const ref = (node) => {
37
+ const setReference = (node) => {
38
38
  api.setNode(node);
39
39
  };
40
40
  return {
41
- ref,
41
+ setReference,
42
42
  getPresenceProps,
43
43
  get mounted() {
44
44
  return !unmounted;
@@ -1,3 +1,3 @@
1
1
  import type { CreatePresenceReturn, PresenceStrategyProps } from './create-presence.svelte.js';
2
- export declare const getPresenceContext: () => CreatePresenceReturn, setPresenceContext: (context: CreatePresenceReturn | (() => CreatePresenceReturn)) => CreatePresenceReturn;
3
- export declare const getPresenceStrategyPropsContext: () => PresenceStrategyProps, setPresenceStrategyPropsContext: (context: PresenceStrategyProps | (() => PresenceStrategyProps)) => PresenceStrategyProps;
2
+ export declare const getPresenceContext: () => CreatePresenceReturn, setPresenceContext: (context: CreatePresenceReturn | (() => CreatePresenceReturn)) => void;
3
+ export declare const getPresenceStrategyPropsContext: () => PresenceStrategyProps, setPresenceStrategyPropsContext: (context: PresenceStrategyProps | (() => PresenceStrategyProps)) => void;
@@ -35,9 +35,9 @@
35
35
 
36
36
  {#if presence.mounted}
37
37
  {#if asChild}
38
- {@render asChild(presence.ref, mergedProps)}
38
+ {@render asChild(presence.setReference, mergedProps)}
39
39
  {:else}
40
- <div use:presence.ref {...mergedProps}>
40
+ <div use:presence.setReference {...mergedProps}>
41
41
  {@render children?.()}
42
42
  </div>
43
43
  {/if}
@@ -1,2 +1,2 @@
1
1
  import type { CreateProgressReturn } from './create-progress.svelte.js';
2
- export declare const getProgressContext: () => CreateProgressReturn, setProgressContext: (context: CreateProgressReturn | (() => CreateProgressReturn)) => CreateProgressReturn;
2
+ export declare const getProgressContext: () => CreateProgressReturn, setProgressContext: (context: CreateProgressReturn | (() => CreateProgressReturn)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateQrCodeReturn } from './create-qr-code.svelte.js';
2
- export declare const getQrCodeContext: () => CreateQrCodeReturn, setQrCodeContext: (context: CreateQrCodeReturn | (() => CreateQrCodeReturn)) => CreateQrCodeReturn;
2
+ export declare const getQrCodeContext: () => CreateQrCodeReturn, setQrCodeContext: (context: CreateQrCodeReturn | (() => CreateQrCodeReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/radio-group';
2
2
  import type { CreateRadioGroupReturn } from './create-radio-group.svelte.js';
3
- export declare const getRadioGroupContext: () => CreateRadioGroupReturn, setRadioGroupContext: (context: CreateRadioGroupReturn | (() => CreateRadioGroupReturn)) => CreateRadioGroupReturn;
4
- export declare const getRadioGroupItemPropsContext: () => ItemProps, setRadioGroupItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
3
+ export declare const getRadioGroupContext: () => CreateRadioGroupReturn, setRadioGroupContext: (context: CreateRadioGroupReturn | (() => CreateRadioGroupReturn)) => void;
4
+ export declare const getRadioGroupItemPropsContext: () => ItemProps, setRadioGroupItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateRatingGroupReturn } from './create-rating-group.svelte.js';
2
- export declare const getRatingGroupContext: () => CreateRatingGroupReturn, setRatingGroupContext: (context: CreateRatingGroupReturn | (() => CreateRatingGroupReturn)) => CreateRatingGroupReturn;
2
+ export declare const getRatingGroupContext: () => CreateRatingGroupReturn, setRatingGroupContext: (context: CreateRatingGroupReturn | (() => CreateRatingGroupReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/radio-group';
2
2
  import type { CreateSegmentGroupReturn } from './create-segment-group.svelte.js';
3
- export declare const getSegmentGroupContext: () => CreateSegmentGroupReturn, setSegmentGroupContext: (context: CreateSegmentGroupReturn | (() => CreateSegmentGroupReturn)) => CreateSegmentGroupReturn;
4
- export declare const getSegmentGroupItemPropsContext: () => ItemProps, setSegmentGroupItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
3
+ export declare const getSegmentGroupContext: () => CreateSegmentGroupReturn, setSegmentGroupContext: (context: CreateSegmentGroupReturn | (() => CreateSegmentGroupReturn)) => void;
4
+ export declare const getSegmentGroupItemPropsContext: () => ItemProps, setSegmentGroupItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
@@ -28,9 +28,9 @@
28
28
 
29
29
  {#if presence.mounted}
30
30
  {#if asChild}
31
- {@render asChild(presence.ref, mergedProps)}
31
+ {@render asChild(presence.setReference, mergedProps)}
32
32
  {:else}
33
- <div bind:this={ref} use:presence.ref {...mergedProps}>
33
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
34
34
  {@render children?.()}
35
35
  </div>
36
36
  {/if}
@@ -1,5 +1,5 @@
1
1
  import type { ItemGroupProps, ItemProps } from '@zag-js/select';
2
2
  import type { CreateSelectReturn } from './create-select.svelte.js';
3
- export declare const getSelectContext: () => CreateSelectReturn, setSelectContext: (context: CreateSelectReturn | (() => CreateSelectReturn)) => CreateSelectReturn;
4
- export declare const getSelectItemPropsContext: () => ItemProps<any>, setSelectItemPropsContext: (context: ItemProps<any> | (() => ItemProps<any>)) => ItemProps<any>;
5
- export declare const getSelectItemGroupPropsContext: () => ItemGroupProps, setSelectItemGroupPropsContext: (context: ItemGroupProps | (() => ItemGroupProps)) => ItemGroupProps;
3
+ export declare const getSelectContext: () => CreateSelectReturn, setSelectContext: (context: CreateSelectReturn | (() => CreateSelectReturn)) => void;
4
+ export declare const getSelectItemPropsContext: () => ItemProps<any>, setSelectItemPropsContext: (context: ItemProps<any> | (() => ItemProps<any>)) => void;
5
+ export declare const getSelectItemGroupPropsContext: () => ItemGroupProps, setSelectItemGroupPropsContext: (context: ItemGroupProps | (() => ItemGroupProps)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateSignaturePadReturn } from './create-signature-pad.svelte.js';
2
- export declare const getSignaturePadContext: () => CreateSignaturePadReturn, setSignaturePadContext: (context: CreateSignaturePadReturn | (() => CreateSignaturePadReturn)) => CreateSignaturePadReturn;
2
+ export declare const getSignaturePadContext: () => CreateSignaturePadReturn, setSignaturePadContext: (context: CreateSignaturePadReturn | (() => CreateSignaturePadReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ThumbProps } from '@zag-js/slider';
2
2
  import type { CreateSliderReturn } from './create-slider.svelte.js';
3
- export declare const getSliderContext: () => CreateSliderReturn, setSliderContext: (context: CreateSliderReturn | (() => CreateSliderReturn)) => CreateSliderReturn;
4
- export declare const getSliderThumbPropsContext: () => ThumbProps, setSliderThumbPropsContext: (context: ThumbProps | (() => ThumbProps)) => ThumbProps;
3
+ export declare const getSliderContext: () => CreateSliderReturn, setSliderContext: (context: CreateSliderReturn | (() => CreateSliderReturn)) => void;
4
+ export declare const getSliderThumbPropsContext: () => ThumbProps, setSliderThumbPropsContext: (context: ThumbProps | (() => ThumbProps)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateSplitterReturn } from './create-splitter.svelte.js';
2
- export declare const getSplitterContext: () => CreateSplitterReturn, setSplitterContext: (context: CreateSplitterReturn | (() => CreateSplitterReturn)) => CreateSplitterReturn;
2
+ export declare const getSplitterContext: () => CreateSplitterReturn, setSplitterContext: (context: CreateSplitterReturn | (() => CreateSplitterReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/steps';
2
2
  import type { CreateStepsReturn } from './create-steps.svelte.js';
3
- export declare const getStepsContext: () => CreateStepsReturn, setStepsContext: (context: CreateStepsReturn | (() => CreateStepsReturn)) => CreateStepsReturn;
4
- export declare const getStepsItemPropsContext: () => ItemProps, setStepsItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
3
+ export declare const getStepsContext: () => CreateStepsReturn, setStepsContext: (context: CreateStepsReturn | (() => CreateStepsReturn)) => void;
4
+ export declare const getStepsItemPropsContext: () => ItemProps, setStepsItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateSwitchReturn } from './create-switch.svelte.js';
2
- export declare const getSwitchContext: () => CreateSwitchReturn, setSwitchContext: (context: CreateSwitchReturn | (() => CreateSwitchReturn)) => CreateSwitchReturn;
2
+ export declare const getSwitchContext: () => CreateSwitchReturn, setSwitchContext: (context: CreateSwitchReturn | (() => CreateSwitchReturn)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateTabsReturn } from './create-tabs.svelte.js';
2
- export declare const getTabsContext: () => CreateTabsReturn, setTabsContext: (context: CreateTabsReturn | (() => CreateTabsReturn)) => CreateTabsReturn;
2
+ export declare const getTabsContext: () => CreateTabsReturn, setTabsContext: (context: CreateTabsReturn | (() => CreateTabsReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/tags-input';
2
2
  import type { CreateTagsInputReturn } from './create-tags-input.svelte.js';
3
- export declare const getTagsInputContext: () => CreateTagsInputReturn, setTagsInputContext: (context: CreateTagsInputReturn | (() => CreateTagsInputReturn)) => CreateTagsInputReturn;
4
- export declare const getTagsInputItemPropsContext: () => ItemProps, setTagsInputItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
3
+ export declare const getTagsInputContext: () => CreateTagsInputReturn, setTagsInputContext: (context: CreateTagsInputReturn | (() => CreateTagsInputReturn)) => void;
4
+ export declare const getTagsInputItemPropsContext: () => ItemProps, setTagsInputItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
@@ -31,9 +31,9 @@
31
31
  </script>
32
32
 
33
33
  {#if asChild}
34
- {@render asChild(presence.ref, mergedProps)}
34
+ {@render asChild(presence.setReference, mergedProps)}
35
35
  {:else}
36
- <div bind:this={ref} use:presence.ref {...mergedProps}>
36
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
37
37
  {@render children?.()}
38
38
  </div>
39
39
  {/if}
@@ -1,2 +1,2 @@
1
1
  import type { CreateTimePickerReturn } from './create-time-picker.svelte.js';
2
- export declare const getTimePickerContext: () => CreateTimePickerReturn, setTimePickerContext: (context: CreateTimePickerReturn | (() => CreateTimePickerReturn)) => CreateTimePickerReturn;
2
+ export declare const getTimePickerContext: () => CreateTimePickerReturn, setTimePickerContext: (context: CreateTimePickerReturn | (() => CreateTimePickerReturn)) => void;
@@ -1,4 +1,4 @@
1
1
  import type { ItemProps } from '@zag-js/timer';
2
2
  import type { CreateTimerReturn } from './create-timer.svelte.js';
3
- export declare const getTimerContext: () => CreateTimerReturn, setTimerContext: (context: CreateTimerReturn | (() => CreateTimerReturn)) => CreateTimerReturn;
4
- export declare const getTimerItemPropsContext: () => ItemProps, setTimerItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
3
+ export declare const getTimerContext: () => CreateTimerReturn, setTimerContext: (context: CreateTimerReturn | (() => CreateTimerReturn)) => void;
4
+ export declare const getTimerItemPropsContext: () => ItemProps, setTimerItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateToastReturn } from './create-toast.svelte.js';
2
- export declare const getToastContext: () => CreateToastReturn, setToastContext: (context: CreateToastReturn | (() => CreateToastReturn)) => CreateToastReturn;
2
+ export declare const getToastContext: () => CreateToastReturn, setToastContext: (context: CreateToastReturn | (() => CreateToastReturn)) => void;
@@ -1,2 +1,2 @@
1
1
  import type { CreateToggleGroupReturn } from './create-toggle-group.svelte.js';
2
- export declare const getToggleGroupContext: () => CreateToggleGroupReturn, setToggleGroupContext: (context: CreateToggleGroupReturn | (() => CreateToggleGroupReturn)) => CreateToggleGroupReturn;
2
+ export declare const getToggleGroupContext: () => CreateToggleGroupReturn, setToggleGroupContext: (context: CreateToggleGroupReturn | (() => CreateToggleGroupReturn)) => void;
@@ -28,9 +28,9 @@
28
28
 
29
29
  {#if presence.mounted}
30
30
  {#if asChild}
31
- {@render asChild(presence.ref, mergedProps)}
31
+ {@render asChild(presence.setReference, mergedProps)}
32
32
  {:else}
33
- <div bind:this={ref} use:presence.ref {...mergedProps}>
33
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
34
34
  {@render children?.()}
35
35
  </div>
36
36
  {/if}
@@ -1,2 +1,2 @@
1
1
  import type { CreateTooltipReturn } from './create-tooltip.svelte.js';
2
- export declare const getTooltipContext: () => CreateTooltipReturn, setTooltipContext: (context: CreateTooltipReturn | (() => CreateTooltipReturn)) => CreateTooltipReturn;
2
+ export declare const getTooltipContext: () => CreateTooltipReturn, setTooltipContext: (context: CreateTooltipReturn | (() => CreateTooltipReturn)) => void;
@@ -29,7 +29,7 @@
29
29
  {#if asChild}
30
30
  {@render asChild(mergedProps)}
31
31
  {:else}
32
- <div bind:this={ref} use:presence.ref {...mergedProps}>
32
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
33
33
  {@render children?.()}
34
34
  </div>
35
35
  {/if}
@@ -1,2 +1,2 @@
1
1
  import { type CreateTourReturn } from './create-tour.svelte.js';
2
- export declare const getTourContext: () => CreateTourReturn, setTourContext: (context: CreateTourReturn | (() => CreateTourReturn)) => CreateTourReturn;
2
+ export declare const getTourContext: () => CreateTourReturn, setTourContext: (context: CreateTourReturn | (() => CreateTourReturn)) => void;
@@ -37,7 +37,7 @@
37
37
  {#if asChild}
38
38
  {@render asChild(mergedProps)}
39
39
  {:else}
40
- <div bind:this={ref} use:presence.ref {...mergedProps}>
40
+ <div bind:this={ref} use:presence.setReference {...mergedProps}>
41
41
  {@render children?.()}
42
42
  </div>
43
43
  {/if}
@@ -1,12 +1,16 @@
1
1
  <script lang="ts" module>
2
2
  import type {HtmlIngredientProps} from '../types.js';
3
+ import type {Action} from 'svelte/action';
3
4
 
4
5
  export interface TreeViewBranchContentProps
5
- extends HtmlIngredientProps<'div', HTMLDivElement> {}
6
+ extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
6
7
  </script>
7
8
 
8
9
  <script lang="ts">
9
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';
10
14
  import {
11
15
  getTreeViewBranchPropsContext,
12
16
  getTreeViewContext,
@@ -22,16 +26,31 @@
22
26
  let treeView = getTreeViewContext();
23
27
 
24
28
  let branchProps = getTreeViewBranchPropsContext();
29
+ let branchState = $derived(treeView.getBranchState(branchProps));
30
+
31
+ let presenceStrategyProps = getPresenceStrategyPropsContext();
32
+ let presence = createPresence(
33
+ reflect(() => ({
34
+ present: branchState.expanded,
35
+ ...presenceStrategyProps,
36
+ })),
37
+ );
25
38
 
26
39
  let mergedProps = $derived(
27
- mergeProps(treeView.getBranchContentProps(branchProps), props),
40
+ mergeProps(
41
+ treeView.getBranchContentProps(branchProps),
42
+ presence.getPresenceProps(),
43
+ props,
44
+ ),
28
45
  );
29
46
  </script>
30
47
 
31
- {#if asChild}
32
- {@render asChild(mergedProps)}
33
- {:else}
34
- <div bind:this={ref} {...mergedProps}>
35
- {@render children?.()}
36
- </div>
48
+ {#if presence.mounted}
49
+ {#if asChild}
50
+ {@render asChild(presence.setReference, mergedProps)}
51
+ {:else}
52
+ <div bind:this={ref} {...mergedProps}>
53
+ {@render children?.()}
54
+ </div>
55
+ {/if}
37
56
  {/if}
@@ -1,5 +1,6 @@
1
1
  import type { HtmlIngredientProps } from '../types.js';
2
- export interface TreeViewBranchContentProps extends HtmlIngredientProps<'div', HTMLDivElement> {
2
+ import type { Action } from 'svelte/action';
3
+ export interface TreeViewBranchContentProps 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,5 +1,5 @@
1
1
  import type { BranchProps, ItemProps } from '@zag-js/tree-view';
2
2
  import type { CreateTreeViewReturn } from './create-tree-view.svelte.js';
3
- export declare const getTreeViewContext: () => CreateTreeViewReturn, setTreeViewContext: (context: CreateTreeViewReturn | (() => CreateTreeViewReturn)) => CreateTreeViewReturn;
4
- export declare const getTreeViewItemPropsContext: () => ItemProps, setTreeViewItemPropsContext: (context: ItemProps | (() => ItemProps)) => ItemProps;
5
- export declare const getTreeViewBranchPropsContext: () => BranchProps, setTreeViewBranchPropsContext: (context: BranchProps | (() => BranchProps)) => BranchProps;
3
+ export declare const getTreeViewContext: () => CreateTreeViewReturn, setTreeViewContext: (context: CreateTreeViewReturn | (() => CreateTreeViewReturn)) => void;
4
+ export declare const getTreeViewItemPropsContext: () => ItemProps, setTreeViewItemPropsContext: (context: ItemProps | (() => ItemProps)) => void;
5
+ export declare const getTreeViewBranchPropsContext: () => BranchProps, setTreeViewBranchPropsContext: (context: BranchProps | (() => BranchProps)) => void;
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" module>
2
+ import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
2
3
  import type {Assign, HtmlIngredientProps} from '../types.js';
3
4
  import type {
4
5
  CreateTreeViewProps,
@@ -7,13 +8,15 @@
7
8
 
8
9
  export interface TreeViewProps
9
10
  extends Assign<
10
- HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>,
11
- CreateTreeViewProps
12
- > {}
11
+ HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>,
12
+ CreateTreeViewProps
13
+ >,
14
+ PresenceStrategyProps {}
13
15
  </script>
14
16
 
15
17
  <script lang="ts">
16
18
  import {mergeProps} from '../merge-props.js';
19
+ import {setPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
17
20
  import {reflect} from '@zag-js/svelte';
18
21
  import {createSplitProps} from '@zag-js/utils';
19
22
  import {createTreeView} from './create-tree-view.svelte.js';
@@ -26,6 +29,12 @@
26
29
  ...props
27
30
  }: TreeViewProps = $props();
28
31
 
32
+ let [presenceStrategyProps, rest] = $derived(
33
+ createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
34
+ props,
35
+ ),
36
+ );
37
+
29
38
  let [createTreeViewProps, localProps] = $derived(
30
39
  createSplitProps<CreateTreeViewProps>([
31
40
  'id',
@@ -39,14 +48,14 @@
39
48
  'onFocusChange',
40
49
  'onExpandedChange',
41
50
  'onSelectionChange',
42
- ])(props),
51
+ ])(rest),
43
52
  );
44
53
 
45
54
  let treeView = createTreeView(reflect(() => createTreeViewProps));
46
-
47
55
  let mergedProps = $derived(mergeProps(treeView.getRootProps(), localProps));
48
56
 
49
57
  setTreeViewContext(treeView);
58
+ setPresenceStrategyPropsContext(() => presenceStrategyProps);
50
59
  </script>
51
60
 
52
61
  {#if asChild}
@@ -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 { CreateTreeViewProps, CreateTreeViewReturn } from './create-tree-view.svelte.js';
3
- export interface TreeViewProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>, CreateTreeViewProps> {
4
+ export interface TreeViewProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateTreeViewReturn>, CreateTreeViewProps>, 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> & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.66",
4
+ "version": "0.0.68",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -1,2 +0,0 @@
1
- import type { GenericObject } from './types.js';
2
- export declare function isObject<T extends GenericObject>(value: unknown): value is T;