@skeletonlabs/skeleton-svelte 1.5.1 → 1.6.0-next.0

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.
@@ -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: 'skb:py-2 skb:px-4'
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: restAttributes })}
20
+ {@render element({ attributes })}
11
21
  {:else}
12
- <svelte:element this={tag} {...restAttributes}>
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(mergeProps(rootContext.api.getItemIndicatorProps(itemContext.itemProps), restAttributes));
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: 'skb:grid skb:gap-2'
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: 'skb:w-full skb:grid skb:gap-2'
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: 'skb:size-full skb:flex skb:justify-center skb:items-center'
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: 'skb:w-full skb:object-cover'
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: 'skb:isolate skb:bg-surface-400-600 skb:size-16 skb:rounded-full skb:overflow-hidden'
21
+ class: classesAvatar.root
21
22
  },
22
23
  restAttributes
23
24
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton-svelte",
3
- "version": "1.5.1",
3
+ "version": "1.6.0-next.0",
4
4
  "description": "The Svelte package for Skeleton.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "types": "./dist/index.d.ts",
@@ -37,7 +37,8 @@
37
37
  "@zag-js/tabs": "^1.18.3",
38
38
  "@zag-js/tags-input": "^1.18.3",
39
39
  "@zag-js/toast": "^1.18.3",
40
- "@zag-js/tooltip": "^1.18.3"
40
+ "@zag-js/tooltip": "^1.18.3",
41
+ "@skeletonlabs/skeleton-common": "0.0.1-next.0"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "svelte": "^5.20.0"
@@ -60,7 +61,7 @@
60
61
  "typescript": "^5.8.3",
61
62
  "vite": "^7.0.4",
62
63
  "vitest": "3.2.4",
63
- "@skeletonlabs/skeleton": "3.2.0"
64
+ "@skeletonlabs/skeleton": "3.3.0-next.0"
64
65
  },
65
66
  "type": "module",
66
67
  "scripts": {