@skeletonlabs/skeleton-svelte 4.0.0-next.24 → 4.0.0-next.26
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/date-picker/modules/anatomy.d.ts +1 -1
- package/dist/components/date-picker/modules/anatomy.js +1 -1
- package/dist/components/listbox/anatomy/content.svelte +36 -0
- package/dist/components/listbox/anatomy/content.svelte.d.ts +8 -0
- package/dist/components/listbox/anatomy/content.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/input.svelte +34 -0
- package/dist/components/listbox/anatomy/input.svelte.d.ts +8 -0
- package/dist/components/listbox/anatomy/input.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-group-label.svelte +48 -0
- package/dist/components/listbox/anatomy/item-group-label.svelte.d.ts +9 -0
- package/dist/components/listbox/anatomy/item-group-label.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-group.svelte +48 -0
- package/dist/components/listbox/anatomy/item-group.svelte.d.ts +9 -0
- package/dist/components/listbox/anatomy/item-group.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-indicator.svelte +43 -0
- package/dist/components/listbox/anatomy/item-indicator.svelte.d.ts +8 -0
- package/dist/components/listbox/anatomy/item-indicator.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item-text.svelte +38 -0
- package/dist/components/listbox/anatomy/item-text.svelte.d.ts +8 -0
- package/dist/components/listbox/anatomy/item-text.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/item.svelte +42 -0
- package/dist/components/listbox/anatomy/item.svelte.d.ts +9 -0
- package/dist/components/listbox/anatomy/item.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/label.svelte +36 -0
- package/dist/components/listbox/anatomy/label.svelte.d.ts +8 -0
- package/dist/components/listbox/anatomy/label.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root-context.svelte +20 -0
- package/dist/components/listbox/anatomy/root-context.svelte.d.ts +10 -0
- package/dist/components/listbox/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root-provider.svelte +39 -0
- package/dist/components/listbox/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/listbox/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/listbox/anatomy/root.svelte +48 -0
- package/dist/components/listbox/anatomy/root.svelte.d.ts +9 -0
- package/dist/components/listbox/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/listbox/index.d.ts +14 -0
- package/dist/components/listbox/index.d.ts.map +1 -0
- package/dist/components/listbox/index.js +2 -0
- package/dist/components/listbox/modules/anatomy.d.ts +13 -0
- package/dist/components/listbox/modules/anatomy.d.ts.map +1 -0
- package/dist/components/listbox/modules/anatomy.js +23 -0
- package/dist/components/listbox/modules/item-context.d.ts +7 -0
- package/dist/components/listbox/modules/item-context.d.ts.map +1 -0
- package/dist/components/listbox/modules/item-context.js +2 -0
- package/dist/components/listbox/modules/item-group-context.d.ts +7 -0
- package/dist/components/listbox/modules/item-group-context.d.ts.map +1 -0
- package/dist/components/listbox/modules/item-group-context.js +2 -0
- package/dist/components/listbox/modules/provider.svelte.d.ts +4 -0
- package/dist/components/listbox/modules/provider.svelte.d.ts.map +1 -0
- package/dist/components/listbox/modules/provider.svelte.js +7 -0
- package/dist/components/listbox/modules/root-context.d.ts +6 -0
- package/dist/components/listbox/modules/root-context.d.ts.map +1 -0
- package/dist/components/listbox/modules/root-context.js +2 -0
- package/dist/components/popover/index.d.ts +2 -0
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/modules/anatomy.d.ts +2 -2
- package/dist/components/toast/index.d.ts +1 -0
- package/dist/components/toast/index.d.ts.map +1 -1
- package/dist/components/toast/modules/anatomy.d.ts +1 -1
- package/dist/components/tree-view/anatomy/branch-content.svelte +38 -0
- package/dist/components/tree-view/anatomy/branch-content.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch-content.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-control.svelte +38 -0
- package/dist/components/tree-view/anatomy/branch-control.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch-control.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.svelte +38 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch-indent-guide.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-indicator.svelte +43 -0
- package/dist/components/tree-view/anatomy/branch-indicator.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch-indicator.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch-text.svelte +38 -0
- package/dist/components/tree-view/anatomy/branch-text.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch-text.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/branch.svelte +38 -0
- package/dist/components/tree-view/anatomy/branch.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/branch.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/item.svelte +38 -0
- package/dist/components/tree-view/anatomy/item.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/item.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/label.svelte +45 -0
- package/dist/components/tree-view/anatomy/label.svelte.d.ts +14 -0
- package/dist/components/tree-view/anatomy/label.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/node-provider.svelte +20 -0
- package/dist/components/tree-view/anatomy/node-provider.svelte.d.ts +9 -0
- package/dist/components/tree-view/anatomy/node-provider.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root-context.svelte +20 -0
- package/dist/components/tree-view/anatomy/root-context.svelte.d.ts +10 -0
- package/dist/components/tree-view/anatomy/root-context.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root-provider.svelte +39 -0
- package/dist/components/tree-view/anatomy/root-provider.svelte.d.ts +10 -0
- package/dist/components/tree-view/anatomy/root-provider.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/root.svelte +45 -0
- package/dist/components/tree-view/anatomy/root.svelte.d.ts +9 -0
- package/dist/components/tree-view/anatomy/root.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/anatomy/tree.svelte +36 -0
- package/dist/components/tree-view/anatomy/tree.svelte.d.ts +8 -0
- package/dist/components/tree-view/anatomy/tree.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/index.d.ts +17 -0
- package/dist/components/tree-view/index.d.ts.map +1 -0
- package/dist/components/tree-view/index.js +3 -0
- package/dist/components/tree-view/modules/anatomy.d.ts +15 -0
- package/dist/components/tree-view/modules/anatomy.d.ts.map +1 -0
- package/dist/components/tree-view/modules/anatomy.js +27 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.d.ts +3 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.d.ts.map +1 -0
- package/dist/components/tree-view/modules/create-tree-view-collection.js +4 -0
- package/dist/components/tree-view/modules/node-context.d.ts +7 -0
- package/dist/components/tree-view/modules/node-context.d.ts.map +1 -0
- package/dist/components/tree-view/modules/node-context.js +2 -0
- package/dist/components/tree-view/modules/provider.svelte.d.ts +4 -0
- package/dist/components/tree-view/modules/provider.svelte.d.ts.map +1 -0
- package/dist/components/tree-view/modules/provider.svelte.js +7 -0
- package/dist/components/tree-view/modules/root-context.d.ts +6 -0
- package/dist/components/tree-view/modules/root-context.d.ts.map +1 -0
- package/dist/components/tree-view/modules/root-context.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/package.json +9 -9
|
@@ -3,6 +3,7 @@ export declare const DatePicker: import("svelte").Component<import("..").DatePic
|
|
|
3
3
|
Context: import("svelte").Component<import("..").DatePickerRootContextProps, {}, "">;
|
|
4
4
|
Label: import("svelte").Component<import("..").DatePickerLabelProps, {}, "">;
|
|
5
5
|
Control: import("svelte").Component<import("..").DatePickerControlProps, {}, "">;
|
|
6
|
+
PresetTrigger: import("svelte").Component<import("..").DatePickerPresetTriggerProps, {}, "">;
|
|
6
7
|
Input: import("svelte").Component<import("..").DatePickerInputProps, {}, "">;
|
|
7
8
|
Trigger: import("svelte").Component<import("..").DatePickerTriggerProps, {}, "">;
|
|
8
9
|
Positioner: import("svelte").Component<import("..").DatePickerPositionerProps, {}, "">;
|
|
@@ -22,6 +23,5 @@ export declare const DatePicker: import("svelte").Component<import("..").DatePic
|
|
|
22
23
|
TableBody: import("svelte").Component<import("..").DatePickerTableBodyProps, {}, "">;
|
|
23
24
|
TableCell: import("svelte").Component<import("..").DatePickerTableCellProps, {}, "">;
|
|
24
25
|
TableCellTrigger: import("svelte").Component<import("..").DatePickerTableCellTriggerProps, {}, "">;
|
|
25
|
-
PresetTrigger: import("svelte").Component<import("..").DatePickerPresetTriggerProps, {}, "">;
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=anatomy.d.ts.map
|
|
@@ -28,6 +28,7 @@ export const DatePicker = Object.assign(Root, {
|
|
|
28
28
|
Context: RootContext,
|
|
29
29
|
Label: Label,
|
|
30
30
|
Control: Control,
|
|
31
|
+
PresetTrigger: PresetTrigger,
|
|
31
32
|
Input: Input,
|
|
32
33
|
Trigger: Trigger,
|
|
33
34
|
Positioner: Positioner,
|
|
@@ -47,5 +48,4 @@ export const DatePicker = Object.assign(Root, {
|
|
|
47
48
|
TableBody: TableBody,
|
|
48
49
|
TableCell: TableCell,
|
|
49
50
|
TableCellTrigger: TableCellTrigger,
|
|
50
|
-
PresetTrigger: PresetTrigger,
|
|
51
51
|
});
|
|
@@ -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 ListboxContentProps extends PropsWithElement<'ul'>, HTMLAttributes<'ul'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: ListboxContentProps = $props();
|
|
14
|
+
|
|
15
|
+
const listbox = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
listbox().getContentProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesListbox.content,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<ul {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</ul>
|
|
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 ListboxContentProps extends PropsWithElement<'ul'>, HTMLAttributes<'ul'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Content: import("svelte").Component<ListboxContentProps, {}, "">;
|
|
6
|
+
type Content = ReturnType<typeof Content>;
|
|
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/listbox/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,mBAAoB,SAAQ,gBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;CAAG;AAyC7F,QAAA,MAAM,OAAO,yDAAwC,CAAC;AACtD,KAAK,OAAO,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAC1C,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 ListboxInputProps extends PropsWithElement<'input'>, HTMLAttributes<'input'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: ListboxInputProps = $props();
|
|
14
|
+
|
|
15
|
+
const listbox = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
listbox().getInputProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesListbox.input,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<input {...attributes} />
|
|
34
|
+
{/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 ListboxInputProps extends PropsWithElement<'input'>, HTMLAttributes<'input'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Input: import("svelte").Component<ListboxInputProps, {}, "">;
|
|
6
|
+
type Input = ReturnType<typeof Input>;
|
|
7
|
+
export default Input;
|
|
8
|
+
//# sourceMappingURL=input.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/input.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,iBAAkB,SAAQ,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;CAAG;AAuCjG,QAAA,MAAM,KAAK,uDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 ListboxItemGroupLabelProps
|
|
6
|
+
extends Omit<ItemGroupLabelProps, 'htmlFor'>,
|
|
7
|
+
PropsWithElement<'div'>,
|
|
8
|
+
HTMLAttributes<'div'> {}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { ItemGroupContext } from '../modules/item-group-context';
|
|
13
|
+
import { RootContext } from '../modules/root-context';
|
|
14
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
15
|
+
import { type ItemGroupLabelProps, splitItemGroupLabelProps } from '@zag-js/listbox';
|
|
16
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
17
|
+
|
|
18
|
+
const props: ListboxItemGroupLabelProps = $props();
|
|
19
|
+
|
|
20
|
+
const listbox = RootContext.consume();
|
|
21
|
+
const itemGroupProps = ItemGroupContext.consume();
|
|
22
|
+
|
|
23
|
+
const [itemGroupLabelProps] = $derived(
|
|
24
|
+
splitItemGroupLabelProps({
|
|
25
|
+
htmlFor: itemGroupProps().id,
|
|
26
|
+
...props,
|
|
27
|
+
}),
|
|
28
|
+
);
|
|
29
|
+
const { element, children, ...rest } = $derived(props);
|
|
30
|
+
|
|
31
|
+
const attributes = $derived(
|
|
32
|
+
mergeProps(
|
|
33
|
+
listbox().getItemGroupLabelProps(itemGroupLabelProps),
|
|
34
|
+
{
|
|
35
|
+
class: classesListbox.itemGroupLabel,
|
|
36
|
+
},
|
|
37
|
+
rest,
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
{#if element}
|
|
43
|
+
{@render element(attributes)}
|
|
44
|
+
{:else}
|
|
45
|
+
<div {...attributes}>
|
|
46
|
+
{@render children?.()}
|
|
47
|
+
</div>
|
|
48
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
2
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
3
|
+
export interface ListboxItemGroupLabelProps extends Omit<ItemGroupLabelProps, 'htmlFor'>, PropsWithElement<'div'>, HTMLAttributes<'div'> {
|
|
4
|
+
}
|
|
5
|
+
import { type ItemGroupLabelProps } from '@zag-js/listbox';
|
|
6
|
+
declare const ItemGroupLabel: import("svelte").Component<ListboxItemGroupLabelProps, {}, "">;
|
|
7
|
+
type ItemGroupLabel = ReturnType<typeof ItemGroupLabel>;
|
|
8
|
+
export default ItemGroupLabel;
|
|
9
|
+
//# sourceMappingURL=item-group-label.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-group-label.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/item-group-label.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,0BAChB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAC3C,gBAAgB,CAAC,KAAK,CAAC,EACvB,cAAc,CAAC,KAAK,CAAC;CAAG;AAM3B,OAAO,EAAE,KAAK,mBAAmB,EAA4B,MAAM,iBAAiB,CAAC;AA8CrF,QAAA,MAAM,cAAc,gEAAwC,CAAC;AAC7D,KAAK,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACxD,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 { ItemGroupProps } from '@zag-js/listbox';
|
|
5
|
+
|
|
6
|
+
export interface ListboxItemGroupProps extends Omit<ItemGroupProps, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { ItemGroupContext } from '../modules/item-group-context';
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
13
|
+
import { splitItemGroupProps } from '@zag-js/listbox';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: ListboxItemGroupProps = $props();
|
|
17
|
+
|
|
18
|
+
const listbox = RootContext.consume();
|
|
19
|
+
|
|
20
|
+
const id = $props.id();
|
|
21
|
+
const [itemGroupProps, componentProps] = $derived(
|
|
22
|
+
splitItemGroupProps({
|
|
23
|
+
id: id,
|
|
24
|
+
...props,
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
28
|
+
|
|
29
|
+
const attributes = $derived(
|
|
30
|
+
mergeProps(
|
|
31
|
+
listbox().getItemGroupProps(itemGroupProps),
|
|
32
|
+
{
|
|
33
|
+
class: classesListbox.itemGroup,
|
|
34
|
+
},
|
|
35
|
+
rest,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
ItemGroupContext.provide(() => itemGroupProps);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
{#if element}
|
|
43
|
+
{@render element(attributes)}
|
|
44
|
+
{:else}
|
|
45
|
+
<div {...attributes}>
|
|
46
|
+
{@render children?.()}
|
|
47
|
+
</div>
|
|
48
|
+
{/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 { ItemGroupProps } from '@zag-js/listbox';
|
|
4
|
+
export interface ListboxItemGroupProps extends Omit<ItemGroupProps, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id'> {
|
|
5
|
+
}
|
|
6
|
+
declare const ItemGroup: import("svelte").Component<ListboxItemGroupProps, {}, "">;
|
|
7
|
+
type ItemGroup = ReturnType<typeof ItemGroup>;
|
|
8
|
+
export default ItemGroup;
|
|
9
|
+
//# sourceMappingURL=item-group.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-group.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/item-group.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC;CAAG;AAsDnI,QAAA,MAAM,SAAS,2DAAwC,CAAC;AACxD,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC;AAC9C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
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 ListboxItemIndicatorProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ItemContext } from '../modules/item-context';
|
|
10
|
+
import { RootContext } from '../modules/root-context';
|
|
11
|
+
import Check from '../../../internal/components/check.svelte';
|
|
12
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
13
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
14
|
+
|
|
15
|
+
const props: ListboxItemIndicatorProps = $props();
|
|
16
|
+
|
|
17
|
+
const listbox = RootContext.consume();
|
|
18
|
+
const itemProps = ItemContext.consume();
|
|
19
|
+
|
|
20
|
+
const { element, children = check, ...rest } = $derived(props);
|
|
21
|
+
|
|
22
|
+
const attributes = $derived(
|
|
23
|
+
mergeProps(
|
|
24
|
+
listbox().getItemIndicatorProps(itemProps()),
|
|
25
|
+
{
|
|
26
|
+
class: classesListbox.itemIndicator,
|
|
27
|
+
},
|
|
28
|
+
rest,
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
{#snippet check()}
|
|
34
|
+
<Check class="size-4" />
|
|
35
|
+
{/snippet}
|
|
36
|
+
|
|
37
|
+
{#if element}
|
|
38
|
+
{@render element(attributes)}
|
|
39
|
+
{:else}
|
|
40
|
+
<span {...attributes}>
|
|
41
|
+
{@render children?.()}
|
|
42
|
+
</span>
|
|
43
|
+
{/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 ListboxItemIndicatorProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {
|
|
4
|
+
}
|
|
5
|
+
declare const ItemIndicator: import("svelte").Component<ListboxItemIndicatorProps, {}, "">;
|
|
6
|
+
type ItemIndicator = ReturnType<typeof ItemIndicator>;
|
|
7
|
+
export default ItemIndicator;
|
|
8
|
+
//# sourceMappingURL=item-indicator.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-indicator.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/item-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,yBAA0B,SAAQ,gBAAgB,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;CAAG;AAkDvG,QAAA,MAAM,aAAa,+DAAwC,CAAC;AAC5D,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 ListboxItemTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { ItemContext } from '../modules/item-context';
|
|
10
|
+
import { RootContext } from '../modules/root-context';
|
|
11
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
12
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
13
|
+
|
|
14
|
+
const props: ListboxItemTextProps = $props();
|
|
15
|
+
|
|
16
|
+
const listbox = RootContext.consume();
|
|
17
|
+
const itemProps = ItemContext.consume();
|
|
18
|
+
|
|
19
|
+
const { element, children, ...rest } = $derived(props);
|
|
20
|
+
|
|
21
|
+
const attributes = $derived(
|
|
22
|
+
mergeProps(
|
|
23
|
+
listbox().getItemTextProps(itemProps()),
|
|
24
|
+
{
|
|
25
|
+
class: classesListbox.itemText,
|
|
26
|
+
},
|
|
27
|
+
rest,
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
{#if element}
|
|
33
|
+
{@render element(attributes)}
|
|
34
|
+
{:else}
|
|
35
|
+
<span {...attributes}>
|
|
36
|
+
{@render children?.()}
|
|
37
|
+
</span>
|
|
38
|
+
{/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 ListboxItemTextProps extends PropsWithElement<'span'>, HTMLAttributes<'span'> {
|
|
4
|
+
}
|
|
5
|
+
declare const ItemText: import("svelte").Component<ListboxItemTextProps, {}, "">;
|
|
6
|
+
type ItemText = ReturnType<typeof ItemText>;
|
|
7
|
+
export default ItemText;
|
|
8
|
+
//# sourceMappingURL=item-text.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-text.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/item-text.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,oBAAqB,SAAQ,gBAAgB,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC;CAAG;AA4ClG,QAAA,MAAM,QAAQ,0DAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { ItemProps } from '@zag-js/listbox';
|
|
5
|
+
|
|
6
|
+
export interface ListboxItemProps extends ItemProps, PropsWithElement<'li'>, HTMLAttributes<'li'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { ItemContext } from '../modules/item-context';
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
13
|
+
import { splitItemProps } from '@zag-js/listbox';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: ListboxItemProps = $props();
|
|
17
|
+
|
|
18
|
+
const listbox = RootContext.consume();
|
|
19
|
+
|
|
20
|
+
const [itemProps, componentProps] = $derived(splitItemProps(props));
|
|
21
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
22
|
+
|
|
23
|
+
const attributes = $derived(
|
|
24
|
+
mergeProps(
|
|
25
|
+
listbox().getItemProps(itemProps),
|
|
26
|
+
{
|
|
27
|
+
class: classesListbox.item,
|
|
28
|
+
},
|
|
29
|
+
rest,
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
ItemContext.provide(() => itemProps);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
{#if element}
|
|
37
|
+
{@render element(attributes)}
|
|
38
|
+
{:else}
|
|
39
|
+
<li {...attributes}>
|
|
40
|
+
{@render children?.()}
|
|
41
|
+
</li>
|
|
42
|
+
{/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 { ItemProps } from '@zag-js/listbox';
|
|
4
|
+
export interface ListboxItemProps extends ItemProps, PropsWithElement<'li'>, HTMLAttributes<'li'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Item: import("svelte").Component<ListboxItemProps, {}, "">;
|
|
7
|
+
type Item = ReturnType<typeof Item>;
|
|
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/listbox/anatomy/item.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC;CAAG;AAgDrG,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -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 ListboxLabelProps extends PropsWithElement<'label'>, HTMLAttributes<'label'> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { RootContext } from '../modules/root-context';
|
|
10
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
11
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
12
|
+
|
|
13
|
+
const props: ListboxLabelProps = $props();
|
|
14
|
+
|
|
15
|
+
const listbox = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { element, children, ...rest } = $derived(props);
|
|
18
|
+
|
|
19
|
+
const attributes = $derived(
|
|
20
|
+
mergeProps(
|
|
21
|
+
listbox().getLabelProps(),
|
|
22
|
+
{
|
|
23
|
+
class: classesListbox.label,
|
|
24
|
+
},
|
|
25
|
+
rest,
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
{#if element}
|
|
31
|
+
{@render element(attributes)}
|
|
32
|
+
{:else}
|
|
33
|
+
<label {...attributes}>
|
|
34
|
+
{@render children?.()}
|
|
35
|
+
</label>
|
|
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 ListboxLabelProps extends PropsWithElement<'label'>, HTMLAttributes<'label'> {
|
|
4
|
+
}
|
|
5
|
+
declare const Label: import("svelte").Component<ListboxLabelProps, {}, "">;
|
|
6
|
+
type Label = ReturnType<typeof Label>;
|
|
7
|
+
export default Label;
|
|
8
|
+
//# sourceMappingURL=label.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/label.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,iBAAkB,SAAQ,gBAAgB,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC;CAAG;AAyCjG,QAAA,MAAM,KAAK,uDAAwC,CAAC;AACpD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { useListbox } from '../modules/provider.svelte';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
4
|
+
|
|
5
|
+
export interface ListboxRootContextProps {
|
|
6
|
+
children: Snippet<[ReturnType<typeof useListbox>]>;
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<script lang="ts">
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
|
|
13
|
+
const props: ListboxRootContextProps = $props();
|
|
14
|
+
|
|
15
|
+
const listbox = RootContext.consume();
|
|
16
|
+
|
|
17
|
+
const { children } = $derived(props);
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
{@render children(listbox)}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { useListbox } from '../modules/provider.svelte';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
export interface ListboxRootContextProps {
|
|
4
|
+
children: Snippet<[ReturnType<typeof useListbox>]>;
|
|
5
|
+
}
|
|
6
|
+
import { RootContext } from '../modules/root-context';
|
|
7
|
+
declare const RootContext: import("svelte").Component<ListboxRootContextProps, {}, "">;
|
|
8
|
+
type RootContext = ReturnType<typeof RootContext>;
|
|
9
|
+
export default RootContext;
|
|
10
|
+
//# sourceMappingURL=root-context.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-context.svelte.d.ts","sourceRoot":"","sources":["../../../../src/components/listbox/anatomy/root-context.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;CACnD;AAGF,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAkBtD,QAAA,MAAM,WAAW,6DAAwC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { useListbox } 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 ListboxRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
7
|
+
value: ReturnType<typeof useListbox>;
|
|
8
|
+
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { RootContext } from '../modules/root-context';
|
|
13
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: ListboxRootProviderProps = $props();
|
|
17
|
+
|
|
18
|
+
const { element, children, value: listbox, ...rest } = $derived(props);
|
|
19
|
+
|
|
20
|
+
const attributes = $derived(
|
|
21
|
+
mergeProps(
|
|
22
|
+
listbox().getRootProps(),
|
|
23
|
+
{
|
|
24
|
+
class: classesListbox.root,
|
|
25
|
+
},
|
|
26
|
+
rest,
|
|
27
|
+
),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
RootContext.provide(() => listbox());
|
|
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 { useListbox } from '../modules/provider.svelte';
|
|
2
|
+
import type { HTMLAttributes } from '../../../internal/html-attributes';
|
|
3
|
+
import type { PropsWithElement } from '../../../internal/props-with-element';
|
|
4
|
+
export interface ListboxRootProviderProps extends PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
value: ReturnType<typeof useListbox>;
|
|
6
|
+
}
|
|
7
|
+
declare const RootProvider: import("svelte").Component<ListboxRootProviderProps, {}, "">;
|
|
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/listbox/anatomy/root-provider.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;IAC7G,KAAK,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;CACrC;AAyCF,QAAA,MAAM,YAAY,8DAAwC,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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/listbox';
|
|
5
|
+
|
|
6
|
+
export interface ListboxRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { useListbox } from '../modules/provider.svelte';
|
|
11
|
+
import { RootContext } from '../modules/root-context';
|
|
12
|
+
import { classesListbox } from '@skeletonlabs/skeleton-common';
|
|
13
|
+
import { splitProps } from '@zag-js/listbox';
|
|
14
|
+
import { mergeProps } from '@zag-js/svelte';
|
|
15
|
+
|
|
16
|
+
const props: ListboxRootProps = $props();
|
|
17
|
+
const [listboxProps, componentProps] = $derived(splitProps(props));
|
|
18
|
+
const { element, children, ...rest } = $derived(componentProps);
|
|
19
|
+
|
|
20
|
+
const id = $props.id();
|
|
21
|
+
const listbox = useListbox(
|
|
22
|
+
() =>
|
|
23
|
+
({
|
|
24
|
+
id: id,
|
|
25
|
+
...listboxProps,
|
|
26
|
+
}) as Props,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const attributes = $derived(
|
|
30
|
+
mergeProps(
|
|
31
|
+
listbox().getRootProps(),
|
|
32
|
+
{
|
|
33
|
+
class: classesListbox.root,
|
|
34
|
+
},
|
|
35
|
+
rest,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
RootContext.provide(() => listbox());
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
{#if element}
|
|
43
|
+
{@render element(attributes)}
|
|
44
|
+
{:else}
|
|
45
|
+
<div {...attributes}>
|
|
46
|
+
{@render children?.()}
|
|
47
|
+
</div>
|
|
48
|
+
{/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/listbox';
|
|
4
|
+
export interface ListboxRootProps extends Omit<Props, 'id'>, PropsWithElement<'div'>, HTMLAttributes<'div', 'id' | 'dir'> {
|
|
5
|
+
}
|
|
6
|
+
declare const Root: import("svelte").Component<ListboxRootProps, {}, "">;
|
|
7
|
+
type Root = ReturnType<typeof Root>;
|
|
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/listbox/anatomy/root.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,KAAK,CAAC;CAAG;AAsD7H,QAAA,MAAM,IAAI,sDAAwC,CAAC;AACnD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC;AACpC,eAAe,IAAI,CAAC"}
|