@ark-ui/react 1.0.1 → 1.2.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 +34 -0
- package/README.md +67 -61
- 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 +4 -2
- package/color-picker/color-picker.mjs +4 -2
- 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/combobox/combobox.cjs +1 -1
- package/combobox/combobox.d.ts +1 -1
- package/combobox/combobox.mjs +1 -1
- package/date-picker/date-picker.cjs +2 -2
- package/date-picker/date-picker.mjs +2 -2
- package/date-picker/date-picker.stories.d.ts +1 -0
- package/dialog/dialog-backdrop.cjs +1 -1
- package/dialog/dialog-backdrop.mjs +1 -1
- package/dialog/dialog.cjs +2 -1
- package/dialog/dialog.mjs +2 -1
- package/editable/editable.cjs +2 -2
- package/editable/editable.mjs +2 -2
- package/factory.cjs +1 -2
- package/factory.d.ts +1 -1
- package/factory.mjs +2 -3
- package/factory.test.d.ts +1 -0
- 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-image.cjs +25 -0
- package/file-upload/file-upload-item-preview-image.d.ts +6 -0
- package/file-upload/file-upload-item-preview-image.mjs +21 -0
- package/file-upload/file-upload-item-preview.cjs +25 -0
- package/file-upload/file-upload-item-preview.d.ts +11 -0
- package/file-upload/file-upload-item-preview.mjs +21 -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 +46 -0
- package/file-upload/file-upload.d.ts +9 -0
- package/file-upload/file-upload.mjs +42 -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 +43 -0
- package/file-upload/index.d.ts +29 -0
- package/file-upload/index.mjs +29 -0
- package/file-upload/use-file-upload.cjs +48 -0
- package/file-upload/use-file-upload.d.ts +8 -0
- package/file-upload/use-file-upload.mjs +25 -0
- package/hover-card/hover-card.cjs +2 -1
- package/hover-card/hover-card.mjs +2 -1
- package/index.cjs +74 -42
- package/index.d.ts +1 -0
- package/index.mjs +18 -2
- package/menu/menu.cjs +4 -3
- package/menu/menu.mjs +2 -1
- package/number-input/index.cjs +3 -3
- package/number-input/index.d.ts +1 -1
- package/number-input/index.mjs +1 -1
- package/number-input/number-input.cjs +5 -3
- package/number-input/number-input.d.ts +5 -4
- package/number-input/number-input.mjs +5 -3
- package/number-input/number-input.stories.d.ts +1 -0
- package/package.json +72 -57
- package/pagination/pagination-item.cjs +1 -1
- package/pagination/pagination-item.mjs +1 -1
- package/pagination/pagination.cjs +2 -2
- package/pagination/pagination.mjs +2 -2
- package/pin-input/index.cjs +3 -3
- package/pin-input/index.d.ts +1 -1
- package/pin-input/index.mjs +1 -1
- package/pin-input/pin-input.cjs +2 -2
- package/pin-input/pin-input.mjs +2 -2
- package/popover/popover.cjs +2 -1
- package/popover/popover.mjs +2 -1
- package/portal.cjs +2 -1
- package/portal.d.ts +2 -2
- package/portal.mjs +2 -1
- package/radio-group/radio-group-indicator.cjs +1 -2
- package/radio-group/radio-group-indicator.mjs +1 -2
- package/radio-group/radio-group-item.d.ts +1 -1
- package/radio-group/radio-group.cjs +2 -2
- package/radio-group/radio-group.mjs +2 -2
- package/radio-group/radio-group.stories.d.ts +1 -1
- package/rating-group/rating-group-control.cjs +2 -2
- package/rating-group/rating-group-control.mjs +2 -2
- package/rating-group/rating-group-item-context.d.ts +2 -2
- package/rating-group/rating-group-item.cjs +5 -4
- package/rating-group/rating-group-item.mjs +5 -4
- package/rating-group/rating-group.cjs +2 -2
- package/rating-group/rating-group.mjs +2 -2
- package/rating-group/use-rating-group.cjs +4 -4
- package/rating-group/use-rating-group.d.ts +4 -4
- package/rating-group/use-rating-group.mjs +3 -3
- package/segment-group/segment-group-indicator.cjs +2 -2
- package/segment-group/segment-group-indicator.mjs +2 -2
- package/segment-group/segment-group-item-context.d.ts +1 -13
- package/segment-group/segment-group-item-control.cjs +2 -2
- package/segment-group/segment-group-item-control.mjs +2 -2
- package/segment-group/segment-group-item-text.cjs +2 -2
- package/segment-group/segment-group-item-text.mjs +2 -2
- package/segment-group/segment-group-item.cjs +3 -3
- package/segment-group/segment-group-item.d.ts +3 -2
- package/segment-group/segment-group-item.mjs +3 -3
- package/segment-group/segment-group-label.cjs +2 -2
- package/segment-group/segment-group-label.mjs +2 -2
- package/segment-group/segment-group.cjs +4 -4
- package/segment-group/segment-group.mjs +4 -4
- package/select/select-item-group.cjs +2 -2
- package/select/select-item-group.mjs +2 -2
- package/select/select.cjs +1 -1
- package/select/select.d.ts +1 -1
- package/select/select.mjs +1 -1
- package/select/select.stories.d.ts +1 -0
- package/slider/slider.stories.d.ts +1 -1
- package/switch/switch.cjs +2 -2
- package/switch/switch.mjs +2 -2
- package/toast/create-toaster.cjs +2 -2
- package/toast/create-toaster.d.ts +1 -1
- package/toast/create-toaster.mjs +2 -2
- package/toast/index.cjs +5 -2
- package/toast/index.d.ts +6 -4
- package/toast/index.mjs +5 -3
- package/toast/toast-group.cjs +15 -0
- package/toast/toast-group.d.ts +6 -0
- package/toast/toast-group.mjs +11 -0
- package/tooltip/tooltip.cjs +2 -1
- package/tooltip/tooltip.mjs +2 -1
- package/use-is-server.cjs +16 -0
- package/use-is-server.d.ts +1 -0
- package/use-is-server.mjs +12 -0
- package/segment-group/segment-group.anatomy.cjs +0 -10
- package/segment-group/segment-group.anatomy.d.ts +0 -2
- package/segment-group/segment-group.anatomy.mjs +0 -6
- /package/number-input/{number-input-field.cjs → number-input-input.cjs} +0 -0
- /package/number-input/{number-input-field.d.ts → number-input-input.d.ts} +0 -0
- /package/number-input/{number-input-field.mjs → number-input-input.mjs} +0 -0
- /package/pin-input/{pin-input-field.cjs → pin-input-input.cjs} +0 -0
- /package/pin-input/{pin-input-field.d.ts → pin-input-input.d.ts} +0 -0
- /package/pin-input/{pin-input-field.mjs → pin-input-input.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,40 @@ description: All notable changes to this project will be documented in this file
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [1.2.0] - 2023-12-13
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added the `ToastGroup` component.
|
|
14
|
+
- Added entrypoint for the `ark` factory at `@ark-ui/react/factory`
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- Revised the `FileUpload` component. Check out the [documentation](https://ark-ui.com/docs/components/file-upload) for more information.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Added an explicit return type for the `Portal` component to resolve an issue with online code editors.
|
|
23
|
+
- Resolved an issue where the `present` prop in the disclosure-type component was not being respected.
|
|
24
|
+
- Resolved an issue where the `ark` function would log a warning when the `asChild` prop was set to `false`.
|
|
25
|
+
- Fixed an issue where keyboard interactions within a submenu would bubble up to the parent `Menu`.
|
|
26
|
+
- Fixed an issue with hydration mismatch in the `Portal` component.
|
|
27
|
+
|
|
28
|
+
## [1.1.0] - 2023-11-21
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Added render function to the `NumberInput` component
|
|
33
|
+
- Added `FileUpload` component
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Revised the `ColorPicker` component. Check out the [documentation](https://ark-ui.com/docs/components/color-picker) for more information.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- Resolved an issue where the `Toast` component would throw a warning when multiple toasts were rendered at the same time.
|
|
42
|
+
|
|
9
43
|
## [1.0.1] - 2023-11-10
|
|
10
44
|
|
|
11
45
|
### Fixed
|
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,31 +61,34 @@ 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'
|
|
64
|
+
import { Slider, type SliderProps } from '@ark-ui/react'
|
|
74
65
|
import { useState } from 'react'
|
|
75
66
|
|
|
76
|
-
export const MySlider = () => {
|
|
77
|
-
const [value, setValue] = useState(
|
|
67
|
+
export const MySlider = (props: SliderProps) => {
|
|
68
|
+
const [value, setValue] = useState([42])
|
|
78
69
|
|
|
79
70
|
return (
|
|
80
|
-
<Slider
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
<Slider.Root
|
|
72
|
+
min={0}
|
|
73
|
+
max={100}
|
|
74
|
+
value={value}
|
|
75
|
+
onValueChange={(e) => setValue(e.value)}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
<Slider.Label>Label</Slider.Label>
|
|
79
|
+
<Slider.ValueText />
|
|
80
|
+
<Slider.Control>
|
|
81
|
+
<Slider.Track>
|
|
82
|
+
<Slider.Range />
|
|
83
|
+
</Slider.Track>
|
|
84
|
+
<Slider.Thumb key={0} index={0} />
|
|
85
|
+
</Slider.Control>
|
|
86
|
+
<Slider.MarkerGroup>
|
|
87
|
+
<Slider.Marker value={25}>25</Slider.Marker>
|
|
88
|
+
<Slider.Marker value={50}>50</Slider.Marker>
|
|
89
|
+
<Slider.Marker value={75}>75</Slider.Marker>
|
|
90
|
+
</Slider.MarkerGroup>
|
|
91
|
+
</Slider.Root>
|
|
90
92
|
)
|
|
91
93
|
}
|
|
92
94
|
```
|
|
@@ -95,10 +97,14 @@ export const MySlider = () => {
|
|
|
95
97
|
|
|
96
98
|
For more detailed documentation and examples, please visit the [official documentation](https://ark-ui.com/).
|
|
97
99
|
|
|
100
|
+
## Roadmap
|
|
101
|
+
|
|
102
|
+
You can request, vote for, and check upcoming features on our [roadmap](https://ark-ui.canny.io/).
|
|
103
|
+
|
|
98
104
|
## Contribution
|
|
99
105
|
|
|
100
|
-
We welcome contributions to
|
|
106
|
+
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
107
|
|
|
102
|
-
##
|
|
108
|
+
## License
|
|
103
109
|
|
|
104
110
|
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",
|
|
@@ -41,7 +43,7 @@ const ColorPicker = react.forwardRef((props, ref) => {
|
|
|
41
43
|
"value"
|
|
42
44
|
]);
|
|
43
45
|
const api = useColorPicker.useColorPicker(useColorPickerProps);
|
|
44
|
-
const presenceApi = usePresence.usePresence({
|
|
46
|
+
const presenceApi = usePresence.usePresence(react$1.mergeProps({ present: api.isOpen }, presenceProps));
|
|
45
47
|
const view = runIfFn.runIfFn(children, api);
|
|
46
48
|
const mergedProps = react$1.mergeProps(api.rootProps, localProps);
|
|
47
49
|
return /* @__PURE__ */ jsxRuntime.jsx(colorPickerContext.ColorPickerProvider, { value: api, children: /* @__PURE__ */ jsxRuntime.jsxs(presenceContext.PresenceProvider, { value: presenceApi, children: [
|
|
@@ -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",
|
|
@@ -37,7 +39,7 @@ const ColorPicker = forwardRef((props, ref) => {
|
|
|
37
39
|
"value"
|
|
38
40
|
]);
|
|
39
41
|
const api = useColorPicker(useColorPickerProps);
|
|
40
|
-
const presenceApi = usePresence({
|
|
42
|
+
const presenceApi = usePresence(mergeProps({ present: api.isOpen }, presenceProps));
|
|
41
43
|
const view = runIfFn(children, api);
|
|
42
44
|
const mergedProps = mergeProps(api.rootProps, localProps);
|
|
43
45
|
return /* @__PURE__ */ jsx(ColorPickerProvider, { value: api, children: /* @__PURE__ */ jsxs(PresenceProvider, { value: presenceApi, children: [
|
package/color-picker/index.cjs
CHANGED
|
@@ -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;
|