@ark-ui/svelte 5.6.0 → 5.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.
- package/dist/components/combobox/combobox-empty.svelte +23 -0
- package/dist/components/combobox/combobox-empty.svelte.d.ts +8 -0
- package/dist/components/combobox/combobox-root-provider.svelte +4 -0
- package/dist/components/combobox/combobox-root-provider.svelte.d.ts +1 -0
- package/dist/components/combobox/combobox-root.svelte +5 -0
- package/dist/components/combobox/combobox-root.svelte.d.ts +2 -0
- package/dist/components/combobox/combobox.anatomy.d.ts +1 -1
- package/dist/components/combobox/combobox.anatomy.js +2 -1
- package/dist/components/combobox/combobox.d.ts +3 -2
- package/dist/components/combobox/combobox.js +1 -0
- package/dist/components/combobox/index.d.ts +3 -2
- package/dist/components/combobox/index.js +2 -1
- package/dist/components/field/use-field.svelte.js +1 -0
- package/dist/components/listbox/index.d.ts +3 -2
- package/dist/components/listbox/index.js +2 -1
- package/dist/components/listbox/listbox-empty.svelte +23 -0
- package/dist/components/listbox/listbox-empty.svelte.d.ts +8 -0
- package/dist/components/listbox/listbox-root-provider.svelte +6 -0
- package/dist/components/listbox/listbox-root-provider.svelte.d.ts +2 -0
- package/dist/components/listbox/listbox-root.svelte +16 -6
- package/dist/components/listbox/listbox-root.svelte.d.ts +3 -1
- package/dist/components/listbox/listbox.anatomy.d.ts +1 -1
- package/dist/components/listbox/listbox.anatomy.js +2 -1
- package/dist/components/listbox/listbox.d.ts +3 -2
- package/dist/components/listbox/listbox.js +1 -0
- package/dist/components/menu/menu-root.svelte +1 -0
- package/dist/components/menu/menu-trigger-item.svelte +3 -0
- package/dist/components/select/index.d.ts +2 -2
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select-root-provider.svelte +5 -0
- package/dist/components/select/select-root-provider.svelte.d.ts +2 -0
- package/dist/components/select/select-root.svelte +3 -0
- package/dist/components/select/select-root.svelte.d.ts +2 -0
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/tree-view/index.d.ts +2 -2
- package/dist/components/tree-view/index.js +1 -1
- package/dist/components/tree-view/tree-view-root-provider.svelte +5 -0
- package/dist/components/tree-view/tree-view-root-provider.svelte.d.ts +2 -0
- package/dist/components/tree-view/tree-view-root.svelte +3 -0
- package/dist/components/tree-view/tree-view-root.svelte.d.ts +2 -0
- package/dist/components/tree-view/tree-view.d.ts +2 -2
- package/dist/lucide-optimize.d.ts +34 -0
- package/dist/lucide-optimize.js +89 -0
- package/package.json +75 -72
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface ComboboxEmptyBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
+
export interface ComboboxEmptyProps extends Assign<HTMLProps<'div'>, ComboboxEmptyBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { Ark } from '../factory'
|
|
10
|
+
import { comboboxAnatomy } from './combobox.anatomy'
|
|
11
|
+
import { useComboboxContext } from './use-combobox-context'
|
|
12
|
+
|
|
13
|
+
const parts = comboboxAnatomy.build()
|
|
14
|
+
|
|
15
|
+
let { ref = $bindable(null), ...props }: ComboboxEmptyProps = $props()
|
|
16
|
+
|
|
17
|
+
const combobox = useComboboxContext()
|
|
18
|
+
const isEmpty = $derived(combobox().collection.size === 0)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if isEmpty}
|
|
22
|
+
<Ark as="div" bind:ref {...parts.empty.attrs} {...props} role="presentation" />
|
|
23
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface ComboboxEmptyBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface ComboboxEmptyProps extends Assign<HTMLProps<'div'>, ComboboxEmptyBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const ComboboxEmpty: import("svelte").Component<ComboboxEmptyProps, {}, "ref">;
|
|
7
|
+
type ComboboxEmpty = ReturnType<typeof ComboboxEmpty>;
|
|
8
|
+
export default ComboboxEmpty;
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
}
|
|
19
19
|
export interface ComboboxRootProviderProps<T extends CollectionItem>
|
|
20
20
|
extends Assign<HTMLProps<'div'>, ComboboxRootProviderBaseProps<T>> {}
|
|
21
|
+
|
|
22
|
+
export type ComboboxRootProviderComponent<P = {}> = <T extends CollectionItem>(
|
|
23
|
+
props: Assign<ComboboxRootProviderProps<T>, P>,
|
|
24
|
+
) => Snippet
|
|
21
25
|
</script>
|
|
22
26
|
|
|
23
27
|
<script lang="ts" generics="T extends CollectionItem">
|
|
@@ -11,6 +11,7 @@ export interface ComboboxRootProviderBaseProps<T extends CollectionItem> extends
|
|
|
11
11
|
}
|
|
12
12
|
export interface ComboboxRootProviderProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ComboboxRootProviderBaseProps<T>> {
|
|
13
13
|
}
|
|
14
|
+
export type ComboboxRootProviderComponent<P = {}> = <T extends CollectionItem>(props: Assign<ComboboxRootProviderProps<T>, P>) => Snippet;
|
|
14
15
|
declare function $$render<T extends CollectionItem>(): {
|
|
15
16
|
props: ComboboxRootProviderProps<T>;
|
|
16
17
|
exports: {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
3
4
|
import type { CollectionItem } from '../collection'
|
|
4
5
|
import type { UsePresenceProps } from '../presence'
|
|
5
6
|
import type { UseComboboxProps } from './use-combobox.svelte'
|
|
@@ -12,6 +13,10 @@
|
|
|
12
13
|
|
|
13
14
|
export interface ComboboxRootProps<T extends CollectionItem>
|
|
14
15
|
extends Assign<HTMLProps<'div'>, ComboboxRootBaseProps<T>> {}
|
|
16
|
+
|
|
17
|
+
export type ComboboxRootComponent<P = {}> = <T extends CollectionItem>(
|
|
18
|
+
props: Assign<ComboboxRootProps<T>, P>,
|
|
19
|
+
) => Snippet
|
|
15
20
|
</script>
|
|
16
21
|
|
|
17
22
|
<script lang="ts" generics="T extends CollectionItem">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { CollectionItem } from '../collection';
|
|
3
4
|
import type { UsePresenceProps } from '../presence';
|
|
4
5
|
import type { UseComboboxProps } from './use-combobox.svelte';
|
|
@@ -6,6 +7,7 @@ export interface ComboboxRootBaseProps<T extends CollectionItem> extends UseComb
|
|
|
6
7
|
}
|
|
7
8
|
export interface ComboboxRootProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ComboboxRootBaseProps<T>> {
|
|
8
9
|
}
|
|
10
|
+
export type ComboboxRootComponent<P = {}> = <T extends CollectionItem>(props: Assign<ComboboxRootProps<T>, P>) => Snippet;
|
|
9
11
|
declare function $$render<T extends CollectionItem>(): {
|
|
10
12
|
props: ComboboxRootProps<T>;
|
|
11
13
|
exports: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const comboboxAnatomy: import("@zag-js/anatomy").AnatomyInstance<"input" | "label" | "list" | "root" | "content" | "trigger" | "control" | "positioner" | "clearTrigger" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "empty">;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { anatomy } from '@zag-js/combobox';
|
|
2
|
+
export const comboboxAnatomy = anatomy.extendWith('empty');
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { HighlightChangeDetails, InputValueChangeDetails, OpenChangeDetails, SelectionDetails, ValueChangeDetails, } from '@zag-js/combobox';
|
|
2
2
|
export { default as ClearTrigger, type ComboboxClearTriggerProps as ClearTriggerProps, type ComboboxClearTriggerBaseProps as ClearTriggerBaseProps, } from './combobox-clear-trigger.svelte';
|
|
3
3
|
export { default as Content, type ComboboxContentProps as ContentProps, type ComboboxContentBaseProps as ContentBaseProps, } from './combobox-content.svelte';
|
|
4
|
+
export { default as Empty, type ComboboxEmptyProps as EmptyProps, type ComboboxEmptyBaseProps as EmptyBaseProps, } from './combobox-empty.svelte';
|
|
4
5
|
export { default as Context, type ComboboxContextProps as ContextProps } from './combobox-context.svelte';
|
|
5
6
|
export { default as Control, type ComboboxControlProps as ControlProps, type ComboboxControlBaseProps as ControlBaseProps, } from './combobox-control.svelte';
|
|
6
7
|
export { default as Input, type ComboboxInputProps as InputProps, type ComboboxInputBaseProps as InputBaseProps, } from './combobox-input.svelte';
|
|
@@ -13,6 +14,6 @@ export { default as ItemText, type ComboboxItemTextProps as ItemTextProps, type
|
|
|
13
14
|
export { default as Label, type ComboboxLabelProps as LabelProps, type ComboboxLabelBaseProps as LabelBaseProps, } from './combobox-label.svelte';
|
|
14
15
|
export { default as List, type ComboboxListProps as ListProps, type ComboboxListBaseProps as ListBaseProps, } from './combobox-list.svelte';
|
|
15
16
|
export { default as Positioner, type ComboboxPositionerProps, type ComboboxPositionerBaseProps, } from './combobox-positioner.svelte';
|
|
16
|
-
export { default as Root, type ComboboxRootBaseProps as RootBaseProps, type ComboboxRootProps as RootProps, } from './combobox-root.svelte';
|
|
17
|
-
export { default as RootProvider, type ComboboxRootProviderBaseProps as RootProviderBaseProps, type ComboboxRootProviderProps as RootProviderProps, } from './combobox-root-provider.svelte';
|
|
17
|
+
export { default as Root, type ComboboxRootBaseProps as RootBaseProps, type ComboboxRootProps as RootProps, type ComboboxRootComponent as RootComponent, } from './combobox-root.svelte';
|
|
18
|
+
export { default as RootProvider, type ComboboxRootProviderBaseProps as RootProviderBaseProps, type ComboboxRootProviderProps as RootProviderProps, type ComboboxRootProviderComponent as RootProviderComponent, } from './combobox-root-provider.svelte';
|
|
18
19
|
export { default as Trigger, type ComboboxTriggerProps as TriggerProps, type ComboboxTriggerBaseProps as TriggerBaseProps, } from './combobox-trigger.svelte';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ClearTrigger, } from './combobox-clear-trigger.svelte';
|
|
2
2
|
export { default as Content, } from './combobox-content.svelte';
|
|
3
|
+
export { default as Empty, } from './combobox-empty.svelte';
|
|
3
4
|
export { default as Context } from './combobox-context.svelte';
|
|
4
5
|
export { default as Control, } from './combobox-control.svelte';
|
|
5
6
|
export { default as Input, } from './combobox-input.svelte';
|
|
@@ -2,6 +2,7 @@ export type { HighlightChangeDetails as ComboboxHighlightChangeDetails, InputVal
|
|
|
2
2
|
export { createListCollection, useListCollection, type CollectionItem, type ListCollection, type UseListCollectionProps, } from '../collection';
|
|
3
3
|
export { default as ComboboxClearTrigger, type ComboboxClearTriggerProps, type ComboboxClearTriggerBaseProps, } from './combobox-clear-trigger.svelte';
|
|
4
4
|
export { default as ComboboxContent, type ComboboxContentProps, type ComboboxContentBaseProps, } from './combobox-content.svelte';
|
|
5
|
+
export { default as ComboboxEmpty, type ComboboxEmptyProps, type ComboboxEmptyBaseProps } from './combobox-empty.svelte';
|
|
5
6
|
export { default as ComboboxContext, type ComboboxContextProps } from './combobox-context.svelte';
|
|
6
7
|
export { default as ComboboxControl, type ComboboxControlProps, type ComboboxControlBaseProps, } from './combobox-control.svelte';
|
|
7
8
|
export { default as ComboboxInput, type ComboboxInputProps, type ComboboxInputBaseProps } from './combobox-input.svelte';
|
|
@@ -14,8 +15,8 @@ export { default as ComboboxItemText, type ComboboxItemTextProps, type ComboboxI
|
|
|
14
15
|
export { default as ComboboxLabel, type ComboboxLabelProps, type ComboboxLabelBaseProps } from './combobox-label.svelte';
|
|
15
16
|
export { default as ComboboxList, type ComboboxListProps, type ComboboxListBaseProps } from './combobox-list.svelte';
|
|
16
17
|
export { default as ComboboxPositioner, type ComboboxPositionerProps, type ComboboxPositionerBaseProps, } from './combobox-positioner.svelte';
|
|
17
|
-
export { default as ComboboxRoot, type ComboboxRootBaseProps, type ComboboxRootProps } from './combobox-root.svelte';
|
|
18
|
-
export { default as ComboboxRootProvider, type ComboboxRootProviderBaseProps, type ComboboxRootProviderProps, } from './combobox-root-provider.svelte';
|
|
18
|
+
export { default as ComboboxRoot, type ComboboxRootBaseProps, type ComboboxRootProps, type ComboboxRootComponent, } from './combobox-root.svelte';
|
|
19
|
+
export { default as ComboboxRootProvider, type ComboboxRootProviderBaseProps, type ComboboxRootProviderProps, type ComboboxRootProviderComponent, } from './combobox-root-provider.svelte';
|
|
19
20
|
export { default as ComboboxTrigger, type ComboboxTriggerProps, type ComboboxTriggerBaseProps, } from './combobox-trigger.svelte';
|
|
20
21
|
export { comboboxAnatomy } from './combobox.anatomy';
|
|
21
22
|
export { useCombobox, type UseComboboxProps, type UseComboboxReturn } from './use-combobox.svelte';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createListCollection, useListCollection, } from '../collection';
|
|
2
2
|
export { default as ComboboxClearTrigger, } from './combobox-clear-trigger.svelte';
|
|
3
3
|
export { default as ComboboxContent, } from './combobox-content.svelte';
|
|
4
|
+
export { default as ComboboxEmpty } from './combobox-empty.svelte';
|
|
4
5
|
export { default as ComboboxContext } from './combobox-context.svelte';
|
|
5
6
|
export { default as ComboboxControl, } from './combobox-control.svelte';
|
|
6
7
|
export { default as ComboboxInput } from './combobox-input.svelte';
|
|
@@ -13,7 +14,7 @@ export { default as ComboboxItemText, } from './combobox-item-text.svelte';
|
|
|
13
14
|
export { default as ComboboxLabel } from './combobox-label.svelte';
|
|
14
15
|
export { default as ComboboxList } from './combobox-list.svelte';
|
|
15
16
|
export { default as ComboboxPositioner, } from './combobox-positioner.svelte';
|
|
16
|
-
export { default as ComboboxRoot } from './combobox-root.svelte';
|
|
17
|
+
export { default as ComboboxRoot, } from './combobox-root.svelte';
|
|
17
18
|
export { default as ComboboxRootProvider, } from './combobox-root-provider.svelte';
|
|
18
19
|
export { default as ComboboxTrigger, } from './combobox-trigger.svelte';
|
|
19
20
|
export { comboboxAnatomy } from './combobox.anatomy';
|
|
@@ -67,6 +67,7 @@ export const useField = (inProps = {}) => {
|
|
|
67
67
|
'data-disabled': dataAttr(disabled),
|
|
68
68
|
'data-invalid': dataAttr(invalid),
|
|
69
69
|
'data-readonly': dataAttr(readOnly),
|
|
70
|
+
'data-required': dataAttr(required),
|
|
70
71
|
for: controlId,
|
|
71
72
|
});
|
|
72
73
|
const getControlProps = () => ({
|
|
@@ -2,6 +2,7 @@ export type { HighlightChangeDetails as ListboxHighlightChangeDetails, ScrollToI
|
|
|
2
2
|
export { createListCollection, type CollectionItem, type ListCollection } from '../collection/index.js';
|
|
3
3
|
export { default as ListboxContent, type ListboxContentBaseProps, type ListboxContentProps, } from './listbox-content.svelte';
|
|
4
4
|
export { default as ListboxContext, type ListboxContextProps } from './listbox-context.svelte';
|
|
5
|
+
export { default as ListboxEmpty, type ListboxEmptyBaseProps, type ListboxEmptyProps } from './listbox-empty.svelte';
|
|
5
6
|
export { default as ListboxInput, type ListboxInputBaseProps, type ListboxInputProps } from './listbox-input.svelte';
|
|
6
7
|
export { default as ListboxItem, type ListboxItemBaseProps, type ListboxItemProps } from './listbox-item.svelte';
|
|
7
8
|
export { default as ListboxItemContext, type ListboxItemContextProps } from './listbox-item-context.svelte';
|
|
@@ -10,8 +11,8 @@ export { default as ListboxItemGroupLabel, type ListboxItemGroupLabelBaseProps,
|
|
|
10
11
|
export { default as ListboxItemIndicator, type ListboxItemIndicatorBaseProps, type ListboxItemIndicatorProps, } from './listbox-item-indicator.svelte';
|
|
11
12
|
export { default as ListboxItemText, type ListboxItemTextBaseProps, type ListboxItemTextProps, } from './listbox-item-text.svelte';
|
|
12
13
|
export { default as ListboxLabel, type ListboxLabelBaseProps, type ListboxLabelProps } from './listbox-label.svelte';
|
|
13
|
-
export { default as ListboxRoot, type ListboxRootBaseProps, type ListboxRootProps } from './listbox-root.svelte';
|
|
14
|
-
export { default as ListboxRootProvider, type ListboxRootProviderBaseProps, type ListboxRootProviderProps, } from './listbox-root-provider.svelte';
|
|
14
|
+
export { default as ListboxRoot, type ListboxRootBaseProps, type ListboxRootProps, type ListboxRootComponent, } from './listbox-root.svelte';
|
|
15
|
+
export { default as ListboxRootProvider, type ListboxRootProviderBaseProps, type ListboxRootProviderProps, type ListboxRootProviderComponent, } from './listbox-root-provider.svelte';
|
|
15
16
|
export { default as ListboxValueText, type ListboxValueTextBaseProps, type ListboxValueTextProps, } from './listbox-value-text.svelte';
|
|
16
17
|
export { listboxAnatomy } from './listbox.anatomy.js';
|
|
17
18
|
export { useListbox, type UseListboxProps, type UseListboxReturn } from './use-listbox.svelte.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { createListCollection } from '../collection/index.js';
|
|
2
2
|
export { default as ListboxContent, } from './listbox-content.svelte';
|
|
3
3
|
export { default as ListboxContext } from './listbox-context.svelte';
|
|
4
|
+
export { default as ListboxEmpty } from './listbox-empty.svelte';
|
|
4
5
|
export { default as ListboxInput } from './listbox-input.svelte';
|
|
5
6
|
export { default as ListboxItem } from './listbox-item.svelte';
|
|
6
7
|
export { default as ListboxItemContext } from './listbox-item-context.svelte';
|
|
@@ -9,7 +10,7 @@ export { default as ListboxItemGroupLabel, } from './listbox-item-group-label.sv
|
|
|
9
10
|
export { default as ListboxItemIndicator, } from './listbox-item-indicator.svelte';
|
|
10
11
|
export { default as ListboxItemText, } from './listbox-item-text.svelte';
|
|
11
12
|
export { default as ListboxLabel } from './listbox-label.svelte';
|
|
12
|
-
export { default as ListboxRoot } from './listbox-root.svelte';
|
|
13
|
+
export { default as ListboxRoot, } from './listbox-root.svelte';
|
|
13
14
|
export { default as ListboxRootProvider, } from './listbox-root-provider.svelte';
|
|
14
15
|
export { default as ListboxValueText, } from './listbox-value-text.svelte';
|
|
15
16
|
export { listboxAnatomy } from './listbox.anatomy.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
|
|
4
|
+
export interface ListboxEmptyBaseProps extends PolymorphicProps<'div'>, RefAttribute {}
|
|
5
|
+
export interface ListboxEmptyProps extends Assign<HTMLProps<'div'>, ListboxEmptyBaseProps> {}
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script lang="ts">
|
|
9
|
+
import { Ark } from '../factory'
|
|
10
|
+
import { listboxAnatomy } from './listbox.anatomy'
|
|
11
|
+
import { useListboxContext } from './use-listbox-context'
|
|
12
|
+
|
|
13
|
+
const parts = listboxAnatomy.build()
|
|
14
|
+
|
|
15
|
+
let { ref = $bindable(null), ...props }: ListboxEmptyProps = $props()
|
|
16
|
+
|
|
17
|
+
const listbox = useListboxContext()
|
|
18
|
+
const isEmpty = $derived(listbox().collection.size === 0)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
{#if isEmpty}
|
|
22
|
+
<Ark as="div" bind:ref {...parts.empty.attrs} {...props} role="presentation" />
|
|
23
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
export interface ListboxEmptyBaseProps extends PolymorphicProps<'div'>, RefAttribute {
|
|
3
|
+
}
|
|
4
|
+
export interface ListboxEmptyProps extends Assign<HTMLProps<'div'>, ListboxEmptyBaseProps> {
|
|
5
|
+
}
|
|
6
|
+
declare const ListboxEmpty: import("svelte").Component<ListboxEmptyProps, {}, "ref">;
|
|
7
|
+
type ListboxEmpty = ReturnType<typeof ListboxEmpty>;
|
|
8
|
+
export default ListboxEmpty;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
2
4
|
interface RootProviderProps<T extends CollectionItem> {
|
|
3
5
|
value: UseListboxReturn<T>
|
|
4
6
|
}
|
|
@@ -8,6 +10,10 @@
|
|
|
8
10
|
RootProviderProps<T> {}
|
|
9
11
|
export interface ListboxRootProviderProps<T extends CollectionItem>
|
|
10
12
|
extends Assign<HTMLProps<'div'>, ListboxRootProviderBaseProps<T>> {}
|
|
13
|
+
|
|
14
|
+
export type ListboxRootProviderComponent<P = {}> = <T extends CollectionItem>(
|
|
15
|
+
props: Assign<ListboxRootProviderProps<T>, P>,
|
|
16
|
+
) => Snippet
|
|
11
17
|
</script>
|
|
12
18
|
|
|
13
19
|
<script lang="ts" generics="T extends CollectionItem">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
interface RootProviderProps<T extends CollectionItem> {
|
|
2
3
|
value: UseListboxReturn<T>;
|
|
3
4
|
}
|
|
@@ -5,6 +6,7 @@ export interface ListboxRootProviderBaseProps<T extends CollectionItem> extends
|
|
|
5
6
|
}
|
|
6
7
|
export interface ListboxRootProviderProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ListboxRootProviderBaseProps<T>> {
|
|
7
8
|
}
|
|
9
|
+
export type ListboxRootProviderComponent<P = {}> = <T extends CollectionItem>(props: Assign<ListboxRootProviderProps<T>, P>) => Snippet;
|
|
8
10
|
import type { Assign, HTMLProps, PolymorphicProps } from '../../types.js';
|
|
9
11
|
import type { CollectionItem } from '../collection/index.js';
|
|
10
12
|
import type { UseListboxReturn } from './use-listbox.svelte.js';
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
<script lang="ts"
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
2
4
|
import type { Assign, HTMLProps, PolymorphicProps } from '../../types.js'
|
|
3
|
-
import { mergeProps } from '@zag-js/svelte'
|
|
4
5
|
import type { CollectionItem } from '../collection/index.js'
|
|
5
|
-
import {
|
|
6
|
-
import { ListboxProvider } from './use-listbox-context.js'
|
|
7
|
-
import { type UseListboxProps, useListbox } from './use-listbox.svelte.js'
|
|
8
|
-
import { createSplitProps } from '../../utils/create-split-props.js'
|
|
6
|
+
import type { UseListboxProps } from './use-listbox.svelte.js'
|
|
9
7
|
|
|
10
8
|
export interface ListboxRootBaseProps<T extends CollectionItem> extends UseListboxProps<T>, PolymorphicProps<'div'> {}
|
|
11
9
|
export interface ListboxRootProps<T extends CollectionItem>
|
|
12
10
|
extends Assign<HTMLProps<'div'>, ListboxRootBaseProps<T>> {}
|
|
13
11
|
|
|
12
|
+
export type ListboxRootComponent<P = {}> = <T extends CollectionItem>(
|
|
13
|
+
props: Assign<ListboxRootProps<T>, P>,
|
|
14
|
+
) => Snippet
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" generics="T extends CollectionItem">
|
|
18
|
+
import { mergeProps } from '@zag-js/svelte'
|
|
19
|
+
import { Ark } from '../factory/index.js'
|
|
20
|
+
import { ListboxProvider } from './use-listbox-context.js'
|
|
21
|
+
import { useListbox } from './use-listbox.svelte.js'
|
|
22
|
+
import { createSplitProps } from '../../utils/create-split-props.js'
|
|
23
|
+
|
|
14
24
|
let { highlightedValue = $bindable(), value = $bindable(), ...props }: ListboxRootProps<T> = $props()
|
|
15
25
|
const providedId = $props.id()
|
|
16
26
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { Assign, HTMLProps, PolymorphicProps } from '../../types.js';
|
|
2
3
|
import type { CollectionItem } from '../collection/index.js';
|
|
3
|
-
import {
|
|
4
|
+
import type { UseListboxProps } from './use-listbox.svelte.js';
|
|
4
5
|
export interface ListboxRootBaseProps<T extends CollectionItem> extends UseListboxProps<T>, PolymorphicProps<'div'> {
|
|
5
6
|
}
|
|
6
7
|
export interface ListboxRootProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ListboxRootBaseProps<T>> {
|
|
7
8
|
}
|
|
9
|
+
export type ListboxRootComponent<P = {}> = <T extends CollectionItem>(props: Assign<ListboxRootProps<T>, P>) => Snippet;
|
|
8
10
|
declare function $$render<T extends CollectionItem>(): {
|
|
9
11
|
props: ListboxRootProps<T>;
|
|
10
12
|
exports: {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const listboxAnatomy: import("@zag-js/anatomy").AnatomyInstance<"input" | "label" | "root" | "content" | "valueText" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "empty">;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { anatomy } from '@zag-js/listbox';
|
|
2
|
+
export const listboxAnatomy = anatomy.extendWith('empty');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Content, type ListboxContentBaseProps as ContentBaseProps, type ListboxContentProps as ContentProps, } from './listbox-content.svelte';
|
|
2
2
|
export { default as Context, type ListboxContextProps as ContextProps } from './listbox-context.svelte';
|
|
3
|
+
export { default as Empty, type ListboxEmptyBaseProps as EmptyBaseProps, type ListboxEmptyProps as EmptyProps, } from './listbox-empty.svelte';
|
|
3
4
|
export { default as Input, type ListboxInputBaseProps as InputBaseProps, type ListboxInputProps as InputProps, } from './listbox-input.svelte';
|
|
4
5
|
export { default as Item, type ListboxItemBaseProps as ItemBaseProps, type ListboxItemProps as ItemProps, } from './listbox-item.svelte';
|
|
5
6
|
export { default as ItemContext, type ListboxItemContextProps as ItemContextProps } from './listbox-item-context.svelte';
|
|
@@ -8,6 +9,6 @@ export { default as ItemGroupLabel, type ListboxItemGroupLabelBaseProps as ItemG
|
|
|
8
9
|
export { default as ItemIndicator, type ListboxItemIndicatorBaseProps as ItemIndicatorBaseProps, type ListboxItemIndicatorProps as ItemIndicatorProps, } from './listbox-item-indicator.svelte';
|
|
9
10
|
export { default as ItemText, type ListboxItemTextBaseProps as ItemTextBaseProps, type ListboxItemTextProps as ItemTextProps, } from './listbox-item-text.svelte';
|
|
10
11
|
export { default as Label, type ListboxLabelBaseProps as LabelBaseProps, type ListboxLabelProps as LabelProps, } from './listbox-label.svelte';
|
|
11
|
-
export { default as Root, type ListboxRootBaseProps as RootBaseProps, type ListboxRootProps as RootProps, } from './listbox-root.svelte';
|
|
12
|
-
export { default as RootProvider, type ListboxRootProviderBaseProps as RootProviderBaseProps, type ListboxRootProviderProps as RootProviderProps, } from './listbox-root-provider.svelte';
|
|
12
|
+
export { default as Root, type ListboxRootBaseProps as RootBaseProps, type ListboxRootProps as RootProps, type ListboxRootComponent as RootComponent, } from './listbox-root.svelte';
|
|
13
|
+
export { default as RootProvider, type ListboxRootProviderBaseProps as RootProviderBaseProps, type ListboxRootProviderProps as RootProviderProps, type ListboxRootProviderComponent as RootProviderComponent, } from './listbox-root-provider.svelte';
|
|
13
14
|
export { default as ValueText, type ListboxValueTextBaseProps as ValueTextBaseProps, type ListboxValueTextProps as ValueTextProps, } from './listbox-value-text.svelte';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as Content, } from './listbox-content.svelte';
|
|
2
2
|
export { default as Context } from './listbox-context.svelte';
|
|
3
|
+
export { default as Empty, } from './listbox-empty.svelte';
|
|
3
4
|
export { default as Input, } from './listbox-input.svelte';
|
|
4
5
|
export { default as Item, } from './listbox-item.svelte';
|
|
5
6
|
export { default as ItemContext } from './listbox-item-context.svelte';
|
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
import { mergeProps } from '@zag-js/svelte'
|
|
10
10
|
import { Ark } from '../factory'
|
|
11
11
|
import { useMenuTriggerItemContext } from './use-menu-trigger-item-context'
|
|
12
|
+
import { MenuItemPropsProvider } from './use-menu-option-item-props-context'
|
|
12
13
|
|
|
13
14
|
let { ref = $bindable(null), ...props }: MenuTriggerItemProps = $props()
|
|
14
15
|
|
|
15
16
|
const getTriggerItemProps = useMenuTriggerItemContext()
|
|
16
17
|
const mergedProps = $derived(mergeProps(getTriggerItemProps?.() ?? {}, props))
|
|
18
|
+
|
|
19
|
+
MenuItemPropsProvider(() => ({ value: mergedProps['data-value'] }))
|
|
17
20
|
</script>
|
|
18
21
|
|
|
19
22
|
<Ark as="div" bind:ref {...mergedProps} />
|
|
@@ -15,8 +15,8 @@ export { default as SelectItemText, type SelectItemTextBaseProps, type SelectIte
|
|
|
15
15
|
export { default as SelectLabel, type SelectLabelBaseProps, type SelectLabelProps } from './select-label.svelte';
|
|
16
16
|
export { default as SelectList, type SelectListBaseProps, type SelectListProps } from './select-list.svelte';
|
|
17
17
|
export { default as SelectPositioner, type SelectPositionerBaseProps, type SelectPositionerProps, } from './select-positioner.svelte';
|
|
18
|
-
export { default as SelectRoot, type SelectRootBaseProps, type SelectRootProps } from './select-root.svelte';
|
|
19
|
-
export { default as SelectRootProvider, type SelectRootProviderBaseProps, type SelectRootProviderProps, } from './select-root-provider.svelte';
|
|
18
|
+
export { default as SelectRoot, type SelectRootBaseProps, type SelectRootProps, type SelectRootComponent, } from './select-root.svelte';
|
|
19
|
+
export { default as SelectRootProvider, type SelectRootProviderBaseProps, type SelectRootProviderProps, type SelectRootProviderComponent, } from './select-root-provider.svelte';
|
|
20
20
|
export { default as SelectTrigger, type SelectTriggerBaseProps, type SelectTriggerProps } from './select-trigger.svelte';
|
|
21
21
|
export { default as SelectValueText, type SelectValueTextBaseProps, type SelectValueTextProps, } from './select-value-text.svelte';
|
|
22
22
|
export { selectAnatomy } from './select.anatomy';
|
|
@@ -14,7 +14,7 @@ export { default as SelectItemText, } from './select-item-text.svelte';
|
|
|
14
14
|
export { default as SelectLabel } from './select-label.svelte';
|
|
15
15
|
export { default as SelectList } from './select-list.svelte';
|
|
16
16
|
export { default as SelectPositioner, } from './select-positioner.svelte';
|
|
17
|
-
export { default as SelectRoot } from './select-root.svelte';
|
|
17
|
+
export { default as SelectRoot, } from './select-root.svelte';
|
|
18
18
|
export { default as SelectRootProvider, } from './select-root-provider.svelte';
|
|
19
19
|
export { default as SelectTrigger } from './select-trigger.svelte';
|
|
20
20
|
export { default as SelectValueText, } from './select-value-text.svelte';
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
export interface SelectRootProviderProps<T extends CollectionItem = CollectionItem>
|
|
14
14
|
extends Assign<HTMLProps<'div'>, SelectRootProviderBaseProps<T>> {}
|
|
15
|
+
|
|
16
|
+
export type SelectRootProviderComponent<P = {}> = <T extends CollectionItem>(
|
|
17
|
+
props: Assign<SelectRootProviderProps<T>, P>,
|
|
18
|
+
) => Snippet
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
21
|
<script lang="ts" generics="T extends CollectionItem = CollectionItem">
|
|
@@ -19,6 +23,7 @@
|
|
|
19
23
|
import { Ark } from '../factory'
|
|
20
24
|
import { SelectProvider } from './use-select-context'
|
|
21
25
|
import { PresenceProvider, splitPresenceProps, usePresence, type UsePresenceProps } from '../presence'
|
|
26
|
+
import type { Snippet } from 'svelte'
|
|
22
27
|
|
|
23
28
|
let { ref = $bindable(null), ...props }: SelectRootProviderProps<T> = $props()
|
|
24
29
|
|
|
@@ -6,7 +6,9 @@ export interface SelectRootProviderBaseProps<T extends CollectionItem = Collecti
|
|
|
6
6
|
}
|
|
7
7
|
export interface SelectRootProviderProps<T extends CollectionItem = CollectionItem> extends Assign<HTMLProps<'div'>, SelectRootProviderBaseProps<T>> {
|
|
8
8
|
}
|
|
9
|
+
export type SelectRootProviderComponent<P = {}> = <T extends CollectionItem>(props: Assign<SelectRootProviderProps<T>, P>) => Snippet;
|
|
9
10
|
import { type UsePresenceProps } from '../presence';
|
|
11
|
+
import type { Snippet } from 'svelte';
|
|
10
12
|
declare function $$render<T extends CollectionItem = CollectionItem>(): {
|
|
11
13
|
props: SelectRootProviderProps<T>;
|
|
12
14
|
exports: {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
3
4
|
import type { CollectionItem } from '../collection'
|
|
4
5
|
import type { UseSelectProps } from './use-select.svelte'
|
|
5
6
|
|
|
@@ -11,6 +12,8 @@
|
|
|
11
12
|
|
|
12
13
|
export interface SelectRootProps<T extends CollectionItem = CollectionItem>
|
|
13
14
|
extends Assign<HTMLProps<'div'>, SelectRootBaseProps<T>> {}
|
|
15
|
+
|
|
16
|
+
export type SelectRootComponent<P = {}> = <T extends CollectionItem>(props: Assign<SelectRootProps<T>, P>) => Snippet
|
|
14
17
|
</script>
|
|
15
18
|
|
|
16
19
|
<script lang="ts" generics="T extends CollectionItem = CollectionItem">
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { CollectionItem } from '../collection';
|
|
3
4
|
import type { UseSelectProps } from './use-select.svelte';
|
|
4
5
|
export interface SelectRootBaseProps<T extends CollectionItem = CollectionItem> extends UseSelectProps<T>, UsePresenceProps, PolymorphicProps<'div'>, RefAttribute {
|
|
5
6
|
}
|
|
6
7
|
export interface SelectRootProps<T extends CollectionItem = CollectionItem> extends Assign<HTMLProps<'div'>, SelectRootBaseProps<T>> {
|
|
7
8
|
}
|
|
9
|
+
export type SelectRootComponent<P = {}> = <T extends CollectionItem>(props: Assign<SelectRootProps<T>, P>) => Snippet;
|
|
8
10
|
import { type UsePresenceProps } from '../presence';
|
|
9
11
|
declare function $$render<T extends CollectionItem = CollectionItem>(): {
|
|
10
12
|
props: SelectRootProps<T>;
|
|
@@ -15,7 +15,7 @@ export { default as Item, type SelectItemProps as ItemProps } from './select-ite
|
|
|
15
15
|
export { default as Label, type SelectLabelProps as LabelProps } from './select-label.svelte';
|
|
16
16
|
export { default as List, type SelectListProps as ListProps } from './select-list.svelte';
|
|
17
17
|
export { default as Positioner, type SelectPositionerProps as PositionerProps } from './select-positioner.svelte';
|
|
18
|
-
export { default as RootProvider, type SelectRootProviderBaseProps as RootProviderBaseProps, type SelectRootProviderProps as RootProviderProps, } from './select-root-provider.svelte';
|
|
19
|
-
export { default as Root, type SelectRootBaseProps as RootBaseProps, type SelectRootProps as RootProps, } from './select-root.svelte';
|
|
18
|
+
export { default as RootProvider, type SelectRootProviderBaseProps as RootProviderBaseProps, type SelectRootProviderProps as RootProviderProps, type SelectRootProviderComponent as RootProviderComponent, } from './select-root-provider.svelte';
|
|
19
|
+
export { default as Root, type SelectRootBaseProps as RootBaseProps, type SelectRootProps as RootProps, type SelectRootComponent as RootComponent, } from './select-root.svelte';
|
|
20
20
|
export { default as Trigger, type SelectTriggerProps as TriggerProps } from './select-trigger.svelte';
|
|
21
21
|
export { default as ValueText, type SelectValueTextProps as ValueTextProps } from './select-value-text.svelte';
|
|
@@ -16,8 +16,8 @@ export { default as TreeViewNodeContext, type TreeViewNodeContextProps } from '.
|
|
|
16
16
|
export { default as TreeViewNodeCheckbox, type TreeViewNodeCheckboxBaseProps, type TreeViewNodeCheckboxProps, } from './tree-view-node-checkbox.svelte';
|
|
17
17
|
export { default as TreeViewNodeCheckboxIndicator, type TreeViewNodeCheckboxIndicatorBaseProps, type TreeViewNodeCheckboxIndicatorProps, } from './tree-view-node-checkbox-indicator.svelte';
|
|
18
18
|
export { default as TreeViewNodeProvider, type TreeViewNodeProviderBaseProps, type TreeViewNodeProviderProps, } from './tree-view-node-provider.svelte';
|
|
19
|
-
export { default as TreeViewRoot, type TreeViewRootBaseProps, type TreeViewRootProps } from './tree-view-root.svelte';
|
|
20
|
-
export { default as TreeViewRootProvider, type TreeViewRootProviderBaseProps, type TreeViewRootProviderProps, } from './tree-view-root-provider.svelte';
|
|
19
|
+
export { default as TreeViewRoot, type TreeViewRootBaseProps, type TreeViewRootComponent, type TreeViewRootProps, } from './tree-view-root.svelte';
|
|
20
|
+
export { default as TreeViewRootProvider, type TreeViewRootProviderBaseProps, type TreeViewRootProviderComponent, type TreeViewRootProviderProps, } from './tree-view-root-provider.svelte';
|
|
21
21
|
export { default as TreeViewTree, type TreeViewTreeBaseProps, type TreeViewTreeProps } from './tree-view-tree.svelte';
|
|
22
22
|
export { treeViewAnatomy } from './tree-view.anatomy';
|
|
23
23
|
export { useTreeViewContext } from './use-tree-view-context';
|
|
@@ -15,7 +15,7 @@ export { default as TreeViewNodeContext } from './tree-view-node-context.svelte'
|
|
|
15
15
|
export { default as TreeViewNodeCheckbox, } from './tree-view-node-checkbox.svelte';
|
|
16
16
|
export { default as TreeViewNodeCheckboxIndicator, } from './tree-view-node-checkbox-indicator.svelte';
|
|
17
17
|
export { default as TreeViewNodeProvider, } from './tree-view-node-provider.svelte';
|
|
18
|
-
export { default as TreeViewRoot } from './tree-view-root.svelte';
|
|
18
|
+
export { default as TreeViewRoot, } from './tree-view-root.svelte';
|
|
19
19
|
export { default as TreeViewRootProvider, } from './tree-view-root-provider.svelte';
|
|
20
20
|
export { default as TreeViewTree } from './tree-view-tree.svelte';
|
|
21
21
|
export { treeViewAnatomy } from './tree-view.anatomy';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
3
4
|
import type { TreeNode } from '../collection'
|
|
4
5
|
import type { UseTreeViewReturn } from './use-tree-view.svelte'
|
|
5
6
|
|
|
@@ -11,6 +12,10 @@
|
|
|
11
12
|
}
|
|
12
13
|
export interface TreeViewRootProviderProps<T extends TreeNode>
|
|
13
14
|
extends Assign<HTMLProps<'div'>, TreeViewRootProviderBaseProps<T>> {}
|
|
15
|
+
|
|
16
|
+
export type TreeViewRootProviderComponent<P = {}> = <T extends TreeNode>(
|
|
17
|
+
props: Assign<TreeViewRootProviderProps<T>, P>,
|
|
18
|
+
) => Snippet
|
|
14
19
|
</script>
|
|
15
20
|
|
|
16
21
|
<script lang="ts" generics="T extends TreeNode">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { TreeNode } from '../collection';
|
|
3
4
|
import type { UseTreeViewReturn } from './use-tree-view.svelte';
|
|
4
5
|
export interface TreeViewRootProviderBaseProps<T extends TreeNode> extends RenderStrategyProps, PolymorphicProps<'div'>, RefAttribute {
|
|
@@ -6,6 +7,7 @@ export interface TreeViewRootProviderBaseProps<T extends TreeNode> extends Rende
|
|
|
6
7
|
}
|
|
7
8
|
export interface TreeViewRootProviderProps<T extends TreeNode> extends Assign<HTMLProps<'div'>, TreeViewRootProviderBaseProps<T>> {
|
|
8
9
|
}
|
|
10
|
+
export type TreeViewRootProviderComponent<P = {}> = <T extends TreeNode>(props: Assign<TreeViewRootProviderProps<T>, P>) => Snippet;
|
|
9
11
|
import { type RenderStrategyProps } from '../../utils/render-strategy';
|
|
10
12
|
declare function $$render<T extends TreeNode>(): {
|
|
11
13
|
props: TreeViewRootProviderProps<T>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
3
4
|
import type { TreeNode } from '../collection'
|
|
4
5
|
import type { UseTreeViewProps } from './use-tree-view.svelte'
|
|
5
6
|
|
|
@@ -10,6 +11,8 @@
|
|
|
10
11
|
RefAttribute {}
|
|
11
12
|
|
|
12
13
|
export interface TreeViewRootProps<T extends TreeNode> extends Assign<HTMLProps<'div'>, TreeViewRootBaseProps<T>> {}
|
|
14
|
+
|
|
15
|
+
export type TreeViewRootComponent<P = {}> = <T extends TreeNode>(props: Assign<TreeViewRootProps<T>, P>) => Snippet
|
|
13
16
|
</script>
|
|
14
17
|
|
|
15
18
|
<script lang="ts" generics="T extends TreeNode">
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { Assign, HTMLProps, PolymorphicProps, RefAttribute } from '../../types';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
2
3
|
import type { TreeNode } from '../collection';
|
|
3
4
|
import type { UseTreeViewProps } from './use-tree-view.svelte';
|
|
4
5
|
export interface TreeViewRootBaseProps<T extends TreeNode> extends UseTreeViewProps<T>, RenderStrategyProps, PolymorphicProps<'div'>, RefAttribute {
|
|
5
6
|
}
|
|
6
7
|
export interface TreeViewRootProps<T extends TreeNode> extends Assign<HTMLProps<'div'>, TreeViewRootBaseProps<T>> {
|
|
7
8
|
}
|
|
9
|
+
export type TreeViewRootComponent<P = {}> = <T extends TreeNode>(props: Assign<TreeViewRootProps<T>, P>) => Snippet;
|
|
8
10
|
import { type RenderStrategyProps } from '../../utils/render-strategy';
|
|
9
11
|
declare function $$render<T extends TreeNode>(): {
|
|
10
12
|
props: TreeViewRootProps<T>;
|
|
@@ -15,6 +15,6 @@ export { default as NodeCheckbox, type TreeViewNodeCheckboxBaseProps as NodeChec
|
|
|
15
15
|
export { default as NodeCheckboxIndicator, type TreeViewNodeCheckboxIndicatorBaseProps as NodeCheckboxIndicatorBaseProps, type TreeViewNodeCheckboxIndicatorProps as NodeCheckboxIndicatorProps, } from './tree-view-node-checkbox-indicator.svelte';
|
|
16
16
|
export { default as NodeContext, type TreeViewNodeContextProps as NodeContextProps, } from './tree-view-node-context.svelte';
|
|
17
17
|
export { default as NodeProvider, type TreeViewNodeProviderBaseProps as NodeProviderBaseProps, type TreeViewNodeProviderProps as NodeProviderProps, } from './tree-view-node-provider.svelte';
|
|
18
|
-
export { default as Root, type TreeViewRootBaseProps as RootBaseProps, type TreeViewRootProps as RootProps, } from './tree-view-root.svelte';
|
|
19
|
-
export { default as RootProvider, type TreeViewRootProviderBaseProps as RootProviderBaseProps, type TreeViewRootProviderProps as RootProviderProps, } from './tree-view-root-provider.svelte';
|
|
18
|
+
export { default as Root, type TreeViewRootBaseProps as RootBaseProps, type TreeViewRootComponent as RootComponent, type TreeViewRootProps as RootProps, } from './tree-view-root.svelte';
|
|
19
|
+
export { default as RootProvider, type TreeViewRootProviderBaseProps as RootProviderBaseProps, type TreeViewRootProviderComponent as RootProviderComponent, type TreeViewRootProviderProps as RootProviderProps, } from './tree-view-root-provider.svelte';
|
|
20
20
|
export { default as Tree, type TreeViewTreeBaseProps as TreeBaseProps, type TreeViewTreeProps as TreeProps, } from './tree-view-tree.svelte';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SourceMap interface for transformation output
|
|
3
|
+
*/
|
|
4
|
+
interface SourceMap {
|
|
5
|
+
version: number;
|
|
6
|
+
sources: string[];
|
|
7
|
+
names: string[];
|
|
8
|
+
sourceRoot?: string;
|
|
9
|
+
sourcesContent?: string[];
|
|
10
|
+
mappings: string;
|
|
11
|
+
file: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Plugin interface matching Vite/Rollup plugin structure
|
|
15
|
+
*/
|
|
16
|
+
interface SveltePlugin {
|
|
17
|
+
name: string;
|
|
18
|
+
transform: (code: string, id: string) => TransformResult | null | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Result of the transform operation
|
|
22
|
+
*/
|
|
23
|
+
interface TransformResult {
|
|
24
|
+
code: string;
|
|
25
|
+
map?: SourceMap | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Creates a Vite/Svelte plugin that optimizes lucide-svelte imports by converting
|
|
29
|
+
* destructured imports to direct imports for better tree-shaking
|
|
30
|
+
*
|
|
31
|
+
* @returns A Svelte plugin that transforms lucide-svelte imports
|
|
32
|
+
*/
|
|
33
|
+
export declare function lucideOptimizeImports(): SveltePlugin;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Pre-compile regex for better performance
|
|
2
|
+
const LUCIDE_IMPORT_PATTERN = /([ \t]*)import\s+\{\s*([^}]+)\s*\}\s+from\s+['"]lucide-svelte['"]/g;
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Vite/Svelte plugin that optimizes lucide-svelte imports by converting
|
|
5
|
+
* destructured imports to direct imports for better tree-shaking
|
|
6
|
+
*
|
|
7
|
+
* @returns A Svelte plugin that transforms lucide-svelte imports
|
|
8
|
+
*/
|
|
9
|
+
export function lucideOptimizeImports() {
|
|
10
|
+
return {
|
|
11
|
+
name: 'lucide-svelte-optimizer',
|
|
12
|
+
transform(sourceCode, filePath) {
|
|
13
|
+
if (!isValidInput(sourceCode, filePath))
|
|
14
|
+
return null;
|
|
15
|
+
try {
|
|
16
|
+
// Quick check if the file contains lucide-svelte imports
|
|
17
|
+
if (!sourceCode.includes('lucide-svelte'))
|
|
18
|
+
return null;
|
|
19
|
+
const { transformedCode, hasChanges } = transformLucideImports(sourceCode);
|
|
20
|
+
if (hasChanges) {
|
|
21
|
+
return {
|
|
22
|
+
code: transformedCode,
|
|
23
|
+
map: null, // No source maps in this implementation
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
handleTransformError(error);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Validates the input parameters for processing
|
|
37
|
+
*/
|
|
38
|
+
function isValidInput(code, id) {
|
|
39
|
+
return Boolean(code && id);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Transforms lucide-svelte imports from destructured to individual imports
|
|
43
|
+
*/
|
|
44
|
+
function transformLucideImports(sourceCode) {
|
|
45
|
+
let hasChanges = false;
|
|
46
|
+
const transformedCode = sourceCode.replace(LUCIDE_IMPORT_PATTERN, (match, indentation, importNames) => {
|
|
47
|
+
if (!importNames.trim())
|
|
48
|
+
return match;
|
|
49
|
+
const semicolonAtEnd = match.endsWith(';');
|
|
50
|
+
const individualImports = convertToIndividualImports(importNames, indentation, semicolonAtEnd);
|
|
51
|
+
if (individualImports) {
|
|
52
|
+
hasChanges = true;
|
|
53
|
+
return individualImports;
|
|
54
|
+
}
|
|
55
|
+
return match;
|
|
56
|
+
});
|
|
57
|
+
return { transformedCode, hasChanges };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Converts a comma-separated list of imports to individual import statements
|
|
61
|
+
*/
|
|
62
|
+
function convertToIndividualImports(importNames, indentation, withSemicolon) {
|
|
63
|
+
return importNames
|
|
64
|
+
.split(',')
|
|
65
|
+
.map((name) => name.trim())
|
|
66
|
+
.filter(Boolean)
|
|
67
|
+
.map((name) => {
|
|
68
|
+
const kebabCasePath = convertToKebabCase(name);
|
|
69
|
+
const semicolon = withSemicolon ? ';' : '';
|
|
70
|
+
return `${indentation}import ${name} from 'lucide-svelte/icons/${kebabCasePath}'${semicolon}`;
|
|
71
|
+
})
|
|
72
|
+
.join('\n');
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Converts a camelCase or PascalCase string to kebab-case
|
|
76
|
+
*/
|
|
77
|
+
function convertToKebabCase(str) {
|
|
78
|
+
return str
|
|
79
|
+
.replace(/Icon$/, '') // Remove 'Icon' suffix
|
|
80
|
+
.replace(/([a-z])([A-Z])/g, '$1-$2')
|
|
81
|
+
.toLowerCase();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Handles and logs transformation errors
|
|
85
|
+
*/
|
|
86
|
+
function handleTransformError(error) {
|
|
87
|
+
const typedError = error instanceof Error ? error : new Error(String(error));
|
|
88
|
+
console.error('Error in lucide-svelte-optimizer plugin:', typedError);
|
|
89
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/svelte",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.8.0",
|
|
5
5
|
"description": "A collection of unstyled, accessible UI components for Svelte",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"accordion",
|
|
@@ -120,89 +120,92 @@
|
|
|
120
120
|
"sideEffects": false,
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"@internationalized/date": "3.8.2",
|
|
123
|
-
"@zag-js/accordion": "1.
|
|
124
|
-
"@zag-js/anatomy": "1.
|
|
125
|
-
"@zag-js/angle-slider": "1.
|
|
126
|
-
"@zag-js/async-list": "1.
|
|
127
|
-
"@zag-js/auto-resize": "1.
|
|
128
|
-
"@zag-js/avatar": "1.
|
|
129
|
-
"@zag-js/carousel": "1.
|
|
130
|
-
"@zag-js/checkbox": "1.
|
|
131
|
-
"@zag-js/clipboard": "1.
|
|
132
|
-
"@zag-js/collapsible": "1.
|
|
133
|
-
"@zag-js/collection": "1.
|
|
134
|
-
"@zag-js/color-picker": "1.
|
|
135
|
-
"@zag-js/color-utils": "1.
|
|
136
|
-
"@zag-js/combobox": "1.
|
|
137
|
-
"@zag-js/core": "1.
|
|
138
|
-
"@zag-js/date-picker": "1.
|
|
139
|
-
"@zag-js/date-utils": "1.
|
|
140
|
-
"@zag-js/dialog": "1.
|
|
141
|
-
"@zag-js/dom-query": "1.
|
|
142
|
-
"@zag-js/editable": "1.
|
|
143
|
-
"@zag-js/file-upload": "1.
|
|
144
|
-
"@zag-js/file-utils": "1.
|
|
145
|
-
"@zag-js/floating-panel": "1.
|
|
146
|
-
"@zag-js/focus-trap": "1.
|
|
147
|
-
"@zag-js/highlight-word": "1.
|
|
148
|
-
"@zag-js/hover-card": "1.
|
|
149
|
-
"@zag-js/i18n-utils": "1.
|
|
150
|
-
"@zag-js/json-tree-utils": "1.
|
|
151
|
-
"@zag-js/listbox": "1.
|
|
152
|
-
"@zag-js/menu": "1.
|
|
153
|
-
"@zag-js/number-input": "1.
|
|
154
|
-
"@zag-js/pagination": "1.
|
|
155
|
-
"@zag-js/password-input": "1.
|
|
156
|
-
"@zag-js/pin-input": "1.
|
|
157
|
-
"@zag-js/popover": "1.
|
|
158
|
-
"@zag-js/presence": "1.
|
|
159
|
-
"@zag-js/progress": "1.
|
|
160
|
-
"@zag-js/qr-code": "1.
|
|
161
|
-
"@zag-js/radio-group": "1.
|
|
162
|
-
"@zag-js/rating-group": "1.
|
|
163
|
-
"@zag-js/scroll-area": "1.
|
|
164
|
-
"@zag-js/select": "1.
|
|
165
|
-
"@zag-js/signature-pad": "1.
|
|
166
|
-
"@zag-js/slider": "1.
|
|
167
|
-
"@zag-js/splitter": "1.
|
|
168
|
-
"@zag-js/steps": "1.
|
|
169
|
-
"@zag-js/svelte": "1.
|
|
170
|
-
"@zag-js/switch": "1.
|
|
171
|
-
"@zag-js/tabs": "1.
|
|
172
|
-
"@zag-js/tags-input": "1.
|
|
173
|
-
"@zag-js/time-picker": "1.
|
|
174
|
-
"@zag-js/timer": "1.
|
|
175
|
-
"@zag-js/toast": "1.
|
|
176
|
-
"@zag-js/toggle": "1.
|
|
177
|
-
"@zag-js/toggle-group": "1.
|
|
178
|
-
"@zag-js/tooltip": "1.
|
|
179
|
-
"@zag-js/tour": "1.
|
|
180
|
-
"@zag-js/tree-view": "1.
|
|
181
|
-
"@zag-js/types": "1.
|
|
182
|
-
"@zag-js/utils": "1.
|
|
123
|
+
"@zag-js/accordion": "1.22.1",
|
|
124
|
+
"@zag-js/anatomy": "1.22.1",
|
|
125
|
+
"@zag-js/angle-slider": "1.22.1",
|
|
126
|
+
"@zag-js/async-list": "1.22.1",
|
|
127
|
+
"@zag-js/auto-resize": "1.22.1",
|
|
128
|
+
"@zag-js/avatar": "1.22.1",
|
|
129
|
+
"@zag-js/carousel": "1.22.1",
|
|
130
|
+
"@zag-js/checkbox": "1.22.1",
|
|
131
|
+
"@zag-js/clipboard": "1.22.1",
|
|
132
|
+
"@zag-js/collapsible": "1.22.1",
|
|
133
|
+
"@zag-js/collection": "1.22.1",
|
|
134
|
+
"@zag-js/color-picker": "1.22.1",
|
|
135
|
+
"@zag-js/color-utils": "1.22.1",
|
|
136
|
+
"@zag-js/combobox": "1.22.1",
|
|
137
|
+
"@zag-js/core": "1.22.1",
|
|
138
|
+
"@zag-js/date-picker": "1.22.1",
|
|
139
|
+
"@zag-js/date-utils": "1.22.1",
|
|
140
|
+
"@zag-js/dialog": "1.22.1",
|
|
141
|
+
"@zag-js/dom-query": "1.22.1",
|
|
142
|
+
"@zag-js/editable": "1.22.1",
|
|
143
|
+
"@zag-js/file-upload": "1.22.1",
|
|
144
|
+
"@zag-js/file-utils": "1.22.1",
|
|
145
|
+
"@zag-js/floating-panel": "1.22.1",
|
|
146
|
+
"@zag-js/focus-trap": "1.22.1",
|
|
147
|
+
"@zag-js/highlight-word": "1.22.1",
|
|
148
|
+
"@zag-js/hover-card": "1.22.1",
|
|
149
|
+
"@zag-js/i18n-utils": "1.22.1",
|
|
150
|
+
"@zag-js/json-tree-utils": "1.22.1",
|
|
151
|
+
"@zag-js/listbox": "1.22.1",
|
|
152
|
+
"@zag-js/menu": "1.22.1",
|
|
153
|
+
"@zag-js/number-input": "1.22.1",
|
|
154
|
+
"@zag-js/pagination": "1.22.1",
|
|
155
|
+
"@zag-js/password-input": "1.22.1",
|
|
156
|
+
"@zag-js/pin-input": "1.22.1",
|
|
157
|
+
"@zag-js/popover": "1.22.1",
|
|
158
|
+
"@zag-js/presence": "1.22.1",
|
|
159
|
+
"@zag-js/progress": "1.22.1",
|
|
160
|
+
"@zag-js/qr-code": "1.22.1",
|
|
161
|
+
"@zag-js/radio-group": "1.22.1",
|
|
162
|
+
"@zag-js/rating-group": "1.22.1",
|
|
163
|
+
"@zag-js/scroll-area": "1.22.1",
|
|
164
|
+
"@zag-js/select": "1.22.1",
|
|
165
|
+
"@zag-js/signature-pad": "1.22.1",
|
|
166
|
+
"@zag-js/slider": "1.22.1",
|
|
167
|
+
"@zag-js/splitter": "1.22.1",
|
|
168
|
+
"@zag-js/steps": "1.22.1",
|
|
169
|
+
"@zag-js/svelte": "1.22.1",
|
|
170
|
+
"@zag-js/switch": "1.22.1",
|
|
171
|
+
"@zag-js/tabs": "1.22.1",
|
|
172
|
+
"@zag-js/tags-input": "1.22.1",
|
|
173
|
+
"@zag-js/time-picker": "1.22.1",
|
|
174
|
+
"@zag-js/timer": "1.22.1",
|
|
175
|
+
"@zag-js/toast": "1.22.1",
|
|
176
|
+
"@zag-js/toggle": "1.22.1",
|
|
177
|
+
"@zag-js/toggle-group": "1.22.1",
|
|
178
|
+
"@zag-js/tooltip": "1.22.1",
|
|
179
|
+
"@zag-js/tour": "1.22.1",
|
|
180
|
+
"@zag-js/tree-view": "1.22.1",
|
|
181
|
+
"@zag-js/types": "1.22.1",
|
|
182
|
+
"@zag-js/utils": "1.22.1"
|
|
183
183
|
},
|
|
184
184
|
"devDependencies": {
|
|
185
|
-
"@storybook/addon-a11y": "9.1.
|
|
186
|
-
"@storybook/sveltekit": "9.1.
|
|
185
|
+
"@storybook/addon-a11y": "9.1.3",
|
|
186
|
+
"@storybook/sveltekit": "9.1.3",
|
|
187
187
|
"@sveltejs/adapter-auto": "6.1.0",
|
|
188
|
-
"@sveltejs/kit": "2.
|
|
189
|
-
"@sveltejs/package": "2.
|
|
190
|
-
"@sveltejs/vite-plugin-svelte": "6.1.
|
|
188
|
+
"@sveltejs/kit": "2.36.2",
|
|
189
|
+
"@sveltejs/package": "2.5.0",
|
|
190
|
+
"@sveltejs/vite-plugin-svelte": "6.1.3",
|
|
191
191
|
"@tanstack/svelte-form": "1.19.2",
|
|
192
|
-
"@testing-library/
|
|
192
|
+
"@testing-library/dom": "10.4.1",
|
|
193
|
+
"@testing-library/jest-dom": "6.8.0",
|
|
193
194
|
"@testing-library/svelte": "5.2.8",
|
|
194
195
|
"@testing-library/user-event": "14.6.1",
|
|
195
196
|
"@vitest/coverage-v8": "3.2.4",
|
|
196
197
|
"clean-package": "2.2.0",
|
|
197
198
|
"image-conversion": "2.1.1",
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
"
|
|
199
|
+
"jsdom": "26.1.0",
|
|
200
|
+
"lucide-svelte": "0.541.0",
|
|
201
|
+
"storybook": "9.1.3",
|
|
202
|
+
"svelte": "5.38.3",
|
|
201
203
|
"svelte-check": "4.3.1",
|
|
202
204
|
"tslib": "2.8.1",
|
|
203
205
|
"typescript": "5.9.2",
|
|
204
|
-
"vite": "7.1.
|
|
205
|
-
"vitest": "3.2.4"
|
|
206
|
+
"vite": "7.1.3",
|
|
207
|
+
"vitest": "3.2.4",
|
|
208
|
+
"vitest-axe": "1.0.0-pre.5"
|
|
206
209
|
},
|
|
207
210
|
"peerDependencies": {
|
|
208
211
|
"svelte": ">=5.20.0"
|