@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,30 +1,33 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type { HTMLAttributes } from '
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
|
-
export interface AccordionContentProps extends PropsWithElement
|
|
5
|
+
export interface AccordionContentProps 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 { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
11
|
-
import {
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
12
12
|
import { AccordionItemContext } from '../modules/item-context';
|
|
13
|
+
import { AccordionRootContext } from '../modules/root-context';
|
|
13
14
|
|
|
14
15
|
const props: AccordionContentProps = $props();
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
17
|
+
const accordion = AccordionRootContext.consume();
|
|
18
|
+
const itemProps = AccordionItemContext.consume();
|
|
18
19
|
|
|
19
|
-
const { element, children, ...
|
|
20
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
21
|
|
|
21
22
|
const attributes = $derived(
|
|
22
|
-
mergeProps(
|
|
23
|
+
mergeProps(accordion().getItemContentProps(itemProps()), rest, {
|
|
24
|
+
class: classesAccordion.content,
|
|
25
|
+
}),
|
|
23
26
|
);
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
{#if element}
|
|
27
|
-
{@render element(
|
|
30
|
+
{@render element(attributes)}
|
|
28
31
|
{:else}
|
|
29
32
|
<div {...attributes}>
|
|
30
33
|
{@render children?.()}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { HTMLAttributes } from '
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
export interface AccordionContentProps extends PropsWithElement
|
|
3
|
+
export interface AccordionContentProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Content: import("svelte").Component<AccordionContentProps, {}, "">;
|
|
6
6
|
type Content = ReturnType<typeof Content>;
|
|
7
7
|
export default Content;
|
|
8
|
+
//# sourceMappingURL=content.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/anatomy/content.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,qBAAsB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AA0CjG,QAAA,MAAM,OAAO,2DAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type { HTMLAttributes } from '
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
|
-
export interface AccordionHeadingProps extends PropsWithElement
|
|
5
|
+
export interface AccordionHeadingProps extends PropsWithElement<'h3'>, HTMLAttributes<'h3'> {
|
|
6
6
|
/**
|
|
7
7
|
* The level of the heading.
|
|
8
8
|
*
|
|
@@ -13,19 +13,23 @@
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<script lang="ts">
|
|
16
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
17
16
|
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
17
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
18
18
|
|
|
19
19
|
const props: AccordionHeadingProps = $props();
|
|
20
|
-
const { level = 3, element, children, ...
|
|
20
|
+
const { level = 3, element, children, ...rest } = $derived(props);
|
|
21
21
|
|
|
22
22
|
const tag = $derived(`h${level}`);
|
|
23
23
|
|
|
24
|
-
const attributes = $derived(
|
|
24
|
+
const attributes = $derived(
|
|
25
|
+
mergeProps(rest, {
|
|
26
|
+
class: classesAccordion.heading,
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
25
29
|
</script>
|
|
26
30
|
|
|
27
31
|
{#if element}
|
|
28
|
-
{@render element(
|
|
32
|
+
{@render element(attributes)}
|
|
29
33
|
{:else}
|
|
30
34
|
<svelte:element this={tag} {...attributes}>
|
|
31
35
|
{@render children?.()}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { HTMLAttributes } from '
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
export interface AccordionHeadingProps extends PropsWithElement
|
|
3
|
+
export interface AccordionHeadingProps extends PropsWithElement<'h3'>, HTMLAttributes<'h3'> {
|
|
4
4
|
/**
|
|
5
5
|
* The level of the heading.
|
|
6
6
|
*
|
|
@@ -11,3 +11,4 @@ export interface AccordionHeadingProps extends PropsWithElement, HTMLAttributes<
|
|
|
11
11
|
declare const Heading: import("svelte").Component<AccordionHeadingProps, {}, "">;
|
|
12
12
|
type Heading = ReturnType<typeof Heading>;
|
|
13
13
|
export default Heading;
|
|
14
|
+
//# sourceMappingURL=heading.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/anatomy/heading.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,qBAAsB,SAAQ,gBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;IAC1F;;;;OAIG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC9B;AAkCF,QAAA,MAAM,OAAO,2DAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -1,30 +1,29 @@
|
|
|
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 AccordionIndicatorProps extends PropsWithElement
|
|
5
|
+
export interface AccordionIndicatorProps 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 { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
11
|
-
import {
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
12
12
|
import { AccordionItemContext } from '../modules/item-context';
|
|
13
|
+
import { AccordionRootContext } from '../modules/root-context';
|
|
13
14
|
|
|
14
15
|
const props: AccordionIndicatorProps = $props();
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
17
|
+
const accordion = AccordionRootContext.consume();
|
|
18
|
+
const itemProps = AccordionItemContext.consume();
|
|
18
19
|
|
|
19
|
-
const { element, children, ...
|
|
20
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
21
|
|
|
21
|
-
const attributes = $derived(
|
|
22
|
-
mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), { class: classesAccordion.indicator }, restAttributes)
|
|
23
|
-
);
|
|
22
|
+
const attributes = $derived(mergeProps(accordion().getItemIndicatorProps(itemProps()), rest, { class: classesAccordion.indicator }));
|
|
24
23
|
</script>
|
|
25
24
|
|
|
26
25
|
{#if element}
|
|
27
|
-
{@render element(
|
|
26
|
+
{@render element(attributes)}
|
|
28
27
|
{:else}
|
|
29
28
|
<div {...attributes}>
|
|
30
29
|
{@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 AccordionIndicatorProps extends PropsWithElement, HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
export interface AccordionIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Indicator: import("svelte").Component<AccordionIndicatorProps, {}, "">;
|
|
6
6
|
type Indicator = ReturnType<typeof Indicator>;
|
|
7
7
|
export default Indicator;
|
|
8
|
+
//# sourceMappingURL=indicator.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indicator.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/anatomy/indicator.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,uBAAwB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AAsCnG,QAAA,MAAM,SAAS,6DAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -1,39 +1,38 @@
|
|
|
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 { ItemProps } from '@zag-js/accordion';
|
|
5
3
|
|
|
6
|
-
|
|
4
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
5
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
6
|
+
|
|
7
|
+
export interface AccordionItemProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<script lang="ts">
|
|
10
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
-
import { splitItemProps } from '@zag-js/accordion';
|
|
12
11
|
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
13
|
-
import {
|
|
12
|
+
import { splitItemProps } from '@zag-js/accordion';
|
|
13
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
14
|
+
|
|
14
15
|
import { AccordionItemContext } from '../modules/item-context';
|
|
16
|
+
import { AccordionRootContext } from '../modules/root-context';
|
|
15
17
|
|
|
16
18
|
const props: AccordionItemProps = $props();
|
|
17
19
|
|
|
18
|
-
const
|
|
20
|
+
const accordion = AccordionRootContext.consume();
|
|
19
21
|
|
|
20
22
|
const [itemProps, componentProps] = $derived(splitItemProps(props));
|
|
21
|
-
const { element, children, ...
|
|
22
|
-
|
|
23
|
-
const attributes = $derived(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return rootContext.api.getItemState(itemProps);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
23
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
24
|
+
|
|
25
|
+
const attributes = $derived(
|
|
26
|
+
mergeProps(accordion().getItemProps(itemProps), rest, {
|
|
27
|
+
class: classesAccordion.item,
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
AccordionItemContext.provide(() => itemProps);
|
|
33
32
|
</script>
|
|
34
33
|
|
|
35
34
|
{#if element}
|
|
36
|
-
{@render element(
|
|
35
|
+
{@render element(attributes)}
|
|
37
36
|
{:else}
|
|
38
37
|
<div {...attributes}>
|
|
39
38
|
{@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 { ItemProps } from '@zag-js/accordion';
|
|
4
|
-
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
export interface AccordionItemProps extends ItemProps, PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
5
5
|
}
|
|
6
6
|
declare const Item: import("svelte").Component<AccordionItemProps, {}, "">;
|
|
7
7
|
type Item = ReturnType<typeof Item>;
|
|
8
8
|
export default Item;
|
|
9
|
+
//# sourceMappingURL=item.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/anatomy/item.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,kBAAmB,SAAQ,SAAS,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;CAAG;AA8CzG,QAAA,MAAM,IAAI,wDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { useAccordion } from '../modules/use-accordion.svelte';
|
|
4
5
|
|
|
5
6
|
export interface AccordionRootContextProps {
|
|
6
|
-
children: Snippet<[
|
|
7
|
+
children: Snippet<[ReturnType<typeof useAccordion>]>;
|
|
7
8
|
}
|
|
8
9
|
</script>
|
|
9
10
|
|
|
@@ -12,7 +13,9 @@
|
|
|
12
13
|
|
|
13
14
|
const props: AccordionRootContextProps = $props();
|
|
14
15
|
|
|
15
|
-
const
|
|
16
|
+
const accordion = AccordionRootContext.consume();
|
|
17
|
+
|
|
18
|
+
const { children } = $derived(props);
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
{@render
|
|
21
|
+
{@render children(accordion)}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { useAccordion } from '../modules/use-accordion.svelte';
|
|
3
3
|
export interface AccordionRootContextProps {
|
|
4
|
-
children: Snippet<[
|
|
4
|
+
children: Snippet<[ReturnType<typeof useAccordion>]>;
|
|
5
5
|
}
|
|
6
6
|
declare const RootContext: import("svelte").Component<AccordionRootContextProps, {}, "">;
|
|
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/accordion/anatomy/root-context.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,WAAW,yBAAyB;IACzC,QAAQ,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;CACrD;AAqBF,QAAA,MAAM,WAAW,+DAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { useAccordion } from '../modules/use-accordion.svelte';
|
|
6
|
+
|
|
7
|
+
export interface AccordionRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
8
|
+
value: ReturnType<typeof useAccordion>;
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script lang="ts">
|
|
13
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
import { AccordionRootContext } from '../modules/root-context';
|
|
17
|
+
|
|
18
|
+
const props: AccordionRootProviderProps = $props();
|
|
19
|
+
|
|
20
|
+
const { element, children, value: accordion, ...rest } = $derived(props);
|
|
21
|
+
|
|
22
|
+
const attributes = $derived(mergeProps(accordion().getRootProps(), { class: classesAccordion.root }, rest));
|
|
23
|
+
|
|
24
|
+
AccordionRootContext.provide(() => accordion());
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
{#if element}
|
|
28
|
+
{@render element(attributes)}
|
|
29
|
+
{:else}
|
|
30
|
+
<div {...attributes}>
|
|
31
|
+
{@render children?.()}
|
|
32
|
+
</div>
|
|
33
|
+
{/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 { useAccordion } from '../modules/use-accordion.svelte';
|
|
4
|
+
export interface AccordionRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useAccordion>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<AccordionRootProviderProps, {}, "">;
|
|
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/accordion/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,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEpE,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;IAC/G,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;CACvC;AAmCF,QAAA,MAAM,YAAY,gEAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { Props } from '@zag-js/accordion';
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
4
5
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
5
6
|
|
|
6
|
-
export interface AccordionRootProps
|
|
7
|
-
extends PropsWithElement,
|
|
8
|
-
Omit<Props, 'id'>,
|
|
9
|
-
Omit<HTMLAttributes<HTMLDivElement>, 'id' | 'defaultValue' | 'dir'> {}
|
|
7
|
+
export interface AccordionRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
10
8
|
</script>
|
|
11
9
|
|
|
12
10
|
<script lang="ts">
|
|
13
|
-
import { mergeProps, normalizeProps, useMachine } from '@zag-js/svelte';
|
|
14
|
-
import { machine, connect, splitProps } from '@zag-js/accordion';
|
|
15
11
|
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
12
|
+
import { splitProps } from '@zag-js/accordion';
|
|
13
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
14
|
+
|
|
16
15
|
import { AccordionRootContext } from '../modules/root-context';
|
|
16
|
+
import { useAccordion } from '../modules/use-accordion.svelte';
|
|
17
17
|
|
|
18
18
|
const props: AccordionRootProps = $props();
|
|
19
|
-
|
|
20
|
-
const
|
|
19
|
+
|
|
20
|
+
const [accordionProps, componentProps] = $derived(splitProps(props));
|
|
21
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
21
22
|
|
|
22
23
|
const id = $props.id();
|
|
23
|
-
const
|
|
24
|
+
const accordion = useAccordion(() => ({
|
|
24
25
|
id: id,
|
|
25
|
-
...
|
|
26
|
+
...accordionProps,
|
|
26
27
|
}));
|
|
27
|
-
const api = $derived(connect(service, normalizeProps));
|
|
28
28
|
|
|
29
|
-
const attributes = $derived(
|
|
29
|
+
const attributes = $derived(
|
|
30
|
+
mergeProps(accordion().getRootProps(), rest, {
|
|
31
|
+
class: classesAccordion.root,
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
30
34
|
|
|
31
|
-
AccordionRootContext.provide(
|
|
32
|
-
get api() {
|
|
33
|
-
return api;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
35
|
+
AccordionRootContext.provide(() => accordion());
|
|
36
36
|
</script>
|
|
37
37
|
|
|
38
38
|
{#if element}
|
|
39
|
-
{@render element(
|
|
39
|
+
{@render element(attributes)}
|
|
40
40
|
{:else}
|
|
41
41
|
<div {...attributes}>
|
|
42
42
|
{@render children?.()}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Props } from '@zag-js/accordion';
|
|
2
|
-
import type { HTMLAttributes } from '
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
-
export interface AccordionRootProps extends
|
|
4
|
+
export interface AccordionRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
5
|
}
|
|
6
6
|
declare const Root: import("svelte").Component<AccordionRootProps, {}, "">;
|
|
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/accordion/anatomy/root.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;CAAG;AAkD/H,QAAA,MAAM,IAAI,wDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
3
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
4
|
|
|
5
|
-
export interface AccordionTriggerProps extends PropsWithElement
|
|
5
|
+
export interface AccordionTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {}
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { mergeProps } from '@zag-js/svelte';
|
|
10
9
|
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
11
|
-
import {
|
|
10
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
11
|
+
|
|
12
12
|
import { AccordionItemContext } from '../modules/item-context';
|
|
13
|
+
import { AccordionRootContext } from '../modules/root-context';
|
|
13
14
|
|
|
14
15
|
const props: AccordionTriggerProps = $props();
|
|
15
16
|
|
|
16
|
-
const
|
|
17
|
-
const
|
|
17
|
+
const accordion = AccordionRootContext.consume();
|
|
18
|
+
const itemProps = AccordionItemContext.consume();
|
|
18
19
|
|
|
19
|
-
const { element, children, ...
|
|
20
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
21
|
|
|
21
22
|
const attributes = $derived(
|
|
22
|
-
mergeProps(
|
|
23
|
+
mergeProps(accordion().getItemTriggerProps(itemProps()), rest, {
|
|
24
|
+
class: classesAccordion.trigger,
|
|
25
|
+
}),
|
|
23
26
|
);
|
|
24
27
|
</script>
|
|
25
28
|
|
|
26
29
|
{#if element}
|
|
27
|
-
{@render element(
|
|
30
|
+
{@render element(attributes)}
|
|
28
31
|
{:else}
|
|
29
32
|
<button {...attributes}>
|
|
30
33
|
{@render children?.()}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
2
|
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
-
export interface AccordionTriggerProps extends PropsWithElement
|
|
3
|
+
export interface AccordionTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {
|
|
4
4
|
}
|
|
5
5
|
declare const Trigger: import("svelte").Component<AccordionTriggerProps, {}, "">;
|
|
6
6
|
type Trigger = ReturnType<typeof Trigger>;
|
|
7
7
|
export default Trigger;
|
|
8
|
+
//# sourceMappingURL=trigger.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/anatomy/trigger.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,qBAAsB,SAAQ,gBAAgB,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC;CAAG;AA0CvG,QAAA,MAAM,OAAO,2DAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { AccordionContentProps } from './anatomy/content.svelte';
|
|
2
|
+
export type { AccordionHeadingProps } from './anatomy/heading.svelte';
|
|
3
|
+
export type { AccordionIndicatorProps } from './anatomy/indicator.svelte';
|
|
4
|
+
export type { AccordionItemProps } from './anatomy/item.svelte';
|
|
2
5
|
export type { AccordionRootProps } from './anatomy/root.svelte';
|
|
3
6
|
export type { AccordionRootContextProps } from './anatomy/root-context.svelte';
|
|
4
|
-
export type {
|
|
5
|
-
export type { AccordionItemContextProps } from './anatomy/item-context.svelte';
|
|
6
|
-
export type { AccordionHeadingProps } from './anatomy/heading.svelte';
|
|
7
|
+
export type { AccordionRootProviderProps } from './anatomy/root-provider.svelte';
|
|
7
8
|
export type { AccordionTriggerProps } from './anatomy/trigger.svelte';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
export type { AccordionItemContextType as AccordionItemContext } from './modules/item-context';
|
|
9
|
+
export { Accordion } from './modules/anatomy';
|
|
10
|
+
export { useAccordion } from './modules/use-accordion.svelte';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC/E,YAAY,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare const Accordion: import("svelte").Component<import("../anatomy/root.svelte").AccordionRootProps, {}, ""> & {
|
|
2
|
+
Provider: import("svelte").Component<import("../anatomy/root-provider.svelte").AccordionRootProviderProps, {}, "">;
|
|
2
3
|
Context: import("svelte").Component<import("../anatomy/root-context.svelte").AccordionRootContextProps, {}, "">;
|
|
3
4
|
Item: import("svelte").Component<import("../anatomy/item.svelte").AccordionItemProps, {}, "">;
|
|
4
|
-
ItemContext: import("svelte").Component<import("../anatomy/item-context.svelte").AccordionItemContextProps, {}, "">;
|
|
5
5
|
Heading: import("svelte").Component<import("../anatomy/heading.svelte").AccordionHeadingProps, {}, "">;
|
|
6
6
|
Trigger: import("svelte").Component<import("../anatomy/trigger.svelte").AccordionTriggerProps, {}, "">;
|
|
7
7
|
Indicator: import("svelte").Component<import("../anatomy/indicator.svelte").AccordionIndicatorProps, {}, "">;
|
|
8
8
|
Content: import("svelte").Component<import("../anatomy/content.svelte").AccordionContentProps, {}, "">;
|
|
9
9
|
};
|
|
10
|
+
//# sourceMappingURL=anatomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"anatomy.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/modules/anatomy.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,SAAS;;;;;;;;CAQpB,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import Content from '../anatomy/content.svelte';
|
|
2
|
+
import Heading from '../anatomy/heading.svelte';
|
|
3
|
+
import Indicator from '../anatomy/indicator.svelte';
|
|
4
|
+
import Item from '../anatomy/item.svelte';
|
|
1
5
|
import Root from '../anatomy/root.svelte';
|
|
2
6
|
import RootContext from '../anatomy/root-context.svelte';
|
|
3
|
-
import
|
|
4
|
-
import ItemContext from '../anatomy/item-context.svelte';
|
|
5
|
-
import Heading from '../anatomy/heading.svelte';
|
|
7
|
+
import RootProvider from '../anatomy/root-provider.svelte';
|
|
6
8
|
import Trigger from '../anatomy/trigger.svelte';
|
|
7
|
-
import Indicator from '../anatomy/indicator.svelte';
|
|
8
|
-
import Content from '../anatomy/content.svelte';
|
|
9
9
|
export const Accordion = Object.assign(Root, {
|
|
10
|
+
Provider: RootProvider,
|
|
10
11
|
Context: RootContext,
|
|
11
12
|
Item: Item,
|
|
12
|
-
ItemContext: ItemContext,
|
|
13
13
|
Heading: Heading,
|
|
14
14
|
Trigger: Trigger,
|
|
15
15
|
Indicator: Indicator,
|
|
16
|
-
Content: Content
|
|
16
|
+
Content: Content,
|
|
17
17
|
});
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type { ItemProps
|
|
2
|
-
export interface AccordionItemContextType {
|
|
3
|
-
itemProps: ItemProps;
|
|
4
|
-
itemState: ItemState;
|
|
5
|
-
}
|
|
1
|
+
import type { ItemProps } from '@zag-js/accordion';
|
|
6
2
|
export declare const AccordionItemContext: {
|
|
7
3
|
key: symbol;
|
|
8
|
-
consume():
|
|
9
|
-
provide(value:
|
|
4
|
+
consume(): () => ItemProps;
|
|
5
|
+
provide(value: () => ItemProps): () => ItemProps;
|
|
10
6
|
};
|
|
7
|
+
//# sourceMappingURL=item-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-context.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/modules/item-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,eAAO,MAAM,oBAAoB;;qBAAuB,SAAS;yBAAT,SAAS,SAAT,SAAS;CAAG,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import type { Api } from '@zag-js/accordion';
|
|
2
|
-
export interface AccordionRootContextType {
|
|
3
|
-
api: Api;
|
|
4
|
-
}
|
|
5
1
|
export declare const AccordionRootContext: {
|
|
6
2
|
key: symbol;
|
|
7
|
-
consume():
|
|
8
|
-
provide(value:
|
|
3
|
+
consume(): () => import("@zag-js/accordion").Api;
|
|
4
|
+
provide(value: () => import("@zag-js/accordion").Api): () => import("@zag-js/accordion").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/accordion/modules/root-context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB;;;;CAAmD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-accordion.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion/modules/use-accordion.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAoB,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAG3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,GAAG,MAAM,GAAG,CAIpE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { connect, machine } from '@zag-js/accordion';
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte';
|
|
3
|
+
export function useAccordion(props) {
|
|
4
|
+
const service = useMachine(machine, props);
|
|
5
|
+
const accordion = $derived(connect(service, normalizeProps));
|
|
6
|
+
return () => accordion;
|
|
7
|
+
}
|