ui-ingredients 0.20.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 -37
- package/dist/steps/steps-completed-content.svelte.d.ts +2 -1
- package/dist/steps/steps-content.svelte +55 -32
- package/dist/steps/steps-content.svelte.d.ts +2 -1
- package/dist/steps/steps-root.svelte +65 -55
- package/dist/steps/steps-root.svelte.d.ts +2 -1
- 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,69 +1,69 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateSliderProps,
|
5
|
-
CreateSliderReturn,
|
6
|
-
} from './create-slider.svelte.js';
|
7
|
-
|
8
|
-
export interface SliderProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateSliderReturn>,
|
11
|
-
CreateSliderProps
|
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 {createSlider} from './create-slider.svelte.js';
|
20
|
-
import {setSliderContext} from './slider-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: SliderProps = $props();
|
28
|
-
|
29
|
-
let [createSliderProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateSliderProps>([
|
31
|
-
'id',
|
32
|
-
'ids',
|
33
|
-
'max',
|
34
|
-
'min',
|
35
|
-
'step',
|
36
|
-
'form',
|
37
|
-
'name',
|
38
|
-
'value',
|
39
|
-
'origin',
|
40
|
-
'invalid',
|
41
|
-
'readOnly',
|
42
|
-
'disabled',
|
43
|
-
'orientation',
|
44
|
-
'thumbAlignment',
|
45
|
-
'thumbSize',
|
46
|
-
'minStepsBetweenThumbs',
|
47
|
-
'onFocusChange',
|
48
|
-
'onValueChange',
|
49
|
-
'onValueChangeEnd',
|
50
|
-
'getAriaValueText',
|
51
|
-
'aria-label',
|
52
|
-
'aria-labelledby',
|
53
|
-
])(props),
|
54
|
-
);
|
55
|
-
|
56
|
-
let slider = createSlider(reflect(() => createSliderProps));
|
57
|
-
|
58
|
-
let mergedProps = $derived(mergeProps(slider.getRootProps(), localProps));
|
59
|
-
|
60
|
-
setSliderContext(slider);
|
61
|
-
</script>
|
62
|
-
|
63
|
-
{#if asChild}
|
64
|
-
{@render asChild(mergedProps, slider)}
|
65
|
-
{:else}
|
66
|
-
<div bind:this={ref} {...mergedProps}>
|
67
|
-
{@render children?.(slider)}
|
68
|
-
</div>
|
69
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateSliderProps,
|
5
|
+
CreateSliderReturn,
|
6
|
+
} from './create-slider.svelte.js';
|
7
|
+
|
8
|
+
export interface SliderProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateSliderReturn>,
|
11
|
+
CreateSliderProps
|
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 {createSlider} from './create-slider.svelte.js';
|
20
|
+
import {setSliderContext} from './slider-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: SliderProps = $props();
|
28
|
+
|
29
|
+
let [createSliderProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateSliderProps>([
|
31
|
+
'id',
|
32
|
+
'ids',
|
33
|
+
'max',
|
34
|
+
'min',
|
35
|
+
'step',
|
36
|
+
'form',
|
37
|
+
'name',
|
38
|
+
'value',
|
39
|
+
'origin',
|
40
|
+
'invalid',
|
41
|
+
'readOnly',
|
42
|
+
'disabled',
|
43
|
+
'orientation',
|
44
|
+
'thumbAlignment',
|
45
|
+
'thumbSize',
|
46
|
+
'minStepsBetweenThumbs',
|
47
|
+
'onFocusChange',
|
48
|
+
'onValueChange',
|
49
|
+
'onValueChangeEnd',
|
50
|
+
'getAriaValueText',
|
51
|
+
'aria-label',
|
52
|
+
'aria-labelledby',
|
53
|
+
])(props),
|
54
|
+
);
|
55
|
+
|
56
|
+
let slider = createSlider(reflect(() => createSliderProps));
|
57
|
+
|
58
|
+
let mergedProps = $derived(mergeProps(slider.getRootProps(), localProps));
|
59
|
+
|
60
|
+
setSliderContext(slider);
|
61
|
+
</script>
|
62
|
+
|
63
|
+
{#if asChild}
|
64
|
+
{@render asChild(mergedProps, slider)}
|
65
|
+
{:else}
|
66
|
+
<div bind:this={ref} {...mergedProps}>
|
67
|
+
{@render children?.(slider)}
|
68
|
+
</div>
|
69
|
+
{/if}
|
@@ -1,53 +1,53 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {
|
4
|
-
CreateSplitterProps,
|
5
|
-
CreateSplitterReturn,
|
6
|
-
} from './create-splitter.svelte.js';
|
7
|
-
|
8
|
-
export interface SplitterProps
|
9
|
-
extends Assign<
|
10
|
-
HtmlIngredientProps<'div', HTMLDivElement, CreateSplitterReturn>,
|
11
|
-
CreateSplitterProps
|
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 {createSplitter} from './create-splitter.svelte.js';
|
20
|
-
import {setSplitterContext} from './splitter-context.svelte.js';
|
21
|
-
|
22
|
-
let {
|
23
|
-
ref = $bindable(null),
|
24
|
-
asChild,
|
25
|
-
children,
|
26
|
-
...props
|
27
|
-
}: SplitterProps = $props();
|
28
|
-
|
29
|
-
let [createSplitterProps, localProps] = $derived(
|
30
|
-
createSplitProps<CreateSplitterProps>([
|
31
|
-
'id',
|
32
|
-
'ids',
|
33
|
-
'size',
|
34
|
-
'orientation',
|
35
|
-
'onSizeChange',
|
36
|
-
'onSizeChangeEnd',
|
37
|
-
])(props),
|
38
|
-
);
|
39
|
-
|
40
|
-
let splitter = createSplitter(reflect(() => createSplitterProps));
|
41
|
-
|
42
|
-
let mergedProps = $derived(mergeProps(splitter.getRootProps(), localProps));
|
43
|
-
|
44
|
-
setSplitterContext(splitter);
|
45
|
-
</script>
|
46
|
-
|
47
|
-
{#if asChild}
|
48
|
-
{@render asChild(mergedProps, splitter)}
|
49
|
-
{:else}
|
50
|
-
<div bind:this={ref} {...mergedProps}>
|
51
|
-
{@render children?.(splitter)}
|
52
|
-
</div>
|
53
|
-
{/if}
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {
|
4
|
+
CreateSplitterProps,
|
5
|
+
CreateSplitterReturn,
|
6
|
+
} from './create-splitter.svelte.js';
|
7
|
+
|
8
|
+
export interface SplitterProps
|
9
|
+
extends Assign<
|
10
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateSplitterReturn>,
|
11
|
+
CreateSplitterProps
|
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 {createSplitter} from './create-splitter.svelte.js';
|
20
|
+
import {setSplitterContext} from './splitter-context.svelte.js';
|
21
|
+
|
22
|
+
let {
|
23
|
+
ref = $bindable(null),
|
24
|
+
asChild,
|
25
|
+
children,
|
26
|
+
...props
|
27
|
+
}: SplitterProps = $props();
|
28
|
+
|
29
|
+
let [createSplitterProps, localProps] = $derived(
|
30
|
+
createSplitProps<CreateSplitterProps>([
|
31
|
+
'id',
|
32
|
+
'ids',
|
33
|
+
'size',
|
34
|
+
'orientation',
|
35
|
+
'onSizeChange',
|
36
|
+
'onSizeChangeEnd',
|
37
|
+
])(props),
|
38
|
+
);
|
39
|
+
|
40
|
+
let splitter = createSplitter(reflect(() => createSplitterProps));
|
41
|
+
|
42
|
+
let mergedProps = $derived(mergeProps(splitter.getRootProps(), localProps));
|
43
|
+
|
44
|
+
setSplitterContext(splitter);
|
45
|
+
</script>
|
46
|
+
|
47
|
+
{#if asChild}
|
48
|
+
{@render asChild(mergedProps, splitter)}
|
49
|
+
{:else}
|
50
|
+
<div bind:this={ref} {...mergedProps}>
|
51
|
+
{@render children?.(splitter)}
|
52
|
+
</div>
|
53
|
+
{/if}
|
@@ -1,37 +1,51 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {HtmlIngredientProps} from '../types.js';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {Action} from 'svelte/action';
|
4
|
+
|
5
|
+
export interface StepsCompletedContentProps
|
6
|
+
extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {}
|
7
|
+
</script>
|
8
|
+
|
9
|
+
<script lang="ts">
|
10
|
+
import {mergeProps} from '../merge-props.js';
|
11
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
12
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
13
|
+
import {reflect} from '@zag-js/svelte';
|
14
|
+
import {getStepsContext} from './steps-context.svelte.js';
|
15
|
+
|
16
|
+
let {
|
17
|
+
ref = $bindable(null),
|
18
|
+
asChild,
|
19
|
+
children,
|
20
|
+
...props
|
21
|
+
}: StepsCompletedContentProps = $props();
|
22
|
+
|
23
|
+
let steps = getStepsContext();
|
24
|
+
let index = $derived(steps.count);
|
25
|
+
|
26
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
27
|
+
let presence = createPresence(
|
28
|
+
reflect(() => ({
|
29
|
+
...presenceStrategyProps,
|
30
|
+
present: steps.value === index,
|
31
|
+
})),
|
32
|
+
);
|
33
|
+
|
34
|
+
let mergedProps = $derived(
|
35
|
+
mergeProps(
|
36
|
+
steps.getContentProps({index}),
|
37
|
+
presence.getPresenceProps(),
|
38
|
+
props,
|
39
|
+
),
|
40
|
+
);
|
41
|
+
</script>
|
42
|
+
|
43
|
+
{#if presence.mounted}
|
44
|
+
{#if asChild}
|
45
|
+
{@render asChild(presence.setReference, mergedProps)}
|
46
|
+
{:else}
|
47
|
+
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
48
|
+
{@render children?.()}
|
49
|
+
</div>
|
50
|
+
{/if}
|
51
|
+
{/if}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { HtmlIngredientProps } from '../types.js';
|
2
|
-
|
2
|
+
import type { Action } from 'svelte/action';
|
3
|
+
export interface StepsCompletedContentProps extends HtmlIngredientProps<'div', HTMLDivElement, never, Action> {
|
3
4
|
}
|
4
5
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
5
6
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
@@ -1,32 +1,55 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
-
import type {ItemProps} from '@zag-js/steps';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
{
|
1
|
+
<script lang="ts" module>
|
2
|
+
import type {Assign, HtmlIngredientProps} from '../types.js';
|
3
|
+
import type {ItemProps} from '@zag-js/steps';
|
4
|
+
import type {Action} from 'svelte/action';
|
5
|
+
|
6
|
+
export interface StepsContentProps
|
7
|
+
extends Assign<
|
8
|
+
HtmlIngredientProps<'div', HTMLDivElement, never, Action>,
|
9
|
+
ItemProps
|
10
|
+
> {}
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<script lang="ts">
|
14
|
+
import {mergeProps} from '../merge-props.js';
|
15
|
+
import {createPresence} from '../presence/create-presence.svelte.js';
|
16
|
+
import {getPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
17
|
+
import {reflect} from '@zag-js/svelte';
|
18
|
+
import {getStepsContext} from './steps-context.svelte.js';
|
19
|
+
|
20
|
+
let {
|
21
|
+
ref = $bindable(null),
|
22
|
+
index,
|
23
|
+
asChild,
|
24
|
+
children,
|
25
|
+
...props
|
26
|
+
}: StepsContentProps = $props();
|
27
|
+
|
28
|
+
let steps = getStepsContext();
|
29
|
+
|
30
|
+
let presenceStrategyProps = getPresenceStrategyPropsContext();
|
31
|
+
let presence = createPresence(
|
32
|
+
reflect(() => ({
|
33
|
+
...presenceStrategyProps,
|
34
|
+
present: steps.value === index,
|
35
|
+
})),
|
36
|
+
);
|
37
|
+
|
38
|
+
let mergedProps = $derived(
|
39
|
+
mergeProps(
|
40
|
+
steps.getContentProps({index}),
|
41
|
+
presence.getPresenceProps(),
|
42
|
+
props,
|
43
|
+
),
|
44
|
+
);
|
45
|
+
</script>
|
46
|
+
|
47
|
+
{#if presence.mounted}
|
48
|
+
{#if asChild}
|
49
|
+
{@render asChild(presence.setReference, mergedProps)}
|
50
|
+
{:else}
|
51
|
+
<div use:presence.setReference bind:this={ref} {...mergedProps}>
|
52
|
+
{@render children?.()}
|
53
|
+
</div>
|
54
|
+
{/if}
|
55
|
+
{/if}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Assign, HtmlIngredientProps } from '../types.js';
|
2
2
|
import type { ItemProps } from '@zag-js/steps';
|
3
|
-
|
3
|
+
import type { Action } from 'svelte/action';
|
4
|
+
export interface StepsContentProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, never, Action>, ItemProps> {
|
4
5
|
}
|
5
6
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
6
7
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
@@ -1,55 +1,65 @@
|
|
1
|
-
<script lang="ts" module>
|
2
|
-
import type {
|
3
|
-
import type {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
import {
|
19
|
-
import {
|
20
|
-
import {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
+
CreateStepsProps,
|
6
|
+
CreateStepsReturn,
|
7
|
+
} from './create-steps.svelte.js';
|
8
|
+
|
9
|
+
export interface StepsProps
|
10
|
+
extends Assign<
|
11
|
+
HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>,
|
12
|
+
CreateStepsProps
|
13
|
+
>,
|
14
|
+
PresenceStrategyProps {}
|
15
|
+
</script>
|
16
|
+
|
17
|
+
<script lang="ts">
|
18
|
+
import {mergeProps} from '../merge-props.js';
|
19
|
+
import {setPresenceStrategyPropsContext} from '../presence/presence-context.svelte.js';
|
20
|
+
import {reflect} from '@zag-js/svelte';
|
21
|
+
import {createSplitProps} from '@zag-js/utils';
|
22
|
+
import {createSteps} from './create-steps.svelte.js';
|
23
|
+
import {setStepsContext} from './steps-context.svelte.js';
|
24
|
+
|
25
|
+
let {
|
26
|
+
ref = $bindable(null),
|
27
|
+
asChild,
|
28
|
+
children,
|
29
|
+
...props
|
30
|
+
}: StepsProps = $props();
|
31
|
+
|
32
|
+
let [presenceStrategyProps, rest] = $derived(
|
33
|
+
createSplitProps<PresenceStrategyProps>(['lazyMount', 'keepMounted'])(
|
34
|
+
props,
|
35
|
+
),
|
36
|
+
);
|
37
|
+
|
38
|
+
let [createStepsProps, localProps] = $derived(
|
39
|
+
createSplitProps<CreateStepsProps>([
|
40
|
+
'id',
|
41
|
+
'ids',
|
42
|
+
'step',
|
43
|
+
'count',
|
44
|
+
'linear',
|
45
|
+
'orientation',
|
46
|
+
'onStepChange',
|
47
|
+
'onStepComplete',
|
48
|
+
])(rest),
|
49
|
+
);
|
50
|
+
|
51
|
+
let steps = createSteps(reflect(() => createStepsProps));
|
52
|
+
|
53
|
+
let mergedProps = $derived(mergeProps(steps.getRootProps(), localProps));
|
54
|
+
|
55
|
+
setStepsContext(steps);
|
56
|
+
setPresenceStrategyPropsContext(() => presenceStrategyProps);
|
57
|
+
</script>
|
58
|
+
|
59
|
+
{#if asChild}
|
60
|
+
{@render asChild(mergedProps, steps)}
|
61
|
+
{:else}
|
62
|
+
<div bind:this={ref} {...mergedProps}>
|
63
|
+
{@render children?.(steps)}
|
64
|
+
</div>
|
65
|
+
{/if}
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import type { PresenceStrategyProps } from '../presence/create-presence.svelte.js';
|
1
2
|
import type { Assign, HtmlIngredientProps } from '../types.js';
|
2
3
|
import type { CreateStepsProps, CreateStepsReturn } from './create-steps.svelte.js';
|
3
|
-
export interface StepsProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>, CreateStepsProps
|
4
|
+
export interface StepsProps extends Assign<HtmlIngredientProps<'div', HTMLDivElement, CreateStepsReturn>, CreateStepsProps>, PresenceStrategyProps {
|
4
5
|
}
|
5
6
|
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
6
7
|
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|