@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.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default, { useLayoutEffect, useState, useRef, useEffect, useCallback, forwardRef, useContext, useMemo, createContext, Component, Fragment
|
|
3
|
-
import { jsx as jsx$1,
|
|
2
|
+
import React__default, { useLayoutEffect, useState, useRef, useEffect, useCallback, forwardRef, useContext, useMemo, createContext, Component, Fragment, useId as useId$1, useInsertionEffect as useInsertionEffect$2, Children, isValidElement, createElement } from 'react';
|
|
3
|
+
import { jsx as jsx$1, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
4
4
|
import * as ReactDOM from 'react-dom';
|
|
5
5
|
import ReactDOM__default, { createPortal } from 'react-dom';
|
|
6
6
|
|
|
@@ -191,7 +191,7 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
|
|
194
|
-
// packages/react/compose-refs/src/
|
|
194
|
+
// packages/react/compose-refs/src/compose-refs.tsx
|
|
195
195
|
function setRef(ref, value) {
|
|
196
196
|
if (typeof ref === "function") {
|
|
197
197
|
return ref(value);
|
|
@@ -227,7 +227,7 @@ function useComposedRefs(...refs) {
|
|
|
227
227
|
return React.useCallback(composeRefs(...refs), refs);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
// packages/react/context/src/
|
|
230
|
+
// packages/react/context/src/create-context.tsx
|
|
231
231
|
function createContext2(rootComponentName, defaultContext) {
|
|
232
232
|
const Context = React.createContext(defaultContext);
|
|
233
233
|
const Provider = (props) => {
|
|
@@ -302,44 +302,51 @@ function composeContextScopes(...scopes) {
|
|
|
302
302
|
return createScope;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
305
|
+
// src/slot.tsx
|
|
306
|
+
// @__NO_SIDE_EFFECTS__
|
|
307
|
+
function createSlot(ownerName) {
|
|
308
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
309
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
310
|
+
const { children, ...slotProps } = props;
|
|
311
|
+
const childrenArray = React.Children.toArray(children);
|
|
312
|
+
const slottable = childrenArray.find(isSlottable);
|
|
313
|
+
if (slottable) {
|
|
314
|
+
const newElement = slottable.props.children;
|
|
315
|
+
const newChildren = childrenArray.map((child) => {
|
|
316
|
+
if (child === slottable) {
|
|
317
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
318
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
319
|
+
} else {
|
|
320
|
+
return child;
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
324
|
+
}
|
|
325
|
+
return /* @__PURE__ */ jsx$1(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
326
|
+
});
|
|
327
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
328
|
+
return Slot2;
|
|
329
|
+
}
|
|
330
|
+
// @__NO_SIDE_EFFECTS__
|
|
331
|
+
function createSlotClone(ownerName) {
|
|
332
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
333
|
+
const { children, ...slotProps } = props;
|
|
334
|
+
if (React.isValidElement(children)) {
|
|
335
|
+
const childrenRef = getElementRef$1(children);
|
|
336
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
337
|
+
if (children.type !== React.Fragment) {
|
|
338
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
318
339
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
if (React.isValidElement(children)) {
|
|
328
|
-
const childrenRef = getElementRef$1(children);
|
|
329
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
330
|
-
if (children.type !== React.Fragment) {
|
|
331
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
332
|
-
}
|
|
333
|
-
return React.cloneElement(children, props2);
|
|
334
|
-
}
|
|
335
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
336
|
-
});
|
|
337
|
-
SlotClone.displayName = "SlotClone";
|
|
338
|
-
var Slottable = ({ children }) => {
|
|
339
|
-
return /* @__PURE__ */ jsx$1(Fragment, { children });
|
|
340
|
-
};
|
|
340
|
+
return React.cloneElement(children, props2);
|
|
341
|
+
}
|
|
342
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
343
|
+
});
|
|
344
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
345
|
+
return SlotClone;
|
|
346
|
+
}
|
|
347
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
341
348
|
function isSlottable(child) {
|
|
342
|
-
return React.isValidElement(child) && child.type ===
|
|
349
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
343
350
|
}
|
|
344
351
|
function mergeProps(slotProps, childProps) {
|
|
345
352
|
const overrideProps = { ...childProps };
|
|
@@ -350,8 +357,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
350
357
|
if (isHandler) {
|
|
351
358
|
if (slotPropValue && childPropValue) {
|
|
352
359
|
overrideProps[propName] = (...args) => {
|
|
353
|
-
childPropValue(...args);
|
|
360
|
+
const result = childPropValue(...args);
|
|
354
361
|
slotPropValue(...args);
|
|
362
|
+
return result;
|
|
355
363
|
};
|
|
356
364
|
} else if (slotPropValue) {
|
|
357
365
|
overrideProps[propName] = slotPropValue;
|
|
@@ -378,7 +386,7 @@ function getElementRef$1(element) {
|
|
|
378
386
|
return element.props.ref || element.ref;
|
|
379
387
|
}
|
|
380
388
|
|
|
381
|
-
//
|
|
389
|
+
// src/primitive.tsx
|
|
382
390
|
var NODES = [
|
|
383
391
|
"a",
|
|
384
392
|
"button",
|
|
@@ -393,11 +401,13 @@ var NODES = [
|
|
|
393
401
|
"nav",
|
|
394
402
|
"ol",
|
|
395
403
|
"p",
|
|
404
|
+
"select",
|
|
396
405
|
"span",
|
|
397
406
|
"svg",
|
|
398
407
|
"ul"
|
|
399
408
|
];
|
|
400
409
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
410
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
401
411
|
const Node = React.forwardRef((props, forwardedRef) => {
|
|
402
412
|
const { asChild, ...primitiveProps } = props;
|
|
403
413
|
const Comp = asChild ? Slot : node;
|
|
@@ -413,7 +423,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
413
423
|
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
414
424
|
}
|
|
415
425
|
|
|
416
|
-
// packages/react/use-callback-ref/src/
|
|
426
|
+
// packages/react/use-callback-ref/src/use-callback-ref.tsx
|
|
417
427
|
function useCallbackRef$1(callback) {
|
|
418
428
|
const callbackRef = React.useRef(callback);
|
|
419
429
|
React.useEffect(() => {
|
|
@@ -422,7 +432,7 @@ function useCallbackRef$1(callback) {
|
|
|
422
432
|
return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
423
433
|
}
|
|
424
434
|
|
|
425
|
-
// packages/react/use-escape-keydown/src/
|
|
435
|
+
// packages/react/use-escape-keydown/src/use-escape-keydown.tsx
|
|
426
436
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
427
437
|
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
428
438
|
React.useEffect(() => {
|
|
@@ -864,12 +874,12 @@ function removeLinks(items) {
|
|
|
864
874
|
return items.filter((item) => item.tagName !== "A");
|
|
865
875
|
}
|
|
866
876
|
|
|
867
|
-
// packages/react/use-layout-effect/src/
|
|
868
|
-
var useLayoutEffect2 =
|
|
877
|
+
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
878
|
+
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
|
869
879
|
};
|
|
870
880
|
|
|
871
881
|
// packages/react/id/src/id.tsx
|
|
872
|
-
var useReactId = React["useId".toString()] || (() => void 0);
|
|
882
|
+
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
873
883
|
var count = 0;
|
|
874
884
|
function useId(deterministicId) {
|
|
875
885
|
const [id, setId] = React.useState(useReactId());
|
|
@@ -2857,7 +2867,7 @@ const arrow = (options, deps) => ({
|
|
|
2857
2867
|
options: [options, deps]
|
|
2858
2868
|
});
|
|
2859
2869
|
|
|
2860
|
-
//
|
|
2870
|
+
// src/arrow.tsx
|
|
2861
2871
|
var NAME = "Arrow";
|
|
2862
2872
|
var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
2863
2873
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
@@ -2877,7 +2887,7 @@ var Arrow$1 = React.forwardRef((props, forwardedRef) => {
|
|
|
2877
2887
|
Arrow$1.displayName = NAME;
|
|
2878
2888
|
var Root$5 = Arrow$1;
|
|
2879
2889
|
|
|
2880
|
-
// packages/react/use-size/src/
|
|
2890
|
+
// packages/react/use-size/src/use-size.tsx
|
|
2881
2891
|
function useSize(element) {
|
|
2882
2892
|
const [size, setSize] = React.useState(void 0);
|
|
2883
2893
|
useLayoutEffect2(() => {
|
|
@@ -3195,7 +3205,7 @@ function useStateMachine(initialState, machine) {
|
|
|
3195
3205
|
}, initialState);
|
|
3196
3206
|
}
|
|
3197
3207
|
|
|
3198
|
-
//
|
|
3208
|
+
// src/presence.tsx
|
|
3199
3209
|
var Presence = (props) => {
|
|
3200
3210
|
const { present, children } = props;
|
|
3201
3211
|
const presence = usePresence$1(present);
|
|
@@ -3207,7 +3217,7 @@ var Presence = (props) => {
|
|
|
3207
3217
|
Presence.displayName = "Presence";
|
|
3208
3218
|
function usePresence$1(present) {
|
|
3209
3219
|
const [node, setNode] = React.useState();
|
|
3210
|
-
const stylesRef = React.useRef(
|
|
3220
|
+
const stylesRef = React.useRef(null);
|
|
3211
3221
|
const prevPresentRef = React.useRef(present);
|
|
3212
3222
|
const prevAnimationNameRef = React.useRef("none");
|
|
3213
3223
|
const initialState = present ? "mounted" : "unmounted";
|
|
@@ -3291,7 +3301,7 @@ function usePresence$1(present) {
|
|
|
3291
3301
|
return {
|
|
3292
3302
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
3293
3303
|
ref: React.useCallback((node2) => {
|
|
3294
|
-
|
|
3304
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
3295
3305
|
setNode(node2);
|
|
3296
3306
|
}, [])
|
|
3297
3307
|
};
|
|
@@ -3313,28 +3323,47 @@ function getElementRef(element) {
|
|
|
3313
3323
|
return element.props.ref || element.ref;
|
|
3314
3324
|
}
|
|
3315
3325
|
|
|
3316
|
-
//
|
|
3326
|
+
// src/use-controllable-state.tsx
|
|
3327
|
+
var useInsertionEffect$1 = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3317
3328
|
function useControllableState({
|
|
3318
3329
|
prop,
|
|
3319
3330
|
defaultProp,
|
|
3320
3331
|
onChange = () => {
|
|
3321
|
-
}
|
|
3332
|
+
},
|
|
3333
|
+
caller
|
|
3322
3334
|
}) {
|
|
3323
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({
|
|
3335
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
3336
|
+
defaultProp,
|
|
3337
|
+
onChange
|
|
3338
|
+
});
|
|
3324
3339
|
const isControlled = prop !== void 0;
|
|
3325
3340
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3326
|
-
|
|
3341
|
+
{
|
|
3342
|
+
const isControlledRef = React.useRef(prop !== void 0);
|
|
3343
|
+
React.useEffect(() => {
|
|
3344
|
+
const wasControlled = isControlledRef.current;
|
|
3345
|
+
if (wasControlled !== isControlled) {
|
|
3346
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
3347
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
3348
|
+
console.warn(
|
|
3349
|
+
`${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.`
|
|
3350
|
+
);
|
|
3351
|
+
}
|
|
3352
|
+
isControlledRef.current = isControlled;
|
|
3353
|
+
}, [isControlled, caller]);
|
|
3354
|
+
}
|
|
3327
3355
|
const setValue = React.useCallback(
|
|
3328
3356
|
(nextValue) => {
|
|
3329
3357
|
if (isControlled) {
|
|
3330
|
-
const
|
|
3331
|
-
|
|
3332
|
-
|
|
3358
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
3359
|
+
if (value2 !== prop) {
|
|
3360
|
+
onChangeRef.current?.(value2);
|
|
3361
|
+
}
|
|
3333
3362
|
} else {
|
|
3334
3363
|
setUncontrolledProp(nextValue);
|
|
3335
3364
|
}
|
|
3336
3365
|
},
|
|
3337
|
-
[isControlled, prop, setUncontrolledProp,
|
|
3366
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
3338
3367
|
);
|
|
3339
3368
|
return [value, setValue];
|
|
3340
3369
|
}
|
|
@@ -3342,17 +3371,22 @@ function useUncontrolledState({
|
|
|
3342
3371
|
defaultProp,
|
|
3343
3372
|
onChange
|
|
3344
3373
|
}) {
|
|
3345
|
-
const
|
|
3346
|
-
const [value] = uncontrolledState;
|
|
3374
|
+
const [value, setValue] = React.useState(defaultProp);
|
|
3347
3375
|
const prevValueRef = React.useRef(value);
|
|
3348
|
-
const
|
|
3376
|
+
const onChangeRef = React.useRef(onChange);
|
|
3377
|
+
useInsertionEffect$1(() => {
|
|
3378
|
+
onChangeRef.current = onChange;
|
|
3379
|
+
}, [onChange]);
|
|
3349
3380
|
React.useEffect(() => {
|
|
3350
3381
|
if (prevValueRef.current !== value) {
|
|
3351
|
-
|
|
3382
|
+
onChangeRef.current?.(value);
|
|
3352
3383
|
prevValueRef.current = value;
|
|
3353
3384
|
}
|
|
3354
|
-
}, [value, prevValueRef
|
|
3355
|
-
return
|
|
3385
|
+
}, [value, prevValueRef]);
|
|
3386
|
+
return [value, setValue, onChangeRef];
|
|
3387
|
+
}
|
|
3388
|
+
function isFunction(value) {
|
|
3389
|
+
return typeof value === "function";
|
|
3356
3390
|
}
|
|
3357
3391
|
|
|
3358
3392
|
var getDefaultParent = function (originalTarget) {
|
|
@@ -4256,10 +4290,11 @@ var Popover = (props) => {
|
|
|
4256
4290
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
4257
4291
|
const triggerRef = React.useRef(null);
|
|
4258
4292
|
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
4259
|
-
const [open
|
|
4293
|
+
const [open, setOpen] = useControllableState({
|
|
4260
4294
|
prop: openProp,
|
|
4261
|
-
defaultProp: defaultOpen,
|
|
4262
|
-
onChange: onOpenChange
|
|
4295
|
+
defaultProp: defaultOpen ?? false,
|
|
4296
|
+
onChange: onOpenChange,
|
|
4297
|
+
caller: POPOVER_NAME
|
|
4263
4298
|
});
|
|
4264
4299
|
return /* @__PURE__ */ jsx$1(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsx$1(
|
|
4265
4300
|
PopoverProvider,
|
|
@@ -4338,6 +4373,7 @@ var PopoverContent$1 = React.forwardRef(
|
|
|
4338
4373
|
}
|
|
4339
4374
|
);
|
|
4340
4375
|
PopoverContent$1.displayName = CONTENT_NAME$6;
|
|
4376
|
+
var Slot$2 = createSlot("PopoverContent.RemoveScroll");
|
|
4341
4377
|
var PopoverContentModal = React.forwardRef(
|
|
4342
4378
|
(props, forwardedRef) => {
|
|
4343
4379
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
@@ -4348,7 +4384,7 @@ var PopoverContentModal = React.forwardRef(
|
|
|
4348
4384
|
const content = contentRef.current;
|
|
4349
4385
|
if (content) return hideOthers(content);
|
|
4350
4386
|
}, []);
|
|
4351
|
-
return /* @__PURE__ */ jsx$1(RemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
|
|
4387
|
+
return /* @__PURE__ */ jsx$1(RemoveScroll, { as: Slot$2, allowPinchZoom: true, children: /* @__PURE__ */ jsx$1(
|
|
4352
4388
|
PopoverContentImpl,
|
|
4353
4389
|
{
|
|
4354
4390
|
...props,
|
|
@@ -11231,7 +11267,7 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
11231
11267
|
}
|
|
11232
11268
|
return guidanceMsg;
|
|
11233
11269
|
}, [ariaLabel, focusedOption, focusedValue, isMulti, isOptionDisabled, isSearchable, menuIsOpen, messages, selectValue, tabSelectsValue, isInitialFocus]);
|
|
11234
|
-
var ScreenReaderText = jsx(Fragment
|
|
11270
|
+
var ScreenReaderText = jsx(Fragment, null, jsx("span", {
|
|
11235
11271
|
id: "aria-selection"
|
|
11236
11272
|
}, ariaSelected), jsx("span", {
|
|
11237
11273
|
id: "aria-focused"
|
|
@@ -11240,7 +11276,7 @@ var LiveRegion = function LiveRegion(props) {
|
|
|
11240
11276
|
}, ariaResults), jsx("span", {
|
|
11241
11277
|
id: "aria-guidance"
|
|
11242
11278
|
}, ariaGuidance));
|
|
11243
|
-
return jsx(Fragment
|
|
11279
|
+
return jsx(Fragment, null, jsx(A11yText$1, {
|
|
11244
11280
|
id: id
|
|
11245
11281
|
}, isInitialFocus && ScreenReaderText), jsx(A11yText$1, {
|
|
11246
11282
|
"aria-live": ariaLive,
|
|
@@ -11852,7 +11888,7 @@ function ScrollManager(_ref) {
|
|
|
11852
11888
|
setScrollCaptureTarget(element);
|
|
11853
11889
|
setScrollLockTarget(element);
|
|
11854
11890
|
};
|
|
11855
|
-
return jsx(Fragment
|
|
11891
|
+
return jsx(Fragment, null, lockEnabled && jsx("div", {
|
|
11856
11892
|
onClick: blurSelectInput,
|
|
11857
11893
|
css: _ref2$1
|
|
11858
11894
|
}), children(targetRef));
|
|
@@ -13953,10 +13989,11 @@ var Dialog$1 = (props) => {
|
|
|
13953
13989
|
} = props;
|
|
13954
13990
|
const triggerRef = React.useRef(null);
|
|
13955
13991
|
const contentRef = React.useRef(null);
|
|
13956
|
-
const [open
|
|
13992
|
+
const [open, setOpen] = useControllableState({
|
|
13957
13993
|
prop: openProp,
|
|
13958
|
-
defaultProp: defaultOpen,
|
|
13959
|
-
onChange: onOpenChange
|
|
13994
|
+
defaultProp: defaultOpen ?? false,
|
|
13995
|
+
onChange: onOpenChange,
|
|
13996
|
+
caller: DIALOG_NAME
|
|
13960
13997
|
});
|
|
13961
13998
|
return /* @__PURE__ */ jsx$1(
|
|
13962
13999
|
DialogProvider,
|
|
@@ -14018,6 +14055,7 @@ var DialogOverlay = React.forwardRef(
|
|
|
14018
14055
|
}
|
|
14019
14056
|
);
|
|
14020
14057
|
DialogOverlay.displayName = OVERLAY_NAME;
|
|
14058
|
+
var Slot$1 = createSlot("DialogOverlay.RemoveScroll");
|
|
14021
14059
|
var DialogOverlayImpl = React.forwardRef(
|
|
14022
14060
|
(props, forwardedRef) => {
|
|
14023
14061
|
const { __scopeDialog, ...overlayProps } = props;
|
|
@@ -14025,7 +14063,7 @@ var DialogOverlayImpl = React.forwardRef(
|
|
|
14025
14063
|
return (
|
|
14026
14064
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
14027
14065
|
// ie. when `Overlay` and `Content` are siblings
|
|
14028
|
-
/* @__PURE__ */ jsx$1(RemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx$1(
|
|
14066
|
+
/* @__PURE__ */ jsx$1(RemoveScroll, { as: Slot$1, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx$1(
|
|
14029
14067
|
Primitive.div,
|
|
14030
14068
|
{
|
|
14031
14069
|
"data-state": getState$2(context.open),
|
|
@@ -14128,7 +14166,7 @@ var DialogContentImpl = React.forwardRef(
|
|
|
14128
14166
|
const contentRef = React.useRef(null);
|
|
14129
14167
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
14130
14168
|
useFocusGuards();
|
|
14131
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14169
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
14132
14170
|
/* @__PURE__ */ jsx$1(
|
|
14133
14171
|
FocusScope,
|
|
14134
14172
|
{
|
|
@@ -14152,7 +14190,7 @@ var DialogContentImpl = React.forwardRef(
|
|
|
14152
14190
|
)
|
|
14153
14191
|
}
|
|
14154
14192
|
),
|
|
14155
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14193
|
+
/* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
14156
14194
|
/* @__PURE__ */ jsx$1(TitleWarning, { titleId: context.titleId }),
|
|
14157
14195
|
/* @__PURE__ */ jsx$1(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
14158
14196
|
] })
|
|
@@ -14412,17 +14450,19 @@ function createCollection(name) {
|
|
|
14412
14450
|
};
|
|
14413
14451
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
14414
14452
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
14453
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
14415
14454
|
const CollectionSlot = React__default.forwardRef(
|
|
14416
14455
|
(props, forwardedRef) => {
|
|
14417
14456
|
const { scope, children } = props;
|
|
14418
14457
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
14419
14458
|
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
14420
|
-
return /* @__PURE__ */ jsx$1(
|
|
14459
|
+
return /* @__PURE__ */ jsx$1(CollectionSlotImpl, { ref: composedRefs, children });
|
|
14421
14460
|
}
|
|
14422
14461
|
);
|
|
14423
14462
|
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
14424
14463
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
14425
14464
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
14465
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
14426
14466
|
const CollectionItemSlot = React__default.forwardRef(
|
|
14427
14467
|
(props, forwardedRef) => {
|
|
14428
14468
|
const { scope, children, ...itemData } = props;
|
|
@@ -14433,7 +14473,7 @@ function createCollection(name) {
|
|
|
14433
14473
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
14434
14474
|
return () => void context.itemMap.delete(ref);
|
|
14435
14475
|
});
|
|
14436
|
-
return /* @__PURE__ */ jsx$1(
|
|
14476
|
+
return /* @__PURE__ */ jsx$1(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
14437
14477
|
}
|
|
14438
14478
|
);
|
|
14439
14479
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
@@ -14458,7 +14498,7 @@ function createCollection(name) {
|
|
|
14458
14498
|
];
|
|
14459
14499
|
}
|
|
14460
14500
|
|
|
14461
|
-
// packages/react/direction/src/
|
|
14501
|
+
// packages/react/direction/src/direction.tsx
|
|
14462
14502
|
var DirectionContext = React.createContext(void 0);
|
|
14463
14503
|
function useDirection(localDir) {
|
|
14464
14504
|
const globalDir = React.useContext(DirectionContext);
|
|
@@ -14496,10 +14536,11 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
14496
14536
|
const ref = React.useRef(null);
|
|
14497
14537
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
14498
14538
|
const direction = useDirection(dir);
|
|
14499
|
-
const [currentTabStopId
|
|
14539
|
+
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
14500
14540
|
prop: currentTabStopIdProp,
|
|
14501
|
-
defaultProp: defaultCurrentTabStopId,
|
|
14502
|
-
onChange: onCurrentTabStopIdChange
|
|
14541
|
+
defaultProp: defaultCurrentTabStopId ?? null,
|
|
14542
|
+
onChange: onCurrentTabStopIdChange,
|
|
14543
|
+
caller: GROUP_NAME$2
|
|
14503
14544
|
});
|
|
14504
14545
|
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
14505
14546
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
@@ -14577,6 +14618,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14577
14618
|
focusable = true,
|
|
14578
14619
|
active = false,
|
|
14579
14620
|
tabStopId,
|
|
14621
|
+
children,
|
|
14580
14622
|
...itemProps
|
|
14581
14623
|
} = props;
|
|
14582
14624
|
const autoId = useId();
|
|
@@ -14584,7 +14626,7 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14584
14626
|
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
14585
14627
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
14586
14628
|
const getItems = useCollection$3(__scopeRovingFocusGroup);
|
|
14587
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
14629
|
+
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
14588
14630
|
React.useEffect(() => {
|
|
14589
14631
|
if (focusable) {
|
|
14590
14632
|
onFocusableItemAdd();
|
|
@@ -14630,7 +14672,8 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
14630
14672
|
}
|
|
14631
14673
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
14632
14674
|
}
|
|
14633
|
-
})
|
|
14675
|
+
}),
|
|
14676
|
+
children: typeof children === "function" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children
|
|
14634
14677
|
}
|
|
14635
14678
|
)
|
|
14636
14679
|
}
|
|
@@ -14694,7 +14737,8 @@ var Tabs$1 = React.forwardRef(
|
|
|
14694
14737
|
const [value, setValue] = useControllableState({
|
|
14695
14738
|
prop: valueProp,
|
|
14696
14739
|
onChange: onValueChange,
|
|
14697
|
-
defaultProp: defaultValue
|
|
14740
|
+
defaultProp: defaultValue ?? "",
|
|
14741
|
+
caller: TABS_NAME
|
|
14698
14742
|
});
|
|
14699
14743
|
return /* @__PURE__ */ jsx$1(
|
|
14700
14744
|
TabsProvider,
|
|
@@ -14877,10 +14921,11 @@ var Collapsible = React.forwardRef(
|
|
|
14877
14921
|
onOpenChange,
|
|
14878
14922
|
...collapsibleProps
|
|
14879
14923
|
} = props;
|
|
14880
|
-
const [open
|
|
14924
|
+
const [open, setOpen] = useControllableState({
|
|
14881
14925
|
prop: openProp,
|
|
14882
|
-
defaultProp: defaultOpen,
|
|
14883
|
-
onChange: onOpenChange
|
|
14926
|
+
defaultProp: defaultOpen ?? false,
|
|
14927
|
+
onChange: onOpenChange,
|
|
14928
|
+
caller: COLLAPSIBLE_NAME
|
|
14884
14929
|
});
|
|
14885
14930
|
return /* @__PURE__ */ jsx$1(
|
|
14886
14931
|
CollapsibleProvider,
|
|
@@ -15030,14 +15075,15 @@ var AccordionImplSingle = React__default.forwardRef(
|
|
|
15030
15075
|
} = props;
|
|
15031
15076
|
const [value, setValue] = useControllableState({
|
|
15032
15077
|
prop: valueProp,
|
|
15033
|
-
defaultProp: defaultValue,
|
|
15034
|
-
onChange: onValueChange
|
|
15078
|
+
defaultProp: defaultValue ?? "",
|
|
15079
|
+
onChange: onValueChange,
|
|
15080
|
+
caller: ACCORDION_NAME
|
|
15035
15081
|
});
|
|
15036
15082
|
return /* @__PURE__ */ jsx$1(
|
|
15037
15083
|
AccordionValueProvider,
|
|
15038
15084
|
{
|
|
15039
15085
|
scope: props.__scopeAccordion,
|
|
15040
|
-
value: value ? [value] : [],
|
|
15086
|
+
value: React__default.useMemo(() => value ? [value] : [], [value]),
|
|
15041
15087
|
onItemOpen: setValue,
|
|
15042
15088
|
onItemClose: React__default.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
|
|
15043
15089
|
children: /* @__PURE__ */ jsx$1(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx$1(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
|
|
@@ -15053,10 +15099,11 @@ var AccordionImplMultiple = React__default.forwardRef((props, forwardedRef) => {
|
|
|
15053
15099
|
},
|
|
15054
15100
|
...accordionMultipleProps
|
|
15055
15101
|
} = props;
|
|
15056
|
-
const [value
|
|
15102
|
+
const [value, setValue] = useControllableState({
|
|
15057
15103
|
prop: valueProp,
|
|
15058
|
-
defaultProp: defaultValue,
|
|
15059
|
-
onChange: onValueChange
|
|
15104
|
+
defaultProp: defaultValue ?? [],
|
|
15105
|
+
onChange: onValueChange,
|
|
15106
|
+
caller: ACCORDION_NAME
|
|
15060
15107
|
});
|
|
15061
15108
|
const handleItemOpen = React__default.useCallback(
|
|
15062
15109
|
(itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
|
|
@@ -15486,6 +15533,7 @@ var MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {
|
|
|
15486
15533
|
}
|
|
15487
15534
|
);
|
|
15488
15535
|
});
|
|
15536
|
+
var Slot = createSlot("MenuContent.ScrollLock");
|
|
15489
15537
|
var MenuContentImpl = React.forwardRef(
|
|
15490
15538
|
(props, forwardedRef) => {
|
|
15491
15539
|
const {
|
|
@@ -16123,10 +16171,12 @@ function isPointInPolygon(point, polygon) {
|
|
|
16123
16171
|
const { x, y } = point;
|
|
16124
16172
|
let inside = false;
|
|
16125
16173
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
16126
|
-
const
|
|
16127
|
-
const
|
|
16128
|
-
const
|
|
16129
|
-
const
|
|
16174
|
+
const ii = polygon[i];
|
|
16175
|
+
const jj = polygon[j];
|
|
16176
|
+
const xi = ii.x;
|
|
16177
|
+
const yi = ii.y;
|
|
16178
|
+
const xj = jj.x;
|
|
16179
|
+
const yj = jj.y;
|
|
16130
16180
|
const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
|
|
16131
16181
|
if (intersect) inside = !inside;
|
|
16132
16182
|
}
|
|
@@ -16176,10 +16226,11 @@ var DropdownMenu = (props) => {
|
|
|
16176
16226
|
} = props;
|
|
16177
16227
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16178
16228
|
const triggerRef = React.useRef(null);
|
|
16179
|
-
const [open
|
|
16229
|
+
const [open, setOpen] = useControllableState({
|
|
16180
16230
|
prop: openProp,
|
|
16181
|
-
defaultProp: defaultOpen,
|
|
16182
|
-
onChange: onOpenChange
|
|
16231
|
+
defaultProp: defaultOpen ?? false,
|
|
16232
|
+
onChange: onOpenChange,
|
|
16233
|
+
caller: DROPDOWN_MENU_NAME
|
|
16183
16234
|
});
|
|
16184
16235
|
return /* @__PURE__ */ jsx$1(
|
|
16185
16236
|
DropdownMenuProvider,
|
|
@@ -16356,10 +16407,11 @@ DropdownMenuArrow.displayName = ARROW_NAME;
|
|
|
16356
16407
|
var DropdownMenuSub = (props) => {
|
|
16357
16408
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
16358
16409
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
16359
|
-
const [open
|
|
16410
|
+
const [open, setOpen] = useControllableState({
|
|
16360
16411
|
prop: openProp,
|
|
16361
|
-
defaultProp: defaultOpen,
|
|
16362
|
-
onChange: onOpenChange
|
|
16412
|
+
defaultProp: defaultOpen ?? false,
|
|
16413
|
+
onChange: onOpenChange,
|
|
16414
|
+
caller: "DropdownMenuSub"
|
|
16363
16415
|
});
|
|
16364
16416
|
return /* @__PURE__ */ jsx$1(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
16365
16417
|
};
|
|
@@ -20434,7 +20486,7 @@ function PopChild({ children, isPresent, anchorX }) {
|
|
|
20434
20486
|
* styles directly on the DOM node, we might be overwriting
|
|
20435
20487
|
* styles set via the style prop.
|
|
20436
20488
|
*/
|
|
20437
|
-
useInsertionEffect$
|
|
20489
|
+
useInsertionEffect$2(() => {
|
|
20438
20490
|
const { width, height, top, left, right } = size.current;
|
|
20439
20491
|
if (isPresent || !ref.current || !width || !height)
|
|
20440
20492
|
return;
|
|
@@ -20694,7 +20746,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
20694
20746
|
* all components have finished animating out.
|
|
20695
20747
|
*/
|
|
20696
20748
|
const { forceRender } = useContext(LayoutGroupContext);
|
|
20697
|
-
return (jsx$1(Fragment, { children: renderedChildren.map((child) => {
|
|
20749
|
+
return (jsx$1(Fragment$1, { children: renderedChildren.map((child) => {
|
|
20698
20750
|
const key = getChildKey(child);
|
|
20699
20751
|
const isPresent = propagate && !isParentPresent
|
|
20700
20752
|
? false
|
|
@@ -21055,7 +21107,7 @@ function useVisualElement(Component, visualState, props, createVisualElement, Pr
|
|
|
21055
21107
|
createProjectionNode$1(visualElementRef.current, props, ProjectionNodeConstructor, initialLayoutGroupConfig);
|
|
21056
21108
|
}
|
|
21057
21109
|
const isMounted = useRef(false);
|
|
21058
|
-
useInsertionEffect$
|
|
21110
|
+
useInsertionEffect$2(() => {
|
|
21059
21111
|
/**
|
|
21060
21112
|
* Check the component has already mounted before calling
|
|
21061
21113
|
* `update` unnecessarily. This ensures we skip the initial update.
|
|
@@ -21586,7 +21638,7 @@ function createUseRender(forwardMotionProps = false) {
|
|
|
21586
21638
|
: useHTMLProps;
|
|
21587
21639
|
const visualProps = useVisualProps(props, latestValues, isStatic, Component);
|
|
21588
21640
|
const filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps);
|
|
21589
|
-
const elementProps = Component !== Fragment
|
|
21641
|
+
const elementProps = Component !== Fragment
|
|
21590
21642
|
? { ...filteredProps, ...visualProps, ref }
|
|
21591
21643
|
: {};
|
|
21592
21644
|
/**
|
|
@@ -26752,7 +26804,7 @@ const createDomVisualElement = (Component, options) => {
|
|
|
26752
26804
|
return isSVGComponent(Component)
|
|
26753
26805
|
? new SVGVisualElement(options)
|
|
26754
26806
|
: new HTMLVisualElement(options, {
|
|
26755
|
-
allowProjection: Component !== Fragment
|
|
26807
|
+
allowProjection: Component !== Fragment,
|
|
26756
26808
|
});
|
|
26757
26809
|
};
|
|
26758
26810
|
|
|
@@ -26782,7 +26834,7 @@ function clamp(value, [min, max]) {
|
|
|
26782
26834
|
return Math.min(max, Math.max(min, value));
|
|
26783
26835
|
}
|
|
26784
26836
|
|
|
26785
|
-
// packages/react/use-previous/src/
|
|
26837
|
+
// packages/react/use-previous/src/use-previous.tsx
|
|
26786
26838
|
function usePrevious(value) {
|
|
26787
26839
|
const ref = React.useRef({ value, previous: value });
|
|
26788
26840
|
return React.useMemo(() => {
|
|
@@ -27228,7 +27280,7 @@ var SliderThumbImpl = React.forwardRef(
|
|
|
27228
27280
|
}
|
|
27229
27281
|
) }),
|
|
27230
27282
|
isFormControl && /* @__PURE__ */ jsx$1(
|
|
27231
|
-
|
|
27283
|
+
SliderBubbleInput,
|
|
27232
27284
|
{
|
|
27233
27285
|
name: name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0),
|
|
27234
27286
|
form: context.form,
|
|
@@ -27242,23 +27294,36 @@ var SliderThumbImpl = React.forwardRef(
|
|
|
27242
27294
|
}
|
|
27243
27295
|
);
|
|
27244
27296
|
SliderThumb.displayName = THUMB_NAME;
|
|
27245
|
-
var
|
|
27246
|
-
|
|
27247
|
-
|
|
27248
|
-
|
|
27249
|
-
|
|
27250
|
-
const
|
|
27251
|
-
|
|
27252
|
-
|
|
27253
|
-
|
|
27254
|
-
|
|
27255
|
-
const
|
|
27256
|
-
setValue.
|
|
27257
|
-
|
|
27258
|
-
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
}
|
|
27297
|
+
var BUBBLE_INPUT_NAME = "RadioBubbleInput";
|
|
27298
|
+
var SliderBubbleInput = React.forwardRef(
|
|
27299
|
+
({ __scopeSlider, value, ...props }, forwardedRef) => {
|
|
27300
|
+
const ref = React.useRef(null);
|
|
27301
|
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
27302
|
+
const prevValue = usePrevious(value);
|
|
27303
|
+
React.useEffect(() => {
|
|
27304
|
+
const input = ref.current;
|
|
27305
|
+
if (!input) return;
|
|
27306
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
27307
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
|
|
27308
|
+
const setValue = descriptor.set;
|
|
27309
|
+
if (prevValue !== value && setValue) {
|
|
27310
|
+
const event = new Event("input", { bubbles: true });
|
|
27311
|
+
setValue.call(input, value);
|
|
27312
|
+
input.dispatchEvent(event);
|
|
27313
|
+
}
|
|
27314
|
+
}, [prevValue, value]);
|
|
27315
|
+
return /* @__PURE__ */ jsx$1(
|
|
27316
|
+
Primitive.input,
|
|
27317
|
+
{
|
|
27318
|
+
style: { display: "none" },
|
|
27319
|
+
...props,
|
|
27320
|
+
ref: composedRefs,
|
|
27321
|
+
defaultValue: value
|
|
27322
|
+
}
|
|
27323
|
+
);
|
|
27324
|
+
}
|
|
27325
|
+
);
|
|
27326
|
+
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
|
|
27262
27327
|
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
|
|
27263
27328
|
const nextValues = [...prevValues];
|
|
27264
27329
|
nextValues[atIndex] = nextValue;
|