ui-ingredients 0.0.19 → 0.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/dist/accordion/create-accordion.svelte.js +4 -4
- package/dist/accordion/item-content.svelte +2 -3
- package/dist/accordion/item-indicator.svelte +2 -3
- package/dist/accordion/item-trigger.svelte +2 -3
- package/dist/accordion/item.svelte +3 -4
- package/dist/accordion/root.svelte +5 -5
- package/dist/avatar/create-avatar.svelte.js +4 -4
- package/dist/avatar/fallback.svelte +2 -2
- package/dist/avatar/image.svelte +2 -2
- package/dist/avatar/root.svelte +5 -5
- package/dist/carousel/create-carousel.svelte.js +4 -4
- package/dist/carousel/indicator-group.svelte +2 -2
- package/dist/carousel/indicator.svelte +2 -2
- package/dist/carousel/item-group.svelte +2 -2
- package/dist/carousel/item.svelte +3 -3
- package/dist/carousel/next-trigger.svelte +2 -2
- package/dist/carousel/prev-trigger.svelte +2 -2
- package/dist/carousel/root.svelte +5 -5
- package/dist/carousel/viewport.svelte +2 -2
- package/dist/checkbox/control.svelte +2 -2
- package/dist/checkbox/create-checkbox.svelte.js +4 -4
- package/dist/checkbox/hidden-input.svelte +2 -2
- package/dist/checkbox/indicator.svelte +2 -2
- package/dist/checkbox/label.svelte +2 -2
- package/dist/checkbox/root.svelte +5 -5
- package/dist/clipboard/control.svelte +2 -2
- package/dist/clipboard/create-clipboard.svelte.js +2 -2
- package/dist/clipboard/indicator.svelte +2 -2
- package/dist/clipboard/input.svelte +2 -2
- package/dist/clipboard/label.svelte +2 -2
- package/dist/clipboard/root.svelte +5 -5
- package/dist/clipboard/trigger.svelte +2 -2
- package/dist/collapsible/content.svelte +2 -2
- package/dist/collapsible/create-collapsible.svelte.js +4 -4
- package/dist/collapsible/root.svelte +5 -5
- package/dist/collapsible/trigger.svelte +3 -3
- package/dist/combobox/clear-trigger.svelte +2 -2
- package/dist/combobox/content.svelte +2 -2
- package/dist/combobox/control.svelte +2 -2
- package/dist/combobox/create-combobox.svelte.js +4 -4
- package/dist/combobox/input.svelte +2 -2
- package/dist/combobox/item-group-label.svelte +2 -3
- package/dist/combobox/item-group.svelte +2 -2
- package/dist/combobox/item-indicator.svelte +2 -3
- package/dist/combobox/item-text.svelte +3 -4
- package/dist/combobox/item.svelte +3 -4
- package/dist/combobox/label.svelte +2 -2
- package/dist/combobox/list.svelte +2 -2
- package/dist/combobox/positioner.svelte +2 -2
- package/dist/combobox/root.svelte +5 -5
- package/dist/combobox/trigger.svelte +2 -2
- package/dist/date-picker/anatomy.js +3 -0
- package/dist/date-picker/clear-trigger.svelte +19 -2
- package/dist/date-picker/clear-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/content.svelte +19 -2
- package/dist/date-picker/content.svelte.d.ts +3 -3
- package/dist/date-picker/context.svelte.d.ts +8 -8
- package/dist/date-picker/context.svelte.js +6 -14
- package/dist/date-picker/control.svelte +19 -2
- package/dist/date-picker/control.svelte.d.ts +3 -3
- package/dist/date-picker/create-date-picker.svelte.d.ts +14 -0
- package/dist/date-picker/create-date-picker.svelte.js +24 -0
- package/dist/date-picker/date-picker.d.ts +3 -3
- package/dist/date-picker/date-picker.js +3 -3
- package/dist/date-picker/day-table-cell-trigger.svelte +20 -2
- package/dist/date-picker/day-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/day-table-cell.svelte +39 -2
- package/dist/date-picker/day-table-cell.svelte.d.ts +3 -3
- package/dist/date-picker/index.d.ts +29 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-picker/input.svelte +18 -2
- package/dist/date-picker/input.svelte.d.ts +3 -3
- package/dist/date-picker/label.svelte +20 -2
- package/dist/date-picker/label.svelte.d.ts +3 -3
- package/dist/date-picker/month-select.svelte +40 -2
- package/dist/date-picker/month-select.svelte.d.ts +3 -3
- package/dist/date-picker/month-table-cell-trigger.svelte +20 -2
- package/dist/date-picker/month-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/month-table-cell.svelte +39 -2
- package/dist/date-picker/month-table-cell.svelte.d.ts +3 -3
- package/dist/date-picker/next-trigger.svelte +20 -2
- package/dist/date-picker/next-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/positioner.svelte +19 -2
- package/dist/date-picker/positioner.svelte.d.ts +3 -3
- package/dist/date-picker/preset-trigger.svelte +21 -2
- package/dist/date-picker/preset-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/prev-trigger.svelte +20 -2
- package/dist/date-picker/prev-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/range-text.svelte +23 -2
- package/dist/date-picker/range-text.svelte.d.ts +3 -3
- package/dist/date-picker/root.svelte +87 -2
- package/dist/date-picker/root.svelte.d.ts +3 -3
- package/dist/date-picker/table-body.svelte +20 -2
- package/dist/date-picker/table-body.svelte.d.ts +3 -3
- package/dist/date-picker/table-head.svelte +20 -2
- package/dist/date-picker/table-head.svelte.d.ts +3 -3
- package/dist/date-picker/table-header.svelte +20 -2
- package/dist/date-picker/table-header.svelte.d.ts +3 -3
- package/dist/date-picker/table-row.svelte +20 -2
- package/dist/date-picker/table-row.svelte.d.ts +3 -3
- package/dist/date-picker/table.svelte +29 -2
- package/dist/date-picker/table.svelte.d.ts +3 -3
- package/dist/date-picker/trigger.svelte +19 -2
- package/dist/date-picker/trigger.svelte.d.ts +3 -3
- package/dist/date-picker/view-control.svelte +20 -2
- package/dist/date-picker/view-control.svelte.d.ts +3 -3
- package/dist/date-picker/view.svelte +24 -0
- package/dist/date-picker/{view-trigger.svelte.d.ts → view.svelte.d.ts} +5 -5
- package/dist/date-picker/year-select.svelte +40 -2
- package/dist/date-picker/year-select.svelte.d.ts +3 -3
- package/dist/date-picker/year-table-cell-trigger.svelte +20 -2
- package/dist/date-picker/year-table-cell-trigger.svelte.d.ts +3 -3
- package/dist/date-picker/year-table-cell.svelte +39 -2
- package/dist/date-picker/year-table-cell.svelte.d.ts +3 -3
- package/dist/dialog/backdrop.svelte +2 -2
- package/dist/dialog/close-trigger.svelte +2 -2
- package/dist/dialog/content.svelte +2 -2
- package/dist/dialog/create-dialog.svelte.js +4 -4
- package/dist/dialog/description.svelte +2 -2
- package/dist/dialog/positioner.svelte +2 -2
- package/dist/dialog/root.svelte +4 -4
- package/dist/dialog/title.svelte +2 -2
- package/dist/dialog/trigger.svelte +2 -2
- package/dist/editable/area.svelte +2 -2
- package/dist/editable/cancel-trigger.svelte +2 -2
- package/dist/editable/control.svelte +2 -2
- package/dist/editable/create-editable.svelte.js +4 -4
- package/dist/editable/edit-trigger.svelte +2 -2
- package/dist/editable/input.svelte +2 -2
- package/dist/editable/label.svelte +2 -2
- package/dist/editable/preview.svelte +3 -3
- package/dist/editable/root.svelte +4 -4
- package/dist/editable/submit-trigger.svelte +2 -2
- package/dist/environment-provider/root.svelte +2 -2
- package/dist/file-upload/context.svelte.d.ts +5 -8
- package/dist/file-upload/context.svelte.js +3 -14
- package/dist/file-upload/create-file-upload.svelte.d.ts +7 -0
- package/dist/file-upload/create-file-upload.svelte.js +18 -0
- package/dist/file-upload/dropzone.svelte +19 -2
- package/dist/file-upload/dropzone.svelte.d.ts +3 -3
- package/dist/file-upload/hidden-input.svelte +17 -2
- package/dist/file-upload/hidden-input.svelte.d.ts +3 -3
- package/dist/file-upload/index.d.ts +13 -0
- package/dist/file-upload/index.js +1 -0
- package/dist/file-upload/item-delete-trigger.svelte +20 -2
- package/dist/file-upload/item-delete-trigger.svelte.d.ts +3 -3
- package/dist/file-upload/item-group.svelte +19 -2
- package/dist/file-upload/item-group.svelte.d.ts +3 -3
- package/dist/file-upload/item-name.svelte +24 -2
- package/dist/file-upload/item-name.svelte.d.ts +3 -3
- package/dist/file-upload/item-preview-image.svelte +26 -2
- package/dist/file-upload/item-preview-image.svelte.d.ts +3 -3
- package/dist/file-upload/item-preview.svelte +20 -2
- package/dist/file-upload/item-preview.svelte.d.ts +3 -3
- package/dist/file-upload/item-size-text.svelte +24 -2
- package/dist/file-upload/item-size-text.svelte.d.ts +3 -3
- package/dist/file-upload/item.svelte +25 -2
- package/dist/file-upload/item.svelte.d.ts +3 -3
- package/dist/file-upload/label.svelte +19 -2
- package/dist/file-upload/label.svelte.d.ts +3 -3
- package/dist/file-upload/root.svelte +67 -2
- package/dist/file-upload/root.svelte.d.ts +3 -3
- package/dist/file-upload/trigger.svelte +19 -2
- package/dist/file-upload/trigger.svelte.d.ts +3 -3
- package/dist/hover-card/arrow-tip.svelte +2 -2
- package/dist/hover-card/arrow.svelte +2 -2
- package/dist/hover-card/content.svelte +2 -2
- package/dist/hover-card/create-hover-card.svelte.js +4 -4
- package/dist/hover-card/positioner.svelte +2 -2
- package/dist/hover-card/root.svelte +4 -4
- package/dist/hover-card/trigger.svelte +2 -2
- package/dist/locale-provider/root.svelte +2 -2
- package/dist/menu/arrow-tip.svelte +2 -2
- package/dist/menu/arrow.svelte +2 -2
- package/dist/menu/context-trigger.svelte +2 -2
- package/dist/menu/create-menu.svelte.js +4 -4
- package/dist/menu/indicator.svelte +2 -2
- package/dist/menu/item-group-label.svelte +2 -3
- package/dist/menu/item-group.svelte +2 -2
- package/dist/menu/item.svelte +3 -4
- package/dist/menu/option-item-indicator.svelte +2 -3
- package/dist/menu/option-item-text.svelte +2 -3
- package/dist/menu/option-item.svelte +3 -4
- package/dist/menu/positioner.svelte +2 -2
- package/dist/menu/root.svelte +4 -4
- package/dist/menu/separator.svelte +2 -2
- package/dist/menu/trigger-item.svelte +2 -2
- package/dist/menu/trigger.svelte +2 -2
- package/dist/number-input/control.svelte +2 -2
- package/dist/number-input/create-number-input.svelte.d.ts +1 -1
- package/dist/number-input/create-number-input.svelte.js +5 -5
- package/dist/number-input/decrement-trigger.svelte +2 -2
- package/dist/number-input/increment-trigger.svelte +2 -2
- package/dist/number-input/input.svelte +2 -2
- package/dist/number-input/label.svelte +2 -2
- package/dist/number-input/root.svelte +7 -5
- package/dist/number-input/scrubber.svelte +2 -2
- package/dist/pagination/create-pagination.svelte.js +4 -4
- package/dist/pagination/ellipsis.svelte +2 -2
- package/dist/pagination/item.svelte +2 -2
- package/dist/pagination/next-trigger.svelte +2 -2
- package/dist/pagination/prev-trigger.svelte +2 -2
- package/dist/pagination/root.svelte +5 -5
- package/dist/pin-input/clear-trigger.svelte +2 -2
- package/dist/pin-input/create-pin-input.svelte.js +4 -4
- package/dist/pin-input/hidden-input.svelte +2 -2
- package/dist/pin-input/input.svelte +2 -2
- package/dist/pin-input/label.svelte +2 -2
- package/dist/pin-input/root.svelte +5 -5
- package/dist/popover/arrow-tip.svelte +2 -2
- package/dist/popover/arrow.svelte +2 -2
- package/dist/popover/close-trigger.svelte +2 -2
- package/dist/popover/content.svelte +2 -2
- package/dist/popover/create-popover.svelte.js +4 -4
- package/dist/popover/description.svelte +2 -2
- package/dist/popover/positioner.svelte +2 -2
- package/dist/popover/root.svelte +4 -4
- package/dist/popover/title.svelte +2 -2
- package/dist/popover/trigger.svelte +2 -2
- package/dist/portal/root.svelte +2 -4
- package/dist/presence/create-presence.svelte.d.ts +10 -0
- package/dist/presence/create-presence.svelte.js +19 -0
- package/dist/presence/root.svelte +11 -20
- package/dist/progress/circle-range.svelte +2 -2
- package/dist/progress/circle-track.svelte +2 -2
- package/dist/progress/circle.svelte +2 -2
- package/dist/progress/create-progress.svelte.js +4 -4
- package/dist/progress/label.svelte +2 -2
- package/dist/progress/range.svelte +2 -2
- package/dist/progress/root.svelte +5 -5
- package/dist/progress/track.svelte +2 -2
- package/dist/progress/value-text.svelte +3 -3
- package/dist/qr-code/create-qr-code.svelte.js +4 -4
- package/dist/qr-code/frame.svelte +2 -2
- package/dist/qr-code/overlay.svelte +2 -2
- package/dist/qr-code/pattern.svelte +2 -2
- package/dist/qr-code/root.svelte +5 -5
- package/dist/radio-group/create-radio-group.svelte.js +4 -4
- package/dist/radio-group/indicator.svelte +2 -2
- package/dist/radio-group/item-control.svelte +2 -3
- package/dist/radio-group/item-hidden-input.svelte +2 -3
- package/dist/radio-group/item-text.svelte +2 -3
- package/dist/radio-group/item.svelte +3 -4
- package/dist/radio-group/label.svelte +2 -2
- package/dist/radio-group/root.svelte +5 -5
- package/dist/rating-group/control.svelte +2 -2
- package/dist/rating-group/create-rating-group.svelte.js +4 -4
- package/dist/rating-group/hidden-input.svelte +2 -2
- package/dist/rating-group/item.svelte +3 -4
- package/dist/rating-group/label.svelte +2 -2
- package/dist/rating-group/root.svelte +5 -5
- package/dist/segment-group/create-segment-group.svelte.js +4 -4
- package/dist/segment-group/indicator.svelte +2 -2
- package/dist/segment-group/item-control.svelte +2 -3
- package/dist/segment-group/item-hidden-input.svelte +2 -3
- package/dist/segment-group/item-text.svelte +2 -3
- package/dist/segment-group/item.svelte +3 -4
- package/dist/segment-group/label.svelte +2 -2
- package/dist/segment-group/root.svelte +5 -5
- package/dist/select/clear-trigger.svelte +2 -2
- package/dist/select/content.svelte +2 -2
- package/dist/select/control.svelte +2 -2
- package/dist/select/create-select.svelte.js +4 -4
- package/dist/select/hidden-select.svelte +2 -2
- package/dist/select/indicator.svelte +2 -2
- package/dist/select/item-group-label.svelte +2 -3
- package/dist/select/item-group.svelte +2 -2
- package/dist/select/item-indicator.svelte +2 -3
- package/dist/select/item-text.svelte +3 -4
- package/dist/select/item.svelte +3 -4
- package/dist/select/label.svelte +2 -2
- package/dist/select/list.svelte +2 -2
- package/dist/select/positioner.svelte +2 -2
- package/dist/select/root.svelte +5 -5
- package/dist/select/trigger.svelte +2 -2
- package/dist/select/value-text.svelte +4 -4
- package/dist/slider/control.svelte +2 -2
- package/dist/slider/create-slider.svelte.js +4 -4
- package/dist/slider/hidden-input.svelte +2 -3
- package/dist/slider/label.svelte +2 -2
- package/dist/slider/marker-group.svelte +2 -2
- package/dist/slider/marker.svelte +2 -2
- package/dist/slider/range.svelte +2 -2
- package/dist/slider/root.svelte +5 -5
- package/dist/slider/thumb.svelte +2 -3
- package/dist/slider/track.svelte +2 -2
- package/dist/slider/value-text.svelte +3 -3
- package/dist/steps/content.svelte +2 -2
- package/dist/steps/create-steps.svelte.js +4 -4
- package/dist/steps/indicator.svelte +2 -3
- package/dist/steps/item.svelte +3 -4
- package/dist/steps/list.svelte +2 -2
- package/dist/steps/next-trigger.svelte +2 -2
- package/dist/steps/prev-trigger.svelte +2 -2
- package/dist/steps/progress.svelte +2 -2
- package/dist/steps/root.svelte +5 -5
- package/dist/steps/separator.svelte +2 -3
- package/dist/steps/trigger.svelte +2 -3
- package/dist/switch/control.svelte +2 -2
- package/dist/switch/create-switch.svelte.js +4 -4
- package/dist/switch/hidden-input.svelte +2 -2
- package/dist/switch/label.svelte +2 -2
- package/dist/switch/root.svelte +5 -5
- package/dist/switch/thumb.svelte +2 -2
- package/dist/tabs/content.svelte +2 -2
- package/dist/tabs/create-tabs.svelte.js +4 -4
- package/dist/tabs/list.svelte +2 -2
- package/dist/tabs/root.svelte +5 -5
- package/dist/tabs/trigger.svelte +2 -2
- package/dist/tags-input/clear-trigger.svelte +2 -2
- package/dist/tags-input/control.svelte +2 -2
- package/dist/tags-input/create-tags-input.svelte.js +4 -4
- package/dist/tags-input/hidden-input.svelte +2 -2
- package/dist/tags-input/input.svelte +2 -2
- package/dist/tags-input/item-delete-trigger.svelte +2 -3
- package/dist/tags-input/item-input.svelte +2 -3
- package/dist/tags-input/item-preview.svelte +2 -3
- package/dist/tags-input/item-text.svelte +2 -3
- package/dist/tags-input/item.svelte +3 -4
- package/dist/tags-input/label.svelte +2 -2
- package/dist/tags-input/root.svelte +5 -5
- package/dist/timer/action-trigger.svelte +2 -2
- package/dist/timer/create-timer.svelte.js +2 -2
- package/dist/timer/item-label.svelte +2 -3
- package/dist/timer/item-value.svelte +3 -4
- package/dist/timer/item.svelte +2 -3
- package/dist/timer/root.svelte +5 -5
- package/dist/timer/separator.svelte +2 -2
- package/dist/toast/create-toaster.svelte.js +4 -4
- package/dist/toggle-group/create-toggle-group.svelte.js +4 -4
- package/dist/toggle-group/item.svelte +3 -4
- package/dist/toggle-group/root.svelte +4 -4
- package/dist/tooltip/arrow-tip.svelte +2 -2
- package/dist/tooltip/arrow.svelte +2 -2
- package/dist/tooltip/content.svelte +2 -2
- package/dist/tooltip/create-tooltip.svelte.js +4 -4
- package/dist/tooltip/positioner.svelte +2 -2
- package/dist/tooltip/root.svelte +4 -4
- package/dist/tooltip/trigger.svelte +2 -2
- package/package.json +3 -2
- package/dist/date-picker/view-trigger.svelte +0 -3
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {...props}: SwitchHiddenInputProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let switch$ = switchContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, switch$.getHiddenInputProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<input {...attrs} />
|
package/dist/switch/label.svelte
CHANGED
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: SwitchLabelProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let switch$ = switchContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, switch$.getLabelProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<span {...attrs}>
|
package/dist/switch/root.svelte
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
export interface SwitchProps
|
7
7
|
extends Assign<Omit<HtmlProps<'label'>, 'children'>, CreateSwitchProps> {
|
8
|
-
children?: Snippet<[
|
8
|
+
children?: Snippet<[switch$: CreateSwitchReturn]>;
|
9
9
|
}
|
10
10
|
</script>
|
11
11
|
|
@@ -31,7 +31,7 @@
|
|
31
31
|
...props
|
32
32
|
}: SwitchProps = $props();
|
33
33
|
|
34
|
-
let
|
34
|
+
let switch$ = createSwitch({
|
35
35
|
id,
|
36
36
|
ids,
|
37
37
|
form,
|
@@ -46,11 +46,11 @@
|
|
46
46
|
onCheckedChange,
|
47
47
|
});
|
48
48
|
|
49
|
-
let attrs = $derived(mergeProps(props,
|
49
|
+
let attrs = $derived(mergeProps(props, switch$.getRootProps()));
|
50
50
|
|
51
|
-
switchContext.set(
|
51
|
+
switchContext.set(switch$);
|
52
52
|
</script>
|
53
53
|
|
54
54
|
<label {...attrs}>
|
55
|
-
{@render children?.(
|
55
|
+
{@render children?.(switch$)}
|
56
56
|
</label>
|
package/dist/switch/thumb.svelte
CHANGED
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: SwitchThumbProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let switch$ = switchContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, switch$.getThumbProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
package/dist/tabs/content.svelte
CHANGED
@@ -11,9 +11,9 @@
|
|
11
11
|
|
12
12
|
let {value, children, ...props}: TabsContentProps = $props();
|
13
13
|
|
14
|
-
let
|
14
|
+
let tabs = tabsContext.get();
|
15
15
|
|
16
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, tabs.getContentProps({value})));
|
17
17
|
</script>
|
18
18
|
|
19
19
|
<div {...attrs}>
|
@@ -4,13 +4,13 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
4
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
5
|
import * as tabs from '@zag-js/tabs';
|
6
6
|
export function createTabs(props) {
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(tabs.machine({
|
10
10
|
...props,
|
11
11
|
id: props.id ?? createUniqueId(),
|
12
|
-
dir:
|
13
|
-
getRootNode:
|
12
|
+
dir: locale?.dir,
|
13
|
+
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
15
15
|
const api = $derived(reflect(() => tabs.connect(state, send, normalizeProps)));
|
16
16
|
return api;
|
package/dist/tabs/list.svelte
CHANGED
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TabsListProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tabs = tabsContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tabs.getListProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
package/dist/tabs/root.svelte
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
import type {CreateTabsProps, CreateTabsReturn} from './create-tabs.svelte.js';
|
5
5
|
|
6
6
|
export interface TabsProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTabsProps> {
|
7
|
-
children?: Snippet<[
|
7
|
+
children?: Snippet<[tabs: CreateTabsReturn]>;
|
8
8
|
}
|
9
9
|
</script>
|
10
10
|
|
@@ -28,7 +28,7 @@
|
|
28
28
|
...props
|
29
29
|
}: TabsProps = $props();
|
30
30
|
|
31
|
-
let
|
31
|
+
let tabs = createTabs({
|
32
32
|
id,
|
33
33
|
ids,
|
34
34
|
value: $state.snapshot(value),
|
@@ -41,11 +41,11 @@
|
|
41
41
|
onValueChange,
|
42
42
|
});
|
43
43
|
|
44
|
-
let attrs = $derived(mergeProps(props,
|
44
|
+
let attrs = $derived(mergeProps(props, tabs.getRootProps()));
|
45
45
|
|
46
|
-
tabsContext.set(
|
46
|
+
tabsContext.set(tabs);
|
47
47
|
</script>
|
48
48
|
|
49
49
|
<div {...attrs}>
|
50
|
-
{@render children?.(
|
50
|
+
{@render children?.(tabs)}
|
51
51
|
</div>
|
package/dist/tabs/trigger.svelte
CHANGED
@@ -11,12 +11,12 @@
|
|
11
11
|
|
12
12
|
let {value, disabled, children, ...props}: TabsTriggerProps = $props();
|
13
13
|
|
14
|
-
let
|
14
|
+
let tabs = tabsContext.get();
|
15
15
|
|
16
16
|
let attrs = $derived(
|
17
17
|
mergeProps(
|
18
18
|
props,
|
19
|
-
|
19
|
+
tabs.getTriggerProps({
|
20
20
|
value,
|
21
21
|
disabled,
|
22
22
|
}),
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputClearTriggerProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tagsInput = tagsInputContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tagsInput.getClearTriggerProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<button type="button" {...attrs}>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputControlProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tagsInput = tagsInputContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tagsInput.getControlProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
@@ -4,13 +4,13 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
4
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
5
|
import * as tagsInput from '@zag-js/tags-input';
|
6
6
|
export function createTagsInputt(props) {
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(tagsInput.machine({
|
10
10
|
...props,
|
11
11
|
id: props.id ?? createUniqueId(),
|
12
|
-
dir:
|
13
|
-
getRootNode:
|
12
|
+
dir: locale?.dir,
|
13
|
+
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
15
15
|
const api = $derived(reflect(() => tagsInput.connect(state, send, normalizeProps)));
|
16
16
|
return api;
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {...props}: TagsInputHiddenInputProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tagsInput = tagsInputContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tagsInput.getHiddenInputProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<input {...attrs} />
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {...props}: TagsInputInputProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tagsInput = tagsInputContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tagsInput.getInputProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<input {...attrs} />
|
@@ -10,11 +10,10 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputItemDeleteTriggerProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let tagsInput = tagsInputContext.get();
|
15
14
|
let itemProps = tagsInputItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, tagsInput.getItemDeleteTriggerProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<button type="button" {...attrs}>
|
@@ -10,11 +10,10 @@
|
|
10
10
|
|
11
11
|
let {...props}: TagsInputItemInputProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let tagsInput = tagsInputContext.get();
|
15
14
|
let itemProps = tagsInputItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, tagsInput.getItemInputProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<input {...attrs} />
|
@@ -10,11 +10,10 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputItemPreviewProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let tagsInput = tagsInputContext.get();
|
15
14
|
let itemProps = tagsInputItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, tagsInput.getItemPreviewProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<div {...attrs}>
|
@@ -10,11 +10,10 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputItemTextProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let tagsInput = tagsInputContext.get();
|
15
14
|
let itemProps = tagsInputItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, tagsInput.getItemTextProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<span {...attrs}>
|
@@ -22,16 +22,15 @@
|
|
22
22
|
...props
|
23
23
|
}: TagsInputItemProps = $props();
|
24
24
|
|
25
|
-
let
|
26
|
-
|
25
|
+
let tagsInput = tagsInputContext.get();
|
27
26
|
let itemProps = $derived({
|
28
27
|
index,
|
29
28
|
value,
|
30
29
|
disabled,
|
31
30
|
});
|
32
31
|
|
33
|
-
let state = $derived(
|
34
|
-
let attrs = $derived(mergeProps(props,
|
32
|
+
let state = $derived(tagsInput.getItemState(itemProps));
|
33
|
+
let attrs = $derived(mergeProps(props, tagsInput.getItemProps(itemProps)));
|
35
34
|
|
36
35
|
tagsInputItemPropsContext.set(() => itemProps);
|
37
36
|
</script>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TagsInputLabelProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tagsInput = tagsInputContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tagsInput.getLabelProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<label {...attrs}>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
export interface TagsInputProps
|
7
7
|
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTagsInputProps> {
|
8
|
-
children?: Snippet<[
|
8
|
+
children?: Snippet<[tagsInput: CreateTagsInputReturn]>;
|
9
9
|
}
|
10
10
|
</script>
|
11
11
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
...props
|
47
47
|
}: TagsInputProps = $props();
|
48
48
|
|
49
|
-
let
|
49
|
+
let tagsInput = createTagsInputt({
|
50
50
|
id,
|
51
51
|
ids,
|
52
52
|
max,
|
@@ -76,11 +76,11 @@
|
|
76
76
|
onPointerDownOutside,
|
77
77
|
});
|
78
78
|
|
79
|
-
let attrs = $derived(mergeProps(props,
|
79
|
+
let attrs = $derived(mergeProps(props, tagsInput.getRootProps()));
|
80
80
|
|
81
|
-
tagsInputContext.set(
|
81
|
+
tagsInputContext.set(tagsInput);
|
82
82
|
</script>
|
83
83
|
|
84
84
|
<div {...attrs}>
|
85
|
-
{@render children?.(
|
85
|
+
{@render children?.(tagsInput)}
|
86
86
|
</div>
|
@@ -12,9 +12,9 @@
|
|
12
12
|
|
13
13
|
let {action, children, ...props}: TimerActionTriggerProps = $props();
|
14
14
|
|
15
|
-
let
|
15
|
+
let timer = timerContext.get();
|
16
16
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
17
|
+
let attrs = $derived(mergeProps(props, timer.getActionTriggerProps({action})));
|
18
18
|
</script>
|
19
19
|
|
20
20
|
<button type="button" {...attrs}>
|
@@ -3,11 +3,11 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
3
3
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
4
4
|
import * as timer from '@zag-js/timer';
|
5
5
|
export function createTimer(props) {
|
6
|
-
const
|
6
|
+
const environment = getEnvironmentContext();
|
7
7
|
const [state, send] = useMachine(timer.machine({
|
8
8
|
...props,
|
9
9
|
id: props.id ?? createUniqueId(),
|
10
|
-
getRootNode:
|
10
|
+
getRootNode: environment?.getRootNode,
|
11
11
|
}));
|
12
12
|
const api = $derived(reflect(() => timer.connect(state, send, normalizeProps)));
|
13
13
|
return api;
|
@@ -10,11 +10,10 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TimerItemLabelProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let timer = timerContext.get();
|
15
14
|
let itemProps = timerItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, timer.getItemLabelProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<span {...attrs}>
|
@@ -10,17 +10,16 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TimerItemValueProps = $props();
|
12
12
|
|
13
|
-
let
|
14
|
-
|
13
|
+
let timer = timerContext.get();
|
15
14
|
let itemProps = timerItemPropsContext.get();
|
16
15
|
|
17
|
-
let attrs = $derived(mergeProps(props,
|
16
|
+
let attrs = $derived(mergeProps(props, timer.getItemValueProps(itemProps)));
|
18
17
|
</script>
|
19
18
|
|
20
19
|
<span {...attrs}>
|
21
20
|
{#if children}
|
22
21
|
{@render children?.()}
|
23
22
|
{:else}
|
24
|
-
{
|
23
|
+
{timer.formattedTime[itemProps.type]}
|
25
24
|
{/if}
|
26
25
|
</span>
|
package/dist/timer/item.svelte
CHANGED
@@ -11,13 +11,12 @@
|
|
11
11
|
|
12
12
|
let {type, children, ...props}: TimerItemProps = $props();
|
13
13
|
|
14
|
-
let
|
15
|
-
|
14
|
+
let timer = timerContext.get();
|
16
15
|
let itemProps = $derived({
|
17
16
|
type,
|
18
17
|
});
|
19
18
|
|
20
|
-
let attrs = $derived(mergeProps(props,
|
19
|
+
let attrs = $derived(mergeProps(props, timer.getItemProps(itemProps)));
|
21
20
|
|
22
21
|
timerItemPropsContext.set(() => itemProps);
|
23
22
|
</script>
|
package/dist/timer/root.svelte
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
import type {CreateTimerProps, CreateTimerReturn} from './create-timer.svelte.js';
|
5
5
|
|
6
6
|
export interface TimerProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTimerProps> {
|
7
|
-
children?: Snippet<[
|
7
|
+
children?: Snippet<[timer: CreateTimerReturn]>;
|
8
8
|
}
|
9
9
|
</script>
|
10
10
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
...props
|
27
27
|
}: TimerProps = $props();
|
28
28
|
|
29
|
-
let
|
29
|
+
let timer = createTimer({
|
30
30
|
id,
|
31
31
|
startMs,
|
32
32
|
targetMs,
|
@@ -37,11 +37,11 @@
|
|
37
37
|
onComplete,
|
38
38
|
});
|
39
39
|
|
40
|
-
let attrs = $derived(mergeProps(props,
|
40
|
+
let attrs = $derived(mergeProps(props, timer.getRootProps()));
|
41
41
|
|
42
|
-
timerContext.set(
|
42
|
+
timerContext.set(timer);
|
43
43
|
</script>
|
44
44
|
|
45
45
|
<div {...attrs}>
|
46
|
-
{@render children?.(
|
46
|
+
{@render children?.(timer)}
|
47
47
|
</div>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TimerSeparatorProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let timer = timerContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, timer.getSeparatorProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<span {...attrs}>
|
@@ -4,13 +4,13 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
4
4
|
import { normalizeProps, reflect } from '@zag-js/svelte';
|
5
5
|
import * as toast from '@zag-js/toast';
|
6
6
|
export function createToaster(props) {
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
9
|
const machine = $derived(toast.group.machine({
|
10
10
|
...props,
|
11
11
|
id: props?.id ?? createUniqueId(),
|
12
|
-
dir:
|
13
|
-
getRootNode:
|
12
|
+
dir: locale?.dir,
|
13
|
+
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
15
15
|
const api = $derived(reflect(() => ({
|
16
16
|
machine,
|
@@ -4,13 +4,13 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
4
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
5
|
import * as toggleGroup from '@zag-js/toggle-group';
|
6
6
|
export function createToggleGroup(props) {
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(toggleGroup.machine({
|
10
10
|
...props,
|
11
11
|
id: props.id ?? createUniqueId(),
|
12
|
-
dir:
|
13
|
-
getRootNode:
|
12
|
+
dir: locale?.dir,
|
13
|
+
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
15
15
|
const api = $derived(reflect(() => toggleGroup.connect(state, send, normalizeProps)));
|
16
16
|
return api;
|
@@ -15,15 +15,14 @@
|
|
15
15
|
|
16
16
|
let {value, disabled, children, ...props}: ToggleGroupItemProps = $props();
|
17
17
|
|
18
|
-
let
|
19
|
-
|
18
|
+
let toggleGroup = toggleGroupContext.get();
|
20
19
|
let itemProps = $derived({
|
21
20
|
value,
|
22
21
|
disabled,
|
23
22
|
});
|
24
23
|
|
25
|
-
let state = $derived(
|
26
|
-
let attrs = $derived(mergeProps(props,
|
24
|
+
let state = $derived(toggleGroup.getItemState(itemProps));
|
25
|
+
let attrs = $derived(mergeProps(props, toggleGroup.getItemProps(itemProps)));
|
27
26
|
</script>
|
28
27
|
|
29
28
|
<button type="button" {...attrs}>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
...props
|
32
32
|
}: ToggleGroupProps = $props();
|
33
33
|
|
34
|
-
let
|
34
|
+
let toggleGroup = createToggleGroup({
|
35
35
|
id,
|
36
36
|
ids,
|
37
37
|
value: $state.snapshot(value),
|
@@ -43,11 +43,11 @@
|
|
43
43
|
onValueChange,
|
44
44
|
});
|
45
45
|
|
46
|
-
let attrs = $derived(mergeProps(props,
|
46
|
+
let attrs = $derived(mergeProps(props, toggleGroup.getRootProps()));
|
47
47
|
|
48
|
-
toggleGroupContext.set(
|
48
|
+
toggleGroupContext.set(toggleGroup);
|
49
49
|
</script>
|
50
50
|
|
51
51
|
<div {...attrs}>
|
52
|
-
{@render children?.(
|
52
|
+
{@render children?.(toggleGroup)}
|
53
53
|
</div>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TooltipArrowTipProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tooltip = tooltipContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tooltip.getArrowTipProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TooltipArrowProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tooltip = tooltipContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tooltip.getArrowProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TooltipContentProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tooltip = tooltipContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tooltip.getContentProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|
@@ -4,14 +4,14 @@ import { createUniqueId } from '../utils.svelte.js';
|
|
4
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
5
|
import * as tooltip from '@zag-js/tooltip';
|
6
6
|
export function createTooltip(props) {
|
7
|
-
const
|
8
|
-
const
|
7
|
+
const locale = getLocaleContext();
|
8
|
+
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(tooltip.machine({
|
10
10
|
...props,
|
11
11
|
id: props.id ?? createUniqueId(),
|
12
|
-
dir:
|
12
|
+
dir: locale?.dir,
|
13
13
|
open: props.defaultOpen,
|
14
|
-
getRootNode:
|
14
|
+
getRootNode: environment?.getRootNode,
|
15
15
|
'open.controlled': props.open != null,
|
16
16
|
}));
|
17
17
|
const api = $derived(reflect(() => tooltip.connect(state, send, normalizeProps)));
|
@@ -10,9 +10,9 @@
|
|
10
10
|
|
11
11
|
let {children, ...props}: TooltipPositionerProps = $props();
|
12
12
|
|
13
|
-
let
|
13
|
+
let tooltip = tooltipContext.get();
|
14
14
|
|
15
|
-
let attrs = $derived(mergeProps(props,
|
15
|
+
let attrs = $derived(mergeProps(props, tooltip.getPositionerProps()));
|
16
16
|
</script>
|
17
17
|
|
18
18
|
<div {...attrs}>
|