@skeletonlabs/skeleton-svelte 4.6.1 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/steps/anatomy/content.svelte +38 -0
- package/dist/components/steps/anatomy/content.svelte.d.ts +8 -0
- package/dist/components/steps/anatomy/indicator.svelte +38 -0
- package/dist/components/steps/anatomy/indicator.svelte.d.ts +7 -0
- package/dist/components/steps/anatomy/item.svelte +42 -0
- package/dist/components/steps/anatomy/item.svelte.d.ts +8 -0
- package/dist/components/steps/anatomy/list.svelte +36 -0
- package/dist/components/steps/anatomy/list.svelte.d.ts +7 -0
- package/dist/components/steps/anatomy/next-trigger.svelte +36 -0
- package/dist/components/steps/anatomy/next-trigger.svelte.d.ts +7 -0
- package/dist/components/steps/anatomy/prev-trigger.svelte +36 -0
- package/dist/components/steps/anatomy/prev-trigger.svelte.d.ts +7 -0
- package/dist/components/steps/anatomy/root-context.svelte +20 -0
- package/dist/components/steps/anatomy/root-context.svelte.d.ts +9 -0
- package/dist/components/steps/anatomy/root-provider.svelte +39 -0
- package/dist/components/steps/anatomy/root-provider.svelte.d.ts +9 -0
- package/dist/components/steps/anatomy/root.svelte +46 -0
- package/dist/components/steps/anatomy/root.svelte.d.ts +8 -0
- package/dist/components/steps/anatomy/separator.svelte +38 -0
- package/dist/components/steps/anatomy/separator.svelte.d.ts +7 -0
- package/dist/components/steps/anatomy/trigger.svelte +38 -0
- package/dist/components/steps/anatomy/trigger.svelte.d.ts +7 -0
- package/dist/components/steps/index.d.ts +13 -0
- package/dist/components/steps/index.js +2 -0
- package/dist/components/steps/modules/anatomy.d.ts +12 -0
- package/dist/components/steps/modules/anatomy.js +23 -0
- package/dist/components/steps/modules/item-context.d.ts +6 -0
- package/dist/components/steps/modules/item-context.js +2 -0
- package/dist/components/steps/modules/provider.svelte.d.ts +3 -0
- package/dist/components/steps/modules/provider.svelte.js +7 -0
- package/dist/components/steps/modules/root-context.d.ts +5 -0
- package/dist/components/steps/modules/root-context.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +28 -27
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
5
|
+
|
|
6
|
+
export interface StepsContentProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { RootContext } from '../modules/root-context.js';
|
|
11
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
12
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
13
|
+
|
|
14
|
+
const props: StepsContentProps = $props();
|
|
15
|
+
|
|
16
|
+
const steps = RootContext.consume();
|
|
17
|
+
|
|
18
|
+
// @zag-js/steps does not currently provide a splitItemProps function, so manually destructure
|
|
19
|
+
const { element, children, index, ...rest } = $derived(props);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
mergeProps(
|
|
23
|
+
steps().getContentProps({ index }),
|
|
24
|
+
{
|
|
25
|
+
class: classes.steps.content,
|
|
26
|
+
},
|
|
27
|
+
rest,
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if element}
|
|
33
|
+
{@render element(attributes)}
|
|
34
|
+
{:else}
|
|
35
|
+
<div {...attributes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
4
|
+
export interface StepsContentProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Content: import("svelte").Component<StepsContentProps, {}, "">;
|
|
7
|
+
type Content = ReturnType<typeof Content>;
|
|
8
|
+
export default Content;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ItemContext } from '../modules/item-context.js';
|
|
10
|
+
import { RootContext } from '../modules/root-context.js';
|
|
11
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
12
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
13
|
+
|
|
14
|
+
const props: StepsIndicatorProps = $props();
|
|
15
|
+
|
|
16
|
+
const steps = RootContext.consume();
|
|
17
|
+
const itemProps = ItemContext.consume();
|
|
18
|
+
|
|
19
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
mergeProps(
|
|
23
|
+
steps().getIndicatorProps(itemProps()),
|
|
24
|
+
{
|
|
25
|
+
class: classes.steps.indicator,
|
|
26
|
+
},
|
|
27
|
+
rest,
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if element}
|
|
33
|
+
{@render element(attributes)}
|
|
34
|
+
{:else}
|
|
35
|
+
<div {...attributes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Indicator: import("svelte").Component<StepsIndicatorProps, {}, "">;
|
|
6
|
+
type Indicator = ReturnType<typeof Indicator>;
|
|
7
|
+
export default Indicator;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
5
|
+
|
|
6
|
+
export interface StepsItemProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { ItemContext } from '../modules/item-context.js';
|
|
11
|
+
import { RootContext } from '../modules/root-context.js';
|
|
12
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
13
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
14
|
+
|
|
15
|
+
const props: StepsItemProps = $props();
|
|
16
|
+
|
|
17
|
+
const steps = RootContext.consume();
|
|
18
|
+
|
|
19
|
+
// @zag-js/steps does not currently provide a splitItemProps function, so manually destructure
|
|
20
|
+
const { element, children, index, ...rest } = $derived(props);
|
|
21
|
+
const itemProps = $derived({ index });
|
|
22
|
+
|
|
23
|
+
const attributes = $derived(
|
|
24
|
+
mergeProps(
|
|
25
|
+
steps().getItemProps(itemProps),
|
|
26
|
+
{
|
|
27
|
+
class: classes.steps.item,
|
|
28
|
+
},
|
|
29
|
+
rest,
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
ItemContext.provide(() => itemProps);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
{#if element}
|
|
37
|
+
{@render element(attributes)}
|
|
38
|
+
{:else}
|
|
39
|
+
<div {...attributes}>
|
|
40
|
+
{@render children?.()}
|
|
41
|
+
</div>
|
|
42
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
import type { ItemProps } from '@zag-js/steps';
|
|
4
|
+
export interface StepsItemProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Item: import("svelte").Component<StepsItemProps, {}, "">;
|
|
7
|
+
type Item = ReturnType<typeof Item>;
|
|
8
|
+
export default Item;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsListProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context.js';
|
|
10
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: StepsListProps = $props();
|
|
14
|
+
|
|
15
|
+
const steps = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
steps().getListProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classes.steps.list,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<div {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsListProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare const List: import("svelte").Component<StepsListProps, {}, "">;
|
|
6
|
+
type List = ReturnType<typeof List>;
|
|
7
|
+
export default List;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsNextTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context.js';
|
|
10
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: StepsNextTriggerProps = $props();
|
|
14
|
+
|
|
15
|
+
const steps = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
steps().getNextTriggerProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classes.steps.nextTrigger,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<button {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</button>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsNextTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {
|
|
4
|
+
}
|
|
5
|
+
declare const NextTrigger: import("svelte").Component<StepsNextTriggerProps, {}, "">;
|
|
6
|
+
type NextTrigger = ReturnType<typeof NextTrigger>;
|
|
7
|
+
export default NextTrigger;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsPrevTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context.js';
|
|
10
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: StepsPrevTriggerProps = $props();
|
|
14
|
+
|
|
15
|
+
const steps = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
steps().getPrevTriggerProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classes.steps.prevTrigger,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<button {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</button>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsPrevTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {
|
|
4
|
+
}
|
|
5
|
+
declare const PrevTrigger: import("svelte").Component<StepsPrevTriggerProps, {}, "">;
|
|
6
|
+
type PrevTrigger = ReturnType<typeof PrevTrigger>;
|
|
7
|
+
export default PrevTrigger;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { useSteps } from '../modules/provider.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
export interface StepsRootContextProps {
|
|
6
|
+
children: Snippet<[ReturnType<typeof useSteps>]>;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { RootContext } from '../modules/root-context.js';
|
|
12
|
+
|
|
13
|
+
const props: StepsRootContextProps = $props();
|
|
14
|
+
|
|
15
|
+
const steps = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { children } = $derived(props);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
{@render children(steps)}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { useSteps } from '../modules/provider.svelte';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export interface StepsRootContextProps {
|
|
4
|
+
children: Snippet<[ReturnType<typeof useSteps>]>;
|
|
5
|
+
}
|
|
6
|
+
import { RootContext } from '../modules/root-context.js';
|
|
7
|
+
declare const RootContext: import("svelte").Component<StepsRootContextProps, {}, "">;
|
|
8
|
+
type RootContext = ReturnType<typeof RootContext>;
|
|
9
|
+
export default RootContext;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
import type { useSteps } from '../modules/provider.svelte';
|
|
5
|
+
|
|
6
|
+
export interface StepsRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
7
|
+
value: ReturnType<typeof useSteps>;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { RootContext } from '../modules/root-context.js';
|
|
13
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: StepsRootProviderProps = $props();
|
|
17
|
+
|
|
18
|
+
const { element, children, value: steps, ...rest } = $derived(props);
|
|
19
|
+
|
|
20
|
+
const attributes = $derived(
|
|
21
|
+
mergeProps(
|
|
22
|
+
steps().getRootProps(),
|
|
23
|
+
{
|
|
24
|
+
class: classes.steps.root,
|
|
25
|
+
},
|
|
26
|
+
rest,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
RootContext.provide(() => steps());
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if element}
|
|
34
|
+
{@render element(attributes)}
|
|
35
|
+
{:else}
|
|
36
|
+
<div {...attributes}>
|
|
37
|
+
{@render children?.()}
|
|
38
|
+
</div>
|
|
39
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
import type { useSteps } from '../modules/provider.svelte';
|
|
4
|
+
export interface StepsRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useSteps>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<StepsRootProviderProps, {}, "">;
|
|
8
|
+
type RootProvider = ReturnType<typeof RootProvider>;
|
|
9
|
+
export default RootProvider;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
import type { Props } from '@zag-js/steps';
|
|
5
|
+
|
|
6
|
+
export interface StepsRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { useSteps } from '../modules/provider.svelte';
|
|
11
|
+
import { RootContext } from '../modules/root-context.js';
|
|
12
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
13
|
+
import { splitProps } from '@zag-js/steps';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: StepsRootProps = $props();
|
|
17
|
+
|
|
18
|
+
const [stepsProps, componentProps] = $derived(splitProps(props));
|
|
19
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
20
|
+
|
|
21
|
+
const id = $props.id();
|
|
22
|
+
const steps = useSteps(() => ({
|
|
23
|
+
...stepsProps,
|
|
24
|
+
id: id,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const attributes = $derived(
|
|
28
|
+
mergeProps(
|
|
29
|
+
steps().getRootProps(),
|
|
30
|
+
{
|
|
31
|
+
class: classes.steps.root,
|
|
32
|
+
},
|
|
33
|
+
rest,
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
RootContext.provide(() => steps());
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
{#if element}
|
|
41
|
+
{@render element(attributes)}
|
|
42
|
+
{:else}
|
|
43
|
+
<div {...attributes}>
|
|
44
|
+
{@render children?.()}
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
import type { Props } from '@zag-js/steps';
|
|
4
|
+
export interface StepsRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Root: import("svelte").Component<StepsRootProps, {}, "">;
|
|
7
|
+
type Root = ReturnType<typeof Root>;
|
|
8
|
+
export default Root;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsSeparatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ItemContext } from '../modules/item-context.js';
|
|
10
|
+
import { RootContext } from '../modules/root-context.js';
|
|
11
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
12
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
13
|
+
|
|
14
|
+
const props: StepsSeparatorProps = $props();
|
|
15
|
+
|
|
16
|
+
const steps = RootContext.consume();
|
|
17
|
+
const itemProps = ItemContext.consume();
|
|
18
|
+
|
|
19
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
mergeProps(
|
|
23
|
+
steps().getSeparatorProps(itemProps()),
|
|
24
|
+
{
|
|
25
|
+
class: classes.steps.separator,
|
|
26
|
+
},
|
|
27
|
+
rest,
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if element}
|
|
33
|
+
{@render element(attributes)}
|
|
34
|
+
{:else}
|
|
35
|
+
<div {...attributes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</div>
|
|
38
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsSeparatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Separator: import("svelte").Component<StepsSeparatorProps, {}, "">;
|
|
6
|
+
type Separator = ReturnType<typeof Separator>;
|
|
7
|
+
export default Separator;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
4
|
+
|
|
5
|
+
export interface StepsTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ItemContext } from '../modules/item-context.js';
|
|
10
|
+
import { RootContext } from '../modules/root-context.js';
|
|
11
|
+
import * as classes from '@skeletonlabs/skeleton-common/classes';
|
|
12
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
13
|
+
|
|
14
|
+
const props: StepsTriggerProps = $props();
|
|
15
|
+
|
|
16
|
+
const steps = RootContext.consume();
|
|
17
|
+
const itemProps = ItemContext.consume();
|
|
18
|
+
|
|
19
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
mergeProps(
|
|
23
|
+
steps().getTriggerProps(itemProps()),
|
|
24
|
+
{
|
|
25
|
+
class: classes.steps.trigger,
|
|
26
|
+
},
|
|
27
|
+
rest,
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if element}
|
|
33
|
+
{@render element(attributes)}
|
|
34
|
+
{:else}
|
|
35
|
+
<button {...attributes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</button>
|
|
38
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes.js';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element.js';
|
|
3
|
+
export interface StepsTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button', 'value' | 'disabled'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Trigger: import("svelte").Component<StepsTriggerProps, {}, "">;
|
|
6
|
+
type Trigger = ReturnType<typeof Trigger>;
|
|
7
|
+
export default Trigger;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type { StepsContentProps } from './anatomy/content.svelte';
|
|
2
|
+
export type { StepsIndicatorProps } from './anatomy/indicator.svelte';
|
|
3
|
+
export type { StepsItemProps } from './anatomy/item.svelte';
|
|
4
|
+
export type { StepsListProps } from './anatomy/list.svelte';
|
|
5
|
+
export type { StepsNextTriggerProps } from './anatomy/next-trigger.svelte';
|
|
6
|
+
export type { StepsPrevTriggerProps } from './anatomy/prev-trigger.svelte';
|
|
7
|
+
export type { StepsRootProps } from './anatomy/root.svelte';
|
|
8
|
+
export type { StepsRootContextProps } from './anatomy/root-context.svelte';
|
|
9
|
+
export type { StepsRootProviderProps } from './anatomy/root-provider.svelte';
|
|
10
|
+
export type { StepsSeparatorProps } from './anatomy/separator.svelte';
|
|
11
|
+
export type { StepsTriggerProps } from './anatomy/trigger.svelte';
|
|
12
|
+
export { Steps } from './modules/anatomy.js';
|
|
13
|
+
export { useSteps } from './modules/provider.svelte.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const Steps: import("svelte").Component<import("../anatomy/root.svelte").StepsRootProps, {}, ""> & {
|
|
2
|
+
Provider: import("svelte").Component<import("../anatomy/root-provider.svelte").StepsRootProviderProps, {}, "">;
|
|
3
|
+
Context: import("svelte").Component<import("../anatomy/root-context.svelte").StepsRootContextProps, {}, "">;
|
|
4
|
+
List: import("svelte").Component<import("../anatomy/list.svelte").StepsListProps, {}, "">;
|
|
5
|
+
Item: import("svelte").Component<import("../anatomy/item.svelte").StepsItemProps, {}, "">;
|
|
6
|
+
Trigger: import("svelte").Component<import("../anatomy/trigger.svelte").StepsTriggerProps, {}, "">;
|
|
7
|
+
Indicator: import("svelte").Component<import("../anatomy/indicator.svelte").StepsIndicatorProps, {}, "">;
|
|
8
|
+
Separator: import("svelte").Component<import("../anatomy/separator.svelte").StepsSeparatorProps, {}, "">;
|
|
9
|
+
Content: import("svelte").Component<import("../anatomy/content.svelte").StepsContentProps, {}, "">;
|
|
10
|
+
PrevTrigger: import("svelte").Component<import("../anatomy/prev-trigger.svelte").StepsPrevTriggerProps, {}, "">;
|
|
11
|
+
NextTrigger: import("svelte").Component<import("../anatomy/next-trigger.svelte").StepsNextTriggerProps, {}, "">;
|
|
12
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Content from '../anatomy/content.svelte';
|
|
2
|
+
import Indicator from '../anatomy/indicator.svelte';
|
|
3
|
+
import Item from '../anatomy/item.svelte';
|
|
4
|
+
import List from '../anatomy/list.svelte';
|
|
5
|
+
import NextTrigger from '../anatomy/next-trigger.svelte';
|
|
6
|
+
import PrevTrigger from '../anatomy/prev-trigger.svelte';
|
|
7
|
+
import RootContext from '../anatomy/root-context.svelte';
|
|
8
|
+
import RootProvider from '../anatomy/root-provider.svelte';
|
|
9
|
+
import Root from '../anatomy/root.svelte';
|
|
10
|
+
import Separator from '../anatomy/separator.svelte';
|
|
11
|
+
import Trigger from '../anatomy/trigger.svelte';
|
|
12
|
+
export const Steps = Object.assign(Root, {
|
|
13
|
+
Provider: RootProvider,
|
|
14
|
+
Context: RootContext,
|
|
15
|
+
List: List,
|
|
16
|
+
Item: Item,
|
|
17
|
+
Trigger: Trigger,
|
|
18
|
+
Indicator: Indicator,
|
|
19
|
+
Separator: Separator,
|
|
20
|
+
Content: Content,
|
|
21
|
+
PrevTrigger: PrevTrigger,
|
|
22
|
+
NextTrigger: NextTrigger,
|
|
23
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { connect, machine } from '@zag-js/steps';
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte';
|
|
3
|
+
export function useSteps(props) {
|
|
4
|
+
const service = useMachine(machine, props);
|
|
5
|
+
const steps = $derived(connect(service, normalizeProps));
|
|
6
|
+
return () => steps;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const RootContext: {
|
|
2
|
+
key: symbol;
|
|
3
|
+
consume(): () => import("@zag-js/steps", { with: { "resolution-mode": "require" } }).Api<import("@zag-js/svelte").PropTypes>;
|
|
4
|
+
provide(value: () => import("@zag-js/steps", { with: { "resolution-mode": "require" } }).Api<import("@zag-js/svelte").PropTypes>): () => import("@zag-js/steps", { with: { "resolution-mode": "require" } }).Api<import("@zag-js/svelte").PropTypes>;
|
|
5
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './components/progress/index.js';
|
|
|
17
17
|
export * from './components/rating-group/index.js';
|
|
18
18
|
export * from './components/segmented-control/index.js';
|
|
19
19
|
export * from './components/slider/index.js';
|
|
20
|
+
export * from './components/steps/index.js';
|
|
20
21
|
export * from './components/switch/index.js';
|
|
21
22
|
export * from './components/tabs/index.js';
|
|
22
23
|
export * from './components/tags-input/index.js';
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from './components/progress/index.js';
|
|
|
17
17
|
export * from './components/rating-group/index.js';
|
|
18
18
|
export * from './components/segmented-control/index.js';
|
|
19
19
|
export * from './components/slider/index.js';
|
|
20
|
+
export * from './components/steps/index.js';
|
|
20
21
|
export * from './components/switch/index.js';
|
|
21
22
|
export * from './components/tabs/index.js';
|
|
22
23
|
export * from './components/tags-input/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"repository": {
|
|
@@ -22,32 +22,33 @@
|
|
|
22
22
|
"sideEffects": false,
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@internationalized/date": "3.10.0",
|
|
25
|
-
"@zag-js/accordion": "1.
|
|
26
|
-
"@zag-js/avatar": "1.
|
|
27
|
-
"@zag-js/collapsible": "1.
|
|
28
|
-
"@zag-js/collection": "1.
|
|
29
|
-
"@zag-js/combobox": "1.
|
|
30
|
-
"@zag-js/date-picker": "1.
|
|
31
|
-
"@zag-js/dialog": "1.
|
|
32
|
-
"@zag-js/file-upload": "1.
|
|
33
|
-
"@zag-js/floating-panel": "1.
|
|
34
|
-
"@zag-js/listbox": "1.
|
|
35
|
-
"@zag-js/menu": "1.
|
|
36
|
-
"@zag-js/pagination": "1.
|
|
37
|
-
"@zag-js/popover": "1.
|
|
38
|
-
"@zag-js/progress": "1.
|
|
39
|
-
"@zag-js/radio-group": "1.
|
|
40
|
-
"@zag-js/rating-group": "1.
|
|
41
|
-
"@zag-js/slider": "1.
|
|
42
|
-
"@zag-js/
|
|
43
|
-
"@zag-js/
|
|
44
|
-
"@zag-js/
|
|
45
|
-
"@zag-js/
|
|
46
|
-
"@zag-js/
|
|
47
|
-
"@zag-js/
|
|
48
|
-
"@zag-js/
|
|
49
|
-
"@zag-js/
|
|
50
|
-
"@
|
|
25
|
+
"@zag-js/accordion": "1.30.0",
|
|
26
|
+
"@zag-js/avatar": "1.30.0",
|
|
27
|
+
"@zag-js/collapsible": "1.30.0",
|
|
28
|
+
"@zag-js/collection": "1.30.0",
|
|
29
|
+
"@zag-js/combobox": "1.30.0",
|
|
30
|
+
"@zag-js/date-picker": "1.30.0",
|
|
31
|
+
"@zag-js/dialog": "1.30.0",
|
|
32
|
+
"@zag-js/file-upload": "1.30.0",
|
|
33
|
+
"@zag-js/floating-panel": "1.30.0",
|
|
34
|
+
"@zag-js/listbox": "1.30.0",
|
|
35
|
+
"@zag-js/menu": "1.30.0",
|
|
36
|
+
"@zag-js/pagination": "1.30.0",
|
|
37
|
+
"@zag-js/popover": "1.30.0",
|
|
38
|
+
"@zag-js/progress": "1.30.0",
|
|
39
|
+
"@zag-js/radio-group": "1.30.0",
|
|
40
|
+
"@zag-js/rating-group": "1.30.0",
|
|
41
|
+
"@zag-js/slider": "1.30.0",
|
|
42
|
+
"@zag-js/steps": "1.30.0",
|
|
43
|
+
"@zag-js/svelte": "1.30.0",
|
|
44
|
+
"@zag-js/switch": "1.30.0",
|
|
45
|
+
"@zag-js/tabs": "1.30.0",
|
|
46
|
+
"@zag-js/tags-input": "1.30.0",
|
|
47
|
+
"@zag-js/toast": "1.30.0",
|
|
48
|
+
"@zag-js/toggle-group": "1.30.0",
|
|
49
|
+
"@zag-js/tooltip": "1.30.0",
|
|
50
|
+
"@zag-js/tree-view": "1.30.0",
|
|
51
|
+
"@skeletonlabs/skeleton-common": "4.7.1"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"svelte": "^5.29.0"
|