ui-ingredients 0.21.0 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/accordion/accordion-item-content.svelte +55 -55
- package/dist/accordion/accordion-root.svelte +66 -66
- package/dist/alert-dialog/alert-dialog-backdrop.svelte +49 -49
- package/dist/alert-dialog/alert-dialog-root.svelte +48 -48
- package/dist/avatar/avatar-root.svelte +46 -46
- package/dist/carousel/carousel-root.svelte +56 -56
- package/dist/checkbox/checkbox-root.svelte +59 -59
- package/dist/clipboard/clipboard-root.svelte +52 -52
- package/dist/collapsible/collapsible-root.svelte +75 -75
- package/dist/color-picker/color-picker-root.svelte +87 -87
- package/dist/combobox/combobox-root.svelte +101 -101
- package/dist/combobox/combobox-trigger.svelte +41 -41
- package/dist/date-picker/date-picker-root.svelte +89 -89
- package/dist/dialog/dialog-backdrop.svelte +45 -45
- package/dist/dialog/dialog-root.svelte +48 -48
- package/dist/drawer/drawer-backdrop.svelte +45 -45
- package/dist/drawer/drawer-root.svelte +48 -48
- package/dist/editable/editable-root.svelte +74 -74
- package/dist/field/field-error-text.svelte +50 -50
- package/dist/field/field-root.svelte +63 -63
- package/dist/file-upload/file-upload-root.svelte +66 -66
- package/dist/floating-panel/floating-panel-root.svelte +47 -47
- package/dist/hover-card/hover-card-root.svelte +52 -52
- package/dist/menu/menu-root.svelte +74 -74
- package/dist/number-input/number-input-root.svelte +74 -74
- package/dist/pagination/pagination-root.svelte +57 -57
- package/dist/pin-input/pin-input-root.svelte +68 -68
- package/dist/popover/popover-root.svelte +60 -60
- package/dist/presence/presence.svelte +48 -48
- package/dist/progress/progress-root.svelte +54 -54
- package/dist/qr-code/qr-code-root.svelte +48 -48
- package/dist/radio-group/radio-group-root.svelte +56 -56
- package/dist/rating-group/rating-group-root.svelte +63 -63
- package/dist/segment-group/segment-group-root.svelte +58 -58
- package/dist/select/select-root.svelte +88 -88
- package/dist/signature-pad/signature-pad-root.svelte +59 -59
- package/dist/slider/slider-root.svelte +69 -69
- package/dist/splitter/splitter-root.svelte +53 -53
- package/dist/steps/steps-completed-content.svelte +51 -51
- package/dist/steps/steps-content.svelte +55 -55
- package/dist/steps/steps-root.svelte +65 -65
- package/dist/switch/switch-root.svelte +59 -59
- package/dist/tabs/tabs-root.svelte +57 -57
- package/dist/tags-input/tags-input-root.svelte +74 -74
- package/dist/time-picker/time-picker-root.svelte +81 -81
- package/dist/timer/timer-root.svelte +55 -55
- package/dist/toast/create-toaster.svelte.d.ts +1 -1
- package/dist/toast/toast-actor.svelte +19 -19
- package/dist/toast/toast-actor.svelte.d.ts +3 -3
- package/dist/toast/toaster.svelte +19 -21
- package/dist/toast/toaster.svelte.d.ts +1 -1
- package/dist/toggle/toggle-root.svelte +50 -50
- package/dist/toggle-group/toggle-group-root.svelte +58 -58
- package/dist/tooltip/tooltip-root.svelte +44 -44
- package/dist/tour/tour-backdrop.svelte +44 -44
- package/dist/tour/tour-root.svelte +47 -47
- package/dist/tree-view/tree-view-branch-content.svelte +55 -55
- package/dist/tree-view/tree-view-root.svelte +68 -68
- package/package.json +5 -5
@@ -1,59 +1,59 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateSwitchProps,
|
5
|
-
CreateSwitchReturn,
|
6
|
-
} from './create-switch.svelte.js';
|
7
|
-
|
8
|
-
export interface SwitchProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'label', HTMLLabelElement, CreateSwitchReturn>,
|
11
|
-
CreateSwitchProps
|
12
|
-
> {}
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<script lang="ts">
|
16
|
-
import {mergeProps} from '../merge-props.js';
|
17
|
-
import {reflect} from '@zag-js/svelte';
|
18
|
-
import {createSplitProps} from '@zag-js/utils';
|
19
|
-
import {createSwitch} from './create-switch.svelte.js';
|
20
|
-
import {setSwitchContext} from './switch-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: SwitchProps = $props();
|
28
|
-
|
29
|
-
let [createSwitchProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateSwitchProps>([
|
31
|
-
'id',
|
32
|
-
'ids',
|
33
|
-
'form',
|
34
|
-
'name',
|
35
|
-
'label',
|
36
|
-
'value',
|
37
|
-
'checked',
|
38
|
-
'invalid',
|
39
|
-
'disabled',
|
40
|
-
'readOnly',
|
41
|
-
'required',
|
42
|
-
'onCheckedChange',
|
43
|
-
])(props),
|
44
|
-
);
|
45
|
-
|
46
|
-
let switch_ = createSwitch(reflect(() => createSwitchProps));
|
47
|
-
|
48
|
-
let mergedProps = $derived(mergeProps(switch_.getRootProps(), localProps));
|
49
|
-
|
50
|
-
setSwitchContext(switch_);
|
51
|
-
</script>
|
52
|
-
|
53
|
-
{#if asChild}
|
54
|
-
{@render asChild(mergedProps, switch_)}
|
55
|
-
{:else}
|
56
|
-
<label bind:this={ref} {...mergedProps}>
|
57
|
-
{@render children?.(switch_)}
|
58
|
-
</label>
|
59
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateSwitchProps,
|
5
|
+
CreateSwitchReturn,
|
6
|
+
} from './create-switch.svelte.js';
|
7
|
+
|
8
|
+
export interface SwitchProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'label', HTMLLabelElement, CreateSwitchReturn>,
|
11
|
+
CreateSwitchProps
|
12
|
+
> {}
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script lang="ts">
|
16
|
+
import {mergeProps} from '../merge-props.js';
|
17
|
+
import {reflect} from '@zag-js/svelte';
|
18
|
+
import {createSplitProps} from '@zag-js/utils';
|
19
|
+
import {createSwitch} from './create-switch.svelte.js';
|
20
|
+
import {setSwitchContext} from './switch-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: SwitchProps = $props();
|
28
|
+
|
29
|
+
let [createSwitchProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateSwitchProps>([
|
31
|
+
'id',
|
32
|
+
'ids',
|
33
|
+
'form',
|
34
|
+
'name',
|
35
|
+
'label',
|
36
|
+
'value',
|
37
|
+
'checked',
|
38
|
+
'invalid',
|
39
|
+
'disabled',
|
40
|
+
'readOnly',
|
41
|
+
'required',
|
42
|
+
'onCheckedChange',
|
43
|
+
])(props),
|
44
|
+
);
|
45
|
+
|
46
|
+
let switch_ = createSwitch(reflect(() => createSwitchProps));
|
47
|
+
|
48
|
+
let mergedProps = $derived(mergeProps(switch_.getRootProps(), localProps));
|
49
|
+
|
50
|
+
setSwitchContext(switch_);
|
51
|
+
</script>
|
52
|
+
|
53
|
+
{#if asChild}
|
54
|
+
{@render asChild(mergedProps, switch_)}
|
55
|
+
{:else}
|
56
|
+
<label bind:this={ref} {...mergedProps}>
|
57
|
+
{@render children?.(switch_)}
|
58
|
+
</label>
|
59
|
+
{/if}
|
@@ -1,57 +1,57 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateTabsProps,
|
5
|
-
CreateTabsReturn,
|
6
|
-
} from './create-tabs.svelte.js';
|
7
|
-
|
8
|
-
export interface TabsProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateTabsReturn>,
|
11
|
-
CreateTabsProps
|
12
|
-
> {}
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<script lang="ts">
|
16
|
-
import {mergeProps} from '../merge-props.js';
|
17
|
-
import {reflect} from '@zag-js/svelte';
|
18
|
-
import {createSplitProps} from '@zag-js/utils';
|
19
|
-
import {createTabs} from './create-tabs.svelte.js';
|
20
|
-
import {setTabsContext} from './tabs-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: TabsProps = $props();
|
28
|
-
|
29
|
-
let [createTabsProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateTabsProps>([
|
31
|
-
'id',
|
32
|
-
'ids',
|
33
|
-
'value',
|
34
|
-
'loopFocus',
|
35
|
-
'composite',
|
36
|
-
'orientation',
|
37
|
-
'translations',
|
38
|
-
'activationMode',
|
39
|
-
'onFocusChange',
|
40
|
-
'onValueChange',
|
41
|
-
])(props),
|
42
|
-
);
|
43
|
-
|
44
|
-
let tabs = createTabs(reflect(() => createTabsProps));
|
45
|
-
|
46
|
-
let mergedProps = $derived(mergeProps(tabs.getRootProps(), localProps));
|
47
|
-
|
48
|
-
setTabsContext(tabs);
|
49
|
-
</script>
|
50
|
-
|
51
|
-
{#if asChild}
|
52
|
-
{@render asChild(mergedProps, tabs)}
|
53
|
-
{:else}
|
54
|
-
<div bind:this={ref} {...mergedProps}>
|
55
|
-
{@render children?.(tabs)}
|
56
|
-
</div>
|
57
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateTabsProps,
|
5
|
+
CreateTabsReturn,
|
6
|
+
} from './create-tabs.svelte.js';
|
7
|
+
|
8
|
+
export interface TabsProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateTabsReturn>,
|
11
|
+
CreateTabsProps
|
12
|
+
> {}
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script lang="ts">
|
16
|
+
import {mergeProps} from '../merge-props.js';
|
17
|
+
import {reflect} from '@zag-js/svelte';
|
18
|
+
import {createSplitProps} from '@zag-js/utils';
|
19
|
+
import {createTabs} from './create-tabs.svelte.js';
|
20
|
+
import {setTabsContext} from './tabs-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: TabsProps = $props();
|
28
|
+
|
29
|
+
let [createTabsProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateTabsProps>([
|
31
|
+
'id',
|
32
|
+
'ids',
|
33
|
+
'value',
|
34
|
+
'loopFocus',
|
35
|
+
'composite',
|
36
|
+
'orientation',
|
37
|
+
'translations',
|
38
|
+
'activationMode',
|
39
|
+
'onFocusChange',
|
40
|
+
'onValueChange',
|
41
|
+
])(props),
|
42
|
+
);
|
43
|
+
|
44
|
+
let tabs = createTabs(reflect(() => createTabsProps));
|
45
|
+
|
46
|
+
let mergedProps = $derived(mergeProps(tabs.getRootProps(), localProps));
|
47
|
+
|
48
|
+
setTabsContext(tabs);
|
49
|
+
</script>
|
50
|
+
|
51
|
+
{#if asChild}
|
52
|
+
{@render asChild(mergedProps, tabs)}
|
53
|
+
{:else}
|
54
|
+
<div bind:this={ref} {...mergedProps}>
|
55
|
+
{@render children?.(tabs)}
|
56
|
+
</div>
|
57
|
+
{/if}
|
@@ -1,74 +1,74 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateTagsInputProps,
|
5
|
-
CreateTagsInputReturn,
|
6
|
-
} from './create-tags-input.svelte.js';
|
7
|
-
|
8
|
-
export interface TagsInputProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateTagsInputReturn>,
|
11
|
-
CreateTagsInputProps
|
12
|
-
> {}
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<script lang="ts">
|
16
|
-
import {mergeProps} from '../merge-props.js';
|
17
|
-
import {reflect} from '@zag-js/svelte';
|
18
|
-
import {createSplitProps} from '@zag-js/utils';
|
19
|
-
import {createTagsInput} from './create-tags-input.svelte.js';
|
20
|
-
import {setTagsInputContext} from './tags-input-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: TagsInputProps = $props();
|
28
|
-
|
29
|
-
let [createTagsInputProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateTagsInputProps>([
|
31
|
-
'id',
|
32
|
-
'ids',
|
33
|
-
'max',
|
34
|
-
'form',
|
35
|
-
'name',
|
36
|
-
'value',
|
37
|
-
'invalid',
|
38
|
-
'disabled',
|
39
|
-
'editable',
|
40
|
-
'readOnly',
|
41
|
-
'validate',
|
42
|
-
'required',
|
43
|
-
'delimiter',
|
44
|
-
'autoFocus',
|
45
|
-
'maxLength',
|
46
|
-
'addOnPaste',
|
47
|
-
'inputValue',
|
48
|
-
'blurBehavior',
|
49
|
-
'translations',
|
50
|
-
'allowOverflow',
|
51
|
-
'onValueChange',
|
52
|
-
'onFocusOutside',
|
53
|
-
'onValueInvalid',
|
54
|
-
'onInteractOutside',
|
55
|
-
'onHighlightChange',
|
56
|
-
'onInputValueChange',
|
57
|
-
'onPointerDownOutside',
|
58
|
-
])(props),
|
59
|
-
);
|
60
|
-
|
61
|
-
let tagsInput = createTagsInput(reflect(() => createTagsInputProps));
|
62
|
-
|
63
|
-
let mergedProps = $derived(mergeProps(tagsInput.getRootProps(), localProps));
|
64
|
-
|
65
|
-
setTagsInputContext(tagsInput);
|
66
|
-
</script>
|
67
|
-
|
68
|
-
{#if asChild}
|
69
|
-
{@render asChild(mergedProps, tagsInput)}
|
70
|
-
{:else}
|
71
|
-
<div bind:this={ref} {...mergedProps}>
|
72
|
-
{@render children?.(tagsInput)}
|
73
|
-
</div>
|
74
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateTagsInputProps,
|
5
|
+
CreateTagsInputReturn,
|
6
|
+
} from './create-tags-input.svelte.js';
|
7
|
+
|
8
|
+
export interface TagsInputProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateTagsInputReturn>,
|
11
|
+
CreateTagsInputProps
|
12
|
+
> {}
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script lang="ts">
|
16
|
+
import {mergeProps} from '../merge-props.js';
|
17
|
+
import {reflect} from '@zag-js/svelte';
|
18
|
+
import {createSplitProps} from '@zag-js/utils';
|
19
|
+
import {createTagsInput} from './create-tags-input.svelte.js';
|
20
|
+
import {setTagsInputContext} from './tags-input-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: TagsInputProps = $props();
|
28
|
+
|
29
|
+
let [createTagsInputProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateTagsInputProps>([
|
31
|
+
'id',
|
32
|
+
'ids',
|
33
|
+
'max',
|
34
|
+
'form',
|
35
|
+
'name',
|
36
|
+
'value',
|
37
|
+
'invalid',
|
38
|
+
'disabled',
|
39
|
+
'editable',
|
40
|
+
'readOnly',
|
41
|
+
'validate',
|
42
|
+
'required',
|
43
|
+
'delimiter',
|
44
|
+
'autoFocus',
|
45
|
+
'maxLength',
|
46
|
+
'addOnPaste',
|
47
|
+
'inputValue',
|
48
|
+
'blurBehavior',
|
49
|
+
'translations',
|
50
|
+
'allowOverflow',
|
51
|
+
'onValueChange',
|
52
|
+
'onFocusOutside',
|
53
|
+
'onValueInvalid',
|
54
|
+
'onInteractOutside',
|
55
|
+
'onHighlightChange',
|
56
|
+
'onInputValueChange',
|
57
|
+
'onPointerDownOutside',
|
58
|
+
])(props),
|
59
|
+
);
|
60
|
+
|
61
|
+
let tagsInput = createTagsInput(reflect(() => createTagsInputProps));
|
62
|
+
|
63
|
+
let mergedProps = $derived(mergeProps(tagsInput.getRootProps(), localProps));
|
64
|
+
|
65
|
+
setTagsInputContext(tagsInput);
|
66
|
+
</script>
|
67
|
+
|
68
|
+
{#if asChild}
|
69
|
+
{@render asChild(mergedProps, tagsInput)}
|
70
|
+
{:else}
|
71
|
+
<div bind:this={ref} {...mergedProps}>
|
72
|
+
{@render children?.(tagsInput)}
|
73
|
+
</div>
|
74
|
+
{/if}
|
@@ -1,81 +1,81 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
|
3
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
4
|
-
import type {
|
5
|
-
CreateTimePickerProps,
|
6
|
-
CreateTimePickerReturn,
|
7
|
-
} from './create-time-picker.svelte.js';
|
8
|
-
|
9
|
-
export interface TimePickerProps
|
10
|
-
extends Assign<
|
11
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateTimePickerReturn>,
|
12
|
-
CreateTimePickerProps
|
13
|
-
>,
|
14
|
-
PresenceStrategyProps {}
|
15
|
-
</script>
|
16
|
-
|
17
|
-
<script lang="ts">
|
18
|
-
import {mergeProps} from '../merge-props.js';
|
19
|
-
import {createPresence} from '../presence/create-presence.svelte.js';
|
20
|
-
import {setPresenceContext} from '../presence/presence-context.svelte.js';
|
21
|
-
import {reflect} from '@zag-js/svelte';
|
22
|
-
import {createSplitProps} from '@zag-js/utils';
|
23
|
-
import {createTimePicker} from './create-time-picker.svelte.js';
|
24
|
-
import {setTimePickerContext} from './time-picker-context.svelte.js';
|
25
|
-
|
26
|
-
let {
|
27
|
-
ref = $bindable(null),
|
28
|
-
asChild,
|
29
|
-
children,
|
30
|
-
...props
|
31
|
-
}: TimePickerProps = $props();
|
32
|
-
|
33
|
-
let [createTimePickerProps, rest] = $derived(
|
34
|
-
createSplitProps<CreateTimePickerProps>([
|
35
|
-
'id',
|
36
|
-
'ids',
|
37
|
-
'min',
|
38
|
-
'max',
|
39
|
-
'name',
|
40
|
-
'open',
|
41
|
-
'openControlled',
|
42
|
-
'steps',
|
43
|
-
'value',
|
44
|
-
'locale',
|
45
|
-
'readOnly',
|
46
|
-
'disabled',
|
47
|
-
'placeholder',
|
48
|
-
'positioning',
|
49
|
-
'allowSeconds',
|
50
|
-
'disableLayer',
|
51
|
-
'onOpenChange',
|
52
|
-
'onValueChange',
|
53
|
-
'onFocusChange',
|
54
|
-
])(props),
|
55
|
-
);
|
56
|
-
|
57
|
-
let [presenceStrategyProps, localProps] = $derived(
|
58
|
-
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(rest),
|
59
|
-
);
|
60
|
-
|
61
|
-
let timePicker = createTimePicker(reflect(() => createTimePickerProps));
|
62
|
-
let presence = createPresence(
|
63
|
-
reflect(() => ({
|
64
|
-
...presenceStrategyProps,
|
65
|
-
present: timePicker.open,
|
66
|
-
})),
|
67
|
-
);
|
68
|
-
|
69
|
-
let mergedProps = $derived(mergeProps(timePicker.getRootProps(), localProps));
|
70
|
-
|
71
|
-
setTimePickerContext(timePicker);
|
72
|
-
setPresenceContext(presence);
|
73
|
-
</script>
|
74
|
-
|
75
|
-
{#if asChild}
|
76
|
-
{@render asChild(mergedProps, timePicker)}
|
77
|
-
{:else}
|
78
|
-
<div bind:this={ref} {...mergedProps}>
|
79
|
-
{@render children?.(timePicker)}
|
80
|
-
</div>
|
81
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {PresenceStrategyProps} from '../presence/create-presence.svelte.js';
|
3
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
4
|
+
import type {
|
5
|
+
CreateTimePickerProps,
|
6
|
+
CreateTimePickerReturn,
|
7
|
+
} from './create-time-picker.svelte.js';
|
8
|
+
|
9
|
+
export interface TimePickerProps
|
10
|
+
extends Assign<
|
11
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateTimePickerReturn>,
|
12
|
+
CreateTimePickerProps
|
13
|
+
>,
|
14
|
+
PresenceStrategyProps {}
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<script lang="ts">
|
18
|
+
import {mergeProps} from '../merge-props.js';
|
19
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
20
|
+
import {setPresenceContext} from '../presence/presence-context.svelte.js';
|
21
|
+
import {reflect} from '@zag-js/svelte';
|
22
|
+
import {createSplitProps} from '@zag-js/utils';
|
23
|
+
import {createTimePicker} from './create-time-picker.svelte.js';
|
24
|
+
import {setTimePickerContext} from './time-picker-context.svelte.js';
|
25
|
+
|
26
|
+
let {
|
27
|
+
ref = $bindable(null),
|
28
|
+
asChild,
|
29
|
+
children,
|
30
|
+
...props
|
31
|
+
}: TimePickerProps = $props();
|
32
|
+
|
33
|
+
let [createTimePickerProps, rest] = $derived(
|
34
|
+
createSplitProps<CreateTimePickerProps>([
|
35
|
+
'id',
|
36
|
+
'ids',
|
37
|
+
'min',
|
38
|
+
'max',
|
39
|
+
'name',
|
40
|
+
'open',
|
41
|
+
'openControlled',
|
42
|
+
'steps',
|
43
|
+
'value',
|
44
|
+
'locale',
|
45
|
+
'readOnly',
|
46
|
+
'disabled',
|
47
|
+
'placeholder',
|
48
|
+
'positioning',
|
49
|
+
'allowSeconds',
|
50
|
+
'disableLayer',
|
51
|
+
'onOpenChange',
|
52
|
+
'onValueChange',
|
53
|
+
'onFocusChange',
|
54
|
+
])(props),
|
55
|
+
);
|
56
|
+
|
57
|
+
let [presenceStrategyProps, localProps] = $derived(
|
58
|
+
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(rest),
|
59
|
+
);
|
60
|
+
|
61
|
+
let timePicker = createTimePicker(reflect(() => createTimePickerProps));
|
62
|
+
let presence = createPresence(
|
63
|
+
reflect(() => ({
|
64
|
+
...presenceStrategyProps,
|
65
|
+
present: timePicker.open,
|
66
|
+
})),
|
67
|
+
);
|
68
|
+
|
69
|
+
let mergedProps = $derived(mergeProps(timePicker.getRootProps(), localProps));
|
70
|
+
|
71
|
+
setTimePickerContext(timePicker);
|
72
|
+
setPresenceContext(presence);
|
73
|
+
</script>
|
74
|
+
|
75
|
+
{#if asChild}
|
76
|
+
{@render asChild(mergedProps, timePicker)}
|
77
|
+
{:else}
|
78
|
+
<div bind:this={ref} {...mergedProps}>
|
79
|
+
{@render children?.(timePicker)}
|
80
|
+
</div>
|
81
|
+
{/if}
|
@@ -1,55 +1,55 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateTimerProps,
|
5
|
-
CreateTimerReturn,
|
6
|
-
} from './create-timer.svelte.js';
|
7
|
-
|
8
|
-
export interface TimerProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateTimerReturn>,
|
11
|
-
CreateTimerProps
|
12
|
-
> {}
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<script lang="ts">
|
16
|
-
import {mergeProps} from '../merge-props.js';
|
17
|
-
import {reflect} from '@zag-js/svelte';
|
18
|
-
import {createSplitProps} from '@zag-js/utils';
|
19
|
-
import {createTimer} from './create-timer.svelte.js';
|
20
|
-
import {setTimerContext} from './timer-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: TimerProps = $props();
|
28
|
-
|
29
|
-
let [createTimerProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateTimerProps>([
|
31
|
-
'id',
|
32
|
-
'startMs',
|
33
|
-
'targetMs',
|
34
|
-
'interval',
|
35
|
-
'autoStart',
|
36
|
-
'countdown',
|
37
|
-
'onTick',
|
38
|
-
'onComplete',
|
39
|
-
])(props),
|
40
|
-
);
|
41
|
-
|
42
|
-
let timer = createTimer(reflect(() => createTimerProps));
|
43
|
-
|
44
|
-
let mergedProps = $derived(mergeProps(timer.getRootProps(), localProps));
|
45
|
-
|
46
|
-
setTimerContext(timer);
|
47
|
-
</script>
|
48
|
-
|
49
|
-
{#if asChild}
|
50
|
-
{@render asChild(mergedProps, timer)}
|
51
|
-
{:else}
|
52
|
-
<div bind:this={ref} {...mergedProps}>
|
53
|
-
{@render children?.(timer)}
|
54
|
-
</div>
|
55
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateTimerProps,
|
5
|
+
CreateTimerReturn,
|
6
|
+
} from './create-timer.svelte.js';
|
7
|
+
|
8
|
+
export interface TimerProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateTimerReturn>,
|
11
|
+
CreateTimerProps
|
12
|
+
> {}
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script lang="ts">
|
16
|
+
import {mergeProps} from '../merge-props.js';
|
17
|
+
import {reflect} from '@zag-js/svelte';
|
18
|
+
import {createSplitProps} from '@zag-js/utils';
|
19
|
+
import {createTimer} from './create-timer.svelte.js';
|
20
|
+
import {setTimerContext} from './timer-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: TimerProps = $props();
|
28
|
+
|
29
|
+
let [createTimerProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateTimerProps>([
|
31
|
+
'id',
|
32
|
+
'startMs',
|
33
|
+
'targetMs',
|
34
|
+
'interval',
|
35
|
+
'autoStart',
|
36
|
+
'countdown',
|
37
|
+
'onTick',
|
38
|
+
'onComplete',
|
39
|
+
])(props),
|
40
|
+
);
|
41
|
+
|
42
|
+
let timer = createTimer(reflect(() => createTimerProps));
|
43
|
+
|
44
|
+
let mergedProps = $derived(mergeProps(timer.getRootProps(), localProps));
|
45
|
+
|
46
|
+
setTimerContext(timer);
|
47
|
+
</script>
|
48
|
+
|
49
|
+
{#if asChild}
|
50
|
+
{@render asChild(mergedProps, timer)}
|
51
|
+
{:else}
|
52
|
+
<div bind:this={ref} {...mergedProps}>
|
53
|
+
{@render children?.(timer)}
|
54
|
+
</div>
|
55
|
+
{/if}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as toast from '@zag-js/toast';
|
2
|
-
export interface CreateToasterProps extends Omit<Partial<toast.GroupMachineContext>, 'id'> {
|
2
|
+
export interface CreateToasterProps extends Omit<Partial<toast.GroupMachineContext>, 'id' | 'dir' | 'getRootNode'> {
|
3
3
|
id?: string;
|
4
4
|
placement?: toast.Placement;
|
5
5
|
}
|