@ark-ui/react 2.0.2 → 2.1.1

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 (131) hide show
  1. package/CHANGELOG.md +40 -3
  2. package/clipboard/clipboard-context.cjs +15 -0
  3. package/clipboard/clipboard-context.d.ts +6 -0
  4. package/clipboard/clipboard-context.mjs +10 -0
  5. package/clipboard/clipboard-control.cjs +19 -0
  6. package/clipboard/clipboard-control.d.ts +6 -0
  7. package/clipboard/clipboard-control.mjs +15 -0
  8. package/clipboard/clipboard-indicator.cjs +22 -0
  9. package/clipboard/clipboard-indicator.d.ts +6 -0
  10. package/clipboard/clipboard-indicator.mjs +18 -0
  11. package/clipboard/clipboard-input.cjs +19 -0
  12. package/clipboard/clipboard-input.d.ts +6 -0
  13. package/clipboard/clipboard-input.mjs +15 -0
  14. package/clipboard/clipboard-label.cjs +19 -0
  15. package/clipboard/clipboard-label.d.ts +6 -0
  16. package/clipboard/clipboard-label.mjs +15 -0
  17. package/clipboard/clipboard-root.cjs +27 -0
  18. package/clipboard/clipboard-root.d.ts +9 -0
  19. package/clipboard/clipboard-root.mjs +23 -0
  20. package/clipboard/clipboard-trigger.cjs +21 -0
  21. package/clipboard/clipboard-trigger.d.ts +6 -0
  22. package/clipboard/clipboard-trigger.mjs +17 -0
  23. package/clipboard/clipboard.cjs +19 -0
  24. package/clipboard/clipboard.d.ts +7 -0
  25. package/clipboard/clipboard.mjs +6 -0
  26. package/clipboard/index.cjs +24 -0
  27. package/clipboard/index.d.ts +11 -0
  28. package/clipboard/index.mjs +10 -0
  29. package/clipboard/use-clipboard.cjs +43 -0
  30. package/clipboard/use-clipboard.d.ts +8 -0
  31. package/clipboard/use-clipboard.mjs +20 -0
  32. package/color-picker/use-color-picker.cjs +2 -1
  33. package/color-picker/use-color-picker.d.ts +1 -1
  34. package/color-picker/use-color-picker.mjs +2 -1
  35. package/date-picker/date-picker-input.cjs +3 -1
  36. package/date-picker/date-picker-input.d.ts +3 -1
  37. package/date-picker/date-picker-input.mjs +3 -1
  38. package/date-picker/date-picker-preset-trigger.cjs +25 -0
  39. package/date-picker/date-picker-preset-trigger.d.ts +8 -0
  40. package/date-picker/date-picker-preset-trigger.mjs +21 -0
  41. package/date-picker/date-picker.cjs +2 -0
  42. package/date-picker/date-picker.d.ts +2 -1
  43. package/date-picker/date-picker.mjs +1 -0
  44. package/date-picker/index.cjs +2 -0
  45. package/date-picker/index.d.ts +3 -2
  46. package/date-picker/index.mjs +1 -0
  47. package/date-picker/use-date-picker.cjs +2 -1
  48. package/date-picker/use-date-picker.d.ts +1 -1
  49. package/date-picker/use-date-picker.mjs +2 -1
  50. package/dialog/dialog-root.cjs +2 -2
  51. package/dialog/dialog-root.mjs +1 -1
  52. package/dialog/use-dialog.cjs +2 -1
  53. package/dialog/use-dialog.d.ts +1 -1
  54. package/dialog/use-dialog.mjs +2 -1
  55. package/factory.cjs +2 -2
  56. package/factory.mjs +1 -1
  57. package/hover-card/use-hover-card.cjs +2 -1
  58. package/hover-card/use-hover-card.d.ts +1 -1
  59. package/hover-card/use-hover-card.mjs +2 -1
  60. package/index.cjs +25 -0
  61. package/index.d.ts +2 -0
  62. package/index.mjs +14 -0
  63. package/locale/index.cjs +11 -0
  64. package/locale/index.d.ts +2 -0
  65. package/locale/index.mjs +2 -0
  66. package/locale/locale-context.cjs +18 -0
  67. package/locale/locale-context.d.ts +6 -0
  68. package/locale/locale-context.mjs +13 -0
  69. package/locale/locale.cjs +31 -0
  70. package/locale/locale.d.ts +14 -0
  71. package/locale/locale.mjs +27 -0
  72. package/menu/use-menu.cjs +2 -1
  73. package/menu/use-menu.d.ts +1 -1
  74. package/menu/use-menu.mjs +2 -1
  75. package/package.json +65 -51
  76. package/popover/use-popover.cjs +2 -1
  77. package/popover/use-popover.d.ts +1 -1
  78. package/popover/use-popover.mjs +2 -1
  79. package/select/use-select.cjs +2 -1
  80. package/select/use-select.d.ts +1 -1
  81. package/select/use-select.mjs +2 -1
  82. package/tooltip/use-tooltip.cjs +2 -1
  83. package/tooltip/use-tooltip.d.ts +1 -1
  84. package/tooltip/use-tooltip.mjs +2 -1
  85. package/tree-view/index.cjs +2 -0
  86. package/tree-view/index.d.ts +3 -2
  87. package/tree-view/index.mjs +1 -0
  88. package/tree-view/tree-view-branch-content.cjs +3 -7
  89. package/tree-view/tree-view-branch-content.d.ts +1 -3
  90. package/tree-view/tree-view-branch-content.mjs +3 -7
  91. package/tree-view/tree-view-branch-context.cjs +15 -0
  92. package/tree-view/tree-view-branch-context.d.ts +8 -0
  93. package/tree-view/tree-view-branch-context.mjs +10 -0
  94. package/tree-view/tree-view-branch-control.cjs +3 -7
  95. package/tree-view/tree-view-branch-control.d.ts +1 -3
  96. package/tree-view/tree-view-branch-control.mjs +3 -7
  97. package/tree-view/tree-view-branch-indicator.cjs +4 -7
  98. package/tree-view/tree-view-branch-indicator.d.ts +1 -3
  99. package/tree-view/tree-view-branch-indicator.mjs +4 -7
  100. package/tree-view/tree-view-branch-text.cjs +3 -7
  101. package/tree-view/tree-view-branch-text.d.ts +1 -3
  102. package/tree-view/tree-view-branch-text.mjs +3 -7
  103. package/tree-view/tree-view-branch-trigger.cjs +3 -7
  104. package/tree-view/tree-view-branch-trigger.d.ts +1 -3
  105. package/tree-view/tree-view-branch-trigger.mjs +3 -7
  106. package/tree-view/tree-view-branch.cjs +8 -5
  107. package/tree-view/tree-view-branch.d.ts +3 -2
  108. package/tree-view/tree-view-branch.mjs +8 -5
  109. package/tree-view/tree-view-context.d.ts +0 -16
  110. package/tree-view/tree-view-depth-context.cjs +17 -0
  111. package/tree-view/tree-view-depth-context.d.ts +4 -0
  112. package/tree-view/tree-view-depth-context.mjs +12 -0
  113. package/tree-view/tree-view-item-context.cjs +15 -0
  114. package/tree-view/tree-view-item-context.d.ts +8 -0
  115. package/tree-view/tree-view-item-context.mjs +10 -0
  116. package/tree-view/tree-view-item-indicator.cjs +23 -0
  117. package/tree-view/tree-view-item-indicator.d.ts +6 -0
  118. package/tree-view/tree-view-item-indicator.mjs +19 -0
  119. package/tree-view/tree-view-item-text.cjs +3 -12
  120. package/tree-view/tree-view-item-text.d.ts +1 -3
  121. package/tree-view/tree-view-item-text.mjs +3 -12
  122. package/tree-view/tree-view-item.cjs +6 -3
  123. package/tree-view/tree-view-item.d.ts +2 -1
  124. package/tree-view/tree-view-item.mjs +6 -3
  125. package/tree-view/tree-view-root.cjs +2 -2
  126. package/tree-view/tree-view-root.mjs +2 -2
  127. package/tree-view/tree-view-tree.cjs +2 -1
  128. package/tree-view/tree-view-tree.mjs +2 -1
  129. package/tree-view/tree-view.cjs +2 -0
  130. package/tree-view/tree-view.d.ts +2 -1
  131. package/tree-view/tree-view.mjs +1 -0
package/CHANGELOG.md CHANGED
@@ -6,16 +6,53 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [2.1.1] - 2024-02-14
10
+
11
+ ### Fixed
12
+
13
+ - Resolved an issue where the `Clipboard` component was missing a specifier in the `@ark-ui/react` package.
14
+
15
+ ## [2.1.0] - 2024-02-14
16
+
17
+ ### Added
18
+
19
+ - Introduced `Clipboard` component. Refer to the [documentation](https://ark-ui.com/docs/components/clipboard) for details.
20
+ - Implemented programmable control over the open state for `ColorPicker`, `DatePicker`, `Dialog`, `HoverCard`, `Menu`, `Popover`, `Select`, and `Tooltip`.
21
+ - Added a `PresetTrigger` part to the `DatePicker` component, enabling custom triggers for common date presets (e.g., Last 7 days, Last 30 days).
22
+ - Enhanced the `DatePicker.Control` component to support multiple inputs by introducing an optional `index` attribute to `DatePicker.Input`. Example usage:
23
+
24
+ ```jsx
25
+ <DatePicker.Control>
26
+ <DatePicker.Input index={0} />
27
+ <DatePicker.Input index={1} />
28
+ </DatePicker.Control>
29
+ ```
30
+
31
+ ### Changed
32
+
33
+ - Refined the `TreeView` component API for streamlined component usage. See the [documentation](https://ark-ui.com/docs/components/tree-view) for details.
34
+
35
+ ### Fixed
36
+
37
+ - Resolved unintentional interactions when clicking the scrollbar.
38
+ - Addressed an issue where positioned components failed to adjust to window resizing.
39
+ - Corrected a behavior where restoring scroll position triggered a smooth scroll effect back to the starting point.
40
+ - Rectified a problem in `Combobox`, `Menu`, and `Select` where scrolling into view inadvertently scrolled the body element.
41
+ - Fixed a discrepancy in `DatePicker` regarding the incorrect display of weeks when setting `startOfWeek`.
42
+ - Solved an issue in the `Editable` preventing text deletion upon reaching `maxLength`.
43
+ - Corrected an issue in the `Select` where an item group's label `id` was misdirected.
44
+ - Adjusted `Select` to use the correct `id` for the `aria-activedescendant` attribute.
45
+
9
46
  ## [2.0.2] - 2024-02-10
10
47
 
11
48
  ### Added
12
49
 
13
- - Exported `SelectionDetails` type for `Menu` component
50
+ - Exported `SelectionDetails` type for the `Menu` component.
14
51
 
15
52
  ### Changed
16
53
 
17
- - Changed `Dialog.Description` and `Popover.Description` from `p` to `div` to allow for multiple paragraphs.
18
- - Changed `TreeView.BranchTrigger` from `button` to `div` for the accessibility reasons.
54
+ - Updated `Dialog.Description` and `Popover.Description` elements from `p` to `div` for better paragraph handling.
55
+ - Altered `TreeView.BranchTrigger` element from `button` to `div` for accessibility enhancements.
19
56
 
20
57
  ### Fixed
21
58
 
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const createContext = require('../create-context.cjs');
7
+
8
+ const [ClipboardProvider, useClipboardContext] = createContext.createContext({
9
+ name: "ClipboardContext",
10
+ hookName: "useClipboardContext",
11
+ providerName: "<ClipboardProvider />"
12
+ });
13
+
14
+ exports.ClipboardProvider = ClipboardProvider;
15
+ exports.useClipboardContext = useClipboardContext;
@@ -0,0 +1,6 @@
1
+ import { Provider } from 'react';
2
+ /// <reference types="react" />
3
+ import { type UseClipboardReturn } from './use-clipboard';
4
+ export interface ClipboardContext extends UseClipboardReturn {
5
+ }
6
+ export declare const ClipboardProvider: Provider<ClipboardContext>, useClipboardContext: () => ClipboardContext;
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { createContext } from '../create-context.mjs';
3
+
4
+ const [ClipboardProvider, useClipboardContext] = createContext({
5
+ name: "ClipboardContext",
6
+ hookName: "useClipboardContext",
7
+ providerName: "<ClipboardProvider />"
8
+ });
9
+
10
+ export { ClipboardProvider, useClipboardContext };
@@ -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 clipboardContext = require('./clipboard-context.cjs');
11
+
12
+ const ClipboardControl = react.forwardRef((props, ref) => {
13
+ const api = clipboardContext.useClipboardContext();
14
+ const mergedProps = react$1.mergeProps(api.controlProps, props);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
16
+ });
17
+ ClipboardControl.displayName = "ClipboardControl";
18
+
19
+ exports.ClipboardControl = ClipboardControl;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ClipboardControlProps extends HTMLArkProps<'div'> {
5
+ }
6
+ export declare const ClipboardControl: ForwardRefExoticComponent<ClipboardControlProps & RefAttributes<HTMLDivElement>>;
@@ -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.mjs';
6
+ import { useClipboardContext } from './clipboard-context.mjs';
7
+
8
+ const ClipboardControl = forwardRef((props, ref) => {
9
+ const api = useClipboardContext();
10
+ const mergedProps = mergeProps(api.controlProps, props);
11
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
12
+ });
13
+ ClipboardControl.displayName = "ClipboardControl";
14
+
15
+ export { ClipboardControl };
@@ -0,0 +1,22 @@
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 clipboardContext = require('./clipboard-context.cjs');
11
+
12
+ const ClipboardIndicator = react.forwardRef(
13
+ (props, ref) => {
14
+ const { children, copied, ...localProps } = props;
15
+ const api = clipboardContext.useClipboardContext();
16
+ const mergedProps = react$1.mergeProps(api.getIndicatorProps({ copied: api.isCopied }), localProps);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref, children: api.isCopied ? copied : children });
18
+ }
19
+ );
20
+ ClipboardIndicator.displayName = "Clipb oardIndicator";
21
+
22
+ exports.ClipboardIndicator = ClipboardIndicator;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes, type ReactNode } from 'react';
2
+ import { type HTMLArkProps } from '../factory';
3
+ export interface ClipboardIndicatorProps extends HTMLArkProps<'div'> {
4
+ copied?: ReactNode;
5
+ }
6
+ export declare const ClipboardIndicator: ForwardRefExoticComponent<ClipboardIndicatorProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,18 @@
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.mjs';
6
+ import { useClipboardContext } from './clipboard-context.mjs';
7
+
8
+ const ClipboardIndicator = forwardRef(
9
+ (props, ref) => {
10
+ const { children, copied, ...localProps } = props;
11
+ const api = useClipboardContext();
12
+ const mergedProps = mergeProps(api.getIndicatorProps({ copied: api.isCopied }), localProps);
13
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: api.isCopied ? copied : children });
14
+ }
15
+ );
16
+ ClipboardIndicator.displayName = "Clipb oardIndicator";
17
+
18
+ export { ClipboardIndicator };
@@ -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 clipboardContext = require('./clipboard-context.cjs');
11
+
12
+ const ClipboardInput = react.forwardRef((props, ref) => {
13
+ const api = clipboardContext.useClipboardContext();
14
+ const mergedProps = react$1.mergeProps(api.inputProps, props);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { ...mergedProps, ref });
16
+ });
17
+ ClipboardInput.displayName = "ClipboardInput";
18
+
19
+ exports.ClipboardInput = ClipboardInput;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ClipboardInputProps extends HTMLArkProps<'input'> {
5
+ }
6
+ export declare const ClipboardInput: ForwardRefExoticComponent<ClipboardInputProps & RefAttributes<HTMLInputElement>>;
@@ -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.mjs';
6
+ import { useClipboardContext } from './clipboard-context.mjs';
7
+
8
+ const ClipboardInput = forwardRef((props, ref) => {
9
+ const api = useClipboardContext();
10
+ const mergedProps = mergeProps(api.inputProps, props);
11
+ return /* @__PURE__ */ jsx(ark.input, { ...mergedProps, ref });
12
+ });
13
+ ClipboardInput.displayName = "ClipboardInput";
14
+
15
+ export { ClipboardInput };
@@ -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 clipboardContext = require('./clipboard-context.cjs');
11
+
12
+ const ClipboardLabel = react.forwardRef((props, ref) => {
13
+ const api = clipboardContext.useClipboardContext();
14
+ const mergedProps = react$1.mergeProps(api.labelProps, props);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.label, { ...mergedProps, ref });
16
+ });
17
+ ClipboardLabel.displayName = "ClipboardLabel";
18
+
19
+ exports.ClipboardLabel = ClipboardLabel;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ClipboardLabelProps extends HTMLArkProps<'label'> {
5
+ }
6
+ export declare const ClipboardLabel: ForwardRefExoticComponent<ClipboardLabelProps & 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.mjs';
6
+ import { useClipboardContext } from './clipboard-context.mjs';
7
+
8
+ const ClipboardLabel = forwardRef((props, ref) => {
9
+ const api = useClipboardContext();
10
+ const mergedProps = mergeProps(api.labelProps, props);
11
+ return /* @__PURE__ */ jsx(ark.label, { ...mergedProps, ref });
12
+ });
13
+ ClipboardLabel.displayName = "ClipboardLabel";
14
+
15
+ export { ClipboardLabel };
@@ -0,0 +1,27 @@
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('../create-split-props.cjs');
10
+ const factory = require('../factory.cjs');
11
+ const runIfFn = require('../run-if-fn.cjs');
12
+ const clipboardContext = require('./clipboard-context.cjs');
13
+ const useClipboard = require('./use-clipboard.cjs');
14
+
15
+ const ClipboardRoot = react.forwardRef((props, ref) => {
16
+ const [useClipboardProps, { children, ...localProps }] = createSplitProps.createSplitProps()(
17
+ props,
18
+ ["getRootNode", "id", "ids", "value", "timeout", "onCopyStatusChange"]
19
+ );
20
+ const api = useClipboard.useClipboard(useClipboardProps);
21
+ const mergedProps = react$1.mergeProps(api.rootProps, localProps);
22
+ const view = runIfFn.runIfFn(children, api);
23
+ return /* @__PURE__ */ jsxRuntime.jsx(clipboardContext.ClipboardProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ref, ...mergedProps, children: view }) });
24
+ });
25
+ ClipboardRoot.displayName = "ClipboardRoot";
26
+
27
+ exports.ClipboardRoot = ClipboardRoot;
@@ -0,0 +1,9 @@
1
+ import { ForwardRefExoticComponent, RefAttributes, type ReactNode } from 'react';
2
+ import { type HTMLArkProps } from '../factory';
3
+ import type { Assign } from '../types';
4
+ import { type UseClipboardProps, type UseClipboardReturn } from './use-clipboard';
5
+ export interface ClipboardRootProps extends Assign<HTMLArkProps<'div'>, {
6
+ children?: ReactNode | ((api: UseClipboardReturn) => ReactNode);
7
+ }>, UseClipboardProps {
8
+ }
9
+ export declare const ClipboardRoot: ForwardRefExoticComponent<ClipboardRootProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,23 @@
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 '../create-split-props.mjs';
6
+ import { ark } from '../factory.mjs';
7
+ import { runIfFn } from '../run-if-fn.mjs';
8
+ import { ClipboardProvider } from './clipboard-context.mjs';
9
+ import { useClipboard } from './use-clipboard.mjs';
10
+
11
+ const ClipboardRoot = forwardRef((props, ref) => {
12
+ const [useClipboardProps, { children, ...localProps }] = createSplitProps()(
13
+ props,
14
+ ["getRootNode", "id", "ids", "value", "timeout", "onCopyStatusChange"]
15
+ );
16
+ const api = useClipboard(useClipboardProps);
17
+ const mergedProps = mergeProps(api.rootProps, localProps);
18
+ const view = runIfFn(children, api);
19
+ return /* @__PURE__ */ jsx(ClipboardProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ref, ...mergedProps, children: view }) });
20
+ });
21
+ ClipboardRoot.displayName = "ClipboardRoot";
22
+
23
+ export { ClipboardRoot };
@@ -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 clipboardContext = require('./clipboard-context.cjs');
11
+
12
+ const ClipboardTrigger = react.forwardRef(
13
+ (props, ref) => {
14
+ const api = clipboardContext.useClipboardContext();
15
+ const mergedProps = react$1.mergeProps(api.triggerProps, props);
16
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
17
+ }
18
+ );
19
+ ClipboardTrigger.displayName = "ClipboardTrigger";
20
+
21
+ exports.ClipboardTrigger = ClipboardTrigger;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ClipboardTriggerProps extends HTMLArkProps<'button'> {
5
+ }
6
+ export declare const ClipboardTrigger: ForwardRefExoticComponent<ClipboardTriggerProps & RefAttributes<HTMLButtonElement>>;
@@ -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.mjs';
6
+ import { useClipboardContext } from './clipboard-context.mjs';
7
+
8
+ const ClipboardTrigger = forwardRef(
9
+ (props, ref) => {
10
+ const api = useClipboardContext();
11
+ const mergedProps = mergeProps(api.triggerProps, props);
12
+ return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
13
+ }
14
+ );
15
+ ClipboardTrigger.displayName = "ClipboardTrigger";
16
+
17
+ export { ClipboardTrigger };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const clipboardControl = require('./clipboard-control.cjs');
6
+ const clipboardIndicator = require('./clipboard-indicator.cjs');
7
+ const clipboardInput = require('./clipboard-input.cjs');
8
+ const clipboardLabel = require('./clipboard-label.cjs');
9
+ const clipboardRoot = require('./clipboard-root.cjs');
10
+ const clipboardTrigger = require('./clipboard-trigger.cjs');
11
+
12
+
13
+
14
+ exports.Control = clipboardControl.ClipboardControl;
15
+ exports.Indicator = clipboardIndicator.ClipboardIndicator;
16
+ exports.Input = clipboardInput.ClipboardInput;
17
+ exports.Label = clipboardLabel.ClipboardLabel;
18
+ exports.Root = clipboardRoot.ClipboardRoot;
19
+ exports.Trigger = clipboardTrigger.ClipboardTrigger;
@@ -0,0 +1,7 @@
1
+ import { ClipboardControl as Control } from './clipboard-control';
2
+ import { ClipboardIndicator as Indicator } from './clipboard-indicator';
3
+ import { ClipboardInput as Input } from './clipboard-input';
4
+ import { ClipboardLabel as Label } from './clipboard-label';
5
+ import { ClipboardRoot as Root } from './clipboard-root';
6
+ import { ClipboardTrigger as Trigger } from './clipboard-trigger';
7
+ export { Control, Indicator, Input, Label, Root, Trigger };
@@ -0,0 +1,6 @@
1
+ export { ClipboardControl as Control } from './clipboard-control.mjs';
2
+ export { ClipboardIndicator as Indicator } from './clipboard-indicator.mjs';
3
+ export { ClipboardInput as Input } from './clipboard-input.mjs';
4
+ export { ClipboardLabel as Label } from './clipboard-label.mjs';
5
+ export { ClipboardRoot as Root } from './clipboard-root.mjs';
6
+ export { ClipboardTrigger as Trigger } from './clipboard-trigger.mjs';
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ require('@zag-js/clipboard');
6
+ const clipboardContext = require('./clipboard-context.cjs');
7
+ const clipboardControl = require('./clipboard-control.cjs');
8
+ const clipboardIndicator = require('./clipboard-indicator.cjs');
9
+ const clipboardInput = require('./clipboard-input.cjs');
10
+ const clipboardLabel = require('./clipboard-label.cjs');
11
+ const clipboardRoot = require('./clipboard-root.cjs');
12
+ const clipboardTrigger = require('./clipboard-trigger.cjs');
13
+ const clipboard = require('./clipboard.cjs');
14
+
15
+
16
+
17
+ exports.useClipboardContext = clipboardContext.useClipboardContext;
18
+ exports.ClipboardControl = clipboardControl.ClipboardControl;
19
+ exports.ClipboardIndicator = clipboardIndicator.ClipboardIndicator;
20
+ exports.ClipboardInput = clipboardInput.ClipboardInput;
21
+ exports.ClipboardLabel = clipboardLabel.ClipboardLabel;
22
+ exports.ClipboardRoot = clipboardRoot.ClipboardRoot;
23
+ exports.ClipboardTrigger = clipboardTrigger.ClipboardTrigger;
24
+ exports.Clipboard = clipboard;
@@ -0,0 +1,11 @@
1
+ import { type CopyStatusDetails as ClipboardCopyStatusDetails } from '@zag-js/clipboard';
2
+ import { useClipboardContext, type ClipboardContext } from './clipboard-context';
3
+ import { ClipboardControl, type ClipboardControlProps } from './clipboard-control';
4
+ import { ClipboardIndicator, type ClipboardIndicatorProps } from './clipboard-indicator';
5
+ import { ClipboardInput, type ClipboardInputProps } from './clipboard-input';
6
+ import { ClipboardLabel, type ClipboardLabelProps } from './clipboard-label';
7
+ import { ClipboardRoot, type ClipboardRootProps } from './clipboard-root';
8
+ import { ClipboardTrigger, type ClipboardTriggerProps } from './clipboard-trigger';
9
+ export * as Clipboard from './clipboard';
10
+ export { ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardTrigger, useClipboardContext, };
11
+ export type { ClipboardContext, ClipboardControlProps, ClipboardCopyStatusDetails, ClipboardIndicatorProps, ClipboardInputProps, ClipboardLabelProps, ClipboardRootProps, ClipboardTriggerProps, };
@@ -0,0 +1,10 @@
1
+ import '@zag-js/clipboard';
2
+ export { useClipboardContext } from './clipboard-context.mjs';
3
+ export { ClipboardControl } from './clipboard-control.mjs';
4
+ export { ClipboardIndicator } from './clipboard-indicator.mjs';
5
+ export { ClipboardInput } from './clipboard-input.mjs';
6
+ export { ClipboardLabel } from './clipboard-label.mjs';
7
+ export { ClipboardRoot } from './clipboard-root.mjs';
8
+ export { ClipboardTrigger } from './clipboard-trigger.mjs';
9
+ import * as clipboard from './clipboard.mjs';
10
+ export { clipboard as Clipboard };
@@ -0,0 +1,43 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
+
6
+ const clipboard = require('@zag-js/clipboard');
7
+ const react$1 = require('@zag-js/react');
8
+ const react = require('react');
9
+ const environmentContext = require('../environment/environment-context.cjs');
10
+
11
+ function _interopNamespaceDefault(e) {
12
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
13
+ if (e) {
14
+ for (const k in e) {
15
+ if (k !== 'default') {
16
+ const d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: () => e[k]
20
+ });
21
+ }
22
+ }
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ const clipboard__namespace = /*#__PURE__*/_interopNamespaceDefault(clipboard);
29
+
30
+ const useClipboard = (props) => {
31
+ const initialContext = {
32
+ id: react.useId(),
33
+ getRootNode: environmentContext.useEnvironmentContext(),
34
+ ...props
35
+ };
36
+ const context = {
37
+ ...initialContext
38
+ };
39
+ const [state, send] = react$1.useMachine(clipboard__namespace.machine(initialContext), { context });
40
+ return clipboard__namespace.connect(state, send, react$1.normalizeProps);
41
+ };
42
+
43
+ exports.useClipboard = useClipboard;
@@ -0,0 +1,8 @@
1
+ import * as clipboard from '@zag-js/clipboard';
2
+ import { type PropTypes } from '@zag-js/react';
3
+ import { type Optional } from '../types';
4
+ export interface UseClipboardProps extends Optional<clipboard.Context, 'id'> {
5
+ }
6
+ export interface UseClipboardReturn extends clipboard.Api<PropTypes> {
7
+ }
8
+ export declare const useClipboard: (props: UseClipboardProps) => clipboard.Api<PropTypes>;
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import * as clipboard from '@zag-js/clipboard';
3
+ import { useMachine, normalizeProps } from '@zag-js/react';
4
+ import { useId } from 'react';
5
+ import { useEnvironmentContext } from '../environment/environment-context.mjs';
6
+
7
+ const useClipboard = (props) => {
8
+ const initialContext = {
9
+ id: useId(),
10
+ getRootNode: useEnvironmentContext(),
11
+ ...props
12
+ };
13
+ const context = {
14
+ ...initialContext
15
+ };
16
+ const [state, send] = useMachine(clipboard.machine(initialContext), { context });
17
+ return clipboard.connect(state, send, normalizeProps);
18
+ };
19
+
20
+ export { useClipboard };
@@ -33,7 +33,8 @@ const useColorPicker = (props) => {
33
33
  id: react.useId(),
34
34
  getRootNode: environmentContext.useEnvironmentContext(),
35
35
  ...props,
36
- value: props.defaultValue ? colorPicker__namespace.parse(props.defaultValue) : void 0
36
+ value: props.defaultValue ? colorPicker__namespace.parse(props.defaultValue) : void 0,
37
+ "open.controlled": props.open !== void 0
37
38
  };
38
39
  const context = {
39
40
  ...initialContext,
@@ -1,7 +1,7 @@
1
1
  import * as colorPicker from '@zag-js/color-picker';
2
2
  import { type PropTypes } from '@zag-js/react';
3
3
  import type { Optional } from '../types';
4
- export interface UseColorPickerProps extends Optional<Omit<colorPicker.Context, 'value'>, 'id'> {
4
+ export interface UseColorPickerProps extends Omit<Optional<Omit<colorPicker.Context, 'value'>, 'id'>, 'open.controlled'> {
5
5
  /**
6
6
  * The initial value of the color picker.
7
7
  */
@@ -10,7 +10,8 @@ const useColorPicker = (props) => {
10
10
  id: useId(),
11
11
  getRootNode: useEnvironmentContext(),
12
12
  ...props,
13
- value: props.defaultValue ? colorPicker.parse(props.defaultValue) : void 0
13
+ value: props.defaultValue ? colorPicker.parse(props.defaultValue) : void 0,
14
+ "open.controlled": props.open !== void 0
14
15
  };
15
16
  const context = {
16
17
  ...initialContext,
@@ -6,12 +6,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6
6
  const jsxRuntime = require('react/jsx-runtime');
7
7
  const react$1 = require('@zag-js/react');
8
8
  const react = require('react');
9
+ const createSplitProps = require('../create-split-props.cjs');
9
10
  const factory = require('../factory.cjs');
10
11
  const datePickerContext = require('./date-picker-context.cjs');
11
12
 
12
13
  const DatePickerInput = react.forwardRef((props, ref) => {
14
+ const [inputProps, localProps] = createSplitProps.createSplitProps()(props, ["index"]);
13
15
  const api = datePickerContext.useDatePickerContext();
14
- const mergedProps = react$1.mergeProps(api.inputProps, props);
16
+ const mergedProps = react$1.mergeProps(api.getInputProps(inputProps), localProps);
15
17
  return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.input, { ...mergedProps, ref });
16
18
  });
17
19
  DatePickerInput.displayName = "DatePickerInput";
@@ -1,6 +1,8 @@
1
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  /// <reference types="react" />
3
+ import type { InputProps } from '@zag-js/date-picker';
3
4
  import { type HTMLArkProps } from '../factory';
4
- export interface DatePickerInputProps extends HTMLArkProps<'input'> {
5
+ import type { Assign } from '../types';
6
+ export interface DatePickerInputProps extends Assign<HTMLArkProps<'input'>, InputProps> {
5
7
  }
6
8
  export declare const DatePickerInput: ForwardRefExoticComponent<DatePickerInputProps & RefAttributes<HTMLInputElement>>;
@@ -2,12 +2,14 @@
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { mergeProps } from '@zag-js/react';
4
4
  import { forwardRef } from 'react';
5
+ import { createSplitProps } from '../create-split-props.mjs';
5
6
  import { ark } from '../factory.mjs';
6
7
  import { useDatePickerContext } from './date-picker-context.mjs';
7
8
 
8
9
  const DatePickerInput = forwardRef((props, ref) => {
10
+ const [inputProps, localProps] = createSplitProps()(props, ["index"]);
9
11
  const api = useDatePickerContext();
10
- const mergedProps = mergeProps(api.inputProps, props);
12
+ const mergedProps = mergeProps(api.getInputProps(inputProps), localProps);
11
13
  return /* @__PURE__ */ jsx(ark.input, { ...mergedProps, ref });
12
14
  });
13
15
  DatePickerInput.displayName = "DatePickerInput";