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.
- package/README.md +0 -2
- package/dist/accordion/accordion-item-content.svelte +2 -2
- package/dist/accordion/avatar-context.svelte.d.ts +2 -2
- package/dist/avatar/avatar-context.svelte.d.ts +1 -1
- package/dist/carousel/carousel-context.svelte.d.ts +1 -1
- package/dist/checkbox/checkbox-context.svelte.d.ts +1 -1
- package/dist/clipboard/clipboard-context.svelte.d.ts +1 -1
- package/dist/collapsible/collapsible-content.svelte +19 -8
- package/dist/collapsible/collapsible-content.svelte.d.ts +2 -1
- package/dist/collapsible/collapsible-context.svelte.d.ts +1 -1
- package/dist/collapsible/collapsible-root.svelte +23 -4
- package/dist/collapsible/collapsible-root.svelte.d.ts +2 -1
- package/dist/collapsible/collapsible-trigger.svelte +0 -1
- package/dist/color-picker/color-picker-channel-slider-value-text.svelte +4 -1
- package/dist/color-picker/color-picker-content.svelte +2 -2
- package/dist/color-picker/color-picker-context.svelte.d.ts +6 -8
- package/dist/combobox/combobox-content.svelte +2 -2
- package/dist/combobox/combobox-context.svelte.d.ts +3 -3
- package/dist/create-context.svelte.d.ts +7 -4
- package/dist/create-context.svelte.js +26 -15
- package/dist/date-picker/date-picker-content.svelte +2 -2
- package/dist/date-picker/date-picker-context.svelte.d.ts +5 -5
- package/dist/dialog/dialog-backdrop.svelte +2 -2
- package/dist/dialog/dialog-content.svelte +2 -2
- package/dist/dialog/dialog-context.svelte.d.ts +1 -1
- package/dist/editable/editable-context.svelte.d.ts +1 -1
- package/dist/environment-provider/enviroment-provider-context.svelte.d.ts +1 -1
- package/dist/field/field-context.svelte.d.ts +1 -1
- package/dist/field/field-error-text.svelte +3 -1
- package/dist/field/field-helper-text.svelte +3 -1
- package/dist/field/field-input.svelte +1 -1
- package/dist/field/field-label.svelte +1 -1
- package/dist/field/field-select.svelte +1 -1
- package/dist/field/field-textarea.svelte +3 -1
- package/dist/file-upload/file-upload-context.svelte.d.ts +2 -2
- package/dist/floating-panel/floating-panel-content.svelte +2 -2
- package/dist/floating-panel/floating-panel-context.svelte.d.ts +1 -1
- package/dist/hover-card/hover-card-content.svelte +2 -2
- package/dist/hover-card/hover-card-context.svelte.d.ts +1 -1
- package/dist/is-pojo.d.ts +2 -0
- package/dist/{is-object.js → is-pojo.js} +1 -1
- package/dist/locale-provider/local-provider-context.svelte.d.ts +1 -1
- package/dist/menu/menu-arrow-tip.svelte +1 -1
- package/dist/menu/menu-arrow.svelte +1 -1
- package/dist/menu/menu-content.svelte +3 -3
- package/dist/menu/menu-context-trigger.svelte +1 -1
- package/dist/menu/menu-context.svelte.d.ts +4 -4
- package/dist/menu/menu-indicator.svelte +1 -1
- package/dist/menu/menu-item-group-label.svelte +1 -1
- package/dist/menu/menu-item-group.svelte +1 -1
- package/dist/menu/menu-item.svelte +2 -2
- package/dist/menu/menu-option-item-indicator.svelte +1 -1
- package/dist/menu/menu-option-item-text.svelte +1 -1
- package/dist/menu/menu-option-item.svelte +2 -2
- package/dist/menu/menu-positioner.svelte +1 -1
- package/dist/menu/menu-separator.svelte +1 -1
- package/dist/menu/menu-trigger.svelte +1 -1
- package/dist/merge-props.js +2 -2
- package/dist/number-input/number-input-context.svelte.d.ts +1 -1
- package/dist/pagination/pagination-context.svelte.d.ts +1 -1
- package/dist/pin-input/pin-input-context.svelte.d.ts +1 -1
- package/dist/popover/popover-content.svelte +2 -2
- package/dist/popover/popover-context.svelte.d.ts +1 -1
- package/dist/presence/create-presence.svelte.d.ts +1 -1
- package/dist/presence/create-presence.svelte.js +2 -2
- package/dist/presence/presence-context.svelte.d.ts +2 -2
- package/dist/presence/presence.svelte +2 -2
- package/dist/progress/progress-context.svelte.d.ts +1 -1
- package/dist/qr-code/qr-code-context.svelte.d.ts +1 -1
- package/dist/radio-group/radio-group-context.svelte.d.ts +2 -2
- package/dist/rating-group/rating-group-context.svelte.d.ts +1 -1
- package/dist/segment-group/segment-group-context.svelte.d.ts +2 -2
- package/dist/select/select-content.svelte +2 -2
- package/dist/select/select-context.svelte.d.ts +3 -3
- package/dist/signature-pad/signature-pad-context.svelte.d.ts +1 -1
- package/dist/slider/slider-context.svelte.d.ts +2 -2
- package/dist/splitter/splitter-context.svelte.d.ts +1 -1
- package/dist/steps/steps-context.svelte.d.ts +2 -2
- package/dist/switch/switch-context.svelte.d.ts +1 -1
- package/dist/tabs/tabs-context.svelte.d.ts +1 -1
- package/dist/tags-input/tags-input-context.svelte.d.ts +2 -2
- package/dist/time-picker/time-picker-content.svelte +2 -2
- package/dist/time-picker/time-picker-context.svelte.d.ts +1 -1
- package/dist/timer/timer-context.svelte.d.ts +2 -2
- package/dist/toast/toast-context.svelte.d.ts +1 -1
- package/dist/toggle-group/toggle-group-context.svelte.d.ts +1 -1
- package/dist/tooltip/tooltip-content.svelte +2 -2
- package/dist/tooltip/tooltip-context.svelte.d.ts +1 -1
- package/dist/tour/tour-content.svelte +1 -1
- package/dist/tour/tour-context.svelte.d.ts +1 -1
- package/dist/tour/tour-overlay.svelte +1 -1
- package/dist/tree-view/tree-view-branch-content.svelte +27 -8
- package/dist/tree-view/tree-view-branch-content.svelte.d.ts +2 -1
- package/dist/tree-view/tree-view-context.svelte.d.ts +3 -3
- package/dist/tree-view/tree-view-root.svelte +14 -5
- package/dist/tree-view/tree-view-root.svelte.d.ts +2 -1
- package/package.json +1 -1
- package/dist/is-object.d.ts +0 -2
@@ -32,9 +32,9 @@
|
|
32
32
|
])(props),
|
33
33
|
);
|
34
34
|
|
35
|
-
let itemState = $derived(menu
|
35
|
+
let itemState = $derived(menu!.getItemState(itemProps));
|
36
36
|
let mergedProps = $derived(
|
37
|
-
mergeProps(menu
|
37
|
+
mergeProps(menu!.getItemProps(itemProps), localProps),
|
38
38
|
);
|
39
39
|
</script>
|
40
40
|
|
@@ -38,10 +38,10 @@
|
|
38
38
|
])(props),
|
39
39
|
);
|
40
40
|
|
41
|
-
let itemState = $derived(menu
|
41
|
+
let itemState = $derived(menu!.getOptionItemState(itemProps));
|
42
42
|
|
43
43
|
let mergedProps = $derived(
|
44
|
-
mergeProps(menu
|
44
|
+
mergeProps(menu!.getOptionItemProps(itemProps), localProps),
|
45
45
|
);
|
46
46
|
|
47
47
|
setMenuOptionItemPropsContext(() => itemProps);
|
package/dist/merge-props.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import { mergeProps as fn } from '@zag-js/svelte';
|
2
|
-
import {
|
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] &&
|
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)) =>
|
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)) =>
|
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)) =>
|
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.
|
31
|
+
{@render asChild(presence.setReference, mergedProps)}
|
32
32
|
{:else}
|
33
|
-
<div bind:this={ref} use:presence.
|
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)) =>
|
2
|
+
export declare const getPopoverContext: () => CreatePopoverReturn, setPopoverContext: (context: CreatePopoverReturn | (() => CreatePopoverReturn)) => void;
|
@@ -34,11 +34,11 @@ export function createPresence(props) {
|
|
34
34
|
return true;
|
35
35
|
return false;
|
36
36
|
});
|
37
|
-
const
|
37
|
+
const setReference = (node) => {
|
38
38
|
api.setNode(node);
|
39
39
|
};
|
40
40
|
return {
|
41
|
-
|
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)) =>
|
3
|
-
export declare const getPresenceStrategyPropsContext: () => PresenceStrategyProps, setPresenceStrategyPropsContext: (context: 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.
|
38
|
+
{@render asChild(presence.setReference, mergedProps)}
|
39
39
|
{:else}
|
40
|
-
<div use:presence.
|
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)) =>
|
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)) =>
|
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)) =>
|
4
|
-
export declare const getRadioGroupItemPropsContext: () => ItemProps, setRadioGroupItemPropsContext: (context: 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)) =>
|
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)) =>
|
4
|
-
export declare const getSegmentGroupItemPropsContext: () => ItemProps, setSegmentGroupItemPropsContext: (context: 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.
|
31
|
+
{@render asChild(presence.setReference, mergedProps)}
|
32
32
|
{:else}
|
33
|
-
<div bind:this={ref} use:presence.
|
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)) =>
|
4
|
-
export declare const getSelectItemPropsContext: () => ItemProps<any>, setSelectItemPropsContext: (context: ItemProps<any> | (() => ItemProps<any>)) =>
|
5
|
-
export declare const getSelectItemGroupPropsContext: () => ItemGroupProps, setSelectItemGroupPropsContext: (context: 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)) =>
|
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)) =>
|
4
|
-
export declare const getSliderThumbPropsContext: () => ThumbProps, setSliderThumbPropsContext: (context: 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)) =>
|
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)) =>
|
4
|
-
export declare const getStepsItemPropsContext: () => ItemProps, setStepsItemPropsContext: (context: 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)) =>
|
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)) =>
|
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)) =>
|
4
|
-
export declare const getTagsInputItemPropsContext: () => ItemProps, setTagsInputItemPropsContext: (context: 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.
|
34
|
+
{@render asChild(presence.setReference, mergedProps)}
|
35
35
|
{:else}
|
36
|
-
<div bind:this={ref} use:presence.
|
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)) =>
|
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)) =>
|
4
|
-
export declare const getTimerItemPropsContext: () => ItemProps, setTimerItemPropsContext: (context: 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)) =>
|
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)) =>
|
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.
|
31
|
+
{@render asChild(presence.setReference, mergedProps)}
|
32
32
|
{:else}
|
33
|
-
<div bind:this={ref} use:presence.
|
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)) =>
|
2
|
+
export declare const getTooltipContext: () => CreateTooltipReturn, setTooltipContext: (context: CreateTooltipReturn | (() => CreateTooltipReturn)) => void;
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { type CreateTourReturn } from './create-tour.svelte.js';
|
2
|
-
export declare const getTourContext: () => CreateTourReturn, setTourContext: (context: CreateTourReturn | (() => CreateTourReturn)) =>
|
2
|
+
export declare const getTourContext: () => CreateTourReturn, setTourContext: (context: CreateTourReturn | (() => CreateTourReturn)) => void;
|
@@ -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(
|
40
|
+
mergeProps(
|
41
|
+
treeView.getBranchContentProps(branchProps),
|
42
|
+
presence.getPresenceProps(),
|
43
|
+
props,
|
44
|
+
),
|
28
45
|
);
|
29
46
|
</script>
|
30
47
|
|
31
|
-
{#if
|
32
|
-
{
|
33
|
-
{
|
34
|
-
|
35
|
-
{
|
36
|
-
|
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
|
-
|
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)) =>
|
4
|
-
export declare const getTreeViewItemPropsContext: () => ItemProps, setTreeViewItemPropsContext: (context: ItemProps | (() => ItemProps)) =>
|
5
|
-
export declare const getTreeViewBranchPropsContext: () => BranchProps, setTreeViewBranchPropsContext: (context: 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
|
-
|
11
|
-
|
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
|
-
])(
|
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
package/dist/is-object.d.ts
DELETED