@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.
- package/CHANGELOG.md +15 -0
- 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/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/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
|
@@ -4,42 +4,47 @@ import { mergeProps } from '@zag-js/react';
|
|
|
4
4
|
import { forwardRef } from 'react';
|
|
5
5
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
6
6
|
import { ark } from '../factory.mjs';
|
|
7
|
+
import { runIfFn } from '../run-if-fn.mjs';
|
|
7
8
|
import { NumberInputProvider } from './number-input-context.mjs';
|
|
8
9
|
import { useNumberInput } from './use-number-input.mjs';
|
|
9
10
|
|
|
10
11
|
const NumberInput = forwardRef((props, ref) => {
|
|
11
|
-
const [useNumberInputProps, divProps] = createSplitProps()(
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
12
|
+
const [useNumberInputProps, { children, ...divProps }] = createSplitProps()(
|
|
13
|
+
props,
|
|
14
|
+
[
|
|
15
|
+
"allowMouseWheel",
|
|
16
|
+
"allowOverflow",
|
|
17
|
+
"clampValueOnBlur",
|
|
18
|
+
"defaultValue",
|
|
19
|
+
"dir",
|
|
20
|
+
"disabled",
|
|
21
|
+
"focusInputOnChange",
|
|
22
|
+
"form",
|
|
23
|
+
"formatOptions",
|
|
24
|
+
"getRootNode",
|
|
25
|
+
"id",
|
|
26
|
+
"ids",
|
|
27
|
+
"inputMode",
|
|
28
|
+
"invalid",
|
|
29
|
+
"locale",
|
|
30
|
+
"max",
|
|
31
|
+
"min",
|
|
32
|
+
"name",
|
|
33
|
+
"onFocusChange",
|
|
34
|
+
"onValueChange",
|
|
35
|
+
"onValueInvalid",
|
|
36
|
+
"pattern",
|
|
37
|
+
"readOnly",
|
|
38
|
+
"spinOnPress",
|
|
39
|
+
"step",
|
|
40
|
+
"translations",
|
|
41
|
+
"value"
|
|
42
|
+
]
|
|
43
|
+
);
|
|
40
44
|
const api = useNumberInput(useNumberInputProps);
|
|
41
45
|
const mergedProps = mergeProps(api.rootProps, divProps);
|
|
42
|
-
|
|
46
|
+
const view = runIfFn(children, api);
|
|
47
|
+
return /* @__PURE__ */ jsx(NumberInputProvider, { value: api, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref, children: view }) });
|
|
43
48
|
});
|
|
44
49
|
NumberInput.displayName = "NumberInput";
|
|
45
50
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accordion",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dialog",
|
|
14
14
|
"editable",
|
|
15
15
|
"environment",
|
|
16
|
+
"file upload",
|
|
16
17
|
"hover card",
|
|
17
18
|
"menu",
|
|
18
19
|
"number input",
|
|
@@ -59,42 +60,43 @@
|
|
|
59
60
|
"release-it": "release-it --config ../../../release-it.json"
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
|
-
"@ark-ui/anatomy": "1.
|
|
63
|
-
"@zag-js/accordion": "0.
|
|
64
|
-
"@zag-js/avatar": "0.
|
|
65
|
-
"@zag-js/carousel": "0.
|
|
66
|
-
"@zag-js/checkbox": "0.
|
|
67
|
-
"@zag-js/color-picker": "0.
|
|
68
|
-
"@zag-js/color-utils": "0.
|
|
69
|
-
"@zag-js/combobox": "0.
|
|
70
|
-
"@zag-js/core": "0.
|
|
71
|
-
"@zag-js/date-picker": "0.
|
|
72
|
-
"@zag-js/date-utils": "0.
|
|
73
|
-
"@zag-js/dialog": "0.
|
|
74
|
-
"@zag-js/editable": "0.
|
|
75
|
-
"@zag-js/
|
|
76
|
-
"@zag-js/
|
|
77
|
-
"@zag-js/
|
|
78
|
-
"@zag-js/
|
|
79
|
-
"@zag-js/
|
|
80
|
-
"@zag-js/
|
|
81
|
-
"@zag-js/
|
|
82
|
-
"@zag-js/
|
|
83
|
-
"@zag-js/
|
|
84
|
-
"@zag-js/
|
|
85
|
-
"@zag-js/
|
|
86
|
-
"@zag-js/
|
|
87
|
-
"@zag-js/
|
|
88
|
-
"@zag-js/
|
|
89
|
-
"@zag-js/
|
|
90
|
-
"@zag-js/
|
|
91
|
-
"@zag-js/
|
|
92
|
-
"@zag-js/
|
|
93
|
-
"@zag-js/
|
|
94
|
-
"@zag-js/
|
|
63
|
+
"@ark-ui/anatomy": "1.1.0",
|
|
64
|
+
"@zag-js/accordion": "0.30.0",
|
|
65
|
+
"@zag-js/avatar": "0.30.0",
|
|
66
|
+
"@zag-js/carousel": "0.30.0",
|
|
67
|
+
"@zag-js/checkbox": "0.30.0",
|
|
68
|
+
"@zag-js/color-picker": "0.30.0",
|
|
69
|
+
"@zag-js/color-utils": "0.30.0",
|
|
70
|
+
"@zag-js/combobox": "0.30.0",
|
|
71
|
+
"@zag-js/core": "0.30.0",
|
|
72
|
+
"@zag-js/date-picker": "0.30.0",
|
|
73
|
+
"@zag-js/date-utils": "0.30.0",
|
|
74
|
+
"@zag-js/dialog": "0.30.0",
|
|
75
|
+
"@zag-js/editable": "0.30.0",
|
|
76
|
+
"@zag-js/file-upload": "0.30.0",
|
|
77
|
+
"@zag-js/hover-card": "0.30.0",
|
|
78
|
+
"@zag-js/menu": "0.30.0",
|
|
79
|
+
"@zag-js/number-input": "0.30.0",
|
|
80
|
+
"@zag-js/pagination": "0.30.0",
|
|
81
|
+
"@zag-js/pin-input": "0.30.0",
|
|
82
|
+
"@zag-js/popover": "0.30.0",
|
|
83
|
+
"@zag-js/presence": "0.30.0",
|
|
84
|
+
"@zag-js/radio-group": "0.30.0",
|
|
85
|
+
"@zag-js/rating-group": "0.30.0",
|
|
86
|
+
"@zag-js/react": "0.30.0",
|
|
87
|
+
"@zag-js/select": "0.30.0",
|
|
88
|
+
"@zag-js/slider": "0.30.0",
|
|
89
|
+
"@zag-js/splitter": "0.30.0",
|
|
90
|
+
"@zag-js/switch": "0.30.0",
|
|
91
|
+
"@zag-js/tabs": "0.30.0",
|
|
92
|
+
"@zag-js/tags-input": "0.30.0",
|
|
93
|
+
"@zag-js/toast": "0.30.0",
|
|
94
|
+
"@zag-js/toggle-group": "0.30.0",
|
|
95
|
+
"@zag-js/tooltip": "0.30.0",
|
|
96
|
+
"@zag-js/types": "0.30.0"
|
|
95
97
|
},
|
|
96
98
|
"devDependencies": {
|
|
97
|
-
"@release-it/keep-a-changelog": "
|
|
99
|
+
"@release-it/keep-a-changelog": "5.0.0",
|
|
98
100
|
"@storybook/addon-a11y": "7.5.3",
|
|
99
101
|
"@storybook/addon-essentials": "7.5.3",
|
|
100
102
|
"@storybook/addons": "7.5.3",
|
|
@@ -102,29 +104,30 @@
|
|
|
102
104
|
"@storybook/react-vite": "7.5.3",
|
|
103
105
|
"@testing-library/dom": "9.3.3",
|
|
104
106
|
"@testing-library/jest-dom": "6.1.4",
|
|
105
|
-
"@testing-library/react": "14.1.
|
|
107
|
+
"@testing-library/react": "14.1.2",
|
|
106
108
|
"@testing-library/user-event": "14.5.1",
|
|
107
|
-
"@types/jsdom": "21.1.
|
|
109
|
+
"@types/jsdom": "21.1.6",
|
|
108
110
|
"@types/react": "18.2.37",
|
|
109
|
-
"@types/react-dom": "18.2.
|
|
111
|
+
"@types/react-dom": "18.2.16",
|
|
110
112
|
"@types/testing-library__jest-dom": "5.14.9",
|
|
111
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
112
|
-
"@typescript-eslint/parser": "6.
|
|
113
|
-
"@vitejs/plugin-react": "4.
|
|
113
|
+
"@typescript-eslint/eslint-plugin": "6.12.0",
|
|
114
|
+
"@typescript-eslint/parser": "6.12.0",
|
|
115
|
+
"@vitejs/plugin-react": "4.2.0",
|
|
114
116
|
"@vitest/coverage-v8": "0.34.6",
|
|
115
|
-
"eslint": "8.
|
|
117
|
+
"eslint": "8.54.0",
|
|
116
118
|
"eslint-plugin-react": "7.33.2",
|
|
117
119
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
118
|
-
"globby": "
|
|
120
|
+
"globby": "14.0.0",
|
|
119
121
|
"jsdom": "22.1.0",
|
|
120
122
|
"lucide-react": "0.292.0",
|
|
121
123
|
"react": "18.2.0",
|
|
122
124
|
"react-dom": "18.2.0",
|
|
123
125
|
"react-frame-component": "5.2.6",
|
|
124
|
-
"
|
|
126
|
+
"react-hook-form": "7.48.2",
|
|
127
|
+
"release-it": "17.0.0",
|
|
125
128
|
"resize-observer-polyfill": "1.5.1",
|
|
126
129
|
"storybook": "7.5.3",
|
|
127
|
-
"typescript": "5.
|
|
130
|
+
"typescript": "5.3.2",
|
|
128
131
|
"vite": "4.5.0",
|
|
129
132
|
"vite-plugin-dts": "3.6.3",
|
|
130
133
|
"vitest": "0.34.6"
|
|
@@ -195,6 +198,11 @@
|
|
|
195
198
|
"import": "./environment/index.mjs",
|
|
196
199
|
"require": "./environment/index.cjs"
|
|
197
200
|
},
|
|
201
|
+
"./file-upload": {
|
|
202
|
+
"types": "./file-upload/index.d.ts",
|
|
203
|
+
"import": "./file-upload/index.mjs",
|
|
204
|
+
"require": "./file-upload/index.cjs"
|
|
205
|
+
},
|
|
198
206
|
"./hover-card": {
|
|
199
207
|
"types": "./hover-card/index.d.ts",
|
|
200
208
|
"import": "./hover-card/index.mjs",
|
|
@@ -7,4 +7,4 @@ export default meta;
|
|
|
7
7
|
export declare const Basic: () => JSX.Element;
|
|
8
8
|
export declare const Disabled: () => JSX.Element;
|
|
9
9
|
export declare const InitialValue: () => JSX.Element;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const OnEvent: () => JSX.Element;
|
|
@@ -5,6 +5,7 @@ type SliderType = typeof Slider;
|
|
|
5
5
|
declare const meta: Meta<SliderType>;
|
|
6
6
|
export default meta;
|
|
7
7
|
export declare const Basic: () => JSX.Element;
|
|
8
|
+
export declare const Range: () => JSX.Element;
|
|
8
9
|
export declare const WithMarks: () => JSX.Element;
|
|
9
10
|
export declare const InitialValue: () => JSX.Element;
|
|
10
11
|
export declare const MinMax: () => JSX.Element;
|
|
@@ -12,4 +13,3 @@ export declare const Step: () => JSX.Element;
|
|
|
12
13
|
export declare const OnEvent: () => JSX.Element;
|
|
13
14
|
export declare const Vertical: () => JSX.Element;
|
|
14
15
|
export declare const CenterOrigin: () => JSX.Element;
|
|
15
|
-
export declare const Advanced: () => JSX.Element;
|
package/toast/create-toaster.cjs
CHANGED
|
@@ -45,7 +45,7 @@ const createToaster = (props) => {
|
|
|
45
45
|
}, []);
|
|
46
46
|
const mergedProps = react.mergeProps(api.getGroupProps({ placement }), props2);
|
|
47
47
|
const toasts = api.toastsByPlacement[placement] ?? [];
|
|
48
|
-
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsxRuntime.jsx(ToastProviderFactory, { service: toast2 },
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsx(factory.ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsxRuntime.jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
|
|
49
49
|
});
|
|
50
50
|
Toaster.displayName = "ToastGroup";
|
|
51
51
|
return [Toaster, api];
|
package/toast/create-toaster.mjs
CHANGED
|
@@ -22,7 +22,7 @@ const createToaster = (props) => {
|
|
|
22
22
|
}, []);
|
|
23
23
|
const mergedProps = mergeProps(api.getGroupProps({ placement }), props2);
|
|
24
24
|
const toasts = api.toastsByPlacement[placement] ?? [];
|
|
25
|
-
return /* @__PURE__ */ jsx(ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastProviderFactory, { service: toast2 },
|
|
25
|
+
return /* @__PURE__ */ jsx(ark.ol, { ...mergedProps, ref, children: toasts.map((toast2) => /* @__PURE__ */ jsx(ToastProviderFactory, { service: toast2 }, toast2.id)) });
|
|
26
26
|
});
|
|
27
27
|
Toaster.displayName = "ToastGroup";
|
|
28
28
|
return [Toaster, api];
|