@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.
- package/CHANGELOG.md +19 -57
- package/README.md +60 -67
- package/accordion/accordion.stories.d.ts +0 -1
- package/color-picker/color-picker-format-select.cjs +21 -0
- package/color-picker/color-picker-format-select.d.ts +6 -0
- package/color-picker/color-picker-format-select.mjs +17 -0
- package/color-picker/color-picker-format-trigger.cjs +19 -0
- package/color-picker/color-picker-format-trigger.d.ts +6 -0
- package/color-picker/color-picker-format-trigger.mjs +15 -0
- package/color-picker/color-picker-swatch-context.cjs +15 -0
- package/color-picker/color-picker-swatch-context.d.ts +6 -0
- package/color-picker/color-picker-swatch-context.mjs +10 -0
- package/color-picker/color-picker-swatch-indicator.cjs +21 -0
- package/color-picker/color-picker-swatch-indicator.d.ts +6 -0
- package/color-picker/color-picker-swatch-indicator.mjs +17 -0
- package/color-picker/color-picker-swatch-trigger.cjs +4 -1
- package/color-picker/color-picker-swatch-trigger.d.ts +1 -5
- package/color-picker/color-picker-swatch-trigger.mjs +4 -1
- package/color-picker/color-picker-swatch.cjs +4 -3
- package/color-picker/color-picker-swatch.mjs +4 -3
- package/color-picker/color-picker-transparency-grid.d.ts +2 -5
- package/color-picker/color-picker.cjs +3 -1
- package/color-picker/color-picker.mjs +3 -1
- package/color-picker/index.cjs +10 -0
- package/color-picker/index.d.ts +10 -3
- package/color-picker/index.mjs +7 -1
- package/color-picker/use-color-picker.cjs +1 -1
- package/color-picker/use-color-picker.d.ts +4 -1
- package/color-picker/use-color-picker.mjs +1 -1
- package/dialog/dialog-backdrop.cjs +6 -4
- package/dialog/dialog-backdrop.mjs +6 -4
- package/dialog/dialog.cjs +2 -1
- package/dialog/dialog.mjs +2 -1
- package/file-upload/file-upload-context.cjs +15 -0
- package/file-upload/file-upload-context.d.ts +6 -0
- package/file-upload/file-upload-context.mjs +10 -0
- package/file-upload/file-upload-dropzone.cjs +24 -0
- package/file-upload/file-upload-dropzone.d.ts +6 -0
- package/file-upload/file-upload-dropzone.mjs +20 -0
- package/file-upload/file-upload-item-context.cjs +15 -0
- package/file-upload/file-upload-item-context.d.ts +6 -0
- package/file-upload/file-upload-item-context.mjs +10 -0
- package/file-upload/file-upload-item-delete-trigger.cjs +21 -0
- package/file-upload/file-upload-item-delete-trigger.d.ts +6 -0
- package/file-upload/file-upload-item-delete-trigger.mjs +17 -0
- package/file-upload/file-upload-item-group.cjs +24 -0
- package/file-upload/file-upload-item-group.d.ts +8 -0
- package/file-upload/file-upload-item-group.mjs +20 -0
- package/file-upload/file-upload-item-name.cjs +24 -0
- package/file-upload/file-upload-item-name.d.ts +6 -0
- package/file-upload/file-upload-item-name.mjs +20 -0
- package/file-upload/file-upload-item-preview.cjs +31 -0
- package/file-upload/file-upload-item-preview.d.ts +6 -0
- package/file-upload/file-upload-item-preview.mjs +27 -0
- package/file-upload/file-upload-item-size-text.cjs +24 -0
- package/file-upload/file-upload-item-size-text.d.ts +6 -0
- package/file-upload/file-upload-item-size-text.mjs +20 -0
- package/file-upload/file-upload-item.cjs +24 -0
- package/file-upload/file-upload-item.d.ts +8 -0
- package/file-upload/file-upload-item.mjs +20 -0
- package/file-upload/file-upload-label.cjs +19 -0
- package/file-upload/file-upload-label.d.ts +6 -0
- package/file-upload/file-upload-label.mjs +15 -0
- package/file-upload/file-upload-trigger.cjs +21 -0
- package/file-upload/file-upload-trigger.d.ts +6 -0
- package/file-upload/file-upload-trigger.mjs +17 -0
- package/file-upload/file-upload.cjs +42 -0
- package/file-upload/file-upload.d.ts +9 -0
- package/file-upload/file-upload.mjs +38 -0
- package/file-upload/file-upload.stories.d.ts +7 -0
- package/file-upload/file-upload.test.d.ts +1 -0
- package/file-upload/index.cjs +41 -0
- package/file-upload/index.d.ts +27 -0
- package/file-upload/index.mjs +27 -0
- package/file-upload/use-file-upload.cjs +47 -0
- package/file-upload/use-file-upload.d.ts +8 -0
- package/file-upload/use-file-upload.mjs +24 -0
- package/index.cjs +68 -38
- package/index.d.ts +1 -0
- package/index.mjs +15 -0
- package/menu/menu-positioner.cjs +6 -0
- package/menu/menu-positioner.mjs +6 -0
- package/menu/menu-trigger.cjs +10 -1
- package/menu/menu-trigger.mjs +10 -1
- package/number-input/number-input.cjs +35 -30
- package/number-input/number-input.d.ts +5 -4
- package/number-input/number-input.mjs +35 -30
- package/number-input/number-input.stories.d.ts +1 -0
- package/package.json +53 -45
- package/radio-group/radio-group.stories.d.ts +1 -1
- package/select/select.stories.d.ts +1 -0
- package/slider/slider.stories.d.ts +1 -1
- package/toast/create-toaster.cjs +1 -1
- 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.
|
|
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
|
|
13
|
+
- Added render function to the `NumberInput` component
|
|
14
|
+
- Added `FileUpload` component
|
|
38
15
|
|
|
39
16
|
### Changed
|
|
40
17
|
|
|
41
|
-
-
|
|
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
|
-
-
|
|
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
|
-
|
|
24
|
+
## [1.0.1] - 2023-11-10
|
|
58
25
|
|
|
59
26
|
### Fixed
|
|
60
27
|
|
|
61
|
-
- Resolved an issue
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
38
|
+
### Highlights
|
|
73
39
|
|
|
74
|
-
|
|
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
|
-
|
|
44
|
+
### Stability and Support
|
|
77
45
|
|
|
78
|
-
|
|
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
|
-
#
|
|
1
|
+
# Welcome to Ark UI
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
##
|
|
5
|
+
## Supported Frameworks
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
|
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
|
-
##
|
|
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, [
|
|
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 {
|
|
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, [
|
|
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 [
|
|
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(
|
|
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 [
|
|
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(
|
|
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
|
|
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
|
-
"
|
|
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
|
-
"
|
|
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",
|