@seeqdev/qomponents 0.0.155-react-19-v7 → 0.0.155-react-19-v9
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/index.esm.js +204 -132
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +192 -120
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -211,7 +211,7 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
// packages/react/compose-refs/src/
|
|
214
|
+
// packages/react/compose-refs/src/compose-refs.tsx
|
|
215
215
|
function setRef(ref, value) {
|
|
216
216
|
if (typeof ref === "function") {
|
|
217
217
|
return ref(value);
|
|
@@ -247,7 +247,7 @@ function useComposedRefs(...refs) {
|
|
|
247
247
|
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
// packages/react/context/src/
|
|
250
|
+
// packages/react/context/src/create-context.tsx
|
|
251
251
|
function createContext2(rootComponentName, defaultContext) {
|
|
252
252
|
const Context = React__namespace.createContext(defaultContext);
|
|
253
253
|
const Provider = (props) => {
|
|
@@ -322,44 +322,51 @@ function composeContextScopes(...scopes) {
|
|
|
322
322
|
return createScope;
|
|
323
323
|
}
|
|
324
324
|
|
|
325
|
-
//
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
325
|
+
// src/slot.tsx
|
|
326
|
+
// @__NO_SIDE_EFFECTS__
|
|
327
|
+
function createSlot(ownerName) {
|
|
328
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
329
|
+
const Slot2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
330
|
+
const { children, ...slotProps } = props;
|
|
331
|
+
const childrenArray = React__namespace.Children.toArray(children);
|
|
332
|
+
const slottable = childrenArray.find(isSlottable);
|
|
333
|
+
if (slottable) {
|
|
334
|
+
const newElement = slottable.props.children;
|
|
335
|
+
const newChildren = childrenArray.map((child) => {
|
|
336
|
+
if (child === slottable) {
|
|
337
|
+
if (React__namespace.Children.count(newElement) > 1) return React__namespace.Children.only(null);
|
|
338
|
+
return React__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
339
|
+
} else {
|
|
340
|
+
return child;
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React__namespace.isValidElement(newElement) ? React__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
346
|
+
});
|
|
347
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
348
|
+
return Slot2;
|
|
349
|
+
}
|
|
350
|
+
// @__NO_SIDE_EFFECTS__
|
|
351
|
+
function createSlotClone(ownerName) {
|
|
352
|
+
const SlotClone = React__namespace.forwardRef((props, forwardedRef) => {
|
|
353
|
+
const { children, ...slotProps } = props;
|
|
354
|
+
if (React__namespace.isValidElement(children)) {
|
|
355
|
+
const childrenRef = getElementRef$1(children);
|
|
356
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
357
|
+
if (children.type !== React__namespace.Fragment) {
|
|
358
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
338
359
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if (React__namespace.isValidElement(children)) {
|
|
348
|
-
const childrenRef = getElementRef$1(children);
|
|
349
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
350
|
-
if (children.type !== React__namespace.Fragment) {
|
|
351
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
352
|
-
}
|
|
353
|
-
return React__namespace.cloneElement(children, props2);
|
|
354
|
-
}
|
|
355
|
-
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
356
|
-
});
|
|
357
|
-
SlotClone.displayName = "SlotClone";
|
|
358
|
-
var Slottable = ({ children }) => {
|
|
359
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
360
|
-
};
|
|
360
|
+
return React__namespace.cloneElement(children, props2);
|
|
361
|
+
}
|
|
362
|
+
return React__namespace.Children.count(children) > 1 ? React__namespace.Children.only(null) : null;
|
|
363
|
+
});
|
|
364
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
365
|
+
return SlotClone;
|
|
366
|
+
}
|
|
367
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
361
368
|
function isSlottable(child) {
|
|
362
|
-
return React__namespace.isValidElement(child) && child.type ===
|
|
369
|
+
return React__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
363
370
|
}
|
|
364
371
|
function mergeProps(slotProps, childProps) {
|
|
365
372
|
const overrideProps = { ...childProps };
|
|
@@ -370,8 +377,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
370
377
|
if (isHandler) {
|
|
371
378
|
if (slotPropValue && childPropValue) {
|
|
372
379
|
overrideProps[propName] = (...args) => {
|
|
373
|
-
childPropValue(...args);
|
|
380
|
+
const result = childPropValue(...args);
|
|
374
381
|
slotPropValue(...args);
|
|
382
|
+
return result;
|
|
375
383
|
};
|
|
376
384
|
} else if (slotPropValue) {
|
|
377
385
|
overrideProps[propName] = slotPropValue;
|
|
@@ -398,7 +406,7 @@ function getElementRef$1(element) {
|
|
|
398
406
|
return element.props.ref || element.ref;
|
|
399
407
|
}
|
|
400
408
|
|
|
401
|
-
//
|
|
409
|
+
// src/primitive.tsx
|
|
402
410
|
var NODES = [
|
|
403
411
|
"a",
|
|
404
412
|
"button",
|
|
@@ -413,11 +421,13 @@ var NODES = [
|
|
|
413
421
|
"nav",
|
|
414
422
|
"ol",
|
|
415
423
|
"p",
|
|
424
|
+
"select",
|
|
416
425
|
"span",
|
|
417
426
|
"svg",
|
|
418
427
|
"ul"
|
|
419
428
|
];
|
|
420
429
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
430
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
421
431
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
422
432
|
const { asChild, ...primitiveProps } = props;
|
|
423
433
|
const Comp = asChild ? Slot : node;
|
|
@@ -433,7 +443,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
433
443
|
if (target) ReactDOM__namespace.flushSync(() => target.dispatchEvent(event));
|
|
434
444
|
}
|
|
435
445
|
|
|
436
|
-
// packages/react/use-callback-ref/src/
|
|
446
|
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
|
437
447
|
function useCallbackRef$1(callback) {
|
|
438
448
|
const callbackRef = React__namespace.useRef(callback);
|
|
439
449
|
React__namespace.useEffect(() => {
|
|
@@ -442,7 +452,7 @@ function useCallbackRef$1(callback) {
|
|
|
442
452
|
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
443
453
|
}
|
|
444
454
|
|
|
445
|
-
// packages/react/use-escape-keydown/src/
|
|
455
|
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
|
446
456
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
447
457
|
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
448
458
|
React__namespace.useEffect(() => {
|
|
@@ -884,12 +894,12 @@ function removeLinks(items) {
|
|
|
884
894
|
return items.filter((item) => item.tagName !== "A");
|
|
885
895
|
}
|
|
886
896
|
|
|
887
|
-
// packages/react/use-layout-effect/src/
|
|
888
|
-
var useLayoutEffect2 =
|
|
897
|
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
898
|
+
var useLayoutEffect2 = globalThis?.document ? React__namespace.useLayoutEffect : () => {
|
|
889
899
|
};
|
|
890
900
|
|
|
891
901
|
// packages/react/id/src/id.tsx
|
|
892
|
-
var useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
902
|
+
var useReactId = React__namespace[" useId ".trim().toString()] || (() => void 0);
|
|
893
903
|
var count = 0;
|
|
894
904
|
function useId(deterministicId) {
|
|
895
905
|
const [id, setId] = React__namespace.useState(useReactId());
|
|
@@ -2877,7 +2887,7 @@ const arrow = (options, deps) => ({
|
|
|
2877
2887
|
options: [options, deps]
|
|
2878
2888
|
});
|
|
2879
2889
|
|
|
2880
|
-
//
|
|
2890
|
+
// src/arrow.tsx
|
|
2881
2891
|
var NAME = "Arrow";
|
|
2882
2892
|
var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
2883
2893
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
@@ -2897,7 +2907,7 @@ var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
2897
2907
|
Arrow$1.displayName = NAME;
|
|
2898
2908
|
var Root$5 = Arrow$1;
|
|
2899
2909
|
|
|
2900
|
-
// packages/react/use-size/src/
|
|
2910
|
+
// packages/react/use-size/src/use-size.tsx
|
|
2901
2911
|
function useSize(element) {
|
|
2902
2912
|
const [size, setSize] = React__namespace.useState(void 0);
|
|
2903
2913
|
useLayoutEffect2(() => {
|
|
@@ -3215,7 +3225,7 @@ function useStateMachine(initialState, machine) {
|
|
|
3215
3225
|
}, initialState);
|
|
3216
3226
|
}
|
|
3217
3227
|
|
|
3218
|
-
//
|
|
3228
|
+
// src/presence.tsx
|
|
3219
3229
|
var Presence = (props) => {
|
|
3220
3230
|
const { present, children } = props;
|
|
3221
3231
|
const presence = usePresence$1(present);
|
|
@@ -3227,7 +3237,7 @@ var Presence = (props) => {
|
|
|
3227
3237
|
Presence.displayName = "Presence";
|
|
3228
3238
|
function usePresence$1(present) {
|
|
3229
3239
|
const [node, setNode] = React__namespace.useState();
|
|
3230
|
-
const stylesRef = React__namespace.useRef(
|
|
3240
|
+
const stylesRef = React__namespace.useRef(null);
|
|
3231
3241
|
const prevPresentRef = React__namespace.useRef(present);
|
|
3232
3242
|
const prevAnimationNameRef = React__namespace.useRef("none");
|
|
3233
3243
|
const initialState = present ? "mounted" : "unmounted";
|
|
@@ -3311,7 +3321,7 @@ function usePresence$1(present) {
|
|
|
3311
3321
|
return {
|
|
3312
3322
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3313
3323
|
ref: React__namespace.useCallback((node2) => {
|
|
3314
|
-
|
|
3324
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3315
3325
|
setNode(node2);
|
|
3316
3326
|
}, [])
|
|
3317
3327
|
};
|
|
@@ -3333,28 +3343,47 @@ function getElementRef(element) {
|
|
|
3333
3343
|
return element.props.ref || element.ref;
|
|
3334
3344
|
}
|
|
3335
3345
|
|
|
3336
|
-
//
|
|
3346
|
+
// src/use-controllable-state.tsx
|
|
3347
|
+
var useInsertionEffect$1 = React__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3337
3348
|
function useControllableState({
|
|
3338
3349
|
prop,
|
|
3339
3350
|
defaultProp,
|
|
3340
3351
|
onChange = () => {
|
|
3341
|
-
}
|
|
3352
|
+
},
|
|
3353
|
+
caller
|
|
3342
3354
|
}) {
|
|
3343
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
3355
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
3356
|
+
defaultProp,
|
|
3357
|
+
onChange
|
|
3358
|
+
});
|
|
3344
3359
|
const isControlled = prop !== void 0;
|
|
3345
3360
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3346
|
-
|
|
3361
|
+
{
|
|
3362
|
+
const isControlledRef = React__namespace.useRef(prop !== void 0);
|
|
3363
|
+
React__namespace.useEffect(() => {
|
|
3364
|
+
const wasControlled = isControlledRef.current;
|
|
3365
|
+
if (wasControlled !== isControlled) {
|
|
3366
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
3367
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
3368
|
+
console.warn(
|
|
3369
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
3370
|
+
);
|
|
3371
|
+
}
|
|
3372
|
+
isControlledRef.current = isControlled;
|
|
3373
|
+
}, [isControlled, caller]);
|
|
3374
|
+
}
|
|
3347
3375
|
const setValue = React__namespace.useCallback(
|
|
3348
3376
|
(nextValue) => {
|
|
3349
3377
|
if (isControlled) {
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3352
|
-
|
|
3378
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
3379
|
+
if (value2 !== prop) {
|
|
3380
|
+
onChangeRef.current?.(value2);
|
|
3381
|
+
}
|
|
3353
3382
|
} else {
|
|
3354
3383
|
setUncontrolledProp(nextValue);
|
|
3355
3384
|
}
|
|
3356
3385
|
},
|
|
3357
|
-
[isControlled, prop, setUncontrolledProp,
|
|
3386
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
3358
3387
|
);
|
|
3359
3388
|
return [value, setValue];
|
|
3360
3389
|
}
|
|
@@ -3362,17 +3391,22 @@ function useUncontrolledState({
|
|
|
3362
3391
|
defaultProp,
|
|
3363
3392
|
onChange
|
|
3364
3393
|
}) {
|
|
3365
|
-
const
|
|
3366
|
-
const [value] = uncontrolledState;
|
|
3394
|
+
const [value, setValue] = React__namespace.useState(defaultProp);
|
|
3367
3395
|
const prevValueRef = React__namespace.useRef(value);
|
|
3368
|
-
const
|
|
3396
|
+
const onChangeRef = React__namespace.useRef(onChange);
|
|
3397
|
+
useInsertionEffect$1(() => {
|
|
3398
|
+
onChangeRef.current = onChange;
|
|
3399
|
+
}, [onChange]);
|
|
3369
3400
|
React__namespace.useEffect(() => {
|
|
3370
3401
|
if (prevValueRef.current !== value) {
|
|
3371
|
-
|
|
3402
|
+
onChangeRef.current?.(value);
|
|
3372
3403
|
prevValueRef.current = value;
|
|
3373
3404
|
}
|
|
3374
|
-
}, [value, prevValueRef
|
|
3375
|
-
return
|
|
3405
|
+
}, [value, prevValueRef]);
|
|
3406
|
+
return [value, setValue, onChangeRef];
|
|
3407
|
+
}
|
|
3408
|
+
function isFunction(value) {
|
|
3409
|
+
return typeof value === "function";
|
|
3376
3410
|
}
|
|
3377
3411
|
|
|
3378
3412
|
var getDefaultParent = function (originalTarget) {
|
|
@@ -4276,10 +4310,11 @@ var Popover = (props) => {
|
|
|
4276
4310
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4277
4311
|
const triggerRef = React__namespace.useRef(null);
|
|
4278
4312
|
const [hasCustomAnchor, setHasCustomAnchor] = React__namespace.useState(false);
|
|
4279
|
-
const [open
|
|
4313
|
+
const [open, setOpen] = useControllableState({
|
|
4280
4314
|
prop: openProp,
|
|
4281
|
-
defaultProp: defaultOpen,
|
|
4282
|
-
onChange: onOpenChange
|
|
4315
|
+
defaultProp: defaultOpen ?? false,
|
|
4316
|
+
onChange: onOpenChange,
|
|
4317
|
+
caller: POPOVER_NAME
|
|
4283
4318
|
});
|
|
4284
4319
|
return /* @__PURE__ */ jsxRuntime.jsx(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4285
4320
|
PopoverProvider,
|
|
@@ -4358,6 +4393,7 @@ var PopoverContent$1 = React__namespace.forwardRef(
|
|
|
4358
4393
|
}
|
|
4359
4394
|
);
|
|
4360
4395
|
PopoverContent$1.displayName = CONTENT_NAME$6;
|
|
4396
|
+
var Slot$2 = createSlot("PopoverContent.RemoveScroll");
|
|
4361
4397
|
var PopoverContentModal = React__namespace.forwardRef(
|
|
4362
4398
|
(props, forwardedRef) => {
|
|
4363
4399
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
@@ -4368,7 +4404,7 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
4368
4404
|
const content = contentRef.current;
|
|
4369
4405
|
if (content) return hideOthers(content);
|
|
4370
4406
|
}, []);
|
|
4371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4407
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4372
4408
|
PopoverContentImpl,
|
|
4373
4409
|
{
|
|
4374
4410
|
...props,
|
|
@@ -4666,6 +4702,13 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4666
4702
|
ref.current = receivedRef;
|
|
4667
4703
|
internalRef.current = receivedRef;
|
|
4668
4704
|
};
|
|
4705
|
+
React.useEffect(() => {
|
|
4706
|
+
if (autoFocus) {
|
|
4707
|
+
setTimeout(() => {
|
|
4708
|
+
internalRef.current?.focus();
|
|
4709
|
+
}, 0);
|
|
4710
|
+
}
|
|
4711
|
+
}, []);
|
|
4669
4712
|
React.useEffect(() => {
|
|
4670
4713
|
const input = internalRef.current;
|
|
4671
4714
|
if (input && type !== 'number' && type !== 'email')
|
|
@@ -4705,7 +4748,7 @@ const TextField = React.forwardRef((props, ref) => {
|
|
|
4705
4748
|
if (minLength)
|
|
4706
4749
|
inputLenghtProp.minLength = minLength;
|
|
4707
4750
|
return (React.createElement(React.Fragment, null,
|
|
4708
|
-
React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required,
|
|
4751
|
+
React.createElement("input", { ref: setAllRefs, "data-testid": testId, name: name, id: id, type: type, value: value, className: appliedClasses, placeholder: placeholder, disabled: disabled, readOnly: readonly, autoComplete: autoComplete, onChange: handleChange, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onKeyUp: onKeyUp, step: step, required: required, min: min, max: max, ...inputLenghtProp, ...inputProp, ...tooltipData }),
|
|
4709
4752
|
errorText && showError && React.createElement("div", { className: "tw-text-sq-danger-color tw-text-xs tw-mt-1" }, errorText)));
|
|
4710
4753
|
});
|
|
4711
4754
|
|
|
@@ -13966,10 +14009,11 @@ var Dialog$1 = (props) => {
|
|
|
13966
14009
|
} = props;
|
|
13967
14010
|
const triggerRef = React__namespace.useRef(null);
|
|
13968
14011
|
const contentRef = React__namespace.useRef(null);
|
|
13969
|
-
const [open
|
|
14012
|
+
const [open, setOpen] = useControllableState({
|
|
13970
14013
|
prop: openProp,
|
|
13971
|
-
defaultProp: defaultOpen,
|
|
13972
|
-
onChange: onOpenChange
|
|
14014
|
+
defaultProp: defaultOpen ?? false,
|
|
14015
|
+
onChange: onOpenChange,
|
|
14016
|
+
caller: DIALOG_NAME
|
|
13973
14017
|
});
|
|
13974
14018
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13975
14019
|
DialogProvider,
|
|
@@ -14031,6 +14075,7 @@ var DialogOverlay = React__namespace.forwardRef(
|
|
|
14031
14075
|
}
|
|
14032
14076
|
);
|
|
14033
14077
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
14078
|
+
var Slot$1 = createSlot("DialogOverlay.RemoveScroll");
|
|
14034
14079
|
var DialogOverlayImpl = React__namespace.forwardRef(
|
|
14035
14080
|
(props, forwardedRef) => {
|
|
14036
14081
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -14038,7 +14083,7 @@ var DialogOverlayImpl = React__namespace.forwardRef(
|
|
|
14038
14083
|
return (
|
|
14039
14084
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
14040
14085
|
// ie. when `Overlay` and `Content` are siblings
|
|
14041
|
-
/* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14086
|
+
/* @__PURE__ */ jsxRuntime.jsx(RemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
14042
14087
|
Primitive.div,
|
|
14043
14088
|
{
|
|
14044
14089
|
"data-state": getState$2(context.open),
|
|
@@ -14425,17 +14470,19 @@ function createCollection(name) {
|
|
|
14425
14470
|
};
|
|
14426
14471
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
14427
14472
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
14473
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
14428
14474
|
const CollectionSlot = React.forwardRef(
|
|
14429
14475
|
(props, forwardedRef) => {
|
|
14430
14476
|
const { scope, children } = props;
|
|
14431
14477
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14432
14478
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
14433
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14479
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
14434
14480
|
}
|
|
14435
14481
|
);
|
|
14436
14482
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
14437
14483
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
14438
14484
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
14485
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
14439
14486
|
const CollectionItemSlot = React.forwardRef(
|
|
14440
14487
|
(props, forwardedRef) => {
|
|
14441
14488
|
const { scope, children, ...itemData } = props;
|
|
@@ -14446,7 +14493,7 @@ function createCollection(name) {
|
|
|
14446
14493
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
14447
14494
|
return () => void context.itemMap.delete(ref);
|
|
14448
14495
|
});
|
|
14449
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14496
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
14450
14497
|
}
|
|
14451
14498
|
);
|
|
14452
14499
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -14471,7 +14518,7 @@ function createCollection(name) {
|
|
|
14471
14518
|
];
|
|
14472
14519
|
}
|
|
14473
14520
|
|
|
14474
|
-
// packages/react/direction/src/
|
|
14521
|
+
// packages/react/direction/src/direction.tsx
|
|
14475
14522
|
var DirectionContext = React__namespace.createContext(void 0);
|
|
14476
14523
|
function useDirection(localDir) {
|
|
14477
14524
|
const globalDir = React__namespace.useContext(DirectionContext);
|
|
@@ -14509,10 +14556,11 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
14509
14556
|
const ref = React__namespace.useRef(null);
|
|
14510
14557
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14511
14558
|
const direction = useDirection(dir);
|
|
14512
|
-
const [currentTabStopId
|
|
14559
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
14513
14560
|
prop: currentTabStopIdProp,
|
|
14514
|
-
defaultProp: defaultCurrentTabStopId,
|
|
14515
|
-
onChange: onCurrentTabStopIdChange
|
|
14561
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
14562
|
+
onChange: onCurrentTabStopIdChange,
|
|
14563
|
+
caller: GROUP_NAME$2
|
|
14516
14564
|
});
|
|
14517
14565
|
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
14518
14566
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
@@ -14590,6 +14638,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14590
14638
|
focusable = true,
|
|
14591
14639
|
active = false,
|
|
14592
14640
|
tabStopId,
|
|
14641
|
+
children,
|
|
14593
14642
|
...itemProps
|
|
14594
14643
|
} = props;
|
|
14595
14644
|
const autoId = useId();
|
|
@@ -14597,7 +14646,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14597
14646
|
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
14598
14647
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
14599
14648
|
const getItems = useCollection$3(__scopeRovingFocusGroup);
|
|
14600
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
14649
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
14601
14650
|
React__namespace.useEffect(() => {
|
|
14602
14651
|
if (focusable) {
|
|
14603
14652
|
onFocusableItemAdd();
|
|
@@ -14643,7 +14692,8 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14643
14692
|
}
|
|
14644
14693
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
14645
14694
|
}
|
|
14646
|
-
})
|
|
14695
|
+
}),
|
|
14696
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
14647
14697
|
}
|
|
14648
14698
|
)
|
|
14649
14699
|
}
|
|
@@ -14707,7 +14757,8 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
14707
14757
|
const [value, setValue] = useControllableState({
|
|
14708
14758
|
prop: valueProp,
|
|
14709
14759
|
onChange: onValueChange,
|
|
14710
|
-
defaultProp: defaultValue
|
|
14760
|
+
defaultProp: defaultValue ?? "",
|
|
14761
|
+
caller: TABS_NAME
|
|
14711
14762
|
});
|
|
14712
14763
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14713
14764
|
TabsProvider,
|
|
@@ -14890,10 +14941,11 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
14890
14941
|
onOpenChange,
|
|
14891
14942
|
...collapsibleProps
|
|
14892
14943
|
} = props;
|
|
14893
|
-
const [open
|
|
14944
|
+
const [open, setOpen] = useControllableState({
|
|
14894
14945
|
prop: openProp,
|
|
14895
|
-
defaultProp: defaultOpen,
|
|
14896
|
-
onChange: onOpenChange
|
|
14946
|
+
defaultProp: defaultOpen ?? false,
|
|
14947
|
+
onChange: onOpenChange,
|
|
14948
|
+
caller: COLLAPSIBLE_NAME
|
|
14897
14949
|
});
|
|
14898
14950
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14899
14951
|
CollapsibleProvider,
|
|
@@ -15043,14 +15095,15 @@ var AccordionImplSingle = React.forwardRef(
|
|
|
15043
15095
|
} = props;
|
|
15044
15096
|
const [value, setValue] = useControllableState({
|
|
15045
15097
|
prop: valueProp,
|
|
15046
|
-
defaultProp: defaultValue,
|
|
15047
|
-
onChange: onValueChange
|
|
15098
|
+
defaultProp: defaultValue ?? "",
|
|
15099
|
+
onChange: onValueChange,
|
|
15100
|
+
caller: ACCORDION_NAME
|
|
15048
15101
|
});
|
|
15049
15102
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15050
15103
|
AccordionValueProvider,
|
|
15051
15104
|
{
|
|
15052
15105
|
scope: props.__scopeAccordion,
|
|
15053
|
-
value: value ? [value] : [],
|
|
15106
|
+
value: React.useMemo(() => value ? [value] : [], [value]),
|
|
15054
15107
|
onItemOpen: setValue,
|
|
15055
15108
|
onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
15056
15109
|
children: /* @__PURE__ */ jsxRuntime.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
@@ -15066,10 +15119,11 @@ var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
|
|
15066
15119
|
},
|
|
15067
15120
|
...accordionMultipleProps
|
|
15068
15121
|
} = props;
|
|
15069
|
-
const [value
|
|
15122
|
+
const [value, setValue] = useControllableState({
|
|
15070
15123
|
prop: valueProp,
|
|
15071
|
-
defaultProp: defaultValue,
|
|
15072
|
-
onChange: onValueChange
|
|
15124
|
+
defaultProp: defaultValue ?? [],
|
|
15125
|
+
onChange: onValueChange,
|
|
15126
|
+
caller: ACCORDION_NAME
|
|
15073
15127
|
});
|
|
15074
15128
|
const handleItemOpen = React.useCallback(
|
|
15075
15129
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
@@ -15499,6 +15553,7 @@ var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef)
|
|
|
15499
15553
|
}
|
|
15500
15554
|
);
|
|
15501
15555
|
});
|
|
15556
|
+
var Slot = createSlot("MenuContent.ScrollLock");
|
|
15502
15557
|
var MenuContentImpl = React__namespace.forwardRef(
|
|
15503
15558
|
(props, forwardedRef) => {
|
|
15504
15559
|
const {
|
|
@@ -16136,10 +16191,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
16136
16191
|
const { x, y } = point;
|
|
16137
16192
|
let inside = false;
|
|
16138
16193
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
16139
|
-
const
|
|
16140
|
-
const
|
|
16141
|
-
const
|
|
16142
|
-
const
|
|
16194
|
+
const ii = polygon[i];
|
|
16195
|
+
const jj = polygon[j];
|
|
16196
|
+
const xi = ii.x;
|
|
16197
|
+
const yi = ii.y;
|
|
16198
|
+
const xj = jj.x;
|
|
16199
|
+
const yj = jj.y;
|
|
16143
16200
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
16144
16201
|
if (intersect) inside = !inside;
|
|
16145
16202
|
}
|
|
@@ -16189,10 +16246,11 @@ var DropdownMenu = (props) => {
|
|
|
16189
16246
|
} = props;
|
|
16190
16247
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16191
16248
|
const triggerRef = React__namespace.useRef(null);
|
|
16192
|
-
const [open
|
|
16249
|
+
const [open, setOpen] = useControllableState({
|
|
16193
16250
|
prop: openProp,
|
|
16194
|
-
defaultProp: defaultOpen,
|
|
16195
|
-
onChange: onOpenChange
|
|
16251
|
+
defaultProp: defaultOpen ?? false,
|
|
16252
|
+
onChange: onOpenChange,
|
|
16253
|
+
caller: DROPDOWN_MENU_NAME
|
|
16196
16254
|
});
|
|
16197
16255
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16198
16256
|
DropdownMenuProvider,
|
|
@@ -16369,10 +16427,11 @@ DropdownMenuArrow.displayName = ARROW_NAME;
|
|
|
16369
16427
|
var DropdownMenuSub = (props) => {
|
|
16370
16428
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
16371
16429
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16372
|
-
const [open
|
|
16430
|
+
const [open, setOpen] = useControllableState({
|
|
16373
16431
|
prop: openProp,
|
|
16374
|
-
defaultProp: defaultOpen,
|
|
16375
|
-
onChange: onOpenChange
|
|
16432
|
+
defaultProp: defaultOpen ?? false,
|
|
16433
|
+
onChange: onOpenChange,
|
|
16434
|
+
caller: "DropdownMenuSub"
|
|
16376
16435
|
});
|
|
16377
16436
|
return /* @__PURE__ */ jsxRuntime.jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
16378
16437
|
};
|
|
@@ -26795,7 +26854,7 @@ function clamp(value, [min, max]) {
|
|
|
26795
26854
|
return Math.min(max, Math.max(min, value));
|
|
26796
26855
|
}
|
|
26797
26856
|
|
|
26798
|
-
// packages/react/use-previous/src/
|
|
26857
|
+
// packages/react/use-previous/src/use-previous.tsx
|
|
26799
26858
|
function usePrevious(value) {
|
|
26800
26859
|
const ref = React__namespace.useRef({ value, previous: value });
|
|
26801
26860
|
return React__namespace.useMemo(() => {
|
|
@@ -27241,7 +27300,7 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27241
27300
|
}
|
|
27242
27301
|
) }),
|
|
27243
27302
|
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27244
|
-
|
|
27303
|
+
SliderBubbleInput,
|
|
27245
27304
|
{
|
|
27246
27305
|
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
27247
27306
|
form: context.form,
|
|
@@ -27255,23 +27314,36 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27255
27314
|
}
|
|
27256
27315
|
);
|
|
27257
27316
|
SliderThumb.displayName = THUMB_NAME;
|
|
27258
|
-
var
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
|
|
27262
|
-
|
|
27263
|
-
const
|
|
27264
|
-
|
|
27265
|
-
|
|
27266
|
-
|
|
27267
|
-
|
|
27268
|
-
const
|
|
27269
|
-
setValue.
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
}
|
|
27317
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
27318
|
+
var SliderBubbleInput = React__namespace.forwardRef(
|
|
27319
|
+
({ __scopeSlider, value, ...props }, forwardedRef) => {
|
|
27320
|
+
const ref = React__namespace.useRef(null);
|
|
27321
|
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
27322
|
+
const prevValue = usePrevious(value);
|
|
27323
|
+
React__namespace.useEffect(() => {
|
|
27324
|
+
const input = ref.current;
|
|
27325
|
+
if (!input) return;
|
|
27326
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
27327
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
|
|
27328
|
+
const setValue = descriptor.set;
|
|
27329
|
+
if (prevValue !== value && setValue) {
|
|
27330
|
+
const event = new Event("input", { bubbles: true });
|
|
27331
|
+
setValue.call(input, value);
|
|
27332
|
+
input.dispatchEvent(event);
|
|
27333
|
+
}
|
|
27334
|
+
}, [prevValue, value]);
|
|
27335
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27336
|
+
Primitive.input,
|
|
27337
|
+
{
|
|
27338
|
+
style: { display: "none" },
|
|
27339
|
+
...props,
|
|
27340
|
+
ref: composedRefs,
|
|
27341
|
+
defaultValue: value
|
|
27342
|
+
}
|
|
27343
|
+
);
|
|
27344
|
+
}
|
|
27345
|
+
);
|
|
27346
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
27275
27347
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
27276
27348
|
const nextValues = [...prevValues];
|
|
27277
27349
|
nextValues[atIndex] = nextValue;
|