@seeqdev/qomponents 0.0.155-react-19-v8 → 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 +196 -131
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +184 -119
- 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,
|
|
@@ -13973,10 +14009,11 @@ var Dialog$1 = (props) => {
|
|
|
13973
14009
|
} = props;
|
|
13974
14010
|
const triggerRef = React__namespace.useRef(null);
|
|
13975
14011
|
const contentRef = React__namespace.useRef(null);
|
|
13976
|
-
const [open
|
|
14012
|
+
const [open, setOpen] = useControllableState({
|
|
13977
14013
|
prop: openProp,
|
|
13978
|
-
defaultProp: defaultOpen,
|
|
13979
|
-
onChange: onOpenChange
|
|
14014
|
+
defaultProp: defaultOpen ?? false,
|
|
14015
|
+
onChange: onOpenChange,
|
|
14016
|
+
caller: DIALOG_NAME
|
|
13980
14017
|
});
|
|
13981
14018
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13982
14019
|
DialogProvider,
|
|
@@ -14038,6 +14075,7 @@ var DialogOverlay = React__namespace.forwardRef(
|
|
|
14038
14075
|
}
|
|
14039
14076
|
);
|
|
14040
14077
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
14078
|
+
var Slot$1 = createSlot("DialogOverlay.RemoveScroll");
|
|
14041
14079
|
var DialogOverlayImpl = React__namespace.forwardRef(
|
|
14042
14080
|
(props, forwardedRef) => {
|
|
14043
14081
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -14045,7 +14083,7 @@ var DialogOverlayImpl = React__namespace.forwardRef(
|
|
|
14045
14083
|
return (
|
|
14046
14084
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
14047
14085
|
// ie. when `Overlay` and `Content` are siblings
|
|
14048
|
-
/* @__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(
|
|
14049
14087
|
Primitive.div,
|
|
14050
14088
|
{
|
|
14051
14089
|
"data-state": getState$2(context.open),
|
|
@@ -14432,17 +14470,19 @@ function createCollection(name) {
|
|
|
14432
14470
|
};
|
|
14433
14471
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
14434
14472
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
14473
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
14435
14474
|
const CollectionSlot = React.forwardRef(
|
|
14436
14475
|
(props, forwardedRef) => {
|
|
14437
14476
|
const { scope, children } = props;
|
|
14438
14477
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14439
14478
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
14440
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14479
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
14441
14480
|
}
|
|
14442
14481
|
);
|
|
14443
14482
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
14444
14483
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
14445
14484
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
14485
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
14446
14486
|
const CollectionItemSlot = React.forwardRef(
|
|
14447
14487
|
(props, forwardedRef) => {
|
|
14448
14488
|
const { scope, children, ...itemData } = props;
|
|
@@ -14453,7 +14493,7 @@ function createCollection(name) {
|
|
|
14453
14493
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
14454
14494
|
return () => void context.itemMap.delete(ref);
|
|
14455
14495
|
});
|
|
14456
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14496
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
14457
14497
|
}
|
|
14458
14498
|
);
|
|
14459
14499
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -14478,7 +14518,7 @@ function createCollection(name) {
|
|
|
14478
14518
|
];
|
|
14479
14519
|
}
|
|
14480
14520
|
|
|
14481
|
-
// packages/react/direction/src/
|
|
14521
|
+
// packages/react/direction/src/direction.tsx
|
|
14482
14522
|
var DirectionContext = React__namespace.createContext(void 0);
|
|
14483
14523
|
function useDirection(localDir) {
|
|
14484
14524
|
const globalDir = React__namespace.useContext(DirectionContext);
|
|
@@ -14516,10 +14556,11 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
14516
14556
|
const ref = React__namespace.useRef(null);
|
|
14517
14557
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14518
14558
|
const direction = useDirection(dir);
|
|
14519
|
-
const [currentTabStopId
|
|
14559
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
14520
14560
|
prop: currentTabStopIdProp,
|
|
14521
|
-
defaultProp: defaultCurrentTabStopId,
|
|
14522
|
-
onChange: onCurrentTabStopIdChange
|
|
14561
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
14562
|
+
onChange: onCurrentTabStopIdChange,
|
|
14563
|
+
caller: GROUP_NAME$2
|
|
14523
14564
|
});
|
|
14524
14565
|
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
14525
14566
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
@@ -14597,6 +14638,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14597
14638
|
focusable = true,
|
|
14598
14639
|
active = false,
|
|
14599
14640
|
tabStopId,
|
|
14641
|
+
children,
|
|
14600
14642
|
...itemProps
|
|
14601
14643
|
} = props;
|
|
14602
14644
|
const autoId = useId();
|
|
@@ -14604,7 +14646,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14604
14646
|
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
14605
14647
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
14606
14648
|
const getItems = useCollection$3(__scopeRovingFocusGroup);
|
|
14607
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
14649
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
14608
14650
|
React__namespace.useEffect(() => {
|
|
14609
14651
|
if (focusable) {
|
|
14610
14652
|
onFocusableItemAdd();
|
|
@@ -14650,7 +14692,8 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
14650
14692
|
}
|
|
14651
14693
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
14652
14694
|
}
|
|
14653
|
-
})
|
|
14695
|
+
}),
|
|
14696
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
14654
14697
|
}
|
|
14655
14698
|
)
|
|
14656
14699
|
}
|
|
@@ -14714,7 +14757,8 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
14714
14757
|
const [value, setValue] = useControllableState({
|
|
14715
14758
|
prop: valueProp,
|
|
14716
14759
|
onChange: onValueChange,
|
|
14717
|
-
defaultProp: defaultValue
|
|
14760
|
+
defaultProp: defaultValue ?? "",
|
|
14761
|
+
caller: TABS_NAME
|
|
14718
14762
|
});
|
|
14719
14763
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14720
14764
|
TabsProvider,
|
|
@@ -14897,10 +14941,11 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
14897
14941
|
onOpenChange,
|
|
14898
14942
|
...collapsibleProps
|
|
14899
14943
|
} = props;
|
|
14900
|
-
const [open
|
|
14944
|
+
const [open, setOpen] = useControllableState({
|
|
14901
14945
|
prop: openProp,
|
|
14902
|
-
defaultProp: defaultOpen,
|
|
14903
|
-
onChange: onOpenChange
|
|
14946
|
+
defaultProp: defaultOpen ?? false,
|
|
14947
|
+
onChange: onOpenChange,
|
|
14948
|
+
caller: COLLAPSIBLE_NAME
|
|
14904
14949
|
});
|
|
14905
14950
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
14906
14951
|
CollapsibleProvider,
|
|
@@ -15050,14 +15095,15 @@ var AccordionImplSingle = React.forwardRef(
|
|
|
15050
15095
|
} = props;
|
|
15051
15096
|
const [value, setValue] = useControllableState({
|
|
15052
15097
|
prop: valueProp,
|
|
15053
|
-
defaultProp: defaultValue,
|
|
15054
|
-
onChange: onValueChange
|
|
15098
|
+
defaultProp: defaultValue ?? "",
|
|
15099
|
+
onChange: onValueChange,
|
|
15100
|
+
caller: ACCORDION_NAME
|
|
15055
15101
|
});
|
|
15056
15102
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15057
15103
|
AccordionValueProvider,
|
|
15058
15104
|
{
|
|
15059
15105
|
scope: props.__scopeAccordion,
|
|
15060
|
-
value: value ? [value] : [],
|
|
15106
|
+
value: React.useMemo(() => value ? [value] : [], [value]),
|
|
15061
15107
|
onItemOpen: setValue,
|
|
15062
15108
|
onItemClose: React.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
15063
15109
|
children: /* @__PURE__ */ jsxRuntime.jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
@@ -15073,10 +15119,11 @@ var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
|
|
15073
15119
|
},
|
|
15074
15120
|
...accordionMultipleProps
|
|
15075
15121
|
} = props;
|
|
15076
|
-
const [value
|
|
15122
|
+
const [value, setValue] = useControllableState({
|
|
15077
15123
|
prop: valueProp,
|
|
15078
|
-
defaultProp: defaultValue,
|
|
15079
|
-
onChange: onValueChange
|
|
15124
|
+
defaultProp: defaultValue ?? [],
|
|
15125
|
+
onChange: onValueChange,
|
|
15126
|
+
caller: ACCORDION_NAME
|
|
15080
15127
|
});
|
|
15081
15128
|
const handleItemOpen = React.useCallback(
|
|
15082
15129
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
@@ -15506,6 +15553,7 @@ var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef)
|
|
|
15506
15553
|
}
|
|
15507
15554
|
);
|
|
15508
15555
|
});
|
|
15556
|
+
var Slot = createSlot("MenuContent.ScrollLock");
|
|
15509
15557
|
var MenuContentImpl = React__namespace.forwardRef(
|
|
15510
15558
|
(props, forwardedRef) => {
|
|
15511
15559
|
const {
|
|
@@ -16143,10 +16191,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
16143
16191
|
const { x, y } = point;
|
|
16144
16192
|
let inside = false;
|
|
16145
16193
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
16146
|
-
const
|
|
16147
|
-
const
|
|
16148
|
-
const
|
|
16149
|
-
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;
|
|
16150
16200
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
16151
16201
|
if (intersect) inside = !inside;
|
|
16152
16202
|
}
|
|
@@ -16196,10 +16246,11 @@ var DropdownMenu = (props) => {
|
|
|
16196
16246
|
} = props;
|
|
16197
16247
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16198
16248
|
const triggerRef = React__namespace.useRef(null);
|
|
16199
|
-
const [open
|
|
16249
|
+
const [open, setOpen] = useControllableState({
|
|
16200
16250
|
prop: openProp,
|
|
16201
|
-
defaultProp: defaultOpen,
|
|
16202
|
-
onChange: onOpenChange
|
|
16251
|
+
defaultProp: defaultOpen ?? false,
|
|
16252
|
+
onChange: onOpenChange,
|
|
16253
|
+
caller: DROPDOWN_MENU_NAME
|
|
16203
16254
|
});
|
|
16204
16255
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16205
16256
|
DropdownMenuProvider,
|
|
@@ -16376,10 +16427,11 @@ DropdownMenuArrow.displayName = ARROW_NAME;
|
|
|
16376
16427
|
var DropdownMenuSub = (props) => {
|
|
16377
16428
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
16378
16429
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16379
|
-
const [open
|
|
16430
|
+
const [open, setOpen] = useControllableState({
|
|
16380
16431
|
prop: openProp,
|
|
16381
|
-
defaultProp: defaultOpen,
|
|
16382
|
-
onChange: onOpenChange
|
|
16432
|
+
defaultProp: defaultOpen ?? false,
|
|
16433
|
+
onChange: onOpenChange,
|
|
16434
|
+
caller: "DropdownMenuSub"
|
|
16383
16435
|
});
|
|
16384
16436
|
return /* @__PURE__ */ jsxRuntime.jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
16385
16437
|
};
|
|
@@ -26802,7 +26854,7 @@ function clamp(value, [min, max]) {
|
|
|
26802
26854
|
return Math.min(max, Math.max(min, value));
|
|
26803
26855
|
}
|
|
26804
26856
|
|
|
26805
|
-
// packages/react/use-previous/src/
|
|
26857
|
+
// packages/react/use-previous/src/use-previous.tsx
|
|
26806
26858
|
function usePrevious(value) {
|
|
26807
26859
|
const ref = React__namespace.useRef({ value, previous: value });
|
|
26808
26860
|
return React__namespace.useMemo(() => {
|
|
@@ -27248,7 +27300,7 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27248
27300
|
}
|
|
27249
27301
|
) }),
|
|
27250
27302
|
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27251
|
-
|
|
27303
|
+
SliderBubbleInput,
|
|
27252
27304
|
{
|
|
27253
27305
|
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
27254
27306
|
form: context.form,
|
|
@@ -27262,23 +27314,36 @@ var SliderThumbImpl = React__namespace.forwardRef(
|
|
|
27262
27314
|
}
|
|
27263
27315
|
);
|
|
27264
27316
|
SliderThumb.displayName = THUMB_NAME;
|
|
27265
|
-
var
|
|
27266
|
-
|
|
27267
|
-
|
|
27268
|
-
|
|
27269
|
-
|
|
27270
|
-
const
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
const
|
|
27276
|
-
setValue.
|
|
27277
|
-
|
|
27278
|
-
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
}
|
|
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;
|
|
27282
27347
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
27283
27348
|
const nextValues = [...prevValues];
|
|
27284
27349
|
nextValues[atIndex] = nextValue;
|