@ark-ui/react 5.6.0 → 5.7.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.
Files changed (99) hide show
  1. package/dist/components/collection.d.cts +1 -1
  2. package/dist/components/collection.d.ts +1 -1
  3. package/dist/components/floating-panel/floating-panel-body.cjs +5 -7
  4. package/dist/components/floating-panel/floating-panel-body.js +5 -7
  5. package/dist/components/floating-panel/floating-panel-content.cjs +8 -14
  6. package/dist/components/floating-panel/floating-panel-content.js +8 -14
  7. package/dist/components/floating-panel/floating-panel-drag-trigger.cjs +5 -7
  8. package/dist/components/floating-panel/floating-panel-drag-trigger.js +5 -7
  9. package/dist/components/floating-panel/floating-panel-header.cjs +5 -7
  10. package/dist/components/floating-panel/floating-panel-header.js +5 -7
  11. package/dist/components/floating-panel/floating-panel-positioner.cjs +8 -10
  12. package/dist/components/floating-panel/floating-panel-positioner.js +8 -10
  13. package/dist/components/index.cjs +35 -0
  14. package/dist/components/index.d.cts +1 -0
  15. package/dist/components/index.d.ts +1 -0
  16. package/dist/components/index.js +17 -0
  17. package/dist/components/listbox/index.cjs +44 -0
  18. package/dist/components/listbox/index.d.cts +18 -0
  19. package/dist/components/listbox/index.d.ts +18 -0
  20. package/dist/components/listbox/index.js +18 -0
  21. package/dist/components/listbox/listbox-content.cjs +19 -0
  22. package/dist/components/listbox/listbox-content.d.cts +7 -0
  23. package/dist/components/listbox/listbox-content.d.ts +7 -0
  24. package/dist/components/listbox/listbox-content.js +15 -0
  25. package/dist/components/listbox/listbox-context.d.cts +7 -0
  26. package/dist/components/listbox/listbox-context.d.ts +7 -0
  27. package/dist/components/listbox/listbox-input.cjs +21 -0
  28. package/dist/components/listbox/listbox-input.d.cts +8 -0
  29. package/dist/components/listbox/listbox-input.d.ts +8 -0
  30. package/dist/components/listbox/listbox-input.js +17 -0
  31. package/dist/components/listbox/listbox-item-group-label.cjs +21 -0
  32. package/dist/components/listbox/listbox-item-group-label.d.cts +7 -0
  33. package/dist/components/listbox/listbox-item-group-label.d.ts +7 -0
  34. package/dist/components/listbox/listbox-item-group-label.js +17 -0
  35. package/dist/components/listbox/listbox-item-group.cjs +24 -0
  36. package/dist/components/listbox/listbox-item-group.d.cts +7 -0
  37. package/dist/components/listbox/listbox-item-group.d.ts +7 -0
  38. package/dist/components/listbox/listbox-item-group.js +20 -0
  39. package/dist/components/listbox/listbox-item-indicator.cjs +21 -0
  40. package/dist/components/listbox/listbox-item-indicator.d.cts +7 -0
  41. package/dist/components/listbox/listbox-item-indicator.d.ts +7 -0
  42. package/dist/components/listbox/listbox-item-indicator.js +17 -0
  43. package/dist/components/listbox/listbox-item-text.cjs +21 -0
  44. package/dist/components/listbox/listbox-item-text.d.cts +7 -0
  45. package/dist/components/listbox/listbox-item-text.d.ts +7 -0
  46. package/dist/components/listbox/listbox-item-text.js +17 -0
  47. package/dist/components/listbox/listbox-item.cjs +24 -0
  48. package/dist/components/listbox/listbox-item.d.cts +8 -0
  49. package/dist/components/listbox/listbox-item.d.ts +8 -0
  50. package/dist/components/listbox/listbox-item.js +20 -0
  51. package/dist/components/listbox/listbox-label.cjs +19 -0
  52. package/dist/components/listbox/listbox-label.d.cts +7 -0
  53. package/dist/components/listbox/listbox-label.d.ts +7 -0
  54. package/dist/components/listbox/listbox-label.js +15 -0
  55. package/dist/components/listbox/listbox-root-provider.cjs +20 -0
  56. package/dist/components/listbox/listbox-root-provider.d.cts +14 -0
  57. package/dist/components/listbox/listbox-root-provider.d.ts +14 -0
  58. package/dist/components/listbox/listbox-root-provider.js +16 -0
  59. package/dist/components/listbox/listbox-root.cjs +42 -0
  60. package/dist/components/listbox/listbox-root.d.cts +11 -0
  61. package/dist/components/listbox/listbox-root.d.ts +11 -0
  62. package/dist/components/listbox/listbox-root.js +38 -0
  63. package/dist/components/listbox/listbox-value-text.cjs +20 -0
  64. package/dist/components/listbox/listbox-value-text.d.cts +11 -0
  65. package/dist/components/listbox/listbox-value-text.d.ts +11 -0
  66. package/dist/components/listbox/listbox-value-text.js +16 -0
  67. package/dist/components/listbox/listbox.anatomy.d.cts +1 -0
  68. package/dist/components/listbox/listbox.anatomy.d.ts +1 -0
  69. package/dist/components/listbox/listbox.cjs +29 -0
  70. package/dist/components/listbox/listbox.d.cts +12 -0
  71. package/dist/components/listbox/listbox.d.ts +12 -0
  72. package/dist/components/listbox/listbox.js +11 -0
  73. package/dist/components/listbox/use-listbox-context.cjs +15 -0
  74. package/dist/components/listbox/use-listbox-context.d.cts +6 -0
  75. package/dist/components/listbox/use-listbox-context.d.ts +6 -0
  76. package/dist/components/listbox/use-listbox-context.js +10 -0
  77. package/dist/components/listbox/use-listbox-item-context.cjs +15 -0
  78. package/dist/components/listbox/use-listbox-item-context.d.cts +5 -0
  79. package/dist/components/listbox/use-listbox-item-context.d.ts +5 -0
  80. package/dist/components/listbox/use-listbox-item-context.js +10 -0
  81. package/dist/components/listbox/use-listbox-item-group-props.cjs +15 -0
  82. package/dist/components/listbox/use-listbox-item-group-props.d.cts +5 -0
  83. package/dist/components/listbox/use-listbox-item-group-props.d.ts +5 -0
  84. package/dist/components/listbox/use-listbox-item-group-props.js +10 -0
  85. package/dist/components/listbox/use-listbox-item-props-context.cjs +15 -0
  86. package/dist/components/listbox/use-listbox-item-props-context.d.cts +3 -0
  87. package/dist/components/listbox/use-listbox-item-props-context.d.ts +3 -0
  88. package/dist/components/listbox/use-listbox-item-props-context.js +10 -0
  89. package/dist/components/listbox/use-listbox.cjs +45 -0
  90. package/dist/components/listbox/use-listbox.d.cts +13 -0
  91. package/dist/components/listbox/use-listbox.d.ts +13 -0
  92. package/dist/components/listbox/use-listbox.js +22 -0
  93. package/dist/components/toast/toaster.cjs +3 -1
  94. package/dist/components/toast/toaster.js +3 -1
  95. package/dist/components/toggle-group/toggle-group-root.cjs +1 -0
  96. package/dist/components/toggle-group/toggle-group-root.js +1 -0
  97. package/dist/index.cjs +35 -0
  98. package/dist/index.js +17 -0
  99. package/package.json +68 -66
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const useListboxContext = require('./use-listbox-context.cjs');
11
+ const useListboxItemGroupProps = require('./use-listbox-item-group-props.cjs');
12
+
13
+ const ListboxItemGroupLabel = react.forwardRef((props, ref) => {
14
+ const listbox = useListboxContext.useListboxContext();
15
+ const itemGroupProps = useListboxItemGroupProps.useListboxItemGroupPropsContext();
16
+ const mergedProps = react$1.mergeProps(listbox.getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
+ });
19
+ ListboxItemGroupLabel.displayName = "ListboxItemGroupLabel";
20
+
21
+ exports.ListboxItemGroupLabel = ListboxItemGroupLabel;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemGroupLabelBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemGroupLabelProps extends HTMLProps<'div'>, ListboxItemGroupLabelBaseProps {
6
+ }
7
+ export declare const ListboxItemGroupLabel: ForwardRefExoticComponent<ListboxItemGroupLabelProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemGroupLabelBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemGroupLabelProps extends HTMLProps<'div'>, ListboxItemGroupLabelBaseProps {
6
+ }
7
+ export declare const ListboxItemGroupLabel: ForwardRefExoticComponent<ListboxItemGroupLabelProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.js';
6
+ import { useListboxContext } from './use-listbox-context.js';
7
+ import { useListboxItemGroupPropsContext } from './use-listbox-item-group-props.js';
8
+
9
+ const ListboxItemGroupLabel = forwardRef((props, ref) => {
10
+ const listbox = useListboxContext();
11
+ const itemGroupProps = useListboxItemGroupPropsContext();
12
+ const mergedProps = mergeProps(listbox.getItemGroupLabelProps({ htmlFor: itemGroupProps.id }), props);
13
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
+ });
15
+ ListboxItemGroupLabel.displayName = "ListboxItemGroupLabel";
16
+
17
+ export { ListboxItemGroupLabel };
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const createSplitProps = require('../../utils/create-split-props.cjs');
10
+ const factory = require('../factory.cjs');
11
+ const useListboxContext = require('./use-listbox-context.cjs');
12
+ const useListboxItemGroupProps = require('./use-listbox-item-group-props.cjs');
13
+
14
+ const ListboxItemGroup = react.forwardRef((props, ref) => {
15
+ const id = react.useId();
16
+ const [_itemGroupProps, localProps] = createSplitProps.createSplitProps()(props, ["id"]);
17
+ const itemGroupProps = { id, ..._itemGroupProps };
18
+ const listbox = useListboxContext.useListboxContext();
19
+ const mergedProps = react$1.mergeProps(listbox.getItemGroupProps(itemGroupProps), localProps);
20
+ return /* @__PURE__ */ jsxRuntime.jsx(useListboxItemGroupProps.ListboxItemGroupPropsProvider, { value: itemGroupProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
21
+ });
22
+ ListboxItemGroup.displayName = "ListboxItemGroup";
23
+
24
+ exports.ListboxItemGroup = ListboxItemGroup;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemGroupBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemGroupProps extends HTMLProps<'div'>, ListboxItemGroupBaseProps {
6
+ }
7
+ export declare const ListboxItemGroup: ForwardRefExoticComponent<ListboxItemGroupProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemGroupBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemGroupProps extends HTMLProps<'div'>, ListboxItemGroupBaseProps {
6
+ }
7
+ export declare const ListboxItemGroup: ForwardRefExoticComponent<ListboxItemGroupProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef, useId } from 'react';
5
+ import { createSplitProps } from '../../utils/create-split-props.js';
6
+ import { ark } from '../factory.js';
7
+ import { useListboxContext } from './use-listbox-context.js';
8
+ import { ListboxItemGroupPropsProvider } from './use-listbox-item-group-props.js';
9
+
10
+ const ListboxItemGroup = forwardRef((props, ref) => {
11
+ const id = useId();
12
+ const [_itemGroupProps, localProps] = createSplitProps()(props, ["id"]);
13
+ const itemGroupProps = { id, ..._itemGroupProps };
14
+ const listbox = useListboxContext();
15
+ const mergedProps = mergeProps(listbox.getItemGroupProps(itemGroupProps), localProps);
16
+ return /* @__PURE__ */ jsx(ListboxItemGroupPropsProvider, { value: itemGroupProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
17
+ });
18
+ ListboxItemGroup.displayName = "ListboxItemGroup";
19
+
20
+ export { ListboxItemGroup };
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const useListboxContext = require('./use-listbox-context.cjs');
11
+ const useListboxItemPropsContext = require('./use-listbox-item-props-context.cjs');
12
+
13
+ const ListboxItemIndicator = react.forwardRef((props, ref) => {
14
+ const listbox = useListboxContext.useListboxContext();
15
+ const itemProps = useListboxItemPropsContext.useListboxItemPropsContext();
16
+ const mergedProps = react$1.mergeProps(listbox.getItemIndicatorProps(itemProps), props);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
+ });
19
+ ListboxItemIndicator.displayName = "ListboxItemIndicator";
20
+
21
+ exports.ListboxItemIndicator = ListboxItemIndicator;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemIndicatorBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemIndicatorProps extends HTMLProps<'div'>, ListboxItemIndicatorBaseProps {
6
+ }
7
+ export declare const ListboxItemIndicator: ForwardRefExoticComponent<ListboxItemIndicatorProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemIndicatorBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemIndicatorProps extends HTMLProps<'div'>, ListboxItemIndicatorBaseProps {
6
+ }
7
+ export declare const ListboxItemIndicator: ForwardRefExoticComponent<ListboxItemIndicatorProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.js';
6
+ import { useListboxContext } from './use-listbox-context.js';
7
+ import { useListboxItemPropsContext } from './use-listbox-item-props-context.js';
8
+
9
+ const ListboxItemIndicator = forwardRef((props, ref) => {
10
+ const listbox = useListboxContext();
11
+ const itemProps = useListboxItemPropsContext();
12
+ const mergedProps = mergeProps(listbox.getItemIndicatorProps(itemProps), props);
13
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
+ });
15
+ ListboxItemIndicator.displayName = "ListboxItemIndicator";
16
+
17
+ export { ListboxItemIndicator };
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const useListboxContext = require('./use-listbox-context.cjs');
11
+ const useListboxItemPropsContext = require('./use-listbox-item-props-context.cjs');
12
+
13
+ const ListboxItemText = react.forwardRef((props, ref) => {
14
+ const listbox = useListboxContext.useListboxContext();
15
+ const itemProps = useListboxItemPropsContext.useListboxItemPropsContext();
16
+ const mergedProps = react$1.mergeProps(listbox.getItemTextProps(itemProps), props);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
+ });
19
+ ListboxItemText.displayName = "ListboxItemText";
20
+
21
+ exports.ListboxItemText = ListboxItemText;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemTextBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemTextProps extends HTMLProps<'div'>, ListboxItemTextBaseProps {
6
+ }
7
+ export declare const ListboxItemText: ForwardRefExoticComponent<ListboxItemTextProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxItemTextBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxItemTextProps extends HTMLProps<'div'>, ListboxItemTextBaseProps {
6
+ }
7
+ export declare const ListboxItemText: ForwardRefExoticComponent<ListboxItemTextProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.js';
6
+ import { useListboxContext } from './use-listbox-context.js';
7
+ import { useListboxItemPropsContext } from './use-listbox-item-props-context.js';
8
+
9
+ const ListboxItemText = forwardRef((props, ref) => {
10
+ const listbox = useListboxContext();
11
+ const itemProps = useListboxItemPropsContext();
12
+ const mergedProps = mergeProps(listbox.getItemTextProps(itemProps), props);
13
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
+ });
15
+ ListboxItemText.displayName = "ListboxItemText";
16
+
17
+ export { ListboxItemText };
@@ -0,0 +1,24 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const createSplitProps = require('../../utils/create-split-props.cjs');
10
+ const factory = require('../factory.cjs');
11
+ const useListboxContext = require('./use-listbox-context.cjs');
12
+ const useListboxItemContext = require('./use-listbox-item-context.cjs');
13
+ const useListboxItemPropsContext = require('./use-listbox-item-props-context.cjs');
14
+
15
+ const ListboxItem = react.forwardRef((props, ref) => {
16
+ const [itemProps, localProps] = createSplitProps.createSplitProps()(props, ["item", "highlightOnHover"]);
17
+ const listbox = useListboxContext.useListboxContext();
18
+ const mergedProps = react$1.mergeProps(listbox.getItemProps(itemProps), localProps);
19
+ const itemState = listbox.getItemState(itemProps);
20
+ return /* @__PURE__ */ jsxRuntime.jsx(useListboxItemPropsContext.ListboxItemPropsProvider, { value: itemProps, children: /* @__PURE__ */ jsxRuntime.jsx(useListboxItemContext.ListboxItemProvider, { value: itemState, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) }) });
21
+ });
22
+ ListboxItem.displayName = "ListboxItem";
23
+
24
+ exports.ListboxItem = ListboxItem;
@@ -0,0 +1,8 @@
1
+ import { ItemProps } from '@zag-js/listbox';
2
+ import { HTMLProps, PolymorphicProps } from '../factory';
3
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ export interface ListboxItemBaseProps extends ItemProps, PolymorphicProps {
5
+ }
6
+ export interface ListboxItemProps extends HTMLProps<'div'>, ListboxItemBaseProps {
7
+ }
8
+ export declare const ListboxItem: ForwardRefExoticComponent<ListboxItemProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,8 @@
1
+ import { ItemProps } from '@zag-js/listbox';
2
+ import { HTMLProps, PolymorphicProps } from '../factory';
3
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
4
+ export interface ListboxItemBaseProps extends ItemProps, PolymorphicProps {
5
+ }
6
+ export interface ListboxItemProps extends HTMLProps<'div'>, ListboxItemBaseProps {
7
+ }
8
+ export declare const ListboxItem: ForwardRefExoticComponent<ListboxItemProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { createSplitProps } from '../../utils/create-split-props.js';
6
+ import { ark } from '../factory.js';
7
+ import { useListboxContext } from './use-listbox-context.js';
8
+ import { ListboxItemProvider } from './use-listbox-item-context.js';
9
+ import { ListboxItemPropsProvider } from './use-listbox-item-props-context.js';
10
+
11
+ const ListboxItem = forwardRef((props, ref) => {
12
+ const [itemProps, localProps] = createSplitProps()(props, ["item", "highlightOnHover"]);
13
+ const listbox = useListboxContext();
14
+ const mergedProps = mergeProps(listbox.getItemProps(itemProps), localProps);
15
+ const itemState = listbox.getItemState(itemProps);
16
+ return /* @__PURE__ */ jsx(ListboxItemPropsProvider, { value: itemProps, children: /* @__PURE__ */ jsx(ListboxItemProvider, { value: itemState, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) }) });
17
+ });
18
+ ListboxItem.displayName = "ListboxItem";
19
+
20
+ export { ListboxItem };
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const useListboxContext = require('./use-listbox-context.cjs');
11
+
12
+ const ListboxLabel = react.forwardRef((props, ref) => {
13
+ const listbox = useListboxContext.useListboxContext();
14
+ const mergedProps = react$1.mergeProps(listbox.getLabelProps(), props);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref });
16
+ });
17
+ ListboxLabel.displayName = "ListboxLabel";
18
+
19
+ exports.ListboxLabel = ListboxLabel;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxLabelBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxLabelProps extends HTMLProps<'label'>, ListboxLabelBaseProps {
6
+ }
7
+ export declare const ListboxLabel: ForwardRefExoticComponent<ListboxLabelProps & RefAttributes<HTMLLabelElement>>;
@@ -0,0 +1,7 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxLabelBaseProps extends PolymorphicProps {
4
+ }
5
+ export interface ListboxLabelProps extends HTMLProps<'label'>, ListboxLabelBaseProps {
6
+ }
7
+ export declare const ListboxLabel: ForwardRefExoticComponent<ListboxLabelProps & RefAttributes<HTMLLabelElement>>;
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.js';
6
+ import { useListboxContext } from './use-listbox-context.js';
7
+
8
+ const ListboxLabel = forwardRef((props, ref) => {
9
+ const listbox = useListboxContext();
10
+ const mergedProps = mergeProps(listbox.getLabelProps(), props);
11
+ return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });
12
+ });
13
+ ListboxLabel.displayName = "ListboxLabel";
14
+
15
+ export { ListboxLabel };
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const createSplitProps = require('../../utils/create-split-props.cjs');
10
+ const factory = require('../factory.cjs');
11
+ const useListboxContext = require('./use-listbox-context.cjs');
12
+
13
+ const ListboxImpl = (props, ref) => {
14
+ const [{ value: listbox }, localProps] = createSplitProps.createSplitProps()(props, ["value"]);
15
+ const mergedProps = react$1.mergeProps(listbox.getRootProps(), localProps);
16
+ return /* @__PURE__ */ jsxRuntime.jsx(useListboxContext.ListboxProvider, { value: listbox, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
17
+ };
18
+ const ListboxRootProvider = react.forwardRef(ListboxImpl);
19
+
20
+ exports.ListboxRootProvider = ListboxRootProvider;
@@ -0,0 +1,14 @@
1
+ import { JSX } from 'react';
2
+ import { CollectionItem } from '../collection';
3
+ import { HTMLProps, PolymorphicProps } from '../factory';
4
+ import { UseListboxReturn } from './use-listbox';
5
+ interface RootProviderProps<T extends CollectionItem> {
6
+ value: UseListboxReturn<T>;
7
+ }
8
+ export interface ListboxRootProviderBaseProps<T extends CollectionItem> extends RootProviderProps<T>, PolymorphicProps {
9
+ }
10
+ export interface ListboxRootProviderProps<T extends CollectionItem> extends HTMLProps<'div'>, ListboxRootProviderBaseProps<T> {
11
+ }
12
+ export type ListboxComponent = <T extends CollectionItem>(props: ListboxRootProviderProps<T> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
13
+ export declare const ListboxRootProvider: ListboxComponent;
14
+ export {};
@@ -0,0 +1,14 @@
1
+ import { JSX } from 'react';
2
+ import { CollectionItem } from '../collection';
3
+ import { HTMLProps, PolymorphicProps } from '../factory';
4
+ import { UseListboxReturn } from './use-listbox';
5
+ interface RootProviderProps<T extends CollectionItem> {
6
+ value: UseListboxReturn<T>;
7
+ }
8
+ export interface ListboxRootProviderBaseProps<T extends CollectionItem> extends RootProviderProps<T>, PolymorphicProps {
9
+ }
10
+ export interface ListboxRootProviderProps<T extends CollectionItem> extends HTMLProps<'div'>, ListboxRootProviderBaseProps<T> {
11
+ }
12
+ export type ListboxComponent = <T extends CollectionItem>(props: ListboxRootProviderProps<T> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
13
+ export declare const ListboxRootProvider: ListboxComponent;
14
+ export {};
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { createSplitProps } from '../../utils/create-split-props.js';
6
+ import { ark } from '../factory.js';
7
+ import { ListboxProvider } from './use-listbox-context.js';
8
+
9
+ const ListboxImpl = (props, ref) => {
10
+ const [{ value: listbox }, localProps] = createSplitProps()(props, ["value"]);
11
+ const mergedProps = mergeProps(listbox.getRootProps(), localProps);
12
+ return /* @__PURE__ */ jsx(ListboxProvider, { value: listbox, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
13
+ };
14
+ const ListboxRootProvider = forwardRef(ListboxImpl);
15
+
16
+ export { ListboxRootProvider };
@@ -0,0 +1,42 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const createSplitProps = require('../../utils/create-split-props.cjs');
10
+ const factory = require('../factory.cjs');
11
+ const useListbox = require('./use-listbox.cjs');
12
+ const useListboxContext = require('./use-listbox-context.cjs');
13
+
14
+ const ListboxImpl = (props, ref) => {
15
+ const [useListboxProps, localProps] = createSplitProps.createSplitProps()(props, [
16
+ "collection",
17
+ "defaultHighlightedValue",
18
+ "defaultValue",
19
+ "deselectable",
20
+ "disabled",
21
+ "disallowSelectAll",
22
+ "highlightedValue",
23
+ "id",
24
+ "ids",
25
+ "loopFocus",
26
+ "onHighlightChange",
27
+ "onSelect",
28
+ "onValueChange",
29
+ "orientation",
30
+ "scrollToIndexFn",
31
+ "selectionMode",
32
+ "selectOnHighlight",
33
+ "typeahead",
34
+ "value"
35
+ ]);
36
+ const listbox = useListbox.useListbox(useListboxProps);
37
+ const mergedProps = react$1.mergeProps(listbox.getRootProps(), localProps);
38
+ return /* @__PURE__ */ jsxRuntime.jsx(useListboxContext.ListboxProvider, { value: listbox, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
39
+ };
40
+ const ListboxRoot = react.forwardRef(ListboxImpl);
41
+
42
+ exports.ListboxRoot = ListboxRoot;
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { Assign } from '../../types';
3
+ import { CollectionItem } from '../collection';
4
+ import { HTMLProps, PolymorphicProps } from '../factory';
5
+ import { UseListboxProps } from './use-listbox';
6
+ export interface ListboxRootBaseProps<T extends CollectionItem> extends UseListboxProps<T>, PolymorphicProps {
7
+ }
8
+ export interface ListboxRootProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ListboxRootBaseProps<T>> {
9
+ }
10
+ export type ListboxComponent = <T extends CollectionItem>(props: ListboxRootProps<T> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
11
+ export declare const ListboxRoot: ListboxComponent;
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'react';
2
+ import { Assign } from '../../types';
3
+ import { CollectionItem } from '../collection';
4
+ import { HTMLProps, PolymorphicProps } from '../factory';
5
+ import { UseListboxProps } from './use-listbox';
6
+ export interface ListboxRootBaseProps<T extends CollectionItem> extends UseListboxProps<T>, PolymorphicProps {
7
+ }
8
+ export interface ListboxRootProps<T extends CollectionItem> extends Assign<HTMLProps<'div'>, ListboxRootBaseProps<T>> {
9
+ }
10
+ export type ListboxComponent = <T extends CollectionItem>(props: ListboxRootProps<T> & React.RefAttributes<HTMLDivElement>) => JSX.Element;
11
+ export declare const ListboxRoot: ListboxComponent;
@@ -0,0 +1,38 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { createSplitProps } from '../../utils/create-split-props.js';
6
+ import { ark } from '../factory.js';
7
+ import { useListbox } from './use-listbox.js';
8
+ import { ListboxProvider } from './use-listbox-context.js';
9
+
10
+ const ListboxImpl = (props, ref) => {
11
+ const [useListboxProps, localProps] = createSplitProps()(props, [
12
+ "collection",
13
+ "defaultHighlightedValue",
14
+ "defaultValue",
15
+ "deselectable",
16
+ "disabled",
17
+ "disallowSelectAll",
18
+ "highlightedValue",
19
+ "id",
20
+ "ids",
21
+ "loopFocus",
22
+ "onHighlightChange",
23
+ "onSelect",
24
+ "onValueChange",
25
+ "orientation",
26
+ "scrollToIndexFn",
27
+ "selectionMode",
28
+ "selectOnHighlight",
29
+ "typeahead",
30
+ "value"
31
+ ]);
32
+ const listbox = useListbox(useListboxProps);
33
+ const mergedProps = mergeProps(listbox.getRootProps(), localProps);
34
+ return /* @__PURE__ */ jsx(ListboxProvider, { value: listbox, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
35
+ };
36
+ const ListboxRoot = forwardRef(ListboxImpl);
37
+
38
+ export { ListboxRoot };
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const jsxRuntime = require('react/jsx-runtime');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const factory = require('../factory.cjs');
10
+ const useListboxContext = require('./use-listbox-context.cjs');
11
+
12
+ const ListboxValueText = react.forwardRef((props, ref) => {
13
+ const { children, placeholder, ...localprops } = props;
14
+ const listbox = useListboxContext.useListboxContext();
15
+ const mergedProps = react$1.mergeProps(listbox.getValueTextProps(), localprops);
16
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.span, { ...mergedProps, ref, children: children || listbox.valueAsString || placeholder });
17
+ });
18
+ ListboxValueText.displayName = "ListboxValueText";
19
+
20
+ exports.ListboxValueText = ListboxValueText;
@@ -0,0 +1,11 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxValueTextBaseProps extends PolymorphicProps {
4
+ /**
5
+ * Text to display when no value is listboxed.
6
+ */
7
+ placeholder?: string;
8
+ }
9
+ export interface ListboxValueTextProps extends HTMLProps<'span'>, ListboxValueTextBaseProps {
10
+ }
11
+ export declare const ListboxValueText: ForwardRefExoticComponent<ListboxValueTextProps & RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,11 @@
1
+ import { HTMLProps, PolymorphicProps } from '../factory';
2
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ export interface ListboxValueTextBaseProps extends PolymorphicProps {
4
+ /**
5
+ * Text to display when no value is listboxed.
6
+ */
7
+ placeholder?: string;
8
+ }
9
+ export interface ListboxValueTextProps extends HTMLProps<'span'>, ListboxValueTextBaseProps {
10
+ }
11
+ export declare const ListboxValueText: ForwardRefExoticComponent<ListboxValueTextProps & RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,16 @@
1
+ 'use client';
2
+ import { jsx } from 'react/jsx-runtime';
3
+ import { mergeProps } from '@zag-js/react';
4
+ import { forwardRef } from 'react';
5
+ import { ark } from '../factory.js';
6
+ import { useListboxContext } from './use-listbox-context.js';
7
+
8
+ const ListboxValueText = forwardRef((props, ref) => {
9
+ const { children, placeholder, ...localprops } = props;
10
+ const listbox = useListboxContext();
11
+ const mergedProps = mergeProps(listbox.getValueTextProps(), localprops);
12
+ return /* @__PURE__ */ jsx(ark.span, { ...mergedProps, ref, children: children || listbox.valueAsString || placeholder });
13
+ });
14
+ ListboxValueText.displayName = "ListboxValueText";
15
+
16
+ export { ListboxValueText };
@@ -0,0 +1 @@
1
+ export { anatomy as listboxAnatomy } from '@zag-js/listbox';
@@ -0,0 +1 @@
1
+ export { anatomy as listboxAnatomy } from '@zag-js/listbox';