ui-ingredients 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accordion/create-accordion.svelte.d.ts +2 -1
- package/dist/accordion/create-accordion.svelte.js +11 -1
- package/dist/accordion/item-content.svelte +3 -2
- package/dist/accordion/item-indicator.svelte +3 -2
- package/dist/accordion/item-trigger.svelte +3 -2
- package/dist/accordion/item.svelte +2 -2
- package/dist/accordion/root.svelte +3 -15
- package/dist/avatar/create-avatar.svelte.d.ts +2 -1
- package/dist/avatar/create-avatar.svelte.js +11 -1
- package/dist/avatar/fallback.svelte +2 -2
- package/dist/avatar/image.svelte +2 -2
- package/dist/avatar/root.svelte +11 -14
- package/dist/carousel/create-carousel.svelte.d.ts +2 -1
- package/dist/carousel/create-carousel.svelte.js +11 -1
- package/dist/carousel/indicator-group.svelte +2 -2
- package/dist/carousel/indicator.svelte +2 -3
- package/dist/carousel/item-group.svelte +2 -2
- package/dist/carousel/item.svelte +2 -2
- package/dist/carousel/next-trigger.svelte +2 -2
- package/dist/carousel/prev-trigger.svelte +2 -2
- package/dist/carousel/root.svelte +3 -15
- package/dist/carousel/viewport.svelte +2 -2
- package/dist/checkbox/control.svelte +2 -2
- package/dist/checkbox/create-checkbox.svelte.d.ts +2 -1
- package/dist/checkbox/create-checkbox.svelte.js +11 -1
- 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 +3 -18
- package/dist/clipboard/control.svelte +2 -2
- package/dist/clipboard/create-clipboard.svelte.d.ts +2 -1
- package/dist/clipboard/create-clipboard.svelte.js +8 -1
- 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 +3 -11
- package/dist/clipboard/trigger.svelte +2 -2
- package/dist/collapsible/content.svelte +2 -2
- package/dist/collapsible/create-collapsible.svelte.d.ts +2 -1
- package/dist/collapsible/create-collapsible.svelte.js +12 -1
- package/dist/collapsible/root.svelte +3 -20
- package/dist/collapsible/trigger.svelte +2 -2
- 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.d.ts +2 -1
- package/dist/combobox/create-combobox.svelte.js +9 -0
- package/dist/combobox/input.svelte +2 -2
- package/dist/combobox/item-group-label.svelte +2 -2
- package/dist/combobox/item-group.svelte +2 -2
- package/dist/combobox/item-indicator.svelte +2 -2
- package/dist/combobox/item-text.svelte +2 -2
- package/dist/combobox/item.svelte +2 -3
- 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 +3 -20
- package/dist/combobox/trigger.svelte +2 -2
- 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.d.ts +2 -1
- package/dist/dialog/create-dialog.svelte.js +12 -1
- package/dist/dialog/description.svelte +2 -2
- package/dist/dialog/positioner.svelte +2 -2
- package/dist/dialog/root.svelte +3 -17
- 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.d.ts +2 -1
- package/dist/editable/create-editable.svelte.js +12 -1
- 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 +2 -2
- package/dist/editable/root.svelte +3 -17
- package/dist/editable/submit-trigger.svelte +2 -2
- package/dist/environment-provider/root.svelte +21 -5
- 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.d.ts +2 -1
- package/dist/hover-card/create-hover-card.svelte.js +12 -1
- package/dist/hover-card/positioner.svelte +2 -2
- package/dist/hover-card/root.svelte +3 -17
- package/dist/hover-card/trigger.svelte +2 -2
- package/dist/menu/arrow-tip.svelte +2 -2
- package/dist/menu/arrow.svelte +2 -2
- package/dist/menu/content.svelte +2 -2
- package/dist/menu/context-trigger.svelte +2 -2
- package/dist/menu/create-menu.svelte.d.ts +2 -1
- package/dist/menu/create-menu.svelte.js +12 -1
- package/dist/menu/indicator.svelte +2 -2
- package/dist/menu/item-group-label.svelte +2 -2
- package/dist/menu/item-group.svelte +2 -2
- package/dist/menu/item.svelte +2 -3
- package/dist/menu/option-item-indicator.svelte +2 -2
- package/dist/menu/option-item-text.svelte +2 -2
- package/dist/menu/option-item.svelte +2 -2
- package/dist/menu/positioner.svelte +2 -2
- package/dist/menu/root.svelte +3 -57
- 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 +2 -1
- package/dist/number-input/create-number-input.svelte.js +12 -1
- 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 +3 -20
- package/dist/number-input/scrubber.svelte +2 -2
- package/dist/pagination/create-pagination.svelte.d.ts +2 -1
- package/dist/pagination/create-pagination.svelte.js +11 -1
- package/dist/pagination/ellipsis.svelte +2 -3
- package/dist/pagination/item.svelte +10 -9
- package/dist/pagination/next-trigger.svelte +2 -2
- package/dist/pagination/prev-trigger.svelte +2 -2
- package/dist/pagination/root.svelte +3 -18
- package/dist/pin-input/clear-trigger.svelte +2 -2
- package/dist/pin-input/create-pin-input.svelte.d.ts +2 -1
- package/dist/pin-input/create-pin-input.svelte.js +11 -1
- 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 +3 -15
- 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.d.ts +2 -1
- package/dist/popover/create-popover.svelte.js +12 -1
- package/dist/popover/description.svelte +2 -2
- package/dist/popover/positioner.svelte +2 -2
- package/dist/popover/root.svelte +3 -17
- package/dist/popover/title.svelte +2 -2
- package/dist/popover/trigger.svelte +2 -2
- package/dist/portal/root.svelte +4 -4
- package/dist/presence/root.svelte +2 -3
- 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.d.ts +2 -1
- package/dist/progress/create-progress.svelte.js +11 -1
- package/dist/progress/label.svelte +2 -2
- package/dist/progress/range.svelte +2 -2
- package/dist/progress/root.svelte +4 -15
- package/dist/progress/track.svelte +2 -2
- package/dist/progress/value-text.svelte +2 -2
- package/dist/qr-code/create-qr-code.svelte.d.ts +2 -1
- package/dist/qr-code/create-qr-code.svelte.js +11 -1
- 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 +3 -15
- package/dist/radio-group/create-radio-group.svelte.d.ts +2 -1
- package/dist/radio-group/create-radio-group.svelte.js +11 -1
- package/dist/radio-group/indicator.svelte +2 -2
- package/dist/radio-group/item-control.svelte +2 -2
- package/dist/radio-group/item-hidden-input.svelte +2 -2
- package/dist/radio-group/item-text.svelte +2 -2
- package/dist/radio-group/item.svelte +2 -2
- package/dist/radio-group/label.svelte +2 -2
- package/dist/radio-group/root.svelte +3 -18
- package/dist/rating-group/control.svelte +2 -2
- package/dist/rating-group/create-rating-group.svelte.d.ts +2 -1
- package/dist/rating-group/create-rating-group.svelte.js +11 -1
- package/dist/rating-group/hidden-input.svelte +2 -2
- package/dist/rating-group/item.svelte +2 -2
- package/dist/rating-group/label.svelte +2 -2
- package/dist/rating-group/root.svelte +3 -18
- package/dist/segment-group/create-segment-group.svelte.d.ts +2 -1
- package/dist/segment-group/create-segment-group.svelte.js +11 -1
- package/dist/segment-group/indicator.svelte +2 -2
- package/dist/segment-group/item-control.svelte +2 -2
- package/dist/segment-group/item-hidden-input.svelte +2 -2
- package/dist/segment-group/item-text.svelte +2 -2
- package/dist/segment-group/item.svelte +2 -2
- package/dist/segment-group/label.svelte +2 -2
- package/dist/segment-group/root.svelte +4 -18
- 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.d.ts +2 -1
- package/dist/select/create-select.svelte.js +9 -0
- package/dist/select/hidden-select.svelte +2 -2
- package/dist/select/indicator.svelte +2 -2
- package/dist/select/item-group-label.svelte +2 -2
- package/dist/select/item-group.svelte +2 -2
- package/dist/select/item-indicator.svelte +2 -2
- package/dist/select/item-text.svelte +2 -2
- package/dist/select/item.svelte +2 -3
- 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 +3 -17
- package/dist/select/trigger.svelte +2 -2
- package/dist/select/value-text.svelte +2 -2
- package/dist/slider/control.svelte +2 -2
- package/dist/slider/create-slider.svelte.d.ts +2 -1
- package/dist/slider/create-slider.svelte.js +11 -1
- package/dist/slider/hidden-input.svelte +2 -2
- 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 +3 -15
- package/dist/slider/thumb.svelte +2 -2
- package/dist/slider/track.svelte +2 -2
- package/dist/slider/value-text.svelte +2 -2
- package/dist/steps/content.svelte +2 -2
- package/dist/steps/create-steps.svelte.d.ts +2 -1
- package/dist/steps/create-steps.svelte.js +11 -1
- package/dist/steps/indicator.svelte +2 -2
- package/dist/steps/item.svelte +2 -3
- 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 +3 -15
- package/dist/steps/separator.svelte +2 -2
- package/dist/steps/trigger.svelte +2 -2
- package/dist/switch/control.svelte +2 -2
- package/dist/switch/create-switch.svelte.d.ts +2 -1
- package/dist/switch/create-switch.svelte.js +11 -1
- package/dist/switch/hidden-input.svelte +2 -2
- package/dist/switch/label.svelte +2 -2
- package/dist/switch/root.svelte +3 -15
- package/dist/switch/thumb.svelte +2 -2
- package/dist/tabs/content.svelte +2 -2
- package/dist/tabs/create-tabs.svelte.d.ts +2 -1
- package/dist/tabs/create-tabs.svelte.js +11 -1
- package/dist/tabs/list.svelte +2 -2
- package/dist/tabs/root.svelte +3 -16
- 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.d.ts +2 -1
- package/dist/tags-input/create-tags-input.svelte.js +11 -1
- 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 -2
- package/dist/tags-input/item-input.svelte +2 -2
- package/dist/tags-input/item-preview.svelte +2 -2
- package/dist/tags-input/item-text.svelte +2 -2
- package/dist/tags-input/item.svelte +2 -2
- package/dist/tags-input/label.svelte +2 -2
- package/dist/tags-input/root.svelte +3 -15
- package/dist/timer/action-trigger.svelte +2 -2
- package/dist/timer/create-timer.svelte.d.ts +2 -1
- package/dist/timer/create-timer.svelte.js +8 -1
- package/dist/timer/item-label.svelte +2 -2
- package/dist/timer/item-value.svelte +2 -2
- package/dist/timer/item.svelte +2 -2
- package/dist/timer/root.svelte +3 -12
- package/dist/timer/separator.svelte +2 -2
- package/dist/toast/action-trigger.svelte +2 -2
- package/dist/toast/close-trigger.svelte +2 -2
- package/dist/toast/create-toaster.svelte.d.ts +2 -4
- package/dist/toast/create-toaster.svelte.js +4 -7
- package/dist/toast/description.svelte +2 -2
- package/dist/toast/index.d.ts +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/root.svelte +2 -2
- package/dist/toast/title.svelte +2 -2
- package/dist/toast/toaster.svelte +2 -2
- package/dist/toggle-group/create-toggle-group.svelte.d.ts +2 -1
- package/dist/toggle-group/create-toggle-group.svelte.js +11 -1
- package/dist/toggle-group/item.svelte +2 -2
- package/dist/toggle-group/root.svelte +3 -18
- 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.d.ts +2 -1
- package/dist/tooltip/create-tooltip.svelte.js +12 -1
- package/dist/tooltip/positioner.svelte +2 -2
- package/dist/tooltip/root.svelte +3 -17
- package/dist/tooltip/trigger.svelte +2 -2
- package/dist/types.d.ts +1 -5
- package/package.json +4 -2
package/dist/steps/root.svelte
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {CreateStepsProps, CreateStepsReturn} from './create-steps.svelte.js';
|
5
5
|
|
6
|
-
export interface StepsProps
|
7
|
-
extends Assign<Omit<HtmlIngredientProps<'div'>, 'children'>, Omit<CreateStepsProps, 'id'>> {
|
6
|
+
export interface StepsProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateStepsProps> {
|
8
7
|
children?: Snippet<[api: CreateStepsReturn]>;
|
9
8
|
}
|
10
9
|
</script>
|
11
10
|
|
12
11
|
<script lang="ts">
|
13
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
14
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
15
|
-
import {createUniqueId} from '../utils.svelte.js';
|
16
12
|
import {mergeProps} from '@zag-js/svelte';
|
17
13
|
import {stepsContext} from './context.svelte.js';
|
18
14
|
import {createSteps} from './create-steps.svelte.js';
|
@@ -20,33 +16,25 @@
|
|
20
16
|
let {
|
21
17
|
id,
|
22
18
|
ids,
|
23
|
-
dir,
|
24
19
|
step,
|
25
20
|
count,
|
26
21
|
linear,
|
27
22
|
orientation,
|
28
23
|
onStepChange,
|
29
24
|
onStepComplete,
|
30
|
-
getRootNode,
|
31
25
|
children,
|
32
26
|
...props
|
33
27
|
}: StepsProps = $props();
|
34
28
|
|
35
|
-
let localeContext = getLocaleContext();
|
36
|
-
|
37
|
-
let uid = createUniqueId();
|
38
|
-
|
39
29
|
let context = createSteps({
|
40
|
-
id
|
30
|
+
id,
|
41
31
|
ids,
|
42
|
-
dir: dir ?? localeContext?.dir,
|
43
32
|
step,
|
44
33
|
count,
|
45
34
|
linear,
|
46
35
|
orientation,
|
47
36
|
onStepChange,
|
48
37
|
onStepComplete,
|
49
|
-
getRootNode: getRootNode ?? getEnvironmentContext()?.getRootNode,
|
50
38
|
});
|
51
39
|
|
52
40
|
let attrs = $derived(mergeProps(props, context.getRootProps()));
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface StepsSeparatorProps extends
|
4
|
+
export interface StepsSeparatorProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface StepsTriggerProps extends
|
4
|
+
export interface StepsTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface SwitchControlProps extends
|
4
|
+
export interface SwitchControlProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as switch$ from '@zag-js/switch';
|
2
|
-
export interface CreateSwitchProps extends switch$.Context {
|
2
|
+
export interface CreateSwitchProps extends Omit<switch$.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreateSwitchReturn extends switch$.Api {
|
5
6
|
}
|
@@ -1,7 +1,17 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
3
|
+
import { createUniqueId } from '../utils.svelte.js';
|
1
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
5
|
import * as switch$ from '@zag-js/switch';
|
3
6
|
export function createSwitch(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(switch$.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => switch$.connect(state, send, normalizeProps)));
|
6
16
|
return api;
|
7
17
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface SwitchHiddenInputProps extends
|
4
|
+
export interface SwitchHiddenInputProps extends HtmlProps<'input'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/switch/label.svelte
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface SwitchLabelProps extends
|
4
|
+
export interface SwitchLabelProps extends HtmlProps<'span'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/switch/root.svelte
CHANGED
@@ -1,18 +1,15 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {CreateSwitchProps, CreateSwitchReturn} from './create-switch.svelte.js';
|
5
5
|
|
6
6
|
export interface SwitchProps
|
7
|
-
extends Assign<Omit<
|
7
|
+
extends Assign<Omit<HtmlProps<'label'>, 'children'>, CreateSwitchProps> {
|
8
8
|
children?: Snippet<[api: CreateSwitchReturn]>;
|
9
9
|
}
|
10
10
|
</script>
|
11
11
|
|
12
12
|
<script lang="ts">
|
13
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
14
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
15
|
-
import {createUniqueId} from '../utils.svelte.js';
|
16
13
|
import {mergeProps} from '@zag-js/svelte';
|
17
14
|
import {switchContext} from './context.svelte.js';
|
18
15
|
import {createSwitch} from './create-switch.svelte.js';
|
@@ -20,7 +17,6 @@
|
|
20
17
|
let {
|
21
18
|
id,
|
22
19
|
ids,
|
23
|
-
dir,
|
24
20
|
form,
|
25
21
|
name,
|
26
22
|
label,
|
@@ -31,20 +27,13 @@
|
|
31
27
|
readOnly,
|
32
28
|
required,
|
33
29
|
onCheckedChange,
|
34
|
-
getRootNode,
|
35
30
|
children,
|
36
31
|
...props
|
37
32
|
}: SwitchProps = $props();
|
38
33
|
|
39
|
-
let localeContext = getLocaleContext();
|
40
|
-
let environmentContext = getEnvironmentContext();
|
41
|
-
|
42
|
-
let uid = createUniqueId();
|
43
|
-
|
44
34
|
let context = createSwitch({
|
45
|
-
id
|
35
|
+
id,
|
46
36
|
ids,
|
47
|
-
dir: dir ?? localeContext?.dir,
|
48
37
|
form,
|
49
38
|
name,
|
50
39
|
label,
|
@@ -55,7 +44,6 @@
|
|
55
44
|
readOnly,
|
56
45
|
required,
|
57
46
|
onCheckedChange,
|
58
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
59
47
|
});
|
60
48
|
|
61
49
|
let attrs = $derived(mergeProps(props, context.getRootProps()));
|
package/dist/switch/thumb.svelte
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface SwitchThumbProps extends
|
4
|
+
export interface SwitchThumbProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/tabs/content.svelte
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {ContentProps} from '@zag-js/tabs';
|
4
4
|
|
5
|
-
export interface TabsContentProps extends Assign<
|
5
|
+
export interface TabsContentProps extends Assign<HtmlProps<'div'>, ContentProps> {}
|
6
6
|
</script>
|
7
7
|
|
8
8
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as tabs from '@zag-js/tabs';
|
2
|
-
export interface CreateTabsProps extends tabs.Context {
|
2
|
+
export interface CreateTabsProps extends Omit<tabs.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreateTabsReturn extends tabs.Api {
|
5
6
|
}
|
@@ -1,7 +1,17 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
3
|
+
import { createUniqueId } from '../utils.svelte.js';
|
1
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
5
|
import * as tabs from '@zag-js/tabs';
|
3
6
|
export function createTabs(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(tabs.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => tabs.connect(state, send, normalizeProps)));
|
6
16
|
return api;
|
7
17
|
}
|
package/dist/tabs/list.svelte
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TabsListProps extends
|
4
|
+
export interface TabsListProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/tabs/root.svelte
CHANGED
@@ -1,18 +1,14 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {CreateTabsProps, CreateTabsReturn} from './create-tabs.svelte.js';
|
5
5
|
|
6
|
-
export interface TabsProps
|
7
|
-
extends Assign<Omit<HtmlIngredientProps<'div'>, 'children'>, Omit<CreateTabsProps, 'id'>> {
|
6
|
+
export interface TabsProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTabsProps> {
|
8
7
|
children?: Snippet<[api: CreateTabsReturn]>;
|
9
8
|
}
|
10
9
|
</script>
|
11
10
|
|
12
11
|
<script lang="ts">
|
13
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
14
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
15
|
-
import {createUniqueId} from '../utils.svelte.js';
|
16
12
|
import {mergeProps} from '@zag-js/svelte';
|
17
13
|
import {tabsContext} from './context.svelte.js';
|
18
14
|
import {createTabs} from './create-tabs.svelte.js';
|
@@ -20,7 +16,6 @@
|
|
20
16
|
let {
|
21
17
|
id,
|
22
18
|
ids,
|
23
|
-
dir,
|
24
19
|
value,
|
25
20
|
loopFocus,
|
26
21
|
composite,
|
@@ -29,20 +24,13 @@
|
|
29
24
|
activationMode,
|
30
25
|
onFocusChange,
|
31
26
|
onValueChange,
|
32
|
-
getRootNode,
|
33
27
|
children,
|
34
28
|
...props
|
35
29
|
}: TabsProps = $props();
|
36
30
|
|
37
|
-
let localeContext = getLocaleContext();
|
38
|
-
let environmentContext = getEnvironmentContext();
|
39
|
-
|
40
|
-
let uid = createUniqueId();
|
41
|
-
|
42
31
|
let context = createTabs({
|
43
|
-
id
|
32
|
+
id,
|
44
33
|
ids,
|
45
|
-
dir: dir ?? localeContext?.dir,
|
46
34
|
value: $state.snapshot(value),
|
47
35
|
loopFocus,
|
48
36
|
composite,
|
@@ -51,7 +39,6 @@
|
|
51
39
|
activationMode,
|
52
40
|
onFocusChange,
|
53
41
|
onValueChange,
|
54
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
55
42
|
});
|
56
43
|
|
57
44
|
let attrs = $derived(mergeProps(props, context.getRootProps()));
|
package/dist/tabs/trigger.svelte
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {TriggerProps} from '@zag-js/tabs';
|
4
4
|
|
5
|
-
export interface TabsTriggerProps extends Assign<
|
5
|
+
export interface TabsTriggerProps extends Assign<HtmlProps<'button'>, TriggerProps> {}
|
6
6
|
</script>
|
7
7
|
|
8
8
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputClearTriggerProps extends
|
4
|
+
export interface TagsInputClearTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputControlProps extends
|
4
|
+
export interface TagsInputControlProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as tagsInput from '@zag-js/tags-input';
|
2
|
-
export interface CreateTagsInputProps extends tagsInput.Context {
|
2
|
+
export interface CreateTagsInputProps extends Omit<tagsInput.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreateTagsInputReturn extends tagsInput.Api {
|
5
6
|
}
|
@@ -1,7 +1,17 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
3
|
+
import { createUniqueId } from '../utils.svelte.js';
|
1
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
5
|
import * as tagsInput from '@zag-js/tags-input';
|
3
6
|
export function createTagsInputt(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(tagsInput.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => tagsInput.connect(state, send, normalizeProps)));
|
6
16
|
return api;
|
7
17
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputHiddenInputProps extends
|
4
|
+
export interface TagsInputHiddenInputProps extends HtmlProps<'input'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputInputProps extends
|
4
|
+
export interface TagsInputInputProps extends HtmlProps<'input'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputItemDeleteTriggerProps extends
|
4
|
+
export interface TagsInputItemDeleteTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputItemInputProps extends
|
4
|
+
export interface TagsInputItemInputProps extends HtmlProps<'input'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputItemPreviewProps extends
|
4
|
+
export interface TagsInputItemPreviewProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputItemTextProps extends
|
4
|
+
export interface TagsInputItemTextProps extends HtmlProps<'span'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {ItemProps, ItemState} from '@zag-js/tags-input';
|
4
4
|
import type {Snippet} from 'svelte';
|
5
5
|
|
6
6
|
export interface TagsInputItemProps
|
7
|
-
extends Assign<Omit<
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, ItemProps> {
|
8
8
|
children?: Snippet<[state: ItemState]>;
|
9
9
|
}
|
10
10
|
</script>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TagsInputLabelProps extends
|
4
|
+
export interface TagsInputLabelProps extends HtmlProps<'label'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,18 +1,15 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {CreateTagsInputProps, CreateTagsInputReturn} from './create-tags-input.svelte.js';
|
5
5
|
|
6
6
|
export interface TagsInputProps
|
7
|
-
extends Assign<Omit<
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTagsInputProps> {
|
8
8
|
children?: Snippet<[api: CreateTagsInputReturn]>;
|
9
9
|
}
|
10
10
|
</script>
|
11
11
|
|
12
12
|
<script lang="ts">
|
13
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
14
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
15
|
-
import {createUniqueId} from '../utils.svelte.js';
|
16
13
|
import {mergeProps} from '@zag-js/svelte';
|
17
14
|
import {tagsInputContext} from './context.svelte.js';
|
18
15
|
import {createTagsInputt} from './create-tags-input.svelte.js';
|
@@ -20,7 +17,6 @@
|
|
20
17
|
let {
|
21
18
|
id,
|
22
19
|
ids,
|
23
|
-
dir,
|
24
20
|
max,
|
25
21
|
form,
|
26
22
|
name,
|
@@ -46,20 +42,13 @@
|
|
46
42
|
onHighlightChange,
|
47
43
|
onInputValueChange,
|
48
44
|
onPointerDownOutside,
|
49
|
-
getRootNode,
|
50
45
|
children,
|
51
46
|
...props
|
52
47
|
}: TagsInputProps = $props();
|
53
48
|
|
54
|
-
let localeContext = getLocaleContext();
|
55
|
-
let environmentContext = getEnvironmentContext();
|
56
|
-
|
57
|
-
let uid = createUniqueId();
|
58
|
-
|
59
49
|
let context = createTagsInputt({
|
60
|
-
id
|
50
|
+
id,
|
61
51
|
ids,
|
62
|
-
dir: dir ?? localeContext?.dir,
|
63
52
|
max,
|
64
53
|
form,
|
65
54
|
name,
|
@@ -85,7 +74,6 @@
|
|
85
74
|
onHighlightChange,
|
86
75
|
onInputValueChange,
|
87
76
|
onPointerDownOutside,
|
88
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
89
77
|
});
|
90
78
|
|
91
79
|
let attrs = $derived(mergeProps(props, context.getRootProps()));
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {ActionTriggerProps} from '@zag-js/timer';
|
4
4
|
|
5
5
|
export interface TimerActionTriggerProps
|
6
|
-
extends Assign<
|
6
|
+
extends Assign<HtmlProps<'button'>, ActionTriggerProps> {}
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as timer from '@zag-js/timer';
|
2
|
-
export interface CreateTimerProps extends timer.Context {
|
2
|
+
export interface CreateTimerProps extends Omit<timer.Context, 'id' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreateTimerReturn extends timer.Api {
|
5
6
|
}
|
@@ -1,7 +1,14 @@
|
|
1
|
+
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
2
|
+
import { createUniqueId } from '../utils.svelte.js';
|
1
3
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
2
4
|
import * as timer from '@zag-js/timer';
|
3
5
|
export function createTimer(props) {
|
4
|
-
const
|
6
|
+
const environmentContext = getEnvironmentContext();
|
7
|
+
const [state, send] = useMachine(timer.machine({
|
8
|
+
...props,
|
9
|
+
id: props.id ?? createUniqueId(),
|
10
|
+
getRootNode: environmentContext?.getRootNode,
|
11
|
+
}));
|
5
12
|
const api = $derived(reflect(() => timer.connect(state, send, normalizeProps)));
|
6
13
|
return api;
|
7
14
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TimerItemLabelProps extends
|
4
|
+
export interface TimerItemLabelProps extends HtmlProps<'span'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {
|
2
|
+
import type {HtmlProps} from '../types.js';
|
3
3
|
|
4
|
-
export interface TimerItemValueProps extends
|
4
|
+
export interface TimerItemValueProps extends HtmlProps<'span'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/timer/item.svelte
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {ItemProps} from '@zag-js/timer';
|
4
4
|
|
5
|
-
export interface TimerItemProps extends Assign<
|
5
|
+
export interface TimerItemProps extends Assign<HtmlProps<'div'>, ItemProps> {}
|
6
6
|
</script>
|
7
7
|
|
8
8
|
<script lang="ts">
|