ui-ingredients 0.0.29 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accordion/accordion.d.ts +0 -1
- package/dist/accordion/accordion.js +0 -1
- package/dist/accordion/create-accordion.svelte.js +2 -2
- package/dist/accordion/index.d.ts +1 -0
- package/dist/accordion/index.js +1 -0
- package/dist/accordion/root.svelte +3 -1
- package/dist/avatar/avatar.d.ts +0 -1
- package/dist/avatar/avatar.js +0 -1
- package/dist/avatar/create-avatar.svelte.js +2 -2
- package/dist/avatar/index.d.ts +1 -0
- package/dist/avatar/index.js +1 -0
- package/dist/avatar/root.svelte +2 -1
- package/dist/carousel/carousel.d.ts +0 -1
- package/dist/carousel/carousel.js +0 -1
- package/dist/carousel/create-carousel.svelte.js +2 -2
- package/dist/carousel/index.d.ts +1 -0
- package/dist/carousel/index.js +1 -0
- package/dist/carousel/root.svelte +2 -1
- package/dist/checkbox/checkbox.d.ts +0 -1
- package/dist/checkbox/checkbox.js +0 -1
- package/dist/checkbox/create-checkbox.svelte.js +2 -2
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox/root.svelte +3 -1
- package/dist/clipboard/clipboard.d.ts +0 -1
- package/dist/clipboard/clipboard.js +0 -1
- package/dist/clipboard/create-clipboard.svelte.js +2 -2
- package/dist/clipboard/index.d.ts +1 -0
- package/dist/clipboard/index.js +1 -0
- package/dist/clipboard/root.svelte +2 -1
- package/dist/collapsible/collapsible.d.ts +0 -1
- package/dist/collapsible/collapsible.js +0 -1
- package/dist/collapsible/create-collapsible.svelte.js +2 -2
- package/dist/collapsible/index.d.ts +1 -0
- package/dist/collapsible/index.js +1 -0
- package/dist/collapsible/root.svelte +2 -1
- package/dist/color-picker/color-picker.d.ts +1 -1
- package/dist/color-picker/color-picker.js +1 -1
- package/dist/color-picker/create-color-picker.svelte.js +2 -2
- package/dist/color-picker/index.d.ts +1 -0
- package/dist/color-picker/index.js +1 -0
- package/dist/combobox/combobox.d.ts +0 -1
- package/dist/combobox/combobox.js +0 -1
- package/dist/combobox/create-combobox.svelte.js +2 -2
- package/dist/combobox/index.d.ts +1 -0
- package/dist/combobox/index.js +1 -0
- package/dist/combobox/item-group.svelte +3 -3
- package/dist/combobox/root.svelte +2 -1
- package/dist/date-picker/anatomy.d.ts +2 -0
- package/dist/date-picker/create-date-picker.svelte.js +2 -2
- package/dist/date-picker/date-picker.d.ts +0 -1
- package/dist/date-picker/date-picker.js +0 -1
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/index.js +1 -0
- package/dist/date-picker/input.svelte +1 -1
- package/dist/date-picker/range-text.svelte +1 -1
- package/dist/date-picker/root.svelte +2 -1
- package/dist/dialog/create-dialog.svelte.js +2 -2
- package/dist/dialog/dialog.d.ts +0 -1
- package/dist/dialog/dialog.js +0 -1
- package/dist/dialog/index.d.ts +1 -0
- package/dist/dialog/index.js +1 -0
- package/dist/editable/create-editable.svelte.js +2 -2
- package/dist/editable/editable.d.ts +0 -1
- package/dist/editable/editable.js +0 -1
- package/dist/editable/index.d.ts +1 -0
- package/dist/editable/index.js +1 -0
- package/dist/editable/root.svelte +2 -1
- package/dist/field/anatomy.d.ts +2 -0
- package/dist/field/anatomy.js +3 -0
- package/dist/field/context.svelte.d.ts +3 -0
- package/dist/field/context.svelte.js +2 -0
- package/dist/field/create-field.svelte.d.ts +28 -0
- package/dist/field/create-field.svelte.js +142 -0
- package/dist/field/error-text.svelte +26 -0
- package/dist/field/error-text.svelte.d.ts +18 -0
- package/dist/field/field.d.ts +7 -0
- package/dist/field/field.js +7 -0
- package/dist/field/helper-text.svelte +26 -0
- package/dist/field/helper-text.svelte.d.ts +18 -0
- package/dist/field/index.d.ts +9 -0
- package/dist/field/index.js +2 -0
- package/dist/field/input.svelte +24 -0
- package/dist/field/input.svelte.d.ts +18 -0
- package/dist/field/label.svelte +26 -0
- package/dist/field/label.svelte.d.ts +18 -0
- package/dist/field/root.svelte +44 -0
- package/dist/field/root.svelte.d.ts +18 -0
- package/dist/field/select.svelte +24 -0
- package/dist/field/select.svelte.d.ts +18 -0
- package/dist/field/textarea.svelte +24 -0
- package/dist/field/textarea.svelte.d.ts +18 -0
- package/dist/file-upload/create-file-upload.svelte.js +2 -2
- package/dist/file-upload/file-upload.d.ts +0 -1
- package/dist/file-upload/file-upload.js +0 -1
- package/dist/file-upload/index.d.ts +1 -0
- package/dist/file-upload/index.js +1 -0
- package/dist/file-upload/root.svelte +2 -1
- package/dist/hover-card/create-hover-card.svelte.js +2 -2
- package/dist/hover-card/hover-card.d.ts +0 -1
- package/dist/hover-card/hover-card.js +0 -1
- package/dist/hover-card/index.d.ts +1 -0
- package/dist/hover-card/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/menu/create-menu.svelte.js +2 -2
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu/item-group.svelte +3 -3
- package/dist/menu/menu.d.ts +0 -1
- package/dist/menu/menu.js +0 -1
- package/dist/number-input/create-number-input.svelte.js +2 -2
- package/dist/number-input/index.d.ts +1 -0
- package/dist/number-input/index.js +1 -0
- package/dist/number-input/number-input.d.ts +0 -1
- package/dist/number-input/number-input.js +0 -1
- package/dist/number-input/root.svelte +2 -1
- package/dist/pagination/create-pagination.svelte.js +2 -2
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +1 -0
- package/dist/pagination/pagination.d.ts +0 -1
- package/dist/pagination/pagination.js +0 -1
- package/dist/pagination/root.svelte +2 -1
- package/dist/pin-input/anatomy.d.ts +2 -0
- package/dist/pin-input/clear-trigger.svelte +1 -2
- package/dist/pin-input/create-pin-input.svelte.js +2 -2
- package/dist/pin-input/index.d.ts +1 -0
- package/dist/pin-input/index.js +1 -0
- package/dist/pin-input/pin-input.d.ts +0 -1
- package/dist/pin-input/pin-input.js +0 -1
- package/dist/pin-input/root.svelte +2 -1
- package/dist/popover/create-popover.svelte.js +2 -2
- package/dist/popover/popover.d.ts +1 -1
- package/dist/popover/popover.js +1 -1
- package/dist/presence/root.svelte +2 -1
- package/dist/progress/create-progress.svelte.js +2 -2
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/index.js +1 -0
- package/dist/progress/progress.d.ts +0 -1
- package/dist/progress/progress.js +0 -1
- package/dist/progress/root.svelte +2 -1
- package/dist/qr-code/create-qr-code.svelte.js +2 -2
- package/dist/qr-code/index.d.ts +1 -0
- package/dist/qr-code/index.js +1 -0
- package/dist/qr-code/qr-code.d.ts +0 -1
- package/dist/qr-code/qr-code.js +0 -1
- package/dist/qr-code/root.svelte +2 -1
- package/dist/radio-group/create-radio-group.svelte.js +2 -2
- package/dist/radio-group/index.d.ts +1 -0
- package/dist/radio-group/index.js +1 -0
- package/dist/radio-group/radio-group.d.ts +0 -1
- package/dist/radio-group/radio-group.js +0 -1
- package/dist/radio-group/root.svelte +2 -1
- package/dist/rating-group/create-rating-group.svelte.js +2 -2
- package/dist/rating-group/index.d.ts +1 -0
- package/dist/rating-group/index.js +1 -0
- package/dist/rating-group/item.svelte +2 -2
- package/dist/rating-group/rating-group.d.ts +0 -1
- package/dist/rating-group/rating-group.js +0 -1
- package/dist/rating-group/root.svelte +2 -1
- package/dist/segment-group/anatomy.d.ts +2 -0
- package/dist/segment-group/create-segment-group.svelte.js +2 -2
- package/dist/segment-group/index.d.ts +1 -0
- package/dist/segment-group/index.js +1 -0
- package/dist/segment-group/root.svelte +2 -1
- package/dist/segment-group/segment-group.d.ts +0 -1
- package/dist/segment-group/segment-group.js +0 -1
- package/dist/select/create-select.svelte.js +2 -2
- package/dist/select/index.d.ts +1 -0
- package/dist/select/index.js +1 -0
- package/dist/select/item-group.svelte +3 -3
- package/dist/select/root.svelte +2 -1
- package/dist/select/select.d.ts +0 -1
- package/dist/select/select.js +0 -1
- package/dist/signature-pad/create-signature-pad.svelte.js +2 -2
- package/dist/signature-pad/current-segment-path.svelte +1 -1
- package/dist/signature-pad/index.d.ts +1 -0
- package/dist/signature-pad/index.js +1 -0
- package/dist/signature-pad/root.svelte +2 -1
- package/dist/signature-pad/signature-pad.d.ts +0 -1
- package/dist/signature-pad/signature-pad.js +0 -1
- package/dist/slider/create-slider.svelte.js +2 -2
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/root.svelte +2 -1
- package/dist/slider/slider.d.ts +0 -1
- package/dist/slider/slider.js +0 -1
- package/dist/splitter/create-splitter.svelte.js +2 -2
- package/dist/splitter/index.d.ts +1 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/root.svelte +2 -1
- package/dist/splitter/splitter.d.ts +0 -1
- package/dist/splitter/splitter.js +0 -1
- package/dist/steps/create-steps.svelte.js +2 -2
- package/dist/steps/index.d.ts +1 -0
- package/dist/steps/index.js +1 -0
- package/dist/steps/root.svelte +2 -1
- package/dist/steps/steps.d.ts +0 -1
- package/dist/steps/steps.js +0 -1
- package/dist/switch/create-switch.svelte.js +2 -2
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/root.svelte +2 -1
- package/dist/switch/switch.d.ts +0 -1
- package/dist/switch/switch.js +0 -1
- package/dist/tabs/create-tabs.svelte.js +2 -2
- package/dist/tabs/index.d.ts +1 -0
- package/dist/tabs/index.js +1 -0
- package/dist/tabs/root.svelte +2 -1
- package/dist/tabs/tabs.d.ts +0 -1
- package/dist/tabs/tabs.js +0 -1
- package/dist/tags-input/create-tags-input.svelte.js +2 -2
- package/dist/tags-input/index.d.ts +1 -0
- package/dist/tags-input/index.js +1 -0
- package/dist/tags-input/root.svelte +2 -1
- package/dist/tags-input/tags-input.d.ts +0 -1
- package/dist/tags-input/tags-input.js +0 -1
- package/dist/time-picker/create-time-picker.svelte.js +2 -2
- package/dist/time-picker/index.d.ts +1 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/input.svelte +1 -1
- package/dist/time-picker/root.svelte +2 -1
- package/dist/time-picker/time-picker.d.ts +1 -1
- package/dist/time-picker/time-picker.js +1 -1
- package/dist/timer/create-timer.svelte.js +2 -2
- package/dist/timer/index.d.ts +2 -2
- package/dist/timer/index.js +1 -1
- package/dist/timer/root.svelte +2 -1
- package/dist/toast/create-toaster.svelte.js +2 -2
- package/dist/toast/index.d.ts +1 -0
- package/dist/toast/index.js +1 -0
- package/dist/toast/toast.d.ts +0 -1
- package/dist/toast/toast.js +0 -1
- package/dist/toggle-group/create-toggle-group.svelte.js +2 -2
- package/dist/toggle-group/index.d.ts +1 -0
- package/dist/toggle-group/index.js +1 -0
- package/dist/toggle-group/root.svelte +2 -1
- package/dist/toggle-group/toggle-group.d.ts +0 -1
- package/dist/toggle-group/toggle-group.js +0 -1
- package/dist/tooltip/create-tooltip.svelte.js +2 -2
- package/dist/tooltip/index.d.ts +1 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip/tooltip.d.ts +0 -1
- package/dist/tooltip/tooltip.js +0 -1
- package/dist/tree-view/create-tree-view.svelte.js +2 -2
- package/dist/tree-view/index.d.ts +1 -0
- package/dist/tree-view/index.js +1 -0
- package/dist/tree-view/root.svelte +2 -1
- package/dist/tree-view/tree-view.d.ts +0 -1
- package/dist/tree-view/tree-view.js +0 -1
- package/package.json +2 -2
- package/dist/create-unique-id.d.ts +0 -1
- package/dist/create-unique-id.js +0 -4
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {fileUploadContext} from './context.svelte.js';
|
20
21
|
import {createFileUpload} from './create-file-upload.svelte.js';
|
@@ -44,7 +45,7 @@
|
|
44
45
|
])(props),
|
45
46
|
);
|
46
47
|
|
47
|
-
let fileUpload = createFileUpload(fileUploadProps);
|
48
|
+
let fileUpload = createFileUpload(reflect(() => fileUploadProps));
|
48
49
|
|
49
50
|
let mergedProps = $derived(mergeProps(otherProps, fileUpload.getRootProps()));
|
50
51
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as hoverCard from '@zag-js/hover-card';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createHoverCard(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(hoverCard.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
open: props.defaultOpen ?? props.open,
|
14
14
|
getRootNode: environment?.getRootNode,
|
@@ -5,3 +5,4 @@ export type { HoverCardContentProps } from './content.svelte';
|
|
5
5
|
export type { HoverCardPositionerProps } from './positioner.svelte';
|
6
6
|
export type { HoverCardProps } from './root.svelte';
|
7
7
|
export type { HoverCardTriggerProps } from './trigger.svelte';
|
8
|
+
export { anatomy as hoverCardAnatomy } from '@zag-js/hover-card';
|
package/dist/hover-card/index.js
CHANGED
package/dist/index.d.ts
CHANGED
@@ -10,6 +10,7 @@ export * from './date-picker/index.js';
|
|
10
10
|
export * from './dialog/index.js';
|
11
11
|
export * from './editable/index.js';
|
12
12
|
export * from './environment-provider/index.js';
|
13
|
+
export * from './field/index.js';
|
13
14
|
export * from './file-upload/index.js';
|
14
15
|
export * from './hover-card/index.js';
|
15
16
|
export * from './locale-provider/index.js';
|
package/dist/index.js
CHANGED
@@ -10,6 +10,7 @@ export * from './date-picker/index.js';
|
|
10
10
|
export * from './dialog/index.js';
|
11
11
|
export * from './editable/index.js';
|
12
12
|
export * from './environment-provider/index.js';
|
13
|
+
export * from './field/index.js';
|
13
14
|
export * from './file-upload/index.js';
|
14
15
|
export * from './hover-card/index.js';
|
15
16
|
export * from './locale-provider/index.js';
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as menu from '@zag-js/menu';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createMenu(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(menu.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
open: props.defaultOpen ?? props.open,
|
14
14
|
getRootNode: environment?.getRootNode,
|
package/dist/menu/index.d.ts
CHANGED
@@ -15,3 +15,4 @@ export { type MenuRootProps } from './root.svelte';
|
|
15
15
|
export { type MenuSeparatorProps } from './separator.svelte';
|
16
16
|
export { type MenuTriggerItemIndicatorProps } from './trigger-item.svelte';
|
17
17
|
export { type MenuTriggerProps } from './trigger.svelte';
|
18
|
+
export { anatomy as menuAnatomy } from '@zag-js/menu';
|
package/dist/menu/index.js
CHANGED
@@ -7,18 +7,18 @@
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
10
|
-
import {createUniqueId} from '../create-unique-id.js';
|
11
10
|
import {mergeProps} from '../merge-props.js';
|
11
|
+
import {uid} from 'uid';
|
12
12
|
import {menuContext, menuItemGroupPropsContext} from './context.svelte.js';
|
13
13
|
|
14
14
|
let {id, asChild, children, ...props}: MenuItemGroupProps = $props();
|
15
15
|
|
16
16
|
let menu = menuContext.get();
|
17
17
|
|
18
|
-
let
|
18
|
+
let id_ = uid();
|
19
19
|
|
20
20
|
let itemGroupProps = $derived({
|
21
|
-
id: id ??
|
21
|
+
id: id ?? id_,
|
22
22
|
});
|
23
23
|
|
24
24
|
let mergedProps = $derived(
|
package/dist/menu/menu.d.ts
CHANGED
package/dist/menu/menu.js
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as numberInput from '@zag-js/number-input';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createNumberInput(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(numberInput.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
locale: props.locale ?? locale?.locale,
|
14
14
|
getRootNode: environment?.getRootNode,
|
@@ -6,3 +6,4 @@ export type { NumberInputInputProps } from './input.svelte';
|
|
6
6
|
export type { NumberInputLabelProps } from './label.svelte';
|
7
7
|
export type { NumberInputProps } from './root.svelte';
|
8
8
|
export type { NumberInputScrubberProps } from './scrubber.svelte';
|
9
|
+
export { anatomy as numberInputAnatomy } from '@zag-js/number-input';
|
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {numberInputContext} from './context.svelte.js';
|
20
21
|
import {createNumberInput} from './create-number-input.svelte.js';
|
@@ -51,7 +52,7 @@
|
|
51
52
|
])(props),
|
52
53
|
);
|
53
54
|
|
54
|
-
let numberInput = createNumberInput(numberInputProps);
|
55
|
+
let numberInput = createNumberInput(reflect(() => numberInputProps));
|
55
56
|
|
56
57
|
let mergedProps = $derived(
|
57
58
|
mergeProps(otherProps, numberInput.getRootProps()),
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as pagination from '@zag-js/pagination';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createPagination(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(pagination.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
@@ -4,3 +4,4 @@ export type { PaginationItemProps } from './item.svelte';
|
|
4
4
|
export type { PaginationNextTriggerProps } from './next-trigger.svelte';
|
5
5
|
export type { PaginationPrevTriggerProps } from './prev-trigger.svelte';
|
6
6
|
export type { PaginationProps } from './root.svelte';
|
7
|
+
export { anatomy as paginationAnatomy } from '@zag-js/pagination';
|
package/dist/pagination/index.js
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {paginationContext} from './context.svelte.js';
|
20
21
|
import {createPagination} from './create-pagination.svelte.js';
|
@@ -36,7 +37,7 @@
|
|
36
37
|
])(props),
|
37
38
|
);
|
38
39
|
|
39
|
-
let pagination = createPagination(paginationProps);
|
40
|
+
let pagination = createPagination(reflect(() => paginationProps));
|
40
41
|
|
41
42
|
let mergedProps = $derived(mergeProps(otherProps, pagination.getRootProps()));
|
42
43
|
|
@@ -11,8 +11,7 @@
|
|
11
11
|
import {parts} from './anatomy.js';
|
12
12
|
import {pinInputContext} from './context.svelte.js';
|
13
13
|
|
14
|
-
let {asChild, children,
|
15
|
-
$props();
|
14
|
+
let {asChild, children, ...props}: PinInputClearTriggerProps = $props();
|
16
15
|
|
17
16
|
let pinInput = pinInputContext.get();
|
18
17
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as pinInput from '@zag-js/pin-input';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createPinInputContext(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(pinInput.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
@@ -4,3 +4,4 @@ export type { PinInputHiddenInputProps } from './hidden-input.svelte';
|
|
4
4
|
export type { PinInputInputProps } from './input.svelte';
|
5
5
|
export type { PinInputLabelProps } from './label.svelte';
|
6
6
|
export type { PinInputProps } from './root.svelte';
|
7
|
+
export { anatomy as pinInputAnatomy } from './anatomy.js';
|
package/dist/pin-input/index.js
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {pinInputContext} from './context.svelte.js';
|
20
21
|
import {createPinInputContext} from './create-pin-input.svelte.js';
|
@@ -47,7 +48,7 @@
|
|
47
48
|
])(props),
|
48
49
|
);
|
49
50
|
|
50
|
-
let pinInput = createPinInputContext(pinInputProps);
|
51
|
+
let pinInput = createPinInputContext(reflect(() => pinInputProps));
|
51
52
|
|
52
53
|
let mergedProps = $derived(mergeProps(otherProps, pinInput.getRootProps()));
|
53
54
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as popover from '@zag-js/popover';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createPopover(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(popover.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
open: props.defaultOpen ?? props.open,
|
14
14
|
getRootNode: environment?.getRootNode,
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export { anatomy } from '@zag-js/popover';
|
2
1
|
export { default as ArrowTip } from './arrow-tip.svelte';
|
3
2
|
export { default as Arrow } from './arrow.svelte';
|
4
3
|
export { default as CloseTrigger } from './close-trigger.svelte';
|
@@ -8,3 +7,4 @@ export { default as Positioner } from './positioner.svelte';
|
|
8
7
|
export { default as Root } from './root.svelte';
|
9
8
|
export { default as Title } from './title.svelte';
|
10
9
|
export { default as Trigger } from './trigger.svelte';
|
10
|
+
export { anatomy as popoverAnatomy } from '@zag-js/popover';
|
package/dist/popover/popover.js
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
export { anatomy } from '@zag-js/popover';
|
2
1
|
export { default as ArrowTip } from './arrow-tip.svelte';
|
3
2
|
export { default as Arrow } from './arrow.svelte';
|
4
3
|
export { default as CloseTrigger } from './close-trigger.svelte';
|
@@ -8,3 +7,4 @@ export { default as Positioner } from './positioner.svelte';
|
|
8
7
|
export { default as Root } from './root.svelte';
|
9
8
|
export { default as Title } from './title.svelte';
|
10
9
|
export { default as Trigger } from './trigger.svelte';
|
10
|
+
export { anatomy as popoverAnatomy } from '@zag-js/popover';
|
@@ -8,6 +8,7 @@
|
|
8
8
|
|
9
9
|
<script lang="ts">
|
10
10
|
import {mergeProps} from '../merge-props.js';
|
11
|
+
import {reflect} from '@zag-js/svelte';
|
11
12
|
import {createSplitProps} from '@zag-js/utils';
|
12
13
|
import {createPresence} from './create-presence.svelte.js';
|
13
14
|
|
@@ -17,7 +18,7 @@
|
|
17
18
|
createSplitProps<CreatePresenceProps>(['present', 'keepMounted'])(props),
|
18
19
|
);
|
19
20
|
|
20
|
-
let presence = createPresence(presenceProps);
|
21
|
+
let presence = createPresence(reflect(() => presenceProps));
|
21
22
|
|
22
23
|
let mergedProps = $derived(mergeProps(otherProps, presence.getRootProps()));
|
23
24
|
</script>
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as progress from '@zag-js/progress';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createProgress(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(progress.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
package/dist/progress/index.d.ts
CHANGED
@@ -8,3 +8,4 @@ export type { ProgressProps } from './root.svelte';
|
|
8
8
|
export type { ProgressTrackProps } from './track.svelte';
|
9
9
|
export type { ProgressValueTextProps } from './value-text.svelte';
|
10
10
|
export type { ProgressViewProps } from './view.svelte';
|
11
|
+
export { anatomy as progressAnatomy } from '@zag-js/progress';
|
package/dist/progress/index.js
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {progressContext} from './context.svelte.js';
|
20
21
|
import {createProgress} from './create-progress.svelte.js';
|
@@ -33,7 +34,7 @@
|
|
33
34
|
])(props),
|
34
35
|
);
|
35
36
|
|
36
|
-
let progress = createProgress(progressProps);
|
37
|
+
let progress = createProgress(reflect(() => progressProps));
|
37
38
|
|
38
39
|
let mergedProps = $derived(mergeProps(otherProps, progress.getRootProps()));
|
39
40
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as qrCode from '@zag-js/qr-code';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createQRCode(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(qrCode.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
package/dist/qr-code/index.d.ts
CHANGED
@@ -3,3 +3,4 @@ export type { QRCodeFrameProps } from './frame.svelte';
|
|
3
3
|
export type { QRCodeOverlayProps } from './overlay.svelte';
|
4
4
|
export type { QRCodePatternProps } from './pattern.svelte';
|
5
5
|
export type { QRCodeProps } from './root.svelte';
|
6
|
+
export { anatomy as qrCodeAnatomy } from '@zag-js/qr-code';
|
package/dist/qr-code/index.js
CHANGED
package/dist/qr-code/qr-code.js
CHANGED
package/dist/qr-code/root.svelte
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {qrCodeContext} from './context.svelte.js';
|
20
21
|
import {createQRCode} from './create-qr-code.svelte.js';
|
@@ -27,7 +28,7 @@
|
|
27
28
|
),
|
28
29
|
);
|
29
30
|
|
30
|
-
let qrCode = createQRCode(qrCodeProps);
|
31
|
+
let qrCode = createQRCode(reflect(() => qrCodeProps));
|
31
32
|
|
32
33
|
let mergedProps = $derived(mergeProps(otherProps, qrCode.getRootProps()));
|
33
34
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as radioGroup from '@zag-js/radio-group';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createRadioGroup(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(radioGroup.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
@@ -6,3 +6,4 @@ export type { RadioGroupItemTextProps } from './item-text.svelte';
|
|
6
6
|
export type { RadioGroupItemProps } from './item.svelte';
|
7
7
|
export type { RadioGroupLabelProps } from './label.svelte';
|
8
8
|
export type { RadioGroupProps } from './root.svelte';
|
9
|
+
export { anatomy as radioGroupAnatomy } from '@zag-js/radio-group';
|
@@ -15,6 +15,7 @@
|
|
15
15
|
|
16
16
|
<script lang="ts">
|
17
17
|
import {mergeProps} from '../merge-props.js';
|
18
|
+
import {reflect} from '@zag-js/svelte';
|
18
19
|
import {createSplitProps} from '@zag-js/utils';
|
19
20
|
import {radioGroupContext} from './context.svelte.js';
|
20
21
|
import {createRadioGroup} from './create-radio-group.svelte.js';
|
@@ -35,7 +36,7 @@
|
|
35
36
|
])(props),
|
36
37
|
);
|
37
38
|
|
38
|
-
let radioGroup = createRadioGroup(radioGroupProps);
|
39
|
+
let radioGroup = createRadioGroup(reflect(() => radioGroupProps));
|
39
40
|
|
40
41
|
let mergedProps = $derived(mergeProps(otherProps, radioGroup.getRootProps()));
|
41
42
|
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import { createUniqueId } from '../create-unique-id.js';
|
2
1
|
import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
|
3
2
|
import { getLocaleContext } from '../locale-provider/context.svelte.js';
|
4
3
|
import * as ratingGroup from '@zag-js/rating-group';
|
5
4
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
5
|
+
import { uid } from 'uid';
|
6
6
|
export function createRatingGroup(props) {
|
7
7
|
const locale = getLocaleContext();
|
8
8
|
const environment = getEnvironmentContext();
|
9
9
|
const [state, send] = useMachine(ratingGroup.machine({
|
10
10
|
...props,
|
11
|
-
id: props.id ??
|
11
|
+
id: props.id ?? uid(),
|
12
12
|
dir: locale?.dir,
|
13
13
|
getRootNode: environment?.getRootNode,
|
14
14
|
}));
|
@@ -4,3 +4,4 @@ export type { RatingGroupHiddenInputProps } from './hidden-input.svelte';
|
|
4
4
|
export type { RatingGroupItemProps } from './item.svelte';
|
5
5
|
export type { RatingGroupLabelProps } from './label.svelte';
|
6
6
|
export type { RatingGroupProps } from './root.svelte';
|
7
|
+
export { anatomy as ratingGroupAnatomy } from '@zag-js/rating-group';
|
@@ -6,7 +6,7 @@
|
|
6
6
|
export interface RatingGroupItemProps
|
7
7
|
extends Assign<Omit<HTMLProps<'div'>, 'children'>, ItemProps> {
|
8
8
|
asChild?: AsChild<ItemState>;
|
9
|
-
children
|
9
|
+
children?: Snippet<[ItemState]>;
|
10
10
|
}
|
11
11
|
</script>
|
12
12
|
|
@@ -28,6 +28,6 @@
|
|
28
28
|
{@render asChild(mergedProps, itemState)}
|
29
29
|
{:else}
|
30
30
|
<div {...mergedProps}>
|
31
|
-
{@render children(itemState)}
|
31
|
+
{@render children?.(itemState)}
|
32
32
|
</div>
|
33
33
|
{/if}
|