@ark-ui/react 1.0.1 → 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 (86) hide show
  1. package/CHANGELOG.md +15 -0
  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/file-upload/file-upload-context.cjs +15 -0
  31. package/file-upload/file-upload-context.d.ts +6 -0
  32. package/file-upload/file-upload-context.mjs +10 -0
  33. package/file-upload/file-upload-dropzone.cjs +24 -0
  34. package/file-upload/file-upload-dropzone.d.ts +6 -0
  35. package/file-upload/file-upload-dropzone.mjs +20 -0
  36. package/file-upload/file-upload-item-context.cjs +15 -0
  37. package/file-upload/file-upload-item-context.d.ts +6 -0
  38. package/file-upload/file-upload-item-context.mjs +10 -0
  39. package/file-upload/file-upload-item-delete-trigger.cjs +21 -0
  40. package/file-upload/file-upload-item-delete-trigger.d.ts +6 -0
  41. package/file-upload/file-upload-item-delete-trigger.mjs +17 -0
  42. package/file-upload/file-upload-item-group.cjs +24 -0
  43. package/file-upload/file-upload-item-group.d.ts +8 -0
  44. package/file-upload/file-upload-item-group.mjs +20 -0
  45. package/file-upload/file-upload-item-name.cjs +24 -0
  46. package/file-upload/file-upload-item-name.d.ts +6 -0
  47. package/file-upload/file-upload-item-name.mjs +20 -0
  48. package/file-upload/file-upload-item-preview.cjs +31 -0
  49. package/file-upload/file-upload-item-preview.d.ts +6 -0
  50. package/file-upload/file-upload-item-preview.mjs +27 -0
  51. package/file-upload/file-upload-item-size-text.cjs +24 -0
  52. package/file-upload/file-upload-item-size-text.d.ts +6 -0
  53. package/file-upload/file-upload-item-size-text.mjs +20 -0
  54. package/file-upload/file-upload-item.cjs +24 -0
  55. package/file-upload/file-upload-item.d.ts +8 -0
  56. package/file-upload/file-upload-item.mjs +20 -0
  57. package/file-upload/file-upload-label.cjs +19 -0
  58. package/file-upload/file-upload-label.d.ts +6 -0
  59. package/file-upload/file-upload-label.mjs +15 -0
  60. package/file-upload/file-upload-trigger.cjs +21 -0
  61. package/file-upload/file-upload-trigger.d.ts +6 -0
  62. package/file-upload/file-upload-trigger.mjs +17 -0
  63. package/file-upload/file-upload.cjs +42 -0
  64. package/file-upload/file-upload.d.ts +9 -0
  65. package/file-upload/file-upload.mjs +38 -0
  66. package/file-upload/file-upload.stories.d.ts +7 -0
  67. package/file-upload/file-upload.test.d.ts +1 -0
  68. package/file-upload/index.cjs +41 -0
  69. package/file-upload/index.d.ts +27 -0
  70. package/file-upload/index.mjs +27 -0
  71. package/file-upload/use-file-upload.cjs +47 -0
  72. package/file-upload/use-file-upload.d.ts +8 -0
  73. package/file-upload/use-file-upload.mjs +24 -0
  74. package/index.cjs +68 -38
  75. package/index.d.ts +1 -0
  76. package/index.mjs +15 -0
  77. package/number-input/number-input.cjs +35 -30
  78. package/number-input/number-input.d.ts +5 -4
  79. package/number-input/number-input.mjs +35 -30
  80. package/number-input/number-input.stories.d.ts +1 -0
  81. package/package.json +53 -45
  82. package/radio-group/radio-group.stories.d.ts +1 -1
  83. package/select/select.stories.d.ts +1 -0
  84. package/slider/slider.stories.d.ts +1 -1
  85. package/toast/create-toaster.cjs +1 -1
  86. package/toast/create-toaster.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,21 @@ description: All notable changes to this project will be documented in this file
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.0] - 2023-11-21
10
+
11
+ ### Added
12
+
13
+ - Added render function to the `NumberInput` component
14
+ - Added `FileUpload` component
15
+
16
+ ### Changed
17
+
18
+ - Revised the `ColorPicker` component. Check out the [documentation](https://ark-ui.com/docs/components/color-picker) for more information.
19
+
20
+ ### Fixed
21
+
22
+ - Resolved an issue where the `Toast` component would throw a warning when multiple toasts were rendered at the same time.
23
+
9
24
  ## [1.0.1] - 2023-11-10
10
25
 
11
26
  ### Fixed
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",
@@ -17,10 +17,13 @@ const colorPickerContent = require('./color-picker-content.cjs');
17
17
  const colorPickerContext = require('./color-picker-context.cjs');
18
18
  const colorPickerControl = require('./color-picker-control.cjs');
19
19
  const colorPickerEyeDropperTrigger = require('./color-picker-eye-dropper-trigger.cjs');
20
+ const colorPickerFormatSelect = require('./color-picker-format-select.cjs');
21
+ const colorPickerFormatTrigger = require('./color-picker-format-trigger.cjs');
20
22
  const colorPickerLabel = require('./color-picker-label.cjs');
21
23
  const colorPickerPositioner = require('./color-picker-positioner.cjs');
22
24
  const colorPickerSwatch = require('./color-picker-swatch.cjs');
23
25
  const colorPickerSwatchGroup = require('./color-picker-swatch-group.cjs');
26
+ const colorPickerSwatchIndicator = require('./color-picker-swatch-indicator.cjs');
24
27
  const colorPickerSwatchTrigger = require('./color-picker-swatch-trigger.cjs');
25
28
  const colorPickerTransparencyGrid = require('./color-picker-transparency-grid.cjs');
26
29
  const colorPickerTrigger = require('./color-picker-trigger.cjs');
@@ -39,10 +42,13 @@ const ColorPicker = Object.assign(colorPicker.ColorPicker, {
39
42
  Content: colorPickerContent.ColorPickerContent,
40
43
  Control: colorPickerControl.ColorPickerControl,
41
44
  EyeDropperTrigger: colorPickerEyeDropperTrigger.ColorPickerEyeDropperTrigger,
45
+ FormatTrigger: colorPickerFormatTrigger.ColorPickerFormatTrigger,
46
+ FormatSelect: colorPickerFormatSelect.ColorPickerFormatSelect,
42
47
  Label: colorPickerLabel.ColorPickerLabel,
43
48
  Positioner: colorPickerPositioner.ColorPickerPositioner,
44
49
  Swatch: colorPickerSwatch.ColorPickerSwatch,
45
50
  SwatchGroup: colorPickerSwatchGroup.ColorPickerSwatchGroup,
51
+ SwatchIndicator: colorPickerSwatchIndicator.ColorPickerSwatchIndicator,
46
52
  SwatchTrigger: colorPickerSwatchTrigger.ColorPickerSwatchTrigger,
47
53
  TransparencyGrid: colorPickerTransparencyGrid.ColorPickerTransparencyGrid,
48
54
  Trigger: colorPickerTrigger.ColorPickerTrigger,
@@ -63,12 +69,16 @@ exports.ColorPickerContent = colorPickerContent.ColorPickerContent;
63
69
  exports.useColorPickerContext = colorPickerContext.useColorPickerContext;
64
70
  exports.ColorPickerControl = colorPickerControl.ColorPickerControl;
65
71
  exports.ColorPickerEyeDropperTrigger = colorPickerEyeDropperTrigger.ColorPickerEyeDropperTrigger;
72
+ exports.ColorPickerFormatSelect = colorPickerFormatSelect.ColorPickerFormatSelect;
73
+ exports.ColorPickerFormatTrigger = colorPickerFormatTrigger.ColorPickerFormatTrigger;
66
74
  exports.ColorPickerLabel = colorPickerLabel.ColorPickerLabel;
67
75
  exports.ColorPickerPositioner = colorPickerPositioner.ColorPickerPositioner;
68
76
  exports.ColorPickerSwatch = colorPickerSwatch.ColorPickerSwatch;
69
77
  exports.ColorPickerSwatchGroup = colorPickerSwatchGroup.ColorPickerSwatchGroup;
78
+ exports.ColorPickerSwatchIndicator = colorPickerSwatchIndicator.ColorPickerSwatchIndicator;
70
79
  exports.ColorPickerSwatchTrigger = colorPickerSwatchTrigger.ColorPickerSwatchTrigger;
71
80
  exports.ColorPickerTransparencyGrid = colorPickerTransparencyGrid.ColorPickerTransparencyGrid;
72
81
  exports.ColorPickerTrigger = colorPickerTrigger.ColorPickerTrigger;
73
82
  exports.ColorPickerValueText = colorPickerValueText.ColorPickerValueText;
83
+ exports.ColorPickerView = colorPickerView.ColorPickerView;
74
84
  exports.ColorPicker = ColorPicker;
@@ -1,5 +1,6 @@
1
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  /// <reference types="react" />
3
+ import type { ColorFormat } from '@zag-js/color-picker';
3
4
  import { type ColorPickerProps } from './color-picker';
4
5
  import { ColorPickerArea, type ColorPickerAreaProps } from './color-picker-area';
5
6
  import { ColorPickerAreaBackground, type ColorPickerAreaBackgroundProps } from './color-picker-area-background';
@@ -14,15 +15,18 @@ import { ColorPickerContent, type ColorPickerContentProps } from './color-picker
14
15
  import { useColorPickerContext, type ColorPickerContext } from './color-picker-context';
15
16
  import { ColorPickerControl, type ColorPickerControlProps } from './color-picker-control';
16
17
  import { ColorPickerEyeDropperTrigger, type ColorPickerEyeDropperTriggerProps } from './color-picker-eye-dropper-trigger';
18
+ import { ColorPickerFormatSelect, type ColorPickerFormatSelectProps } from './color-picker-format-select';
19
+ import { ColorPickerFormatTrigger, type ColorPickerFormatTriggerProps } from './color-picker-format-trigger';
17
20
  import { ColorPickerLabel, type ColorPickerLabelProps } from './color-picker-label';
18
21
  import { ColorPickerPositioner, type ColorPickerPositionerProps } from './color-picker-positioner';
19
22
  import { ColorPickerSwatch, type ColorPickerSwatchProps } from './color-picker-swatch';
20
23
  import { ColorPickerSwatchGroup, type ColorPickerSwatchGroupProps } from './color-picker-swatch-group';
24
+ import { ColorPickerSwatchIndicator, type ColorPickerSwatchIndicatorProps } from './color-picker-swatch-indicator';
21
25
  import { ColorPickerSwatchTrigger, type ColorPickerSwatchTriggerProps } from './color-picker-swatch-trigger';
22
26
  import { ColorPickerTransparencyGrid, type ColorPickerTransparencyGridProps } from './color-picker-transparency-grid';
23
27
  import { ColorPickerTrigger, type ColorPickerTriggerProps } from './color-picker-trigger';
24
28
  import { ColorPickerValueText, type ColorPickerValueTextProps } from './color-picker-value-text';
25
- import { type ColorPickerViewProps } from './color-picker-view';
29
+ import { ColorPickerView, type ColorPickerViewProps } from './color-picker-view';
26
30
  declare const ColorPicker: ForwardRefExoticComponent<ColorPickerProps & RefAttributes<HTMLDivElement>> & {
27
31
  Root: ForwardRefExoticComponent<ColorPickerProps & RefAttributes<HTMLDivElement>>;
28
32
  Area: ForwardRefExoticComponent<ColorPickerAreaProps & RefAttributes<HTMLDivElement>>;
@@ -35,15 +39,18 @@ declare const ColorPicker: ForwardRefExoticComponent<ColorPickerProps & RefAttri
35
39
  Content: ForwardRefExoticComponent<ColorPickerContentProps & RefAttributes<HTMLDivElement>>;
36
40
  Control: ForwardRefExoticComponent<ColorPickerControlProps & RefAttributes<HTMLDivElement>>;
37
41
  EyeDropperTrigger: ForwardRefExoticComponent<ColorPickerEyeDropperTriggerProps & RefAttributes<HTMLButtonElement>>;
42
+ FormatTrigger: ForwardRefExoticComponent<ColorPickerFormatTriggerProps & RefAttributes<HTMLButtonElement>>;
43
+ FormatSelect: ForwardRefExoticComponent<ColorPickerFormatSelectProps & RefAttributes<HTMLSelectElement>>;
38
44
  Label: ForwardRefExoticComponent<ColorPickerLabelProps & RefAttributes<HTMLLabelElement>>;
39
45
  Positioner: ForwardRefExoticComponent<ColorPickerPositionerProps & RefAttributes<HTMLDivElement>>;
40
46
  Swatch: ForwardRefExoticComponent<ColorPickerSwatchProps & RefAttributes<HTMLDivElement>>;
41
47
  SwatchGroup: ForwardRefExoticComponent<ColorPickerSwatchGroupProps & RefAttributes<HTMLDivElement>>;
48
+ SwatchIndicator: ForwardRefExoticComponent<ColorPickerSwatchIndicatorProps & RefAttributes<HTMLDivElement>>;
42
49
  SwatchTrigger: ForwardRefExoticComponent<ColorPickerSwatchTriggerProps & RefAttributes<HTMLButtonElement>>;
43
50
  TransparencyGrid: ForwardRefExoticComponent<ColorPickerTransparencyGridProps & RefAttributes<HTMLDivElement>>;
44
51
  Trigger: ForwardRefExoticComponent<ColorPickerTriggerProps & RefAttributes<HTMLButtonElement>>;
45
52
  ValueText: ForwardRefExoticComponent<ColorPickerValueTextProps & RefAttributes<HTMLDivElement>>;
46
53
  View: ForwardRefExoticComponent<ColorPickerViewProps & RefAttributes<HTMLDivElement>>;
47
54
  };
48
- export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueText, useColorPickerAreaContext, useColorPickerChannelSliderContext, useColorPickerContext, };
49
- export type { ColorPickerAreaBackgroundProps, ColorPickerAreaContext, ColorPickerAreaProps, ColorPickerAreaThumbProps, ColorPickerChannelInputProps, ColorPickerChannelSliderContext, ColorPickerChannelSliderProps, ColorPickerChannelSliderThumbProps, ColorPickerChannelSliderTrackProps, ColorPickerContentProps, ColorPickerContext, ColorPickerControlProps, ColorPickerEyeDropperTriggerProps, ColorPickerLabelProps, ColorPickerPositionerProps, ColorPickerProps, ColorPickerSwatchGroupProps, ColorPickerSwatchProps, ColorPickerSwatchTriggerProps, ColorPickerTransparencyGridProps, ColorPickerTriggerProps, ColorPickerValueTextProps, ColorPickerViewProps, };
55
+ export { ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerFormatSelect, ColorPickerFormatTrigger, ColorPickerLabel, ColorPickerPositioner, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchIndicator, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueText, ColorPickerView, useColorPickerAreaContext, useColorPickerChannelSliderContext, useColorPickerContext, };
56
+ export type { ColorFormat, ColorPickerAreaBackgroundProps, ColorPickerAreaContext, ColorPickerAreaProps, ColorPickerAreaThumbProps, ColorPickerChannelInputProps, ColorPickerChannelSliderContext, ColorPickerChannelSliderProps, ColorPickerChannelSliderThumbProps, ColorPickerChannelSliderTrackProps, ColorPickerContentProps, ColorPickerContext, ColorPickerControlProps, ColorPickerEyeDropperTriggerProps, ColorPickerFormatSelectProps, ColorPickerFormatTriggerProps, ColorPickerLabelProps, ColorPickerPositionerProps, ColorPickerProps, ColorPickerSwatchGroupProps, ColorPickerSwatchIndicatorProps, ColorPickerSwatchProps, ColorPickerSwatchTriggerProps, ColorPickerTransparencyGridProps, ColorPickerTriggerProps, ColorPickerValueTextProps, ColorPickerViewProps, };