@skeletonlabs/skeleton-svelte 4.7.3 → 4.8.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.
@@ -0,0 +1,36 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
4
+
5
+ export interface NavigationTriggerAnchorProps extends PropsWithElement<'anchor'>, HTMLAttributes<'anchor'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { RootContext } from '../modules/root-context.js';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ const props: NavigationTriggerAnchorProps = $props();
13
+
14
+ const navigation = RootContext.consume();
15
+
16
+ const { element, children, ...rest } = $derived(props);
17
+
18
+ const attributes = $derived(
19
+ mergeProps(
20
+ {
21
+ 'data-scope': 'navigation',
22
+ 'data-part': 'trigger-anchor',
23
+ 'data-layout': navigation().layout,
24
+ },
25
+ rest,
26
+ ),
27
+ );
28
+ </script>
29
+
30
+ {#if element}
31
+ {@render element(attributes)}
32
+ {:else}
33
+ <a {...attributes}>
34
+ {@render children?.()}
35
+ </a>
36
+ {/if}
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
3
+ export interface NavigationTriggerAnchorProps extends PropsWithElement<'anchor'>, HTMLAttributes<'anchor'> {
4
+ }
5
+ declare const TriggerAnchor: import("svelte").Component<NavigationTriggerAnchorProps, {}, "">;
6
+ type TriggerAnchor = ReturnType<typeof TriggerAnchor>;
7
+ export default TriggerAnchor;
@@ -0,0 +1,36 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
4
+
5
+ export interface NavigationTriggerTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { RootContext } from '../modules/root-context.js';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ const props: NavigationTriggerTextProps = $props();
13
+
14
+ const navigation = RootContext.consume();
15
+
16
+ const { element, children, ...rest } = $derived(props);
17
+
18
+ const attributes = $derived(
19
+ mergeProps(
20
+ {
21
+ 'data-scope': 'navigation',
22
+ 'data-part': 'trigger-text',
23
+ 'data-layout': navigation().layout,
24
+ },
25
+ rest,
26
+ ),
27
+ );
28
+ </script>
29
+
30
+ {#if element}
31
+ {@render element(attributes)}
32
+ {:else}
33
+ <span {...attributes}>
34
+ {@render children?.()}
35
+ </span>
36
+ {/if}
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
3
+ export interface NavigationTriggerTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {
4
+ }
5
+ declare const TriggerText: import("svelte").Component<NavigationTriggerTextProps, {}, "">;
6
+ type TriggerText = ReturnType<typeof TriggerText>;
7
+ export default TriggerText;
@@ -0,0 +1,37 @@
1
+ <script lang="ts" module>
2
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
3
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
4
+
5
+ export interface NavigationTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {}
6
+ </script>
7
+
8
+ <script lang="ts">
9
+ import { RootContext } from '../modules/root-context.js';
10
+ import { mergeProps } from '@zag-js/svelte';
11
+
12
+ const props: NavigationTriggerProps = $props();
13
+
14
+ const navigation = RootContext.consume();
15
+
16
+ const { element, children, ...rest } = $derived(props);
17
+
18
+ const attributes = $derived(
19
+ mergeProps(
20
+ {
21
+ 'data-scope': 'navigation',
22
+ 'data-part': 'trigger',
23
+ 'data-layout': navigation().layout,
24
+ type: 'button',
25
+ },
26
+ rest,
27
+ ),
28
+ );
29
+ </script>
30
+
31
+ {#if element}
32
+ {@render element(attributes)}
33
+ {:else}
34
+ <button type="button" {...attributes}>
35
+ {@render children?.()}
36
+ </button>
37
+ {/if}
@@ -0,0 +1,7 @@
1
+ import type { HTMLAttributes } from '../../../internal/html-attributes.js';
2
+ import type { PropsWithElement } from '../../../internal/props-with-element.js';
3
+ export interface NavigationTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {
4
+ }
5
+ declare const Trigger: import("svelte").Component<NavigationTriggerProps, {}, "">;
6
+ type Trigger = ReturnType<typeof Trigger>;
7
+ export default Trigger;
@@ -5,4 +5,7 @@ export type { NavigationContentProps } from './anatomy/content.svelte';
5
5
  export type { NavigationFooterProps } from './anatomy/footer.svelte';
6
6
  export type { NavigationGroupProps } from './anatomy/group.svelte';
7
7
  export type { NavigationLabelProps } from './anatomy/label.svelte';
8
+ export type { NavigationTriggerAnchorProps } from './anatomy/trigger-anchor.svelte';
9
+ export type { NavigationTriggerProps } from './anatomy/trigger.svelte';
10
+ export type { NavigationTriggerTextProps } from './anatomy/trigger-text.svelte';
8
11
  export { Navigation } from './modules/anatomy.js';
@@ -4,5 +4,8 @@ export declare const Navigation: import("svelte").Component<import("../anatomy/r
4
4
  Group: import("svelte").Component<import("../anatomy/group.svelte").NavigationGroupProps, {}, "">;
5
5
  Label: import("svelte").Component<import("../anatomy/label.svelte").NavigationLabelProps, {}, "">;
6
6
  Menu: import("svelte").Component<import("../anatomy/menu.svelte").NavigationMenuProps, {}, "">;
7
+ Trigger: import("svelte").Component<import("../anatomy/trigger.svelte").NavigationTriggerProps, {}, "">;
8
+ TriggerAnchor: import("svelte").Component<import("../anatomy/trigger-anchor.svelte").NavigationTriggerAnchorProps, {}, "">;
9
+ TriggerText: import("svelte").Component<import("../anatomy/trigger-text.svelte").NavigationTriggerTextProps, {}, "">;
7
10
  Footer: import("svelte").Component<import("../anatomy/footer.svelte").NavigationFooterProps, {}, "">;
8
11
  };
@@ -4,6 +4,9 @@ import Group from '../anatomy/group.svelte';
4
4
  import Header from '../anatomy/header.svelte';
5
5
  import Label from '../anatomy/label.svelte';
6
6
  import Menu from '../anatomy/menu.svelte';
7
+ import TriggerAnchor from '../anatomy/trigger-anchor.svelte';
8
+ import Trigger from '../anatomy/trigger.svelte';
9
+ import TriggerText from '../anatomy/trigger-text.svelte';
7
10
  import Root from '../anatomy/root.svelte';
8
11
  export const Navigation = Object.assign(Root, {
9
12
  Header: Header,
@@ -11,5 +14,8 @@ export const Navigation = Object.assign(Root, {
11
14
  Group: Group,
12
15
  Label: Label,
13
16
  Menu: Menu,
17
+ Trigger: Trigger,
18
+ TriggerAnchor: TriggerAnchor,
19
+ TriggerText: TriggerText,
14
20
  Footer: Footer,
15
21
  });
@@ -15,7 +15,7 @@
15
15
 
16
16
  const { element, children, ...rest } = $derived(props);
17
17
 
18
- const attributes = $derived(mergeProps(ratingGroup().getControlProps(), rest));
18
+ const attributes = $derived(mergeProps(ratingGroup().getLabelProps(), rest));
19
19
  </script>
20
20
 
21
21
  {#if element}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skeletonlabs/skeleton-svelte",
3
- "version": "4.7.3",
3
+ "version": "4.8.0",
4
4
  "description": "The Svelte package for Skeleton.",
5
5
  "author": "endigo9740 <chris@skeletonlabs.dev>",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  "@zag-js/toggle-group": "1.31.0",
49
49
  "@zag-js/tooltip": "1.31.0",
50
50
  "@zag-js/tree-view": "1.31.0",
51
- "@skeletonlabs/skeleton-common": "4.7.3"
51
+ "@skeletonlabs/skeleton-common": "4.8.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "svelte": "^5.29.0"