@ark-ui/react 5.18.2 → 5.18.3
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.
|
@@ -26,10 +26,10 @@ const withAsChild = (Component) => {
|
|
|
26
26
|
if (!asChild) {
|
|
27
27
|
return react.createElement(Component, { ...restProps, ref }, children);
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
if (!react.isValidElement(onlyChild)) {
|
|
29
|
+
if (!react.isValidElement(children)) {
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
32
|
+
const onlyChild = react.Children.only(children);
|
|
33
33
|
const childRef = getRef(onlyChild);
|
|
34
34
|
return react.cloneElement(onlyChild, {
|
|
35
35
|
...core.mergeProps(restProps, onlyChild.props),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { mergeProps } from '@zag-js/core';
|
|
2
|
-
import { memo, forwardRef, createElement,
|
|
2
|
+
import { memo, forwardRef, createElement, isValidElement, Children, cloneElement } from 'react';
|
|
3
3
|
import { composeRefs } from '../utils/compose-refs.js';
|
|
4
4
|
|
|
5
5
|
function getRef(element) {
|
|
@@ -22,10 +22,10 @@ const withAsChild = (Component) => {
|
|
|
22
22
|
if (!asChild) {
|
|
23
23
|
return createElement(Component, { ...restProps, ref }, children);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
if (!isValidElement(onlyChild)) {
|
|
25
|
+
if (!isValidElement(children)) {
|
|
27
26
|
return null;
|
|
28
27
|
}
|
|
28
|
+
const onlyChild = Children.only(children);
|
|
29
29
|
const childRef = getRef(onlyChild);
|
|
30
30
|
return cloneElement(onlyChild, {
|
|
31
31
|
...mergeProps(restProps, onlyChild.props),
|
package/dist/utils/use-event.cjs
CHANGED
|
@@ -9,7 +9,6 @@ function useEvent(callback, opts = {}) {
|
|
|
9
9
|
const { sync = false } = opts;
|
|
10
10
|
const callbackRef = useLatestRef(callback);
|
|
11
11
|
return react.useCallback(
|
|
12
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
13
12
|
(...args) => {
|
|
14
13
|
if (sync) return queueMicrotask(() => callbackRef.current?.(...args));
|
|
15
14
|
return callbackRef.current?.(...args);
|
package/dist/utils/use-event.js
CHANGED
|
@@ -5,7 +5,6 @@ function useEvent(callback, opts = {}) {
|
|
|
5
5
|
const { sync = false } = opts;
|
|
6
6
|
const callbackRef = useLatestRef(callback);
|
|
7
7
|
return useCallback(
|
|
8
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
9
8
|
(...args) => {
|
|
10
9
|
if (sync) return queueMicrotask(() => callbackRef.current?.(...args));
|
|
11
10
|
return callbackRef.current?.(...args);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ark-ui/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.18.
|
|
4
|
+
"version": "5.18.3",
|
|
5
5
|
"description": "A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"accordion",
|
|
@@ -141,64 +141,64 @@
|
|
|
141
141
|
"sideEffects": false,
|
|
142
142
|
"dependencies": {
|
|
143
143
|
"@internationalized/date": "3.8.2",
|
|
144
|
-
"@zag-js/accordion": "1.21.
|
|
145
|
-
"@zag-js/angle-slider": "1.21.
|
|
146
|
-
"@zag-js/anatomy": "1.21.
|
|
147
|
-
"@zag-js/auto-resize": "1.21.
|
|
148
|
-
"@zag-js/avatar": "1.21.
|
|
149
|
-
"@zag-js/carousel": "1.21.
|
|
150
|
-
"@zag-js/checkbox": "1.21.
|
|
151
|
-
"@zag-js/clipboard": "1.21.
|
|
152
|
-
"@zag-js/collapsible": "1.21.
|
|
153
|
-
"@zag-js/collection": "1.21.
|
|
154
|
-
"@zag-js/color-picker": "1.21.
|
|
155
|
-
"@zag-js/color-utils": "1.21.
|
|
156
|
-
"@zag-js/combobox": "1.21.
|
|
157
|
-
"@zag-js/core": "1.21.
|
|
158
|
-
"@zag-js/date-picker": "1.21.
|
|
159
|
-
"@zag-js/date-utils": "1.21.
|
|
160
|
-
"@zag-js/dialog": "1.21.
|
|
161
|
-
"@zag-js/dom-query": "1.21.
|
|
162
|
-
"@zag-js/editable": "1.21.
|
|
163
|
-
"@zag-js/file-upload": "1.21.
|
|
164
|
-
"@zag-js/file-utils": "1.21.
|
|
165
|
-
"@zag-js/focus-trap": "1.21.
|
|
166
|
-
"@zag-js/floating-panel": "1.21.
|
|
167
|
-
"@zag-js/highlight-word": "1.21.
|
|
168
|
-
"@zag-js/hover-card": "1.21.
|
|
169
|
-
"@zag-js/i18n-utils": "1.21.
|
|
170
|
-
"@zag-js/json-tree-utils": "1.21.
|
|
171
|
-
"@zag-js/listbox": "1.21.
|
|
172
|
-
"@zag-js/menu": "1.21.
|
|
173
|
-
"@zag-js/number-input": "1.21.
|
|
174
|
-
"@zag-js/pagination": "1.21.
|
|
175
|
-
"@zag-js/password-input": "1.21.
|
|
176
|
-
"@zag-js/pin-input": "1.21.
|
|
177
|
-
"@zag-js/popover": "1.21.
|
|
178
|
-
"@zag-js/presence": "1.21.
|
|
179
|
-
"@zag-js/progress": "1.21.
|
|
180
|
-
"@zag-js/qr-code": "1.21.
|
|
181
|
-
"@zag-js/radio-group": "1.21.
|
|
182
|
-
"@zag-js/rating-group": "1.21.
|
|
183
|
-
"@zag-js/react": "1.21.
|
|
184
|
-
"@zag-js/select": "1.21.
|
|
185
|
-
"@zag-js/signature-pad": "1.21.
|
|
186
|
-
"@zag-js/slider": "1.21.
|
|
187
|
-
"@zag-js/splitter": "1.21.
|
|
188
|
-
"@zag-js/steps": "1.21.
|
|
189
|
-
"@zag-js/switch": "1.21.
|
|
190
|
-
"@zag-js/tabs": "1.21.
|
|
191
|
-
"@zag-js/tags-input": "1.21.
|
|
192
|
-
"@zag-js/time-picker": "1.21.
|
|
193
|
-
"@zag-js/timer": "1.21.
|
|
194
|
-
"@zag-js/toast": "1.21.
|
|
195
|
-
"@zag-js/toggle": "1.21.
|
|
196
|
-
"@zag-js/toggle-group": "1.21.
|
|
197
|
-
"@zag-js/tooltip": "1.21.
|
|
198
|
-
"@zag-js/tour": "1.21.
|
|
199
|
-
"@zag-js/tree-view": "1.21.
|
|
200
|
-
"@zag-js/types": "1.21.
|
|
201
|
-
"@zag-js/utils": "1.21.
|
|
144
|
+
"@zag-js/accordion": "1.21.1",
|
|
145
|
+
"@zag-js/angle-slider": "1.21.1",
|
|
146
|
+
"@zag-js/anatomy": "1.21.1",
|
|
147
|
+
"@zag-js/auto-resize": "1.21.1",
|
|
148
|
+
"@zag-js/avatar": "1.21.1",
|
|
149
|
+
"@zag-js/carousel": "1.21.1",
|
|
150
|
+
"@zag-js/checkbox": "1.21.1",
|
|
151
|
+
"@zag-js/clipboard": "1.21.1",
|
|
152
|
+
"@zag-js/collapsible": "1.21.1",
|
|
153
|
+
"@zag-js/collection": "1.21.1",
|
|
154
|
+
"@zag-js/color-picker": "1.21.1",
|
|
155
|
+
"@zag-js/color-utils": "1.21.1",
|
|
156
|
+
"@zag-js/combobox": "1.21.1",
|
|
157
|
+
"@zag-js/core": "1.21.1",
|
|
158
|
+
"@zag-js/date-picker": "1.21.1",
|
|
159
|
+
"@zag-js/date-utils": "1.21.1",
|
|
160
|
+
"@zag-js/dialog": "1.21.1",
|
|
161
|
+
"@zag-js/dom-query": "1.21.1",
|
|
162
|
+
"@zag-js/editable": "1.21.1",
|
|
163
|
+
"@zag-js/file-upload": "1.21.1",
|
|
164
|
+
"@zag-js/file-utils": "1.21.1",
|
|
165
|
+
"@zag-js/focus-trap": "1.21.1",
|
|
166
|
+
"@zag-js/floating-panel": "1.21.1",
|
|
167
|
+
"@zag-js/highlight-word": "1.21.1",
|
|
168
|
+
"@zag-js/hover-card": "1.21.1",
|
|
169
|
+
"@zag-js/i18n-utils": "1.21.1",
|
|
170
|
+
"@zag-js/json-tree-utils": "1.21.1",
|
|
171
|
+
"@zag-js/listbox": "1.21.1",
|
|
172
|
+
"@zag-js/menu": "1.21.1",
|
|
173
|
+
"@zag-js/number-input": "1.21.1",
|
|
174
|
+
"@zag-js/pagination": "1.21.1",
|
|
175
|
+
"@zag-js/password-input": "1.21.1",
|
|
176
|
+
"@zag-js/pin-input": "1.21.1",
|
|
177
|
+
"@zag-js/popover": "1.21.1",
|
|
178
|
+
"@zag-js/presence": "1.21.1",
|
|
179
|
+
"@zag-js/progress": "1.21.1",
|
|
180
|
+
"@zag-js/qr-code": "1.21.1",
|
|
181
|
+
"@zag-js/radio-group": "1.21.1",
|
|
182
|
+
"@zag-js/rating-group": "1.21.1",
|
|
183
|
+
"@zag-js/react": "1.21.1",
|
|
184
|
+
"@zag-js/select": "1.21.1",
|
|
185
|
+
"@zag-js/signature-pad": "1.21.1",
|
|
186
|
+
"@zag-js/slider": "1.21.1",
|
|
187
|
+
"@zag-js/splitter": "1.21.1",
|
|
188
|
+
"@zag-js/steps": "1.21.1",
|
|
189
|
+
"@zag-js/switch": "1.21.1",
|
|
190
|
+
"@zag-js/tabs": "1.21.1",
|
|
191
|
+
"@zag-js/tags-input": "1.21.1",
|
|
192
|
+
"@zag-js/time-picker": "1.21.1",
|
|
193
|
+
"@zag-js/timer": "1.21.1",
|
|
194
|
+
"@zag-js/toast": "1.21.1",
|
|
195
|
+
"@zag-js/toggle": "1.21.1",
|
|
196
|
+
"@zag-js/toggle-group": "1.21.1",
|
|
197
|
+
"@zag-js/tooltip": "1.21.1",
|
|
198
|
+
"@zag-js/tour": "1.21.1",
|
|
199
|
+
"@zag-js/tree-view": "1.21.1",
|
|
200
|
+
"@zag-js/types": "1.21.1",
|
|
201
|
+
"@zag-js/utils": "1.21.1"
|
|
202
202
|
},
|
|
203
203
|
"devDependencies": {
|
|
204
204
|
"@biomejs/biome": "1.9.4",
|