@jobber/components 9.14.4 → 9.15.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/dist/Combobox/index.cjs +1 -0
- package/dist/Combobox/index.mjs +1 -0
- package/dist/ComboboxSeparator-es.js +1 -1
- package/dist/DrawerDescription-es.js +1 -1
- package/dist/DrawerTitle-es.js +1 -1
- package/dist/FieldDescription-cjs.js +6 -298
- package/dist/FieldDescription-es.js +4 -296
- package/dist/InputNumber/index.cjs +1 -0
- package/dist/InputNumber/index.mjs +1 -0
- package/dist/MenuSubmenuTrigger-es.js +1 -1
- package/dist/NumberFieldInput-es.js +1 -1
- package/dist/ScrollAreaViewport-es.js +1 -1
- package/dist/Select/index.cjs +1 -0
- package/dist/Select/index.mjs +1 -0
- package/dist/SelectGroupLabel-es.js +1 -1
- package/dist/docs/Icon/Icon.md +4 -0
- package/dist/index.cjs +1 -0
- package/dist/index.mjs +1 -0
- package/dist/unstyledPrimitives/index.cjs +696 -10
- package/dist/unstyledPrimitives/index.d.ts +2 -0
- package/dist/unstyledPrimitives/index.mjs +693 -9
- package/dist/useCompositeListItem-es.js +1 -1
- package/dist/useFieldValidation-cjs.js +323 -0
- package/dist/useFieldValidation-es.js +299 -0
- package/dist/useScrollLock-es.js +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useLayoutEffect } from 'react';
|
|
3
|
-
import { ae as evaluate, af as getSide, ag as getSideAxis, ah as getOppositePlacement, ai as getExpandedPlacements, aj as getOppositeAxisPlacements, ak as getAlignmentSides, al as getAlignment, am as min, an as max, ao as getAlignmentAxis, ap as getPaddingObject, aa as rectToClientRect, aq as getOppositeAxis, ar as clamp, as as getAxisLength, at as getDocumentElement, au as isElement, i as isHTMLElement, av as createCoords, aw as round, ax as isTopLayer, ay as getNodeName, az as isOverflowElement, aA as getNodeScroll, I as getWindow, b as getParentNode, a as isLastTraversableNode, aB as isTableElement, aC as isContainingBlock, aD as getContainingBlock, g as getComputedStyle$1, aE as getOverflowAncestors, aF as getFrameElement, aG as isWebKit, aH as floor, aI as useId, aJ as useFloatingParentNodeId, aK as FloatingRootStore, aL as PopupTriggerMap, c as useIsoLayoutEffect, aM as useFloatingTree, $ as getFloatingFocusElement, aN as isTypeableCombobox, w as useValueAsRef, d as useStableCallback, a8 as useAnimationFrame, aO as isIndexOutOfListBounds, aP as getMinListIndex, aQ as getMaxListIndex, D as activeElement, o as ownerDocument, a0 as contains, aR as stopEvent,
|
|
3
|
+
import { ae as evaluate, af as getSide, ag as getSideAxis, ah as getOppositePlacement, ai as getExpandedPlacements, aj as getOppositeAxisPlacements, ak as getAlignmentSides, al as getAlignment, am as min, an as max, ao as getAlignmentAxis, ap as getPaddingObject, aa as rectToClientRect, aq as getOppositeAxis, ar as clamp, as as getAxisLength, at as getDocumentElement, au as isElement, i as isHTMLElement, av as createCoords, aw as round, ax as isTopLayer, ay as getNodeName, az as isOverflowElement, aA as getNodeScroll, I as getWindow, b as getParentNode, a as isLastTraversableNode, aB as isTableElement, aC as isContainingBlock, aD as getContainingBlock, g as getComputedStyle$1, aE as getOverflowAncestors, aF as getFrameElement, aG as isWebKit, aH as floor, aI as useId, aJ as useFloatingParentNodeId, aK as FloatingRootStore, aL as PopupTriggerMap, c as useIsoLayoutEffect, aM as useFloatingTree, $ as getFloatingFocusElement, aN as isTypeableCombobox, w as useValueAsRef, d as useStableCallback, a8 as useAnimationFrame, aO as isIndexOutOfListBounds, aP as getMinListIndex, aQ as getMaxListIndex, D as activeElement, o as ownerDocument, a0 as contains, aR as stopEvent, j as createChangeEventDetails, aS as listNavigation, aT as findNonDisabledListIndex, e as getTarget, Y as focusOut, a9 as webkit, aU as enqueueFocus, ac as isVirtualClick, aV as isVirtualPointerEvent, aW as ARROW_UP, aX as ARROW_DOWN, aY as ARROW_LEFT, aZ as ARROW_RIGHT, f as useTimeout, a_ as isElementVisible, a$ as isListIndexDisabled, u as useBaseUiId, b0 as jsdom, a7 as useDirection, b1 as DISABLED_TRANSITIONS_STYLE, a6 as popupStateMapping, b2 as useScrollLock } from './useScrollLock-es.js';
|
|
4
4
|
import { a as useRefWithInit, c as EMPTY_ARRAY, N as NOOP, E as EMPTY_OBJECT, f as formatErrorMessage, u as useRenderElement } from './useRenderElement-es.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import * as ReactDOM from 'react-dom';
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var useRenderElement = require('./useRenderElement-cjs.js');
|
|
5
|
+
var useScrollLock = require('./useScrollLock-cjs.js');
|
|
6
|
+
var useCompositeListItem = require('./useCompositeListItem-cjs.js');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceDefault(e) {
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
26
|
+
|
|
27
|
+
const FieldItemContext = /*#__PURE__*/React__namespace.createContext({
|
|
28
|
+
disabled: false
|
|
29
|
+
});
|
|
30
|
+
if (process.env.NODE_ENV !== "production") FieldItemContext.displayName = "FieldItemContext";
|
|
31
|
+
function useFieldItemContext() {
|
|
32
|
+
const context = React__namespace.useContext(FieldItemContext);
|
|
33
|
+
return context;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Combines the field's client-side, stateful validity data with the external invalid state to
|
|
38
|
+
* determine the field's true validity.
|
|
39
|
+
*/
|
|
40
|
+
function getCombinedFieldValidityData(validityData, invalid) {
|
|
41
|
+
return {
|
|
42
|
+
...validityData,
|
|
43
|
+
state: {
|
|
44
|
+
...validityData.state,
|
|
45
|
+
valid: !invalid && validityData.state.valid
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const validityKeys = Object.keys(useCompositeListItem.DEFAULT_VALIDITY_STATE);
|
|
51
|
+
/**
|
|
52
|
+
* Whether an input participates in the surrounding Base UI Form. Inputs that are effectively
|
|
53
|
+
* disabled, or whose `form` attribute explicitly associates them with another form, are excluded.
|
|
54
|
+
* DOM position only matters when it associates the input with a different form. Otherwise, field
|
|
55
|
+
* registration is context-driven, so portaled inputs (for example inside a dialog) still belong to
|
|
56
|
+
* the form for both validation and values projected into `onFormSubmit`.
|
|
57
|
+
*/
|
|
58
|
+
function isEligibleInput(input, formElement) {
|
|
59
|
+
if (input.matches(':disabled')) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (!formElement || input.form === formElement) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// React context crosses portal boundaries. An unassociated portaled input still participates in
|
|
67
|
+
// contextual validation, unless an explicit `form` attribute opts it out of the surrounding Form.
|
|
68
|
+
return input.form === null && !input.hasAttribute('form');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Picks the input whose native validity should represent a field that owns several inputs (such as a
|
|
73
|
+
* checkbox or radio group). Prefers the first eligible currently-invalid input, where "first" follows
|
|
74
|
+
* registration order (mount order), and otherwise returns the first eligible input.
|
|
75
|
+
*/
|
|
76
|
+
function findRepresentativeInput(inputs, formElement) {
|
|
77
|
+
let fallback = null;
|
|
78
|
+
for (const input of inputs.keys()) {
|
|
79
|
+
if (!isEligibleInput(input, formElement)) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (!input.validity.valid) {
|
|
83
|
+
return input;
|
|
84
|
+
}
|
|
85
|
+
fallback ??= input;
|
|
86
|
+
}
|
|
87
|
+
return fallback;
|
|
88
|
+
}
|
|
89
|
+
function clearCustomValidity(element, inputs) {
|
|
90
|
+
for (const input of inputs.keys()) {
|
|
91
|
+
input.setCustomValidity('');
|
|
92
|
+
}
|
|
93
|
+
element?.setCustomValidity('');
|
|
94
|
+
}
|
|
95
|
+
function useFieldValidation(params) {
|
|
96
|
+
const {
|
|
97
|
+
elementRef,
|
|
98
|
+
formRef
|
|
99
|
+
} = useCompositeListItem.useFormContext();
|
|
100
|
+
const {
|
|
101
|
+
setValidityData,
|
|
102
|
+
validate,
|
|
103
|
+
validityData,
|
|
104
|
+
validationDebounceTime,
|
|
105
|
+
invalid,
|
|
106
|
+
markedDirtyRef,
|
|
107
|
+
state,
|
|
108
|
+
shouldValidateOnChange,
|
|
109
|
+
registeredFieldIdRef
|
|
110
|
+
} = params;
|
|
111
|
+
const {
|
|
112
|
+
controlId,
|
|
113
|
+
getDescriptionProps
|
|
114
|
+
} = useCompositeListItem.useLabelableContext();
|
|
115
|
+
const timeout = useScrollLock.useTimeout();
|
|
116
|
+
const inputRef = React__namespace.useRef(null);
|
|
117
|
+
const registeredInputs = useRenderElement.useRefWithInit(() => new Map()).current;
|
|
118
|
+
const validationCommitIdRef = React__namespace.useRef(0);
|
|
119
|
+
|
|
120
|
+
// Groups register several inputs against a single field so focus, validation, and form-value
|
|
121
|
+
// projection can use the same live controls. This also ensures a `required` checkbox can't be
|
|
122
|
+
// satisfied by another input in the group, matching native per-checkbox behavior.
|
|
123
|
+
const registerInput = React__namespace.useCallback((element, registration) => {
|
|
124
|
+
registeredInputs.set(element, registration);
|
|
125
|
+
return () => {
|
|
126
|
+
registeredInputs.delete(element);
|
|
127
|
+
};
|
|
128
|
+
}, [registeredInputs]);
|
|
129
|
+
const getInputControl = useScrollLock.useStableCallback(() => {
|
|
130
|
+
const element = findRepresentativeInput(registeredInputs, elementRef.current);
|
|
131
|
+
return element && registeredInputs.get(element)?.controlRef.current || null;
|
|
132
|
+
});
|
|
133
|
+
const commit = useScrollLock.useStableCallback(async (value, revalidate = false) => {
|
|
134
|
+
validationCommitIdRef.current += 1;
|
|
135
|
+
const validationCommitId = validationCommitIdRef.current;
|
|
136
|
+
function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid) {
|
|
137
|
+
const fieldId = registeredFieldIdRef.current ?? controlId;
|
|
138
|
+
if (fieldId == null) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const currentFieldData = formRef.current.fields.get(fieldId);
|
|
142
|
+
if (!currentFieldData) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
|
|
146
|
+
formRef.current.fields.set(fieldId, {
|
|
147
|
+
...currentFieldData,
|
|
148
|
+
validityData: validityDataWithFormErrors
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function publishAllValid(input, externalInvalid) {
|
|
152
|
+
const nextValidityData = {
|
|
153
|
+
value,
|
|
154
|
+
state: {
|
|
155
|
+
...useCompositeListItem.DEFAULT_VALIDITY_STATE,
|
|
156
|
+
valid: true
|
|
157
|
+
},
|
|
158
|
+
error: '',
|
|
159
|
+
errors: [],
|
|
160
|
+
initialValue: validityData.initialValue
|
|
161
|
+
};
|
|
162
|
+
clearCustomValidity(input, registeredInputs);
|
|
163
|
+
updateRegisteredFieldValidity(nextValidityData, externalInvalid);
|
|
164
|
+
setValidityData(nextValidityData);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// A field can own several inputs (such as a checkbox or radio group), but only the last-mounted
|
|
168
|
+
// one wins the shared `inputRef`. Validate against the registry instead so every input counts;
|
|
169
|
+
// `inputRef` is the fallback only when no inputs are registered.
|
|
170
|
+
const element = registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
|
|
171
|
+
// A field with no eligible input has no native constraint, but its custom validator still
|
|
172
|
+
// applies to the logical value at the configured validation boundary.
|
|
173
|
+
|
|
174
|
+
if (revalidate) {
|
|
175
|
+
if (state.valid !== false || !element) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const currentNativeValidity = element.validity;
|
|
179
|
+
if (!currentNativeValidity.valueMissing) {
|
|
180
|
+
// The 'valueMissing' (required) condition has been resolved by the user typing.
|
|
181
|
+
// Temporarily mark the field as valid for this onChange event.
|
|
182
|
+
// Other native errors (e.g., typeMismatch) will be caught by full validation on blur or submit.
|
|
183
|
+
// The required value is now present; ignore stale external invalid state for this pass.
|
|
184
|
+
publishAllValid(element, false);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// A stale custom error can coexist with valueMissing, but defer any other native errors.
|
|
189
|
+
for (const key of validityKeys) {
|
|
190
|
+
if (key !== 'valid' && key !== 'valueMissing' && key !== 'customError' && currentNativeValidity[key]) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Value is still missing: publish the current native state so valueMissing and the changed
|
|
196
|
+
// value are observable immediately. Full custom validation still waits for its boundary.
|
|
197
|
+
}
|
|
198
|
+
function getState(el) {
|
|
199
|
+
const computedState = validityKeys.reduce((acc, key) => {
|
|
200
|
+
acc[key] = el.validity[key];
|
|
201
|
+
return acc;
|
|
202
|
+
}, {});
|
|
203
|
+
let hasOnlyValueMissingError = false;
|
|
204
|
+
for (const key of validityKeys) {
|
|
205
|
+
if (key === 'valid') {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (key === 'valueMissing' && computedState[key]) {
|
|
209
|
+
hasOnlyValueMissingError = true;
|
|
210
|
+
} else if (computedState[key]) {
|
|
211
|
+
return computedState;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Only make `valueMissing` mark the field invalid if it's been changed
|
|
216
|
+
// to reduce error noise.
|
|
217
|
+
if (hasOnlyValueMissingError && !markedDirtyRef.current) {
|
|
218
|
+
computedState.valid = true;
|
|
219
|
+
computedState.valueMissing = false;
|
|
220
|
+
}
|
|
221
|
+
return computedState;
|
|
222
|
+
}
|
|
223
|
+
timeout.clear();
|
|
224
|
+
let result = null;
|
|
225
|
+
let validationErrors = [];
|
|
226
|
+
|
|
227
|
+
// With no representative input the field carries no native constraint, so start from an
|
|
228
|
+
// all-valid native state and let the custom `validate` result below decide the outcome.
|
|
229
|
+
const nextState = element ? getState(element) : {
|
|
230
|
+
...useCompositeListItem.DEFAULT_VALIDITY_STATE,
|
|
231
|
+
valid: true
|
|
232
|
+
};
|
|
233
|
+
let defaultValidationMessage;
|
|
234
|
+
const isValidatingOnChange = shouldValidateOnChange();
|
|
235
|
+
if (element && element.validationMessage && !isValidatingOnChange) {
|
|
236
|
+
// not validating on change, if there is a `validationMessage` from
|
|
237
|
+
// native validity, set errors and skip calling the custom validate fn
|
|
238
|
+
defaultValidationMessage = element.validationMessage;
|
|
239
|
+
validationErrors = [element.validationMessage];
|
|
240
|
+
} else {
|
|
241
|
+
// call the validate function because either
|
|
242
|
+
// - validating on change, or
|
|
243
|
+
// - native constraint validations passed, custom validity check is next
|
|
244
|
+
const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
|
|
245
|
+
if (field.name) {
|
|
246
|
+
acc[field.name] = field.getValue();
|
|
247
|
+
}
|
|
248
|
+
return acc;
|
|
249
|
+
}, {});
|
|
250
|
+
const resultOrPromise = validate(value, formValues);
|
|
251
|
+
if (typeof resultOrPromise === 'object' && resultOrPromise !== null && 'then' in resultOrPromise) {
|
|
252
|
+
result = await resultOrPromise;
|
|
253
|
+
if (validationCommitId !== validationCommitIdRef.current) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
result = resultOrPromise;
|
|
258
|
+
}
|
|
259
|
+
if (result !== null) {
|
|
260
|
+
nextState.valid = false;
|
|
261
|
+
nextState.customError = true;
|
|
262
|
+
if (Array.isArray(result)) {
|
|
263
|
+
validationErrors = result;
|
|
264
|
+
element?.setCustomValidity(result.join('\n'));
|
|
265
|
+
} else if (result) {
|
|
266
|
+
validationErrors = [result];
|
|
267
|
+
element?.setCustomValidity(result);
|
|
268
|
+
}
|
|
269
|
+
} else if (isValidatingOnChange) {
|
|
270
|
+
// validate function returned no errors, if validating on change
|
|
271
|
+
// we need to clear the custom validity state
|
|
272
|
+
clearCustomValidity(element, registeredInputs);
|
|
273
|
+
nextState.customError = false;
|
|
274
|
+
if (element && element.validationMessage) {
|
|
275
|
+
defaultValidationMessage = element.validationMessage;
|
|
276
|
+
validationErrors = [element.validationMessage];
|
|
277
|
+
} else if ((!element || element.validity.valid) && !nextState.valid) {
|
|
278
|
+
nextState.valid = true;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const nextValidityData = {
|
|
283
|
+
value,
|
|
284
|
+
state: nextState,
|
|
285
|
+
error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ''),
|
|
286
|
+
errors: validationErrors,
|
|
287
|
+
initialValue: validityData.initialValue
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// Keep Form-level errors part of overall field validity for submit blocking/focus logic.
|
|
291
|
+
updateRegisteredFieldValidity(nextValidityData);
|
|
292
|
+
setValidityData(nextValidityData);
|
|
293
|
+
});
|
|
294
|
+
const change = useScrollLock.useStableCallback(value => {
|
|
295
|
+
timeout.clear();
|
|
296
|
+
const validateOnChange = shouldValidateOnChange();
|
|
297
|
+
if (validateOnChange && value !== '' && validationDebounceTime) {
|
|
298
|
+
validationCommitIdRef.current += 1;
|
|
299
|
+
timeout.start(validationDebounceTime, () => {
|
|
300
|
+
commit(value);
|
|
301
|
+
});
|
|
302
|
+
} else {
|
|
303
|
+
commit(value, !validateOnChange);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
const getValidationProps = React__namespace.useCallback((disabled, externalProps = {}) => useRenderElement.mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled ? {
|
|
307
|
+
'aria-invalid': true
|
|
308
|
+
} : useRenderElement.EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
|
|
309
|
+
return React__namespace.useMemo(() => ({
|
|
310
|
+
getValidationProps,
|
|
311
|
+
inputRef,
|
|
312
|
+
registeredInputs,
|
|
313
|
+
registerInput,
|
|
314
|
+
getInputControl,
|
|
315
|
+
commit,
|
|
316
|
+
change
|
|
317
|
+
}), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
exports.getCombinedFieldValidityData = getCombinedFieldValidityData;
|
|
321
|
+
exports.isEligibleInput = isEligibleInput;
|
|
322
|
+
exports.useFieldItemContext = useFieldItemContext;
|
|
323
|
+
exports.useFieldValidation = useFieldValidation;
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { a as useRefWithInit, m as mergeProps, E as EMPTY_OBJECT } from './useRenderElement-es.js';
|
|
3
|
+
import { f as useTimeout, d as useStableCallback } from './useScrollLock-es.js';
|
|
4
|
+
import { a as useFormContext, u as useLabelableContext, D as DEFAULT_VALIDITY_STATE } from './useCompositeListItem-es.js';
|
|
5
|
+
|
|
6
|
+
const FieldItemContext = /*#__PURE__*/React.createContext({
|
|
7
|
+
disabled: false
|
|
8
|
+
});
|
|
9
|
+
if (process.env.NODE_ENV !== "production") FieldItemContext.displayName = "FieldItemContext";
|
|
10
|
+
function useFieldItemContext() {
|
|
11
|
+
const context = React.useContext(FieldItemContext);
|
|
12
|
+
return context;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Combines the field's client-side, stateful validity data with the external invalid state to
|
|
17
|
+
* determine the field's true validity.
|
|
18
|
+
*/
|
|
19
|
+
function getCombinedFieldValidityData(validityData, invalid) {
|
|
20
|
+
return {
|
|
21
|
+
...validityData,
|
|
22
|
+
state: {
|
|
23
|
+
...validityData.state,
|
|
24
|
+
valid: !invalid && validityData.state.valid
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
|
|
30
|
+
/**
|
|
31
|
+
* Whether an input participates in the surrounding Base UI Form. Inputs that are effectively
|
|
32
|
+
* disabled, or whose `form` attribute explicitly associates them with another form, are excluded.
|
|
33
|
+
* DOM position only matters when it associates the input with a different form. Otherwise, field
|
|
34
|
+
* registration is context-driven, so portaled inputs (for example inside a dialog) still belong to
|
|
35
|
+
* the form for both validation and values projected into `onFormSubmit`.
|
|
36
|
+
*/
|
|
37
|
+
function isEligibleInput(input, formElement) {
|
|
38
|
+
if (input.matches(':disabled')) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (!formElement || input.form === formElement) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// React context crosses portal boundaries. An unassociated portaled input still participates in
|
|
46
|
+
// contextual validation, unless an explicit `form` attribute opts it out of the surrounding Form.
|
|
47
|
+
return input.form === null && !input.hasAttribute('form');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Picks the input whose native validity should represent a field that owns several inputs (such as a
|
|
52
|
+
* checkbox or radio group). Prefers the first eligible currently-invalid input, where "first" follows
|
|
53
|
+
* registration order (mount order), and otherwise returns the first eligible input.
|
|
54
|
+
*/
|
|
55
|
+
function findRepresentativeInput(inputs, formElement) {
|
|
56
|
+
let fallback = null;
|
|
57
|
+
for (const input of inputs.keys()) {
|
|
58
|
+
if (!isEligibleInput(input, formElement)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (!input.validity.valid) {
|
|
62
|
+
return input;
|
|
63
|
+
}
|
|
64
|
+
fallback ??= input;
|
|
65
|
+
}
|
|
66
|
+
return fallback;
|
|
67
|
+
}
|
|
68
|
+
function clearCustomValidity(element, inputs) {
|
|
69
|
+
for (const input of inputs.keys()) {
|
|
70
|
+
input.setCustomValidity('');
|
|
71
|
+
}
|
|
72
|
+
element?.setCustomValidity('');
|
|
73
|
+
}
|
|
74
|
+
function useFieldValidation(params) {
|
|
75
|
+
const {
|
|
76
|
+
elementRef,
|
|
77
|
+
formRef
|
|
78
|
+
} = useFormContext();
|
|
79
|
+
const {
|
|
80
|
+
setValidityData,
|
|
81
|
+
validate,
|
|
82
|
+
validityData,
|
|
83
|
+
validationDebounceTime,
|
|
84
|
+
invalid,
|
|
85
|
+
markedDirtyRef,
|
|
86
|
+
state,
|
|
87
|
+
shouldValidateOnChange,
|
|
88
|
+
registeredFieldIdRef
|
|
89
|
+
} = params;
|
|
90
|
+
const {
|
|
91
|
+
controlId,
|
|
92
|
+
getDescriptionProps
|
|
93
|
+
} = useLabelableContext();
|
|
94
|
+
const timeout = useTimeout();
|
|
95
|
+
const inputRef = React.useRef(null);
|
|
96
|
+
const registeredInputs = useRefWithInit(() => new Map()).current;
|
|
97
|
+
const validationCommitIdRef = React.useRef(0);
|
|
98
|
+
|
|
99
|
+
// Groups register several inputs against a single field so focus, validation, and form-value
|
|
100
|
+
// projection can use the same live controls. This also ensures a `required` checkbox can't be
|
|
101
|
+
// satisfied by another input in the group, matching native per-checkbox behavior.
|
|
102
|
+
const registerInput = React.useCallback((element, registration) => {
|
|
103
|
+
registeredInputs.set(element, registration);
|
|
104
|
+
return () => {
|
|
105
|
+
registeredInputs.delete(element);
|
|
106
|
+
};
|
|
107
|
+
}, [registeredInputs]);
|
|
108
|
+
const getInputControl = useStableCallback(() => {
|
|
109
|
+
const element = findRepresentativeInput(registeredInputs, elementRef.current);
|
|
110
|
+
return element && registeredInputs.get(element)?.controlRef.current || null;
|
|
111
|
+
});
|
|
112
|
+
const commit = useStableCallback(async (value, revalidate = false) => {
|
|
113
|
+
validationCommitIdRef.current += 1;
|
|
114
|
+
const validationCommitId = validationCommitIdRef.current;
|
|
115
|
+
function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid) {
|
|
116
|
+
const fieldId = registeredFieldIdRef.current ?? controlId;
|
|
117
|
+
if (fieldId == null) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const currentFieldData = formRef.current.fields.get(fieldId);
|
|
121
|
+
if (!currentFieldData) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
|
|
125
|
+
formRef.current.fields.set(fieldId, {
|
|
126
|
+
...currentFieldData,
|
|
127
|
+
validityData: validityDataWithFormErrors
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function publishAllValid(input, externalInvalid) {
|
|
131
|
+
const nextValidityData = {
|
|
132
|
+
value,
|
|
133
|
+
state: {
|
|
134
|
+
...DEFAULT_VALIDITY_STATE,
|
|
135
|
+
valid: true
|
|
136
|
+
},
|
|
137
|
+
error: '',
|
|
138
|
+
errors: [],
|
|
139
|
+
initialValue: validityData.initialValue
|
|
140
|
+
};
|
|
141
|
+
clearCustomValidity(input, registeredInputs);
|
|
142
|
+
updateRegisteredFieldValidity(nextValidityData, externalInvalid);
|
|
143
|
+
setValidityData(nextValidityData);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// A field can own several inputs (such as a checkbox or radio group), but only the last-mounted
|
|
147
|
+
// one wins the shared `inputRef`. Validate against the registry instead so every input counts;
|
|
148
|
+
// `inputRef` is the fallback only when no inputs are registered.
|
|
149
|
+
const element = registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
|
|
150
|
+
// A field with no eligible input has no native constraint, but its custom validator still
|
|
151
|
+
// applies to the logical value at the configured validation boundary.
|
|
152
|
+
|
|
153
|
+
if (revalidate) {
|
|
154
|
+
if (state.valid !== false || !element) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const currentNativeValidity = element.validity;
|
|
158
|
+
if (!currentNativeValidity.valueMissing) {
|
|
159
|
+
// The 'valueMissing' (required) condition has been resolved by the user typing.
|
|
160
|
+
// Temporarily mark the field as valid for this onChange event.
|
|
161
|
+
// Other native errors (e.g., typeMismatch) will be caught by full validation on blur or submit.
|
|
162
|
+
// The required value is now present; ignore stale external invalid state for this pass.
|
|
163
|
+
publishAllValid(element, false);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// A stale custom error can coexist with valueMissing, but defer any other native errors.
|
|
168
|
+
for (const key of validityKeys) {
|
|
169
|
+
if (key !== 'valid' && key !== 'valueMissing' && key !== 'customError' && currentNativeValidity[key]) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Value is still missing: publish the current native state so valueMissing and the changed
|
|
175
|
+
// value are observable immediately. Full custom validation still waits for its boundary.
|
|
176
|
+
}
|
|
177
|
+
function getState(el) {
|
|
178
|
+
const computedState = validityKeys.reduce((acc, key) => {
|
|
179
|
+
acc[key] = el.validity[key];
|
|
180
|
+
return acc;
|
|
181
|
+
}, {});
|
|
182
|
+
let hasOnlyValueMissingError = false;
|
|
183
|
+
for (const key of validityKeys) {
|
|
184
|
+
if (key === 'valid') {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (key === 'valueMissing' && computedState[key]) {
|
|
188
|
+
hasOnlyValueMissingError = true;
|
|
189
|
+
} else if (computedState[key]) {
|
|
190
|
+
return computedState;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Only make `valueMissing` mark the field invalid if it's been changed
|
|
195
|
+
// to reduce error noise.
|
|
196
|
+
if (hasOnlyValueMissingError && !markedDirtyRef.current) {
|
|
197
|
+
computedState.valid = true;
|
|
198
|
+
computedState.valueMissing = false;
|
|
199
|
+
}
|
|
200
|
+
return computedState;
|
|
201
|
+
}
|
|
202
|
+
timeout.clear();
|
|
203
|
+
let result = null;
|
|
204
|
+
let validationErrors = [];
|
|
205
|
+
|
|
206
|
+
// With no representative input the field carries no native constraint, so start from an
|
|
207
|
+
// all-valid native state and let the custom `validate` result below decide the outcome.
|
|
208
|
+
const nextState = element ? getState(element) : {
|
|
209
|
+
...DEFAULT_VALIDITY_STATE,
|
|
210
|
+
valid: true
|
|
211
|
+
};
|
|
212
|
+
let defaultValidationMessage;
|
|
213
|
+
const isValidatingOnChange = shouldValidateOnChange();
|
|
214
|
+
if (element && element.validationMessage && !isValidatingOnChange) {
|
|
215
|
+
// not validating on change, if there is a `validationMessage` from
|
|
216
|
+
// native validity, set errors and skip calling the custom validate fn
|
|
217
|
+
defaultValidationMessage = element.validationMessage;
|
|
218
|
+
validationErrors = [element.validationMessage];
|
|
219
|
+
} else {
|
|
220
|
+
// call the validate function because either
|
|
221
|
+
// - validating on change, or
|
|
222
|
+
// - native constraint validations passed, custom validity check is next
|
|
223
|
+
const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
|
|
224
|
+
if (field.name) {
|
|
225
|
+
acc[field.name] = field.getValue();
|
|
226
|
+
}
|
|
227
|
+
return acc;
|
|
228
|
+
}, {});
|
|
229
|
+
const resultOrPromise = validate(value, formValues);
|
|
230
|
+
if (typeof resultOrPromise === 'object' && resultOrPromise !== null && 'then' in resultOrPromise) {
|
|
231
|
+
result = await resultOrPromise;
|
|
232
|
+
if (validationCommitId !== validationCommitIdRef.current) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
} else {
|
|
236
|
+
result = resultOrPromise;
|
|
237
|
+
}
|
|
238
|
+
if (result !== null) {
|
|
239
|
+
nextState.valid = false;
|
|
240
|
+
nextState.customError = true;
|
|
241
|
+
if (Array.isArray(result)) {
|
|
242
|
+
validationErrors = result;
|
|
243
|
+
element?.setCustomValidity(result.join('\n'));
|
|
244
|
+
} else if (result) {
|
|
245
|
+
validationErrors = [result];
|
|
246
|
+
element?.setCustomValidity(result);
|
|
247
|
+
}
|
|
248
|
+
} else if (isValidatingOnChange) {
|
|
249
|
+
// validate function returned no errors, if validating on change
|
|
250
|
+
// we need to clear the custom validity state
|
|
251
|
+
clearCustomValidity(element, registeredInputs);
|
|
252
|
+
nextState.customError = false;
|
|
253
|
+
if (element && element.validationMessage) {
|
|
254
|
+
defaultValidationMessage = element.validationMessage;
|
|
255
|
+
validationErrors = [element.validationMessage];
|
|
256
|
+
} else if ((!element || element.validity.valid) && !nextState.valid) {
|
|
257
|
+
nextState.valid = true;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
const nextValidityData = {
|
|
262
|
+
value,
|
|
263
|
+
state: nextState,
|
|
264
|
+
error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ''),
|
|
265
|
+
errors: validationErrors,
|
|
266
|
+
initialValue: validityData.initialValue
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
// Keep Form-level errors part of overall field validity for submit blocking/focus logic.
|
|
270
|
+
updateRegisteredFieldValidity(nextValidityData);
|
|
271
|
+
setValidityData(nextValidityData);
|
|
272
|
+
});
|
|
273
|
+
const change = useStableCallback(value => {
|
|
274
|
+
timeout.clear();
|
|
275
|
+
const validateOnChange = shouldValidateOnChange();
|
|
276
|
+
if (validateOnChange && value !== '' && validationDebounceTime) {
|
|
277
|
+
validationCommitIdRef.current += 1;
|
|
278
|
+
timeout.start(validationDebounceTime, () => {
|
|
279
|
+
commit(value);
|
|
280
|
+
});
|
|
281
|
+
} else {
|
|
282
|
+
commit(value, !validateOnChange);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
const getValidationProps = React.useCallback((disabled, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled ? {
|
|
286
|
+
'aria-invalid': true
|
|
287
|
+
} : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
|
|
288
|
+
return React.useMemo(() => ({
|
|
289
|
+
getValidationProps,
|
|
290
|
+
inputRef,
|
|
291
|
+
registeredInputs,
|
|
292
|
+
registerInput,
|
|
293
|
+
getInputControl,
|
|
294
|
+
commit,
|
|
295
|
+
change
|
|
296
|
+
}), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export { useFieldItemContext as a, getCombinedFieldValidityData as g, isEligibleInput as i, useFieldValidation as u };
|
package/dist/useScrollLock-es.js
CHANGED
|
@@ -5743,4 +5743,4 @@ function useScrollLock(enabled = true, referenceElement = null) {
|
|
|
5743
5743
|
}, [enabled, referenceElement]);
|
|
5744
5744
|
}
|
|
5745
5745
|
|
|
5746
|
-
export { getFloatingFocusElement as $, AnimationFrame as A, visuallyHiddenInput as B, visuallyHidden as C, activeElement as D, wheel as E, FOCUSABLE_POPUP_PROPS as F, createGenericEventDetails as G, useOnMount as H, getWindow as I, incrementPress as J, decrementPress as K, useValueChanged as L, inputClear as M, inputBlur as N, inputChange as O, keyboard as P, inputPaste as Q, useOpenInteractionType as R, SafeReact as S, Timeout as T, useStore as U, useClick as V, useDismiss as W, ReactStore as X, focusOut as Y, outsidePress as Z, pressableTriggerOpenStateMapping as _, isLastTraversableNode as a, isListIndexDisabled as a$, contains as a0, cancelOpen as a1, FloatingPortal as a2, InternalBackdrop as a3, inertValue as a4, DROPDOWN_COLLISION_AVOIDANCE as a5, popupStateMapping as a6, useDirection as a7, useAnimationFrame as a8, webkit as a9, getNodeScroll as aA, isTableElement as aB, isContainingBlock as aC, getContainingBlock as aD, getOverflowAncestors as aE, getFrameElement as aF, isWebKit as aG, floor as aH, useId as aI, useFloatingParentNodeId as aJ, FloatingRootStore as aK, PopupTriggerMap as aL, useFloatingTree as aM, isTypeableCombobox as aN, isIndexOutOfListBounds as aO, getMinListIndex as aP, getMaxListIndex as aQ, stopEvent as aR, listNavigation as aS, findNonDisabledListIndex as aT, enqueueFocus as aU, isVirtualPointerEvent as aV, ARROW_UP as aW, ARROW_DOWN as aX, ARROW_LEFT as aY, ARROW_RIGHT as aZ, isElementVisible as a_, rectToClientRect as aa, windowResize as ab, isVirtualClick as ac, itemPress as ad, evaluate as ae, getSide as af, getSideAxis as ag, getOppositePlacement as ah, getExpandedPlacements as ai, getOppositeAxisPlacements as aj, getAlignmentSides as ak, getAlignment as al, min as am, max as an, getAlignmentAxis as ao, getPaddingObject as ap, getOppositeAxis as aq, clamp as ar, getAxisLength as as, getDocumentElement as at, isElement as au, createCoords as av, round as aw, isTopLayer as ax, getNodeName as ay, isOverflowElement as az, getParentNode as b, scrub as b$, jsdom as b0, DISABLED_TRANSITIONS_STYLE as b1, useScrollLock as b2, shimExports as b3, usePopupInteractionProps as b4, setPopupOpenState as b5, usePopupRootStore as b6, usePopupRootSync as b7, useImplicitActiveTrigger as b8, useOpenStateTransitions as b9, POPUP_COLLISION_AVOIDANCE as bA, FloatingNode as bB, siblingOpen as bC, FloatingTreeStore as bD, fastComponent as bE, useFloatingNodeId as bF, attachPreventUnmountOnClose as bG, useSyncedFloatingRootContext as bH, TYPEAHEAD_RESET_MS as bI, FloatingTree as bJ, useCompositeRootContext as bK, getTabbableBeforeElement as bL, isOutsideEvent as bM, getTabbableAfterElement as bN, getNextTabbable as bO, fastComponentRef as bP, FocusGuard as bQ, PATIENT_CLICK_THRESHOLD as bR, useTriggerRegistration as bS, voiceOver as bT, getGridNavigatedIndex as bU, Store as bV, inputPress as bW, pointer as bX, gecko as bY, clearPress as bZ, chipRemovePress as b_, PopupHandleAttachment as ba, useTriggerDataForwarding as bb, useOpenMethodTriggerProps as bc, CLICK_TRIGGER_IDENTIFIER as bd, triggerOpenStateMapping as be, CommonPopupDataAttributes as bf, android as bg, closeWatcher as bh, TransitionStatusDataAttributes as bi, swipe as bj, BASE_UI_SWIPE_IGNORE_SELECTOR as bk, isMouseLikePointerType as bl, mergeCleanups as bm, isTypeableElement as bn, matchesFocusVisible as bo, isTargetInsideEnabledTrigger as bp, triggerFocus as bq, createAttribute as br, mac as bs, triggerPress as bt, escapeKey as bu, isInteractiveElement as bv, getNodeChildren as bw, triggerHover as bx, dispatchClickWithModifiers as by, useAnimationsFinished as bz, useIsoLayoutEffect as c, useStableCallback as d, getTarget as e,
|
|
5746
|
+
export { getFloatingFocusElement as $, AnimationFrame as A, visuallyHiddenInput as B, visuallyHidden as C, activeElement as D, wheel as E, FOCUSABLE_POPUP_PROPS as F, createGenericEventDetails as G, useOnMount as H, getWindow as I, incrementPress as J, decrementPress as K, useValueChanged as L, inputClear as M, inputBlur as N, inputChange as O, keyboard as P, inputPaste as Q, useOpenInteractionType as R, SafeReact as S, Timeout as T, useStore as U, useClick as V, useDismiss as W, ReactStore as X, focusOut as Y, outsidePress as Z, pressableTriggerOpenStateMapping as _, isLastTraversableNode as a, isListIndexDisabled as a$, contains as a0, cancelOpen as a1, FloatingPortal as a2, InternalBackdrop as a3, inertValue as a4, DROPDOWN_COLLISION_AVOIDANCE as a5, popupStateMapping as a6, useDirection as a7, useAnimationFrame as a8, webkit as a9, getNodeScroll as aA, isTableElement as aB, isContainingBlock as aC, getContainingBlock as aD, getOverflowAncestors as aE, getFrameElement as aF, isWebKit as aG, floor as aH, useId as aI, useFloatingParentNodeId as aJ, FloatingRootStore as aK, PopupTriggerMap as aL, useFloatingTree as aM, isTypeableCombobox as aN, isIndexOutOfListBounds as aO, getMinListIndex as aP, getMaxListIndex as aQ, stopEvent as aR, listNavigation as aS, findNonDisabledListIndex as aT, enqueueFocus as aU, isVirtualPointerEvent as aV, ARROW_UP as aW, ARROW_DOWN as aX, ARROW_LEFT as aY, ARROW_RIGHT as aZ, isElementVisible as a_, rectToClientRect as aa, windowResize as ab, isVirtualClick as ac, itemPress as ad, evaluate as ae, getSide as af, getSideAxis as ag, getOppositePlacement as ah, getExpandedPlacements as ai, getOppositeAxisPlacements as aj, getAlignmentSides as ak, getAlignment as al, min as am, max as an, getAlignmentAxis as ao, getPaddingObject as ap, getOppositeAxis as aq, clamp as ar, getAxisLength as as, getDocumentElement as at, isElement as au, createCoords as av, round as aw, isTopLayer as ax, getNodeName as ay, isOverflowElement as az, getParentNode as b, scrub as b$, jsdom as b0, DISABLED_TRANSITIONS_STYLE as b1, useScrollLock as b2, shimExports as b3, usePopupInteractionProps as b4, setPopupOpenState as b5, usePopupRootStore as b6, usePopupRootSync as b7, useImplicitActiveTrigger as b8, useOpenStateTransitions as b9, POPUP_COLLISION_AVOIDANCE as bA, FloatingNode as bB, siblingOpen as bC, FloatingTreeStore as bD, fastComponent as bE, useFloatingNodeId as bF, attachPreventUnmountOnClose as bG, useSyncedFloatingRootContext as bH, TYPEAHEAD_RESET_MS as bI, FloatingTree as bJ, useCompositeRootContext as bK, getTabbableBeforeElement as bL, isOutsideEvent as bM, getTabbableAfterElement as bN, getNextTabbable as bO, fastComponentRef as bP, FocusGuard as bQ, PATIENT_CLICK_THRESHOLD as bR, useTriggerRegistration as bS, voiceOver as bT, getGridNavigatedIndex as bU, Store as bV, inputPress as bW, pointer as bX, gecko as bY, clearPress as bZ, chipRemovePress as b_, PopupHandleAttachment as ba, useTriggerDataForwarding as bb, useOpenMethodTriggerProps as bc, CLICK_TRIGGER_IDENTIFIER as bd, triggerOpenStateMapping as be, CommonPopupDataAttributes as bf, android as bg, closeWatcher as bh, TransitionStatusDataAttributes as bi, swipe as bj, BASE_UI_SWIPE_IGNORE_SELECTOR as bk, isMouseLikePointerType as bl, mergeCleanups as bm, isTypeableElement as bn, matchesFocusVisible as bo, isTargetInsideEnabledTrigger as bp, triggerFocus as bq, createAttribute as br, mac as bs, triggerPress as bt, escapeKey as bu, isInteractiveElement as bv, getNodeChildren as bw, triggerHover as bx, dispatchClickWithModifiers as by, useAnimationsFinished as bz, useIsoLayoutEffect as c, useStableCallback as d, getTarget as e, useTimeout as f, getComputedStyle as g, useButton as h, isHTMLElement as i, createChangeEventDetails as j, closePress as k, error as l, useTransitionStatus as m, useOpenChangeComplete as n, ownerDocument as o, imperativeAction as p, popupTransitionStateMapping as q, createDefaultInitialFocus as r, FloatingFocusManager as s, transitionStatusMapping as t, useBaseUiId as u, useControlled as v, useValueAsRef as w, ios as x, addEventListener as y, none as z };
|