@skeletonlabs/skeleton-svelte 1.5.1 → 2.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{composed → components}/accordion/anatomy/accordion-content.svelte +2 -1
- package/dist/{composed → components}/accordion/anatomy/accordion-heading.svelte +12 -2
- package/dist/{composed → components}/accordion/anatomy/accordion-indicator.svelte +10 -1
- package/dist/{composed → components}/accordion/anatomy/accordion-item.svelte +2 -1
- package/dist/{composed → components}/accordion/anatomy/accordion-root.svelte +2 -1
- package/dist/{composed → components}/accordion/anatomy/accordion-trigger.svelte +2 -2
- package/dist/{composed → components}/avatar/anatomy/avatar-fallback.svelte +2 -1
- package/dist/{composed → components}/avatar/anatomy/avatar-image.svelte +2 -1
- package/dist/{composed → components}/avatar/anatomy/avatar-root.svelte +2 -1
- package/dist/index.css +2 -0
- package/dist/index.d.ts +2 -21
- package/dist/index.js +2 -29
- package/package.json +31 -38
- package/dist/components/Accordion/Accordion.svelte +0 -55
- package/dist/components/Accordion/Accordion.svelte.d.ts +0 -5
- package/dist/components/Accordion/AccordionItem.svelte +0 -90
- package/dist/components/Accordion/AccordionItem.svelte.d.ts +0 -5
- package/dist/components/Accordion/context.d.ts +0 -2
- package/dist/components/Accordion/context.js +0 -3
- package/dist/components/Accordion/index.d.ts +0 -4
- package/dist/components/Accordion/index.js +0 -3
- package/dist/components/Accordion/types.d.ts +0 -74
- package/dist/components/AppBar/AppBar.svelte +0 -72
- package/dist/components/AppBar/AppBar.svelte.d.ts +0 -5
- package/dist/components/AppBar/types.d.ts +0 -61
- package/dist/components/AppBar/types.js +0 -1
- package/dist/components/Avatar/Avatar.svelte +0 -68
- package/dist/components/Avatar/Avatar.svelte.d.ts +0 -5
- package/dist/components/Avatar/types.d.ts +0 -39
- package/dist/components/Avatar/types.js +0 -1
- package/dist/components/Combobox/Combobox.svelte +0 -154
- package/dist/components/Combobox/Combobox.svelte.d.ts +0 -18
- package/dist/components/Combobox/types.d.ts +0 -66
- package/dist/components/Combobox/types.js +0 -1
- package/dist/components/FileUpload/FileUpload.svelte +0 -132
- package/dist/components/FileUpload/FileUpload.svelte.d.ts +0 -5
- package/dist/components/FileUpload/types.d.ts +0 -74
- package/dist/components/FileUpload/types.js +0 -1
- package/dist/components/Modal/Modal.svelte +0 -87
- package/dist/components/Modal/Modal.svelte.d.ts +0 -4
- package/dist/components/Modal/types.d.ts +0 -58
- package/dist/components/Modal/types.js +0 -1
- package/dist/components/Navigation/NavBar.svelte +0 -48
- package/dist/components/Navigation/NavBar.svelte.d.ts +0 -5
- package/dist/components/Navigation/NavRail.svelte +0 -90
- package/dist/components/Navigation/NavRail.svelte.d.ts +0 -5
- package/dist/components/Navigation/NavTile.svelte +0 -87
- package/dist/components/Navigation/NavTile.svelte.d.ts +0 -5
- package/dist/components/Navigation/context.d.ts +0 -2
- package/dist/components/Navigation/context.js +0 -6
- package/dist/components/Navigation/index.d.ts +0 -6
- package/dist/components/Navigation/index.js +0 -4
- package/dist/components/Navigation/types.d.ts +0 -132
- package/dist/components/Navigation/types.js +0 -1
- package/dist/components/Pagination/Pagination.svelte +0 -146
- package/dist/components/Pagination/Pagination.svelte.d.ts +0 -4
- package/dist/components/Pagination/types.d.ts +0 -56
- package/dist/components/Pagination/types.js +0 -1
- package/dist/components/Popover/Popover.svelte +0 -74
- package/dist/components/Popover/Popover.svelte.d.ts +0 -4
- package/dist/components/Popover/types.d.ts +0 -45
- package/dist/components/Popover/types.js +0 -1
- package/dist/components/Progress/Progress.svelte +0 -63
- package/dist/components/Progress/Progress.svelte.d.ts +0 -5
- package/dist/components/Progress/types.d.ts +0 -44
- package/dist/components/Progress/types.js +0 -1
- package/dist/components/ProgressRing/ProgressRing.svelte +0 -98
- package/dist/components/ProgressRing/ProgressRing.svelte.d.ts +0 -5
- package/dist/components/ProgressRing/types.d.ts +0 -56
- package/dist/components/ProgressRing/types.js +0 -1
- package/dist/components/Rating/Rating.svelte +0 -135
- package/dist/components/Rating/Rating.svelte.d.ts +0 -5
- package/dist/components/Rating/index.d.ts +0 -2
- package/dist/components/Rating/index.js +0 -2
- package/dist/components/Rating/types.d.ts +0 -36
- package/dist/components/Rating/types.js +0 -1
- package/dist/components/Segment/Segment.svelte +0 -77
- package/dist/components/Segment/Segment.svelte.d.ts +0 -5
- package/dist/components/Segment/SegmentItem.svelte +0 -40
- package/dist/components/Segment/SegmentItem.svelte.d.ts +0 -5
- package/dist/components/Segment/context.d.ts +0 -2
- package/dist/components/Segment/context.js +0 -6
- package/dist/components/Segment/index.d.ts +0 -4
- package/dist/components/Segment/index.js +0 -3
- package/dist/components/Segment/types.d.ts +0 -64
- package/dist/components/Segment/types.js +0 -1
- package/dist/components/Slider/Slider.svelte +0 -105
- package/dist/components/Slider/Slider.svelte.d.ts +0 -4
- package/dist/components/Slider/types.d.ts +0 -68
- package/dist/components/Slider/types.js +0 -1
- package/dist/components/Switch/Switch.svelte +0 -102
- package/dist/components/Switch/Switch.svelte.d.ts +0 -5
- package/dist/components/Switch/types.d.ts +0 -64
- package/dist/components/Switch/types.js +0 -1
- package/dist/components/Tabs/Tabs.svelte +0 -59
- package/dist/components/Tabs/Tabs.svelte.d.ts +0 -5
- package/dist/components/Tabs/TabsControl.svelte +0 -51
- package/dist/components/Tabs/TabsControl.svelte.d.ts +0 -5
- package/dist/components/Tabs/TabsPanel.svelte +0 -23
- package/dist/components/Tabs/TabsPanel.svelte.d.ts +0 -5
- package/dist/components/Tabs/context.d.ts +0 -2
- package/dist/components/Tabs/context.js +0 -6
- package/dist/components/Tabs/index.d.ts +0 -5
- package/dist/components/Tabs/index.js +0 -4
- package/dist/components/Tabs/types.d.ts +0 -68
- package/dist/components/Tabs/types.js +0 -1
- package/dist/components/TagsInput/TagsInput.svelte +0 -96
- package/dist/components/TagsInput/TagsInput.svelte.d.ts +0 -5
- package/dist/components/TagsInput/types.d.ts +0 -40
- package/dist/components/TagsInput/types.js +0 -1
- package/dist/components/Toast/Toast.svelte +0 -76
- package/dist/components/Toast/Toast.svelte.d.ts +0 -4
- package/dist/components/Toast/Toaster.svelte +0 -72
- package/dist/components/Toast/Toaster.svelte.d.ts +0 -4
- package/dist/components/Toast/create-toaster.d.ts +0 -2
- package/dist/components/Toast/create-toaster.js +0 -4
- package/dist/components/Toast/types.d.ts +0 -47
- package/dist/components/Toast/types.js +0 -1
- package/dist/components/Tooltip/Tooltip.svelte +0 -78
- package/dist/components/Tooltip/Tooltip.svelte.d.ts +0 -4
- package/dist/components/Tooltip/types.d.ts +0 -47
- package/dist/components/Tooltip/types.js +0 -1
- package/dist/composed/accordion/modules/types.js +0 -1
- package/dist/composed/index.d.ts +0 -2
- package/dist/composed/index.js +0 -2
- /package/dist/{composed → components}/accordion/anatomy/accordion-content.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/anatomy/accordion-heading.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/anatomy/accordion-indicator.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/anatomy/accordion-item.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/anatomy/accordion-root.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/anatomy/accordion-trigger.svelte.d.ts +0 -0
- /package/dist/{composed → components}/accordion/index.d.ts +0 -0
- /package/dist/{composed → components}/accordion/index.js +0 -0
- /package/dist/{composed → components}/accordion/modules/anatomy.d.ts +0 -0
- /package/dist/{composed → components}/accordion/modules/anatomy.js +0 -0
- /package/dist/{composed → components}/accordion/modules/context.d.ts +0 -0
- /package/dist/{composed → components}/accordion/modules/context.js +0 -0
- /package/dist/{composed → components}/accordion/modules/types.d.ts +0 -0
- /package/dist/components/{Accordion → accordion/modules}/types.js +0 -0
- /package/dist/{composed → components}/avatar/anatomy/avatar-fallback.svelte.d.ts +0 -0
- /package/dist/{composed → components}/avatar/anatomy/avatar-image.svelte.d.ts +0 -0
- /package/dist/{composed → components}/avatar/anatomy/avatar-root.svelte.d.ts +0 -0
- /package/dist/{composed → components}/avatar/index.d.ts +0 -0
- /package/dist/{composed → components}/avatar/index.js +0 -0
- /package/dist/{composed → components}/avatar/modules/anatomy.d.ts +0 -0
- /package/dist/{composed → components}/avatar/modules/anatomy.js +0 -0
- /package/dist/{composed → components}/avatar/modules/context.d.ts +0 -0
- /package/dist/{composed → components}/avatar/modules/context.js +0 -0
- /package/dist/{composed → components}/avatar/modules/types.d.ts +0 -0
- /package/dist/{composed → components}/avatar/modules/types.js +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
3
|
import { AccordionItemContext, AccordionRootContext } from '../modules/context.js';
|
|
4
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
4
5
|
import type { AccordionContentProps } from '../modules/types.js';
|
|
5
6
|
|
|
6
7
|
const rootContext = AccordionRootContext.consume();
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
mergeProps(
|
|
12
13
|
rootContext.api.getItemContentProps(itemContext.itemProps),
|
|
13
14
|
{
|
|
14
|
-
class:
|
|
15
|
+
class: classesAccordion.content
|
|
15
16
|
},
|
|
16
17
|
restAttributes
|
|
17
18
|
)
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
3
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
2
4
|
import type { AccordionHeadingProps } from '../modules/types.js';
|
|
3
5
|
|
|
4
6
|
const props: AccordionHeadingProps = $props();
|
|
5
7
|
const { level = 3, element, children, ...restAttributes } = $derived(props);
|
|
8
|
+
const attributes = $derived(
|
|
9
|
+
mergeProps(
|
|
10
|
+
{
|
|
11
|
+
class: classesAccordion.heading
|
|
12
|
+
},
|
|
13
|
+
restAttributes
|
|
14
|
+
)
|
|
15
|
+
);
|
|
6
16
|
const tag = $derived(`h${level}`);
|
|
7
17
|
</script>
|
|
8
18
|
|
|
9
19
|
{#if element}
|
|
10
|
-
{@render element({ attributes
|
|
20
|
+
{@render element({ attributes })}
|
|
11
21
|
{:else}
|
|
12
|
-
<svelte:element this={tag} {...
|
|
22
|
+
<svelte:element this={tag} {...attributes}>
|
|
13
23
|
{@render children?.()}
|
|
14
24
|
</svelte:element>
|
|
15
25
|
{/if}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
3
4
|
import { AccordionRootContext, AccordionItemContext } from '../modules/context.js';
|
|
4
5
|
import type { AccordionIndicatorProps } from '../modules/types.js';
|
|
5
6
|
|
|
@@ -7,7 +8,15 @@
|
|
|
7
8
|
const itemContext = AccordionItemContext.consume();
|
|
8
9
|
const props: AccordionIndicatorProps = $props();
|
|
9
10
|
const { element, children, ...restAttributes } = $derived(props);
|
|
10
|
-
const attributes = $derived(
|
|
11
|
+
const attributes = $derived(
|
|
12
|
+
mergeProps(
|
|
13
|
+
rootContext.api.getItemIndicatorProps(itemContext.itemProps),
|
|
14
|
+
{
|
|
15
|
+
class: classesAccordion.indicator
|
|
16
|
+
},
|
|
17
|
+
restAttributes
|
|
18
|
+
)
|
|
19
|
+
);
|
|
11
20
|
</script>
|
|
12
21
|
|
|
13
22
|
{#if element}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
3
|
import * as accordion from '@zag-js/accordion';
|
|
4
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
4
5
|
import { AccordionItemContext, AccordionRootContext } from '../modules/context.js';
|
|
5
6
|
import type { AccordionItemProps } from '../modules/types.js';
|
|
6
7
|
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
mergeProps(
|
|
13
14
|
rootContext.api.getItemProps(itemProps),
|
|
14
15
|
{
|
|
15
|
-
class:
|
|
16
|
+
class: classesAccordion.item
|
|
16
17
|
},
|
|
17
18
|
restAttributes
|
|
18
19
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps, normalizeProps, useMachine } from '@zag-js/svelte';
|
|
3
3
|
import * as accordion from '@zag-js/accordion';
|
|
4
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
4
5
|
import { AccordionRootContext } from '../modules/context.js';
|
|
5
6
|
import type { AccordionRootProps } from '../modules/types.js';
|
|
6
7
|
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
mergeProps(
|
|
18
19
|
api.getRootProps(),
|
|
19
20
|
{
|
|
20
|
-
class:
|
|
21
|
+
class: classesAccordion.root
|
|
21
22
|
},
|
|
22
23
|
restAttributes
|
|
23
24
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
3
|
import { AccordionItemContext, AccordionRootContext } from '../modules/context.js';
|
|
4
|
+
import { classesAccordion } from '@skeletonlabs/skeleton-common';
|
|
4
5
|
import type { AccordionTriggerProps } from '../modules/types.js';
|
|
5
6
|
|
|
6
7
|
const rootContext = AccordionRootContext.consume();
|
|
@@ -11,8 +12,7 @@
|
|
|
11
12
|
mergeProps(
|
|
12
13
|
rootContext.api.getItemTriggerProps(itemContext.itemProps),
|
|
13
14
|
{
|
|
14
|
-
class:
|
|
15
|
-
'skb:w-full skb:grid skb:items-center skb:gap-4 skb:py-2 skb:px-4 skb:rounded-base skb:text-left skb:hover:preset-tonal-primary'
|
|
15
|
+
class: classesAccordion.trigger
|
|
16
16
|
},
|
|
17
17
|
restAttributes
|
|
18
18
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
|
+
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
3
4
|
import { AvatarRootContext } from '../modules/context.js';
|
|
4
5
|
import type { AvatarFallbackProps } from '../modules/types.js';
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
mergeProps(
|
|
11
12
|
rootContext.api.getFallbackProps(),
|
|
12
13
|
{
|
|
13
|
-
class:
|
|
14
|
+
class: classesAvatar.fallback
|
|
14
15
|
},
|
|
15
16
|
restAttributes
|
|
16
17
|
)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { mergeProps } from '@zag-js/svelte';
|
|
3
|
+
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
3
4
|
import { AvatarRootContext } from '../modules/context.js';
|
|
4
5
|
import type { AvatarImageProps } from '../modules/types.js';
|
|
5
6
|
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
mergeProps(
|
|
11
12
|
rootContext.api.getImageProps(),
|
|
12
13
|
{
|
|
13
|
-
class:
|
|
14
|
+
class: classesAvatar.image
|
|
14
15
|
},
|
|
15
16
|
restAttributes
|
|
16
17
|
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import * as avatar from '@zag-js/avatar';
|
|
3
3
|
import { useMachine, normalizeProps, mergeProps } from '@zag-js/svelte';
|
|
4
|
+
import { classesAvatar } from '@skeletonlabs/skeleton-common';
|
|
4
5
|
import { AvatarRootContext } from '../modules/context.js';
|
|
5
6
|
import type { AvatarRootProps } from '../modules/types.js';
|
|
6
7
|
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
mergeProps(
|
|
18
19
|
api.getRootProps(),
|
|
19
20
|
{
|
|
20
|
-
class:
|
|
21
|
+
class: classesAvatar.root
|
|
21
22
|
},
|
|
22
23
|
restAttributes
|
|
23
24
|
)
|
package/dist/index.css
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export { default as Avatar } from './components/Avatar/Avatar.svelte';
|
|
4
|
-
export { default as FileUpload } from './components/FileUpload/FileUpload.svelte';
|
|
5
|
-
export { default as Pagination } from './components/Pagination/Pagination.svelte';
|
|
6
|
-
export { default as Progress } from './components/Progress/Progress.svelte';
|
|
7
|
-
export { default as ProgressRing } from './components/ProgressRing/ProgressRing.svelte';
|
|
8
|
-
export { default as Navigation } from './components/Navigation/index.js';
|
|
9
|
-
export { default as Segment } from './components/Segment/index.js';
|
|
10
|
-
export { default as Slider } from './components/Slider/Slider.svelte';
|
|
11
|
-
export { default as Switch } from './components/Switch/Switch.svelte';
|
|
12
|
-
export { default as Tabs } from './components/Tabs/index.js';
|
|
13
|
-
export { default as TagsInput } from './components/TagsInput/TagsInput.svelte';
|
|
14
|
-
export { default as Toaster } from './components/Toast/Toaster.svelte';
|
|
15
|
-
export { createToaster } from './components/Toast/create-toaster.js';
|
|
16
|
-
export { default as Rating } from './components/Rating/index.js';
|
|
17
|
-
export type { FileUploadApi } from './components/FileUpload/types.js';
|
|
18
|
-
export { default as Combobox } from './components/Combobox/Combobox.svelte';
|
|
19
|
-
export { default as Popover } from './components/Popover/Popover.svelte';
|
|
20
|
-
export { default as Tooltip } from './components/Tooltip/Tooltip.svelte';
|
|
21
|
-
export { default as Modal } from './components/Modal/Modal.svelte';
|
|
1
|
+
export * from './components/accordion/index.js';
|
|
2
|
+
export * from './components/avatar/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// Do not export parent/child components. Use the dot-notation composition pattern:
|
|
4
|
-
// https://skeleton.dev/docs/resources/contribute/components#dot-notation-syntax
|
|
5
|
-
// (See Accordion, Nav, and Tabs for examples)
|
|
6
|
-
// Components
|
|
7
|
-
export { default as Accordion } from './components/Accordion/index.js';
|
|
8
|
-
export { default as AppBar } from './components/AppBar/AppBar.svelte';
|
|
9
|
-
export { default as Avatar } from './components/Avatar/Avatar.svelte';
|
|
10
|
-
export { default as FileUpload } from './components/FileUpload/FileUpload.svelte';
|
|
11
|
-
export { default as Pagination } from './components/Pagination/Pagination.svelte';
|
|
12
|
-
export { default as Progress } from './components/Progress/Progress.svelte';
|
|
13
|
-
export { default as ProgressRing } from './components/ProgressRing/ProgressRing.svelte';
|
|
14
|
-
export { default as Navigation } from './components/Navigation/index.js';
|
|
15
|
-
export { default as Segment } from './components/Segment/index.js';
|
|
16
|
-
export { default as Slider } from './components/Slider/Slider.svelte';
|
|
17
|
-
export { default as Switch } from './components/Switch/Switch.svelte';
|
|
18
|
-
export { default as Tabs } from './components/Tabs/index.js';
|
|
19
|
-
export { default as TagsInput } from './components/TagsInput/TagsInput.svelte';
|
|
20
|
-
export { default as Toaster } from './components/Toast/Toaster.svelte';
|
|
21
|
-
export { createToaster } from './components/Toast/create-toaster.js';
|
|
22
|
-
export { default as Rating } from './components/Rating/index.js';
|
|
23
|
-
// Temporary Features ---
|
|
24
|
-
// The following will be removed or replaced in the future.
|
|
25
|
-
// Popvers
|
|
26
|
-
export { default as Combobox } from './components/Combobox/Combobox.svelte';
|
|
27
|
-
export { default as Popover } from './components/Popover/Popover.svelte';
|
|
28
|
-
export { default as Tooltip } from './components/Tooltip/Tooltip.svelte';
|
|
29
|
-
export { default as Modal } from './components/Modal/Modal.svelte';
|
|
1
|
+
export * from './components/accordion/index.js';
|
|
2
|
+
export * from './components/avatar/index.js';
|
package/package.json
CHANGED
|
@@ -1,66 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.1",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
+
"style": "./dist/index.css",
|
|
9
10
|
"types": "./dist/index.d.ts",
|
|
10
11
|
"svelte": "./dist/index.js",
|
|
11
12
|
"default": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./composed": {
|
|
14
|
-
"types": "./dist/composed/index.d.ts",
|
|
15
|
-
"svelte": "./dist/composed/index.js",
|
|
16
|
-
"default": "./dist/composed/index.js"
|
|
17
13
|
}
|
|
18
14
|
},
|
|
19
15
|
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
"!dist/**/*.test.*"
|
|
16
|
+
"dist"
|
|
22
17
|
],
|
|
23
18
|
"dependencies": {
|
|
24
|
-
"@zag-js/accordion": "^1.
|
|
25
|
-
"@zag-js/avatar": "^1.
|
|
26
|
-
"@zag-js/combobox": "^1.
|
|
27
|
-
"@zag-js/dialog": "^1.
|
|
28
|
-
"@zag-js/file-upload": "^1.
|
|
29
|
-
"@zag-js/pagination": "^1.
|
|
30
|
-
"@zag-js/popover": "^1.
|
|
31
|
-
"@zag-js/progress": "^1.
|
|
32
|
-
"@zag-js/radio-group": "^1.
|
|
33
|
-
"@zag-js/rating-group": "^1.
|
|
34
|
-
"@zag-js/slider": "^1.
|
|
35
|
-
"@zag-js/svelte": "^1.
|
|
36
|
-
"@zag-js/switch": "^1.
|
|
37
|
-
"@zag-js/tabs": "^1.
|
|
38
|
-
"@zag-js/tags-input": "^1.
|
|
39
|
-
"@zag-js/toast": "^1.
|
|
40
|
-
"@zag-js/tooltip": "^1.
|
|
19
|
+
"@zag-js/accordion": "^1.22.1",
|
|
20
|
+
"@zag-js/avatar": "^1.22.1",
|
|
21
|
+
"@zag-js/combobox": "^1.22.1",
|
|
22
|
+
"@zag-js/dialog": "^1.22.1",
|
|
23
|
+
"@zag-js/file-upload": "^1.22.1",
|
|
24
|
+
"@zag-js/pagination": "^1.22.1",
|
|
25
|
+
"@zag-js/popover": "^1.22.1",
|
|
26
|
+
"@zag-js/progress": "^1.22.1",
|
|
27
|
+
"@zag-js/radio-group": "^1.22.1",
|
|
28
|
+
"@zag-js/rating-group": "^1.22.1",
|
|
29
|
+
"@zag-js/slider": "^1.22.1",
|
|
30
|
+
"@zag-js/svelte": "^1.22.1",
|
|
31
|
+
"@zag-js/switch": "^1.22.1",
|
|
32
|
+
"@zag-js/tabs": "^1.22.1",
|
|
33
|
+
"@zag-js/tags-input": "^1.22.1",
|
|
34
|
+
"@zag-js/toast": "^1.22.1",
|
|
35
|
+
"@zag-js/tooltip": "^1.22.1",
|
|
36
|
+
"@skeletonlabs/skeleton-common": "1.0.0-next.1"
|
|
41
37
|
},
|
|
42
38
|
"peerDependencies": {
|
|
43
39
|
"svelte": "^5.20.0"
|
|
44
40
|
},
|
|
45
41
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/adapter-auto": "^6.0
|
|
47
|
-
"@sveltejs/kit": "^2.
|
|
48
|
-
"@sveltejs/package": "^2.
|
|
49
|
-
"@sveltejs/vite-plugin-svelte": "^6.1.
|
|
50
|
-
"@
|
|
51
|
-
"@tailwindcss/vite": "^4.1.11",
|
|
52
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
42
|
+
"@sveltejs/adapter-auto": "^6.1.0",
|
|
43
|
+
"@sveltejs/kit": "^2.37.0",
|
|
44
|
+
"@sveltejs/package": "^2.5.0",
|
|
45
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.3",
|
|
46
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
53
47
|
"@testing-library/svelte": "^5.2.8",
|
|
54
48
|
"jsdom": "^26.1.0",
|
|
55
49
|
"publint": "^0.3.12",
|
|
56
|
-
"svelte": "^5.
|
|
57
|
-
"svelte-check": "^4.
|
|
58
|
-
"tailwindcss": "^4.1.11",
|
|
50
|
+
"svelte": "^5.38.6",
|
|
51
|
+
"svelte-check": "^4.3.1",
|
|
59
52
|
"tslib": "^2.8.1",
|
|
60
|
-
"typescript": "^5.
|
|
61
|
-
"vite": "^7.
|
|
53
|
+
"typescript": "^5.9.2",
|
|
54
|
+
"vite": "^7.1.3",
|
|
62
55
|
"vitest": "3.2.4",
|
|
63
|
-
"@skeletonlabs/skeleton": "
|
|
56
|
+
"@skeletonlabs/skeleton": "4.0.0-next.1"
|
|
64
57
|
},
|
|
65
58
|
"type": "module",
|
|
66
59
|
"scripts": {
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as accordion from '@zag-js/accordion';
|
|
3
|
-
import { useMachine, normalizeProps } from '@zag-js/svelte';
|
|
4
|
-
import { setAccordionContext } from './context.js';
|
|
5
|
-
import type { AccordionProps } from './types.js';
|
|
6
|
-
|
|
7
|
-
// Props
|
|
8
|
-
const {
|
|
9
|
-
animationConfig = {
|
|
10
|
-
duration: 200
|
|
11
|
-
},
|
|
12
|
-
// Root
|
|
13
|
-
base = '',
|
|
14
|
-
padding = '',
|
|
15
|
-
spaceY = 'space-y-2',
|
|
16
|
-
rounded = 'rounded-base',
|
|
17
|
-
width = 'w-full',
|
|
18
|
-
classes = '',
|
|
19
|
-
// Snippets
|
|
20
|
-
children,
|
|
21
|
-
iconOpen,
|
|
22
|
-
iconClosed,
|
|
23
|
-
...zagProps
|
|
24
|
-
}: AccordionProps = $props();
|
|
25
|
-
|
|
26
|
-
// Zag
|
|
27
|
-
const id = $props.id();
|
|
28
|
-
const service = useMachine(accordion.machine, () => ({
|
|
29
|
-
id: id,
|
|
30
|
-
...zagProps
|
|
31
|
-
}));
|
|
32
|
-
const api = $derived(accordion.connect(service, normalizeProps));
|
|
33
|
-
|
|
34
|
-
// Context
|
|
35
|
-
setAccordionContext({
|
|
36
|
-
get api() {
|
|
37
|
-
return api;
|
|
38
|
-
},
|
|
39
|
-
get animationConfig() {
|
|
40
|
-
return animationConfig;
|
|
41
|
-
},
|
|
42
|
-
get iconClosed() {
|
|
43
|
-
return iconClosed;
|
|
44
|
-
},
|
|
45
|
-
get iconOpen() {
|
|
46
|
-
return iconOpen;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<!-- @component Divide content into collapsible sections. -->
|
|
52
|
-
|
|
53
|
-
<div class="{base} {padding} {spaceY} {rounded} {width} {classes}" {...api.getRootProps()} data-testid="accordion">
|
|
54
|
-
{@render children?.()}
|
|
55
|
-
</div>
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { slide } from 'svelte/transition';
|
|
3
|
-
import { getAccordionContext } from './context.js';
|
|
4
|
-
import type { AccordionItemProps } from './types.js';
|
|
5
|
-
|
|
6
|
-
// Props
|
|
7
|
-
const {
|
|
8
|
-
headingLevel = 3,
|
|
9
|
-
// Root
|
|
10
|
-
base,
|
|
11
|
-
spaceY,
|
|
12
|
-
classes,
|
|
13
|
-
// Control
|
|
14
|
-
controlBase = 'flex text-start items-center space-x-4 w-full',
|
|
15
|
-
controlHover = 'hover:preset-tonal-primary',
|
|
16
|
-
controlPadding = 'py-2 px-4',
|
|
17
|
-
controlRounded = 'rounded-base',
|
|
18
|
-
controlClasses,
|
|
19
|
-
// Lead
|
|
20
|
-
leadBase = '',
|
|
21
|
-
leadClasses = '',
|
|
22
|
-
// Content
|
|
23
|
-
contentBase = 'flex-1',
|
|
24
|
-
contentClasses = '',
|
|
25
|
-
// Indicator
|
|
26
|
-
indicatorBase = '',
|
|
27
|
-
indicatorClasses = '',
|
|
28
|
-
// Panel
|
|
29
|
-
panelBase,
|
|
30
|
-
panelPadding = 'py-2 px-4',
|
|
31
|
-
panelRounded,
|
|
32
|
-
panelClasses,
|
|
33
|
-
// Snippets
|
|
34
|
-
control,
|
|
35
|
-
lead,
|
|
36
|
-
panel,
|
|
37
|
-
...zagProps
|
|
38
|
-
}: AccordionItemProps = $props();
|
|
39
|
-
|
|
40
|
-
// Context
|
|
41
|
-
const ctx = getAccordionContext();
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<!-- @component A accordion item component. -->
|
|
45
|
-
|
|
46
|
-
<div class="{base} {spaceY} {classes}" {...ctx.api.getItemProps(zagProps)} data-testid="accordion-item">
|
|
47
|
-
<!-- Control -->
|
|
48
|
-
<svelte:element this={`h${headingLevel}`}>
|
|
49
|
-
<button
|
|
50
|
-
class="{controlBase} {controlHover} {controlPadding} {controlRounded} {controlClasses}"
|
|
51
|
-
{...ctx.api.getItemTriggerProps(zagProps)}
|
|
52
|
-
data-testid="accordion-control"
|
|
53
|
-
>
|
|
54
|
-
<!-- Lead -->
|
|
55
|
-
{#if lead}
|
|
56
|
-
<div class="{leadBase} {leadClasses}" data-testid="accordion-lead">{@render lead()}</div>
|
|
57
|
-
{/if}
|
|
58
|
-
<!-- Content -->
|
|
59
|
-
<div class="{contentBase} {contentClasses}" data-testid="accordion-control">
|
|
60
|
-
{@render control()}
|
|
61
|
-
</div>
|
|
62
|
-
<!-- Indicator -->
|
|
63
|
-
<div class="{indicatorBase} {indicatorClasses}" data-testid="accordion-indicator">
|
|
64
|
-
{#if ctx.api.value.includes(zagProps.value)}
|
|
65
|
-
{#if ctx.iconOpen}
|
|
66
|
-
{@render ctx.iconOpen()}
|
|
67
|
-
{:else}
|
|
68
|
-
−
|
|
69
|
-
{/if}
|
|
70
|
-
{:else if ctx.iconClosed}
|
|
71
|
-
{@render ctx.iconClosed()}
|
|
72
|
-
{:else}
|
|
73
|
-
+
|
|
74
|
-
{/if}
|
|
75
|
-
</div>
|
|
76
|
-
</button>
|
|
77
|
-
</svelte:element>
|
|
78
|
-
|
|
79
|
-
<!-- Panel -->
|
|
80
|
-
{#if ctx.api.value.includes(zagProps.value)}
|
|
81
|
-
<div
|
|
82
|
-
class="{panelBase} {panelPadding} {panelRounded} {panelClasses}"
|
|
83
|
-
{...ctx.api.getItemContentProps(zagProps)}
|
|
84
|
-
transition:slide={ctx.animationConfig}
|
|
85
|
-
data-testid="accordion-panel"
|
|
86
|
-
>
|
|
87
|
-
{@render panel?.()}
|
|
88
|
-
</div>
|
|
89
|
-
{/if}
|
|
90
|
-
</div>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import * as accordion from '@zag-js/accordion';
|
|
3
|
-
import type { SlideParams } from 'svelte/transition';
|
|
4
|
-
export interface AccordionContext extends Pick<AccordionProps, 'animationConfig' | 'iconOpen' | 'iconClosed'> {
|
|
5
|
-
api: ReturnType<typeof accordion.connect>;
|
|
6
|
-
}
|
|
7
|
-
export interface AccordionProps extends Omit<accordion.Props, 'id' | 'orientation'> {
|
|
8
|
-
/** The animation configuration */
|
|
9
|
-
animationConfig?: SlideParams;
|
|
10
|
-
/** Sets base styles. */
|
|
11
|
-
base?: string;
|
|
12
|
-
/** Set padding styles. */
|
|
13
|
-
padding?: string;
|
|
14
|
-
/** Set vertical spacing styles. */
|
|
15
|
-
spaceY?: string;
|
|
16
|
-
/** Set border radius styles. */
|
|
17
|
-
rounded?: string;
|
|
18
|
-
/** Set the width styles. */
|
|
19
|
-
width?: string;
|
|
20
|
-
/** Provide arbitrary CSS classes. */
|
|
21
|
-
classes?: string;
|
|
22
|
-
/** The default child slot. */
|
|
23
|
-
children: Snippet;
|
|
24
|
-
/** Set the open state icon. */
|
|
25
|
-
iconOpen?: Snippet;
|
|
26
|
-
/** Set the closed state icon. */
|
|
27
|
-
iconClosed?: Snippet;
|
|
28
|
-
}
|
|
29
|
-
export interface AccordionItemProps extends accordion.ItemProps {
|
|
30
|
-
/** The heading level. */
|
|
31
|
-
headingLevel?: number;
|
|
32
|
-
/** Sets base styles. */
|
|
33
|
-
base?: string;
|
|
34
|
-
/** Set vertical spacing styles. */
|
|
35
|
-
spaceY?: string;
|
|
36
|
-
/** Provide arbitrary CSS classes. */
|
|
37
|
-
classes?: string;
|
|
38
|
-
/** Sets control's base styles. */
|
|
39
|
-
controlBase?: string;
|
|
40
|
-
/** Sets control's the hover styles. */
|
|
41
|
-
controlHover?: string;
|
|
42
|
-
/** Sets control's the padding styles. */
|
|
43
|
-
controlPadding?: string;
|
|
44
|
-
/** Sets control's the border radius styles. */
|
|
45
|
-
controlRounded?: string;
|
|
46
|
-
/** Provide arbitrary CSS classes to the control. */
|
|
47
|
-
controlClasses?: string;
|
|
48
|
-
/** Sets the lead's base styles */
|
|
49
|
-
leadBase?: string;
|
|
50
|
-
/** Provide arbitrary CSS classes to the lead. */
|
|
51
|
-
leadClasses?: string;
|
|
52
|
-
/** Sets the lead's base styles */
|
|
53
|
-
contentBase?: string;
|
|
54
|
-
/** Provide arbitrary CSS classes to the content. */
|
|
55
|
-
contentClasses?: string;
|
|
56
|
-
/** Sets the lead's base styles */
|
|
57
|
-
indicatorBase?: string;
|
|
58
|
-
/** Provide arbitrary CSS classes to the indicator. */
|
|
59
|
-
indicatorClasses?: string;
|
|
60
|
-
/** Set the panel's base styles. */
|
|
61
|
-
panelBase?: string;
|
|
62
|
-
/** Set the panel's padding styles. */
|
|
63
|
-
panelPadding?: string;
|
|
64
|
-
/** Set the panel's border-radius styles. */
|
|
65
|
-
panelRounded?: string;
|
|
66
|
-
/** Provide arbitrary CSS classes to the panel. */
|
|
67
|
-
panelClasses?: string;
|
|
68
|
-
/** The control's default slot. */
|
|
69
|
-
control: Snippet;
|
|
70
|
-
/** The control's lead icon slot. */
|
|
71
|
-
lead?: Snippet;
|
|
72
|
-
/** The panels's default slot. */
|
|
73
|
-
panel?: Snippet;
|
|
74
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { AppBarProps } from './types.js';
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
// Root
|
|
6
|
-
base = 'w-full flex flex-col',
|
|
7
|
-
background = 'bg-surface-100-900',
|
|
8
|
-
spaceY = 'space-y-4',
|
|
9
|
-
border = '',
|
|
10
|
-
padding = 'p-4',
|
|
11
|
-
shadow = '',
|
|
12
|
-
classes = '',
|
|
13
|
-
// Toolbar
|
|
14
|
-
toolbarBase = 'flex justify-between',
|
|
15
|
-
toolbarGridCols = 'grid-cols-[auto_1fr_auto]',
|
|
16
|
-
toolbarGap = 'gap-4',
|
|
17
|
-
toolbarClasses = '',
|
|
18
|
-
// Lead
|
|
19
|
-
leadBase = 'flex',
|
|
20
|
-
leadSpaceX = 'space-x-4 rtl:space-x-reverse',
|
|
21
|
-
leadPadding = '',
|
|
22
|
-
leadClasses = '',
|
|
23
|
-
// Center
|
|
24
|
-
centerBase = 'grow',
|
|
25
|
-
centerAlign = 'text-center',
|
|
26
|
-
centerPadding = '',
|
|
27
|
-
centerClasses = '',
|
|
28
|
-
// Trail
|
|
29
|
-
trailBase = 'flex',
|
|
30
|
-
trailSpaceX = 'space-x-4 rtl:space-x-reverse',
|
|
31
|
-
trailPadding = '',
|
|
32
|
-
trailClasses = '',
|
|
33
|
-
// Headline
|
|
34
|
-
headlineBase = 'w-full',
|
|
35
|
-
headlineClasses = '',
|
|
36
|
-
// Snippets
|
|
37
|
-
children,
|
|
38
|
-
lead,
|
|
39
|
-
trail,
|
|
40
|
-
headline
|
|
41
|
-
}: AppBarProps = $props();
|
|
42
|
-
</script>
|
|
43
|
-
|
|
44
|
-
<!-- @component A header element for the top of a page layout. -->
|
|
45
|
-
|
|
46
|
-
<header class="{base} {background} {spaceY} {border} {padding} {shadow} {classes}" data-testid="app-bar">
|
|
47
|
-
<section class="{toolbarBase} {toolbarGridCols} {toolbarGap} {toolbarClasses}" data-testid="app-bar-toolbar">
|
|
48
|
-
{#if lead}
|
|
49
|
-
<div class="{leadBase} {leadSpaceX} {leadPadding} {leadClasses}">
|
|
50
|
-
{@render lead()}
|
|
51
|
-
</div>
|
|
52
|
-
{/if}
|
|
53
|
-
|
|
54
|
-
{#if children}
|
|
55
|
-
<div class="{centerBase} {centerAlign} {centerPadding} {centerClasses}">
|
|
56
|
-
{@render children()}
|
|
57
|
-
</div>
|
|
58
|
-
{/if}
|
|
59
|
-
|
|
60
|
-
{#if trail}
|
|
61
|
-
<div class="{trailBase} {trailSpaceX} {trailPadding} {trailClasses}">
|
|
62
|
-
{@render trail()}
|
|
63
|
-
</div>
|
|
64
|
-
{/if}
|
|
65
|
-
</section>
|
|
66
|
-
|
|
67
|
-
{#if headline}
|
|
68
|
-
<section class="{headlineBase} {headlineClasses}" data-testid="app-bar-headline">
|
|
69
|
-
{@render headline()}
|
|
70
|
-
</section>
|
|
71
|
-
{/if}
|
|
72
|
-
</header>
|