@skeletonlabs/skeleton-svelte 2.0.0-next.2 → 2.0.0-next.3
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/accordion/anatomy/{accordion-content.svelte → content.svelte} +8 -11
- package/dist/components/accordion/anatomy/{accordion-content.svelte.d.ts → content.svelte.d.ts} +4 -4
- package/dist/components/accordion/anatomy/{accordion-heading.svelte → heading.svelte} +5 -10
- package/dist/components/accordion/anatomy/heading.svelte.d.ts +13 -0
- package/dist/components/accordion/anatomy/{accordion-indicator.svelte → indicator.svelte} +8 -11
- package/dist/components/accordion/anatomy/{accordion-indicator.svelte.d.ts → indicator.svelte.d.ts} +4 -4
- package/dist/components/accordion/anatomy/{accordion-item-context.svelte → item-context.svelte} +3 -2
- package/dist/components/accordion/anatomy/item-context.svelte.d.ts +8 -0
- package/dist/components/accordion/anatomy/{accordion-item.svelte → item.svelte} +9 -13
- package/dist/components/accordion/anatomy/{accordion-item.svelte.d.ts → item.svelte.d.ts} +4 -4
- package/dist/components/accordion/anatomy/{accordion-root-context.svelte → root-context.svelte} +3 -2
- package/dist/components/accordion/anatomy/root-context.svelte.d.ts +8 -0
- package/dist/components/accordion/anatomy/{accordion-root.svelte → root.svelte} +6 -11
- package/dist/components/accordion/anatomy/{accordion-root.svelte.d.ts → root.svelte.d.ts} +4 -4
- package/dist/components/accordion/anatomy/{accordion-trigger.svelte → trigger.svelte} +8 -11
- package/dist/components/accordion/anatomy/{accordion-trigger.svelte.d.ts → trigger.svelte.d.ts} +4 -4
- package/dist/components/accordion/index.d.ts +11 -11
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/modules/anatomy.d.ts +9 -0
- package/dist/components/accordion/modules/anatomy.js +17 -0
- package/dist/components/accordion/modules/item-context.js +2 -0
- package/dist/components/accordion/modules/root-context.js +2 -0
- package/dist/components/avatar/anatomy/{avatar-fallback.svelte → fallback.svelte} +7 -12
- package/dist/components/avatar/anatomy/{avatar-fallback.svelte.d.ts → fallback.svelte.d.ts} +4 -4
- package/dist/components/avatar/anatomy/{avatar-image.svelte → image.svelte} +7 -12
- package/dist/components/avatar/anatomy/{avatar-image.svelte.d.ts → image.svelte.d.ts} +4 -4
- package/dist/components/avatar/anatomy/{avatar-root-context.svelte → root-context.svelte} +3 -2
- package/dist/components/avatar/anatomy/root-context.svelte.d.ts +8 -0
- package/dist/components/avatar/anatomy/{avatar-root.svelte → root.svelte} +6 -11
- package/dist/components/avatar/anatomy/{avatar-root.svelte.d.ts → root.svelte.d.ts} +4 -4
- package/dist/components/avatar/index.d.ts +6 -6
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/modules/anatomy.d.ts +5 -0
- package/dist/components/avatar/modules/anatomy.js +9 -0
- package/dist/components/avatar/modules/root-context.js +2 -0
- package/dist/components/progress-linear/anatomy/label.svelte +36 -0
- package/dist/components/progress-linear/anatomy/label.svelte.d.ts +7 -0
- package/dist/components/progress-linear/anatomy/range.svelte +36 -0
- package/dist/components/progress-linear/anatomy/range.svelte.d.ts +7 -0
- package/dist/components/progress-linear/anatomy/root-context.svelte +18 -0
- package/dist/components/progress-linear/anatomy/root-context.svelte.d.ts +8 -0
- package/dist/components/progress-linear/anatomy/root.svelte +53 -0
- package/dist/components/progress-linear/anatomy/root.svelte.d.ts +8 -0
- package/dist/components/progress-linear/anatomy/track.svelte +28 -0
- package/dist/components/progress-linear/anatomy/track.svelte.d.ts +7 -0
- package/dist/components/progress-linear/index.d.ts +7 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/progress-linear/modules/anatomy.d.ts +6 -0
- package/dist/components/progress-linear/modules/anatomy.js +11 -0
- package/dist/components/progress-linear/modules/root-context.d.ts +9 -0
- package/dist/components/{accordion/modules/accordion-item-context.js → progress-linear/modules/root-context.js} +1 -1
- package/dist/components/rating-group/anatomy/{rating-group-control.svelte → control.svelte} +7 -12
- package/dist/components/rating-group/anatomy/{rating-group-control.svelte.d.ts → control.svelte.d.ts} +4 -4
- package/dist/components/rating-group/anatomy/{rating-group-hidden-input.svelte → hidden-input.svelte} +7 -12
- package/dist/components/rating-group/anatomy/{rating-group-hidden-input.svelte.d.ts → hidden-input.svelte.d.ts} +4 -4
- package/dist/components/rating-group/anatomy/{rating-group-item-context.svelte → item-context.svelte} +3 -2
- package/dist/components/rating-group/anatomy/item-context.svelte.d.ts +8 -0
- package/dist/components/rating-group/anatomy/{rating-group-item.svelte → item.svelte} +10 -13
- package/dist/components/rating-group/anatomy/{rating-group-item.svelte.d.ts → item.svelte.d.ts} +4 -4
- package/dist/components/rating-group/anatomy/{rating-group-label.svelte → label.svelte} +7 -12
- package/dist/components/rating-group/anatomy/{rating-group-label.svelte.d.ts → label.svelte.d.ts} +4 -4
- package/dist/components/rating-group/anatomy/{rating-group-root-context.svelte → root-context.svelte} +3 -2
- package/dist/components/rating-group/anatomy/root-context.svelte.d.ts +8 -0
- package/dist/components/rating-group/anatomy/{rating-group-root.svelte → root.svelte} +6 -11
- package/dist/components/rating-group/anatomy/{rating-group-root.svelte.d.ts → root.svelte.d.ts} +4 -4
- package/dist/components/rating-group/index.d.ts +10 -10
- package/dist/components/rating-group/index.js +1 -1
- package/dist/components/rating-group/modules/anatomy.d.ts +8 -0
- package/dist/components/rating-group/modules/anatomy.js +15 -0
- package/dist/components/rating-group/modules/item-context.js +2 -0
- package/dist/components/rating-group/modules/root-context.js +2 -0
- package/dist/components/tabs/anatomy/{tabs-content.svelte → content.svelte} +6 -11
- package/dist/components/tabs/anatomy/{tabs-content.svelte.d.ts → content.svelte.d.ts} +4 -4
- package/dist/components/tabs/anatomy/{tabs-indicator.svelte → indicator.svelte} +6 -11
- package/dist/components/tabs/anatomy/{tabs-indicator.svelte.d.ts → indicator.svelte.d.ts} +4 -4
- package/dist/components/tabs/anatomy/{tabs-list.svelte → list.svelte} +6 -11
- package/dist/components/tabs/anatomy/{tabs-list.svelte.d.ts → list.svelte.d.ts} +4 -4
- package/dist/components/tabs/anatomy/{tabs-root-context.svelte → root-context.svelte} +3 -2
- package/dist/components/tabs/anatomy/root-context.svelte.d.ts +8 -0
- package/dist/components/tabs/anatomy/{tabs-root.svelte → root.svelte} +6 -11
- package/dist/components/tabs/anatomy/{tabs-root.svelte.d.ts → root.svelte.d.ts} +4 -4
- package/dist/components/tabs/anatomy/{tabs-trigger.svelte → trigger.svelte} +6 -11
- package/dist/components/tabs/anatomy/{tabs-trigger.svelte.d.ts → trigger.svelte.d.ts} +4 -4
- package/dist/components/tabs/index.d.ts +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/modules/anatomy.d.ts +7 -0
- package/dist/components/tabs/modules/anatomy.js +13 -0
- package/dist/components/tabs/modules/root-context.js +2 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/package.json +3 -3
- package/dist/components/accordion/anatomy/accordion-heading.svelte.d.ts +0 -13
- package/dist/components/accordion/anatomy/accordion-item-context.svelte.d.ts +0 -9
- package/dist/components/accordion/anatomy/accordion-root-context.svelte.d.ts +0 -9
- package/dist/components/accordion/modules/accordion-anatomy.d.ts +0 -9
- package/dist/components/accordion/modules/accordion-anatomy.js +0 -17
- package/dist/components/accordion/modules/accordion-root-context.js +0 -2
- package/dist/components/avatar/anatomy/avatar-root-context.svelte.d.ts +0 -9
- package/dist/components/avatar/modules/avatar-anatomy.d.ts +0 -5
- package/dist/components/avatar/modules/avatar-anatomy.js +0 -9
- package/dist/components/avatar/modules/avatar-root-context.js +0 -2
- package/dist/components/rating-group/anatomy/rating-group-item-context.svelte.d.ts +0 -9
- package/dist/components/rating-group/anatomy/rating-group-root-context.svelte.d.ts +0 -9
- package/dist/components/rating-group/modules/rating-group-anatomy.d.ts +0 -8
- package/dist/components/rating-group/modules/rating-group-anatomy.js +0 -15
- package/dist/components/rating-group/modules/rating-group-item-context.js +0 -2
- package/dist/components/rating-group/modules/rating-group-root-context.js +0 -2
- package/dist/components/tabs/anatomy/tabs-root-context.svelte.d.ts +0 -9
- package/dist/components/tabs/modules/tabs-anatomy.d.ts +0 -7
- package/dist/components/tabs/modules/tabs-anatomy.js +0 -13
- package/dist/components/tabs/modules/tabs-root-context.js +0 -2
- /package/dist/components/accordion/modules/{accordion-item-context.d.ts → item-context.d.ts} +0 -0
- /package/dist/components/accordion/modules/{accordion-root-context.d.ts → root-context.d.ts} +0 -0
- /package/dist/components/avatar/modules/{avatar-root-context.d.ts → root-context.d.ts} +0 -0
- /package/dist/components/rating-group/modules/{rating-group-item-context.d.ts → item-context.d.ts} +0 -0
- /package/dist/components/rating-group/modules/{rating-group-root-context.d.ts → root-context.d.ts} +0 -0
- /package/dist/components/tabs/modules/{tabs-root-context.d.ts → root-context.d.ts} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Avatar: import("svelte").Component<import("../anatomy/root.svelte").AvatarRootProps, {}, ""> & {
|
|
2
|
+
Context: import("svelte").Component<import("../anatomy/root-context.svelte").AvatarRootContextProps, {}, "">;
|
|
3
|
+
Image: import("svelte").Component<import("../anatomy/image.svelte").AvatarImageProps, {}, "">;
|
|
4
|
+
Fallback: import("svelte").Component<import("../anatomy/fallback.svelte").AvatarFallbackProps, {}, "">;
|
|
5
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Root from '../anatomy/root.svelte';
|
|
2
|
+
import RootContext from '../anatomy/root-context.svelte';
|
|
3
|
+
import Image from '../anatomy/image.svelte';
|
|
4
|
+
import Fallback from '../anatomy/fallback.svelte';
|
|
5
|
+
export const Avatar = Object.assign(Root, {
|
|
6
|
+
Context: RootContext,
|
|
7
|
+
Image: Image,
|
|
8
|
+
Fallback: Fallback
|
|
9
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
export interface ProgressLinearLabelProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
10
|
+
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: ProgressLinearLabelProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = ProgressLinearRootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...restAttributes } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
rootContext.api.getLabelProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesProgressLinear.label
|
|
24
|
+
},
|
|
25
|
+
restAttributes
|
|
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 { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
export interface ProgressLinearLabelProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
declare const Label: import("svelte").Component<ProgressLinearLabelProps, {}, "">;
|
|
6
|
+
type Label = ReturnType<typeof Label>;
|
|
7
|
+
export default Label;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
export interface ProgressLinearRangeProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
10
|
+
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: ProgressLinearRangeProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = ProgressLinearRootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...restAttributes } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
rootContext.api.getRangeProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesProgressLinear.range
|
|
24
|
+
},
|
|
25
|
+
restAttributes
|
|
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 { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
export interface ProgressLinearRangeProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
declare const Range: import("svelte").Component<ProgressLinearRangeProps, {}, "">;
|
|
6
|
+
type Range = ReturnType<typeof Range>;
|
|
7
|
+
export default Range;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { ProgressLinearRootContextType } from '../modules/root-context';
|
|
4
|
+
|
|
5
|
+
export interface ProgressLinearRootContextProps {
|
|
6
|
+
children: Snippet<[ProgressLinearRootContextType]>;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: ProgressLinearRootContextProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = ProgressLinearRootContext.consume();
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
{@render props.children(rootContext)}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { ProgressLinearRootContextType } from '../modules/root-context';
|
|
3
|
+
export interface ProgressLinearRootContextProps {
|
|
4
|
+
children: Snippet<[ProgressLinearRootContextType]>;
|
|
5
|
+
}
|
|
6
|
+
declare const RootContext: import("svelte").Component<ProgressLinearRootContextProps, {}, "">;
|
|
7
|
+
type RootContext = ReturnType<typeof RootContext>;
|
|
8
|
+
export default RootContext;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
import type { Props } from '@zag-js/progress';
|
|
5
|
+
|
|
6
|
+
export interface ProgressLinearRootProps
|
|
7
|
+
extends PropsWithElement,
|
|
8
|
+
Omit<Props, 'id'>,
|
|
9
|
+
Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'dir'> {}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { splitProps, machine, connect } from '@zag-js/progress';
|
|
14
|
+
import { mergeProps, normalizeProps, useMachine } from '@zag-js/svelte';
|
|
15
|
+
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
16
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
17
|
+
|
|
18
|
+
const props: ProgressLinearRootProps = $props();
|
|
19
|
+
|
|
20
|
+
const [machineProps, componentProps] = $derived(splitProps(props));
|
|
21
|
+
const { element, children, ...restAttributes } = $derived(componentProps);
|
|
22
|
+
|
|
23
|
+
const id = $props.id();
|
|
24
|
+
const service = useMachine(machine, () => ({
|
|
25
|
+
id,
|
|
26
|
+
...machineProps
|
|
27
|
+
}));
|
|
28
|
+
const api = $derived(connect(service, normalizeProps));
|
|
29
|
+
|
|
30
|
+
const attributes = $derived(
|
|
31
|
+
mergeProps(
|
|
32
|
+
api.getRootProps(),
|
|
33
|
+
{
|
|
34
|
+
class: classesProgressLinear.root
|
|
35
|
+
},
|
|
36
|
+
restAttributes
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
ProgressLinearRootContext.provide({
|
|
41
|
+
get api() {
|
|
42
|
+
return api;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
{#if element}
|
|
48
|
+
{@render element({ attributes })}
|
|
49
|
+
{:else}
|
|
50
|
+
<div {...attributes}>
|
|
51
|
+
{@render children?.()}
|
|
52
|
+
</div>
|
|
53
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { Props } from '@zag-js/progress';
|
|
4
|
+
export interface ProgressLinearRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'dir'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Root: import("svelte").Component<ProgressLinearRootProps, {}, "">;
|
|
7
|
+
type Root = ReturnType<typeof Root>;
|
|
8
|
+
export default Root;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
|
|
5
|
+
export interface ProgressLinearTrackProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
10
|
+
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: ProgressLinearTrackProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = ProgressLinearRootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...restAttributes } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(mergeProps(rootContext.api.getTrackProps(), { class: classesProgressLinear.track }, restAttributes));
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
{#if element}
|
|
23
|
+
{@render element({ attributes })}
|
|
24
|
+
{:else}
|
|
25
|
+
<div {...attributes}>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
</div>
|
|
28
|
+
{/if}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
export interface ProgressLinearTrackProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
declare const Track: import("svelte").Component<ProgressLinearTrackProps, {}, "">;
|
|
6
|
+
type Track = ReturnType<typeof Track>;
|
|
7
|
+
export default Track;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ProgressLinear } from './modules/anatomy';
|
|
2
|
+
export type { ProgressLinearRootProps } from './anatomy/root.svelte';
|
|
3
|
+
export type { ProgressLinearRootContextProps } from './anatomy/root-context.svelte';
|
|
4
|
+
export type { ProgressLinearLabelProps } from './anatomy/label.svelte';
|
|
5
|
+
export type { ProgressLinearTrackProps } from './anatomy/track.svelte';
|
|
6
|
+
export type { ProgressLinearRangeProps } from './anatomy/range.svelte';
|
|
7
|
+
export type { ProgressLinearRootContextType as ProgressLinearRootContext } from './modules/root-context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProgressLinear } from './modules/anatomy';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ProgressLinear: import("svelte").Component<import("../anatomy/root.svelte").ProgressLinearRootProps, {}, ""> & {
|
|
2
|
+
Context: import("svelte").Component<import("../anatomy/root-context.svelte").ProgressLinearRootContextProps, {}, "">;
|
|
3
|
+
Label: import("svelte").Component<import("../anatomy/label.svelte").ProgressLinearLabelProps, {}, "">;
|
|
4
|
+
Track: import("svelte").Component<import("../anatomy/track.svelte").ProgressLinearTrackProps, {}, "">;
|
|
5
|
+
Range: import("svelte").Component<import("../anatomy/range.svelte").ProgressLinearRangeProps, {}, "">;
|
|
6
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Root from '../anatomy/root.svelte';
|
|
2
|
+
import RootContext from '../anatomy/root-context.svelte';
|
|
3
|
+
import Label from '../anatomy/label.svelte';
|
|
4
|
+
import Track from '../anatomy/track.svelte';
|
|
5
|
+
import Range from '../anatomy/range.svelte';
|
|
6
|
+
export const ProgressLinear = Object.assign(Root, {
|
|
7
|
+
Context: RootContext,
|
|
8
|
+
Label: Label,
|
|
9
|
+
Track: Track,
|
|
10
|
+
Range: Range
|
|
11
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Api } from '@zag-js/progress';
|
|
2
|
+
export interface ProgressLinearRootContextType {
|
|
3
|
+
api: Api;
|
|
4
|
+
}
|
|
5
|
+
export declare const ProgressLinearRootContext: {
|
|
6
|
+
key: symbol;
|
|
7
|
+
consume(): ProgressLinearRootContextType;
|
|
8
|
+
provide(value: ProgressLinearRootContextType): ProgressLinearRootContextType;
|
|
9
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createContext } from '../../../internal/create-context.js';
|
|
2
|
-
export const
|
|
2
|
+
export const ProgressLinearRootContext = createContext();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
5
|
export interface RatingGroupControlProps extends PropsWithElement, Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'defaultValue' | 'dir'> {}
|
|
6
6
|
</script>
|
|
@@ -8,20 +8,15 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import { mergeProps } from '@zag-js/svelte';
|
|
10
10
|
import { classesRatingGroup } from '@skeletonlabs/skeleton-common';
|
|
11
|
-
import { RatingGroupRootContext } from '../modules/
|
|
11
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
12
12
|
|
|
13
|
-
const rootContext = RatingGroupRootContext.consume();
|
|
14
13
|
const props: RatingGroupControlProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = RatingGroupRootContext.consume();
|
|
16
|
+
|
|
15
17
|
const { element, children, ...restAttributes } = $derived(props);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rootContext.api.getControlProps(),
|
|
19
|
-
{
|
|
20
|
-
class: classesRatingGroup.control
|
|
21
|
-
},
|
|
22
|
-
restAttributes
|
|
23
|
-
)
|
|
24
|
-
);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(mergeProps(rootContext.api.getControlProps(), { class: classesRatingGroup.control }, restAttributes));
|
|
25
20
|
</script>
|
|
26
21
|
|
|
27
22
|
{#if element}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
3
|
export interface RatingGroupControlProps extends PropsWithElement, Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'defaultValue' | 'dir'> {
|
|
4
4
|
}
|
|
5
|
-
declare const
|
|
6
|
-
type
|
|
7
|
-
export default
|
|
5
|
+
declare const Control: import("svelte").Component<RatingGroupControlProps, {}, "">;
|
|
6
|
+
type Control = ReturnType<typeof Control>;
|
|
7
|
+
export default Control;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
5
|
export interface RatingGroupHiddenInputProps
|
|
6
6
|
extends PropsWithElement,
|
|
@@ -10,20 +10,15 @@
|
|
|
10
10
|
<script lang="ts">
|
|
11
11
|
import { mergeProps } from '@zag-js/svelte';
|
|
12
12
|
import { classesRatingGroup } from '@skeletonlabs/skeleton-common';
|
|
13
|
-
import { RatingGroupRootContext } from '../modules/
|
|
13
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
14
14
|
|
|
15
|
-
const rootContext = RatingGroupRootContext.consume();
|
|
16
15
|
const props: RatingGroupHiddenInputProps = $props();
|
|
16
|
+
|
|
17
|
+
const rootContext = RatingGroupRootContext.consume();
|
|
18
|
+
|
|
17
19
|
const { element, ...restAttributes } = $derived(props);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rootContext.api.getHiddenInputProps(),
|
|
21
|
-
{
|
|
22
|
-
class: classesRatingGroup.hiddenInput
|
|
23
|
-
},
|
|
24
|
-
restAttributes
|
|
25
|
-
)
|
|
26
|
-
);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(mergeProps(rootContext.api.getHiddenInputProps(), { class: classesRatingGroup.hiddenInput }, restAttributes));
|
|
27
22
|
</script>
|
|
28
23
|
|
|
29
24
|
{#if element}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
3
|
export interface RatingGroupHiddenInputProps extends PropsWithElement, Omit<HTMLInputAttributes, 'id' | 'defaultValue' | 'dir' | 'children'> {
|
|
4
4
|
}
|
|
5
|
-
declare const
|
|
6
|
-
type
|
|
7
|
-
export default
|
|
5
|
+
declare const HiddenInput: import("svelte").Component<RatingGroupHiddenInputProps, {}, "">;
|
|
6
|
+
type HiddenInput = ReturnType<typeof HiddenInput>;
|
|
7
|
+
export default HiddenInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { RatingGroupItemContextType } from '../modules/
|
|
3
|
+
import type { RatingGroupItemContextType } from '../modules/item-context';
|
|
4
4
|
|
|
5
5
|
export interface RatingGroupItemContextProps {
|
|
6
6
|
children: Snippet<[RatingGroupItemContextType]>;
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { RatingGroupItemContext } from '../modules/
|
|
11
|
+
import { RatingGroupItemContext } from '../modules/item-context';
|
|
12
12
|
|
|
13
13
|
const props: RatingGroupItemContextProps = $props();
|
|
14
|
+
|
|
14
15
|
const itemContext = RatingGroupItemContext.consume();
|
|
15
16
|
</script>
|
|
16
17
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { RatingGroupItemContextType } from '../modules/item-context';
|
|
3
|
+
export interface RatingGroupItemContextProps {
|
|
4
|
+
children: Snippet<[RatingGroupItemContextType]>;
|
|
5
|
+
}
|
|
6
|
+
declare const ItemContext: import("svelte").Component<RatingGroupItemContextProps, {}, "">;
|
|
7
|
+
type ItemContext = ReturnType<typeof ItemContext>;
|
|
8
|
+
export default ItemContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
import type { ItemProps } from '@zag-js/rating-group';
|
|
5
5
|
|
|
6
6
|
export interface RatingGroupItemProps
|
|
@@ -32,27 +32,24 @@
|
|
|
32
32
|
import { mergeProps } from '@zag-js/svelte';
|
|
33
33
|
import { classesRatingGroup } from '@skeletonlabs/skeleton-common';
|
|
34
34
|
import { splitItemProps } from '@zag-js/rating-group';
|
|
35
|
-
import { RatingGroupRootContext } from '../modules/
|
|
36
|
-
import { RatingGroupItemContext } from '../modules/
|
|
35
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
36
|
+
import { RatingGroupItemContext } from '../modules/item-context';
|
|
37
37
|
import StarFull from '../../../internal/components/star-full.svelte';
|
|
38
38
|
import StarEmpty from '../../../internal/components/star-empty.svelte';
|
|
39
39
|
import StarHalf from '../../../internal/components/star-half.svelte';
|
|
40
40
|
import type { Snippet } from 'svelte';
|
|
41
41
|
|
|
42
|
-
const rootContext = RatingGroupRootContext.consume();
|
|
43
42
|
const props: RatingGroupItemProps = $props();
|
|
43
|
+
|
|
44
|
+
const rootContext = RatingGroupRootContext.consume();
|
|
45
|
+
|
|
44
46
|
const [itemProps, componentProps] = $derived(splitItemProps(props));
|
|
45
47
|
const { element, children, empty = starEmpty, half = starHalf, full = starFull, ...restAttributes } = $derived(componentProps);
|
|
46
|
-
|
|
47
|
-
mergeProps(
|
|
48
|
-
rootContext.api.getItemProps(itemProps),
|
|
49
|
-
{
|
|
50
|
-
class: classesRatingGroup.item
|
|
51
|
-
},
|
|
52
|
-
restAttributes
|
|
53
|
-
)
|
|
54
|
-
);
|
|
48
|
+
|
|
55
49
|
const itemState = $derived(rootContext.api.getItemState(itemProps));
|
|
50
|
+
|
|
51
|
+
const attributes = $derived(mergeProps(rootContext.api.getItemProps(itemProps), { class: classesRatingGroup.item }, restAttributes));
|
|
52
|
+
|
|
56
53
|
RatingGroupItemContext.provide({
|
|
57
54
|
get itemState() {
|
|
58
55
|
return itemState;
|
package/dist/components/rating-group/anatomy/{rating-group-item.svelte.d.ts → item.svelte.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
3
|
import type { ItemProps } from '@zag-js/rating-group';
|
|
4
4
|
export interface RatingGroupItemProps extends PropsWithElement, ItemProps, Omit<HTMLAttributes<HTMLSpanElement>, 'id' | 'defaultValue' | 'dir'> {
|
|
5
5
|
/**
|
|
@@ -22,6 +22,6 @@ export interface RatingGroupItemProps extends PropsWithElement, ItemProps, Omit<
|
|
|
22
22
|
full?: Snippet;
|
|
23
23
|
}
|
|
24
24
|
import type { Snippet } from 'svelte';
|
|
25
|
-
declare const
|
|
26
|
-
type
|
|
27
|
-
export default
|
|
25
|
+
declare const Item: import("svelte").Component<RatingGroupItemProps, {}, "">;
|
|
26
|
+
type Item = ReturnType<typeof Item>;
|
|
27
|
+
export default Item;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
5
|
export interface RatingGroupLabelProps extends PropsWithElement, Omit<HTMLAttributes<HTMLLabelElement>, 'id' | 'defaultValue' | 'dir'> {}
|
|
6
6
|
</script>
|
|
@@ -8,20 +8,15 @@
|
|
|
8
8
|
<script lang="ts">
|
|
9
9
|
import { mergeProps } from '@zag-js/svelte';
|
|
10
10
|
import { classesRatingGroup } from '@skeletonlabs/skeleton-common';
|
|
11
|
-
import { RatingGroupRootContext } from '../modules/
|
|
11
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
12
12
|
|
|
13
|
-
const rootContext = RatingGroupRootContext.consume();
|
|
14
13
|
const props: RatingGroupLabelProps = $props();
|
|
14
|
+
|
|
15
|
+
const rootContext = RatingGroupRootContext.consume();
|
|
16
|
+
|
|
15
17
|
const { element, children, ...restAttributes } = $derived(props);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
rootContext.api.getControlProps(),
|
|
19
|
-
{
|
|
20
|
-
class: classesRatingGroup.label
|
|
21
|
-
},
|
|
22
|
-
restAttributes
|
|
23
|
-
)
|
|
24
|
-
);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(mergeProps(rootContext.api.getControlProps(), { class: classesRatingGroup.label }, restAttributes));
|
|
25
20
|
</script>
|
|
26
21
|
|
|
27
22
|
{#if element}
|
package/dist/components/rating-group/anatomy/{rating-group-label.svelte.d.ts → label.svelte.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
3
|
export interface RatingGroupLabelProps extends PropsWithElement, Omit<HTMLAttributes<HTMLLabelElement>, 'id' | 'defaultValue' | 'dir'> {
|
|
4
4
|
}
|
|
5
|
-
declare const
|
|
6
|
-
type
|
|
7
|
-
export default
|
|
5
|
+
declare const Label: import("svelte").Component<RatingGroupLabelProps, {}, "">;
|
|
6
|
+
type Label = ReturnType<typeof Label>;
|
|
7
|
+
export default Label;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
import type { RatingGroupRootContextType } from '../modules/
|
|
3
|
+
import type { RatingGroupRootContextType } from '../modules/root-context';
|
|
4
4
|
|
|
5
5
|
export interface RatingGroupRootContextProps {
|
|
6
6
|
children: Snippet<[RatingGroupRootContextType]>;
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
import { RatingGroupRootContext } from '../modules/
|
|
11
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
12
12
|
|
|
13
13
|
const props: RatingGroupRootContextProps = $props();
|
|
14
|
+
|
|
14
15
|
const rootContext = RatingGroupRootContext.consume();
|
|
15
16
|
</script>
|
|
16
17
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { RatingGroupRootContextType } from '../modules/root-context';
|
|
3
|
+
export interface RatingGroupRootContextProps {
|
|
4
|
+
children: Snippet<[RatingGroupRootContextType]>;
|
|
5
|
+
}
|
|
6
|
+
declare const RootContext: import("svelte").Component<RatingGroupRootContextProps, {}, "">;
|
|
7
|
+
type RootContext = ReturnType<typeof RootContext>;
|
|
8
|
+
export default RootContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
import type { Props } from '@zag-js/rating-group';
|
|
5
5
|
|
|
6
6
|
export interface RatingGroupRootProps
|
|
@@ -13,13 +13,14 @@
|
|
|
13
13
|
import { mergeProps, normalizeProps, useMachine } from '@zag-js/svelte';
|
|
14
14
|
import { splitProps, machine, connect } from '@zag-js/rating-group';
|
|
15
15
|
import { classesRatingGroup } from '@skeletonlabs/skeleton-common';
|
|
16
|
-
import { RatingGroupRootContext } from '../modules/
|
|
16
|
+
import { RatingGroupRootContext } from '../modules/root-context';
|
|
17
17
|
|
|
18
18
|
const props: RatingGroupRootProps = $props();
|
|
19
19
|
// @ts-expect-error - https://github.com/chakra-ui/zag/issues/2672
|
|
20
20
|
const [machineProps, componentProps] = $derived(splitProps(props));
|
|
21
21
|
// @ts-expect-error - https://github.com/chakra-ui/zag/issues/2672
|
|
22
22
|
const { element, children, ...restAttributes } = $derived(componentProps);
|
|
23
|
+
|
|
23
24
|
const id = $props.id();
|
|
24
25
|
const service = useMachine(machine, () => ({
|
|
25
26
|
// @ts-expect-error - https://github.com/chakra-ui/zag/issues/2672
|
|
@@ -27,15 +28,9 @@
|
|
|
27
28
|
...machineProps
|
|
28
29
|
}));
|
|
29
30
|
const api = $derived(connect(service, normalizeProps));
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
class: classesRatingGroup.root
|
|
35
|
-
},
|
|
36
|
-
restAttributes
|
|
37
|
-
)
|
|
38
|
-
);
|
|
31
|
+
|
|
32
|
+
const attributes = $derived(mergeProps(api.getRootProps(), { class: classesRatingGroup.root }, restAttributes));
|
|
33
|
+
|
|
39
34
|
RatingGroupRootContext.provide({
|
|
40
35
|
get api() {
|
|
41
36
|
return api;
|
package/dist/components/rating-group/anatomy/{rating-group-root.svelte.d.ts → root.svelte.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
3
|
import type { Props } from '@zag-js/rating-group';
|
|
4
4
|
export interface RatingGroupRootProps extends PropsWithElement, Omit<Props, 'id'>, Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'defaultValue' | 'dir'> {
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
7
|
-
type
|
|
8
|
-
export default
|
|
6
|
+
declare const Root: import("svelte").Component<RatingGroupRootProps, {}, "">;
|
|
7
|
+
type Root = ReturnType<typeof Root>;
|
|
8
|
+
export default Root;
|