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
@@ -1,5 +1,5 @@
|
|
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 {
|
5
5
|
CreateNumberInputProps,
|
@@ -7,18 +7,12 @@
|
|
7
7
|
} from './create-number-input.svelte.js';
|
8
8
|
|
9
9
|
export interface NumberInputProps
|
10
|
-
extends Assign<
|
11
|
-
Omit<HtmlIngredientProps<'div'>, 'children'>,
|
12
|
-
Omit<CreateNumberInputProps, 'id'>
|
13
|
-
> {
|
10
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateNumberInputProps> {
|
14
11
|
children?: Snippet<[api: CreateNumberInputReturn]>;
|
15
12
|
}
|
16
13
|
</script>
|
17
14
|
|
18
15
|
<script lang="ts">
|
19
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
20
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
21
|
-
import {createUniqueId} from '../utils.svelte.js';
|
22
16
|
import {mergeProps} from '@zag-js/svelte';
|
23
17
|
import {numberInputContext} from './context.svelte.js';
|
24
18
|
import {createNumberInput} from './create-number-input.svelte.js';
|
@@ -26,14 +20,12 @@
|
|
26
20
|
let {
|
27
21
|
id,
|
28
22
|
ids,
|
29
|
-
dir,
|
30
23
|
max,
|
31
24
|
min,
|
32
25
|
step,
|
33
26
|
name,
|
34
27
|
form,
|
35
28
|
value,
|
36
|
-
locale,
|
37
29
|
pattern,
|
38
30
|
invalid,
|
39
31
|
disabled,
|
@@ -50,27 +42,19 @@
|
|
50
42
|
onFocusChange,
|
51
43
|
onValueChange,
|
52
44
|
onValueInvalid,
|
53
|
-
getRootNode,
|
54
45
|
children,
|
55
46
|
...props
|
56
47
|
}: NumberInputProps = $props();
|
57
48
|
|
58
|
-
let localeContext = getLocaleContext();
|
59
|
-
let environmentContext = getEnvironmentContext();
|
60
|
-
|
61
|
-
let uid = createUniqueId();
|
62
|
-
|
63
49
|
let context = createNumberInput({
|
64
|
-
id
|
50
|
+
id,
|
65
51
|
ids,
|
66
|
-
dir: dir ?? localeContext?.dir,
|
67
52
|
max,
|
68
53
|
min,
|
69
54
|
step,
|
70
55
|
name,
|
71
56
|
form,
|
72
57
|
value: $state.snapshot(value),
|
73
|
-
locale: locale ?? localeContext?.locale,
|
74
58
|
pattern,
|
75
59
|
invalid,
|
76
60
|
disabled,
|
@@ -87,7 +71,6 @@
|
|
87
71
|
onFocusChange,
|
88
72
|
onValueChange,
|
89
73
|
onValueInvalid,
|
90
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
91
74
|
});
|
92
75
|
|
93
76
|
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 NumberInputScrubberProps extends
|
4
|
+
export interface NumberInputScrubberProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as pagination from '@zag-js/pagination';
|
2
|
-
export interface CreatePaginationProps extends pagination.Context {
|
2
|
+
export interface CreatePaginationProps extends Omit<pagination.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreatePaginationReturn extends pagination.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 * as pagination from '@zag-js/pagination';
|
2
5
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
6
|
export function createPagination(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(pagination.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => pagination.connect(state, send, normalizeProps)));
|
6
16
|
return api;
|
7
17
|
}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {EllipsisProps} from '@zag-js/pagination';
|
4
4
|
|
5
|
-
export interface PaginationEllipsisProps
|
6
|
-
extends Assign<HtmlIngredientProps<'span'>, EllipsisProps> {}
|
5
|
+
export interface PaginationEllipsisProps extends Assign<HtmlProps<'span'>, EllipsisProps> {}
|
7
6
|
</script>
|
8
7
|
|
9
8
|
<script lang="ts">
|
@@ -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 {ItemProps} from '@zag-js/pagination';
|
4
4
|
|
5
5
|
export interface PaginationItemProps
|
6
|
-
extends Assign<
|
6
|
+
extends Assign<HtmlProps<'button'>, Omit<ItemProps, 'type'>> {}
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<script lang="ts">
|
@@ -14,14 +14,15 @@
|
|
14
14
|
|
15
15
|
let context = paginationContext.get();
|
16
16
|
|
17
|
-
let
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
let attrs = $derived(
|
18
|
+
mergeProps(
|
19
|
+
props,
|
20
|
+
context.getItemProps({
|
21
|
+
type: 'page',
|
22
|
+
value,
|
23
|
+
}),
|
24
|
+
),
|
22
25
|
);
|
23
|
-
|
24
|
-
let attrs = $derived(mergeProps(props, itemProps));
|
25
26
|
</script>
|
26
27
|
|
27
28
|
<button type="button" {...attrs}>
|
@@ -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 PaginationNextTriggerProps extends
|
4
|
+
export interface PaginationNextTriggerProps 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 PaginationPrevTriggerProps extends
|
4
|
+
export interface PaginationPrevTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,21 +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 {CreatePaginationProps, CreatePaginationReturn} from './create-pagination.svelte.js';
|
5
5
|
|
6
6
|
export interface PaginationProps
|
7
|
-
extends Assign<
|
8
|
-
Omit<HtmlIngredientProps<'div'>, 'children'>,
|
9
|
-
Omit<CreatePaginationProps, 'id'>
|
10
|
-
> {
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreatePaginationProps> {
|
11
8
|
children?: Snippet<[api: CreatePaginationReturn]>;
|
12
9
|
}
|
13
10
|
</script>
|
14
11
|
|
15
12
|
<script lang="ts">
|
16
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
17
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
18
|
-
import {createUniqueId} from '../utils.svelte.js';
|
19
13
|
import {mergeProps} from '@zag-js/svelte';
|
20
14
|
import {paginationContext} from './context.svelte.js';
|
21
15
|
import {createPagination} from './create-pagination.svelte.js';
|
@@ -23,7 +17,6 @@
|
|
23
17
|
let {
|
24
18
|
id,
|
25
19
|
ids,
|
26
|
-
dir,
|
27
20
|
type,
|
28
21
|
page,
|
29
22
|
pageSize,
|
@@ -32,20 +25,13 @@
|
|
32
25
|
translations,
|
33
26
|
onPageChange,
|
34
27
|
onPageSizeChange,
|
35
|
-
getRootNode,
|
36
28
|
children,
|
37
29
|
...props
|
38
30
|
}: PaginationProps = $props();
|
39
31
|
|
40
|
-
let localeContext = getLocaleContext();
|
41
|
-
let environmentContext = getEnvironmentContext();
|
42
|
-
|
43
|
-
let uid = createUniqueId();
|
44
|
-
|
45
32
|
let context = createPagination({
|
46
|
-
id
|
33
|
+
id,
|
47
34
|
ids,
|
48
|
-
dir: dir ?? localeContext?.dir,
|
49
35
|
type,
|
50
36
|
page,
|
51
37
|
pageSize,
|
@@ -54,7 +40,6 @@
|
|
54
40
|
translations,
|
55
41
|
onPageChange,
|
56
42
|
onPageSizeChange,
|
57
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
58
43
|
});
|
59
44
|
|
60
45
|
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 PinInputClearTriggerProps extends
|
4
|
+
export interface PinInputClearTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as pinInput from '@zag-js/pin-input';
|
2
|
-
export interface CreatePinInputProps extends pinInput.Context {
|
2
|
+
export interface CreatePinInputProps extends Omit<pinInput.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreatePinInputReturn extends pinInput.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 * as pinInput from '@zag-js/pin-input';
|
2
5
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
6
|
export function createPinInputContext(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(pinInput.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => pinInput.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 PinInputHiddenInputProps extends
|
4
|
+
export interface PinInputHiddenInputProps extends HtmlProps<'input'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -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 {InputProps} from '@zag-js/pin-input';
|
4
4
|
|
5
|
-
export interface PinInputInputProps extends Assign<
|
5
|
+
export interface PinInputInputProps extends Assign<HtmlProps<'input'>, InputProps> {}
|
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 PinInputLabelProps extends
|
4
|
+
export interface PinInputLabelProps 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 {CreatePinInputProps, CreatePinInputReturn} from './create-pin-input.svelte.js';
|
5
5
|
|
6
6
|
export interface PinInputProps
|
7
|
-
extends Assign<Omit<
|
7
|
+
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreatePinInputProps> {
|
8
8
|
children?: Snippet<[api: CreatePinInputReturn]>;
|
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 {pinInputContext} from './context.svelte.js';
|
18
15
|
import {createPinInputContext} from './create-pin-input.svelte.js';
|
@@ -20,7 +17,6 @@
|
|
20
17
|
let {
|
21
18
|
id,
|
22
19
|
ids,
|
23
|
-
dir,
|
24
20
|
otp,
|
25
21
|
form,
|
26
22
|
mask,
|
@@ -40,20 +36,13 @@
|
|
40
36
|
onValueChange,
|
41
37
|
onValueInvalid,
|
42
38
|
onValueComplete,
|
43
|
-
getRootNode,
|
44
39
|
children,
|
45
40
|
...props
|
46
41
|
}: PinInputProps = $props();
|
47
42
|
|
48
|
-
let localeContext = getLocaleContext();
|
49
|
-
let environmentContext = getEnvironmentContext();
|
50
|
-
|
51
|
-
let uid = createUniqueId();
|
52
|
-
|
53
43
|
let context = createPinInputContext({
|
54
|
-
id
|
44
|
+
id,
|
55
45
|
ids,
|
56
|
-
dir: dir ?? localeContext?.dir,
|
57
46
|
otp,
|
58
47
|
form,
|
59
48
|
mask,
|
@@ -73,7 +62,6 @@
|
|
73
62
|
onValueChange,
|
74
63
|
onValueInvalid,
|
75
64
|
onValueComplete,
|
76
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
77
65
|
});
|
78
66
|
|
79
67
|
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 PopoverArrowTipProps extends
|
4
|
+
export interface PopoverArrowTipProps 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 PopoverArrowProps extends
|
4
|
+
export interface PopoverArrowProps 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 PopoverCloseTriggerProps extends
|
4
|
+
export interface PopoverCloseTriggerProps 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 PopoverContentProps extends
|
4
|
+
export interface PopoverContentProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as popover from '@zag-js/popover';
|
2
|
-
export interface CreatePopoverProps extends popover.Context {
|
2
|
+
export interface CreatePopoverProps extends Omit<popover.Context, 'id' | 'dir' | 'getRootNode' | 'open.controlled'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreatePopoverReturn extends popover.Api {
|
5
6
|
}
|
@@ -1,7 +1,18 @@
|
|
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 * as popover from '@zag-js/popover';
|
2
5
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
6
|
export function createPopover(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(popover.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
'open.controlled': props.open != null,
|
15
|
+
}));
|
5
16
|
const api = $derived(reflect(() => popover.connect(state, send, normalizeProps)));
|
6
17
|
return api;
|
7
18
|
}
|
@@ -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 PopoverDescriptionProps extends
|
4
|
+
export interface PopoverDescriptionProps 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 PopoverPositionerProps extends
|
4
|
+
export interface PopoverPositionerProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/popover/root.svelte
CHANGED
@@ -2,32 +2,18 @@
|
|
2
2
|
import type {Snippet} from 'svelte';
|
3
3
|
import type {CreatePopoverProps, CreatePopoverReturn} from './create-popover.svelte.js';
|
4
4
|
|
5
|
-
export interface PopoverProps extends
|
6
|
-
id?: string | null;
|
5
|
+
export interface PopoverProps extends CreatePopoverProps {
|
7
6
|
children?: Snippet<[api: CreatePopoverReturn]>;
|
8
7
|
}
|
9
8
|
</script>
|
10
9
|
|
11
10
|
<script lang="ts">
|
12
|
-
import {getEnvironmentContext} from '../environment-provider/index.js';
|
13
|
-
import {getLocaleContext} from '../locale-provider/index.js';
|
14
|
-
import {createUniqueId} from '../utils.svelte.js';
|
15
11
|
import {popoverContext} from './context.svelte.js';
|
16
12
|
import {createPopover} from './create-popover.svelte.js';
|
17
13
|
|
18
|
-
let {
|
14
|
+
let {children, ...props}: PopoverProps = $props();
|
19
15
|
|
20
|
-
let
|
21
|
-
let environmentContext = getEnvironmentContext();
|
22
|
-
|
23
|
-
let uid = createUniqueId();
|
24
|
-
|
25
|
-
let context = createPopover({
|
26
|
-
id: id ?? uid,
|
27
|
-
dir: dir ?? localeContext?.dir,
|
28
|
-
getRootNode: getRootNode ?? environmentContext?.getRootNode,
|
29
|
-
...props,
|
30
|
-
});
|
16
|
+
let context = createPopover(props);
|
31
17
|
|
32
18
|
popoverContext.set(context);
|
33
19
|
</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 PopoverTitleProps extends
|
4
|
+
export interface PopoverTitleProps 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 PopoverTriggerProps extends
|
4
|
+
export interface PopoverTriggerProps extends HtmlProps<'button'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
package/dist/portal/root.svelte
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
export interface PortalProps {
|
5
5
|
container?: HTMLElement;
|
6
6
|
disabled?: boolean;
|
7
|
-
getRootNode?: () => ShadowRoot | Document | Node;
|
8
7
|
children: Snippet;
|
9
8
|
}
|
10
9
|
</script>
|
@@ -13,15 +12,16 @@
|
|
13
12
|
import {getEnvironmentContext} from '../environment-provider/index.js';
|
14
13
|
import {portal} from '@zag-js/svelte';
|
15
14
|
|
16
|
-
let {container, disabled,
|
15
|
+
let {container, disabled, children}: PortalProps = $props();
|
16
|
+
|
17
17
|
let environmentContext = getEnvironmentContext();
|
18
18
|
</script>
|
19
19
|
|
20
20
|
<div
|
21
21
|
use:portal={{
|
22
|
-
container,
|
23
22
|
disabled,
|
24
|
-
|
23
|
+
container,
|
24
|
+
getRootNode: environmentContext?.getRootNode,
|
25
25
|
}}
|
26
26
|
data-scope="portal"
|
27
27
|
data-part="root"
|
@@ -1,9 +1,8 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign,
|
2
|
+
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {Context} from '@zag-js/presence';
|
4
4
|
|
5
|
-
export interface PresenceProps
|
6
|
-
extends Assign<HtmlIngredientProps<'div'>, Context> {}
|
5
|
+
export interface PresenceProps extends Assign<HtmlProps<'div'>, Context> {}
|
7
6
|
</script>
|
8
7
|
|
9
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 ProgressCircleRangeProps extends
|
4
|
+
export interface ProgressCircleRangeProps extends HtmlProps<'circle'> {}
|
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 ProgressCircleTrackProps extends
|
4
|
+
export interface ProgressCircleTrackProps extends HtmlProps<'circle'> {}
|
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 ProgressCircleProps extends
|
4
|
+
export interface ProgressCircleProps extends HtmlProps<'svg'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as progress from '@zag-js/progress';
|
2
|
-
export interface CreateProgressProps extends progress.Context {
|
2
|
+
export interface CreateProgressProps extends Omit<progress.Context, 'id' | 'dir' | 'getRootNode'> {
|
3
|
+
id?: string | null;
|
3
4
|
}
|
4
5
|
export interface CreateProgressReturn extends progress.Api<any> {
|
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 * as progress from '@zag-js/progress';
|
2
5
|
import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
|
3
6
|
export function createProgress(props) {
|
4
|
-
const
|
7
|
+
const localeContext = getLocaleContext();
|
8
|
+
const environmentContext = getEnvironmentContext();
|
9
|
+
const [state, send] = useMachine(progress.machine({
|
10
|
+
...props,
|
11
|
+
id: props.id ?? createUniqueId(),
|
12
|
+
dir: localeContext?.dir,
|
13
|
+
getRootNode: environmentContext?.getRootNode,
|
14
|
+
}));
|
5
15
|
const api = $derived(reflect(() => progress.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 ProgressLabelProps extends
|
4
|
+
export interface ProgressLabelProps extends HtmlProps<'div'> {}
|
5
5
|
</script>
|
6
6
|
|
7
7
|
<script lang="ts">
|