@skeletonlabs/skeleton-svelte 2.0.0-next.3 → 2.0.0-next.5
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/content.svelte +12 -9
- package/dist/components/accordion/anatomy/content.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/content.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/heading.svelte +10 -6
- package/dist/components/accordion/anatomy/heading.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/heading.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/indicator.svelte +10 -11
- package/dist/components/accordion/anatomy/indicator.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/indicator.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/item.svelte +19 -20
- package/dist/components/accordion/anatomy/item.svelte.d.ts +4 -3
- package/dist/components/accordion/anatomy/item.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/root-context.svelte +7 -4
- package/dist/components/accordion/anatomy/root-context.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/root-provider.svelte +33 -0
- package/dist/components/accordion/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/accordion/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/root.svelte +19 -19
- package/dist/components/accordion/anatomy/root.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/accordion/anatomy/trigger.svelte +12 -9
- package/dist/components/accordion/anatomy/trigger.svelte.d.ts +3 -2
- package/dist/components/accordion/anatomy/trigger.svelte.d.ts.map +1 -0
- package/dist/components/accordion/index.d.ts +8 -8
- package/dist/components/accordion/index.d.ts.map +1 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/modules/anatomy.d.ts +2 -1
- package/dist/components/accordion/modules/anatomy.d.ts.map +1 -0
- package/dist/components/accordion/modules/anatomy.js +7 -7
- package/dist/components/accordion/modules/item-context.d.ts +4 -7
- package/dist/components/accordion/modules/item-context.d.ts.map +1 -0
- package/dist/components/accordion/modules/root-context.d.ts +3 -6
- package/dist/components/accordion/modules/root-context.d.ts.map +1 -0
- package/dist/components/accordion/modules/use-accordion.svelte.d.ts +3 -0
- package/dist/components/accordion/modules/use-accordion.svelte.d.ts.map +1 -0
- package/dist/components/accordion/modules/use-accordion.svelte.js +7 -0
- package/dist/components/avatar/anatomy/fallback.svelte +12 -7
- package/dist/components/avatar/anatomy/fallback.svelte.d.ts +3 -2
- package/dist/components/avatar/anatomy/fallback.svelte.d.ts.map +1 -0
- package/dist/components/avatar/anatomy/image.svelte +12 -7
- package/dist/components/avatar/anatomy/image.svelte.d.ts +3 -2
- package/dist/components/avatar/anatomy/image.svelte.d.ts.map +1 -0
- package/dist/components/avatar/anatomy/root-context.svelte +7 -4
- package/dist/components/avatar/anatomy/root-context.svelte.d.ts +3 -2
- package/dist/components/avatar/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/avatar/anatomy/root-provider.svelte +37 -0
- package/dist/components/avatar/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/avatar/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/avatar/anatomy/root.svelte +20 -17
- package/dist/components/avatar/anatomy/root.svelte.d.ts +4 -3
- package/dist/components/avatar/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/avatar/index.d.ts +6 -4
- package/dist/components/avatar/index.d.ts.map +1 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar/modules/anatomy.d.ts +2 -0
- package/dist/components/avatar/modules/anatomy.d.ts.map +1 -0
- package/dist/components/avatar/modules/anatomy.js +5 -3
- package/dist/components/avatar/modules/root-context.d.ts +3 -6
- package/dist/components/avatar/modules/root-context.d.ts.map +1 -0
- package/dist/components/avatar/modules/use-avatar.svelte.d.ts +3 -0
- package/dist/components/avatar/modules/use-avatar.svelte.d.ts.map +1 -0
- package/dist/components/avatar/modules/use-avatar.svelte.js +7 -0
- package/dist/components/progress-linear/anatomy/label.svelte +10 -13
- package/dist/components/progress-linear/anatomy/label.svelte.d.ts +3 -2
- package/dist/components/progress-linear/anatomy/label.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/anatomy/range.svelte +10 -13
- package/dist/components/progress-linear/anatomy/range.svelte.d.ts +3 -2
- package/dist/components/progress-linear/anatomy/range.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/anatomy/root-context.svelte +7 -4
- package/dist/components/progress-linear/anatomy/root-context.svelte.d.ts +3 -2
- package/dist/components/progress-linear/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/anatomy/root-provider.svelte +37 -0
- package/dist/components/progress-linear/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/progress-linear/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/anatomy/root.svelte +17 -26
- package/dist/components/progress-linear/anatomy/root.svelte.d.ts +4 -3
- package/dist/components/progress-linear/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/anatomy/track.svelte +12 -7
- package/dist/components/progress-linear/anatomy/track.svelte.d.ts +3 -2
- package/dist/components/progress-linear/anatomy/track.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/index.d.ts +6 -4
- package/dist/components/progress-linear/index.d.ts.map +1 -0
- package/dist/components/progress-linear/index.js +1 -0
- package/dist/components/progress-linear/modules/anatomy.d.ts +1 -0
- package/dist/components/progress-linear/modules/anatomy.d.ts.map +1 -0
- package/dist/components/progress-linear/modules/anatomy.js +3 -3
- package/dist/components/progress-linear/modules/root-context.d.ts +3 -6
- package/dist/components/progress-linear/modules/root-context.d.ts.map +1 -0
- package/dist/components/progress-linear/modules/use-progress-linear.svelte.d.ts +3 -0
- package/dist/components/progress-linear/modules/use-progress-linear.svelte.d.ts.map +1 -0
- package/dist/components/progress-linear/modules/use-progress-linear.svelte.js +7 -0
- package/dist/components/rating-group/anatomy/control.svelte +15 -8
- package/dist/components/rating-group/anatomy/control.svelte.d.ts +3 -2
- package/dist/components/rating-group/anatomy/control.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/hidden-input.svelte +12 -9
- package/dist/components/rating-group/anatomy/hidden-input.svelte.d.ts +3 -2
- package/dist/components/rating-group/anatomy/hidden-input.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/item.svelte +19 -22
- package/dist/components/rating-group/anatomy/item.svelte.d.ts +4 -3
- package/dist/components/rating-group/anatomy/item.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/label.svelte +15 -8
- package/dist/components/rating-group/anatomy/label.svelte.d.ts +3 -2
- package/dist/components/rating-group/anatomy/label.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/root-context.svelte +7 -4
- package/dist/components/rating-group/anatomy/root-context.svelte.d.ts +3 -2
- package/dist/components/rating-group/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/root-provider.svelte +37 -0
- package/dist/components/rating-group/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/rating-group/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/anatomy/root.svelte +20 -23
- package/dist/components/rating-group/anatomy/root.svelte.d.ts +4 -3
- package/dist/components/rating-group/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/index.d.ts +8 -8
- package/dist/components/rating-group/index.d.ts.map +1 -0
- package/dist/components/rating-group/index.js +1 -0
- package/dist/components/rating-group/modules/anatomy.d.ts +2 -1
- package/dist/components/rating-group/modules/anatomy.d.ts.map +1 -0
- package/dist/components/rating-group/modules/anatomy.js +7 -7
- package/dist/components/rating-group/modules/root-context.d.ts +3 -6
- package/dist/components/rating-group/modules/root-context.d.ts.map +1 -0
- package/dist/components/rating-group/modules/use-rating-group.svelte.d.ts +3 -0
- package/dist/components/rating-group/modules/use-rating-group.svelte.d.ts.map +1 -0
- package/dist/components/rating-group/modules/use-rating-group.svelte.js +7 -0
- package/dist/components/switch/anatomy/control.svelte +33 -0
- package/dist/components/switch/anatomy/control.svelte.d.ts +8 -0
- package/dist/components/switch/anatomy/control.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/hidden-input.svelte +31 -0
- package/dist/components/switch/anatomy/hidden-input.svelte.d.ts +8 -0
- package/dist/components/switch/anatomy/hidden-input.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/label.svelte +33 -0
- package/dist/components/switch/anatomy/label.svelte.d.ts +8 -0
- package/dist/components/switch/anatomy/label.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/root-context.svelte +21 -0
- package/dist/components/switch/anatomy/root-context.svelte.d.ts +9 -0
- package/dist/components/switch/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/root-provider.svelte +37 -0
- package/dist/components/switch/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/switch/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/root.svelte +44 -0
- package/dist/components/switch/anatomy/root.svelte.d.ts +9 -0
- package/dist/components/switch/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/switch/anatomy/thumb.svelte +33 -0
- package/dist/components/switch/anatomy/thumb.svelte.d.ts +8 -0
- package/dist/components/switch/anatomy/thumb.svelte.d.ts.map +1 -0
- package/dist/components/switch/index.d.ts +10 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/switch/modules/anatomy.d.ts +9 -0
- package/dist/components/switch/modules/anatomy.d.ts.map +1 -0
- package/dist/components/switch/modules/anatomy.js +15 -0
- package/dist/components/switch/modules/root-context.d.ts +6 -0
- package/dist/components/switch/modules/root-context.d.ts.map +1 -0
- package/dist/components/{rating-group/modules/item-context.js → switch/modules/root-context.js} +1 -1
- package/dist/components/switch/modules/use-switch.svelte.d.ts +3 -0
- package/dist/components/switch/modules/use-switch.svelte.d.ts.map +1 -0
- package/dist/components/switch/modules/use-switch.svelte.js +7 -0
- package/dist/components/tabs/anatomy/content.svelte +14 -8
- package/dist/components/tabs/anatomy/content.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/content.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/indicator.svelte +13 -8
- package/dist/components/tabs/anatomy/indicator.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/indicator.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/list.svelte +13 -8
- package/dist/components/tabs/anatomy/list.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/list.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/root-context.svelte +7 -4
- package/dist/components/tabs/anatomy/root-context.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/root-provider.svelte +36 -0
- package/dist/components/tabs/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/tabs/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/root.svelte +18 -19
- package/dist/components/tabs/anatomy/root.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/tabs/anatomy/trigger.svelte +14 -8
- package/dist/components/tabs/anatomy/trigger.svelte.d.ts +3 -2
- package/dist/components/tabs/anatomy/trigger.svelte.d.ts.map +1 -0
- package/dist/components/tabs/index.d.ts +10 -1
- package/dist/components/tabs/index.d.ts.map +1 -0
- package/dist/components/tabs/index.js +2 -1
- package/dist/components/tabs/modules/anatomy.d.ts +2 -0
- package/dist/components/tabs/modules/anatomy.d.ts.map +1 -0
- package/dist/components/tabs/modules/anatomy.js +6 -4
- package/dist/components/tabs/modules/root-context.d.ts +3 -6
- package/dist/components/tabs/modules/root-context.d.ts.map +1 -0
- package/dist/components/tabs/modules/use-tabs.svelte.d.ts +3 -0
- package/dist/components/tabs/modules/use-tabs.svelte.d.ts.map +1 -0
- package/dist/components/tabs/modules/use-tabs.svelte.js +7 -0
- package/dist/components/toast/anatomy/action-trigger.svelte +33 -0
- package/dist/components/toast/anatomy/action-trigger.svelte.d.ts +8 -0
- package/dist/components/toast/anatomy/action-trigger.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/close-trigger.svelte +39 -0
- package/dist/components/toast/anatomy/close-trigger.svelte.d.ts +8 -0
- package/dist/components/toast/anatomy/close-trigger.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/description.svelte +33 -0
- package/dist/components/toast/anatomy/description.svelte.d.ts +8 -0
- package/dist/components/toast/anatomy/description.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/group.svelte +49 -0
- package/dist/components/toast/anatomy/group.svelte.d.ts +12 -0
- package/dist/components/toast/anatomy/group.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/message.svelte +29 -0
- package/dist/components/toast/anatomy/message.svelte.d.ts +8 -0
- package/dist/components/toast/anatomy/message.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/root-context.svelte +20 -0
- package/dist/components/toast/anatomy/root-context.svelte.d.ts +9 -0
- package/dist/components/toast/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/root.svelte +76 -0
- package/dist/components/toast/anatomy/root.svelte.d.ts +10 -0
- package/dist/components/toast/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/toast/anatomy/title.svelte +33 -0
- package/dist/components/toast/anatomy/title.svelte.d.ts +8 -0
- package/dist/components/toast/anatomy/title.svelte.d.ts.map +1 -0
- package/dist/components/toast/index.d.ts +10 -0
- package/dist/components/toast/index.d.ts.map +1 -0
- package/dist/components/toast/index.js +2 -0
- package/dist/components/toast/modules/anatomy.d.ts +10 -0
- package/dist/components/toast/modules/anatomy.d.ts.map +1 -0
- package/dist/components/toast/modules/anatomy.js +17 -0
- package/dist/components/toast/modules/group-context.d.ts +7 -0
- package/dist/components/toast/modules/group-context.d.ts.map +1 -0
- package/dist/components/toast/modules/group-context.js +2 -0
- package/dist/components/toast/modules/root-context.d.ts +7 -0
- package/dist/components/toast/modules/root-context.d.ts.map +1 -0
- package/dist/components/toast/modules/root-context.js +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/internal/components/star-empty.svelte.d.ts +1 -0
- package/dist/internal/components/star-empty.svelte.d.ts.map +1 -0
- package/dist/internal/components/star-full.svelte.d.ts +1 -0
- package/dist/internal/components/star-full.svelte.d.ts.map +1 -0
- package/dist/internal/components/star-half.svelte.d.ts +1 -0
- package/dist/internal/components/star-half.svelte.d.ts.map +1 -0
- package/dist/internal/components/x.svelte +14 -0
- package/dist/internal/components/x.svelte.d.ts +27 -0
- package/dist/internal/components/x.svelte.d.ts.map +1 -0
- package/dist/internal/create-context.d.ts +1 -0
- package/dist/internal/create-context.d.ts.map +1 -0
- package/dist/internal/create-context.js +1 -1
- package/dist/internal/html-attributes.d.ts +3 -0
- package/dist/internal/html-attributes.d.ts.map +1 -0
- package/dist/internal/html-attributes.js +1 -0
- package/dist/internal/props-with-children.d.ts +1 -0
- package/dist/internal/props-with-children.d.ts.map +1 -0
- package/dist/internal/props-with-element.d.ts +5 -4
- package/dist/internal/props-with-element.d.ts.map +1 -0
- package/package.json +18 -22
- package/dist/components/accordion/anatomy/item-context.svelte +0 -18
- package/dist/components/accordion/anatomy/item-context.svelte.d.ts +0 -8
- package/dist/components/rating-group/anatomy/item-context.svelte +0 -18
- package/dist/components/rating-group/anatomy/item-context.svelte.d.ts +0 -8
- package/dist/components/rating-group/modules/item-context.d.ts +0 -9
- package/dist/internal/test-utils.d.ts +0 -3
- package/dist/internal/test-utils.js +0 -9
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
export interface AvatarFallbackProps extends PropsWithElement
|
|
5
|
+
export interface AvatarFallbackProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
10
9
|
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
11
12
|
import { AvatarRootContext } from '../modules/root-context';
|
|
12
13
|
|
|
13
14
|
const props: AvatarFallbackProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const avatar = AvatarRootContext.consume();
|
|
16
17
|
|
|
17
|
-
const { element, children, ...
|
|
18
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
19
|
|
|
19
|
-
const attributes = $derived(
|
|
20
|
+
const attributes = $derived(
|
|
21
|
+
mergeProps(avatar().getFallbackProps(), rest, {
|
|
22
|
+
class: classesAvatar.fallback,
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
20
25
|
</script>
|
|
21
26
|
|
|
22
27
|
{#if element}
|
|
23
|
-
{@render element(
|
|
28
|
+
{@render element(attributes)}
|
|
24
29
|
{:else}
|
|
25
30
|
<span {...attributes}>
|
|
26
31
|
{@render children?.()}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
1
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
-
|
|
3
|
-
export interface AvatarFallbackProps extends PropsWithElement, HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
export interface AvatarFallbackProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Fallback: import("svelte").Component<AvatarFallbackProps, {}, "">;
|
|
6
6
|
type Fallback = ReturnType<typeof Fallback>;
|
|
7
7
|
export default Fallback;
|
|
8
|
+
//# sourceMappingURL=fallback.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fallback.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/anatomy/fallback.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;CAAG;AAuCjG,QAAA,MAAM,QAAQ,yDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
import type { HTMLImgAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
export interface AvatarImageProps extends PropsWithElement
|
|
5
|
+
export interface AvatarImageProps extends PropsWithElement<'img'>, HTMLAttributes<'img'> {}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
10
9
|
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
11
12
|
import { AvatarRootContext } from '../modules/root-context';
|
|
12
13
|
|
|
13
14
|
const props: AvatarImageProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const avatar = AvatarRootContext.consume();
|
|
16
17
|
|
|
17
|
-
const { element, ...
|
|
18
|
+
const { element, ...rest } = $derived(props);
|
|
18
19
|
|
|
19
|
-
const attributes = $derived(
|
|
20
|
+
const attributes = $derived(
|
|
21
|
+
mergeProps(avatar().getImageProps(), rest, {
|
|
22
|
+
class: classesAvatar.image,
|
|
23
|
+
}),
|
|
24
|
+
);
|
|
20
25
|
</script>
|
|
21
26
|
|
|
22
27
|
{#if element}
|
|
23
|
-
{@render element(
|
|
28
|
+
{@render element(attributes)}
|
|
24
29
|
{:else}
|
|
25
30
|
<img {...attributes} />
|
|
26
31
|
{/if}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
1
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
-
|
|
3
|
-
export interface AvatarImageProps extends PropsWithElement, HTMLImgAttributes {
|
|
3
|
+
export interface AvatarImageProps extends PropsWithElement<'img'>, HTMLAttributes<'img'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Image: import("svelte").Component<AvatarImageProps, {}, "">;
|
|
6
6
|
type Image = ReturnType<typeof Image>;
|
|
7
7
|
export default Image;
|
|
8
|
+
//# sourceMappingURL=image.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/anatomy/image.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AAqC5F,QAAA,MAAM,KAAK,sDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { useAvatar } from '../modules/use-avatar.svelte';
|
|
4
5
|
|
|
5
6
|
export interface AvatarRootContextProps {
|
|
6
|
-
children: Snippet<[
|
|
7
|
+
children: Snippet<[ReturnType<typeof useAvatar>]>;
|
|
7
8
|
}
|
|
8
9
|
</script>
|
|
9
10
|
|
|
@@ -12,7 +13,9 @@
|
|
|
12
13
|
|
|
13
14
|
const props: AvatarRootContextProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const avatar = AvatarRootContext.consume();
|
|
17
|
+
|
|
18
|
+
const { children } = $derived(props);
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
{@render
|
|
21
|
+
{@render children(avatar)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { useAvatar } from '../modules/use-avatar.svelte';
|
|
3
3
|
export interface AvatarRootContextProps {
|
|
4
|
-
children: Snippet<[
|
|
4
|
+
children: Snippet<[ReturnType<typeof useAvatar>]>;
|
|
5
5
|
}
|
|
6
6
|
declare const RootContext: import("svelte").Component<AvatarRootContextProps, {}, "">;
|
|
7
7
|
type RootContext = ReturnType<typeof RootContext>;
|
|
8
8
|
export default RootContext;
|
|
9
|
+
//# sourceMappingURL=root-context.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/anatomy/root-context.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;CAClD;AAqBF,QAAA,MAAM,WAAW,4DAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
|
|
5
|
+
import type { useAvatar } from '../modules/use-avatar.svelte';
|
|
6
|
+
|
|
7
|
+
export interface AvatarRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
8
|
+
value: ReturnType<typeof useAvatar>;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
import { AvatarRootContext } from '../modules/root-context';
|
|
17
|
+
|
|
18
|
+
const props: AvatarRootProviderProps = $props();
|
|
19
|
+
|
|
20
|
+
const { element, children, value: api, ...rest } = $derived(props);
|
|
21
|
+
|
|
22
|
+
const attributes = $derived(
|
|
23
|
+
mergeProps(api().getRootProps(), rest, {
|
|
24
|
+
class: classesAvatar.root,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
AvatarRootContext.provide(() => api());
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if element}
|
|
32
|
+
{@render element(attributes)}
|
|
33
|
+
{:else}
|
|
34
|
+
<div {...attributes}>
|
|
35
|
+
{@render children?.()}
|
|
36
|
+
</div>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { useAvatar } from '../modules/use-avatar.svelte';
|
|
4
|
+
export interface AvatarRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useAvatar>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<AvatarRootProviderProps, {}, "">;
|
|
8
|
+
type RootProvider = ReturnType<typeof RootProvider>;
|
|
9
|
+
export default RootProvider;
|
|
10
|
+
//# sourceMappingURL=root-provider.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-provider.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/anatomy/root-provider.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;IAC5G,KAAK,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;CACpC;AAuCF,QAAA,MAAM,YAAY,6DAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
2
|
import type { Props } from '@zag-js/avatar';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
5
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
6
|
+
|
|
7
|
+
export interface AvatarRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<script lang="ts">
|
|
10
|
-
import { useMachine, normalizeProps, mergeProps } from '@zag-js/svelte';
|
|
11
11
|
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
12
|
+
import { splitProps } from '@zag-js/avatar';
|
|
13
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
14
|
+
|
|
12
15
|
import { AvatarRootContext } from '../modules/root-context';
|
|
13
|
-
import {
|
|
16
|
+
import { useAvatar } from '../modules/use-avatar.svelte';
|
|
14
17
|
|
|
15
18
|
const props: AvatarRootProps = $props();
|
|
16
|
-
|
|
17
|
-
const
|
|
19
|
+
|
|
20
|
+
const [avatarProps, componentProps] = $derived(splitProps(props));
|
|
21
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
18
22
|
|
|
19
23
|
const id = $props.id();
|
|
20
|
-
const
|
|
24
|
+
const avatar = useAvatar(() => ({
|
|
21
25
|
id: id,
|
|
22
|
-
...
|
|
26
|
+
...avatarProps,
|
|
23
27
|
}));
|
|
24
|
-
const api = $derived(connect(service, normalizeProps));
|
|
25
28
|
|
|
26
|
-
const attributes = $derived(
|
|
29
|
+
const attributes = $derived(
|
|
30
|
+
mergeProps(avatar().getRootProps(), rest, {
|
|
31
|
+
class: classesAvatar.root,
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
27
34
|
|
|
28
|
-
AvatarRootContext.provide(
|
|
29
|
-
get api() {
|
|
30
|
-
return api;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
35
|
+
AvatarRootContext.provide(() => avatar());
|
|
33
36
|
</script>
|
|
34
37
|
|
|
35
38
|
{#if element}
|
|
36
|
-
{@render element(
|
|
39
|
+
{@render element(attributes)}
|
|
37
40
|
{:else}
|
|
38
41
|
<div {...attributes}>
|
|
39
42
|
{@render children?.()}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
1
|
import type { Props } from '@zag-js/avatar';
|
|
4
|
-
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
export interface AvatarRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
5
|
}
|
|
6
6
|
declare const Root: import("svelte").Component<AvatarRootProps, {}, "">;
|
|
7
7
|
type Root = ReturnType<typeof Root>;
|
|
8
8
|
export default Root;
|
|
9
|
+
//# sourceMappingURL=root.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/anatomy/root.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;CAAG;AAkD5H,QAAA,MAAM,IAAI,qDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { AvatarFallbackProps } from './anatomy/fallback.svelte';
|
|
2
|
+
export type { AvatarImageProps } from './anatomy/image.svelte';
|
|
2
3
|
export type { AvatarRootProps } from './anatomy/root.svelte';
|
|
3
4
|
export type { AvatarRootContextProps } from './anatomy/root-context.svelte';
|
|
4
|
-
export type {
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type { AvatarRootProviderProps } from './anatomy/root-provider.svelte';
|
|
6
|
+
export { Avatar } from './modules/anatomy';
|
|
7
|
+
export { useAvatar } from './modules/use-avatar.svelte';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/avatar/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const Avatar: import("svelte").Component<import("../anatomy/root.svelte").AvatarRootProps, {}, ""> & {
|
|
2
|
+
Provider: import("svelte").Component<import("../anatomy/root-provider.svelte").AvatarRootProviderProps, {}, "">;
|
|
2
3
|
Context: import("svelte").Component<import("../anatomy/root-context.svelte").AvatarRootContextProps, {}, "">;
|
|
3
4
|
Image: import("svelte").Component<import("../anatomy/image.svelte").AvatarImageProps, {}, "">;
|
|
4
5
|
Fallback: import("svelte").Component<import("../anatomy/fallback.svelte").AvatarFallbackProps, {}, "">;
|
|
5
6
|
};
|
|
7
|
+
//# sourceMappingURL=anatomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anatomy.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/modules/anatomy.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM;;;;;CAKjB,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import Fallback from '../anatomy/fallback.svelte';
|
|
2
|
+
import Image from '../anatomy/image.svelte';
|
|
1
3
|
import Root from '../anatomy/root.svelte';
|
|
2
4
|
import RootContext from '../anatomy/root-context.svelte';
|
|
3
|
-
import
|
|
4
|
-
import Fallback from '../anatomy/fallback.svelte';
|
|
5
|
+
import RootProvider from '../anatomy/root-provider.svelte';
|
|
5
6
|
export const Avatar = Object.assign(Root, {
|
|
7
|
+
Provider: RootProvider,
|
|
6
8
|
Context: RootContext,
|
|
7
9
|
Image: Image,
|
|
8
|
-
Fallback: Fallback
|
|
10
|
+
Fallback: Fallback,
|
|
9
11
|
});
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { Api } from '@zag-js/avatar';
|
|
2
|
-
export interface AvatarRootContextType {
|
|
3
|
-
api: Api;
|
|
4
|
-
}
|
|
5
1
|
export declare const AvatarRootContext: {
|
|
6
2
|
key: symbol;
|
|
7
|
-
consume():
|
|
8
|
-
provide(value:
|
|
3
|
+
consume(): () => import("@zag-js/avatar").Api;
|
|
4
|
+
provide(value: () => import("@zag-js/avatar").Api): () => import("@zag-js/avatar").Api;
|
|
9
5
|
};
|
|
6
|
+
//# sourceMappingURL=root-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/modules/root-context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB;;;;CAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-avatar.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/avatar/modules/use-avatar.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAoB,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGxE,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,MAAM,GAAG,CAIjE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { connect, machine } from '@zag-js/avatar';
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte';
|
|
3
|
+
export function useAvatar(props) {
|
|
4
|
+
const service = useMachine(machine, props);
|
|
5
|
+
const avatar = $derived(connect(service, normalizeProps));
|
|
6
|
+
return () => avatar;
|
|
7
|
+
}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
export interface ProgressLinearLabelProps extends PropsWithElement
|
|
5
|
+
export interface ProgressLinearLabelProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
10
9
|
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
11
12
|
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
13
|
|
|
13
14
|
const props: ProgressLinearLabelProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const progressLinear = ProgressLinearRootContext.consume();
|
|
16
17
|
|
|
17
|
-
const { element, children, ...
|
|
18
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
19
|
|
|
19
20
|
const attributes = $derived(
|
|
20
|
-
mergeProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class: classesProgressLinear.label
|
|
24
|
-
},
|
|
25
|
-
restAttributes
|
|
26
|
-
)
|
|
21
|
+
mergeProps(progressLinear().getLabelProps(), rest, {
|
|
22
|
+
class: classesProgressLinear.label,
|
|
23
|
+
}),
|
|
27
24
|
);
|
|
28
25
|
</script>
|
|
29
26
|
|
|
30
27
|
{#if element}
|
|
31
|
-
{@render element(
|
|
28
|
+
{@render element(attributes)}
|
|
32
29
|
{:else}
|
|
33
30
|
<div {...attributes}>
|
|
34
31
|
{@render children?.()}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
1
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
-
|
|
3
|
-
export interface ProgressLinearLabelProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface ProgressLinearLabelProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Label: import("svelte").Component<ProgressLinearLabelProps, {}, "">;
|
|
6
6
|
type Label = ReturnType<typeof Label>;
|
|
7
7
|
export default Label;
|
|
8
|
+
//# sourceMappingURL=label.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/progress-linear/anatomy/label.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AAuCpG,QAAA,MAAM,KAAK,8DAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
4
|
|
|
5
|
-
export interface ProgressLinearRangeProps extends PropsWithElement
|
|
5
|
+
export interface ProgressLinearRangeProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
10
9
|
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
11
12
|
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
12
13
|
|
|
13
14
|
const props: ProgressLinearRangeProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const progressLinear = ProgressLinearRootContext.consume();
|
|
16
17
|
|
|
17
|
-
const { element, children, ...
|
|
18
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
19
|
|
|
19
20
|
const attributes = $derived(
|
|
20
|
-
mergeProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class: classesProgressLinear.range
|
|
24
|
-
},
|
|
25
|
-
restAttributes
|
|
26
|
-
)
|
|
21
|
+
mergeProps(progressLinear().getRangeProps(), rest, {
|
|
22
|
+
class: classesProgressLinear.range,
|
|
23
|
+
}),
|
|
27
24
|
);
|
|
28
25
|
</script>
|
|
29
26
|
|
|
30
27
|
{#if element}
|
|
31
|
-
{@render element(
|
|
28
|
+
{@render element(attributes)}
|
|
32
29
|
{:else}
|
|
33
30
|
<div {...attributes}>
|
|
34
31
|
{@render children?.()}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
1
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
2
|
-
|
|
3
|
-
export interface ProgressLinearRangeProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface ProgressLinearRangeProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Range: import("svelte").Component<ProgressLinearRangeProps, {}, "">;
|
|
6
6
|
type Range = ReturnType<typeof Range>;
|
|
7
7
|
export default Range;
|
|
8
|
+
//# sourceMappingURL=range.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/progress-linear/anatomy/range.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AAuCpG,QAAA,MAAM,KAAK,8DAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { useProgressLinear } from '../modules/use-progress-linear.svelte';
|
|
4
5
|
|
|
5
6
|
export interface ProgressLinearRootContextProps {
|
|
6
|
-
children: Snippet<[
|
|
7
|
+
children: Snippet<[ReturnType<typeof useProgressLinear>]>;
|
|
7
8
|
}
|
|
8
9
|
</script>
|
|
9
10
|
|
|
@@ -12,7 +13,9 @@
|
|
|
12
13
|
|
|
13
14
|
const props: ProgressLinearRootContextProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const progressLinear = ProgressLinearRootContext.consume();
|
|
17
|
+
|
|
18
|
+
const { children } = $derived(props);
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
{@render
|
|
21
|
+
{@render children(progressLinear)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { useProgressLinear } from '../modules/use-progress-linear.svelte';
|
|
3
3
|
export interface ProgressLinearRootContextProps {
|
|
4
|
-
children: Snippet<[
|
|
4
|
+
children: Snippet<[ReturnType<typeof useProgressLinear>]>;
|
|
5
5
|
}
|
|
6
6
|
declare const RootContext: import("svelte").Component<ProgressLinearRootContextProps, {}, "">;
|
|
7
7
|
type RootContext = ReturnType<typeof RootContext>;
|
|
8
8
|
export default RootContext;
|
|
9
|
+
//# sourceMappingURL=root-context.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/progress-linear/anatomy/root-context.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,MAAM,WAAW,8BAA8B;IAC9C,QAAQ,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAC1D;AAqBF,QAAA,MAAM,WAAW,oEAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
|
|
5
|
+
import { useProgressLinear } from '../modules/use-progress-linear.svelte';
|
|
6
|
+
|
|
7
|
+
export interface ProgressLinearRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
8
|
+
value: ReturnType<typeof useProgressLinear>;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { classesProgressLinear } from '@skeletonlabs/skeleton-common';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
import { ProgressLinearRootContext } from '../modules/root-context';
|
|
17
|
+
|
|
18
|
+
const props: ProgressLinearRootProviderProps = $props();
|
|
19
|
+
|
|
20
|
+
const { element, children, value: avatar, ...rest } = $derived(props);
|
|
21
|
+
|
|
22
|
+
const attributes = $derived(
|
|
23
|
+
mergeProps(avatar().getRootProps(), rest, {
|
|
24
|
+
class: classesProgressLinear.root,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
ProgressLinearRootContext.provide(() => avatar());
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#if element}
|
|
32
|
+
{@render element(attributes)}
|
|
33
|
+
{:else}
|
|
34
|
+
<div {...attributes}>
|
|
35
|
+
{@render children?.()}
|
|
36
|
+
</div>
|
|
37
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import { useProgressLinear } from '../modules/use-progress-linear.svelte';
|
|
4
|
+
export interface ProgressLinearRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useProgressLinear>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<ProgressLinearRootProviderProps, {}, "">;
|
|
8
|
+
type RootProvider = ReturnType<typeof RootProvider>;
|
|
9
|
+
export default RootProvider;
|
|
10
|
+
//# sourceMappingURL=root-provider.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-provider.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/progress-linear/anatomy/root-provider.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAE1E,MAAM,WAAW,+BAAgC,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;IACpH,KAAK,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;CAC5C;AAuCF,QAAA,MAAM,YAAY,qEAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|