@ark-ui/react 1.0.0 → 1.1.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 (94) hide show
  1. package/CHANGELOG.md +19 -57
  2. package/README.md +60 -67
  3. package/accordion/accordion.stories.d.ts +0 -1
  4. package/color-picker/color-picker-format-select.cjs +21 -0
  5. package/color-picker/color-picker-format-select.d.ts +6 -0
  6. package/color-picker/color-picker-format-select.mjs +17 -0
  7. package/color-picker/color-picker-format-trigger.cjs +19 -0
  8. package/color-picker/color-picker-format-trigger.d.ts +6 -0
  9. package/color-picker/color-picker-format-trigger.mjs +15 -0
  10. package/color-picker/color-picker-swatch-context.cjs +15 -0
  11. package/color-picker/color-picker-swatch-context.d.ts +6 -0
  12. package/color-picker/color-picker-swatch-context.mjs +10 -0
  13. package/color-picker/color-picker-swatch-indicator.cjs +21 -0
  14. package/color-picker/color-picker-swatch-indicator.d.ts +6 -0
  15. package/color-picker/color-picker-swatch-indicator.mjs +17 -0
  16. package/color-picker/color-picker-swatch-trigger.cjs +4 -1
  17. package/color-picker/color-picker-swatch-trigger.d.ts +1 -5
  18. package/color-picker/color-picker-swatch-trigger.mjs +4 -1
  19. package/color-picker/color-picker-swatch.cjs +4 -3
  20. package/color-picker/color-picker-swatch.mjs +4 -3
  21. package/color-picker/color-picker-transparency-grid.d.ts +2 -5
  22. package/color-picker/color-picker.cjs +3 -1
  23. package/color-picker/color-picker.mjs +3 -1
  24. package/color-picker/index.cjs +10 -0
  25. package/color-picker/index.d.ts +10 -3
  26. package/color-picker/index.mjs +7 -1
  27. package/color-picker/use-color-picker.cjs +1 -1
  28. package/color-picker/use-color-picker.d.ts +4 -1
  29. package/color-picker/use-color-picker.mjs +1 -1
  30. package/dialog/dialog-backdrop.cjs +6 -4
  31. package/dialog/dialog-backdrop.mjs +6 -4
  32. package/dialog/dialog.cjs +2 -1
  33. package/dialog/dialog.mjs +2 -1
  34. package/file-upload/file-upload-context.cjs +15 -0
  35. package/file-upload/file-upload-context.d.ts +6 -0
  36. package/file-upload/file-upload-context.mjs +10 -0
  37. package/file-upload/file-upload-dropzone.cjs +24 -0
  38. package/file-upload/file-upload-dropzone.d.ts +6 -0
  39. package/file-upload/file-upload-dropzone.mjs +20 -0
  40. package/file-upload/file-upload-item-context.cjs +15 -0
  41. package/file-upload/file-upload-item-context.d.ts +6 -0
  42. package/file-upload/file-upload-item-context.mjs +10 -0
  43. package/file-upload/file-upload-item-delete-trigger.cjs +21 -0
  44. package/file-upload/file-upload-item-delete-trigger.d.ts +6 -0
  45. package/file-upload/file-upload-item-delete-trigger.mjs +17 -0
  46. package/file-upload/file-upload-item-group.cjs +24 -0
  47. package/file-upload/file-upload-item-group.d.ts +8 -0
  48. package/file-upload/file-upload-item-group.mjs +20 -0
  49. package/file-upload/file-upload-item-name.cjs +24 -0
  50. package/file-upload/file-upload-item-name.d.ts +6 -0
  51. package/file-upload/file-upload-item-name.mjs +20 -0
  52. package/file-upload/file-upload-item-preview.cjs +31 -0
  53. package/file-upload/file-upload-item-preview.d.ts +6 -0
  54. package/file-upload/file-upload-item-preview.mjs +27 -0
  55. package/file-upload/file-upload-item-size-text.cjs +24 -0
  56. package/file-upload/file-upload-item-size-text.d.ts +6 -0
  57. package/file-upload/file-upload-item-size-text.mjs +20 -0
  58. package/file-upload/file-upload-item.cjs +24 -0
  59. package/file-upload/file-upload-item.d.ts +8 -0
  60. package/file-upload/file-upload-item.mjs +20 -0
  61. package/file-upload/file-upload-label.cjs +19 -0
  62. package/file-upload/file-upload-label.d.ts +6 -0
  63. package/file-upload/file-upload-label.mjs +15 -0
  64. package/file-upload/file-upload-trigger.cjs +21 -0
  65. package/file-upload/file-upload-trigger.d.ts +6 -0
  66. package/file-upload/file-upload-trigger.mjs +17 -0
  67. package/file-upload/file-upload.cjs +42 -0
  68. package/file-upload/file-upload.d.ts +9 -0
  69. package/file-upload/file-upload.mjs +38 -0
  70. package/file-upload/file-upload.stories.d.ts +7 -0
  71. package/file-upload/file-upload.test.d.ts +1 -0
  72. package/file-upload/index.cjs +41 -0
  73. package/file-upload/index.d.ts +27 -0
  74. package/file-upload/index.mjs +27 -0
  75. package/file-upload/use-file-upload.cjs +47 -0
  76. package/file-upload/use-file-upload.d.ts +8 -0
  77. package/file-upload/use-file-upload.mjs +24 -0
  78. package/index.cjs +68 -38
  79. package/index.d.ts +1 -0
  80. package/index.mjs +15 -0
  81. package/menu/menu-positioner.cjs +6 -0
  82. package/menu/menu-positioner.mjs +6 -0
  83. package/menu/menu-trigger.cjs +10 -1
  84. package/menu/menu-trigger.mjs +10 -1
  85. package/number-input/number-input.cjs +35 -30
  86. package/number-input/number-input.d.ts +5 -4
  87. package/number-input/number-input.mjs +35 -30
  88. package/number-input/number-input.stories.d.ts +1 -0
  89. package/package.json +53 -45
  90. package/radio-group/radio-group.stories.d.ts +1 -1
  91. package/select/select.stories.d.ts +1 -0
  92. package/slider/slider.stories.d.ts +1 -1
  93. package/toast/create-toaster.cjs +1 -1
  94. package/toast/create-toaster.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -6,82 +6,44 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [1.0.0] - 2023-11-09
10
-
11
- We are happy to announce the release of `@ark-ui/react@1.0.0`. This release includes a number of breaking changes, new features, and bug fixes. Since our last release over two months ago, we will only highlight some key changes. Please refer to the documentation for each component to learn more.
12
-
13
- ### Highlights
14
-
15
- - Revised the `Presence` component: `lazyMount` and `unmountOnExit` have been added at the root level. For some disclosure components like `Tabs` and `Accordion`, this constitutes a breaking change.
16
- - Breaking changes have been implemented in `Accordion`, `ColorPicker`, `DatePicker`, `Dialog`, `RadioGroup`, `SegmentGroup`, `TagsInput`, `Toast`, and `ToggleGroup` to achieve a consistent and more intuitive API.
17
- - Resolved various bugs and addressed accessibility issues across all components.
18
-
19
- ### Stability and Support
20
-
21
- With the release of version 1.0.0, we are moving towards a more stable version of `@ark-ui/react`. Future updates will strive to avoid breaking changes, ensuring a smoother experience for our users. If you encounter any issues while upgrading, please do not hesitate to open an issue on our [GitHub repository](https://github.com/chakra-ui/ark/issues). Your feedback is invaluable in helping us improve.
22
-
23
- ## [1.0.0-beta.5] - 2023-11-09
24
-
25
- - Integrate latest `@zag-js` packages
26
-
27
- ## [1.0.0-beta.4] - 2023-10-31
28
-
29
- ### Fixed
30
-
31
- - Resolved an accessibility issue with `Select`
32
-
33
- ## [1.0.0-beta.3] - 2023-10-26
9
+ ## [1.1.0] - 2023-11-21
34
10
 
35
11
  ### Added
36
12
 
37
- - Added support to lazy mount the `DatePicker` and `ColorPicker` components using the `Presence` component
13
+ - Added render function to the `NumberInput` component
14
+ - Added `FileUpload` component
38
15
 
39
16
  ### Changed
40
17
 
41
- - Improved accessibility of all disclosure components when lazy mounting is enabled.
42
-
43
- ## [1.0.0-beta.2] - 2023-10-25
44
-
45
- ### Added
46
-
47
- - Added `ValueText` to the `ColorPicker` component
18
+ - Revised the `ColorPicker` component. Check out the [documentation](https://ark-ui.com/docs/components/color-picker) for more information.
48
19
 
49
20
  ### Fixed
50
21
 
51
- - Added missing data attributes to `DatePickerView` component
52
-
53
- ## [1.0.0-beta.1] - 2023-10-20
54
-
55
- ### Added
22
+ - Resolved an issue where the `Toast` component would throw a warning when multiple toasts were rendered at the same time.
56
23
 
57
- - Parsed `focusedValue` in `DatePicker`
24
+ ## [1.0.1] - 2023-11-10
58
25
 
59
26
  ### Fixed
60
27
 
61
- - Resolved an issue with `@ark-ui/anatomy`
62
-
63
- ## [1.0.0-beta.0] - 2023-10-20
28
+ - Resolved an issue where the `Dialog` component would not animate on exit.
29
+ - Resolved various issues for `Menu` when lazy mounted.
30
+ - Resolved an issue where `MenuTrigger` could still work even when disabled.
31
+ - Resolved an issue where components like `Dialog`, `Popover` etc would not invoke `onExitComplete`
32
+ - Fixed an issue where placement of the `Combobox` could be incorrect when lazy mounted.
64
33
 
65
- ### Changed
66
-
67
- - Add memoization to `Select` and `Combobox` item collection to improve performance.
68
- - Ensure all event callbacks have a stable reference
34
+ ## [1.0.0] - 2023-11-09
69
35
 
70
- ### Fixed
36
+ We are happy to announce the release of `@ark-ui/react@1.0.0`. This release includes a number of breaking changes, new features, and bug fixes. Since our last release over two months ago, we will only highlight some key changes. Please refer to the documentation for each component to learn more.
71
37
 
72
- - Resolved an issue when controlling the `Editable` component.
38
+ ### Highlights
73
39
 
74
- ### Removed
40
+ - Revised the `Presence` component: `lazyMount` and `unmountOnExit` have been added at the root level. For some disclosure components like `Tabs` and `Accordion`, this constitutes a breaking change.
41
+ - Breaking changes have been implemented in `Accordion`, `ColorPicker`, `DatePicker`, `Dialog`, `RadioGroup`, `SegmentGroup`, `TagsInput`, `Toast`, and `ToggleGroup` to achieve a consistent and more intuitive API.
42
+ - Resolved various bugs and addressed accessibility issues across all components.
75
43
 
76
- - Removed anatomy exports. These exports are now available in `@ark-ui/anatomy`.
44
+ ### Stability and Support
77
45
 
78
- ```tsx
79
- // before
80
- import { accordionAnatomy } from '@ark-ui/react'
81
- // after
82
- import { accordionAnatomy } from '@ark-ui/anatomy' // or
83
- import { anatomy } from '@ark-ui/anatomy/accordion'
84
- ```
46
+ With the release of version 1.0.0, we are moving towards a more stable version of `@ark-ui/react`. Future updates will strive to avoid breaking changes, ensuring a smoother experience for our users. If you encounter any issues while upgrading, please do not hesitate to open an issue on our [GitHub repository](https://github.com/chakra-ui/ark/issues). Your feedback is invaluable in helping us improve.
85
47
 
86
48
  ## [0.15.0] - 2023-09-14
87
49
 
package/README.md CHANGED
@@ -1,47 +1,46 @@
1
- # @ark-ui/react
1
+ # Welcome to Ark UI
2
2
 
3
- `@ark-ui/react` is an open-source UI component library designed to make building high-quality, accessible web applications easier. The library focuses on providing low-level UI components with an emphasis on accessibility, customization, and developer experience.
3
+ Ark UI is a headless, open-source UI library with over 30+ components designed for building reusable, scalable Design Systems. It supports a wide range of JavaScript frameworks, offering dedciated packages for each supported framework.
4
4
 
5
- ## Key Features
5
+ ## Supported Frameworks
6
6
 
7
- - **Accessible**: Components in Ark UI are designed with accessibility in mind, adhering to WAI-ARIA design patterns and handling implementation details such as aria and role attributes, focus management, and keyboard navigation.
8
- - **Headless**: Components are shipped without styles, giving developers full control over styling.
9
- - **Customizable**: The open component architecture allows for customization and customization, providing granular access to each component part.
10
- - **Powered by state machines**: Predictable, simplified, and robust component behavior.
11
- - **Developer Experience**: The library provides a fully-typed API with a consistent and predictable experience.
7
+ Ark UI is available for the following JavaScript frameworks:
8
+
9
+ - **React**: `@ark-ui/react`
10
+ - **Solid**: `@ark-ui/solid`
11
+ - **Vue**: `@ark-ui/vue`
12
12
 
13
13
  ## Available Components
14
14
 
15
- At the moment, `@ark-ui/react`offers the following components:
16
-
17
- - [Accordion](https://ark-ui.com/docs/react/components/accordion)
18
- - [Avatar](https://ark-ui.com/docs/react/components/avatar)
19
- - [Carousel](https://ark-ui.com/docs/react/components/carousel)
20
- - [Checkbox](https://ark-ui.com/docs/react/components/checkbox)
21
- - [Color Picker](https://ark-ui.com/docs/react/components/color-picker)
22
- - [Combobox](https://ark-ui.com/docs/react/components/combobox)
23
- - [Date Picker](https://ark-ui.com/docs/react/components/date-picker)
24
- - [Dialog](https://ark-ui.com/docs/react/components/dialog)
25
- - [Editable](https://ark-ui.com/docs/react/components/editable)
26
- - [Hover Card](https://ark-ui.com/docs/react/components/hover-card)
27
- - [Menu](https://ark-ui.com/docs/react/components/menu)
28
- - [Number Input](https://ark-ui.com/docs/react/components/number-input)
29
- - [Pagination](https://ark-ui.com/docs/react/components/pagination)
30
- - [Pin Input](https://ark-ui.com/docs/react/components/pin-input)
31
- - [Popover](https://ark-ui.com/docs/react/components/popover)
32
- - [Pressable](https://ark-ui.com/docs/react/components/pressable)
33
- - [Radio Group](https://ark-ui.com/docs/react/components/radio-group)
34
- - [Range Slider](https://ark-ui.com/docs/react/components/range-slider)
35
- - [Rating Group](https://ark-ui.com/docs/react/components/rating-group)
36
- - [Segment Group](https://ark-ui.com/docs/react/components/segment-group)
37
- - [Select](https://ark-ui.com/docs/react/components/select)
38
- - [Slider](https://ark-ui.com/docs/react/components/slider)
39
- - [Splitter](https://ark-ui.com/docs/react/components/splitter)
40
- - [Switch](https://ark-ui.com/docs/react/components/switch)
41
- - [Tabs](https://ark-ui.com/docs/react/components/tabs)
42
- - [Tags Input](https://ark-ui.com/docs/react/components/tags-input)
43
- - [Toast](https://ark-ui.com/docs/react/components/toast)
44
- - [Tooltip](https://ark-ui.com/docs/react/components/tooltip)
15
+ - [Accordion](https://ark-ui.com/docs/components/accordion)
16
+ - [Avatar](https://ark-ui.com/docs/components/avatar)
17
+ - [Carousel](https://ark-ui.com/docs/components/carousel)
18
+ - [Checkbox](https://ark-ui.com/docs/components/checkbox)
19
+ - [Color Picker](https://ark-ui.com/docs/components/color-picker)
20
+ - [Combobox](https://ark-ui.com/docs/components/combobox)
21
+ - [Date Picker](https://ark-ui.com/docs/components/date-picker)
22
+ - [Dialog](https://ark-ui.com/docs/components/dialog)
23
+ - [Editable](https://ark-ui.com/docs/components/editable)
24
+ - [File Upload](https://ark-ui.com/docs/components/file-upload)
25
+ - [Hover Card](https://ark-ui.com/docs/components/hover-card)
26
+ - [Menu](https://ark-ui.com/docs/components/menu)
27
+ - [Number Input](https://ark-ui.com/docs/components/number-input)
28
+ - [Pagination](https://ark-ui.com/docs/components/pagination)
29
+ - [Pin Input](https://ark-ui.com/docs/components/pin-input)
30
+ - [Popover](https://ark-ui.com/docs/components/popover)
31
+ - [Radio Group](https://ark-ui.com/docs/components/radio-group)
32
+ - [Range Slider](https://ark-ui.com/docs/components/slider)
33
+ - [Rating Group](https://ark-ui.com/docs/components/rating-group)
34
+ - [Segment Group](https://ark-ui.com/docs/components/segment-group)
35
+ - [Select](https://ark-ui.com/docs/components/select)
36
+ - [Slider](https://ark-ui.com/docs/components/slider)
37
+ - [Splitter](https://ark-ui.com/docs/components/splitter)
38
+ - [Switch](https://ark-ui.com/docs/components/switch)
39
+ - [Tabs](https://ark-ui.com/docs/components/tabs)
40
+ - [Tags Input](https://ark-ui.com/docs/components/tags-input)
41
+ - [Toast](https://ark-ui.com/docs/components/toast)
42
+ - [Toggle Group](https://ark-ui.com/docs/components/toggle-group)
43
+ - [Tooltip](https://ark-ui.com/docs/components/tooltip)
45
44
 
46
45
  ## Installation
47
46
 
@@ -62,43 +61,37 @@ yarn add @ark-ui/react
62
61
  To use a component from `@ark-ui/react`, import it and include it in your application:
63
62
 
64
63
  ```tsx
65
- import {
66
- Slider,
67
- SliderControl,
68
- SliderLabel,
69
- SliderOutput,
70
- SliderRange,
71
- SliderThumb,
72
- SliderTrack,
73
- } from '@ark-ui/react'
74
- import { useState } from 'react'
75
-
76
- export const MySlider = () => {
77
- const [value, setValue] = useState(30)
78
-
79
- return (
80
- <Slider min={-50} max={50} value={value} onChange={(e) => setValue(e.value)}>
81
- <SliderLabel>Label</SliderLabel>
82
- <SliderOutput>{value}</SliderOutput>
83
- <SliderControl>
84
- <SliderTrack>
85
- <SliderRange />
86
- </SliderTrack>
87
- <SliderThumb />
88
- </SliderControl>
89
- </Slider>
90
- )
91
- }
64
+ import { Slider, type SliderProps } from '@ark-ui/react'
65
+
66
+ export const MySlider = (props: SliderProps) => (
67
+ <Slider.Root min={0} max={100} defaultValue={[33]} {...props}>
68
+ <Slider.Control>
69
+ <Slider.Track>
70
+ <Slider.Range />
71
+ </Slider.Track>
72
+ <Slider.Thumb index={0} />
73
+ </Slider.Control>
74
+ <Slider.MarkerGroup>
75
+ <Slider.Marker value={25}>25</Slider.Marker>
76
+ <Slider.Marker value={50}>50</Slider.Marker>
77
+ <Slider.Marker value={75}>75</Slider.Marker>
78
+ </Slider.MarkerGroup>
79
+ </Slider.Root>
80
+ )
92
81
  ```
93
82
 
94
83
  ## Documentation
95
84
 
96
85
  For more detailed documentation and examples, please visit the [official documentation](https://ark-ui.com/).
97
86
 
87
+ ## Roadmap
88
+
89
+ You can request, vote for, and check upcoming features on our [roadmap](https://ark-ui.canny.io/).
90
+
98
91
  ## Contribution
99
92
 
100
- We welcome contributions to `@ark-ui/react`. Please read our [contributing guidelines](https://github.com/chakra-ui/ark/blob/main/CONTRIBUTING.md) for more information on how to contribute.
93
+ We welcome contributions to Ark UI. Please read our [contributing guidelines](https://github.com/chakra-ui/ark/blob/main/CONTRIBUTING.md) for more information on how to contribute.
101
94
 
102
- ## Licence
95
+ ## License
103
96
 
104
97
  This project is licensed under the terms of the [MIT license](https://github.com/chakra-ui/ark/blob/main/LICENSE).
@@ -5,7 +5,6 @@ type AccordionType = typeof Accordion;
5
5
  declare const meta: Meta<AccordionType>;
6
6
  export default meta;
7
7
  export declare const Basic: () => JSX.Element;
8
- export declare const Initial: () => JSX.Element;
9
8
  export declare const RenderProp: () => JSX.Element;
10
9
  export declare const Collapsible: () => JSX.Element;
11
10
  export declare const Multiple: () => JSX.Element;
@@ -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 colorPickerContext = require('./color-picker-context.cjs');
11
+
12
+ const ColorPickerFormatSelect = react.forwardRef(
13
+ (props, ref) => {
14
+ const api = colorPickerContext.useColorPickerContext();
15
+ const mergedProps = react$1.mergeProps(api.formatSelectProps, props);
16
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.select, { ...mergedProps, ref, children: ["rgba", "hsla", "hsba"].map((format) => /* @__PURE__ */ jsxRuntime.jsx(factory.ark.option, { value: format, children: format }, format)) });
17
+ }
18
+ );
19
+ ColorPickerFormatSelect.displayName = "ColorPickerFormatSelect";
20
+
21
+ exports.ColorPickerFormatSelect = ColorPickerFormatSelect;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ColorPickerFormatSelectProps extends HTMLArkProps<'select'> {
5
+ }
6
+ export declare const ColorPickerFormatSelect: ForwardRefExoticComponent<ColorPickerFormatSelectProps & RefAttributes<HTMLSelectElement>>;
@@ -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 { useColorPickerContext } from './color-picker-context.mjs';
7
+
8
+ const ColorPickerFormatSelect = forwardRef(
9
+ (props, ref) => {
10
+ const api = useColorPickerContext();
11
+ const mergedProps = mergeProps(api.formatSelectProps, props);
12
+ return /* @__PURE__ */ jsx(ark.select, { ...mergedProps, ref, children: ["rgba", "hsla", "hsba"].map((format) => /* @__PURE__ */ jsx(ark.option, { value: format, children: format }, format)) });
13
+ }
14
+ );
15
+ ColorPickerFormatSelect.displayName = "ColorPickerFormatSelect";
16
+
17
+ export { ColorPickerFormatSelect };
@@ -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 colorPickerContext = require('./color-picker-context.cjs');
11
+
12
+ const ColorPickerFormatTrigger = react.forwardRef((props, ref) => {
13
+ const api = colorPickerContext.useColorPickerContext();
14
+ const mergedProps = react$1.mergeProps(api.formatTriggerProps, props);
15
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
16
+ });
17
+ ColorPickerFormatTrigger.displayName = "ColorPickerFormatTrigger";
18
+
19
+ exports.ColorPickerFormatTrigger = ColorPickerFormatTrigger;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ColorPickerFormatTriggerProps extends HTMLArkProps<'button'> {
5
+ }
6
+ export declare const ColorPickerFormatTrigger: ForwardRefExoticComponent<ColorPickerFormatTriggerProps & RefAttributes<HTMLButtonElement>>;
@@ -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 { useColorPickerContext } from './color-picker-context.mjs';
7
+
8
+ const ColorPickerFormatTrigger = forwardRef((props, ref) => {
9
+ const api = useColorPickerContext();
10
+ const mergedProps = mergeProps(api.formatTriggerProps, props);
11
+ return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
12
+ });
13
+ ColorPickerFormatTrigger.displayName = "ColorPickerFormatTrigger";
14
+
15
+ export { ColorPickerFormatTrigger };
@@ -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 [ColorPickerSwatchProvider, useColorPickerSwatchContext] = createContext.createContext({
9
+ name: "ColorPickerSwatchContext",
10
+ hookName: "useColorPickerSwatchContext",
11
+ providerName: "<ColorPickerSwatchProvider />"
12
+ });
13
+
14
+ exports.ColorPickerSwatchProvider = ColorPickerSwatchProvider;
15
+ exports.useColorPickerSwatchContext = useColorPickerSwatchContext;
@@ -0,0 +1,6 @@
1
+ import { Provider } from 'react';
2
+ /// <reference types="react" />
3
+ import type { SwatchProps } from '@zag-js/color-picker';
4
+ export interface ColorPickerSwatchContext extends SwatchProps {
5
+ }
6
+ export declare const ColorPickerSwatchProvider: Provider<ColorPickerSwatchContext>, useColorPickerSwatchContext: () => ColorPickerSwatchContext;
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { createContext } from '../create-context.mjs';
3
+
4
+ const [ColorPickerSwatchProvider, useColorPickerSwatchContext] = createContext({
5
+ name: "ColorPickerSwatchContext",
6
+ hookName: "useColorPickerSwatchContext",
7
+ providerName: "<ColorPickerSwatchProvider />"
8
+ });
9
+
10
+ export { ColorPickerSwatchProvider, useColorPickerSwatchContext };
@@ -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 colorPickerContext = require('./color-picker-context.cjs');
11
+ const colorPickerSwatchContext = require('./color-picker-swatch-context.cjs');
12
+
13
+ const ColorPickerSwatchIndicator = react.forwardRef((props, ref) => {
14
+ const api = colorPickerContext.useColorPickerContext();
15
+ const swatchProps = colorPickerSwatchContext.useColorPickerSwatchContext();
16
+ const mergedProps = react$1.mergeProps(api.getSwatchIndicatorProps(swatchProps), props);
17
+ return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
18
+ });
19
+ ColorPickerSwatchIndicator.displayName = "ColorPickerSwatchIndicator";
20
+
21
+ exports.ColorPickerSwatchIndicator = ColorPickerSwatchIndicator;
@@ -0,0 +1,6 @@
1
+ import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
+ /// <reference types="react" />
3
+ import { type HTMLArkProps } from '../factory';
4
+ export interface ColorPickerSwatchIndicatorProps extends HTMLArkProps<'div'> {
5
+ }
6
+ export declare const ColorPickerSwatchIndicator: ForwardRefExoticComponent<ColorPickerSwatchIndicatorProps & 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.mjs';
6
+ import { useColorPickerContext } from './color-picker-context.mjs';
7
+ import { useColorPickerSwatchContext } from './color-picker-swatch-context.mjs';
8
+
9
+ const ColorPickerSwatchIndicator = forwardRef((props, ref) => {
10
+ const api = useColorPickerContext();
11
+ const swatchProps = useColorPickerSwatchContext();
12
+ const mergedProps = mergeProps(api.getSwatchIndicatorProps(swatchProps), props);
13
+ return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
14
+ });
15
+ ColorPickerSwatchIndicator.displayName = "ColorPickerSwatchIndicator";
16
+
17
+ export { ColorPickerSwatchIndicator };
@@ -11,7 +11,10 @@ const factory = require('../factory.cjs');
11
11
  const colorPickerContext = require('./color-picker-context.cjs');
12
12
 
13
13
  const ColorPickerSwatchTrigger = react.forwardRef((props, ref) => {
14
- const [triggerProps, localProps] = createSplitProps.createSplitProps()(props, ["value"]);
14
+ const [triggerProps, localProps] = createSplitProps.createSplitProps()(props, [
15
+ "value",
16
+ "disabled"
17
+ ]);
15
18
  const api = colorPickerContext.useColorPickerContext();
16
19
  const mergedProps = react$1.mergeProps(api.getSwatchTriggerProps(triggerProps), localProps);
17
20
  return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.button, { ...mergedProps, ref });
@@ -1,12 +1,8 @@
1
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  /// <reference types="react" />
3
- import type { Color } from '@zag-js/color-picker';
3
+ import type { SwatchTriggerProps } from '@zag-js/color-picker';
4
4
  import { type HTMLArkProps } from '../factory';
5
5
  import type { Assign } from '../types';
6
- interface SwatchTriggerProps {
7
- value: string | Color;
8
- }
9
6
  export interface ColorPickerSwatchTriggerProps extends Assign<HTMLArkProps<'button'>, SwatchTriggerProps> {
10
7
  }
11
8
  export declare const ColorPickerSwatchTrigger: ForwardRefExoticComponent<ColorPickerSwatchTriggerProps & RefAttributes<HTMLButtonElement>>;
12
- export {};
@@ -7,7 +7,10 @@ import { ark } from '../factory.mjs';
7
7
  import { useColorPickerContext } from './color-picker-context.mjs';
8
8
 
9
9
  const ColorPickerSwatchTrigger = forwardRef((props, ref) => {
10
- const [triggerProps, localProps] = createSplitProps()(props, ["value"]);
10
+ const [triggerProps, localProps] = createSplitProps()(props, [
11
+ "value",
12
+ "disabled"
13
+ ]);
11
14
  const api = useColorPickerContext();
12
15
  const mergedProps = mergeProps(api.getSwatchTriggerProps(triggerProps), localProps);
13
16
  return /* @__PURE__ */ jsx(ark.button, { ...mergedProps, ref });
@@ -9,16 +9,17 @@ const react = require('react');
9
9
  const createSplitProps = require('../create-split-props.cjs');
10
10
  const factory = require('../factory.cjs');
11
11
  const colorPickerContext = require('./color-picker-context.cjs');
12
+ const colorPickerSwatchContext = require('./color-picker-swatch-context.cjs');
12
13
 
13
14
  const ColorPickerSwatch = react.forwardRef(
14
15
  (props, ref) => {
15
- const [colorSwatchProps, localProps] = createSplitProps.createSplitProps()(props, [
16
+ const [swatwchProps, localProps] = createSplitProps.createSplitProps()(props, [
16
17
  "respectAlpha",
17
18
  "value"
18
19
  ]);
19
20
  const api = colorPickerContext.useColorPickerContext();
20
- const mergedProps = react$1.mergeProps(api.getSwatchProps(colorSwatchProps), localProps);
21
- return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref });
21
+ const mergedProps = react$1.mergeProps(api.getSwatchProps(swatwchProps), localProps);
22
+ return /* @__PURE__ */ jsxRuntime.jsx(colorPickerSwatchContext.ColorPickerSwatchProvider, { value: swatwchProps, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
22
23
  }
23
24
  );
24
25
  ColorPickerSwatch.displayName = "ColorPickerSwatch";
@@ -5,16 +5,17 @@ import { forwardRef } from 'react';
5
5
  import { createSplitProps } from '../create-split-props.mjs';
6
6
  import { ark } from '../factory.mjs';
7
7
  import { useColorPickerContext } from './color-picker-context.mjs';
8
+ import { ColorPickerSwatchProvider } from './color-picker-swatch-context.mjs';
8
9
 
9
10
  const ColorPickerSwatch = forwardRef(
10
11
  (props, ref) => {
11
- const [colorSwatchProps, localProps] = createSplitProps()(props, [
12
+ const [swatwchProps, localProps] = createSplitProps()(props, [
12
13
  "respectAlpha",
13
14
  "value"
14
15
  ]);
15
16
  const api = useColorPickerContext();
16
- const mergedProps = mergeProps(api.getSwatchProps(colorSwatchProps), localProps);
17
- return /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref });
17
+ const mergedProps = mergeProps(api.getSwatchProps(swatwchProps), localProps);
18
+ return /* @__PURE__ */ jsx(ColorPickerSwatchProvider, { value: swatwchProps, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
18
19
  }
19
20
  );
20
21
  ColorPickerSwatch.displayName = "ColorPickerSwatch";
@@ -1,11 +1,8 @@
1
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  /// <reference types="react" />
3
+ import type { TransparencyGridProps } from '@zag-js/color-picker';
3
4
  import { type HTMLArkProps } from '../factory';
4
5
  import type { Assign } from '../types';
5
- interface TransparancyGridProps {
6
- size: string;
7
- }
8
- export interface ColorPickerTransparencyGridProps extends Assign<HTMLArkProps<'div'>, TransparancyGridProps> {
6
+ export interface ColorPickerTransparencyGridProps extends Assign<HTMLArkProps<'div'>, TransparencyGridProps> {
9
7
  }
10
8
  export declare const ColorPickerTransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridProps & RefAttributes<HTMLDivElement>>;
11
- export {};
@@ -19,10 +19,11 @@ const presenceContext = require('../presence/presence-context.cjs');
19
19
  const ColorPicker = react.forwardRef((props, ref) => {
20
20
  const [presenceProps, colorPickerProps] = splitPresenceProps.splitPresenceProps(props);
21
21
  const [useColorPickerProps, { children, ...localProps }] = createSplitProps.createSplitProps()(colorPickerProps, [
22
- "autoFocus",
22
+ "closeOnSelect",
23
23
  "defaultValue",
24
24
  "dir",
25
25
  "disabled",
26
+ "format",
26
27
  "getRootNode",
27
28
  "id",
28
29
  "ids",
@@ -30,6 +31,7 @@ const ColorPicker = react.forwardRef((props, ref) => {
30
31
  "name",
31
32
  "name",
32
33
  "onFocusOutside",
34
+ "onFormatChange",
33
35
  "onInteractOutside",
34
36
  "onOpenChange",
35
37
  "onPointerDownOutside",
@@ -15,10 +15,11 @@ import { PresenceProvider } from '../presence/presence-context.mjs';
15
15
  const ColorPicker = forwardRef((props, ref) => {
16
16
  const [presenceProps, colorPickerProps] = splitPresenceProps(props);
17
17
  const [useColorPickerProps, { children, ...localProps }] = createSplitProps()(colorPickerProps, [
18
- "autoFocus",
18
+ "closeOnSelect",
19
19
  "defaultValue",
20
20
  "dir",
21
21
  "disabled",
22
+ "format",
22
23
  "getRootNode",
23
24
  "id",
24
25
  "ids",
@@ -26,6 +27,7 @@ const ColorPicker = forwardRef((props, ref) => {
26
27
  "name",
27
28
  "name",
28
29
  "onFocusOutside",
30
+ "onFormatChange",
29
31
  "onInteractOutside",
30
32
  "onOpenChange",
31
33
  "onPointerDownOutside",