@skeletonlabs/skeleton-svelte 4.0.0-next.31 → 4.0.0-next.32
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/collapsible/anatomy/content.svelte +36 -0
- package/dist/components/collapsible/anatomy/content.svelte.d.ts +8 -0
- package/dist/components/collapsible/anatomy/indicator.svelte +36 -0
- package/dist/components/collapsible/anatomy/indicator.svelte.d.ts +8 -0
- package/dist/components/collapsible/anatomy/root-context.svelte +20 -0
- package/dist/components/collapsible/anatomy/root-context.svelte.d.ts +10 -0
- package/dist/components/collapsible/anatomy/root-provider.svelte +39 -0
- package/dist/components/collapsible/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/collapsible/anatomy/root.svelte +46 -0
- package/dist/components/collapsible/anatomy/root.svelte.d.ts +9 -0
- package/dist/components/collapsible/anatomy/trigger.svelte +36 -0
- package/dist/components/collapsible/anatomy/trigger.svelte.d.ts +8 -0
- package/dist/components/collapsible/index.d.ts +9 -0
- package/dist/components/collapsible/index.js +2 -0
- package/dist/components/collapsible/modules/anatomy.d.ts +8 -0
- package/dist/components/collapsible/modules/anatomy.js +13 -0
- package/dist/components/collapsible/modules/provider.svelte.d.ts +4 -0
- package/dist/components/collapsible/modules/provider.svelte.js +7 -0
- package/dist/components/collapsible/modules/root-context.d.ts +6 -0
- package/dist/components/collapsible/modules/root-context.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
|
|
5
|
+
export interface CollapsibleContentProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesCollapsible } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: CollapsibleContentProps = $props();
|
|
14
|
+
|
|
15
|
+
const collapsible = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
collapsible().getContentProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesCollapsible.content,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<div {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
export interface CollapsibleContentProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Content: import("svelte").Component<CollapsibleContentProps, {}, "">;
|
|
6
|
+
type Content = ReturnType<typeof Content>;
|
|
7
|
+
export default Content;
|
|
8
|
+
//# sourceMappingURL=content.svelte.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
|
|
5
|
+
export interface CollapsibleIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesCollapsible } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: CollapsibleIndicatorProps = $props();
|
|
14
|
+
|
|
15
|
+
const collapsible = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
collapsible().getIndicatorProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesCollapsible.indicator,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<div {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</div>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
export interface CollapsibleIndicatorProps extends PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Indicator: import("svelte").Component<CollapsibleIndicatorProps, {}, "">;
|
|
6
|
+
type Indicator = ReturnType<typeof Indicator>;
|
|
7
|
+
export default Indicator;
|
|
8
|
+
//# sourceMappingURL=indicator.svelte.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { useCollapsible } from '../modules/provider.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
export interface CollapsibleRootContextProps {
|
|
6
|
+
children: Snippet<[ReturnType<typeof useCollapsible>]>;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: CollapsibleRootContextProps = $props();
|
|
14
|
+
|
|
15
|
+
const collapsible = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { children } = $derived(props);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
{@render children(collapsible)}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { useCollapsible } from '../modules/provider.svelte';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export interface CollapsibleRootContextProps {
|
|
4
|
+
children: Snippet<[ReturnType<typeof useCollapsible>]>;
|
|
5
|
+
}
|
|
6
|
+
import { RootContext } from '../modules/root-context';
|
|
7
|
+
declare const RootContext: import("svelte").Component<CollapsibleRootContextProps, {}, "">;
|
|
8
|
+
type RootContext = ReturnType<typeof RootContext>;
|
|
9
|
+
export default RootContext;
|
|
10
|
+
//# sourceMappingURL=root-context.svelte.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { useCollapsible } from '../modules/provider.svelte';
|
|
3
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
4
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
5
|
+
|
|
6
|
+
export interface CollapsibleRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
7
|
+
value: ReturnType<typeof useCollapsible>;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { RootContext } from '../modules/root-context';
|
|
13
|
+
import { classesCollapsible } from '@skeletonlabs/skeleton-common';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: CollapsibleRootProviderProps = $props();
|
|
17
|
+
|
|
18
|
+
const { element, children, value: collapsible, ...rest } = $derived(props);
|
|
19
|
+
|
|
20
|
+
const attributes = $derived(
|
|
21
|
+
mergeProps(
|
|
22
|
+
collapsible().getRootProps(),
|
|
23
|
+
{
|
|
24
|
+
class: classesCollapsible.root,
|
|
25
|
+
},
|
|
26
|
+
rest,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
RootContext.provide(() => collapsible());
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#if element}
|
|
34
|
+
{@render element(attributes)}
|
|
35
|
+
{:else}
|
|
36
|
+
<div {...attributes}>
|
|
37
|
+
{@render children?.()}
|
|
38
|
+
</div>
|
|
39
|
+
{/if}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { useCollapsible } from '../modules/provider.svelte';
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
export interface CollapsibleRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useCollapsible>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<CollapsibleRootProviderProps, {}, "">;
|
|
8
|
+
type RootProvider = ReturnType<typeof RootProvider>;
|
|
9
|
+
export default RootProvider;
|
|
10
|
+
//# sourceMappingURL=root-provider.svelte.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
import type { Props } from '@zag-js/collapsible';
|
|
5
|
+
|
|
6
|
+
export interface CollapsibleRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { useCollapsible } from '../modules/provider.svelte';
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
import { classesCollapsible } from '@skeletonlabs/skeleton-common';
|
|
13
|
+
import { splitProps } from '@zag-js/collapsible';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: CollapsibleRootProps = $props();
|
|
17
|
+
|
|
18
|
+
const [collapsibleProps, componentProps] = $derived(splitProps(props));
|
|
19
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
20
|
+
|
|
21
|
+
const id = $props.id();
|
|
22
|
+
const collapsible = useCollapsible(() => ({
|
|
23
|
+
...collapsibleProps,
|
|
24
|
+
id: id,
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const attributes = $derived(
|
|
28
|
+
mergeProps(
|
|
29
|
+
collapsible().getRootProps(),
|
|
30
|
+
{
|
|
31
|
+
class: classesCollapsible.root,
|
|
32
|
+
},
|
|
33
|
+
rest,
|
|
34
|
+
),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
RootContext.provide(() => collapsible());
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
{#if element}
|
|
41
|
+
{@render element(attributes)}
|
|
42
|
+
{:else}
|
|
43
|
+
<div {...attributes}>
|
|
44
|
+
{@render children?.()}
|
|
45
|
+
</div>
|
|
46
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
import type { Props } from '@zag-js/collapsible';
|
|
4
|
+
export interface CollapsibleRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Root: import("svelte").Component<CollapsibleRootProps, {}, "">;
|
|
7
|
+
type Root = ReturnType<typeof Root>;
|
|
8
|
+
export default Root;
|
|
9
|
+
//# sourceMappingURL=root.svelte.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
|
|
5
|
+
export interface CollapsibleTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesCollapsible } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: CollapsibleTriggerProps = $props();
|
|
14
|
+
|
|
15
|
+
const collapsible = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
collapsible().getTriggerProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesCollapsible.trigger,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<button {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</button>
|
|
36
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
export interface CollapsibleTriggerProps extends PropsWithElement<'button'>, HTMLAttributes<'button'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Trigger: import("svelte").Component<CollapsibleTriggerProps, {}, "">;
|
|
6
|
+
type Trigger = ReturnType<typeof Trigger>;
|
|
7
|
+
export default Trigger;
|
|
8
|
+
//# sourceMappingURL=trigger.svelte.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type { CollapsibleContentProps } from './anatomy/content.svelte';
|
|
2
|
+
export type { CollapsibleRootProps } from './anatomy/root.svelte';
|
|
3
|
+
export type { CollapsibleRootContextProps } from './anatomy/root-context.svelte';
|
|
4
|
+
export type { CollapsibleRootProviderProps } from './anatomy/root-provider.svelte';
|
|
5
|
+
export type { CollapsibleTriggerProps } from './anatomy/trigger.svelte';
|
|
6
|
+
export type { CollapsibleIndicatorProps } from './anatomy/indicator.svelte';
|
|
7
|
+
export { Collapsible } from './modules/anatomy';
|
|
8
|
+
export { useCollapsible } from './modules/provider.svelte';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const Collapsible: import("svelte").Component<import("..").CollapsibleRootProps, {}, ""> & {
|
|
2
|
+
Provider: import("svelte").Component<import("..").CollapsibleRootProviderProps, {}, "">;
|
|
3
|
+
Context: import("svelte").Component<import("..").CollapsibleRootContextProps, {}, "">;
|
|
4
|
+
Trigger: import("svelte").Component<import("..").CollapsibleTriggerProps, {}, "">;
|
|
5
|
+
Indicator: import("svelte").Component<import("..").CollapsibleIndicatorProps, {}, "">;
|
|
6
|
+
Content: import("svelte").Component<import("..").CollapsibleContentProps, {}, "">;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=anatomy.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Content from '../anatomy/content.svelte';
|
|
2
|
+
import Indicator from '../anatomy/indicator.svelte';
|
|
3
|
+
import RootContext from '../anatomy/root-context.svelte';
|
|
4
|
+
import RootProvider from '../anatomy/root-provider.svelte';
|
|
5
|
+
import Root from '../anatomy/root.svelte';
|
|
6
|
+
import Trigger from '../anatomy/trigger.svelte';
|
|
7
|
+
export const Collapsible = Object.assign(Root, {
|
|
8
|
+
Provider: RootProvider,
|
|
9
|
+
Context: RootContext,
|
|
10
|
+
Trigger: Trigger,
|
|
11
|
+
Indicator: Indicator,
|
|
12
|
+
Content: Content,
|
|
13
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { connect, machine } from '@zag-js/collapsible';
|
|
2
|
+
import { normalizeProps, useMachine } from '@zag-js/svelte';
|
|
3
|
+
export function useCollapsible(props) {
|
|
4
|
+
const service = useMachine(machine, props);
|
|
5
|
+
const collapsible = $derived(connect(service, normalizeProps));
|
|
6
|
+
return () => collapsible;
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RootContext: {
|
|
2
|
+
key: symbol;
|
|
3
|
+
consume(): () => import("@zag-js/collapsible").Api<import("@zag-js/svelte").PropTypes>;
|
|
4
|
+
provide(value: () => import("@zag-js/collapsible").Api<import("@zag-js/svelte").PropTypes>): () => import("@zag-js/collapsible").Api<import("@zag-js/svelte").PropTypes>;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=root-context.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/accordion/index';
|
|
2
2
|
export * from './components/app-bar/index';
|
|
3
3
|
export * from './components/avatar/index';
|
|
4
|
+
export * from './components/collapsible/index';
|
|
4
5
|
export * from './components/combobox/index';
|
|
5
6
|
export * from './components/date-picker/index';
|
|
6
7
|
export * from './components/dialog/index';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './components/accordion/index';
|
|
2
2
|
export * from './components/app-bar/index';
|
|
3
3
|
export * from './components/avatar/index';
|
|
4
|
+
export * from './components/collapsible/index';
|
|
4
5
|
export * from './components/combobox/index';
|
|
5
6
|
export * from './components/date-picker/index';
|
|
6
7
|
export * from './components/dialog/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skeletonlabs/skeleton-svelte",
|
|
3
|
-
"version": "4.0.0-next.
|
|
3
|
+
"version": "4.0.0-next.32",
|
|
4
4
|
"description": "The Svelte package for Skeleton.",
|
|
5
5
|
"author": "endigo9740 <chris@skeletonlabs.dev>",
|
|
6
6
|
"repository": {
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@zag-js/accordion": "1.26.0",
|
|
26
26
|
"@zag-js/avatar": "1.26.0",
|
|
27
|
+
"@zag-js/collapsible": "1.26.0",
|
|
27
28
|
"@zag-js/collection": "1.26.0",
|
|
28
29
|
"@zag-js/combobox": "1.26.0",
|
|
29
30
|
"@zag-js/date-picker": "1.26.0",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"@zag-js/toast": "1.26.0",
|
|
44
45
|
"@zag-js/tooltip": "1.26.0",
|
|
45
46
|
"@zag-js/tree-view": "1.26.0",
|
|
46
|
-
"@skeletonlabs/skeleton-common": "4.0.0-next.
|
|
47
|
+
"@skeletonlabs/skeleton-common": "4.0.0-next.32"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"svelte": "^5.29.0"
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"typescript": "5.9.3",
|
|
61
62
|
"vite": "7.1.9",
|
|
62
63
|
"vitest": "3.2.4",
|
|
63
|
-
"@skeletonlabs/skeleton": "4.0.0-next.
|
|
64
|
+
"@skeletonlabs/skeleton": "4.0.0-next.32"
|
|
64
65
|
},
|
|
65
66
|
"license": "MIT",
|
|
66
67
|
"type": "module",
|