@process.co/ui 0.0.16 → 0.0.17
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/css/ui.css +77 -0
- package/dist/components/fields/index.cjs +19 -0
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.d.cts +1 -1
- package/dist/components/fields/index.d.ts +1 -1
- package/dist/components/fields/index.js +18 -1
- package/dist/components/fields/index.js.map +1 -1
- package/dist/{index-19C2gVyr.d.cts → index-D9NS5Zgl.d.cts} +13 -2
- package/dist/{index-19C2gVyr.d.ts → index-D9NS5Zgl.d.ts} +13 -2
- package/dist/index.cjs +449 -428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +404 -385
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React44 = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var ReactDOM4 = require('react-dom');
|
|
6
6
|
|
|
@@ -22,7 +22,7 @@ function _interopNamespace(e) {
|
|
|
22
22
|
return Object.freeze(n);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var React44__namespace = /*#__PURE__*/_interopNamespace(React44);
|
|
26
26
|
var ReactDOM4__namespace = /*#__PURE__*/_interopNamespace(ReactDOM4);
|
|
27
27
|
|
|
28
28
|
var __defProp = Object.defineProperty;
|
|
@@ -62,10 +62,10 @@ function composeRefs(...refs) {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
function useComposedRefs(...refs) {
|
|
65
|
-
return
|
|
65
|
+
return React44__namespace.useCallback(composeRefs(...refs), refs);
|
|
66
66
|
}
|
|
67
67
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
68
|
-
var use =
|
|
68
|
+
var use = React44__namespace[" use ".trim().toString()];
|
|
69
69
|
function isPromiseLike(value) {
|
|
70
70
|
return typeof value === "object" && value !== null && "then" in value;
|
|
71
71
|
}
|
|
@@ -75,24 +75,24 @@ function isLazyComponent(element) {
|
|
|
75
75
|
// @__NO_SIDE_EFFECTS__
|
|
76
76
|
function createSlot(ownerName) {
|
|
77
77
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
78
|
-
const Slot22 =
|
|
78
|
+
const Slot22 = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
79
79
|
let { children, ...slotProps } = props;
|
|
80
80
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
81
81
|
children = use(children._payload);
|
|
82
82
|
}
|
|
83
|
-
const childrenArray =
|
|
83
|
+
const childrenArray = React44__namespace.Children.toArray(children);
|
|
84
84
|
const slottable = childrenArray.find(isSlottable);
|
|
85
85
|
if (slottable) {
|
|
86
86
|
const newElement = slottable.props.children;
|
|
87
87
|
const newChildren = childrenArray.map((child) => {
|
|
88
88
|
if (child === slottable) {
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
89
|
+
if (React44__namespace.Children.count(newElement) > 1) return React44__namespace.Children.only(null);
|
|
90
|
+
return React44__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
91
91
|
} else {
|
|
92
92
|
return child;
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
95
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React44__namespace.isValidElement(newElement) ? React44__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
96
96
|
}
|
|
97
97
|
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
98
98
|
});
|
|
@@ -102,27 +102,27 @@ function createSlot(ownerName) {
|
|
|
102
102
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
103
103
|
// @__NO_SIDE_EFFECTS__
|
|
104
104
|
function createSlotClone(ownerName) {
|
|
105
|
-
const SlotClone =
|
|
105
|
+
const SlotClone = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
106
106
|
let { children, ...slotProps } = props;
|
|
107
107
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
108
108
|
children = use(children._payload);
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if (React44__namespace.isValidElement(children)) {
|
|
111
111
|
const childrenRef = getElementRef(children);
|
|
112
112
|
const props2 = mergeProps(slotProps, children.props);
|
|
113
|
-
if (children.type !==
|
|
113
|
+
if (children.type !== React44__namespace.Fragment) {
|
|
114
114
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
115
115
|
}
|
|
116
|
-
return
|
|
116
|
+
return React44__namespace.cloneElement(children, props2);
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return React44__namespace.Children.count(children) > 1 ? React44__namespace.Children.only(null) : null;
|
|
119
119
|
});
|
|
120
120
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
121
121
|
return SlotClone;
|
|
122
122
|
}
|
|
123
123
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
124
124
|
function isSlottable(child) {
|
|
125
|
-
return
|
|
125
|
+
return React44__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
126
126
|
}
|
|
127
127
|
function mergeProps(slotProps, childProps) {
|
|
128
128
|
const overrideProps = { ...childProps };
|
|
@@ -3269,7 +3269,7 @@ function Button({
|
|
|
3269
3269
|
...props
|
|
3270
3270
|
}) {
|
|
3271
3271
|
const Comp = asChild ? Slot : "button";
|
|
3272
|
-
return /* @__PURE__ */
|
|
3272
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
3273
3273
|
Comp,
|
|
3274
3274
|
{
|
|
3275
3275
|
"data-slot": "button",
|
|
@@ -3286,9 +3286,9 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
3286
3286
|
}
|
|
3287
3287
|
};
|
|
3288
3288
|
}
|
|
3289
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3289
|
+
var useLayoutEffect2 = globalThis?.document ? React44__namespace.useLayoutEffect : () => {
|
|
3290
3290
|
};
|
|
3291
|
-
var useInsertionEffect =
|
|
3291
|
+
var useInsertionEffect = React44__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3292
3292
|
function useControllableState({
|
|
3293
3293
|
prop,
|
|
3294
3294
|
defaultProp,
|
|
@@ -3303,8 +3303,8 @@ function useControllableState({
|
|
|
3303
3303
|
const isControlled = prop !== void 0;
|
|
3304
3304
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3305
3305
|
{
|
|
3306
|
-
const isControlledRef =
|
|
3307
|
-
|
|
3306
|
+
const isControlledRef = React44__namespace.useRef(prop !== void 0);
|
|
3307
|
+
React44__namespace.useEffect(() => {
|
|
3308
3308
|
const wasControlled = isControlledRef.current;
|
|
3309
3309
|
if (wasControlled !== isControlled) {
|
|
3310
3310
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -3316,7 +3316,7 @@ function useControllableState({
|
|
|
3316
3316
|
isControlledRef.current = isControlled;
|
|
3317
3317
|
}, [isControlled, caller]);
|
|
3318
3318
|
}
|
|
3319
|
-
const setValue =
|
|
3319
|
+
const setValue = React44__namespace.useCallback(
|
|
3320
3320
|
(nextValue) => {
|
|
3321
3321
|
if (isControlled) {
|
|
3322
3322
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -3335,13 +3335,13 @@ function useUncontrolledState({
|
|
|
3335
3335
|
defaultProp,
|
|
3336
3336
|
onChange
|
|
3337
3337
|
}) {
|
|
3338
|
-
const [value, setValue] =
|
|
3339
|
-
const prevValueRef =
|
|
3340
|
-
const onChangeRef =
|
|
3338
|
+
const [value, setValue] = React44__namespace.useState(defaultProp);
|
|
3339
|
+
const prevValueRef = React44__namespace.useRef(value);
|
|
3340
|
+
const onChangeRef = React44__namespace.useRef(onChange);
|
|
3341
3341
|
useInsertionEffect(() => {
|
|
3342
3342
|
onChangeRef.current = onChange;
|
|
3343
3343
|
}, [onChange]);
|
|
3344
|
-
|
|
3344
|
+
React44__namespace.useEffect(() => {
|
|
3345
3345
|
if (prevValueRef.current !== value) {
|
|
3346
3346
|
onChangeRef.current?.(value);
|
|
3347
3347
|
prevValueRef.current = value;
|
|
@@ -3355,21 +3355,21 @@ function isFunction(value) {
|
|
|
3355
3355
|
// @__NO_SIDE_EFFECTS__
|
|
3356
3356
|
function createSlot2(ownerName) {
|
|
3357
3357
|
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
3358
|
-
const Slot22 =
|
|
3358
|
+
const Slot22 = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3359
3359
|
const { children, ...slotProps } = props;
|
|
3360
|
-
const childrenArray =
|
|
3360
|
+
const childrenArray = React44__namespace.Children.toArray(children);
|
|
3361
3361
|
const slottable = childrenArray.find(isSlottable2);
|
|
3362
3362
|
if (slottable) {
|
|
3363
3363
|
const newElement = slottable.props.children;
|
|
3364
3364
|
const newChildren = childrenArray.map((child) => {
|
|
3365
3365
|
if (child === slottable) {
|
|
3366
|
-
if (
|
|
3367
|
-
return
|
|
3366
|
+
if (React44__namespace.Children.count(newElement) > 1) return React44__namespace.Children.only(null);
|
|
3367
|
+
return React44__namespace.isValidElement(newElement) ? newElement.props.children : null;
|
|
3368
3368
|
} else {
|
|
3369
3369
|
return child;
|
|
3370
3370
|
}
|
|
3371
3371
|
});
|
|
3372
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
3372
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React44__namespace.isValidElement(newElement) ? React44__namespace.cloneElement(newElement, void 0, newChildren) : null });
|
|
3373
3373
|
}
|
|
3374
3374
|
return /* @__PURE__ */ jsxRuntime.jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
3375
3375
|
});
|
|
@@ -3378,24 +3378,24 @@ function createSlot2(ownerName) {
|
|
|
3378
3378
|
}
|
|
3379
3379
|
// @__NO_SIDE_EFFECTS__
|
|
3380
3380
|
function createSlotClone2(ownerName) {
|
|
3381
|
-
const SlotClone =
|
|
3381
|
+
const SlotClone = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3382
3382
|
const { children, ...slotProps } = props;
|
|
3383
|
-
if (
|
|
3383
|
+
if (React44__namespace.isValidElement(children)) {
|
|
3384
3384
|
const childrenRef = getElementRef2(children);
|
|
3385
3385
|
const props2 = mergeProps2(slotProps, children.props);
|
|
3386
|
-
if (children.type !==
|
|
3386
|
+
if (children.type !== React44__namespace.Fragment) {
|
|
3387
3387
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
3388
3388
|
}
|
|
3389
|
-
return
|
|
3389
|
+
return React44__namespace.cloneElement(children, props2);
|
|
3390
3390
|
}
|
|
3391
|
-
return
|
|
3391
|
+
return React44__namespace.Children.count(children) > 1 ? React44__namespace.Children.only(null) : null;
|
|
3392
3392
|
});
|
|
3393
3393
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
3394
3394
|
return SlotClone;
|
|
3395
3395
|
}
|
|
3396
3396
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
3397
3397
|
function isSlottable2(child) {
|
|
3398
|
-
return
|
|
3398
|
+
return React44__namespace.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
3399
3399
|
}
|
|
3400
3400
|
function mergeProps2(slotProps, childProps) {
|
|
3401
3401
|
const overrideProps = { ...childProps };
|
|
@@ -3455,7 +3455,7 @@ var NODES = [
|
|
|
3455
3455
|
];
|
|
3456
3456
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
3457
3457
|
const Slot4 = createSlot2(`Primitive.${node}`);
|
|
3458
|
-
const Node2 =
|
|
3458
|
+
const Node2 = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3459
3459
|
const { asChild, ...primitiveProps } = props;
|
|
3460
3460
|
const Comp = asChild ? Slot4 : node;
|
|
3461
3461
|
if (typeof window !== "undefined") {
|
|
@@ -3470,7 +3470,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
3470
3470
|
if (target) ReactDOM4__namespace.flushSync(() => target.dispatchEvent(event));
|
|
3471
3471
|
}
|
|
3472
3472
|
var NAME = "Toggle";
|
|
3473
|
-
var Toggle =
|
|
3473
|
+
var Toggle = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3474
3474
|
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
3475
3475
|
const [pressed, setPressed] = useControllableState({
|
|
3476
3476
|
prop: pressedProp,
|
|
@@ -3524,7 +3524,7 @@ var toggleButtonVariants = cva(
|
|
|
3524
3524
|
}
|
|
3525
3525
|
);
|
|
3526
3526
|
function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
3527
|
-
return /* @__PURE__ */
|
|
3527
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
3528
3528
|
Root,
|
|
3529
3529
|
{
|
|
3530
3530
|
"data-slot": "toggle-button",
|
|
@@ -3533,22 +3533,39 @@ function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
|
3533
3533
|
}
|
|
3534
3534
|
);
|
|
3535
3535
|
}
|
|
3536
|
+
var logicToggleButtonStyles = [
|
|
3537
|
+
"uii:inline-flex uii:items-center uii:justify-center uii:rounded-md uii:border uii:border-[#e5e7eb] uii:min-w-[28px] uii:w-[28px] uii:min-h-[56px] uii:h-[56px] uii:text-xs uii:font-bold uii:outline-none uii:focus-visible:ring-2 uii:focus-visible:ring-[#3b82f6]/40 uii:focus-visible:ring-offset-1 uii:disabled:pointer-events-none uii:disabled:opacity-50 uii:cursor-pointer uii:transition-colors uii:select-none",
|
|
3538
|
+
"uii:data-[state=on]:bg-[#3b82f6] uii:data-[state=on]:text-white uii:data-[state=on]:border-[#3b82f6]",
|
|
3539
|
+
"uii:data-[state=off]:bg-[#f3f4f6] uii:data-[state=off]:text-[#374151] uii:data-[state=off]:hover:bg-[#e5e7eb]"
|
|
3540
|
+
].join(" ");
|
|
3541
|
+
var logicToggleButtonLabelStyles = "uii:inline-block uii:whitespace-nowrap uii:[transform:rotate(-90deg)]";
|
|
3542
|
+
function LogicToggleButton({ className, children, ...props }) {
|
|
3543
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
3544
|
+
Root,
|
|
3545
|
+
{
|
|
3546
|
+
"data-slot": "logic-toggle-button",
|
|
3547
|
+
className: cn(logicToggleButtonStyles, className),
|
|
3548
|
+
...props
|
|
3549
|
+
},
|
|
3550
|
+
children != null ? /* @__PURE__ */ React44__namespace.createElement("span", { className: logicToggleButtonLabelStyles }, children) : null
|
|
3551
|
+
);
|
|
3552
|
+
}
|
|
3536
3553
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
3537
3554
|
let defaultContexts = [];
|
|
3538
3555
|
function createContext32(rootComponentName, defaultContext) {
|
|
3539
|
-
const BaseContext =
|
|
3556
|
+
const BaseContext = React44__namespace.createContext(defaultContext);
|
|
3540
3557
|
const index2 = defaultContexts.length;
|
|
3541
3558
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
3542
3559
|
const Provider = (props) => {
|
|
3543
3560
|
const { scope, children, ...context } = props;
|
|
3544
3561
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3545
|
-
const value =
|
|
3562
|
+
const value = React44__namespace.useMemo(() => context, Object.values(context));
|
|
3546
3563
|
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
3547
3564
|
};
|
|
3548
3565
|
Provider.displayName = rootComponentName + "Provider";
|
|
3549
3566
|
function useContext22(consumerName, scope) {
|
|
3550
3567
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3551
|
-
const context =
|
|
3568
|
+
const context = React44__namespace.useContext(Context);
|
|
3552
3569
|
if (context) return context;
|
|
3553
3570
|
if (defaultContext !== void 0) return defaultContext;
|
|
3554
3571
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -3557,11 +3574,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
3557
3574
|
}
|
|
3558
3575
|
const createScope = () => {
|
|
3559
3576
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
3560
|
-
return
|
|
3577
|
+
return React44__namespace.createContext(defaultContext);
|
|
3561
3578
|
});
|
|
3562
3579
|
return function useScope(scope) {
|
|
3563
3580
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
3564
|
-
return
|
|
3581
|
+
return React44__namespace.useMemo(
|
|
3565
3582
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
3566
3583
|
[scope, contexts]
|
|
3567
3584
|
);
|
|
@@ -3584,7 +3601,7 @@ function composeContextScopes(...scopes) {
|
|
|
3584
3601
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
3585
3602
|
return { ...nextScopes2, ...currentScope };
|
|
3586
3603
|
}, {});
|
|
3587
|
-
return
|
|
3604
|
+
return React44__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
3588
3605
|
};
|
|
3589
3606
|
};
|
|
3590
3607
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -3599,14 +3616,14 @@ function createCollection(name) {
|
|
|
3599
3616
|
);
|
|
3600
3617
|
const CollectionProvider = (props) => {
|
|
3601
3618
|
const { scope, children } = props;
|
|
3602
|
-
const ref =
|
|
3603
|
-
const itemMap =
|
|
3619
|
+
const ref = React44__namespace.default.useRef(null);
|
|
3620
|
+
const itemMap = React44__namespace.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
3604
3621
|
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
3605
3622
|
};
|
|
3606
3623
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
3607
3624
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
3608
3625
|
const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);
|
|
3609
|
-
const CollectionSlot =
|
|
3626
|
+
const CollectionSlot = React44__namespace.default.forwardRef(
|
|
3610
3627
|
(props, forwardedRef) => {
|
|
3611
3628
|
const { scope, children } = props;
|
|
3612
3629
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -3618,13 +3635,13 @@ function createCollection(name) {
|
|
|
3618
3635
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
3619
3636
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
3620
3637
|
const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);
|
|
3621
|
-
const CollectionItemSlot =
|
|
3638
|
+
const CollectionItemSlot = React44__namespace.default.forwardRef(
|
|
3622
3639
|
(props, forwardedRef) => {
|
|
3623
3640
|
const { scope, children, ...itemData } = props;
|
|
3624
|
-
const ref =
|
|
3641
|
+
const ref = React44__namespace.default.useRef(null);
|
|
3625
3642
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3626
3643
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
3627
|
-
|
|
3644
|
+
React44__namespace.default.useEffect(() => {
|
|
3628
3645
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
3629
3646
|
return () => void context.itemMap.delete(ref);
|
|
3630
3647
|
});
|
|
@@ -3634,7 +3651,7 @@ function createCollection(name) {
|
|
|
3634
3651
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
3635
3652
|
function useCollection4(scope) {
|
|
3636
3653
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
3637
|
-
const getItems =
|
|
3654
|
+
const getItems = React44__namespace.default.useCallback(() => {
|
|
3638
3655
|
const collectionNode = context.collectionRef.current;
|
|
3639
3656
|
if (!collectionNode) return [];
|
|
3640
3657
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -3652,21 +3669,21 @@ function createCollection(name) {
|
|
|
3652
3669
|
createCollectionScope4
|
|
3653
3670
|
];
|
|
3654
3671
|
}
|
|
3655
|
-
var DirectionContext =
|
|
3672
|
+
var DirectionContext = React44__namespace.createContext(void 0);
|
|
3656
3673
|
function useDirection(localDir) {
|
|
3657
|
-
const globalDir =
|
|
3674
|
+
const globalDir = React44__namespace.useContext(DirectionContext);
|
|
3658
3675
|
return localDir || globalDir || "ltr";
|
|
3659
3676
|
}
|
|
3660
3677
|
function useCallbackRef(callback) {
|
|
3661
|
-
const callbackRef =
|
|
3662
|
-
|
|
3678
|
+
const callbackRef = React44__namespace.useRef(callback);
|
|
3679
|
+
React44__namespace.useEffect(() => {
|
|
3663
3680
|
callbackRef.current = callback;
|
|
3664
3681
|
});
|
|
3665
|
-
return
|
|
3682
|
+
return React44__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
3666
3683
|
}
|
|
3667
3684
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
3668
3685
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
3669
|
-
|
|
3686
|
+
React44__namespace.useEffect(() => {
|
|
3670
3687
|
const handleKeyDown = (event) => {
|
|
3671
3688
|
if (event.key === "Escape") {
|
|
3672
3689
|
onEscapeKeyDown(event);
|
|
@@ -3681,12 +3698,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
3681
3698
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3682
3699
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3683
3700
|
var originalBodyPointerEvents;
|
|
3684
|
-
var DismissableLayerContext =
|
|
3701
|
+
var DismissableLayerContext = React44__namespace.createContext({
|
|
3685
3702
|
layers: /* @__PURE__ */ new Set(),
|
|
3686
3703
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3687
3704
|
branches: /* @__PURE__ */ new Set()
|
|
3688
3705
|
});
|
|
3689
|
-
var DismissableLayer =
|
|
3706
|
+
var DismissableLayer = React44__namespace.forwardRef(
|
|
3690
3707
|
(props, forwardedRef) => {
|
|
3691
3708
|
const {
|
|
3692
3709
|
disableOutsidePointerEvents = false,
|
|
@@ -3697,10 +3714,10 @@ var DismissableLayer = React43__namespace.forwardRef(
|
|
|
3697
3714
|
onDismiss,
|
|
3698
3715
|
...layerProps
|
|
3699
3716
|
} = props;
|
|
3700
|
-
const context =
|
|
3701
|
-
const [node, setNode] =
|
|
3717
|
+
const context = React44__namespace.useContext(DismissableLayerContext);
|
|
3718
|
+
const [node, setNode] = React44__namespace.useState(null);
|
|
3702
3719
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3703
|
-
const [, force] =
|
|
3720
|
+
const [, force] = React44__namespace.useState({});
|
|
3704
3721
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3705
3722
|
const layers = Array.from(context.layers);
|
|
3706
3723
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -3733,7 +3750,7 @@ var DismissableLayer = React43__namespace.forwardRef(
|
|
|
3733
3750
|
onDismiss();
|
|
3734
3751
|
}
|
|
3735
3752
|
}, ownerDocument);
|
|
3736
|
-
|
|
3753
|
+
React44__namespace.useEffect(() => {
|
|
3737
3754
|
if (!node) return;
|
|
3738
3755
|
if (disableOutsidePointerEvents) {
|
|
3739
3756
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -3750,7 +3767,7 @@ var DismissableLayer = React43__namespace.forwardRef(
|
|
|
3750
3767
|
}
|
|
3751
3768
|
};
|
|
3752
3769
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3753
|
-
|
|
3770
|
+
React44__namespace.useEffect(() => {
|
|
3754
3771
|
return () => {
|
|
3755
3772
|
if (!node) return;
|
|
3756
3773
|
context.layers.delete(node);
|
|
@@ -3758,7 +3775,7 @@ var DismissableLayer = React43__namespace.forwardRef(
|
|
|
3758
3775
|
dispatchUpdate();
|
|
3759
3776
|
};
|
|
3760
3777
|
}, [node, context]);
|
|
3761
|
-
|
|
3778
|
+
React44__namespace.useEffect(() => {
|
|
3762
3779
|
const handleUpdate = () => force({});
|
|
3763
3780
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3764
3781
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -3784,11 +3801,11 @@ var DismissableLayer = React43__namespace.forwardRef(
|
|
|
3784
3801
|
);
|
|
3785
3802
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3786
3803
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3787
|
-
var DismissableLayerBranch =
|
|
3788
|
-
const context =
|
|
3789
|
-
const ref =
|
|
3804
|
+
var DismissableLayerBranch = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3805
|
+
const context = React44__namespace.useContext(DismissableLayerContext);
|
|
3806
|
+
const ref = React44__namespace.useRef(null);
|
|
3790
3807
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3791
|
-
|
|
3808
|
+
React44__namespace.useEffect(() => {
|
|
3792
3809
|
const node = ref.current;
|
|
3793
3810
|
if (node) {
|
|
3794
3811
|
context.branches.add(node);
|
|
@@ -3802,10 +3819,10 @@ var DismissableLayerBranch = React43__namespace.forwardRef((props, forwardedRef)
|
|
|
3802
3819
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3803
3820
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
3804
3821
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3805
|
-
const isPointerInsideReactTreeRef =
|
|
3806
|
-
const handleClickRef =
|
|
3822
|
+
const isPointerInsideReactTreeRef = React44__namespace.useRef(false);
|
|
3823
|
+
const handleClickRef = React44__namespace.useRef(() => {
|
|
3807
3824
|
});
|
|
3808
|
-
|
|
3825
|
+
React44__namespace.useEffect(() => {
|
|
3809
3826
|
const handlePointerDown = (event) => {
|
|
3810
3827
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3811
3828
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -3845,8 +3862,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
3845
3862
|
}
|
|
3846
3863
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3847
3864
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3848
|
-
const isFocusInsideReactTreeRef =
|
|
3849
|
-
|
|
3865
|
+
const isFocusInsideReactTreeRef = React44__namespace.useRef(false);
|
|
3866
|
+
React44__namespace.useEffect(() => {
|
|
3850
3867
|
const handleFocus = (event) => {
|
|
3851
3868
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3852
3869
|
const eventDetail = { originalEvent: event };
|
|
@@ -3879,7 +3896,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
3879
3896
|
}
|
|
3880
3897
|
var count = 0;
|
|
3881
3898
|
function useFocusGuards() {
|
|
3882
|
-
|
|
3899
|
+
React44__namespace.useEffect(() => {
|
|
3883
3900
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3884
3901
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
3885
3902
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -3906,7 +3923,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
3906
3923
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3907
3924
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3908
3925
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
3909
|
-
var FocusScope =
|
|
3926
|
+
var FocusScope = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
3910
3927
|
const {
|
|
3911
3928
|
loop = false,
|
|
3912
3929
|
trapped = false,
|
|
@@ -3914,12 +3931,12 @@ var FocusScope = React43__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3914
3931
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
3915
3932
|
...scopeProps
|
|
3916
3933
|
} = props;
|
|
3917
|
-
const [container, setContainer] =
|
|
3934
|
+
const [container, setContainer] = React44__namespace.useState(null);
|
|
3918
3935
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3919
3936
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3920
|
-
const lastFocusedElementRef =
|
|
3937
|
+
const lastFocusedElementRef = React44__namespace.useRef(null);
|
|
3921
3938
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
3922
|
-
const focusScope =
|
|
3939
|
+
const focusScope = React44__namespace.useRef({
|
|
3923
3940
|
paused: false,
|
|
3924
3941
|
pause() {
|
|
3925
3942
|
this.paused = true;
|
|
@@ -3928,7 +3945,7 @@ var FocusScope = React43__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3928
3945
|
this.paused = false;
|
|
3929
3946
|
}
|
|
3930
3947
|
}).current;
|
|
3931
|
-
|
|
3948
|
+
React44__namespace.useEffect(() => {
|
|
3932
3949
|
if (trapped) {
|
|
3933
3950
|
let handleFocusIn2 = function(event) {
|
|
3934
3951
|
if (focusScope.paused || !container) return;
|
|
@@ -3963,7 +3980,7 @@ var FocusScope = React43__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3963
3980
|
};
|
|
3964
3981
|
}
|
|
3965
3982
|
}, [trapped, container, focusScope.paused]);
|
|
3966
|
-
|
|
3983
|
+
React44__namespace.useEffect(() => {
|
|
3967
3984
|
if (container) {
|
|
3968
3985
|
focusScopesStack.add(focusScope);
|
|
3969
3986
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3994,7 +4011,7 @@ var FocusScope = React43__namespace.forwardRef((props, forwardedRef) => {
|
|
|
3994
4011
|
};
|
|
3995
4012
|
}
|
|
3996
4013
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3997
|
-
const handleKeyDown =
|
|
4014
|
+
const handleKeyDown = React44__namespace.useCallback(
|
|
3998
4015
|
(event) => {
|
|
3999
4016
|
if (!loop && !trapped) return;
|
|
4000
4017
|
if (focusScope.paused) return;
|
|
@@ -4101,10 +4118,10 @@ function arrayRemove(array, item) {
|
|
|
4101
4118
|
function removeLinks(items) {
|
|
4102
4119
|
return items.filter((item) => item.tagName !== "A");
|
|
4103
4120
|
}
|
|
4104
|
-
var useReactId =
|
|
4121
|
+
var useReactId = React44__namespace[" useId ".trim().toString()] || (() => void 0);
|
|
4105
4122
|
var count2 = 0;
|
|
4106
4123
|
function useId(deterministicId) {
|
|
4107
|
-
const [id, setId] =
|
|
4124
|
+
const [id, setId] = React44__namespace.useState(useReactId());
|
|
4108
4125
|
useLayoutEffect2(() => {
|
|
4109
4126
|
setId((reactId) => reactId ?? String(count2++));
|
|
4110
4127
|
}, [deterministicId]);
|
|
@@ -5719,7 +5736,7 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
5719
5736
|
var isClient = typeof document !== "undefined";
|
|
5720
5737
|
var noop = function noop2() {
|
|
5721
5738
|
};
|
|
5722
|
-
var index = isClient ?
|
|
5739
|
+
var index = isClient ? React44.useLayoutEffect : noop;
|
|
5723
5740
|
function deepEqual(a, b) {
|
|
5724
5741
|
if (a === b) {
|
|
5725
5742
|
return true;
|
|
@@ -5779,7 +5796,7 @@ function roundByDPR(element, value) {
|
|
|
5779
5796
|
return Math.round(value * dpr) / dpr;
|
|
5780
5797
|
}
|
|
5781
5798
|
function useLatestRef(value) {
|
|
5782
|
-
const ref =
|
|
5799
|
+
const ref = React44__namespace.useRef(value);
|
|
5783
5800
|
index(() => {
|
|
5784
5801
|
ref.current = value;
|
|
5785
5802
|
});
|
|
@@ -5802,7 +5819,7 @@ function useFloating(options) {
|
|
|
5802
5819
|
whileElementsMounted,
|
|
5803
5820
|
open
|
|
5804
5821
|
} = options;
|
|
5805
|
-
const [data, setData] =
|
|
5822
|
+
const [data, setData] = React44__namespace.useState({
|
|
5806
5823
|
x: 0,
|
|
5807
5824
|
y: 0,
|
|
5808
5825
|
strategy,
|
|
@@ -5810,19 +5827,19 @@ function useFloating(options) {
|
|
|
5810
5827
|
middlewareData: {},
|
|
5811
5828
|
isPositioned: false
|
|
5812
5829
|
});
|
|
5813
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
5830
|
+
const [latestMiddleware, setLatestMiddleware] = React44__namespace.useState(middleware);
|
|
5814
5831
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
5815
5832
|
setLatestMiddleware(middleware);
|
|
5816
5833
|
}
|
|
5817
|
-
const [_reference, _setReference] =
|
|
5818
|
-
const [_floating, _setFloating] =
|
|
5819
|
-
const setReference =
|
|
5834
|
+
const [_reference, _setReference] = React44__namespace.useState(null);
|
|
5835
|
+
const [_floating, _setFloating] = React44__namespace.useState(null);
|
|
5836
|
+
const setReference = React44__namespace.useCallback((node) => {
|
|
5820
5837
|
if (node !== referenceRef.current) {
|
|
5821
5838
|
referenceRef.current = node;
|
|
5822
5839
|
_setReference(node);
|
|
5823
5840
|
}
|
|
5824
5841
|
}, []);
|
|
5825
|
-
const setFloating =
|
|
5842
|
+
const setFloating = React44__namespace.useCallback((node) => {
|
|
5826
5843
|
if (node !== floatingRef.current) {
|
|
5827
5844
|
floatingRef.current = node;
|
|
5828
5845
|
_setFloating(node);
|
|
@@ -5830,14 +5847,14 @@ function useFloating(options) {
|
|
|
5830
5847
|
}, []);
|
|
5831
5848
|
const referenceEl = externalReference || _reference;
|
|
5832
5849
|
const floatingEl = externalFloating || _floating;
|
|
5833
|
-
const referenceRef =
|
|
5834
|
-
const floatingRef =
|
|
5835
|
-
const dataRef =
|
|
5850
|
+
const referenceRef = React44__namespace.useRef(null);
|
|
5851
|
+
const floatingRef = React44__namespace.useRef(null);
|
|
5852
|
+
const dataRef = React44__namespace.useRef(data);
|
|
5836
5853
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
5837
5854
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
5838
5855
|
const platformRef = useLatestRef(platform2);
|
|
5839
5856
|
const openRef = useLatestRef(open);
|
|
5840
|
-
const update =
|
|
5857
|
+
const update = React44__namespace.useCallback(() => {
|
|
5841
5858
|
if (!referenceRef.current || !floatingRef.current) {
|
|
5842
5859
|
return;
|
|
5843
5860
|
}
|
|
@@ -5875,7 +5892,7 @@ function useFloating(options) {
|
|
|
5875
5892
|
}));
|
|
5876
5893
|
}
|
|
5877
5894
|
}, [open]);
|
|
5878
|
-
const isMountedRef =
|
|
5895
|
+
const isMountedRef = React44__namespace.useRef(false);
|
|
5879
5896
|
index(() => {
|
|
5880
5897
|
isMountedRef.current = true;
|
|
5881
5898
|
return () => {
|
|
@@ -5892,17 +5909,17 @@ function useFloating(options) {
|
|
|
5892
5909
|
update();
|
|
5893
5910
|
}
|
|
5894
5911
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
5895
|
-
const refs =
|
|
5912
|
+
const refs = React44__namespace.useMemo(() => ({
|
|
5896
5913
|
reference: referenceRef,
|
|
5897
5914
|
floating: floatingRef,
|
|
5898
5915
|
setReference,
|
|
5899
5916
|
setFloating
|
|
5900
5917
|
}), [setReference, setFloating]);
|
|
5901
|
-
const elements =
|
|
5918
|
+
const elements = React44__namespace.useMemo(() => ({
|
|
5902
5919
|
reference: referenceEl,
|
|
5903
5920
|
floating: floatingEl
|
|
5904
5921
|
}), [referenceEl, floatingEl]);
|
|
5905
|
-
const floatingStyles =
|
|
5922
|
+
const floatingStyles = React44__namespace.useMemo(() => {
|
|
5906
5923
|
const initialStyles = {
|
|
5907
5924
|
position: strategy,
|
|
5908
5925
|
left: 0,
|
|
@@ -5928,7 +5945,7 @@ function useFloating(options) {
|
|
|
5928
5945
|
top: y
|
|
5929
5946
|
};
|
|
5930
5947
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
5931
|
-
return
|
|
5948
|
+
return React44__namespace.useMemo(() => ({
|
|
5932
5949
|
...data,
|
|
5933
5950
|
update,
|
|
5934
5951
|
refs,
|
|
@@ -5996,7 +6013,7 @@ var arrow3 = (options, deps) => ({
|
|
|
5996
6013
|
options: [options, deps]
|
|
5997
6014
|
});
|
|
5998
6015
|
var NAME2 = "Arrow";
|
|
5999
|
-
var Arrow =
|
|
6016
|
+
var Arrow = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
6000
6017
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
6001
6018
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6002
6019
|
Primitive.svg,
|
|
@@ -6014,7 +6031,7 @@ var Arrow = React43__namespace.forwardRef((props, forwardedRef) => {
|
|
|
6014
6031
|
Arrow.displayName = NAME2;
|
|
6015
6032
|
var Root2 = Arrow;
|
|
6016
6033
|
function useSize(element) {
|
|
6017
|
-
const [size4, setSize] =
|
|
6034
|
+
const [size4, setSize] = React44__namespace.useState(void 0);
|
|
6018
6035
|
useLayoutEffect2(() => {
|
|
6019
6036
|
if (element) {
|
|
6020
6037
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -6052,19 +6069,19 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
6052
6069
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
6053
6070
|
var Popper = (props) => {
|
|
6054
6071
|
const { __scopePopper, children } = props;
|
|
6055
|
-
const [anchor, setAnchor] =
|
|
6072
|
+
const [anchor, setAnchor] = React44__namespace.useState(null);
|
|
6056
6073
|
return /* @__PURE__ */ jsxRuntime.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
6057
6074
|
};
|
|
6058
6075
|
Popper.displayName = POPPER_NAME;
|
|
6059
6076
|
var ANCHOR_NAME = "PopperAnchor";
|
|
6060
|
-
var PopperAnchor =
|
|
6077
|
+
var PopperAnchor = React44__namespace.forwardRef(
|
|
6061
6078
|
(props, forwardedRef) => {
|
|
6062
6079
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
6063
6080
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
6064
|
-
const ref =
|
|
6081
|
+
const ref = React44__namespace.useRef(null);
|
|
6065
6082
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6066
|
-
const anchorRef =
|
|
6067
|
-
|
|
6083
|
+
const anchorRef = React44__namespace.useRef(null);
|
|
6084
|
+
React44__namespace.useEffect(() => {
|
|
6068
6085
|
const previousAnchor = anchorRef.current;
|
|
6069
6086
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
6070
6087
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -6077,7 +6094,7 @@ var PopperAnchor = React43__namespace.forwardRef(
|
|
|
6077
6094
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
6078
6095
|
var CONTENT_NAME = "PopperContent";
|
|
6079
6096
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
6080
|
-
var PopperContent =
|
|
6097
|
+
var PopperContent = React44__namespace.forwardRef(
|
|
6081
6098
|
(props, forwardedRef) => {
|
|
6082
6099
|
const {
|
|
6083
6100
|
__scopePopper,
|
|
@@ -6096,9 +6113,9 @@ var PopperContent = React43__namespace.forwardRef(
|
|
|
6096
6113
|
...contentProps
|
|
6097
6114
|
} = props;
|
|
6098
6115
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
6099
|
-
const [content, setContent] =
|
|
6116
|
+
const [content, setContent] = React44__namespace.useState(null);
|
|
6100
6117
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
6101
|
-
const [arrow4, setArrow] =
|
|
6118
|
+
const [arrow4, setArrow] = React44__namespace.useState(null);
|
|
6102
6119
|
const arrowSize = useSize(arrow4);
|
|
6103
6120
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
6104
6121
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -6160,7 +6177,7 @@ var PopperContent = React43__namespace.forwardRef(
|
|
|
6160
6177
|
const arrowX = middlewareData.arrow?.x;
|
|
6161
6178
|
const arrowY = middlewareData.arrow?.y;
|
|
6162
6179
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
6163
|
-
const [contentZIndex, setContentZIndex] =
|
|
6180
|
+
const [contentZIndex, setContentZIndex] = React44__namespace.useState();
|
|
6164
6181
|
useLayoutEffect2(() => {
|
|
6165
6182
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
6166
6183
|
}, [content]);
|
|
@@ -6226,7 +6243,7 @@ var OPPOSITE_SIDE = {
|
|
|
6226
6243
|
bottom: "top",
|
|
6227
6244
|
left: "right"
|
|
6228
6245
|
};
|
|
6229
|
-
var PopperArrow =
|
|
6246
|
+
var PopperArrow = React44__namespace.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
6230
6247
|
const { __scopePopper, ...arrowProps } = props;
|
|
6231
6248
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
6232
6249
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -6317,16 +6334,16 @@ var Anchor = PopperAnchor;
|
|
|
6317
6334
|
var Content = PopperContent;
|
|
6318
6335
|
var Arrow2 = PopperArrow;
|
|
6319
6336
|
var PORTAL_NAME = "Portal";
|
|
6320
|
-
var Portal =
|
|
6337
|
+
var Portal = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
6321
6338
|
const { container: containerProp, ...portalProps } = props;
|
|
6322
|
-
const [mounted, setMounted] =
|
|
6339
|
+
const [mounted, setMounted] = React44__namespace.useState(false);
|
|
6323
6340
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6324
6341
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6325
6342
|
return container ? ReactDOM4__namespace.default.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
6326
6343
|
});
|
|
6327
6344
|
Portal.displayName = PORTAL_NAME;
|
|
6328
6345
|
function useStateMachine(initialState, machine) {
|
|
6329
|
-
return
|
|
6346
|
+
return React44__namespace.useReducer((state, event) => {
|
|
6330
6347
|
const nextState = machine[state][event];
|
|
6331
6348
|
return nextState ?? state;
|
|
6332
6349
|
}, initialState);
|
|
@@ -6334,17 +6351,17 @@ function useStateMachine(initialState, machine) {
|
|
|
6334
6351
|
var Presence = (props) => {
|
|
6335
6352
|
const { present, children } = props;
|
|
6336
6353
|
const presence = usePresence(present);
|
|
6337
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
6354
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React44__namespace.Children.only(children);
|
|
6338
6355
|
const ref = useComposedRefs(presence.ref, getElementRef3(child));
|
|
6339
6356
|
const forceMount = typeof children === "function";
|
|
6340
|
-
return forceMount || presence.isPresent ?
|
|
6357
|
+
return forceMount || presence.isPresent ? React44__namespace.cloneElement(child, { ref }) : null;
|
|
6341
6358
|
};
|
|
6342
6359
|
Presence.displayName = "Presence";
|
|
6343
6360
|
function usePresence(present) {
|
|
6344
|
-
const [node, setNode] =
|
|
6345
|
-
const stylesRef =
|
|
6346
|
-
const prevPresentRef =
|
|
6347
|
-
const prevAnimationNameRef =
|
|
6361
|
+
const [node, setNode] = React44__namespace.useState();
|
|
6362
|
+
const stylesRef = React44__namespace.useRef(null);
|
|
6363
|
+
const prevPresentRef = React44__namespace.useRef(present);
|
|
6364
|
+
const prevAnimationNameRef = React44__namespace.useRef("none");
|
|
6348
6365
|
const initialState = present ? "mounted" : "unmounted";
|
|
6349
6366
|
const [state, send] = useStateMachine(initialState, {
|
|
6350
6367
|
mounted: {
|
|
@@ -6359,7 +6376,7 @@ function usePresence(present) {
|
|
|
6359
6376
|
MOUNT: "mounted"
|
|
6360
6377
|
}
|
|
6361
6378
|
});
|
|
6362
|
-
|
|
6379
|
+
React44__namespace.useEffect(() => {
|
|
6363
6380
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
6364
6381
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
6365
6382
|
}, [state]);
|
|
@@ -6425,7 +6442,7 @@ function usePresence(present) {
|
|
|
6425
6442
|
}, [node, send]);
|
|
6426
6443
|
return {
|
|
6427
6444
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
6428
|
-
ref:
|
|
6445
|
+
ref: React44__namespace.useCallback((node2) => {
|
|
6429
6446
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
6430
6447
|
setNode(node2);
|
|
6431
6448
|
}, [])
|
|
@@ -6456,13 +6473,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6456
6473
|
[createCollectionScope]
|
|
6457
6474
|
);
|
|
6458
6475
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
6459
|
-
var RovingFocusGroup =
|
|
6476
|
+
var RovingFocusGroup = React44__namespace.forwardRef(
|
|
6460
6477
|
(props, forwardedRef) => {
|
|
6461
6478
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6462
6479
|
}
|
|
6463
6480
|
);
|
|
6464
6481
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
6465
|
-
var RovingFocusGroupImpl =
|
|
6482
|
+
var RovingFocusGroupImpl = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
6466
6483
|
const {
|
|
6467
6484
|
__scopeRovingFocusGroup,
|
|
6468
6485
|
orientation,
|
|
@@ -6475,7 +6492,7 @@ var RovingFocusGroupImpl = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
6475
6492
|
preventScrollOnEntryFocus = false,
|
|
6476
6493
|
...groupProps
|
|
6477
6494
|
} = props;
|
|
6478
|
-
const ref =
|
|
6495
|
+
const ref = React44__namespace.useRef(null);
|
|
6479
6496
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6480
6497
|
const direction = useDirection(dir);
|
|
6481
6498
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -6484,12 +6501,12 @@ var RovingFocusGroupImpl = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
6484
6501
|
onChange: onCurrentTabStopIdChange,
|
|
6485
6502
|
caller: GROUP_NAME
|
|
6486
6503
|
});
|
|
6487
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
6504
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React44__namespace.useState(false);
|
|
6488
6505
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
6489
6506
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6490
|
-
const isClickFocusRef =
|
|
6491
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
6492
|
-
|
|
6507
|
+
const isClickFocusRef = React44__namespace.useRef(false);
|
|
6508
|
+
const [focusableItemsCount, setFocusableItemsCount] = React44__namespace.useState(0);
|
|
6509
|
+
React44__namespace.useEffect(() => {
|
|
6493
6510
|
const node = ref.current;
|
|
6494
6511
|
if (node) {
|
|
6495
6512
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -6504,16 +6521,16 @@ var RovingFocusGroupImpl = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
6504
6521
|
dir: direction,
|
|
6505
6522
|
loop,
|
|
6506
6523
|
currentTabStopId,
|
|
6507
|
-
onItemFocus:
|
|
6524
|
+
onItemFocus: React44__namespace.useCallback(
|
|
6508
6525
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
6509
6526
|
[setCurrentTabStopId]
|
|
6510
6527
|
),
|
|
6511
|
-
onItemShiftTab:
|
|
6512
|
-
onFocusableItemAdd:
|
|
6528
|
+
onItemShiftTab: React44__namespace.useCallback(() => setIsTabbingBackOut(true), []),
|
|
6529
|
+
onFocusableItemAdd: React44__namespace.useCallback(
|
|
6513
6530
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
6514
6531
|
[]
|
|
6515
6532
|
),
|
|
6516
|
-
onFocusableItemRemove:
|
|
6533
|
+
onFocusableItemRemove: React44__namespace.useCallback(
|
|
6517
6534
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6518
6535
|
[]
|
|
6519
6536
|
),
|
|
@@ -6553,7 +6570,7 @@ var RovingFocusGroupImpl = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
6553
6570
|
);
|
|
6554
6571
|
});
|
|
6555
6572
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
6556
|
-
var RovingFocusGroupItem =
|
|
6573
|
+
var RovingFocusGroupItem = React44__namespace.forwardRef(
|
|
6557
6574
|
(props, forwardedRef) => {
|
|
6558
6575
|
const {
|
|
6559
6576
|
__scopeRovingFocusGroup,
|
|
@@ -6569,7 +6586,7 @@ var RovingFocusGroupItem = React43__namespace.forwardRef(
|
|
|
6569
6586
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
6570
6587
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6571
6588
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
6572
|
-
|
|
6589
|
+
React44__namespace.useEffect(() => {
|
|
6573
6590
|
if (focusable) {
|
|
6574
6591
|
onFocusableItemAdd();
|
|
6575
6592
|
return () => onFocusableItemRemove();
|
|
@@ -6826,7 +6843,7 @@ function assignRef(ref, value) {
|
|
|
6826
6843
|
return ref;
|
|
6827
6844
|
}
|
|
6828
6845
|
function useCallbackRef2(initialValue, callback) {
|
|
6829
|
-
var ref =
|
|
6846
|
+
var ref = React44.useState(function() {
|
|
6830
6847
|
return {
|
|
6831
6848
|
// value
|
|
6832
6849
|
value: initialValue,
|
|
@@ -6850,7 +6867,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6850
6867
|
ref.callback = callback;
|
|
6851
6868
|
return ref.facade;
|
|
6852
6869
|
}
|
|
6853
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6870
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React44__namespace.useLayoutEffect : React44__namespace.useEffect;
|
|
6854
6871
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6855
6872
|
function useMergeRefs(refs, defaultValue) {
|
|
6856
6873
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -6974,7 +6991,7 @@ var SideCar = function(_a) {
|
|
|
6974
6991
|
if (!Target) {
|
|
6975
6992
|
throw new Error("Sidecar medium not found");
|
|
6976
6993
|
}
|
|
6977
|
-
return
|
|
6994
|
+
return React44__namespace.createElement(Target, __assign({}, rest));
|
|
6978
6995
|
};
|
|
6979
6996
|
SideCar.isSideCarExport = true;
|
|
6980
6997
|
function exportSidecar(medium, exported) {
|
|
@@ -6989,9 +7006,9 @@ var effectCar = createSidecarMedium();
|
|
|
6989
7006
|
var nothing = function() {
|
|
6990
7007
|
return;
|
|
6991
7008
|
};
|
|
6992
|
-
var RemoveScroll =
|
|
6993
|
-
var ref =
|
|
6994
|
-
var _a =
|
|
7009
|
+
var RemoveScroll = React44__namespace.forwardRef(function(props, parentRef) {
|
|
7010
|
+
var ref = React44__namespace.useRef(null);
|
|
7011
|
+
var _a = React44__namespace.useState({
|
|
6995
7012
|
onScrollCapture: nothing,
|
|
6996
7013
|
onWheelCapture: nothing,
|
|
6997
7014
|
onTouchMoveCapture: nothing
|
|
@@ -7000,11 +7017,11 @@ var RemoveScroll = React43__namespace.forwardRef(function(props, parentRef) {
|
|
|
7000
7017
|
var SideCar2 = sideCar;
|
|
7001
7018
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
7002
7019
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
7003
|
-
return
|
|
7004
|
-
|
|
7020
|
+
return React44__namespace.createElement(
|
|
7021
|
+
React44__namespace.Fragment,
|
|
7005
7022
|
null,
|
|
7006
|
-
enabled &&
|
|
7007
|
-
forwardProps ?
|
|
7023
|
+
enabled && React44__namespace.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
7024
|
+
forwardProps ? React44__namespace.cloneElement(React44__namespace.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React44__namespace.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
7008
7025
|
);
|
|
7009
7026
|
});
|
|
7010
7027
|
RemoveScroll.defaultProps = {
|
|
@@ -7073,7 +7090,7 @@ var stylesheetSingleton = function() {
|
|
|
7073
7090
|
var styleHookSingleton = function() {
|
|
7074
7091
|
var sheet = stylesheetSingleton();
|
|
7075
7092
|
return function(styles, isDynamic) {
|
|
7076
|
-
|
|
7093
|
+
React44__namespace.useEffect(function() {
|
|
7077
7094
|
sheet.add(styles);
|
|
7078
7095
|
return function() {
|
|
7079
7096
|
sheet.remove();
|
|
@@ -7147,7 +7164,7 @@ var getCurrentUseCounter = function() {
|
|
|
7147
7164
|
return isFinite(counter) ? counter : 0;
|
|
7148
7165
|
};
|
|
7149
7166
|
var useLockAttribute = function() {
|
|
7150
|
-
|
|
7167
|
+
React44__namespace.useEffect(function() {
|
|
7151
7168
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7152
7169
|
return function() {
|
|
7153
7170
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7162,10 +7179,10 @@ var useLockAttribute = function() {
|
|
|
7162
7179
|
var RemoveScrollBar = function(_a) {
|
|
7163
7180
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7164
7181
|
useLockAttribute();
|
|
7165
|
-
var gap =
|
|
7182
|
+
var gap = React44__namespace.useMemo(function() {
|
|
7166
7183
|
return getGapWidth(gapMode);
|
|
7167
7184
|
}, [gapMode]);
|
|
7168
|
-
return
|
|
7185
|
+
return React44__namespace.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7169
7186
|
};
|
|
7170
7187
|
|
|
7171
7188
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.2_react@19.2.2/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
@@ -7306,16 +7323,16 @@ var generateStyle = function(id) {
|
|
|
7306
7323
|
var idCounter = 0;
|
|
7307
7324
|
var lockStack = [];
|
|
7308
7325
|
function RemoveScrollSideCar(props) {
|
|
7309
|
-
var shouldPreventQueue =
|
|
7310
|
-
var touchStartRef =
|
|
7311
|
-
var activeAxis =
|
|
7312
|
-
var id =
|
|
7313
|
-
var Style2 =
|
|
7314
|
-
var lastProps =
|
|
7315
|
-
|
|
7326
|
+
var shouldPreventQueue = React44__namespace.useRef([]);
|
|
7327
|
+
var touchStartRef = React44__namespace.useRef([0, 0]);
|
|
7328
|
+
var activeAxis = React44__namespace.useRef();
|
|
7329
|
+
var id = React44__namespace.useState(idCounter++)[0];
|
|
7330
|
+
var Style2 = React44__namespace.useState(styleSingleton)[0];
|
|
7331
|
+
var lastProps = React44__namespace.useRef(props);
|
|
7332
|
+
React44__namespace.useEffect(function() {
|
|
7316
7333
|
lastProps.current = props;
|
|
7317
7334
|
}, [props]);
|
|
7318
|
-
|
|
7335
|
+
React44__namespace.useEffect(function() {
|
|
7319
7336
|
if (props.inert) {
|
|
7320
7337
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7321
7338
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -7331,7 +7348,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7331
7348
|
}
|
|
7332
7349
|
return;
|
|
7333
7350
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7334
|
-
var shouldCancelEvent =
|
|
7351
|
+
var shouldCancelEvent = React44__namespace.useCallback(function(event, parent) {
|
|
7335
7352
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7336
7353
|
return !lastProps.current.allowPinchZoom;
|
|
7337
7354
|
}
|
|
@@ -7367,7 +7384,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7367
7384
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7368
7385
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
7369
7386
|
}, []);
|
|
7370
|
-
var shouldPrevent =
|
|
7387
|
+
var shouldPrevent = React44__namespace.useCallback(function(_event) {
|
|
7371
7388
|
var event = _event;
|
|
7372
7389
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7373
7390
|
return;
|
|
@@ -7394,7 +7411,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7394
7411
|
}
|
|
7395
7412
|
}
|
|
7396
7413
|
}, []);
|
|
7397
|
-
var shouldCancel =
|
|
7414
|
+
var shouldCancel = React44__namespace.useCallback(function(name, delta, target, should) {
|
|
7398
7415
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7399
7416
|
shouldPreventQueue.current.push(event);
|
|
7400
7417
|
setTimeout(function() {
|
|
@@ -7403,17 +7420,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7403
7420
|
});
|
|
7404
7421
|
}, 1);
|
|
7405
7422
|
}, []);
|
|
7406
|
-
var scrollTouchStart =
|
|
7423
|
+
var scrollTouchStart = React44__namespace.useCallback(function(event) {
|
|
7407
7424
|
touchStartRef.current = getTouchXY(event);
|
|
7408
7425
|
activeAxis.current = void 0;
|
|
7409
7426
|
}, []);
|
|
7410
|
-
var scrollWheel =
|
|
7427
|
+
var scrollWheel = React44__namespace.useCallback(function(event) {
|
|
7411
7428
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7412
7429
|
}, []);
|
|
7413
|
-
var scrollTouchMove =
|
|
7430
|
+
var scrollTouchMove = React44__namespace.useCallback(function(event) {
|
|
7414
7431
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7415
7432
|
}, []);
|
|
7416
|
-
|
|
7433
|
+
React44__namespace.useEffect(function() {
|
|
7417
7434
|
lockStack.push(Style2);
|
|
7418
7435
|
props.setCallbacks({
|
|
7419
7436
|
onScrollCapture: scrollWheel,
|
|
@@ -7433,11 +7450,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7433
7450
|
};
|
|
7434
7451
|
}, []);
|
|
7435
7452
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7436
|
-
return
|
|
7437
|
-
|
|
7453
|
+
return React44__namespace.createElement(
|
|
7454
|
+
React44__namespace.Fragment,
|
|
7438
7455
|
null,
|
|
7439
|
-
inert ?
|
|
7440
|
-
removeScrollBar ?
|
|
7456
|
+
inert ? React44__namespace.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7457
|
+
removeScrollBar ? React44__namespace.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7441
7458
|
);
|
|
7442
7459
|
}
|
|
7443
7460
|
function getOutermostShadowParent(node) {
|
|
@@ -7456,8 +7473,8 @@ function getOutermostShadowParent(node) {
|
|
|
7456
7473
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7457
7474
|
|
|
7458
7475
|
// ../../node_modules/.pnpm/react-remove-scroll@2.7.1_@types+react@19.2.2_react@19.2.2/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
7459
|
-
var ReactRemoveScroll =
|
|
7460
|
-
return
|
|
7476
|
+
var ReactRemoveScroll = React44__namespace.forwardRef(function(props, ref) {
|
|
7477
|
+
return React44__namespace.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7461
7478
|
});
|
|
7462
7479
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7463
7480
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7487,11 +7504,11 @@ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
|
7487
7504
|
var Menu = (props) => {
|
|
7488
7505
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
7489
7506
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7490
|
-
const [content, setContent] =
|
|
7491
|
-
const isUsingKeyboardRef =
|
|
7507
|
+
const [content, setContent] = React44__namespace.useState(null);
|
|
7508
|
+
const isUsingKeyboardRef = React44__namespace.useRef(false);
|
|
7492
7509
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
7493
7510
|
const direction = useDirection(dir);
|
|
7494
|
-
|
|
7511
|
+
React44__namespace.useEffect(() => {
|
|
7495
7512
|
const handleKeyDown = () => {
|
|
7496
7513
|
isUsingKeyboardRef.current = true;
|
|
7497
7514
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
@@ -7517,7 +7534,7 @@ var Menu = (props) => {
|
|
|
7517
7534
|
MenuRootProvider,
|
|
7518
7535
|
{
|
|
7519
7536
|
scope: __scopeMenu,
|
|
7520
|
-
onClose:
|
|
7537
|
+
onClose: React44__namespace.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
7521
7538
|
isUsingKeyboardRef,
|
|
7522
7539
|
dir: direction,
|
|
7523
7540
|
modal,
|
|
@@ -7529,7 +7546,7 @@ var Menu = (props) => {
|
|
|
7529
7546
|
};
|
|
7530
7547
|
Menu.displayName = MENU_NAME;
|
|
7531
7548
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
7532
|
-
var MenuAnchor =
|
|
7549
|
+
var MenuAnchor = React44__namespace.forwardRef(
|
|
7533
7550
|
(props, forwardedRef) => {
|
|
7534
7551
|
const { __scopeMenu, ...anchorProps } = props;
|
|
7535
7552
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -7549,7 +7566,7 @@ var MenuPortal = (props) => {
|
|
|
7549
7566
|
MenuPortal.displayName = PORTAL_NAME2;
|
|
7550
7567
|
var CONTENT_NAME2 = "MenuContent";
|
|
7551
7568
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
7552
|
-
var MenuContent =
|
|
7569
|
+
var MenuContent = React44__namespace.forwardRef(
|
|
7553
7570
|
(props, forwardedRef) => {
|
|
7554
7571
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7555
7572
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7558,12 +7575,12 @@ var MenuContent = React43__namespace.forwardRef(
|
|
|
7558
7575
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
7559
7576
|
}
|
|
7560
7577
|
);
|
|
7561
|
-
var MenuRootContentModal =
|
|
7578
|
+
var MenuRootContentModal = React44__namespace.forwardRef(
|
|
7562
7579
|
(props, forwardedRef) => {
|
|
7563
7580
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7564
|
-
const ref =
|
|
7581
|
+
const ref = React44__namespace.useRef(null);
|
|
7565
7582
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7566
|
-
|
|
7583
|
+
React44__namespace.useEffect(() => {
|
|
7567
7584
|
const content = ref.current;
|
|
7568
7585
|
if (content) return hideOthers(content);
|
|
7569
7586
|
}, []);
|
|
@@ -7585,7 +7602,7 @@ var MenuRootContentModal = React43__namespace.forwardRef(
|
|
|
7585
7602
|
);
|
|
7586
7603
|
}
|
|
7587
7604
|
);
|
|
7588
|
-
var MenuRootContentNonModal =
|
|
7605
|
+
var MenuRootContentNonModal = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
7589
7606
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7590
7607
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
7591
7608
|
MenuContentImpl,
|
|
@@ -7600,7 +7617,7 @@ var MenuRootContentNonModal = React43__namespace.forwardRef((props, forwardedRef
|
|
|
7600
7617
|
);
|
|
7601
7618
|
});
|
|
7602
7619
|
var Slot2 = createSlot2("MenuContent.ScrollLock");
|
|
7603
|
-
var MenuContentImpl =
|
|
7620
|
+
var MenuContentImpl = React44__namespace.forwardRef(
|
|
7604
7621
|
(props, forwardedRef) => {
|
|
7605
7622
|
const {
|
|
7606
7623
|
__scopeMenu,
|
|
@@ -7623,16 +7640,16 @@ var MenuContentImpl = React43__namespace.forwardRef(
|
|
|
7623
7640
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7624
7641
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7625
7642
|
const getItems = useCollection2(__scopeMenu);
|
|
7626
|
-
const [currentItemId, setCurrentItemId] =
|
|
7627
|
-
const contentRef =
|
|
7643
|
+
const [currentItemId, setCurrentItemId] = React44__namespace.useState(null);
|
|
7644
|
+
const contentRef = React44__namespace.useRef(null);
|
|
7628
7645
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
7629
|
-
const timerRef =
|
|
7630
|
-
const searchRef =
|
|
7631
|
-
const pointerGraceTimerRef =
|
|
7632
|
-
const pointerGraceIntentRef =
|
|
7633
|
-
const pointerDirRef =
|
|
7634
|
-
const lastPointerXRef =
|
|
7635
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
7646
|
+
const timerRef = React44__namespace.useRef(0);
|
|
7647
|
+
const searchRef = React44__namespace.useRef("");
|
|
7648
|
+
const pointerGraceTimerRef = React44__namespace.useRef(0);
|
|
7649
|
+
const pointerGraceIntentRef = React44__namespace.useRef(null);
|
|
7650
|
+
const pointerDirRef = React44__namespace.useRef("right");
|
|
7651
|
+
const lastPointerXRef = React44__namespace.useRef(0);
|
|
7652
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React44__namespace.Fragment;
|
|
7636
7653
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
7637
7654
|
const handleTypeaheadSearch = (key) => {
|
|
7638
7655
|
const search = searchRef.current + key;
|
|
@@ -7651,11 +7668,11 @@ var MenuContentImpl = React43__namespace.forwardRef(
|
|
|
7651
7668
|
setTimeout(() => newItem.focus());
|
|
7652
7669
|
}
|
|
7653
7670
|
};
|
|
7654
|
-
|
|
7671
|
+
React44__namespace.useEffect(() => {
|
|
7655
7672
|
return () => window.clearTimeout(timerRef.current);
|
|
7656
7673
|
}, []);
|
|
7657
7674
|
useFocusGuards();
|
|
7658
|
-
const isPointerMovingToSubmenu =
|
|
7675
|
+
const isPointerMovingToSubmenu = React44__namespace.useCallback((event) => {
|
|
7659
7676
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
7660
7677
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
7661
7678
|
}, []);
|
|
@@ -7664,13 +7681,13 @@ var MenuContentImpl = React43__namespace.forwardRef(
|
|
|
7664
7681
|
{
|
|
7665
7682
|
scope: __scopeMenu,
|
|
7666
7683
|
searchRef,
|
|
7667
|
-
onItemEnter:
|
|
7684
|
+
onItemEnter: React44__namespace.useCallback(
|
|
7668
7685
|
(event) => {
|
|
7669
7686
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7670
7687
|
},
|
|
7671
7688
|
[isPointerMovingToSubmenu]
|
|
7672
7689
|
),
|
|
7673
|
-
onItemLeave:
|
|
7690
|
+
onItemLeave: React44__namespace.useCallback(
|
|
7674
7691
|
(event) => {
|
|
7675
7692
|
if (isPointerMovingToSubmenu(event)) return;
|
|
7676
7693
|
contentRef.current?.focus();
|
|
@@ -7678,14 +7695,14 @@ var MenuContentImpl = React43__namespace.forwardRef(
|
|
|
7678
7695
|
},
|
|
7679
7696
|
[isPointerMovingToSubmenu]
|
|
7680
7697
|
),
|
|
7681
|
-
onTriggerLeave:
|
|
7698
|
+
onTriggerLeave: React44__namespace.useCallback(
|
|
7682
7699
|
(event) => {
|
|
7683
7700
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7684
7701
|
},
|
|
7685
7702
|
[isPointerMovingToSubmenu]
|
|
7686
7703
|
),
|
|
7687
7704
|
pointerGraceTimerRef,
|
|
7688
|
-
onPointerGraceIntentChange:
|
|
7705
|
+
onPointerGraceIntentChange: React44__namespace.useCallback((intent) => {
|
|
7689
7706
|
pointerGraceIntentRef.current = intent;
|
|
7690
7707
|
}, []),
|
|
7691
7708
|
children: /* @__PURE__ */ jsxRuntime.jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7784,7 +7801,7 @@ var MenuContentImpl = React43__namespace.forwardRef(
|
|
|
7784
7801
|
);
|
|
7785
7802
|
MenuContent.displayName = CONTENT_NAME2;
|
|
7786
7803
|
var GROUP_NAME2 = "MenuGroup";
|
|
7787
|
-
var MenuGroup =
|
|
7804
|
+
var MenuGroup = React44__namespace.forwardRef(
|
|
7788
7805
|
(props, forwardedRef) => {
|
|
7789
7806
|
const { __scopeMenu, ...groupProps } = props;
|
|
7790
7807
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -7792,7 +7809,7 @@ var MenuGroup = React43__namespace.forwardRef(
|
|
|
7792
7809
|
);
|
|
7793
7810
|
MenuGroup.displayName = GROUP_NAME2;
|
|
7794
7811
|
var LABEL_NAME = "MenuLabel";
|
|
7795
|
-
var MenuLabel =
|
|
7812
|
+
var MenuLabel = React44__namespace.forwardRef(
|
|
7796
7813
|
(props, forwardedRef) => {
|
|
7797
7814
|
const { __scopeMenu, ...labelProps } = props;
|
|
7798
7815
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -7801,14 +7818,14 @@ var MenuLabel = React43__namespace.forwardRef(
|
|
|
7801
7818
|
MenuLabel.displayName = LABEL_NAME;
|
|
7802
7819
|
var ITEM_NAME2 = "MenuItem";
|
|
7803
7820
|
var ITEM_SELECT = "menu.itemSelect";
|
|
7804
|
-
var MenuItem =
|
|
7821
|
+
var MenuItem = React44__namespace.forwardRef(
|
|
7805
7822
|
(props, forwardedRef) => {
|
|
7806
7823
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
7807
|
-
const ref =
|
|
7824
|
+
const ref = React44__namespace.useRef(null);
|
|
7808
7825
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
7809
7826
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
7810
7827
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7811
|
-
const isPointerDownRef =
|
|
7828
|
+
const isPointerDownRef = React44__namespace.useRef(false);
|
|
7812
7829
|
const handleSelect = () => {
|
|
7813
7830
|
const menuItem = ref.current;
|
|
7814
7831
|
if (!disabled && menuItem) {
|
|
@@ -7849,16 +7866,16 @@ var MenuItem = React43__namespace.forwardRef(
|
|
|
7849
7866
|
}
|
|
7850
7867
|
);
|
|
7851
7868
|
MenuItem.displayName = ITEM_NAME2;
|
|
7852
|
-
var MenuItemImpl =
|
|
7869
|
+
var MenuItemImpl = React44__namespace.forwardRef(
|
|
7853
7870
|
(props, forwardedRef) => {
|
|
7854
7871
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
7855
7872
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
7856
7873
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7857
|
-
const ref =
|
|
7874
|
+
const ref = React44__namespace.useRef(null);
|
|
7858
7875
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7859
|
-
const [isFocused, setIsFocused] =
|
|
7860
|
-
const [textContent, setTextContent] =
|
|
7861
|
-
|
|
7876
|
+
const [isFocused, setIsFocused] = React44__namespace.useState(false);
|
|
7877
|
+
const [textContent, setTextContent] = React44__namespace.useState("");
|
|
7878
|
+
React44__namespace.useEffect(() => {
|
|
7862
7879
|
const menuItem = ref.current;
|
|
7863
7880
|
if (menuItem) {
|
|
7864
7881
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
@@ -7906,7 +7923,7 @@ var MenuItemImpl = React43__namespace.forwardRef(
|
|
|
7906
7923
|
}
|
|
7907
7924
|
);
|
|
7908
7925
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
7909
|
-
var MenuCheckboxItem =
|
|
7926
|
+
var MenuCheckboxItem = React44__namespace.forwardRef(
|
|
7910
7927
|
(props, forwardedRef) => {
|
|
7911
7928
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
7912
7929
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -7933,7 +7950,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
7933
7950
|
{ value: void 0, onValueChange: () => {
|
|
7934
7951
|
} }
|
|
7935
7952
|
);
|
|
7936
|
-
var MenuRadioGroup =
|
|
7953
|
+
var MenuRadioGroup = React44__namespace.forwardRef(
|
|
7937
7954
|
(props, forwardedRef) => {
|
|
7938
7955
|
const { value, onValueChange, ...groupProps } = props;
|
|
7939
7956
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -7942,7 +7959,7 @@ var MenuRadioGroup = React43__namespace.forwardRef(
|
|
|
7942
7959
|
);
|
|
7943
7960
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7944
7961
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
7945
|
-
var MenuRadioItem =
|
|
7962
|
+
var MenuRadioItem = React44__namespace.forwardRef(
|
|
7946
7963
|
(props, forwardedRef) => {
|
|
7947
7964
|
const { value, ...radioItemProps } = props;
|
|
7948
7965
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -7970,7 +7987,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
7970
7987
|
ITEM_INDICATOR_NAME,
|
|
7971
7988
|
{ checked: false }
|
|
7972
7989
|
);
|
|
7973
|
-
var MenuItemIndicator =
|
|
7990
|
+
var MenuItemIndicator = React44__namespace.forwardRef(
|
|
7974
7991
|
(props, forwardedRef) => {
|
|
7975
7992
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
7976
7993
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -7992,7 +8009,7 @@ var MenuItemIndicator = React43__namespace.forwardRef(
|
|
|
7992
8009
|
);
|
|
7993
8010
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
7994
8011
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
7995
|
-
var MenuSeparator =
|
|
8012
|
+
var MenuSeparator = React44__namespace.forwardRef(
|
|
7996
8013
|
(props, forwardedRef) => {
|
|
7997
8014
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7998
8015
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8008,7 +8025,7 @@ var MenuSeparator = React43__namespace.forwardRef(
|
|
|
8008
8025
|
);
|
|
8009
8026
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
8010
8027
|
var ARROW_NAME2 = "MenuArrow";
|
|
8011
|
-
var MenuArrow =
|
|
8028
|
+
var MenuArrow = React44__namespace.forwardRef(
|
|
8012
8029
|
(props, forwardedRef) => {
|
|
8013
8030
|
const { __scopeMenu, ...arrowProps } = props;
|
|
8014
8031
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -8022,10 +8039,10 @@ var MenuSub = (props) => {
|
|
|
8022
8039
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
8023
8040
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
8024
8041
|
const popperScope = usePopperScope(__scopeMenu);
|
|
8025
|
-
const [trigger, setTrigger] =
|
|
8026
|
-
const [content, setContent] =
|
|
8042
|
+
const [trigger, setTrigger] = React44__namespace.useState(null);
|
|
8043
|
+
const [content, setContent] = React44__namespace.useState(null);
|
|
8027
8044
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
8028
|
-
|
|
8045
|
+
React44__namespace.useEffect(() => {
|
|
8029
8046
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
8030
8047
|
return () => handleOpenChange(false);
|
|
8031
8048
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
@@ -8053,21 +8070,21 @@ var MenuSub = (props) => {
|
|
|
8053
8070
|
};
|
|
8054
8071
|
MenuSub.displayName = SUB_NAME;
|
|
8055
8072
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
8056
|
-
var MenuSubTrigger =
|
|
8073
|
+
var MenuSubTrigger = React44__namespace.forwardRef(
|
|
8057
8074
|
(props, forwardedRef) => {
|
|
8058
8075
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8059
8076
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8060
8077
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8061
8078
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8062
|
-
const openTimerRef =
|
|
8079
|
+
const openTimerRef = React44__namespace.useRef(null);
|
|
8063
8080
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
8064
8081
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
8065
|
-
const clearOpenTimer =
|
|
8082
|
+
const clearOpenTimer = React44__namespace.useCallback(() => {
|
|
8066
8083
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
8067
8084
|
openTimerRef.current = null;
|
|
8068
8085
|
}, []);
|
|
8069
|
-
|
|
8070
|
-
|
|
8086
|
+
React44__namespace.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
8087
|
+
React44__namespace.useEffect(() => {
|
|
8071
8088
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
8072
8089
|
return () => {
|
|
8073
8090
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -8154,14 +8171,14 @@ var MenuSubTrigger = React43__namespace.forwardRef(
|
|
|
8154
8171
|
);
|
|
8155
8172
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
8156
8173
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
8157
|
-
var MenuSubContent =
|
|
8174
|
+
var MenuSubContent = React44__namespace.forwardRef(
|
|
8158
8175
|
(props, forwardedRef) => {
|
|
8159
8176
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8160
8177
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
8161
8178
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8162
8179
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8163
8180
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
8164
|
-
const ref =
|
|
8181
|
+
const ref = React44__namespace.useRef(null);
|
|
8165
8182
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8166
8183
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
8167
8184
|
MenuContentImpl,
|
|
@@ -8290,7 +8307,7 @@ var DropdownMenu = (props) => {
|
|
|
8290
8307
|
modal = true
|
|
8291
8308
|
} = props;
|
|
8292
8309
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8293
|
-
const triggerRef =
|
|
8310
|
+
const triggerRef = React44__namespace.useRef(null);
|
|
8294
8311
|
const [open, setOpen] = useControllableState({
|
|
8295
8312
|
prop: openProp,
|
|
8296
8313
|
defaultProp: defaultOpen ?? false,
|
|
@@ -8306,7 +8323,7 @@ var DropdownMenu = (props) => {
|
|
|
8306
8323
|
contentId: useId(),
|
|
8307
8324
|
open,
|
|
8308
8325
|
onOpenChange: setOpen,
|
|
8309
|
-
onOpenToggle:
|
|
8326
|
+
onOpenToggle: React44__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8310
8327
|
modal,
|
|
8311
8328
|
children: /* @__PURE__ */ jsxRuntime.jsx(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
8312
8329
|
}
|
|
@@ -8314,7 +8331,7 @@ var DropdownMenu = (props) => {
|
|
|
8314
8331
|
};
|
|
8315
8332
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
8316
8333
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8317
|
-
var DropdownMenuTrigger =
|
|
8334
|
+
var DropdownMenuTrigger = React44__namespace.forwardRef(
|
|
8318
8335
|
(props, forwardedRef) => {
|
|
8319
8336
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8320
8337
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -8357,12 +8374,12 @@ var DropdownMenuPortal = (props) => {
|
|
|
8357
8374
|
};
|
|
8358
8375
|
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
8359
8376
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
8360
|
-
var DropdownMenuContent =
|
|
8377
|
+
var DropdownMenuContent = React44__namespace.forwardRef(
|
|
8361
8378
|
(props, forwardedRef) => {
|
|
8362
8379
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8363
8380
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
8364
8381
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8365
|
-
const hasInteractedOutsideRef =
|
|
8382
|
+
const hasInteractedOutsideRef = React44__namespace.useRef(false);
|
|
8366
8383
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8367
8384
|
Content2,
|
|
8368
8385
|
{
|
|
@@ -8399,7 +8416,7 @@ var DropdownMenuContent = React43__namespace.forwardRef(
|
|
|
8399
8416
|
);
|
|
8400
8417
|
DropdownMenuContent.displayName = CONTENT_NAME3;
|
|
8401
8418
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
8402
|
-
var DropdownMenuGroup =
|
|
8419
|
+
var DropdownMenuGroup = React44__namespace.forwardRef(
|
|
8403
8420
|
(props, forwardedRef) => {
|
|
8404
8421
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
8405
8422
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8408,7 +8425,7 @@ var DropdownMenuGroup = React43__namespace.forwardRef(
|
|
|
8408
8425
|
);
|
|
8409
8426
|
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
8410
8427
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
8411
|
-
var DropdownMenuLabel =
|
|
8428
|
+
var DropdownMenuLabel = React44__namespace.forwardRef(
|
|
8412
8429
|
(props, forwardedRef) => {
|
|
8413
8430
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8414
8431
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8417,7 +8434,7 @@ var DropdownMenuLabel = React43__namespace.forwardRef(
|
|
|
8417
8434
|
);
|
|
8418
8435
|
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
8419
8436
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
8420
|
-
var DropdownMenuItem =
|
|
8437
|
+
var DropdownMenuItem = React44__namespace.forwardRef(
|
|
8421
8438
|
(props, forwardedRef) => {
|
|
8422
8439
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
8423
8440
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8426,42 +8443,42 @@ var DropdownMenuItem = React43__namespace.forwardRef(
|
|
|
8426
8443
|
);
|
|
8427
8444
|
DropdownMenuItem.displayName = ITEM_NAME3;
|
|
8428
8445
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
8429
|
-
var DropdownMenuCheckboxItem =
|
|
8446
|
+
var DropdownMenuCheckboxItem = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8430
8447
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
8431
8448
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8432
8449
|
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
8433
8450
|
});
|
|
8434
8451
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
8435
8452
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
8436
|
-
var DropdownMenuRadioGroup =
|
|
8453
|
+
var DropdownMenuRadioGroup = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8437
8454
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
8438
8455
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8439
8456
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
8440
8457
|
});
|
|
8441
8458
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
8442
8459
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
8443
|
-
var DropdownMenuRadioItem =
|
|
8460
|
+
var DropdownMenuRadioItem = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8444
8461
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
8445
8462
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8446
8463
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
8447
8464
|
});
|
|
8448
8465
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
8449
8466
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
8450
|
-
var DropdownMenuItemIndicator =
|
|
8467
|
+
var DropdownMenuItemIndicator = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8451
8468
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
8452
8469
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8453
8470
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
8454
8471
|
});
|
|
8455
8472
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
8456
8473
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
8457
|
-
var DropdownMenuSeparator =
|
|
8474
|
+
var DropdownMenuSeparator = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8458
8475
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
8459
8476
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8460
8477
|
return /* @__PURE__ */ jsxRuntime.jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
8461
8478
|
});
|
|
8462
8479
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
8463
8480
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
8464
|
-
var DropdownMenuArrow =
|
|
8481
|
+
var DropdownMenuArrow = React44__namespace.forwardRef(
|
|
8465
8482
|
(props, forwardedRef) => {
|
|
8466
8483
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
8467
8484
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8481,14 +8498,14 @@ var DropdownMenuSub = (props) => {
|
|
|
8481
8498
|
return /* @__PURE__ */ jsxRuntime.jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
8482
8499
|
};
|
|
8483
8500
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
8484
|
-
var DropdownMenuSubTrigger =
|
|
8501
|
+
var DropdownMenuSubTrigger = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8485
8502
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
8486
8503
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8487
8504
|
return /* @__PURE__ */ jsxRuntime.jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
8488
8505
|
});
|
|
8489
8506
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
8490
8507
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
8491
|
-
var DropdownMenuSubContent =
|
|
8508
|
+
var DropdownMenuSubContent = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
8492
8509
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
8493
8510
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8494
8511
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -8548,7 +8565,7 @@ var defaultAttributes = {
|
|
|
8548
8565
|
};
|
|
8549
8566
|
|
|
8550
8567
|
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/Icon.js
|
|
8551
|
-
var Icon =
|
|
8568
|
+
var Icon = React44.forwardRef(
|
|
8552
8569
|
({
|
|
8553
8570
|
color = "currentColor",
|
|
8554
8571
|
size: size4 = 24,
|
|
@@ -8559,7 +8576,7 @@ var Icon = React43.forwardRef(
|
|
|
8559
8576
|
iconNode,
|
|
8560
8577
|
...rest
|
|
8561
8578
|
}, ref) => {
|
|
8562
|
-
return
|
|
8579
|
+
return React44.createElement(
|
|
8563
8580
|
"svg",
|
|
8564
8581
|
{
|
|
8565
8582
|
ref,
|
|
@@ -8572,7 +8589,7 @@ var Icon = React43.forwardRef(
|
|
|
8572
8589
|
...rest
|
|
8573
8590
|
},
|
|
8574
8591
|
[
|
|
8575
|
-
...iconNode.map(([tag, attrs]) =>
|
|
8592
|
+
...iconNode.map(([tag, attrs]) => React44.createElement(tag, attrs)),
|
|
8576
8593
|
...Array.isArray(children) ? children : [children]
|
|
8577
8594
|
]
|
|
8578
8595
|
);
|
|
@@ -8581,8 +8598,8 @@ var Icon = React43.forwardRef(
|
|
|
8581
8598
|
|
|
8582
8599
|
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
8583
8600
|
var createLucideIcon = (iconName, iconNode) => {
|
|
8584
|
-
const Component =
|
|
8585
|
-
({ className, ...props }, ref) =>
|
|
8601
|
+
const Component = React44.forwardRef(
|
|
8602
|
+
({ className, ...props }, ref) => React44.createElement(Icon, {
|
|
8586
8603
|
ref,
|
|
8587
8604
|
iconNode,
|
|
8588
8605
|
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
@@ -8617,17 +8634,17 @@ var Circle = createLucideIcon("Circle", __iconNode5);
|
|
|
8617
8634
|
function DropdownMenu2({
|
|
8618
8635
|
...props
|
|
8619
8636
|
}) {
|
|
8620
|
-
return /* @__PURE__ */
|
|
8637
|
+
return /* @__PURE__ */ React44__namespace.createElement(Root23, { "data-slot": "dropdown-menu", ...props });
|
|
8621
8638
|
}
|
|
8622
8639
|
function DropdownMenuPortal2({
|
|
8623
8640
|
...props
|
|
8624
8641
|
}) {
|
|
8625
|
-
return /* @__PURE__ */
|
|
8642
|
+
return /* @__PURE__ */ React44__namespace.createElement(Portal22, { "data-slot": "dropdown-menu-portal", ...props });
|
|
8626
8643
|
}
|
|
8627
8644
|
function DropdownMenuTrigger2({
|
|
8628
8645
|
...props
|
|
8629
8646
|
}) {
|
|
8630
|
-
return /* @__PURE__ */
|
|
8647
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8631
8648
|
Trigger,
|
|
8632
8649
|
{
|
|
8633
8650
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -8640,7 +8657,7 @@ function DropdownMenuContent2({
|
|
|
8640
8657
|
sideOffset = 4,
|
|
8641
8658
|
...props
|
|
8642
8659
|
}) {
|
|
8643
|
-
return /* @__PURE__ */
|
|
8660
|
+
return /* @__PURE__ */ React44__namespace.createElement(Portal22, null, /* @__PURE__ */ React44__namespace.createElement(
|
|
8644
8661
|
Content22,
|
|
8645
8662
|
{
|
|
8646
8663
|
"data-slot": "dropdown-menu-content",
|
|
@@ -8657,30 +8674,30 @@ function DropdownMenuClose({
|
|
|
8657
8674
|
className,
|
|
8658
8675
|
...props
|
|
8659
8676
|
}) {
|
|
8660
|
-
return /* @__PURE__ */
|
|
8677
|
+
return /* @__PURE__ */ React44__namespace.createElement(Item22, { "data-slot": "dropdown-menu-close", className: "hidden", ...props });
|
|
8661
8678
|
}
|
|
8662
8679
|
function DropdownMenuGroup2({
|
|
8663
8680
|
...props
|
|
8664
8681
|
}) {
|
|
8665
|
-
return /* @__PURE__ */
|
|
8682
|
+
return /* @__PURE__ */ React44__namespace.createElement(Group2, { "data-slot": "dropdown-menu-group", ...props });
|
|
8666
8683
|
}
|
|
8667
8684
|
function ConfirmationDropdownMenuItem({
|
|
8668
8685
|
...props
|
|
8669
8686
|
}) {
|
|
8670
8687
|
const { onClick: originalOnClick, ...rest } = props;
|
|
8671
|
-
const [isConfirming, setIsConfirming] =
|
|
8672
|
-
return !isConfirming ? /* @__PURE__ */
|
|
8688
|
+
const [isConfirming, setIsConfirming] = React44__namespace.useState(false);
|
|
8689
|
+
return !isConfirming ? /* @__PURE__ */ React44__namespace.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8673
8690
|
setIsConfirming(true);
|
|
8674
8691
|
e.preventDefault();
|
|
8675
8692
|
e.stopPropagation();
|
|
8676
|
-
} }) : /* @__PURE__ */
|
|
8693
|
+
} }) : /* @__PURE__ */ React44__namespace.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8677
8694
|
if (originalOnClick) {
|
|
8678
8695
|
setIsConfirming(false);
|
|
8679
8696
|
originalOnClick(e);
|
|
8680
8697
|
e.preventDefault();
|
|
8681
8698
|
e.stopPropagation();
|
|
8682
8699
|
}
|
|
8683
|
-
} }, /* @__PURE__ */
|
|
8700
|
+
} }, /* @__PURE__ */ React44__namespace.createElement("div", { className: "flex flex-row gap-2 items-center" }, /* @__PURE__ */ React44__namespace.createElement("div", { className: "text-destructive" }, "Are you sure ?")));
|
|
8684
8701
|
}
|
|
8685
8702
|
function DropdownMenuItem2({
|
|
8686
8703
|
className,
|
|
@@ -8688,7 +8705,7 @@ function DropdownMenuItem2({
|
|
|
8688
8705
|
variant = "default",
|
|
8689
8706
|
...props
|
|
8690
8707
|
}) {
|
|
8691
|
-
return /* @__PURE__ */
|
|
8708
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8692
8709
|
Item22,
|
|
8693
8710
|
{
|
|
8694
8711
|
"data-slot": "dropdown-menu-item",
|
|
@@ -8708,7 +8725,7 @@ function DropdownMenuCheckboxItem2({
|
|
|
8708
8725
|
checked,
|
|
8709
8726
|
...props
|
|
8710
8727
|
}) {
|
|
8711
|
-
return /* @__PURE__ */
|
|
8728
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8712
8729
|
CheckboxItem2,
|
|
8713
8730
|
{
|
|
8714
8731
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -8719,14 +8736,14 @@ function DropdownMenuCheckboxItem2({
|
|
|
8719
8736
|
checked,
|
|
8720
8737
|
...props
|
|
8721
8738
|
},
|
|
8722
|
-
/* @__PURE__ */
|
|
8739
|
+
/* @__PURE__ */ React44__namespace.createElement("span", { className: "uii:pointer-events-none uii:absolute uii:left-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center" }, /* @__PURE__ */ React44__namespace.createElement(ItemIndicator2, null, /* @__PURE__ */ React44__namespace.createElement(Check, { className: "uii:size-4" }))),
|
|
8723
8740
|
children
|
|
8724
8741
|
);
|
|
8725
8742
|
}
|
|
8726
8743
|
function DropdownMenuRadioGroup2({
|
|
8727
8744
|
...props
|
|
8728
8745
|
}) {
|
|
8729
|
-
return /* @__PURE__ */
|
|
8746
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8730
8747
|
RadioGroup2,
|
|
8731
8748
|
{
|
|
8732
8749
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -8739,7 +8756,7 @@ function DropdownMenuRadioItem2({
|
|
|
8739
8756
|
children,
|
|
8740
8757
|
...props
|
|
8741
8758
|
}) {
|
|
8742
|
-
return /* @__PURE__ */
|
|
8759
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8743
8760
|
RadioItem2,
|
|
8744
8761
|
{
|
|
8745
8762
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -8749,7 +8766,7 @@ function DropdownMenuRadioItem2({
|
|
|
8749
8766
|
),
|
|
8750
8767
|
...props
|
|
8751
8768
|
},
|
|
8752
|
-
/* @__PURE__ */
|
|
8769
|
+
/* @__PURE__ */ React44__namespace.createElement("span", { className: "uii:pointer-events-none uii:absolute uii:left-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center" }, /* @__PURE__ */ React44__namespace.createElement(ItemIndicator2, null, /* @__PURE__ */ React44__namespace.createElement(Circle, { className: "uii:size-2 uii:fill-current" }))),
|
|
8753
8770
|
children
|
|
8754
8771
|
);
|
|
8755
8772
|
}
|
|
@@ -8758,7 +8775,7 @@ function DropdownMenuLabel2({
|
|
|
8758
8775
|
inset,
|
|
8759
8776
|
...props
|
|
8760
8777
|
}) {
|
|
8761
|
-
return /* @__PURE__ */
|
|
8778
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8762
8779
|
Label2,
|
|
8763
8780
|
{
|
|
8764
8781
|
"data-slot": "dropdown-menu-label",
|
|
@@ -8775,7 +8792,7 @@ function DropdownMenuSeparator2({
|
|
|
8775
8792
|
className,
|
|
8776
8793
|
...props
|
|
8777
8794
|
}) {
|
|
8778
|
-
return /* @__PURE__ */
|
|
8795
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8779
8796
|
Separator2,
|
|
8780
8797
|
{
|
|
8781
8798
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -8788,7 +8805,7 @@ function DropdownMenuShortcut({
|
|
|
8788
8805
|
className,
|
|
8789
8806
|
...props
|
|
8790
8807
|
}) {
|
|
8791
|
-
return /* @__PURE__ */
|
|
8808
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8792
8809
|
"span",
|
|
8793
8810
|
{
|
|
8794
8811
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -8803,7 +8820,7 @@ function DropdownMenuShortcut({
|
|
|
8803
8820
|
function DropdownMenuSub2({
|
|
8804
8821
|
...props
|
|
8805
8822
|
}) {
|
|
8806
|
-
return /* @__PURE__ */
|
|
8823
|
+
return /* @__PURE__ */ React44__namespace.createElement(Sub2, { "data-slot": "dropdown-menu-sub", ...props });
|
|
8807
8824
|
}
|
|
8808
8825
|
function DropdownMenuSubTrigger2({
|
|
8809
8826
|
className,
|
|
@@ -8811,7 +8828,7 @@ function DropdownMenuSubTrigger2({
|
|
|
8811
8828
|
children,
|
|
8812
8829
|
...props
|
|
8813
8830
|
}) {
|
|
8814
|
-
return /* @__PURE__ */
|
|
8831
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8815
8832
|
SubTrigger2,
|
|
8816
8833
|
{
|
|
8817
8834
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
@@ -8823,14 +8840,14 @@ function DropdownMenuSubTrigger2({
|
|
|
8823
8840
|
...props
|
|
8824
8841
|
},
|
|
8825
8842
|
children,
|
|
8826
|
-
/* @__PURE__ */
|
|
8843
|
+
/* @__PURE__ */ React44__namespace.createElement(ChevronRight, { className: "uii:ml-auto uii:size-4" })
|
|
8827
8844
|
);
|
|
8828
8845
|
}
|
|
8829
8846
|
function DropdownMenuSubContent2({
|
|
8830
8847
|
className,
|
|
8831
8848
|
...props
|
|
8832
8849
|
}) {
|
|
8833
|
-
return /* @__PURE__ */
|
|
8850
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
8834
8851
|
SubContent2,
|
|
8835
8852
|
{
|
|
8836
8853
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -8850,6 +8867,7 @@ __export(fields_exports, {
|
|
|
8850
8867
|
InferredTypesContext: () => InferredTypesContext,
|
|
8851
8868
|
InferredTypesProvider: () => InferredTypesProvider,
|
|
8852
8869
|
Input: () => Input,
|
|
8870
|
+
LogicToggleButton: () => LogicToggleButton,
|
|
8853
8871
|
NestedFieldProvider: () => NestedFieldProvider,
|
|
8854
8872
|
NodePropertyProvider: () => NodePropertyProvider,
|
|
8855
8873
|
OPERATORS_BY_TYPE: () => OPERATORS_BY_TYPE,
|
|
@@ -8863,6 +8881,7 @@ __export(fields_exports, {
|
|
|
8863
8881
|
getOperatorsForType: () => getOperatorsForType,
|
|
8864
8882
|
getStringConstants: () => getStringConstants,
|
|
8865
8883
|
intersectTypes: () => intersectTypes,
|
|
8884
|
+
logicToggleButtonStyles: () => logicToggleButtonStyles,
|
|
8866
8885
|
normalizeFieldValue: () => normalizeFieldValue,
|
|
8867
8886
|
parseInferSyntax: () => parseInferSyntax,
|
|
8868
8887
|
parseInferredTypes: () => parseInferredTypes,
|
|
@@ -8886,10 +8905,10 @@ __export(fields_exports, {
|
|
|
8886
8905
|
useTemplateFieldContext: () => useTemplateFieldContext,
|
|
8887
8906
|
useTriggerLayoutUpdate: () => useTriggerLayoutUpdate
|
|
8888
8907
|
});
|
|
8889
|
-
var DevContext =
|
|
8908
|
+
var DevContext = React44.createContext(null);
|
|
8890
8909
|
function useResolvedExpectedType(expectedType, devCtx) {
|
|
8891
8910
|
const inferredTypes = devCtx?.inferredTypes;
|
|
8892
|
-
return
|
|
8911
|
+
return React44__namespace.useMemo(() => {
|
|
8893
8912
|
if (!expectedType) return "any";
|
|
8894
8913
|
if (!expectedType.startsWith("$infer<")) {
|
|
8895
8914
|
return expectedType;
|
|
@@ -8932,18 +8951,18 @@ function Input({
|
|
|
8932
8951
|
className,
|
|
8933
8952
|
editorClassName
|
|
8934
8953
|
}) {
|
|
8935
|
-
const devCtx =
|
|
8954
|
+
const devCtx = React44.useContext(DevContext);
|
|
8936
8955
|
const resolvedExpectedType = useResolvedExpectedType(expectedType, devCtx);
|
|
8937
|
-
const displayValue =
|
|
8956
|
+
const displayValue = React44__namespace.useMemo(() => {
|
|
8938
8957
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
8939
8958
|
return String(value.expression ?? "");
|
|
8940
8959
|
}
|
|
8941
8960
|
return String(value ?? "");
|
|
8942
8961
|
}, [value]);
|
|
8943
|
-
const isExpression =
|
|
8962
|
+
const isExpression = React44__namespace.useMemo(() => {
|
|
8944
8963
|
return value != null && typeof value === "object" && "expression" in value;
|
|
8945
8964
|
}, [value]);
|
|
8946
|
-
const handleChange =
|
|
8965
|
+
const handleChange = React44__namespace.useCallback((e) => {
|
|
8947
8966
|
const newValue = e.target.value;
|
|
8948
8967
|
if (newValue.includes("{{")) {
|
|
8949
8968
|
onChange({
|
|
@@ -8956,7 +8975,7 @@ function Input({
|
|
|
8956
8975
|
}, [onChange]);
|
|
8957
8976
|
const showError = hasRequiredError || required && !displayValue;
|
|
8958
8977
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
8959
|
-
return /* @__PURE__ */
|
|
8978
|
+
return /* @__PURE__ */ React44__namespace.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React44__namespace.createElement(
|
|
8960
8979
|
"label",
|
|
8961
8980
|
{
|
|
8962
8981
|
htmlFor: fieldName,
|
|
@@ -8964,7 +8983,7 @@ function Input({
|
|
|
8964
8983
|
},
|
|
8965
8984
|
label,
|
|
8966
8985
|
":"
|
|
8967
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
8986
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44__namespace.createElement(
|
|
8968
8987
|
"span",
|
|
8969
8988
|
{
|
|
8970
8989
|
className: cn(
|
|
@@ -8974,7 +8993,7 @@ function Input({
|
|
|
8974
8993
|
title: resolvedExpectedType
|
|
8975
8994
|
},
|
|
8976
8995
|
resolvedExpectedType
|
|
8977
|
-
), showError && /* @__PURE__ */
|
|
8996
|
+
), showError && /* @__PURE__ */ React44__namespace.createElement("span", { className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-red-100 uii:text-red-600 uii:rounded-sm uii:text-[10px] uii:font-medium" }, "Required")), /* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:mt-0.5" }, /* @__PURE__ */ React44__namespace.createElement(
|
|
8978
8997
|
"input",
|
|
8979
8998
|
{
|
|
8980
8999
|
id: fieldName,
|
|
@@ -9002,8 +9021,8 @@ function clamp2(value, [min2, max2]) {
|
|
|
9002
9021
|
return Math.min(max2, Math.max(min2, value));
|
|
9003
9022
|
}
|
|
9004
9023
|
function usePrevious(value) {
|
|
9005
|
-
const ref =
|
|
9006
|
-
return
|
|
9024
|
+
const ref = React44__namespace.useRef({ value, previous: value });
|
|
9025
|
+
return React44__namespace.useMemo(() => {
|
|
9007
9026
|
if (ref.current.value !== value) {
|
|
9008
9027
|
ref.current.previous = ref.current.value;
|
|
9009
9028
|
ref.current.value = value;
|
|
@@ -9025,7 +9044,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
9025
9044
|
wordWrap: "normal"
|
|
9026
9045
|
});
|
|
9027
9046
|
var NAME3 = "VisuallyHidden";
|
|
9028
|
-
var VisuallyHidden =
|
|
9047
|
+
var VisuallyHidden = React44__namespace.forwardRef(
|
|
9029
9048
|
(props, forwardedRef) => {
|
|
9030
9049
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9031
9050
|
Primitive.span,
|
|
@@ -9067,9 +9086,9 @@ var Select = (props) => {
|
|
|
9067
9086
|
form
|
|
9068
9087
|
} = props;
|
|
9069
9088
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
9070
|
-
const [trigger, setTrigger] =
|
|
9071
|
-
const [valueNode, setValueNode] =
|
|
9072
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
9089
|
+
const [trigger, setTrigger] = React44__namespace.useState(null);
|
|
9090
|
+
const [valueNode, setValueNode] = React44__namespace.useState(null);
|
|
9091
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React44__namespace.useState(false);
|
|
9073
9092
|
const direction = useDirection(dir);
|
|
9074
9093
|
const [open, setOpen] = useControllableState({
|
|
9075
9094
|
prop: openProp,
|
|
@@ -9083,9 +9102,9 @@ var Select = (props) => {
|
|
|
9083
9102
|
onChange: onValueChange,
|
|
9084
9103
|
caller: SELECT_NAME
|
|
9085
9104
|
});
|
|
9086
|
-
const triggerPointerDownPosRef =
|
|
9105
|
+
const triggerPointerDownPosRef = React44__namespace.useRef(null);
|
|
9087
9106
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
9088
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
9107
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React44__namespace.useState(/* @__PURE__ */ new Set());
|
|
9089
9108
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
9090
9109
|
return /* @__PURE__ */ jsxRuntime.jsx(Root22, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9091
9110
|
SelectProvider,
|
|
@@ -9111,10 +9130,10 @@ var Select = (props) => {
|
|
|
9111
9130
|
SelectNativeOptionsProvider,
|
|
9112
9131
|
{
|
|
9113
9132
|
scope: props.__scopeSelect,
|
|
9114
|
-
onNativeOptionAdd:
|
|
9133
|
+
onNativeOptionAdd: React44__namespace.useCallback((option) => {
|
|
9115
9134
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
9116
9135
|
}, []),
|
|
9117
|
-
onNativeOptionRemove:
|
|
9136
|
+
onNativeOptionRemove: React44__namespace.useCallback((option) => {
|
|
9118
9137
|
setNativeOptionsSet((prev) => {
|
|
9119
9138
|
const optionsSet = new Set(prev);
|
|
9120
9139
|
optionsSet.delete(option);
|
|
@@ -9149,7 +9168,7 @@ var Select = (props) => {
|
|
|
9149
9168
|
};
|
|
9150
9169
|
Select.displayName = SELECT_NAME;
|
|
9151
9170
|
var TRIGGER_NAME2 = "SelectTrigger";
|
|
9152
|
-
var SelectTrigger =
|
|
9171
|
+
var SelectTrigger = React44__namespace.forwardRef(
|
|
9153
9172
|
(props, forwardedRef) => {
|
|
9154
9173
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
9155
9174
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -9157,7 +9176,7 @@ var SelectTrigger = React43__namespace.forwardRef(
|
|
|
9157
9176
|
const isDisabled = context.disabled || disabled;
|
|
9158
9177
|
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
9159
9178
|
const getItems = useCollection3(__scopeSelect);
|
|
9160
|
-
const pointerTypeRef =
|
|
9179
|
+
const pointerTypeRef = React44__namespace.useRef("touch");
|
|
9161
9180
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
9162
9181
|
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
9163
9182
|
const currentItem = enabledItems.find((item) => item.value === context.value);
|
|
@@ -9227,7 +9246,7 @@ var SelectTrigger = React43__namespace.forwardRef(
|
|
|
9227
9246
|
);
|
|
9228
9247
|
SelectTrigger.displayName = TRIGGER_NAME2;
|
|
9229
9248
|
var VALUE_NAME = "SelectValue";
|
|
9230
|
-
var SelectValue =
|
|
9249
|
+
var SelectValue = React44__namespace.forwardRef(
|
|
9231
9250
|
(props, forwardedRef) => {
|
|
9232
9251
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
9233
9252
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
@@ -9250,7 +9269,7 @@ var SelectValue = React43__namespace.forwardRef(
|
|
|
9250
9269
|
);
|
|
9251
9270
|
SelectValue.displayName = VALUE_NAME;
|
|
9252
9271
|
var ICON_NAME = "SelectIcon";
|
|
9253
|
-
var SelectIcon =
|
|
9272
|
+
var SelectIcon = React44__namespace.forwardRef(
|
|
9254
9273
|
(props, forwardedRef) => {
|
|
9255
9274
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
9256
9275
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
@@ -9263,10 +9282,10 @@ var SelectPortal = (props) => {
|
|
|
9263
9282
|
};
|
|
9264
9283
|
SelectPortal.displayName = PORTAL_NAME4;
|
|
9265
9284
|
var CONTENT_NAME4 = "SelectContent";
|
|
9266
|
-
var SelectContent =
|
|
9285
|
+
var SelectContent = React44__namespace.forwardRef(
|
|
9267
9286
|
(props, forwardedRef) => {
|
|
9268
9287
|
const context = useSelectContext(CONTENT_NAME4, props.__scopeSelect);
|
|
9269
|
-
const [fragment, setFragment] =
|
|
9288
|
+
const [fragment, setFragment] = React44__namespace.useState();
|
|
9270
9289
|
useLayoutEffect2(() => {
|
|
9271
9290
|
setFragment(new DocumentFragment());
|
|
9272
9291
|
}, []);
|
|
@@ -9285,7 +9304,7 @@ var CONTENT_MARGIN = 10;
|
|
|
9285
9304
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME4);
|
|
9286
9305
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
9287
9306
|
var Slot3 = createSlot2("SelectContent.RemoveScroll");
|
|
9288
|
-
var SelectContentImpl =
|
|
9307
|
+
var SelectContentImpl = React44__namespace.forwardRef(
|
|
9289
9308
|
(props, forwardedRef) => {
|
|
9290
9309
|
const {
|
|
9291
9310
|
__scopeSelect,
|
|
@@ -9309,21 +9328,21 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9309
9328
|
...contentProps
|
|
9310
9329
|
} = props;
|
|
9311
9330
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9312
|
-
const [content, setContent] =
|
|
9313
|
-
const [viewport, setViewport] =
|
|
9331
|
+
const [content, setContent] = React44__namespace.useState(null);
|
|
9332
|
+
const [viewport, setViewport] = React44__namespace.useState(null);
|
|
9314
9333
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9315
|
-
const [selectedItem, setSelectedItem] =
|
|
9316
|
-
const [selectedItemText, setSelectedItemText] =
|
|
9334
|
+
const [selectedItem, setSelectedItem] = React44__namespace.useState(null);
|
|
9335
|
+
const [selectedItemText, setSelectedItemText] = React44__namespace.useState(
|
|
9317
9336
|
null
|
|
9318
9337
|
);
|
|
9319
9338
|
const getItems = useCollection3(__scopeSelect);
|
|
9320
|
-
const [isPositioned, setIsPositioned] =
|
|
9321
|
-
const firstValidItemFoundRef =
|
|
9322
|
-
|
|
9339
|
+
const [isPositioned, setIsPositioned] = React44__namespace.useState(false);
|
|
9340
|
+
const firstValidItemFoundRef = React44__namespace.useRef(false);
|
|
9341
|
+
React44__namespace.useEffect(() => {
|
|
9323
9342
|
if (content) return hideOthers(content);
|
|
9324
9343
|
}, [content]);
|
|
9325
9344
|
useFocusGuards();
|
|
9326
|
-
const focusFirst4 =
|
|
9345
|
+
const focusFirst4 = React44__namespace.useCallback(
|
|
9327
9346
|
(candidates) => {
|
|
9328
9347
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
9329
9348
|
const [lastItem] = restItems.slice(-1);
|
|
@@ -9339,17 +9358,17 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9339
9358
|
},
|
|
9340
9359
|
[getItems, viewport]
|
|
9341
9360
|
);
|
|
9342
|
-
const focusSelectedItem =
|
|
9361
|
+
const focusSelectedItem = React44__namespace.useCallback(
|
|
9343
9362
|
() => focusFirst4([selectedItem, content]),
|
|
9344
9363
|
[focusFirst4, selectedItem, content]
|
|
9345
9364
|
);
|
|
9346
|
-
|
|
9365
|
+
React44__namespace.useEffect(() => {
|
|
9347
9366
|
if (isPositioned) {
|
|
9348
9367
|
focusSelectedItem();
|
|
9349
9368
|
}
|
|
9350
9369
|
}, [isPositioned, focusSelectedItem]);
|
|
9351
9370
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
9352
|
-
|
|
9371
|
+
React44__namespace.useEffect(() => {
|
|
9353
9372
|
if (content) {
|
|
9354
9373
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
9355
9374
|
const handlePointerMove = (event) => {
|
|
@@ -9379,7 +9398,7 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9379
9398
|
};
|
|
9380
9399
|
}
|
|
9381
9400
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
9382
|
-
|
|
9401
|
+
React44__namespace.useEffect(() => {
|
|
9383
9402
|
const close = () => onOpenChange(false);
|
|
9384
9403
|
window.addEventListener("blur", close);
|
|
9385
9404
|
window.addEventListener("resize", close);
|
|
@@ -9396,7 +9415,7 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9396
9415
|
setTimeout(() => nextItem.ref.current.focus());
|
|
9397
9416
|
}
|
|
9398
9417
|
});
|
|
9399
|
-
const itemRefCallback =
|
|
9418
|
+
const itemRefCallback = React44__namespace.useCallback(
|
|
9400
9419
|
(node, value, disabled) => {
|
|
9401
9420
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9402
9421
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9407,8 +9426,8 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9407
9426
|
},
|
|
9408
9427
|
[context.value]
|
|
9409
9428
|
);
|
|
9410
|
-
const handleItemLeave =
|
|
9411
|
-
const itemTextRefCallback =
|
|
9429
|
+
const handleItemLeave = React44__namespace.useCallback(() => content?.focus(), [content]);
|
|
9430
|
+
const itemTextRefCallback = React44__namespace.useCallback(
|
|
9412
9431
|
(node, value, disabled) => {
|
|
9413
9432
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9414
9433
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9519,18 +9538,18 @@ var SelectContentImpl = React43__namespace.forwardRef(
|
|
|
9519
9538
|
);
|
|
9520
9539
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
9521
9540
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
9522
|
-
var SelectItemAlignedPosition =
|
|
9541
|
+
var SelectItemAlignedPosition = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
9523
9542
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
9524
9543
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9525
9544
|
const contentContext = useSelectContentContext(CONTENT_NAME4, __scopeSelect);
|
|
9526
|
-
const [contentWrapper, setContentWrapper] =
|
|
9527
|
-
const [content, setContent] =
|
|
9545
|
+
const [contentWrapper, setContentWrapper] = React44__namespace.useState(null);
|
|
9546
|
+
const [content, setContent] = React44__namespace.useState(null);
|
|
9528
9547
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9529
9548
|
const getItems = useCollection3(__scopeSelect);
|
|
9530
|
-
const shouldExpandOnScrollRef =
|
|
9531
|
-
const shouldRepositionRef =
|
|
9549
|
+
const shouldExpandOnScrollRef = React44__namespace.useRef(false);
|
|
9550
|
+
const shouldRepositionRef = React44__namespace.useRef(true);
|
|
9532
9551
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
9533
|
-
const position =
|
|
9552
|
+
const position = React44__namespace.useCallback(() => {
|
|
9534
9553
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
9535
9554
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
9536
9555
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -9630,11 +9649,11 @@ var SelectItemAlignedPosition = React43__namespace.forwardRef((props, forwardedR
|
|
|
9630
9649
|
onPlaced
|
|
9631
9650
|
]);
|
|
9632
9651
|
useLayoutEffect2(() => position(), [position]);
|
|
9633
|
-
const [contentZIndex, setContentZIndex] =
|
|
9652
|
+
const [contentZIndex, setContentZIndex] = React44__namespace.useState();
|
|
9634
9653
|
useLayoutEffect2(() => {
|
|
9635
9654
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
9636
9655
|
}, [content]);
|
|
9637
|
-
const handleScrollButtonChange =
|
|
9656
|
+
const handleScrollButtonChange = React44__namespace.useCallback(
|
|
9638
9657
|
(node) => {
|
|
9639
9658
|
if (node && shouldRepositionRef.current === true) {
|
|
9640
9659
|
position();
|
|
@@ -9683,7 +9702,7 @@ var SelectItemAlignedPosition = React43__namespace.forwardRef((props, forwardedR
|
|
|
9683
9702
|
});
|
|
9684
9703
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
9685
9704
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
9686
|
-
var SelectPopperPosition =
|
|
9705
|
+
var SelectPopperPosition = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
9687
9706
|
const {
|
|
9688
9707
|
__scopeSelect,
|
|
9689
9708
|
align = "start",
|
|
@@ -9718,13 +9737,13 @@ var SelectPopperPosition = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
9718
9737
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
9719
9738
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME4, {});
|
|
9720
9739
|
var VIEWPORT_NAME = "SelectViewport";
|
|
9721
|
-
var SelectViewport =
|
|
9740
|
+
var SelectViewport = React44__namespace.forwardRef(
|
|
9722
9741
|
(props, forwardedRef) => {
|
|
9723
9742
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
9724
9743
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
9725
9744
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
9726
9745
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
9727
|
-
const prevScrollTopRef =
|
|
9746
|
+
const prevScrollTopRef = React44__namespace.useRef(0);
|
|
9728
9747
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9729
9748
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9730
9749
|
"style",
|
|
@@ -9787,7 +9806,7 @@ var SelectViewport = React43__namespace.forwardRef(
|
|
|
9787
9806
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
9788
9807
|
var GROUP_NAME4 = "SelectGroup";
|
|
9789
9808
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME4);
|
|
9790
|
-
var SelectGroup =
|
|
9809
|
+
var SelectGroup = React44__namespace.forwardRef(
|
|
9791
9810
|
(props, forwardedRef) => {
|
|
9792
9811
|
const { __scopeSelect, ...groupProps } = props;
|
|
9793
9812
|
const groupId = useId();
|
|
@@ -9796,7 +9815,7 @@ var SelectGroup = React43__namespace.forwardRef(
|
|
|
9796
9815
|
);
|
|
9797
9816
|
SelectGroup.displayName = GROUP_NAME4;
|
|
9798
9817
|
var LABEL_NAME3 = "SelectLabel";
|
|
9799
|
-
var SelectLabel =
|
|
9818
|
+
var SelectLabel = React44__namespace.forwardRef(
|
|
9800
9819
|
(props, forwardedRef) => {
|
|
9801
9820
|
const { __scopeSelect, ...labelProps } = props;
|
|
9802
9821
|
const groupContext = useSelectGroupContext(LABEL_NAME3, __scopeSelect);
|
|
@@ -9806,7 +9825,7 @@ var SelectLabel = React43__namespace.forwardRef(
|
|
|
9806
9825
|
SelectLabel.displayName = LABEL_NAME3;
|
|
9807
9826
|
var ITEM_NAME4 = "SelectItem";
|
|
9808
9827
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME4);
|
|
9809
|
-
var SelectItem =
|
|
9828
|
+
var SelectItem = React44__namespace.forwardRef(
|
|
9810
9829
|
(props, forwardedRef) => {
|
|
9811
9830
|
const {
|
|
9812
9831
|
__scopeSelect,
|
|
@@ -9818,14 +9837,14 @@ var SelectItem = React43__namespace.forwardRef(
|
|
|
9818
9837
|
const context = useSelectContext(ITEM_NAME4, __scopeSelect);
|
|
9819
9838
|
const contentContext = useSelectContentContext(ITEM_NAME4, __scopeSelect);
|
|
9820
9839
|
const isSelected = context.value === value;
|
|
9821
|
-
const [textValue, setTextValue] =
|
|
9822
|
-
const [isFocused, setIsFocused] =
|
|
9840
|
+
const [textValue, setTextValue] = React44__namespace.useState(textValueProp ?? "");
|
|
9841
|
+
const [isFocused, setIsFocused] = React44__namespace.useState(false);
|
|
9823
9842
|
const composedRefs = useComposedRefs(
|
|
9824
9843
|
forwardedRef,
|
|
9825
9844
|
(node) => contentContext.itemRefCallback?.(node, value, disabled)
|
|
9826
9845
|
);
|
|
9827
9846
|
const textId = useId();
|
|
9828
|
-
const pointerTypeRef =
|
|
9847
|
+
const pointerTypeRef = React44__namespace.useRef("touch");
|
|
9829
9848
|
const handleSelect = () => {
|
|
9830
9849
|
if (!disabled) {
|
|
9831
9850
|
context.onValueChange(value);
|
|
@@ -9845,7 +9864,7 @@ var SelectItem = React43__namespace.forwardRef(
|
|
|
9845
9864
|
disabled,
|
|
9846
9865
|
textId,
|
|
9847
9866
|
isSelected,
|
|
9848
|
-
onItemTextChange:
|
|
9867
|
+
onItemTextChange: React44__namespace.useCallback((node) => {
|
|
9849
9868
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
9850
9869
|
}, []),
|
|
9851
9870
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -9908,14 +9927,14 @@ var SelectItem = React43__namespace.forwardRef(
|
|
|
9908
9927
|
);
|
|
9909
9928
|
SelectItem.displayName = ITEM_NAME4;
|
|
9910
9929
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
9911
|
-
var SelectItemText =
|
|
9930
|
+
var SelectItemText = React44__namespace.forwardRef(
|
|
9912
9931
|
(props, forwardedRef) => {
|
|
9913
9932
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
9914
9933
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9915
9934
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9916
9935
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9917
9936
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9918
|
-
const [itemTextNode, setItemTextNode] =
|
|
9937
|
+
const [itemTextNode, setItemTextNode] = React44__namespace.useState(null);
|
|
9919
9938
|
const composedRefs = useComposedRefs(
|
|
9920
9939
|
forwardedRef,
|
|
9921
9940
|
(node) => setItemTextNode(node),
|
|
@@ -9923,7 +9942,7 @@ var SelectItemText = React43__namespace.forwardRef(
|
|
|
9923
9942
|
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
|
9924
9943
|
);
|
|
9925
9944
|
const textContent = itemTextNode?.textContent;
|
|
9926
|
-
const nativeOption =
|
|
9945
|
+
const nativeOption = React44__namespace.useMemo(
|
|
9927
9946
|
() => /* @__PURE__ */ jsxRuntime.jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
9928
9947
|
[itemContext.disabled, itemContext.value, textContent]
|
|
9929
9948
|
);
|
|
@@ -9940,7 +9959,7 @@ var SelectItemText = React43__namespace.forwardRef(
|
|
|
9940
9959
|
);
|
|
9941
9960
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
9942
9961
|
var ITEM_INDICATOR_NAME2 = "SelectItemIndicator";
|
|
9943
|
-
var SelectItemIndicator =
|
|
9962
|
+
var SelectItemIndicator = React44__namespace.forwardRef(
|
|
9944
9963
|
(props, forwardedRef) => {
|
|
9945
9964
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
9946
9965
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME2, __scopeSelect);
|
|
@@ -9949,10 +9968,10 @@ var SelectItemIndicator = React43__namespace.forwardRef(
|
|
|
9949
9968
|
);
|
|
9950
9969
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME2;
|
|
9951
9970
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
9952
|
-
var SelectScrollUpButton =
|
|
9971
|
+
var SelectScrollUpButton = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
9953
9972
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9954
9973
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9955
|
-
const [canScrollUp, setCanScrollUp] =
|
|
9974
|
+
const [canScrollUp, setCanScrollUp] = React44__namespace.useState(false);
|
|
9956
9975
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9957
9976
|
useLayoutEffect2(() => {
|
|
9958
9977
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9982,10 +10001,10 @@ var SelectScrollUpButton = React43__namespace.forwardRef((props, forwardedRef) =
|
|
|
9982
10001
|
});
|
|
9983
10002
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
9984
10003
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
9985
|
-
var SelectScrollDownButton =
|
|
10004
|
+
var SelectScrollDownButton = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
9986
10005
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9987
10006
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9988
|
-
const [canScrollDown, setCanScrollDown] =
|
|
10007
|
+
const [canScrollDown, setCanScrollDown] = React44__namespace.useState(false);
|
|
9989
10008
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9990
10009
|
useLayoutEffect2(() => {
|
|
9991
10010
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -10015,18 +10034,18 @@ var SelectScrollDownButton = React43__namespace.forwardRef((props, forwardedRef)
|
|
|
10015
10034
|
) : null;
|
|
10016
10035
|
});
|
|
10017
10036
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
10018
|
-
var SelectScrollButtonImpl =
|
|
10037
|
+
var SelectScrollButtonImpl = React44__namespace.forwardRef((props, forwardedRef) => {
|
|
10019
10038
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
10020
10039
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
10021
|
-
const autoScrollTimerRef =
|
|
10040
|
+
const autoScrollTimerRef = React44__namespace.useRef(null);
|
|
10022
10041
|
const getItems = useCollection3(__scopeSelect);
|
|
10023
|
-
const clearAutoScrollTimer =
|
|
10042
|
+
const clearAutoScrollTimer = React44__namespace.useCallback(() => {
|
|
10024
10043
|
if (autoScrollTimerRef.current !== null) {
|
|
10025
10044
|
window.clearInterval(autoScrollTimerRef.current);
|
|
10026
10045
|
autoScrollTimerRef.current = null;
|
|
10027
10046
|
}
|
|
10028
10047
|
}, []);
|
|
10029
|
-
|
|
10048
|
+
React44__namespace.useEffect(() => {
|
|
10030
10049
|
return () => clearAutoScrollTimer();
|
|
10031
10050
|
}, [clearAutoScrollTimer]);
|
|
10032
10051
|
useLayoutEffect2(() => {
|
|
@@ -10058,7 +10077,7 @@ var SelectScrollButtonImpl = React43__namespace.forwardRef((props, forwardedRef)
|
|
|
10058
10077
|
);
|
|
10059
10078
|
});
|
|
10060
10079
|
var SEPARATOR_NAME3 = "SelectSeparator";
|
|
10061
|
-
var SelectSeparator =
|
|
10080
|
+
var SelectSeparator = React44__namespace.forwardRef(
|
|
10062
10081
|
(props, forwardedRef) => {
|
|
10063
10082
|
const { __scopeSelect, ...separatorProps } = props;
|
|
10064
10083
|
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
@@ -10066,7 +10085,7 @@ var SelectSeparator = React43__namespace.forwardRef(
|
|
|
10066
10085
|
);
|
|
10067
10086
|
SelectSeparator.displayName = SEPARATOR_NAME3;
|
|
10068
10087
|
var ARROW_NAME4 = "SelectArrow";
|
|
10069
|
-
var SelectArrow =
|
|
10088
|
+
var SelectArrow = React44__namespace.forwardRef(
|
|
10070
10089
|
(props, forwardedRef) => {
|
|
10071
10090
|
const { __scopeSelect, ...arrowProps } = props;
|
|
10072
10091
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -10077,12 +10096,12 @@ var SelectArrow = React43__namespace.forwardRef(
|
|
|
10077
10096
|
);
|
|
10078
10097
|
SelectArrow.displayName = ARROW_NAME4;
|
|
10079
10098
|
var BUBBLE_INPUT_NAME = "SelectBubbleInput";
|
|
10080
|
-
var SelectBubbleInput =
|
|
10099
|
+
var SelectBubbleInput = React44__namespace.forwardRef(
|
|
10081
10100
|
({ __scopeSelect, value, ...props }, forwardedRef) => {
|
|
10082
|
-
const ref =
|
|
10101
|
+
const ref = React44__namespace.useRef(null);
|
|
10083
10102
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10084
10103
|
const prevValue = usePrevious(value);
|
|
10085
|
-
|
|
10104
|
+
React44__namespace.useEffect(() => {
|
|
10086
10105
|
const select = ref.current;
|
|
10087
10106
|
if (!select) return;
|
|
10088
10107
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -10114,9 +10133,9 @@ function shouldShowPlaceholder(value) {
|
|
|
10114
10133
|
}
|
|
10115
10134
|
function useTypeaheadSearch(onSearchChange) {
|
|
10116
10135
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
10117
|
-
const searchRef =
|
|
10118
|
-
const timerRef =
|
|
10119
|
-
const handleTypeaheadSearch =
|
|
10136
|
+
const searchRef = React44__namespace.useRef("");
|
|
10137
|
+
const timerRef = React44__namespace.useRef(0);
|
|
10138
|
+
const handleTypeaheadSearch = React44__namespace.useCallback(
|
|
10120
10139
|
(key) => {
|
|
10121
10140
|
const search = searchRef.current + key;
|
|
10122
10141
|
handleSearchChange(search);
|
|
@@ -10128,11 +10147,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
10128
10147
|
},
|
|
10129
10148
|
[handleSearchChange]
|
|
10130
10149
|
);
|
|
10131
|
-
const resetTypeahead =
|
|
10150
|
+
const resetTypeahead = React44__namespace.useCallback(() => {
|
|
10132
10151
|
searchRef.current = "";
|
|
10133
10152
|
window.clearTimeout(timerRef.current);
|
|
10134
10153
|
}, []);
|
|
10135
|
-
|
|
10154
|
+
React44__namespace.useEffect(() => {
|
|
10136
10155
|
return () => window.clearTimeout(timerRef.current);
|
|
10137
10156
|
}, []);
|
|
10138
10157
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -10169,19 +10188,19 @@ var ScrollDownButton = SelectScrollDownButton;
|
|
|
10169
10188
|
function Select2({
|
|
10170
10189
|
...props
|
|
10171
10190
|
}) {
|
|
10172
|
-
return /* @__PURE__ */
|
|
10191
|
+
return /* @__PURE__ */ React44__namespace.createElement(Root24, { "data-slot": "select", ...props });
|
|
10173
10192
|
}
|
|
10174
10193
|
function SelectValue2({
|
|
10175
10194
|
...props
|
|
10176
10195
|
}) {
|
|
10177
|
-
return /* @__PURE__ */
|
|
10196
|
+
return /* @__PURE__ */ React44__namespace.createElement(Value, { "data-slot": "select-value", ...props });
|
|
10178
10197
|
}
|
|
10179
10198
|
function SelectTrigger2({
|
|
10180
10199
|
className,
|
|
10181
10200
|
children,
|
|
10182
10201
|
...props
|
|
10183
10202
|
}) {
|
|
10184
|
-
return /* @__PURE__ */
|
|
10203
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
10185
10204
|
Trigger2,
|
|
10186
10205
|
{
|
|
10187
10206
|
"data-slot": "select-trigger",
|
|
@@ -10192,7 +10211,7 @@ function SelectTrigger2({
|
|
|
10192
10211
|
...props
|
|
10193
10212
|
},
|
|
10194
10213
|
children,
|
|
10195
|
-
/* @__PURE__ */
|
|
10214
|
+
/* @__PURE__ */ React44__namespace.createElement(Icon2, { asChild: true }, /* @__PURE__ */ React44__namespace.createElement(ChevronDown, { className: "uii:size-4 uii:opacity-50" }))
|
|
10196
10215
|
);
|
|
10197
10216
|
}
|
|
10198
10217
|
function SelectContent2({
|
|
@@ -10204,7 +10223,7 @@ function SelectContent2({
|
|
|
10204
10223
|
hideScrollDownButton = false,
|
|
10205
10224
|
...props
|
|
10206
10225
|
}) {
|
|
10207
|
-
return /* @__PURE__ */
|
|
10226
|
+
return /* @__PURE__ */ React44__namespace.createElement(Portal3, null, /* @__PURE__ */ React44__namespace.createElement(
|
|
10208
10227
|
Content23,
|
|
10209
10228
|
{
|
|
10210
10229
|
"data-slot": "select-content",
|
|
@@ -10217,8 +10236,8 @@ function SelectContent2({
|
|
|
10217
10236
|
position,
|
|
10218
10237
|
...props
|
|
10219
10238
|
},
|
|
10220
|
-
!hideScrollUpButton && /* @__PURE__ */
|
|
10221
|
-
/* @__PURE__ */
|
|
10239
|
+
!hideScrollUpButton && /* @__PURE__ */ React44__namespace.createElement(SelectScrollUpButton2, null),
|
|
10240
|
+
/* @__PURE__ */ React44__namespace.createElement(
|
|
10222
10241
|
Viewport,
|
|
10223
10242
|
{
|
|
10224
10243
|
className: cn(
|
|
@@ -10228,8 +10247,8 @@ function SelectContent2({
|
|
|
10228
10247
|
},
|
|
10229
10248
|
children
|
|
10230
10249
|
),
|
|
10231
|
-
footer ? /* @__PURE__ */
|
|
10232
|
-
!hideScrollDownButton && /* @__PURE__ */
|
|
10250
|
+
footer ? /* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:border-t uii:p-2 uii:bg-popover" }, footer) : null,
|
|
10251
|
+
!hideScrollDownButton && /* @__PURE__ */ React44__namespace.createElement(SelectScrollDownButton2, null)
|
|
10233
10252
|
));
|
|
10234
10253
|
}
|
|
10235
10254
|
function SelectItem2({
|
|
@@ -10237,7 +10256,7 @@ function SelectItem2({
|
|
|
10237
10256
|
children,
|
|
10238
10257
|
...props
|
|
10239
10258
|
}) {
|
|
10240
|
-
return /* @__PURE__ */
|
|
10259
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
10241
10260
|
Item3,
|
|
10242
10261
|
{
|
|
10243
10262
|
"data-slot": "select-item",
|
|
@@ -10247,15 +10266,15 @@ function SelectItem2({
|
|
|
10247
10266
|
),
|
|
10248
10267
|
...props
|
|
10249
10268
|
},
|
|
10250
|
-
/* @__PURE__ */
|
|
10251
|
-
/* @__PURE__ */
|
|
10269
|
+
/* @__PURE__ */ React44__namespace.createElement("span", { className: "uii:absolute uii:right-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center" }, /* @__PURE__ */ React44__namespace.createElement(ItemIndicator3, null, /* @__PURE__ */ React44__namespace.createElement(Check, { className: "uii:size-4" }))),
|
|
10270
|
+
/* @__PURE__ */ React44__namespace.createElement(ItemText, null, children)
|
|
10252
10271
|
);
|
|
10253
10272
|
}
|
|
10254
10273
|
function SelectScrollUpButton2({
|
|
10255
10274
|
className,
|
|
10256
10275
|
...props
|
|
10257
10276
|
}) {
|
|
10258
|
-
return /* @__PURE__ */
|
|
10277
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
10259
10278
|
ScrollUpButton,
|
|
10260
10279
|
{
|
|
10261
10280
|
"data-slot": "select-scroll-up-button",
|
|
@@ -10265,14 +10284,14 @@ function SelectScrollUpButton2({
|
|
|
10265
10284
|
),
|
|
10266
10285
|
...props
|
|
10267
10286
|
},
|
|
10268
|
-
/* @__PURE__ */
|
|
10287
|
+
/* @__PURE__ */ React44__namespace.createElement(ChevronUp, { className: "uii:size-4" })
|
|
10269
10288
|
);
|
|
10270
10289
|
}
|
|
10271
10290
|
function SelectScrollDownButton2({
|
|
10272
10291
|
className,
|
|
10273
10292
|
...props
|
|
10274
10293
|
}) {
|
|
10275
|
-
return /* @__PURE__ */
|
|
10294
|
+
return /* @__PURE__ */ React44__namespace.createElement(
|
|
10276
10295
|
ScrollDownButton,
|
|
10277
10296
|
{
|
|
10278
10297
|
"data-slot": "select-scroll-down-button",
|
|
@@ -10282,14 +10301,14 @@ function SelectScrollDownButton2({
|
|
|
10282
10301
|
),
|
|
10283
10302
|
...props
|
|
10284
10303
|
},
|
|
10285
|
-
/* @__PURE__ */
|
|
10304
|
+
/* @__PURE__ */ React44__namespace.createElement(ChevronDown, { className: "uii:size-4" })
|
|
10286
10305
|
);
|
|
10287
10306
|
}
|
|
10288
10307
|
|
|
10289
10308
|
// src/components/fields/Select.tsx
|
|
10290
10309
|
function useResolvedExpectedType2(expectedType, devCtx) {
|
|
10291
10310
|
const inferredTypes = devCtx?.inferredTypes;
|
|
10292
|
-
return
|
|
10311
|
+
return React44__namespace.useMemo(() => {
|
|
10293
10312
|
if (!expectedType) return "any";
|
|
10294
10313
|
if (!expectedType.startsWith("$infer<")) {
|
|
10295
10314
|
return expectedType;
|
|
@@ -10334,38 +10353,38 @@ function Select3({
|
|
|
10334
10353
|
className,
|
|
10335
10354
|
children
|
|
10336
10355
|
}) {
|
|
10337
|
-
const devCtx =
|
|
10356
|
+
const devCtx = React44.useContext(DevContext);
|
|
10338
10357
|
const resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
|
|
10339
|
-
const [isExpressionMode, setIsExpressionMode] =
|
|
10340
|
-
const [expressionValue, setExpressionValue] =
|
|
10341
|
-
const options =
|
|
10358
|
+
const [isExpressionMode, setIsExpressionMode] = React44__namespace.useState(false);
|
|
10359
|
+
const [expressionValue, setExpressionValue] = React44__namespace.useState("");
|
|
10360
|
+
const options = React44__namespace.useMemo(() => {
|
|
10342
10361
|
return rawOptions.map(
|
|
10343
10362
|
(opt) => typeof opt === "string" ? { value: opt, label: opt } : opt
|
|
10344
10363
|
);
|
|
10345
10364
|
}, [rawOptions]);
|
|
10346
|
-
const displayValue =
|
|
10365
|
+
const displayValue = React44__namespace.useMemo(() => {
|
|
10347
10366
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
10348
10367
|
return String(value.expression ?? "");
|
|
10349
10368
|
}
|
|
10350
10369
|
return String(value ?? "");
|
|
10351
10370
|
}, [value]);
|
|
10352
|
-
const isExpression =
|
|
10371
|
+
const isExpression = React44__namespace.useMemo(() => {
|
|
10353
10372
|
return value && typeof value === "object" && "expression" in value;
|
|
10354
10373
|
}, [value]);
|
|
10355
|
-
|
|
10374
|
+
React44__namespace.useEffect(() => {
|
|
10356
10375
|
if (isExpression) {
|
|
10357
10376
|
setIsExpressionMode(true);
|
|
10358
10377
|
setExpressionValue(displayValue);
|
|
10359
10378
|
}
|
|
10360
10379
|
}, [isExpression, displayValue]);
|
|
10361
|
-
const handleSelectChange =
|
|
10380
|
+
const handleSelectChange = React44__namespace.useCallback((newValue) => {
|
|
10362
10381
|
if (newValue === "__expression__") {
|
|
10363
10382
|
setIsExpressionMode(true);
|
|
10364
10383
|
return;
|
|
10365
10384
|
}
|
|
10366
10385
|
onChange(newValue);
|
|
10367
10386
|
}, [onChange]);
|
|
10368
|
-
const handleExpressionChange =
|
|
10387
|
+
const handleExpressionChange = React44__namespace.useCallback((e) => {
|
|
10369
10388
|
const newValue = e.target.value;
|
|
10370
10389
|
setExpressionValue(newValue);
|
|
10371
10390
|
onChange({
|
|
@@ -10373,7 +10392,7 @@ function Select3({
|
|
|
10373
10392
|
type: "expression"
|
|
10374
10393
|
});
|
|
10375
10394
|
}, [onChange]);
|
|
10376
|
-
const handleSwitchToValue =
|
|
10395
|
+
const handleSwitchToValue = React44__namespace.useCallback(() => {
|
|
10377
10396
|
setIsExpressionMode(false);
|
|
10378
10397
|
setExpressionValue("");
|
|
10379
10398
|
onChange("");
|
|
@@ -10402,7 +10421,7 @@ function Select3({
|
|
|
10402
10421
|
hasError: showError
|
|
10403
10422
|
};
|
|
10404
10423
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
10405
|
-
return /* @__PURE__ */
|
|
10424
|
+
return /* @__PURE__ */ React44__namespace.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React44__namespace.createElement(
|
|
10406
10425
|
"label",
|
|
10407
10426
|
{
|
|
10408
10427
|
htmlFor: fieldName,
|
|
@@ -10410,7 +10429,7 @@ function Select3({
|
|
|
10410
10429
|
},
|
|
10411
10430
|
label,
|
|
10412
10431
|
":"
|
|
10413
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
10432
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44__namespace.createElement(
|
|
10414
10433
|
"span",
|
|
10415
10434
|
{
|
|
10416
10435
|
className: cn(
|
|
@@ -10420,12 +10439,12 @@ function Select3({
|
|
|
10420
10439
|
title: resolvedExpectedType
|
|
10421
10440
|
},
|
|
10422
10441
|
resolvedExpectedType
|
|
10423
|
-
), showError && /* @__PURE__ */
|
|
10442
|
+
), showError && /* @__PURE__ */ React44__namespace.createElement("span", { className: "uii:-mt-2 uii:inline-flex uii:px-1 uii:py-0.5 uii:bg-red-100 uii:text-red-600 uii:rounded-sm uii:text-[10px] uii:font-medium" }, "Required")), /* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:mt-0.5" }, children ? (
|
|
10424
10443
|
// Use custom render function
|
|
10425
10444
|
children(renderProps)
|
|
10426
10445
|
) : isExpressionMode ? (
|
|
10427
10446
|
// Expression mode - show input with clear button
|
|
10428
|
-
/* @__PURE__ */
|
|
10447
|
+
/* @__PURE__ */ React44__namespace.createElement("div", { className: "uii:flex uii:items-center uii:h-9 uii:rounded-sm uii:border uii:border-amber-500/50 uii:bg-amber-500/5" }, /* @__PURE__ */ React44__namespace.createElement(
|
|
10429
10448
|
"input",
|
|
10430
10449
|
{
|
|
10431
10450
|
id: fieldName,
|
|
@@ -10441,7 +10460,7 @@ function Select3({
|
|
|
10441
10460
|
disabled && "uii:opacity-50 uii:cursor-not-allowed"
|
|
10442
10461
|
)
|
|
10443
10462
|
}
|
|
10444
|
-
), /* @__PURE__ */
|
|
10463
|
+
), /* @__PURE__ */ React44__namespace.createElement(
|
|
10445
10464
|
"button",
|
|
10446
10465
|
{
|
|
10447
10466
|
type: "button",
|
|
@@ -10483,21 +10502,21 @@ function Select3({
|
|
|
10483
10502
|
// 📝 Custom Expression
|
|
10484
10503
|
// </option>
|
|
10485
10504
|
// </select>
|
|
10486
|
-
/* @__PURE__ */
|
|
10505
|
+
/* @__PURE__ */ React44__namespace.createElement(
|
|
10487
10506
|
Select2,
|
|
10488
10507
|
{
|
|
10489
10508
|
value: displayValue,
|
|
10490
10509
|
onValueChange: (e) => handleSelectChange(e),
|
|
10491
10510
|
disabled: disabled ?? disabled
|
|
10492
10511
|
},
|
|
10493
|
-
/* @__PURE__ */
|
|
10512
|
+
/* @__PURE__ */ React44__namespace.createElement(
|
|
10494
10513
|
SelectTrigger2,
|
|
10495
10514
|
{
|
|
10496
10515
|
className: "ui:w-full ui:h-9 ui:px-3 ui:border ui:border-input ui:rounded-sm ui:bg-background"
|
|
10497
10516
|
},
|
|
10498
|
-
/* @__PURE__ */
|
|
10517
|
+
/* @__PURE__ */ React44__namespace.createElement(SelectValue2, { placeholder })
|
|
10499
10518
|
),
|
|
10500
|
-
/* @__PURE__ */
|
|
10519
|
+
/* @__PURE__ */ React44__namespace.createElement(SelectContent2, null, options.map((opt) => /* @__PURE__ */ React44__namespace.createElement(SelectItem2, { key: opt.value, value: opt.value }, opt.node ? opt.node : /* @__PURE__ */ React44__namespace.createElement(React44__namespace.Fragment, null, opt.label))))
|
|
10501
10520
|
)
|
|
10502
10521
|
)));
|
|
10503
10522
|
}
|
|
@@ -10628,17 +10647,17 @@ function useFieldPath(fieldName) {
|
|
|
10628
10647
|
return fieldName;
|
|
10629
10648
|
}
|
|
10630
10649
|
function TemplateFieldProvider({ children }) {
|
|
10631
|
-
return /* @__PURE__ */
|
|
10650
|
+
return /* @__PURE__ */ React44__namespace.default.createElement(React44__namespace.default.Fragment, null, children);
|
|
10632
10651
|
}
|
|
10633
10652
|
function NestedFieldProvider({
|
|
10634
10653
|
children
|
|
10635
10654
|
}) {
|
|
10636
|
-
return /* @__PURE__ */
|
|
10655
|
+
return /* @__PURE__ */ React44__namespace.default.createElement(React44__namespace.default.Fragment, null, children);
|
|
10637
10656
|
}
|
|
10638
|
-
var InferredTypesContext =
|
|
10657
|
+
var InferredTypesContext = React44.createContext(null);
|
|
10639
10658
|
function useInferredTypes() {
|
|
10640
|
-
const devContext =
|
|
10641
|
-
const realContext =
|
|
10659
|
+
const devContext = React44.useContext(DevContext);
|
|
10660
|
+
const realContext = React44.useContext(InferredTypesContext);
|
|
10642
10661
|
if (devContext) {
|
|
10643
10662
|
return {
|
|
10644
10663
|
inferredTypes: devContext.inferredTypes,
|
|
@@ -10651,7 +10670,7 @@ function useInferredTypes() {
|
|
|
10651
10670
|
return realContext;
|
|
10652
10671
|
}
|
|
10653
10672
|
function InferredTypesProvider({ children }) {
|
|
10654
|
-
return /* @__PURE__ */
|
|
10673
|
+
return /* @__PURE__ */ React44__namespace.default.createElement(React44__namespace.default.Fragment, null, children);
|
|
10655
10674
|
}
|
|
10656
10675
|
function intersectTypes(types) {
|
|
10657
10676
|
const validTypes = types.filter((t) => !!t && t.length > 0);
|
|
@@ -10712,33 +10731,33 @@ function getOperatorsForType(type) {
|
|
|
10712
10731
|
];
|
|
10713
10732
|
}
|
|
10714
10733
|
function NodePropertyProvider({ children }) {
|
|
10715
|
-
return /* @__PURE__ */
|
|
10734
|
+
return /* @__PURE__ */ React44__namespace.default.createElement(React44__namespace.default.Fragment, null, children);
|
|
10716
10735
|
}
|
|
10717
10736
|
function useSetFieldMetadataOnly() {
|
|
10718
|
-
return
|
|
10737
|
+
return React44.useCallback((_fieldKey, _metadata) => {
|
|
10719
10738
|
}, []);
|
|
10720
10739
|
}
|
|
10721
10740
|
function useIsInNodePropertyProvider() {
|
|
10722
|
-
const devContext =
|
|
10741
|
+
const devContext = React44.useContext(DevContext);
|
|
10723
10742
|
return devContext !== null;
|
|
10724
10743
|
}
|
|
10725
10744
|
function useNodeProperty(key) {
|
|
10726
|
-
const devContext =
|
|
10727
|
-
const [devValue, setDevValue] =
|
|
10745
|
+
const devContext = React44.useContext(DevContext);
|
|
10746
|
+
const [devValue, setDevValue] = React44.useState(
|
|
10728
10747
|
() => devContext?.data?.[key]
|
|
10729
10748
|
);
|
|
10730
|
-
|
|
10749
|
+
React44__namespace.default.useEffect(() => {
|
|
10731
10750
|
if (devContext) {
|
|
10732
10751
|
setDevValue(devContext.data[key]);
|
|
10733
10752
|
}
|
|
10734
10753
|
}, [devContext, key]);
|
|
10735
|
-
const devSetter =
|
|
10754
|
+
const devSetter = React44.useCallback((value, _metadata) => {
|
|
10736
10755
|
if (devContext) {
|
|
10737
10756
|
devContext.setProperty(key, value);
|
|
10738
10757
|
setDevValue(value);
|
|
10739
10758
|
}
|
|
10740
10759
|
}, [devContext, key]);
|
|
10741
|
-
const noopSetter =
|
|
10760
|
+
const noopSetter = React44.useCallback(() => {
|
|
10742
10761
|
console.warn(`[useNodeProperty] No provider - cannot set "${key}"`);
|
|
10743
10762
|
}, [key]);
|
|
10744
10763
|
if (devContext) {
|
|
@@ -10747,16 +10766,16 @@ function useNodeProperty(key) {
|
|
|
10747
10766
|
return [void 0, noopSetter];
|
|
10748
10767
|
}
|
|
10749
10768
|
function useNodeProperties() {
|
|
10750
|
-
const devContext =
|
|
10751
|
-
const [devData, setDevData] =
|
|
10769
|
+
const devContext = React44.useContext(DevContext);
|
|
10770
|
+
const [devData, setDevData] = React44.useState(
|
|
10752
10771
|
() => devContext?.data ?? {}
|
|
10753
10772
|
);
|
|
10754
|
-
|
|
10773
|
+
React44__namespace.default.useEffect(() => {
|
|
10755
10774
|
if (devContext) {
|
|
10756
10775
|
setDevData({ ...devContext.data });
|
|
10757
10776
|
}
|
|
10758
10777
|
}, [devContext, devContext?.data]);
|
|
10759
|
-
const devSetter =
|
|
10778
|
+
const devSetter = React44.useCallback((updates) => {
|
|
10760
10779
|
if (devContext) {
|
|
10761
10780
|
Object.entries(updates).forEach(([key, value]) => {
|
|
10762
10781
|
devContext.setProperty(key, value);
|
|
@@ -10764,7 +10783,7 @@ function useNodeProperties() {
|
|
|
10764
10783
|
setDevData((prev) => ({ ...prev, ...updates }));
|
|
10765
10784
|
}
|
|
10766
10785
|
}, [devContext]);
|
|
10767
|
-
const noopSetter =
|
|
10786
|
+
const noopSetter = React44.useCallback(() => {
|
|
10768
10787
|
console.warn("[useNodeProperties] No provider - cannot set properties");
|
|
10769
10788
|
}, []);
|
|
10770
10789
|
if (devContext) {
|
|
@@ -10773,11 +10792,11 @@ function useNodeProperties() {
|
|
|
10773
10792
|
return [{}, noopSetter];
|
|
10774
10793
|
}
|
|
10775
10794
|
function useInferredType(fieldName) {
|
|
10776
|
-
const devContext =
|
|
10777
|
-
const [devInferredType, setDevInferredType] =
|
|
10795
|
+
const devContext = React44.useContext(DevContext);
|
|
10796
|
+
const [devInferredType, setDevInferredType] = React44.useState(
|
|
10778
10797
|
() => devContext?.inferredTypes?.[fieldName]
|
|
10779
10798
|
);
|
|
10780
|
-
|
|
10799
|
+
React44__namespace.default.useEffect(() => {
|
|
10781
10800
|
if (devContext) {
|
|
10782
10801
|
setDevInferredType(devContext.inferredTypes[fieldName]);
|
|
10783
10802
|
}
|
|
@@ -10788,8 +10807,8 @@ function useInferredType(fieldName) {
|
|
|
10788
10807
|
return void 0;
|
|
10789
10808
|
}
|
|
10790
10809
|
function useSetInferredType() {
|
|
10791
|
-
const devContext =
|
|
10792
|
-
return
|
|
10810
|
+
const devContext = React44.useContext(DevContext);
|
|
10811
|
+
return React44.useCallback((fieldName, type) => {
|
|
10793
10812
|
if (devContext) {
|
|
10794
10813
|
devContext.setInferredType(fieldName, type);
|
|
10795
10814
|
} else {
|
|
@@ -10798,8 +10817,8 @@ function useSetInferredType() {
|
|
|
10798
10817
|
}, [devContext]);
|
|
10799
10818
|
}
|
|
10800
10819
|
function useClearInferredType() {
|
|
10801
|
-
const devContext =
|
|
10802
|
-
return
|
|
10820
|
+
const devContext = React44.useContext(DevContext);
|
|
10821
|
+
return React44.useCallback((fieldName) => {
|
|
10803
10822
|
if (devContext) {
|
|
10804
10823
|
devContext.clearInferredType(fieldName);
|
|
10805
10824
|
} else {
|
|
@@ -10808,8 +10827,8 @@ function useClearInferredType() {
|
|
|
10808
10827
|
}, [devContext]);
|
|
10809
10828
|
}
|
|
10810
10829
|
function useClearAllInferredTypes() {
|
|
10811
|
-
const devContext =
|
|
10812
|
-
return
|
|
10830
|
+
const devContext = React44.useContext(DevContext);
|
|
10831
|
+
return React44.useCallback(() => {
|
|
10813
10832
|
if (devContext) {
|
|
10814
10833
|
devContext.clearAllInferredTypes();
|
|
10815
10834
|
} else {
|
|
@@ -10818,7 +10837,7 @@ function useClearAllInferredTypes() {
|
|
|
10818
10837
|
}, [devContext]);
|
|
10819
10838
|
}
|
|
10820
10839
|
function useClearValidationErrorsByPrefix() {
|
|
10821
|
-
return
|
|
10840
|
+
return React44.useCallback((fieldPrefix) => {
|
|
10822
10841
|
console.log(`[useClearValidationErrorsByPrefix] Dev mode - clearing errors with prefix "${fieldPrefix}" is a no-op`);
|
|
10823
10842
|
}, []);
|
|
10824
10843
|
}
|
|
@@ -10835,11 +10854,11 @@ function useFlowEditorActions() {
|
|
|
10835
10854
|
};
|
|
10836
10855
|
}
|
|
10837
10856
|
function useAllInferredTypes() {
|
|
10838
|
-
const devContext =
|
|
10839
|
-
const [devTypes, setDevTypes] =
|
|
10857
|
+
const devContext = React44.useContext(DevContext);
|
|
10858
|
+
const [devTypes, setDevTypes] = React44.useState(
|
|
10840
10859
|
() => devContext?.inferredTypes ?? {}
|
|
10841
10860
|
);
|
|
10842
|
-
|
|
10861
|
+
React44__namespace.default.useEffect(() => {
|
|
10843
10862
|
if (devContext) {
|
|
10844
10863
|
setDevTypes({ ...devContext.inferredTypes });
|
|
10845
10864
|
}
|
|
@@ -10850,8 +10869,8 @@ function useAllInferredTypes() {
|
|
|
10850
10869
|
return {};
|
|
10851
10870
|
}
|
|
10852
10871
|
function useSetProperty() {
|
|
10853
|
-
const devContext =
|
|
10854
|
-
return
|
|
10872
|
+
const devContext = React44.useContext(DevContext);
|
|
10873
|
+
return React44.useCallback((key, value, _metadata) => {
|
|
10855
10874
|
if (devContext) {
|
|
10856
10875
|
devContext.setProperty(key, value);
|
|
10857
10876
|
} else {
|
|
@@ -10860,8 +10879,8 @@ function useSetProperty() {
|
|
|
10860
10879
|
}, [devContext]);
|
|
10861
10880
|
}
|
|
10862
10881
|
function useTriggerLayoutUpdate() {
|
|
10863
|
-
const devContext =
|
|
10864
|
-
return
|
|
10882
|
+
const devContext = React44.useContext(DevContext);
|
|
10883
|
+
return React44.useCallback(() => {
|
|
10865
10884
|
if (devContext) {
|
|
10866
10885
|
console.log("[useTriggerLayoutUpdate] Dev mode - layout update is a no-op");
|
|
10867
10886
|
} else {
|
|
@@ -10870,28 +10889,28 @@ function useTriggerLayoutUpdate() {
|
|
|
10870
10889
|
}, [devContext]);
|
|
10871
10890
|
}
|
|
10872
10891
|
function useFieldValidation() {
|
|
10873
|
-
const setFieldRequired =
|
|
10892
|
+
const setFieldRequired = React44.useCallback((fieldName, required) => {
|
|
10874
10893
|
console.warn(`[useFieldValidation] Mock mode - cannot set required for "${fieldName}"`);
|
|
10875
10894
|
}, []);
|
|
10876
|
-
const setFieldRequiredIf =
|
|
10895
|
+
const setFieldRequiredIf = React44.useCallback(
|
|
10877
10896
|
(fieldName, requiredIf) => {
|
|
10878
10897
|
console.warn(`[useFieldValidation] Mock mode - cannot set requiredIf for "${fieldName}"`);
|
|
10879
10898
|
},
|
|
10880
10899
|
[]
|
|
10881
10900
|
);
|
|
10882
|
-
const setFieldValidation =
|
|
10901
|
+
const setFieldValidation = React44.useCallback(
|
|
10883
10902
|
(fieldName, customValidation) => {
|
|
10884
10903
|
console.warn(`[useFieldValidation] Mock mode - cannot set validation for "${fieldName}"`);
|
|
10885
10904
|
},
|
|
10886
10905
|
[]
|
|
10887
10906
|
);
|
|
10888
|
-
const clearFieldValidation =
|
|
10907
|
+
const clearFieldValidation = React44.useCallback((fieldName) => {
|
|
10889
10908
|
console.warn(`[useFieldValidation] Mock mode - cannot clear validation for "${fieldName}"`);
|
|
10890
10909
|
}, []);
|
|
10891
|
-
const isFieldRequired =
|
|
10910
|
+
const isFieldRequired = React44.useCallback((fieldName) => {
|
|
10892
10911
|
return false;
|
|
10893
10912
|
}, []);
|
|
10894
|
-
const validateField =
|
|
10913
|
+
const validateField = React44.useCallback((fieldName) => {
|
|
10895
10914
|
return null;
|
|
10896
10915
|
}, []);
|
|
10897
10916
|
return {
|
|
@@ -10941,9 +10960,11 @@ exports.DropdownMenuSub = DropdownMenuSub2;
|
|
|
10941
10960
|
exports.DropdownMenuSubContent = DropdownMenuSubContent2;
|
|
10942
10961
|
exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger2;
|
|
10943
10962
|
exports.DropdownMenuTrigger = DropdownMenuTrigger2;
|
|
10963
|
+
exports.LogicToggleButton = LogicToggleButton;
|
|
10944
10964
|
exports.ToggleButton = ToggleButton;
|
|
10945
10965
|
exports.buttonVariants = buttonVariants;
|
|
10946
10966
|
exports.fields = fields_exports;
|
|
10967
|
+
exports.logicToggleButtonStyles = logicToggleButtonStyles;
|
|
10947
10968
|
exports.toggleButtonVariants = toggleButtonVariants;
|
|
10948
10969
|
//# sourceMappingURL=index.cjs.map
|
|
10949
10970
|
//# sourceMappingURL=index.cjs.map
|