@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.
Files changed (117) hide show
  1. package/dist/components/accordion/anatomy/{accordion-content.svelte → content.svelte} +8 -11
  2. package/dist/components/accordion/anatomy/{accordion-content.svelte.d.ts → content.svelte.d.ts} +4 -4
  3. package/dist/components/accordion/anatomy/{accordion-heading.svelte → heading.svelte} +5 -10
  4. package/dist/components/accordion/anatomy/heading.svelte.d.ts +13 -0
  5. package/dist/components/accordion/anatomy/{accordion-indicator.svelte → indicator.svelte} +8 -11
  6. package/dist/components/accordion/anatomy/{accordion-indicator.svelte.d.ts → indicator.svelte.d.ts} +4 -4
  7. package/dist/components/accordion/anatomy/{accordion-item-context.svelte → item-context.svelte} +3 -2
  8. package/dist/components/accordion/anatomy/item-context.svelte.d.ts +8 -0
  9. package/dist/components/accordion/anatomy/{accordion-item.svelte → item.svelte} +9 -13
  10. package/dist/components/accordion/anatomy/{accordion-item.svelte.d.ts → item.svelte.d.ts} +4 -4
  11. package/dist/components/accordion/anatomy/{accordion-root-context.svelte → root-context.svelte} +3 -2
  12. package/dist/components/accordion/anatomy/root-context.svelte.d.ts +8 -0
  13. package/dist/components/accordion/anatomy/{accordion-root.svelte → root.svelte} +6 -11
  14. package/dist/components/accordion/anatomy/{accordion-root.svelte.d.ts → root.svelte.d.ts} +4 -4
  15. package/dist/components/accordion/anatomy/{accordion-trigger.svelte → trigger.svelte} +8 -11
  16. package/dist/components/accordion/anatomy/{accordion-trigger.svelte.d.ts → trigger.svelte.d.ts} +4 -4
  17. package/dist/components/accordion/index.d.ts +11 -11
  18. package/dist/components/accordion/index.js +1 -1
  19. package/dist/components/accordion/modules/anatomy.d.ts +9 -0
  20. package/dist/components/accordion/modules/anatomy.js +17 -0
  21. package/dist/components/accordion/modules/item-context.js +2 -0
  22. package/dist/components/accordion/modules/root-context.js +2 -0
  23. package/dist/components/avatar/anatomy/{avatar-fallback.svelte → fallback.svelte} +7 -12
  24. package/dist/components/avatar/anatomy/{avatar-fallback.svelte.d.ts → fallback.svelte.d.ts} +4 -4
  25. package/dist/components/avatar/anatomy/{avatar-image.svelte → image.svelte} +7 -12
  26. package/dist/components/avatar/anatomy/{avatar-image.svelte.d.ts → image.svelte.d.ts} +4 -4
  27. package/dist/components/avatar/anatomy/{avatar-root-context.svelte → root-context.svelte} +3 -2
  28. package/dist/components/avatar/anatomy/root-context.svelte.d.ts +8 -0
  29. package/dist/components/avatar/anatomy/{avatar-root.svelte → root.svelte} +6 -11
  30. package/dist/components/avatar/anatomy/{avatar-root.svelte.d.ts → root.svelte.d.ts} +4 -4
  31. package/dist/components/avatar/index.d.ts +6 -6
  32. package/dist/components/avatar/index.js +1 -1
  33. package/dist/components/avatar/modules/anatomy.d.ts +5 -0
  34. package/dist/components/avatar/modules/anatomy.js +9 -0
  35. package/dist/components/avatar/modules/root-context.js +2 -0
  36. package/dist/components/progress-linear/anatomy/label.svelte +36 -0
  37. package/dist/components/progress-linear/anatomy/label.svelte.d.ts +7 -0
  38. package/dist/components/progress-linear/anatomy/range.svelte +36 -0
  39. package/dist/components/progress-linear/anatomy/range.svelte.d.ts +7 -0
  40. package/dist/components/progress-linear/anatomy/root-context.svelte +18 -0
  41. package/dist/components/progress-linear/anatomy/root-context.svelte.d.ts +8 -0
  42. package/dist/components/progress-linear/anatomy/root.svelte +53 -0
  43. package/dist/components/progress-linear/anatomy/root.svelte.d.ts +8 -0
  44. package/dist/components/progress-linear/anatomy/track.svelte +28 -0
  45. package/dist/components/progress-linear/anatomy/track.svelte.d.ts +7 -0
  46. package/dist/components/progress-linear/index.d.ts +7 -0
  47. package/dist/components/progress-linear/index.js +1 -0
  48. package/dist/components/progress-linear/modules/anatomy.d.ts +6 -0
  49. package/dist/components/progress-linear/modules/anatomy.js +11 -0
  50. package/dist/components/progress-linear/modules/root-context.d.ts +9 -0
  51. package/dist/components/{accordion/modules/accordion-item-context.js → progress-linear/modules/root-context.js} +1 -1
  52. package/dist/components/rating-group/anatomy/{rating-group-control.svelte → control.svelte} +7 -12
  53. package/dist/components/rating-group/anatomy/{rating-group-control.svelte.d.ts → control.svelte.d.ts} +4 -4
  54. package/dist/components/rating-group/anatomy/{rating-group-hidden-input.svelte → hidden-input.svelte} +7 -12
  55. package/dist/components/rating-group/anatomy/{rating-group-hidden-input.svelte.d.ts → hidden-input.svelte.d.ts} +4 -4
  56. package/dist/components/rating-group/anatomy/{rating-group-item-context.svelte → item-context.svelte} +3 -2
  57. package/dist/components/rating-group/anatomy/item-context.svelte.d.ts +8 -0
  58. package/dist/components/rating-group/anatomy/{rating-group-item.svelte → item.svelte} +10 -13
  59. package/dist/components/rating-group/anatomy/{rating-group-item.svelte.d.ts → item.svelte.d.ts} +4 -4
  60. package/dist/components/rating-group/anatomy/{rating-group-label.svelte → label.svelte} +7 -12
  61. package/dist/components/rating-group/anatomy/{rating-group-label.svelte.d.ts → label.svelte.d.ts} +4 -4
  62. package/dist/components/rating-group/anatomy/{rating-group-root-context.svelte → root-context.svelte} +3 -2
  63. package/dist/components/rating-group/anatomy/root-context.svelte.d.ts +8 -0
  64. package/dist/components/rating-group/anatomy/{rating-group-root.svelte → root.svelte} +6 -11
  65. package/dist/components/rating-group/anatomy/{rating-group-root.svelte.d.ts → root.svelte.d.ts} +4 -4
  66. package/dist/components/rating-group/index.d.ts +10 -10
  67. package/dist/components/rating-group/index.js +1 -1
  68. package/dist/components/rating-group/modules/anatomy.d.ts +8 -0
  69. package/dist/components/rating-group/modules/anatomy.js +15 -0
  70. package/dist/components/rating-group/modules/item-context.js +2 -0
  71. package/dist/components/rating-group/modules/root-context.js +2 -0
  72. package/dist/components/tabs/anatomy/{tabs-content.svelte → content.svelte} +6 -11
  73. package/dist/components/tabs/anatomy/{tabs-content.svelte.d.ts → content.svelte.d.ts} +4 -4
  74. package/dist/components/tabs/anatomy/{tabs-indicator.svelte → indicator.svelte} +6 -11
  75. package/dist/components/tabs/anatomy/{tabs-indicator.svelte.d.ts → indicator.svelte.d.ts} +4 -4
  76. package/dist/components/tabs/anatomy/{tabs-list.svelte → list.svelte} +6 -11
  77. package/dist/components/tabs/anatomy/{tabs-list.svelte.d.ts → list.svelte.d.ts} +4 -4
  78. package/dist/components/tabs/anatomy/{tabs-root-context.svelte → root-context.svelte} +3 -2
  79. package/dist/components/tabs/anatomy/root-context.svelte.d.ts +8 -0
  80. package/dist/components/tabs/anatomy/{tabs-root.svelte → root.svelte} +6 -11
  81. package/dist/components/tabs/anatomy/{tabs-root.svelte.d.ts → root.svelte.d.ts} +4 -4
  82. package/dist/components/tabs/anatomy/{tabs-trigger.svelte → trigger.svelte} +6 -11
  83. package/dist/components/tabs/anatomy/{tabs-trigger.svelte.d.ts → trigger.svelte.d.ts} +4 -4
  84. package/dist/components/tabs/index.d.ts +1 -1
  85. package/dist/components/tabs/index.js +1 -1
  86. package/dist/components/tabs/modules/anatomy.d.ts +7 -0
  87. package/dist/components/tabs/modules/anatomy.js +13 -0
  88. package/dist/components/tabs/modules/root-context.js +2 -0
  89. package/dist/index.d.ts +5 -4
  90. package/dist/index.js +5 -4
  91. package/package.json +3 -3
  92. package/dist/components/accordion/anatomy/accordion-heading.svelte.d.ts +0 -13
  93. package/dist/components/accordion/anatomy/accordion-item-context.svelte.d.ts +0 -9
  94. package/dist/components/accordion/anatomy/accordion-root-context.svelte.d.ts +0 -9
  95. package/dist/components/accordion/modules/accordion-anatomy.d.ts +0 -9
  96. package/dist/components/accordion/modules/accordion-anatomy.js +0 -17
  97. package/dist/components/accordion/modules/accordion-root-context.js +0 -2
  98. package/dist/components/avatar/anatomy/avatar-root-context.svelte.d.ts +0 -9
  99. package/dist/components/avatar/modules/avatar-anatomy.d.ts +0 -5
  100. package/dist/components/avatar/modules/avatar-anatomy.js +0 -9
  101. package/dist/components/avatar/modules/avatar-root-context.js +0 -2
  102. package/dist/components/rating-group/anatomy/rating-group-item-context.svelte.d.ts +0 -9
  103. package/dist/components/rating-group/anatomy/rating-group-root-context.svelte.d.ts +0 -9
  104. package/dist/components/rating-group/modules/rating-group-anatomy.d.ts +0 -8
  105. package/dist/components/rating-group/modules/rating-group-anatomy.js +0 -15
  106. package/dist/components/rating-group/modules/rating-group-item-context.js +0 -2
  107. package/dist/components/rating-group/modules/rating-group-root-context.js +0 -2
  108. package/dist/components/tabs/anatomy/tabs-root-context.svelte.d.ts +0 -9
  109. package/dist/components/tabs/modules/tabs-anatomy.d.ts +0 -7
  110. package/dist/components/tabs/modules/tabs-anatomy.js +0 -13
  111. package/dist/components/tabs/modules/tabs-root-context.js +0 -2
  112. /package/dist/components/accordion/modules/{accordion-item-context.d.ts → item-context.d.ts} +0 -0
  113. /package/dist/components/accordion/modules/{accordion-root-context.d.ts → root-context.d.ts} +0 -0
  114. /package/dist/components/avatar/modules/{avatar-root-context.d.ts → root-context.d.ts} +0 -0
  115. /package/dist/components/rating-group/modules/{rating-group-item-context.d.ts → item-context.d.ts} +0 -0
  116. /package/dist/components/rating-group/modules/{rating-group-root-context.d.ts → root-context.d.ts} +0 -0
  117. /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,2 @@
1
+ import { createContext } from '../../../internal/create-context';
2
+ export const AvatarRootContext = createContext();
@@ -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 AccordionItemContext = createContext();
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.js';
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/rating-group-root-context.js';
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
- const attributes = $derived(
17
- mergeProps(
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.js';
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 RatingGroupControl: import("svelte").Component<RatingGroupControlProps, {}, "">;
6
- type RatingGroupControl = ReturnType<typeof RatingGroupControl>;
7
- export default RatingGroupControl;
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.js';
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/rating-group-root-context.js';
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
- const attributes = $derived(
19
- mergeProps(
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.js';
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 RatingGroupHiddenInput: import("svelte").Component<RatingGroupHiddenInputProps, {}, "">;
6
- type RatingGroupHiddenInput = ReturnType<typeof RatingGroupHiddenInput>;
7
- export default RatingGroupHiddenInput;
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/rating-group-item-context.js';
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/rating-group-item-context.js';
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.js';
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/rating-group-root-context.js';
36
- import { RatingGroupItemContext } from '../modules/rating-group-item-context.js';
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
- const attributes = $derived(
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;
@@ -1,5 +1,5 @@
1
1
  import type { HTMLAttributes } from 'svelte/elements';
2
- import type { PropsWithElement } from '../../../internal/props-with-element.js';
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 RatingGroupItem: import("svelte").Component<RatingGroupItemProps, {}, "">;
26
- type RatingGroupItem = ReturnType<typeof RatingGroupItem>;
27
- export default RatingGroupItem;
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.js';
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/rating-group-root-context.js';
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
- const attributes = $derived(
17
- mergeProps(
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}
@@ -1,7 +1,7 @@
1
1
  import type { HTMLAttributes } from 'svelte/elements';
2
- import type { PropsWithElement } from '../../../internal/props-with-element.js';
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 RatingGroupLabel: import("svelte").Component<RatingGroupLabelProps, {}, "">;
6
- type RatingGroupLabel = ReturnType<typeof RatingGroupLabel>;
7
- export default RatingGroupLabel;
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/rating-group-root-context.js';
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/rating-group-root-context.js';
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.js';
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/rating-group-root-context.js';
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
- const attributes = $derived(
31
- mergeProps(
32
- api.getRootProps(),
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;
@@ -1,8 +1,8 @@
1
1
  import type { HTMLAttributes } from 'svelte/elements';
2
- import type { PropsWithElement } from '../../../internal/props-with-element.js';
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 RatingGroupRoot: import("svelte").Component<RatingGroupRootProps, {}, "">;
7
- type RatingGroupRoot = ReturnType<typeof RatingGroupRoot>;
8
- export default RatingGroupRoot;
6
+ declare const Root: import("svelte").Component<RatingGroupRootProps, {}, "">;
7
+ type Root = ReturnType<typeof Root>;
8
+ export default Root;