ui-ingredients 0.0.23 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/README.md +5 -5
  2. package/dist/date-picker/date-picker.d.ts +1 -0
  3. package/dist/date-picker/date-picker.js +1 -0
  4. package/dist/date-picker/index.d.ts +1 -0
  5. package/dist/date-picker/view-trigger.svelte +21 -0
  6. package/dist/date-picker/view-trigger.svelte.d.ts +18 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.js +3 -0
  9. package/dist/progress/index.d.ts +1 -0
  10. package/dist/progress/progress.d.ts +1 -0
  11. package/dist/progress/progress.js +1 -0
  12. package/dist/progress/view.svelte +21 -0
  13. package/dist/progress/view.svelte.d.ts +18 -0
  14. package/dist/signature-pad/guide.svelte +2 -2
  15. package/dist/splitter/context.svelte.d.ts +3 -0
  16. package/dist/splitter/context.svelte.js +2 -0
  17. package/dist/splitter/create-splitter.svelte.d.ts +7 -0
  18. package/dist/splitter/create-splitter.svelte.js +17 -0
  19. package/dist/splitter/index.d.ts +4 -0
  20. package/dist/splitter/index.js +1 -0
  21. package/dist/splitter/panel.svelte +29 -0
  22. package/dist/splitter/panel.svelte.d.ts +18 -0
  23. package/dist/splitter/resize-trigger.svelte +41 -0
  24. package/dist/splitter/resize-trigger.svelte.d.ts +18 -0
  25. package/dist/splitter/root.svelte +44 -0
  26. package/dist/splitter/root.svelte.d.ts +18 -0
  27. package/dist/splitter/splitter.d.ts +4 -0
  28. package/dist/splitter/splitter.js +4 -0
  29. package/dist/time-picker/clear-trigger.svelte +20 -0
  30. package/dist/time-picker/clear-trigger.svelte.d.ts +18 -0
  31. package/dist/time-picker/column.svelte +21 -0
  32. package/dist/time-picker/column.svelte.d.ts +18 -0
  33. package/dist/time-picker/content.svelte +20 -0
  34. package/dist/time-picker/content.svelte.d.ts +18 -0
  35. package/dist/time-picker/context.svelte.d.ts +3 -0
  36. package/dist/time-picker/context.svelte.js +2 -0
  37. package/dist/time-picker/control.svelte +20 -0
  38. package/dist/time-picker/control.svelte.d.ts +18 -0
  39. package/dist/time-picker/create-time-picker.svelte.d.ts +8 -0
  40. package/dist/time-picker/create-time-picker.svelte.js +20 -0
  41. package/dist/time-picker/hour-cell.svelte +21 -0
  42. package/dist/time-picker/hour-cell.svelte.d.ts +18 -0
  43. package/dist/time-picker/index.d.ts +15 -0
  44. package/dist/time-picker/index.js +1 -0
  45. package/dist/time-picker/input.svelte +18 -0
  46. package/dist/time-picker/input.svelte.d.ts +18 -0
  47. package/dist/time-picker/label.svelte +20 -0
  48. package/dist/time-picker/label.svelte.d.ts +18 -0
  49. package/dist/time-picker/minute-cell.svelte +21 -0
  50. package/dist/time-picker/minute-cell.svelte.d.ts +18 -0
  51. package/dist/time-picker/period-cell.svelte +28 -0
  52. package/dist/time-picker/period-cell.svelte.d.ts +18 -0
  53. package/dist/time-picker/positioner.svelte +20 -0
  54. package/dist/time-picker/positioner.svelte.d.ts +18 -0
  55. package/dist/time-picker/root.svelte +70 -0
  56. package/dist/time-picker/root.svelte.d.ts +18 -0
  57. package/dist/time-picker/second-cell.svelte +21 -0
  58. package/dist/time-picker/second-cell.svelte.d.ts +18 -0
  59. package/dist/time-picker/spacer.svelte +20 -0
  60. package/dist/time-picker/spacer.svelte.d.ts +18 -0
  61. package/dist/time-picker/time-picker.d.ts +15 -0
  62. package/dist/time-picker/time-picker.js +15 -0
  63. package/dist/time-picker/trigger.svelte +20 -0
  64. package/dist/time-picker/trigger.svelte.d.ts +18 -0
  65. package/dist/tree-view/branch-content.svelte +21 -0
  66. package/dist/tree-view/branch-content.svelte.d.ts +18 -0
  67. package/dist/tree-view/branch-control.svelte +21 -0
  68. package/dist/tree-view/branch-control.svelte.d.ts +18 -0
  69. package/dist/tree-view/branch-indicator.svelte +21 -0
  70. package/dist/tree-view/branch-indicator.svelte.d.ts +18 -0
  71. package/dist/tree-view/branch-text.svelte +21 -0
  72. package/dist/tree-view/branch-text.svelte.d.ts +18 -0
  73. package/dist/tree-view/branch-trigger.svelte +21 -0
  74. package/dist/tree-view/branch-trigger.svelte.d.ts +18 -0
  75. package/dist/tree-view/branch.svelte +40 -0
  76. package/dist/tree-view/branch.svelte.d.ts +18 -0
  77. package/dist/tree-view/context.svelte.d.ts +6 -0
  78. package/dist/tree-view/context.svelte.js +4 -0
  79. package/dist/tree-view/create-tree-view.svelte.d.ts +7 -0
  80. package/dist/tree-view/create-tree-view.svelte.js +17 -0
  81. package/dist/tree-view/index.d.ts +13 -0
  82. package/dist/tree-view/index.js +1 -0
  83. package/dist/tree-view/item-indicator.svelte +21 -0
  84. package/dist/tree-view/item-indicator.svelte.d.ts +18 -0
  85. package/dist/tree-view/item-text.svelte +21 -0
  86. package/dist/tree-view/item-text.svelte.d.ts +18 -0
  87. package/dist/tree-view/item.svelte +39 -0
  88. package/dist/tree-view/item.svelte.d.ts +18 -0
  89. package/dist/tree-view/label.svelte +20 -0
  90. package/dist/tree-view/label.svelte.d.ts +18 -0
  91. package/dist/tree-view/root.svelte +54 -0
  92. package/dist/tree-view/root.svelte.d.ts +18 -0
  93. package/dist/tree-view/tree-view.d.ts +13 -0
  94. package/dist/tree-view/tree-view.js +13 -0
  95. package/dist/tree-view/tree.svelte +20 -0
  96. package/dist/tree-view/tree.svelte.d.ts +18 -0
  97. package/package.json +1 -1
  98. package/dist/time-picker/.gitkeep +0 -0
  99. package/dist/tree-view/.gitkeep +0 -0
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const BranchIndicator: $$__sveltets_2_IsomorphicComponent<TreeViewBranchIndicatorProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type BranchIndicator = InstanceType<typeof BranchIndicator>;
18
+ export default BranchIndicator;
@@ -0,0 +1,21 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewBranchTextProps extends HtmlProps<'span'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewBranchPropsContext, treeViewContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewBranchTextProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+ let branchProps = treeViewBranchPropsContext.get();
15
+
16
+ let attrs = $derived(mergeProps(props, treeView.getBranchTextProps(branchProps)));
17
+ </script>
18
+
19
+ <span {...attrs}>
20
+ {@render children?.()}
21
+ </span>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const BranchText: $$__sveltets_2_IsomorphicComponent<TreeViewBranchTextProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type BranchText = InstanceType<typeof BranchText>;
18
+ export default BranchText;
@@ -0,0 +1,21 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewBranchTriggerProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewBranchPropsContext, treeViewContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewBranchTriggerProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+ let branchProps = treeViewBranchPropsContext.get();
15
+
16
+ let attrs = $derived(mergeProps(props, treeView.getBranchTriggerProps(branchProps)));
17
+ </script>
18
+
19
+ <div {...attrs}>
20
+ {@render children?.()}
21
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const BranchTrigger: $$__sveltets_2_IsomorphicComponent<TreeViewBranchTriggerProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type BranchTrigger = InstanceType<typeof BranchTrigger>;
18
+ export default BranchTrigger;
@@ -0,0 +1,40 @@
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {BranchProps, BranchState} from '@zag-js/tree-view';
4
+ import type {Snippet} from 'svelte';
5
+
6
+ export interface TreeViewBranchProps
7
+ extends Assign<Omit<HtmlProps<'div'>, 'children'>, BranchProps> {
8
+ children?: Snippet<[state: BranchState]>;
9
+ }
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import {mergeProps} from '@zag-js/svelte';
14
+ import {treeViewBranchPropsContext, treeViewContext} from './context.svelte.js';
15
+
16
+ let {
17
+ /**/
18
+ depth,
19
+ value,
20
+ disabled,
21
+ children,
22
+ ...props
23
+ }: TreeViewBranchProps = $props();
24
+
25
+ let treeView = treeViewContext.get();
26
+ let branchProps: BranchProps = $derived({
27
+ depth,
28
+ value,
29
+ disabled,
30
+ });
31
+
32
+ let attrs = $derived(mergeProps(props, treeView.getBranchProps(branchProps)));
33
+ let state = $derived(treeView.getBranchState(branchProps));
34
+
35
+ treeViewBranchPropsContext.set(() => branchProps);
36
+ </script>
37
+
38
+ <div {...attrs}>
39
+ {@render children?.(state)}
40
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Branch: $$__sveltets_2_IsomorphicComponent<TreeViewBranchProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type Branch = InstanceType<typeof Branch>;
18
+ export default Branch;
@@ -0,0 +1,6 @@
1
+ import { Context } from '../utils.svelte.js';
2
+ import type { BranchProps, ItemProps } from '@zag-js/tree-view';
3
+ import type { CreateTreeViewReturn } from './create-tree-view.svelte.js';
4
+ export declare const treeViewContext: Context<CreateTreeViewReturn>;
5
+ export declare const treeViewItemPropsContext: Context<ItemProps>;
6
+ export declare const treeViewBranchPropsContext: Context<BranchProps>;
@@ -0,0 +1,4 @@
1
+ import { Context } from '../utils.svelte.js';
2
+ export const treeViewContext = new Context('TreeView');
3
+ export const treeViewItemPropsContext = new Context('TreeViewItem');
4
+ export const treeViewBranchPropsContext = new Context('TreeViewBranch');
@@ -0,0 +1,7 @@
1
+ import * as treeView from '@zag-js/tree-view';
2
+ export interface CreateTreeViewProps extends Omit<treeView.Context, 'id' | 'dir' | 'getRootNode'> {
3
+ id?: string | null;
4
+ }
5
+ export interface CreateTreeViewReturn extends treeView.Api {
6
+ }
7
+ export declare function createTreeView(props: CreateTreeViewProps): any;
@@ -0,0 +1,17 @@
1
+ import { getEnvironmentContext } from '../environment-provider/context.svelte.js';
2
+ import { getLocaleContext } from '../locale-provider/context.svelte.js';
3
+ import { createUniqueId } from '../utils.svelte.js';
4
+ import { normalizeProps, reflect, useMachine } from '@zag-js/svelte';
5
+ import * as treeView from '@zag-js/tree-view';
6
+ export function createTreeView(props) {
7
+ const locale = getLocaleContext();
8
+ const environment = getEnvironmentContext();
9
+ const [state, send] = useMachine(treeView.machine({
10
+ ...props,
11
+ id: props.id ?? createUniqueId(),
12
+ dir: locale?.dir,
13
+ getRootNode: environment?.getRootNode,
14
+ }));
15
+ const api = $derived(reflect(() => treeView.connect(state, send, normalizeProps)));
16
+ return api;
17
+ }
@@ -0,0 +1,13 @@
1
+ export * as TreeView from './tree-view.js';
2
+ export type { TreeViewBranchContentProps } from './branch-content.svelte';
3
+ export type { TreeViewBranchControlProps } from './branch-control.svelte';
4
+ export type { TreeViewBranchIndicatorProps } from './branch-indicator.svelte';
5
+ export type { TreeViewBranchTextProps } from './branch-text.svelte';
6
+ export type { TreeViewBranchTriggerProps } from './branch-trigger.svelte';
7
+ export type { TreeViewBranchProps } from './branch.svelte';
8
+ export type { TreeViewItemIndicatorProps } from './item-indicator.svelte';
9
+ export type { TreeViewItemTextProps } from './item-text.svelte';
10
+ export type { TreeViewItemProps } from './item.svelte';
11
+ export type { TreeViewLabelProps } from './label.svelte';
12
+ export type { TreeViewProps } from './root.svelte';
13
+ export type { TreeViewTreeProps } from './tree.svelte';
@@ -0,0 +1 @@
1
+ export * as TreeView from './tree-view.js';
@@ -0,0 +1,21 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewItemIndicatorProps extends HtmlProps<'span'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewContext, treeViewItemPropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewItemIndicatorProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+ let itemProps = treeViewItemPropsContext.get();
15
+
16
+ let attrs = $derived(mergeProps(props, treeView.getItemIndicatorProps(itemProps)));
17
+ </script>
18
+
19
+ <span {...attrs}>
20
+ {@render children?.()}
21
+ </span>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const ItemIndicator: $$__sveltets_2_IsomorphicComponent<TreeViewItemIndicatorProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type ItemIndicator = InstanceType<typeof ItemIndicator>;
18
+ export default ItemIndicator;
@@ -0,0 +1,21 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewItemTextProps extends HtmlProps<'span'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewContext, treeViewItemPropsContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewItemTextProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+ let itemProps = treeViewItemPropsContext.get();
15
+
16
+ let attrs = $derived(mergeProps(props, treeView.getItemTextProps(itemProps)));
17
+ </script>
18
+
19
+ <span {...attrs}>
20
+ {@render children?.()}
21
+ </span>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const ItemText: $$__sveltets_2_IsomorphicComponent<TreeViewItemTextProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type ItemText = InstanceType<typeof ItemText>;
18
+ export default ItemText;
@@ -0,0 +1,39 @@
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {ItemProps, ItemState} from '@zag-js/tree-view';
4
+ import type {Snippet} from 'svelte';
5
+
6
+ export interface TreeViewItemProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, ItemProps> {
7
+ children?: Snippet<[state: ItemState]>;
8
+ }
9
+ </script>
10
+
11
+ <script lang="ts">
12
+ import {mergeProps} from '@zag-js/svelte';
13
+ import {treeViewContext, treeViewItemPropsContext} from './context.svelte.js';
14
+
15
+ let {
16
+ /**/
17
+ depth,
18
+ value,
19
+ disabled,
20
+ children,
21
+ ...props
22
+ }: TreeViewItemProps = $props();
23
+
24
+ let treeView = treeViewContext.get();
25
+ let itemProps: ItemProps = $derived({
26
+ depth,
27
+ value,
28
+ disabled,
29
+ });
30
+
31
+ let attrs = $derived(mergeProps(props, treeView.getItemProps(itemProps)));
32
+ let state = $derived(treeView.getItemState(itemProps));
33
+
34
+ treeViewItemPropsContext.set(() => itemProps);
35
+ </script>
36
+
37
+ <div {...attrs}>
38
+ {@render children?.(state)}
39
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Item: $$__sveltets_2_IsomorphicComponent<TreeViewItemProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type Item = InstanceType<typeof Item>;
18
+ export default Item;
@@ -0,0 +1,20 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewLabelProps extends HtmlProps<'span'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewLabelProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+
15
+ let attrs = $derived(mergeProps(props, treeView.getLabelProps()));
16
+ </script>
17
+
18
+ <span {...attrs}>
19
+ {@render children?.()}
20
+ </span>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Label: $$__sveltets_2_IsomorphicComponent<TreeViewLabelProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type Label = InstanceType<typeof Label>;
18
+ export default Label;
@@ -0,0 +1,54 @@
1
+ <script lang="ts" module>
2
+ import type {Assign, HtmlProps} from '../types.js';
3
+ import type {Snippet} from 'svelte';
4
+ import type {CreateTreeViewProps, CreateTreeViewReturn} from './create-tree-view.svelte.js';
5
+
6
+ export interface TreeViewProps
7
+ extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateTreeViewProps> {
8
+ children?: Snippet<[treeView: CreateTreeViewReturn]>;
9
+ }
10
+ </script>
11
+
12
+ <script lang="ts">
13
+ import {mergeProps} from '@zag-js/svelte';
14
+ import {treeViewContext} from './context.svelte.js';
15
+ import {createTreeView} from './create-tree-view.svelte.js';
16
+
17
+ let {
18
+ id,
19
+ ids,
20
+ typeahead,
21
+ focusedValue,
22
+ expandedValue,
23
+ expandOnClick,
24
+ selectedValue,
25
+ selectionMode,
26
+ onFocusChange,
27
+ onExpandedChange,
28
+ onSelectionChange,
29
+ children,
30
+ ...props
31
+ }: TreeViewProps = $props();
32
+
33
+ let treeView = createTreeView({
34
+ id,
35
+ ids,
36
+ typeahead,
37
+ focusedValue,
38
+ expandedValue,
39
+ expandOnClick,
40
+ selectedValue,
41
+ selectionMode,
42
+ onFocusChange,
43
+ onExpandedChange,
44
+ onSelectionChange,
45
+ });
46
+
47
+ let attrs = $derived(mergeProps(props, treeView.getRootProps()));
48
+
49
+ treeViewContext.set(treeView);
50
+ </script>
51
+
52
+ <div {...attrs}>
53
+ {@render children?.(treeView)}
54
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Root: $$__sveltets_2_IsomorphicComponent<TreeViewProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type Root = InstanceType<typeof Root>;
18
+ export default Root;
@@ -0,0 +1,13 @@
1
+ export { anatomy } from '@zag-js/tree-view';
2
+ export { default as BranchContent } from './branch-content.svelte';
3
+ export { default as BranchControl } from './branch-control.svelte';
4
+ export { default as BranchIndicator } from './branch-indicator.svelte';
5
+ export { default as BranchText } from './branch-text.svelte';
6
+ export { default as BranchTrigger } from './branch-trigger.svelte';
7
+ export { default as Branch } from './branch.svelte';
8
+ export { default as ItemIndicator } from './item-indicator.svelte';
9
+ export { default as ItemText } from './item-text.svelte';
10
+ export { default as Item } from './item.svelte';
11
+ export { default as Label } from './label.svelte';
12
+ export { default as Root } from './root.svelte';
13
+ export { default as Tree } from './tree.svelte';
@@ -0,0 +1,13 @@
1
+ export { anatomy } from '@zag-js/tree-view';
2
+ export { default as BranchContent } from './branch-content.svelte';
3
+ export { default as BranchControl } from './branch-control.svelte';
4
+ export { default as BranchIndicator } from './branch-indicator.svelte';
5
+ export { default as BranchText } from './branch-text.svelte';
6
+ export { default as BranchTrigger } from './branch-trigger.svelte';
7
+ export { default as Branch } from './branch.svelte';
8
+ export { default as ItemIndicator } from './item-indicator.svelte';
9
+ export { default as ItemText } from './item-text.svelte';
10
+ export { default as Item } from './item.svelte';
11
+ export { default as Label } from './label.svelte';
12
+ export { default as Root } from './root.svelte';
13
+ export { default as Tree } from './tree.svelte';
@@ -0,0 +1,20 @@
1
+ <script lang="ts" module>
2
+ import type {HtmlProps} from '../types.js';
3
+
4
+ export interface TreeViewTreeProps extends HtmlProps<'div'> {}
5
+ </script>
6
+
7
+ <script lang="ts">
8
+ import {mergeProps} from '@zag-js/svelte';
9
+ import {treeViewContext} from './context.svelte.js';
10
+
11
+ let {children, ...props}: TreeViewTreeProps = $props();
12
+
13
+ let treeView = treeViewContext.get();
14
+
15
+ let attrs = $derived(mergeProps(props, treeView.getTreeProps()));
16
+ </script>
17
+
18
+ <div {...attrs}>
19
+ {@render children?.()}
20
+ </div>
@@ -0,0 +1,18 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ declare const Tree: $$__sveltets_2_IsomorphicComponent<TreeViewTreeProps, {
15
+ [evt: string]: CustomEvent<any>;
16
+ }, {}, {}, "">;
17
+ type Tree = InstanceType<typeof Tree>;
18
+ export default Tree;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ui-ingredients",
3
3
  "type": "module",
4
- "version": "0.0.23",
4
+ "version": "0.0.25",
5
5
  "packageManager": "pnpm@9.7.0",
6
6
  "svelte": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
File without changes
File without changes