@process.co/ui 0.0.15 → 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 +119 -5
- 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 +119 -7
- 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 +553 -425
- 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 +513 -387
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React44 from 'react';
|
|
2
|
+
import React44__default, { forwardRef, createElement, createContext, useLayoutEffect, useState, useContext, useCallback } from 'react';
|
|
3
3
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
4
|
import * as ReactDOM4 from 'react-dom';
|
|
5
5
|
import ReactDOM4__default from 'react-dom';
|
|
6
|
-
import { CheckIcon, CircleIcon, ChevronRightIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
|
|
7
6
|
|
|
8
7
|
var __defProp = Object.defineProperty;
|
|
9
8
|
var __export = (target, all) => {
|
|
@@ -42,10 +41,10 @@ function composeRefs(...refs) {
|
|
|
42
41
|
};
|
|
43
42
|
}
|
|
44
43
|
function useComposedRefs(...refs) {
|
|
45
|
-
return
|
|
44
|
+
return React44.useCallback(composeRefs(...refs), refs);
|
|
46
45
|
}
|
|
47
46
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
48
|
-
var use =
|
|
47
|
+
var use = React44[" use ".trim().toString()];
|
|
49
48
|
function isPromiseLike(value) {
|
|
50
49
|
return typeof value === "object" && value !== null && "then" in value;
|
|
51
50
|
}
|
|
@@ -55,24 +54,24 @@ function isLazyComponent(element) {
|
|
|
55
54
|
// @__NO_SIDE_EFFECTS__
|
|
56
55
|
function createSlot(ownerName) {
|
|
57
56
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
58
|
-
const Slot22 =
|
|
57
|
+
const Slot22 = React44.forwardRef((props, forwardedRef) => {
|
|
59
58
|
let { children, ...slotProps } = props;
|
|
60
59
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
61
60
|
children = use(children._payload);
|
|
62
61
|
}
|
|
63
|
-
const childrenArray =
|
|
62
|
+
const childrenArray = React44.Children.toArray(children);
|
|
64
63
|
const slottable = childrenArray.find(isSlottable);
|
|
65
64
|
if (slottable) {
|
|
66
65
|
const newElement = slottable.props.children;
|
|
67
66
|
const newChildren = childrenArray.map((child) => {
|
|
68
67
|
if (child === slottable) {
|
|
69
|
-
if (
|
|
70
|
-
return
|
|
68
|
+
if (React44.Children.count(newElement) > 1) return React44.Children.only(null);
|
|
69
|
+
return React44.isValidElement(newElement) ? newElement.props.children : null;
|
|
71
70
|
} else {
|
|
72
71
|
return child;
|
|
73
72
|
}
|
|
74
73
|
});
|
|
75
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
74
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React44.isValidElement(newElement) ? React44.cloneElement(newElement, void 0, newChildren) : null });
|
|
76
75
|
}
|
|
77
76
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
78
77
|
});
|
|
@@ -82,27 +81,27 @@ function createSlot(ownerName) {
|
|
|
82
81
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
83
82
|
// @__NO_SIDE_EFFECTS__
|
|
84
83
|
function createSlotClone(ownerName) {
|
|
85
|
-
const SlotClone =
|
|
84
|
+
const SlotClone = React44.forwardRef((props, forwardedRef) => {
|
|
86
85
|
let { children, ...slotProps } = props;
|
|
87
86
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
88
87
|
children = use(children._payload);
|
|
89
88
|
}
|
|
90
|
-
if (
|
|
89
|
+
if (React44.isValidElement(children)) {
|
|
91
90
|
const childrenRef = getElementRef(children);
|
|
92
91
|
const props2 = mergeProps(slotProps, children.props);
|
|
93
|
-
if (children.type !==
|
|
92
|
+
if (children.type !== React44.Fragment) {
|
|
94
93
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
95
94
|
}
|
|
96
|
-
return
|
|
95
|
+
return React44.cloneElement(children, props2);
|
|
97
96
|
}
|
|
98
|
-
return
|
|
97
|
+
return React44.Children.count(children) > 1 ? React44.Children.only(null) : null;
|
|
99
98
|
});
|
|
100
99
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
101
100
|
return SlotClone;
|
|
102
101
|
}
|
|
103
102
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
104
103
|
function isSlottable(child) {
|
|
105
|
-
return
|
|
104
|
+
return React44.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
106
105
|
}
|
|
107
106
|
function mergeProps(slotProps, childProps) {
|
|
108
107
|
const overrideProps = { ...childProps };
|
|
@@ -3249,7 +3248,7 @@ function Button({
|
|
|
3249
3248
|
...props
|
|
3250
3249
|
}) {
|
|
3251
3250
|
const Comp = asChild ? Slot : "button";
|
|
3252
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3253
3252
|
Comp,
|
|
3254
3253
|
{
|
|
3255
3254
|
"data-slot": "button",
|
|
@@ -3266,9 +3265,9 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
3266
3265
|
}
|
|
3267
3266
|
};
|
|
3268
3267
|
}
|
|
3269
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3268
|
+
var useLayoutEffect2 = globalThis?.document ? React44.useLayoutEffect : () => {
|
|
3270
3269
|
};
|
|
3271
|
-
var useInsertionEffect =
|
|
3270
|
+
var useInsertionEffect = React44[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3272
3271
|
function useControllableState({
|
|
3273
3272
|
prop,
|
|
3274
3273
|
defaultProp,
|
|
@@ -3283,8 +3282,8 @@ function useControllableState({
|
|
|
3283
3282
|
const isControlled = prop !== void 0;
|
|
3284
3283
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3285
3284
|
{
|
|
3286
|
-
const isControlledRef =
|
|
3287
|
-
|
|
3285
|
+
const isControlledRef = React44.useRef(prop !== void 0);
|
|
3286
|
+
React44.useEffect(() => {
|
|
3288
3287
|
const wasControlled = isControlledRef.current;
|
|
3289
3288
|
if (wasControlled !== isControlled) {
|
|
3290
3289
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -3296,7 +3295,7 @@ function useControllableState({
|
|
|
3296
3295
|
isControlledRef.current = isControlled;
|
|
3297
3296
|
}, [isControlled, caller]);
|
|
3298
3297
|
}
|
|
3299
|
-
const setValue =
|
|
3298
|
+
const setValue = React44.useCallback(
|
|
3300
3299
|
(nextValue) => {
|
|
3301
3300
|
if (isControlled) {
|
|
3302
3301
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -3315,13 +3314,13 @@ function useUncontrolledState({
|
|
|
3315
3314
|
defaultProp,
|
|
3316
3315
|
onChange
|
|
3317
3316
|
}) {
|
|
3318
|
-
const [value, setValue] =
|
|
3319
|
-
const prevValueRef =
|
|
3320
|
-
const onChangeRef =
|
|
3317
|
+
const [value, setValue] = React44.useState(defaultProp);
|
|
3318
|
+
const prevValueRef = React44.useRef(value);
|
|
3319
|
+
const onChangeRef = React44.useRef(onChange);
|
|
3321
3320
|
useInsertionEffect(() => {
|
|
3322
3321
|
onChangeRef.current = onChange;
|
|
3323
3322
|
}, [onChange]);
|
|
3324
|
-
|
|
3323
|
+
React44.useEffect(() => {
|
|
3325
3324
|
if (prevValueRef.current !== value) {
|
|
3326
3325
|
onChangeRef.current?.(value);
|
|
3327
3326
|
prevValueRef.current = value;
|
|
@@ -3335,21 +3334,21 @@ function isFunction(value) {
|
|
|
3335
3334
|
// @__NO_SIDE_EFFECTS__
|
|
3336
3335
|
function createSlot2(ownerName) {
|
|
3337
3336
|
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
3338
|
-
const Slot22 =
|
|
3337
|
+
const Slot22 = React44.forwardRef((props, forwardedRef) => {
|
|
3339
3338
|
const { children, ...slotProps } = props;
|
|
3340
|
-
const childrenArray =
|
|
3339
|
+
const childrenArray = React44.Children.toArray(children);
|
|
3341
3340
|
const slottable = childrenArray.find(isSlottable2);
|
|
3342
3341
|
if (slottable) {
|
|
3343
3342
|
const newElement = slottable.props.children;
|
|
3344
3343
|
const newChildren = childrenArray.map((child) => {
|
|
3345
3344
|
if (child === slottable) {
|
|
3346
|
-
if (
|
|
3347
|
-
return
|
|
3345
|
+
if (React44.Children.count(newElement) > 1) return React44.Children.only(null);
|
|
3346
|
+
return React44.isValidElement(newElement) ? newElement.props.children : null;
|
|
3348
3347
|
} else {
|
|
3349
3348
|
return child;
|
|
3350
3349
|
}
|
|
3351
3350
|
});
|
|
3352
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children:
|
|
3351
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React44.isValidElement(newElement) ? React44.cloneElement(newElement, void 0, newChildren) : null });
|
|
3353
3352
|
}
|
|
3354
3353
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
3355
3354
|
});
|
|
@@ -3358,24 +3357,24 @@ function createSlot2(ownerName) {
|
|
|
3358
3357
|
}
|
|
3359
3358
|
// @__NO_SIDE_EFFECTS__
|
|
3360
3359
|
function createSlotClone2(ownerName) {
|
|
3361
|
-
const SlotClone =
|
|
3360
|
+
const SlotClone = React44.forwardRef((props, forwardedRef) => {
|
|
3362
3361
|
const { children, ...slotProps } = props;
|
|
3363
|
-
if (
|
|
3362
|
+
if (React44.isValidElement(children)) {
|
|
3364
3363
|
const childrenRef = getElementRef2(children);
|
|
3365
3364
|
const props2 = mergeProps2(slotProps, children.props);
|
|
3366
|
-
if (children.type !==
|
|
3365
|
+
if (children.type !== React44.Fragment) {
|
|
3367
3366
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
3368
3367
|
}
|
|
3369
|
-
return
|
|
3368
|
+
return React44.cloneElement(children, props2);
|
|
3370
3369
|
}
|
|
3371
|
-
return
|
|
3370
|
+
return React44.Children.count(children) > 1 ? React44.Children.only(null) : null;
|
|
3372
3371
|
});
|
|
3373
3372
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
3374
3373
|
return SlotClone;
|
|
3375
3374
|
}
|
|
3376
3375
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
3377
3376
|
function isSlottable2(child) {
|
|
3378
|
-
return
|
|
3377
|
+
return React44.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
3379
3378
|
}
|
|
3380
3379
|
function mergeProps2(slotProps, childProps) {
|
|
3381
3380
|
const overrideProps = { ...childProps };
|
|
@@ -3435,7 +3434,7 @@ var NODES = [
|
|
|
3435
3434
|
];
|
|
3436
3435
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
3437
3436
|
const Slot4 = createSlot2(`Primitive.${node}`);
|
|
3438
|
-
const Node2 =
|
|
3437
|
+
const Node2 = React44.forwardRef((props, forwardedRef) => {
|
|
3439
3438
|
const { asChild, ...primitiveProps } = props;
|
|
3440
3439
|
const Comp = asChild ? Slot4 : node;
|
|
3441
3440
|
if (typeof window !== "undefined") {
|
|
@@ -3450,7 +3449,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
3450
3449
|
if (target) ReactDOM4.flushSync(() => target.dispatchEvent(event));
|
|
3451
3450
|
}
|
|
3452
3451
|
var NAME = "Toggle";
|
|
3453
|
-
var Toggle =
|
|
3452
|
+
var Toggle = React44.forwardRef((props, forwardedRef) => {
|
|
3454
3453
|
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
3455
3454
|
const [pressed, setPressed] = useControllableState({
|
|
3456
3455
|
prop: pressedProp,
|
|
@@ -3504,7 +3503,7 @@ var toggleButtonVariants = cva(
|
|
|
3504
3503
|
}
|
|
3505
3504
|
);
|
|
3506
3505
|
function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
3507
|
-
return /* @__PURE__ */
|
|
3506
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3508
3507
|
Root,
|
|
3509
3508
|
{
|
|
3510
3509
|
"data-slot": "toggle-button",
|
|
@@ -3513,22 +3512,39 @@ function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
|
3513
3512
|
}
|
|
3514
3513
|
);
|
|
3515
3514
|
}
|
|
3515
|
+
var logicToggleButtonStyles = [
|
|
3516
|
+
"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",
|
|
3517
|
+
"uii:data-[state=on]:bg-[#3b82f6] uii:data-[state=on]:text-white uii:data-[state=on]:border-[#3b82f6]",
|
|
3518
|
+
"uii:data-[state=off]:bg-[#f3f4f6] uii:data-[state=off]:text-[#374151] uii:data-[state=off]:hover:bg-[#e5e7eb]"
|
|
3519
|
+
].join(" ");
|
|
3520
|
+
var logicToggleButtonLabelStyles = "uii:inline-block uii:whitespace-nowrap uii:[transform:rotate(-90deg)]";
|
|
3521
|
+
function LogicToggleButton({ className, children, ...props }) {
|
|
3522
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3523
|
+
Root,
|
|
3524
|
+
{
|
|
3525
|
+
"data-slot": "logic-toggle-button",
|
|
3526
|
+
className: cn(logicToggleButtonStyles, className),
|
|
3527
|
+
...props
|
|
3528
|
+
},
|
|
3529
|
+
children != null ? /* @__PURE__ */ React44.createElement("span", { className: logicToggleButtonLabelStyles }, children) : null
|
|
3530
|
+
);
|
|
3531
|
+
}
|
|
3516
3532
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
3517
3533
|
let defaultContexts = [];
|
|
3518
3534
|
function createContext32(rootComponentName, defaultContext) {
|
|
3519
|
-
const BaseContext =
|
|
3535
|
+
const BaseContext = React44.createContext(defaultContext);
|
|
3520
3536
|
const index2 = defaultContexts.length;
|
|
3521
3537
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
3522
3538
|
const Provider = (props) => {
|
|
3523
3539
|
const { scope, children, ...context } = props;
|
|
3524
3540
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3525
|
-
const value =
|
|
3541
|
+
const value = React44.useMemo(() => context, Object.values(context));
|
|
3526
3542
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
3527
3543
|
};
|
|
3528
3544
|
Provider.displayName = rootComponentName + "Provider";
|
|
3529
3545
|
function useContext22(consumerName, scope) {
|
|
3530
3546
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3531
|
-
const context =
|
|
3547
|
+
const context = React44.useContext(Context);
|
|
3532
3548
|
if (context) return context;
|
|
3533
3549
|
if (defaultContext !== void 0) return defaultContext;
|
|
3534
3550
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -3537,11 +3553,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
3537
3553
|
}
|
|
3538
3554
|
const createScope = () => {
|
|
3539
3555
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
3540
|
-
return
|
|
3556
|
+
return React44.createContext(defaultContext);
|
|
3541
3557
|
});
|
|
3542
3558
|
return function useScope(scope) {
|
|
3543
3559
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
3544
|
-
return
|
|
3560
|
+
return React44.useMemo(
|
|
3545
3561
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
3546
3562
|
[scope, contexts]
|
|
3547
3563
|
);
|
|
@@ -3564,7 +3580,7 @@ function composeContextScopes(...scopes) {
|
|
|
3564
3580
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
3565
3581
|
return { ...nextScopes2, ...currentScope };
|
|
3566
3582
|
}, {});
|
|
3567
|
-
return
|
|
3583
|
+
return React44.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
3568
3584
|
};
|
|
3569
3585
|
};
|
|
3570
3586
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -3579,14 +3595,14 @@ function createCollection(name) {
|
|
|
3579
3595
|
);
|
|
3580
3596
|
const CollectionProvider = (props) => {
|
|
3581
3597
|
const { scope, children } = props;
|
|
3582
|
-
const ref =
|
|
3583
|
-
const itemMap =
|
|
3598
|
+
const ref = React44__default.useRef(null);
|
|
3599
|
+
const itemMap = React44__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
3584
3600
|
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
3585
3601
|
};
|
|
3586
3602
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
3587
3603
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
3588
3604
|
const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);
|
|
3589
|
-
const CollectionSlot =
|
|
3605
|
+
const CollectionSlot = React44__default.forwardRef(
|
|
3590
3606
|
(props, forwardedRef) => {
|
|
3591
3607
|
const { scope, children } = props;
|
|
3592
3608
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -3598,13 +3614,13 @@ function createCollection(name) {
|
|
|
3598
3614
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
3599
3615
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
3600
3616
|
const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);
|
|
3601
|
-
const CollectionItemSlot =
|
|
3617
|
+
const CollectionItemSlot = React44__default.forwardRef(
|
|
3602
3618
|
(props, forwardedRef) => {
|
|
3603
3619
|
const { scope, children, ...itemData } = props;
|
|
3604
|
-
const ref =
|
|
3620
|
+
const ref = React44__default.useRef(null);
|
|
3605
3621
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3606
3622
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
3607
|
-
|
|
3623
|
+
React44__default.useEffect(() => {
|
|
3608
3624
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
3609
3625
|
return () => void context.itemMap.delete(ref);
|
|
3610
3626
|
});
|
|
@@ -3614,7 +3630,7 @@ function createCollection(name) {
|
|
|
3614
3630
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
3615
3631
|
function useCollection4(scope) {
|
|
3616
3632
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
3617
|
-
const getItems =
|
|
3633
|
+
const getItems = React44__default.useCallback(() => {
|
|
3618
3634
|
const collectionNode = context.collectionRef.current;
|
|
3619
3635
|
if (!collectionNode) return [];
|
|
3620
3636
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -3632,21 +3648,21 @@ function createCollection(name) {
|
|
|
3632
3648
|
createCollectionScope4
|
|
3633
3649
|
];
|
|
3634
3650
|
}
|
|
3635
|
-
var DirectionContext =
|
|
3651
|
+
var DirectionContext = React44.createContext(void 0);
|
|
3636
3652
|
function useDirection(localDir) {
|
|
3637
|
-
const globalDir =
|
|
3653
|
+
const globalDir = React44.useContext(DirectionContext);
|
|
3638
3654
|
return localDir || globalDir || "ltr";
|
|
3639
3655
|
}
|
|
3640
3656
|
function useCallbackRef(callback) {
|
|
3641
|
-
const callbackRef =
|
|
3642
|
-
|
|
3657
|
+
const callbackRef = React44.useRef(callback);
|
|
3658
|
+
React44.useEffect(() => {
|
|
3643
3659
|
callbackRef.current = callback;
|
|
3644
3660
|
});
|
|
3645
|
-
return
|
|
3661
|
+
return React44.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
3646
3662
|
}
|
|
3647
3663
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
3648
3664
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
3649
|
-
|
|
3665
|
+
React44.useEffect(() => {
|
|
3650
3666
|
const handleKeyDown = (event) => {
|
|
3651
3667
|
if (event.key === "Escape") {
|
|
3652
3668
|
onEscapeKeyDown(event);
|
|
@@ -3661,12 +3677,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
3661
3677
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3662
3678
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3663
3679
|
var originalBodyPointerEvents;
|
|
3664
|
-
var DismissableLayerContext =
|
|
3680
|
+
var DismissableLayerContext = React44.createContext({
|
|
3665
3681
|
layers: /* @__PURE__ */ new Set(),
|
|
3666
3682
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3667
3683
|
branches: /* @__PURE__ */ new Set()
|
|
3668
3684
|
});
|
|
3669
|
-
var DismissableLayer =
|
|
3685
|
+
var DismissableLayer = React44.forwardRef(
|
|
3670
3686
|
(props, forwardedRef) => {
|
|
3671
3687
|
const {
|
|
3672
3688
|
disableOutsidePointerEvents = false,
|
|
@@ -3677,10 +3693,10 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3677
3693
|
onDismiss,
|
|
3678
3694
|
...layerProps
|
|
3679
3695
|
} = props;
|
|
3680
|
-
const context =
|
|
3681
|
-
const [node, setNode] =
|
|
3696
|
+
const context = React44.useContext(DismissableLayerContext);
|
|
3697
|
+
const [node, setNode] = React44.useState(null);
|
|
3682
3698
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3683
|
-
const [, force] =
|
|
3699
|
+
const [, force] = React44.useState({});
|
|
3684
3700
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3685
3701
|
const layers = Array.from(context.layers);
|
|
3686
3702
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -3713,7 +3729,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3713
3729
|
onDismiss();
|
|
3714
3730
|
}
|
|
3715
3731
|
}, ownerDocument);
|
|
3716
|
-
|
|
3732
|
+
React44.useEffect(() => {
|
|
3717
3733
|
if (!node) return;
|
|
3718
3734
|
if (disableOutsidePointerEvents) {
|
|
3719
3735
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -3730,7 +3746,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3730
3746
|
}
|
|
3731
3747
|
};
|
|
3732
3748
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3733
|
-
|
|
3749
|
+
React44.useEffect(() => {
|
|
3734
3750
|
return () => {
|
|
3735
3751
|
if (!node) return;
|
|
3736
3752
|
context.layers.delete(node);
|
|
@@ -3738,7 +3754,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3738
3754
|
dispatchUpdate();
|
|
3739
3755
|
};
|
|
3740
3756
|
}, [node, context]);
|
|
3741
|
-
|
|
3757
|
+
React44.useEffect(() => {
|
|
3742
3758
|
const handleUpdate = () => force({});
|
|
3743
3759
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3744
3760
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -3764,11 +3780,11 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3764
3780
|
);
|
|
3765
3781
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3766
3782
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3767
|
-
var DismissableLayerBranch =
|
|
3768
|
-
const context =
|
|
3769
|
-
const ref =
|
|
3783
|
+
var DismissableLayerBranch = React44.forwardRef((props, forwardedRef) => {
|
|
3784
|
+
const context = React44.useContext(DismissableLayerContext);
|
|
3785
|
+
const ref = React44.useRef(null);
|
|
3770
3786
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3771
|
-
|
|
3787
|
+
React44.useEffect(() => {
|
|
3772
3788
|
const node = ref.current;
|
|
3773
3789
|
if (node) {
|
|
3774
3790
|
context.branches.add(node);
|
|
@@ -3782,10 +3798,10 @@ var DismissableLayerBranch = React43.forwardRef((props, forwardedRef) => {
|
|
|
3782
3798
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3783
3799
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
3784
3800
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3785
|
-
const isPointerInsideReactTreeRef =
|
|
3786
|
-
const handleClickRef =
|
|
3801
|
+
const isPointerInsideReactTreeRef = React44.useRef(false);
|
|
3802
|
+
const handleClickRef = React44.useRef(() => {
|
|
3787
3803
|
});
|
|
3788
|
-
|
|
3804
|
+
React44.useEffect(() => {
|
|
3789
3805
|
const handlePointerDown = (event) => {
|
|
3790
3806
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3791
3807
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -3825,8 +3841,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
3825
3841
|
}
|
|
3826
3842
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3827
3843
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3828
|
-
const isFocusInsideReactTreeRef =
|
|
3829
|
-
|
|
3844
|
+
const isFocusInsideReactTreeRef = React44.useRef(false);
|
|
3845
|
+
React44.useEffect(() => {
|
|
3830
3846
|
const handleFocus = (event) => {
|
|
3831
3847
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3832
3848
|
const eventDetail = { originalEvent: event };
|
|
@@ -3859,7 +3875,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
3859
3875
|
}
|
|
3860
3876
|
var count = 0;
|
|
3861
3877
|
function useFocusGuards() {
|
|
3862
|
-
|
|
3878
|
+
React44.useEffect(() => {
|
|
3863
3879
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3864
3880
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
3865
3881
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -3886,7 +3902,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
3886
3902
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3887
3903
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3888
3904
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
3889
|
-
var FocusScope =
|
|
3905
|
+
var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
3890
3906
|
const {
|
|
3891
3907
|
loop = false,
|
|
3892
3908
|
trapped = false,
|
|
@@ -3894,12 +3910,12 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3894
3910
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
3895
3911
|
...scopeProps
|
|
3896
3912
|
} = props;
|
|
3897
|
-
const [container, setContainer] =
|
|
3913
|
+
const [container, setContainer] = React44.useState(null);
|
|
3898
3914
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3899
3915
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3900
|
-
const lastFocusedElementRef =
|
|
3916
|
+
const lastFocusedElementRef = React44.useRef(null);
|
|
3901
3917
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
3902
|
-
const focusScope =
|
|
3918
|
+
const focusScope = React44.useRef({
|
|
3903
3919
|
paused: false,
|
|
3904
3920
|
pause() {
|
|
3905
3921
|
this.paused = true;
|
|
@@ -3908,7 +3924,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3908
3924
|
this.paused = false;
|
|
3909
3925
|
}
|
|
3910
3926
|
}).current;
|
|
3911
|
-
|
|
3927
|
+
React44.useEffect(() => {
|
|
3912
3928
|
if (trapped) {
|
|
3913
3929
|
let handleFocusIn2 = function(event) {
|
|
3914
3930
|
if (focusScope.paused || !container) return;
|
|
@@ -3943,7 +3959,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3943
3959
|
};
|
|
3944
3960
|
}
|
|
3945
3961
|
}, [trapped, container, focusScope.paused]);
|
|
3946
|
-
|
|
3962
|
+
React44.useEffect(() => {
|
|
3947
3963
|
if (container) {
|
|
3948
3964
|
focusScopesStack.add(focusScope);
|
|
3949
3965
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3974,7 +3990,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3974
3990
|
};
|
|
3975
3991
|
}
|
|
3976
3992
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3977
|
-
const handleKeyDown =
|
|
3993
|
+
const handleKeyDown = React44.useCallback(
|
|
3978
3994
|
(event) => {
|
|
3979
3995
|
if (!loop && !trapped) return;
|
|
3980
3996
|
if (focusScope.paused) return;
|
|
@@ -4081,10 +4097,10 @@ function arrayRemove(array, item) {
|
|
|
4081
4097
|
function removeLinks(items) {
|
|
4082
4098
|
return items.filter((item) => item.tagName !== "A");
|
|
4083
4099
|
}
|
|
4084
|
-
var useReactId =
|
|
4100
|
+
var useReactId = React44[" useId ".trim().toString()] || (() => void 0);
|
|
4085
4101
|
var count2 = 0;
|
|
4086
4102
|
function useId(deterministicId) {
|
|
4087
|
-
const [id, setId] =
|
|
4103
|
+
const [id, setId] = React44.useState(useReactId());
|
|
4088
4104
|
useLayoutEffect2(() => {
|
|
4089
4105
|
setId((reactId) => reactId ?? String(count2++));
|
|
4090
4106
|
}, [deterministicId]);
|
|
@@ -5759,7 +5775,7 @@ function roundByDPR(element, value) {
|
|
|
5759
5775
|
return Math.round(value * dpr) / dpr;
|
|
5760
5776
|
}
|
|
5761
5777
|
function useLatestRef(value) {
|
|
5762
|
-
const ref =
|
|
5778
|
+
const ref = React44.useRef(value);
|
|
5763
5779
|
index(() => {
|
|
5764
5780
|
ref.current = value;
|
|
5765
5781
|
});
|
|
@@ -5782,7 +5798,7 @@ function useFloating(options) {
|
|
|
5782
5798
|
whileElementsMounted,
|
|
5783
5799
|
open
|
|
5784
5800
|
} = options;
|
|
5785
|
-
const [data, setData] =
|
|
5801
|
+
const [data, setData] = React44.useState({
|
|
5786
5802
|
x: 0,
|
|
5787
5803
|
y: 0,
|
|
5788
5804
|
strategy,
|
|
@@ -5790,19 +5806,19 @@ function useFloating(options) {
|
|
|
5790
5806
|
middlewareData: {},
|
|
5791
5807
|
isPositioned: false
|
|
5792
5808
|
});
|
|
5793
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
5809
|
+
const [latestMiddleware, setLatestMiddleware] = React44.useState(middleware);
|
|
5794
5810
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
5795
5811
|
setLatestMiddleware(middleware);
|
|
5796
5812
|
}
|
|
5797
|
-
const [_reference, _setReference] =
|
|
5798
|
-
const [_floating, _setFloating] =
|
|
5799
|
-
const setReference =
|
|
5813
|
+
const [_reference, _setReference] = React44.useState(null);
|
|
5814
|
+
const [_floating, _setFloating] = React44.useState(null);
|
|
5815
|
+
const setReference = React44.useCallback((node) => {
|
|
5800
5816
|
if (node !== referenceRef.current) {
|
|
5801
5817
|
referenceRef.current = node;
|
|
5802
5818
|
_setReference(node);
|
|
5803
5819
|
}
|
|
5804
5820
|
}, []);
|
|
5805
|
-
const setFloating =
|
|
5821
|
+
const setFloating = React44.useCallback((node) => {
|
|
5806
5822
|
if (node !== floatingRef.current) {
|
|
5807
5823
|
floatingRef.current = node;
|
|
5808
5824
|
_setFloating(node);
|
|
@@ -5810,14 +5826,14 @@ function useFloating(options) {
|
|
|
5810
5826
|
}, []);
|
|
5811
5827
|
const referenceEl = externalReference || _reference;
|
|
5812
5828
|
const floatingEl = externalFloating || _floating;
|
|
5813
|
-
const referenceRef =
|
|
5814
|
-
const floatingRef =
|
|
5815
|
-
const dataRef =
|
|
5829
|
+
const referenceRef = React44.useRef(null);
|
|
5830
|
+
const floatingRef = React44.useRef(null);
|
|
5831
|
+
const dataRef = React44.useRef(data);
|
|
5816
5832
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
5817
5833
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
5818
5834
|
const platformRef = useLatestRef(platform2);
|
|
5819
5835
|
const openRef = useLatestRef(open);
|
|
5820
|
-
const update =
|
|
5836
|
+
const update = React44.useCallback(() => {
|
|
5821
5837
|
if (!referenceRef.current || !floatingRef.current) {
|
|
5822
5838
|
return;
|
|
5823
5839
|
}
|
|
@@ -5855,7 +5871,7 @@ function useFloating(options) {
|
|
|
5855
5871
|
}));
|
|
5856
5872
|
}
|
|
5857
5873
|
}, [open]);
|
|
5858
|
-
const isMountedRef =
|
|
5874
|
+
const isMountedRef = React44.useRef(false);
|
|
5859
5875
|
index(() => {
|
|
5860
5876
|
isMountedRef.current = true;
|
|
5861
5877
|
return () => {
|
|
@@ -5872,17 +5888,17 @@ function useFloating(options) {
|
|
|
5872
5888
|
update();
|
|
5873
5889
|
}
|
|
5874
5890
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
5875
|
-
const refs =
|
|
5891
|
+
const refs = React44.useMemo(() => ({
|
|
5876
5892
|
reference: referenceRef,
|
|
5877
5893
|
floating: floatingRef,
|
|
5878
5894
|
setReference,
|
|
5879
5895
|
setFloating
|
|
5880
5896
|
}), [setReference, setFloating]);
|
|
5881
|
-
const elements =
|
|
5897
|
+
const elements = React44.useMemo(() => ({
|
|
5882
5898
|
reference: referenceEl,
|
|
5883
5899
|
floating: floatingEl
|
|
5884
5900
|
}), [referenceEl, floatingEl]);
|
|
5885
|
-
const floatingStyles =
|
|
5901
|
+
const floatingStyles = React44.useMemo(() => {
|
|
5886
5902
|
const initialStyles = {
|
|
5887
5903
|
position: strategy,
|
|
5888
5904
|
left: 0,
|
|
@@ -5908,7 +5924,7 @@ function useFloating(options) {
|
|
|
5908
5924
|
top: y
|
|
5909
5925
|
};
|
|
5910
5926
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
5911
|
-
return
|
|
5927
|
+
return React44.useMemo(() => ({
|
|
5912
5928
|
...data,
|
|
5913
5929
|
update,
|
|
5914
5930
|
refs,
|
|
@@ -5976,7 +5992,7 @@ var arrow3 = (options, deps) => ({
|
|
|
5976
5992
|
options: [options, deps]
|
|
5977
5993
|
});
|
|
5978
5994
|
var NAME2 = "Arrow";
|
|
5979
|
-
var Arrow =
|
|
5995
|
+
var Arrow = React44.forwardRef((props, forwardedRef) => {
|
|
5980
5996
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5981
5997
|
return /* @__PURE__ */ jsx(
|
|
5982
5998
|
Primitive.svg,
|
|
@@ -5994,7 +6010,7 @@ var Arrow = React43.forwardRef((props, forwardedRef) => {
|
|
|
5994
6010
|
Arrow.displayName = NAME2;
|
|
5995
6011
|
var Root2 = Arrow;
|
|
5996
6012
|
function useSize(element) {
|
|
5997
|
-
const [size4, setSize] =
|
|
6013
|
+
const [size4, setSize] = React44.useState(void 0);
|
|
5998
6014
|
useLayoutEffect2(() => {
|
|
5999
6015
|
if (element) {
|
|
6000
6016
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -6032,19 +6048,19 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
6032
6048
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
6033
6049
|
var Popper = (props) => {
|
|
6034
6050
|
const { __scopePopper, children } = props;
|
|
6035
|
-
const [anchor, setAnchor] =
|
|
6051
|
+
const [anchor, setAnchor] = React44.useState(null);
|
|
6036
6052
|
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
6037
6053
|
};
|
|
6038
6054
|
Popper.displayName = POPPER_NAME;
|
|
6039
6055
|
var ANCHOR_NAME = "PopperAnchor";
|
|
6040
|
-
var PopperAnchor =
|
|
6056
|
+
var PopperAnchor = React44.forwardRef(
|
|
6041
6057
|
(props, forwardedRef) => {
|
|
6042
6058
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
6043
6059
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
6044
|
-
const ref =
|
|
6060
|
+
const ref = React44.useRef(null);
|
|
6045
6061
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6046
|
-
const anchorRef =
|
|
6047
|
-
|
|
6062
|
+
const anchorRef = React44.useRef(null);
|
|
6063
|
+
React44.useEffect(() => {
|
|
6048
6064
|
const previousAnchor = anchorRef.current;
|
|
6049
6065
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
6050
6066
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -6057,7 +6073,7 @@ var PopperAnchor = React43.forwardRef(
|
|
|
6057
6073
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
6058
6074
|
var CONTENT_NAME = "PopperContent";
|
|
6059
6075
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
6060
|
-
var PopperContent =
|
|
6076
|
+
var PopperContent = React44.forwardRef(
|
|
6061
6077
|
(props, forwardedRef) => {
|
|
6062
6078
|
const {
|
|
6063
6079
|
__scopePopper,
|
|
@@ -6076,9 +6092,9 @@ var PopperContent = React43.forwardRef(
|
|
|
6076
6092
|
...contentProps
|
|
6077
6093
|
} = props;
|
|
6078
6094
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
6079
|
-
const [content, setContent] =
|
|
6095
|
+
const [content, setContent] = React44.useState(null);
|
|
6080
6096
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
6081
|
-
const [arrow4, setArrow] =
|
|
6097
|
+
const [arrow4, setArrow] = React44.useState(null);
|
|
6082
6098
|
const arrowSize = useSize(arrow4);
|
|
6083
6099
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
6084
6100
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -6140,7 +6156,7 @@ var PopperContent = React43.forwardRef(
|
|
|
6140
6156
|
const arrowX = middlewareData.arrow?.x;
|
|
6141
6157
|
const arrowY = middlewareData.arrow?.y;
|
|
6142
6158
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
6143
|
-
const [contentZIndex, setContentZIndex] =
|
|
6159
|
+
const [contentZIndex, setContentZIndex] = React44.useState();
|
|
6144
6160
|
useLayoutEffect2(() => {
|
|
6145
6161
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
6146
6162
|
}, [content]);
|
|
@@ -6206,7 +6222,7 @@ var OPPOSITE_SIDE = {
|
|
|
6206
6222
|
bottom: "top",
|
|
6207
6223
|
left: "right"
|
|
6208
6224
|
};
|
|
6209
|
-
var PopperArrow =
|
|
6225
|
+
var PopperArrow = React44.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
6210
6226
|
const { __scopePopper, ...arrowProps } = props;
|
|
6211
6227
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
6212
6228
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -6297,16 +6313,16 @@ var Anchor = PopperAnchor;
|
|
|
6297
6313
|
var Content = PopperContent;
|
|
6298
6314
|
var Arrow2 = PopperArrow;
|
|
6299
6315
|
var PORTAL_NAME = "Portal";
|
|
6300
|
-
var Portal =
|
|
6316
|
+
var Portal = React44.forwardRef((props, forwardedRef) => {
|
|
6301
6317
|
const { container: containerProp, ...portalProps } = props;
|
|
6302
|
-
const [mounted, setMounted] =
|
|
6318
|
+
const [mounted, setMounted] = React44.useState(false);
|
|
6303
6319
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6304
6320
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6305
6321
|
return container ? ReactDOM4__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
6306
6322
|
});
|
|
6307
6323
|
Portal.displayName = PORTAL_NAME;
|
|
6308
6324
|
function useStateMachine(initialState, machine) {
|
|
6309
|
-
return
|
|
6325
|
+
return React44.useReducer((state, event) => {
|
|
6310
6326
|
const nextState = machine[state][event];
|
|
6311
6327
|
return nextState ?? state;
|
|
6312
6328
|
}, initialState);
|
|
@@ -6314,17 +6330,17 @@ function useStateMachine(initialState, machine) {
|
|
|
6314
6330
|
var Presence = (props) => {
|
|
6315
6331
|
const { present, children } = props;
|
|
6316
6332
|
const presence = usePresence(present);
|
|
6317
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
6333
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React44.Children.only(children);
|
|
6318
6334
|
const ref = useComposedRefs(presence.ref, getElementRef3(child));
|
|
6319
6335
|
const forceMount = typeof children === "function";
|
|
6320
|
-
return forceMount || presence.isPresent ?
|
|
6336
|
+
return forceMount || presence.isPresent ? React44.cloneElement(child, { ref }) : null;
|
|
6321
6337
|
};
|
|
6322
6338
|
Presence.displayName = "Presence";
|
|
6323
6339
|
function usePresence(present) {
|
|
6324
|
-
const [node, setNode] =
|
|
6325
|
-
const stylesRef =
|
|
6326
|
-
const prevPresentRef =
|
|
6327
|
-
const prevAnimationNameRef =
|
|
6340
|
+
const [node, setNode] = React44.useState();
|
|
6341
|
+
const stylesRef = React44.useRef(null);
|
|
6342
|
+
const prevPresentRef = React44.useRef(present);
|
|
6343
|
+
const prevAnimationNameRef = React44.useRef("none");
|
|
6328
6344
|
const initialState = present ? "mounted" : "unmounted";
|
|
6329
6345
|
const [state, send] = useStateMachine(initialState, {
|
|
6330
6346
|
mounted: {
|
|
@@ -6339,7 +6355,7 @@ function usePresence(present) {
|
|
|
6339
6355
|
MOUNT: "mounted"
|
|
6340
6356
|
}
|
|
6341
6357
|
});
|
|
6342
|
-
|
|
6358
|
+
React44.useEffect(() => {
|
|
6343
6359
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
6344
6360
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
6345
6361
|
}, [state]);
|
|
@@ -6405,7 +6421,7 @@ function usePresence(present) {
|
|
|
6405
6421
|
}, [node, send]);
|
|
6406
6422
|
return {
|
|
6407
6423
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
6408
|
-
ref:
|
|
6424
|
+
ref: React44.useCallback((node2) => {
|
|
6409
6425
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
6410
6426
|
setNode(node2);
|
|
6411
6427
|
}, [])
|
|
@@ -6436,13 +6452,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6436
6452
|
[createCollectionScope]
|
|
6437
6453
|
);
|
|
6438
6454
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
6439
|
-
var RovingFocusGroup =
|
|
6455
|
+
var RovingFocusGroup = React44.forwardRef(
|
|
6440
6456
|
(props, forwardedRef) => {
|
|
6441
6457
|
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6442
6458
|
}
|
|
6443
6459
|
);
|
|
6444
6460
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
6445
|
-
var RovingFocusGroupImpl =
|
|
6461
|
+
var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
6446
6462
|
const {
|
|
6447
6463
|
__scopeRovingFocusGroup,
|
|
6448
6464
|
orientation,
|
|
@@ -6455,7 +6471,7 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6455
6471
|
preventScrollOnEntryFocus = false,
|
|
6456
6472
|
...groupProps
|
|
6457
6473
|
} = props;
|
|
6458
|
-
const ref =
|
|
6474
|
+
const ref = React44.useRef(null);
|
|
6459
6475
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6460
6476
|
const direction = useDirection(dir);
|
|
6461
6477
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -6464,12 +6480,12 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6464
6480
|
onChange: onCurrentTabStopIdChange,
|
|
6465
6481
|
caller: GROUP_NAME
|
|
6466
6482
|
});
|
|
6467
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
6483
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React44.useState(false);
|
|
6468
6484
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
6469
6485
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6470
|
-
const isClickFocusRef =
|
|
6471
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
6472
|
-
|
|
6486
|
+
const isClickFocusRef = React44.useRef(false);
|
|
6487
|
+
const [focusableItemsCount, setFocusableItemsCount] = React44.useState(0);
|
|
6488
|
+
React44.useEffect(() => {
|
|
6473
6489
|
const node = ref.current;
|
|
6474
6490
|
if (node) {
|
|
6475
6491
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -6484,16 +6500,16 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6484
6500
|
dir: direction,
|
|
6485
6501
|
loop,
|
|
6486
6502
|
currentTabStopId,
|
|
6487
|
-
onItemFocus:
|
|
6503
|
+
onItemFocus: React44.useCallback(
|
|
6488
6504
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
6489
6505
|
[setCurrentTabStopId]
|
|
6490
6506
|
),
|
|
6491
|
-
onItemShiftTab:
|
|
6492
|
-
onFocusableItemAdd:
|
|
6507
|
+
onItemShiftTab: React44.useCallback(() => setIsTabbingBackOut(true), []),
|
|
6508
|
+
onFocusableItemAdd: React44.useCallback(
|
|
6493
6509
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
6494
6510
|
[]
|
|
6495
6511
|
),
|
|
6496
|
-
onFocusableItemRemove:
|
|
6512
|
+
onFocusableItemRemove: React44.useCallback(
|
|
6497
6513
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6498
6514
|
[]
|
|
6499
6515
|
),
|
|
@@ -6533,7 +6549,7 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6533
6549
|
);
|
|
6534
6550
|
});
|
|
6535
6551
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
6536
|
-
var RovingFocusGroupItem =
|
|
6552
|
+
var RovingFocusGroupItem = React44.forwardRef(
|
|
6537
6553
|
(props, forwardedRef) => {
|
|
6538
6554
|
const {
|
|
6539
6555
|
__scopeRovingFocusGroup,
|
|
@@ -6549,7 +6565,7 @@ var RovingFocusGroupItem = React43.forwardRef(
|
|
|
6549
6565
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
6550
6566
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6551
6567
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
6552
|
-
|
|
6568
|
+
React44.useEffect(() => {
|
|
6553
6569
|
if (focusable) {
|
|
6554
6570
|
onFocusableItemAdd();
|
|
6555
6571
|
return () => onFocusableItemRemove();
|
|
@@ -6830,7 +6846,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6830
6846
|
ref.callback = callback;
|
|
6831
6847
|
return ref.facade;
|
|
6832
6848
|
}
|
|
6833
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6849
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React44.useLayoutEffect : React44.useEffect;
|
|
6834
6850
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6835
6851
|
function useMergeRefs(refs, defaultValue) {
|
|
6836
6852
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -6954,7 +6970,7 @@ var SideCar = function(_a) {
|
|
|
6954
6970
|
if (!Target) {
|
|
6955
6971
|
throw new Error("Sidecar medium not found");
|
|
6956
6972
|
}
|
|
6957
|
-
return
|
|
6973
|
+
return React44.createElement(Target, __assign({}, rest));
|
|
6958
6974
|
};
|
|
6959
6975
|
SideCar.isSideCarExport = true;
|
|
6960
6976
|
function exportSidecar(medium, exported) {
|
|
@@ -6969,9 +6985,9 @@ var effectCar = createSidecarMedium();
|
|
|
6969
6985
|
var nothing = function() {
|
|
6970
6986
|
return;
|
|
6971
6987
|
};
|
|
6972
|
-
var RemoveScroll =
|
|
6973
|
-
var ref =
|
|
6974
|
-
var _a =
|
|
6988
|
+
var RemoveScroll = React44.forwardRef(function(props, parentRef) {
|
|
6989
|
+
var ref = React44.useRef(null);
|
|
6990
|
+
var _a = React44.useState({
|
|
6975
6991
|
onScrollCapture: nothing,
|
|
6976
6992
|
onWheelCapture: nothing,
|
|
6977
6993
|
onTouchMoveCapture: nothing
|
|
@@ -6980,11 +6996,11 @@ var RemoveScroll = React43.forwardRef(function(props, parentRef) {
|
|
|
6980
6996
|
var SideCar2 = sideCar;
|
|
6981
6997
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6982
6998
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6983
|
-
return
|
|
6984
|
-
|
|
6999
|
+
return React44.createElement(
|
|
7000
|
+
React44.Fragment,
|
|
6985
7001
|
null,
|
|
6986
|
-
enabled &&
|
|
6987
|
-
forwardProps ?
|
|
7002
|
+
enabled && React44.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
7003
|
+
forwardProps ? React44.cloneElement(React44.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React44.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
6988
7004
|
);
|
|
6989
7005
|
});
|
|
6990
7006
|
RemoveScroll.defaultProps = {
|
|
@@ -7053,7 +7069,7 @@ var stylesheetSingleton = function() {
|
|
|
7053
7069
|
var styleHookSingleton = function() {
|
|
7054
7070
|
var sheet = stylesheetSingleton();
|
|
7055
7071
|
return function(styles, isDynamic) {
|
|
7056
|
-
|
|
7072
|
+
React44.useEffect(function() {
|
|
7057
7073
|
sheet.add(styles);
|
|
7058
7074
|
return function() {
|
|
7059
7075
|
sheet.remove();
|
|
@@ -7127,7 +7143,7 @@ var getCurrentUseCounter = function() {
|
|
|
7127
7143
|
return isFinite(counter) ? counter : 0;
|
|
7128
7144
|
};
|
|
7129
7145
|
var useLockAttribute = function() {
|
|
7130
|
-
|
|
7146
|
+
React44.useEffect(function() {
|
|
7131
7147
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7132
7148
|
return function() {
|
|
7133
7149
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7142,10 +7158,10 @@ var useLockAttribute = function() {
|
|
|
7142
7158
|
var RemoveScrollBar = function(_a) {
|
|
7143
7159
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7144
7160
|
useLockAttribute();
|
|
7145
|
-
var gap =
|
|
7161
|
+
var gap = React44.useMemo(function() {
|
|
7146
7162
|
return getGapWidth(gapMode);
|
|
7147
7163
|
}, [gapMode]);
|
|
7148
|
-
return
|
|
7164
|
+
return React44.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7149
7165
|
};
|
|
7150
7166
|
|
|
7151
7167
|
// ../../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
|
|
@@ -7286,16 +7302,16 @@ var generateStyle = function(id) {
|
|
|
7286
7302
|
var idCounter = 0;
|
|
7287
7303
|
var lockStack = [];
|
|
7288
7304
|
function RemoveScrollSideCar(props) {
|
|
7289
|
-
var shouldPreventQueue =
|
|
7290
|
-
var touchStartRef =
|
|
7291
|
-
var activeAxis =
|
|
7292
|
-
var id =
|
|
7293
|
-
var Style2 =
|
|
7294
|
-
var lastProps =
|
|
7295
|
-
|
|
7305
|
+
var shouldPreventQueue = React44.useRef([]);
|
|
7306
|
+
var touchStartRef = React44.useRef([0, 0]);
|
|
7307
|
+
var activeAxis = React44.useRef();
|
|
7308
|
+
var id = React44.useState(idCounter++)[0];
|
|
7309
|
+
var Style2 = React44.useState(styleSingleton)[0];
|
|
7310
|
+
var lastProps = React44.useRef(props);
|
|
7311
|
+
React44.useEffect(function() {
|
|
7296
7312
|
lastProps.current = props;
|
|
7297
7313
|
}, [props]);
|
|
7298
|
-
|
|
7314
|
+
React44.useEffect(function() {
|
|
7299
7315
|
if (props.inert) {
|
|
7300
7316
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7301
7317
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -7311,7 +7327,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7311
7327
|
}
|
|
7312
7328
|
return;
|
|
7313
7329
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7314
|
-
var shouldCancelEvent =
|
|
7330
|
+
var shouldCancelEvent = React44.useCallback(function(event, parent) {
|
|
7315
7331
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7316
7332
|
return !lastProps.current.allowPinchZoom;
|
|
7317
7333
|
}
|
|
@@ -7347,7 +7363,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7347
7363
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7348
7364
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
7349
7365
|
}, []);
|
|
7350
|
-
var shouldPrevent =
|
|
7366
|
+
var shouldPrevent = React44.useCallback(function(_event) {
|
|
7351
7367
|
var event = _event;
|
|
7352
7368
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7353
7369
|
return;
|
|
@@ -7374,7 +7390,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7374
7390
|
}
|
|
7375
7391
|
}
|
|
7376
7392
|
}, []);
|
|
7377
|
-
var shouldCancel =
|
|
7393
|
+
var shouldCancel = React44.useCallback(function(name, delta, target, should) {
|
|
7378
7394
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7379
7395
|
shouldPreventQueue.current.push(event);
|
|
7380
7396
|
setTimeout(function() {
|
|
@@ -7383,17 +7399,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7383
7399
|
});
|
|
7384
7400
|
}, 1);
|
|
7385
7401
|
}, []);
|
|
7386
|
-
var scrollTouchStart =
|
|
7402
|
+
var scrollTouchStart = React44.useCallback(function(event) {
|
|
7387
7403
|
touchStartRef.current = getTouchXY(event);
|
|
7388
7404
|
activeAxis.current = void 0;
|
|
7389
7405
|
}, []);
|
|
7390
|
-
var scrollWheel =
|
|
7406
|
+
var scrollWheel = React44.useCallback(function(event) {
|
|
7391
7407
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7392
7408
|
}, []);
|
|
7393
|
-
var scrollTouchMove =
|
|
7409
|
+
var scrollTouchMove = React44.useCallback(function(event) {
|
|
7394
7410
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7395
7411
|
}, []);
|
|
7396
|
-
|
|
7412
|
+
React44.useEffect(function() {
|
|
7397
7413
|
lockStack.push(Style2);
|
|
7398
7414
|
props.setCallbacks({
|
|
7399
7415
|
onScrollCapture: scrollWheel,
|
|
@@ -7413,11 +7429,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7413
7429
|
};
|
|
7414
7430
|
}, []);
|
|
7415
7431
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7416
|
-
return
|
|
7417
|
-
|
|
7432
|
+
return React44.createElement(
|
|
7433
|
+
React44.Fragment,
|
|
7418
7434
|
null,
|
|
7419
|
-
inert ?
|
|
7420
|
-
removeScrollBar ?
|
|
7435
|
+
inert ? React44.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7436
|
+
removeScrollBar ? React44.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7421
7437
|
);
|
|
7422
7438
|
}
|
|
7423
7439
|
function getOutermostShadowParent(node) {
|
|
@@ -7436,8 +7452,8 @@ function getOutermostShadowParent(node) {
|
|
|
7436
7452
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7437
7453
|
|
|
7438
7454
|
// ../../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
|
|
7439
|
-
var ReactRemoveScroll =
|
|
7440
|
-
return
|
|
7455
|
+
var ReactRemoveScroll = React44.forwardRef(function(props, ref) {
|
|
7456
|
+
return React44.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7441
7457
|
});
|
|
7442
7458
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7443
7459
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7467,11 +7483,11 @@ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
|
7467
7483
|
var Menu = (props) => {
|
|
7468
7484
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
7469
7485
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7470
|
-
const [content, setContent] =
|
|
7471
|
-
const isUsingKeyboardRef =
|
|
7486
|
+
const [content, setContent] = React44.useState(null);
|
|
7487
|
+
const isUsingKeyboardRef = React44.useRef(false);
|
|
7472
7488
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
7473
7489
|
const direction = useDirection(dir);
|
|
7474
|
-
|
|
7490
|
+
React44.useEffect(() => {
|
|
7475
7491
|
const handleKeyDown = () => {
|
|
7476
7492
|
isUsingKeyboardRef.current = true;
|
|
7477
7493
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
@@ -7497,7 +7513,7 @@ var Menu = (props) => {
|
|
|
7497
7513
|
MenuRootProvider,
|
|
7498
7514
|
{
|
|
7499
7515
|
scope: __scopeMenu,
|
|
7500
|
-
onClose:
|
|
7516
|
+
onClose: React44.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
7501
7517
|
isUsingKeyboardRef,
|
|
7502
7518
|
dir: direction,
|
|
7503
7519
|
modal,
|
|
@@ -7509,7 +7525,7 @@ var Menu = (props) => {
|
|
|
7509
7525
|
};
|
|
7510
7526
|
Menu.displayName = MENU_NAME;
|
|
7511
7527
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
7512
|
-
var MenuAnchor =
|
|
7528
|
+
var MenuAnchor = React44.forwardRef(
|
|
7513
7529
|
(props, forwardedRef) => {
|
|
7514
7530
|
const { __scopeMenu, ...anchorProps } = props;
|
|
7515
7531
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -7529,7 +7545,7 @@ var MenuPortal = (props) => {
|
|
|
7529
7545
|
MenuPortal.displayName = PORTAL_NAME2;
|
|
7530
7546
|
var CONTENT_NAME2 = "MenuContent";
|
|
7531
7547
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
7532
|
-
var MenuContent =
|
|
7548
|
+
var MenuContent = React44.forwardRef(
|
|
7533
7549
|
(props, forwardedRef) => {
|
|
7534
7550
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7535
7551
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7538,12 +7554,12 @@ var MenuContent = React43.forwardRef(
|
|
|
7538
7554
|
return /* @__PURE__ */ jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection2.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
7539
7555
|
}
|
|
7540
7556
|
);
|
|
7541
|
-
var MenuRootContentModal =
|
|
7557
|
+
var MenuRootContentModal = React44.forwardRef(
|
|
7542
7558
|
(props, forwardedRef) => {
|
|
7543
7559
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7544
|
-
const ref =
|
|
7560
|
+
const ref = React44.useRef(null);
|
|
7545
7561
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7546
|
-
|
|
7562
|
+
React44.useEffect(() => {
|
|
7547
7563
|
const content = ref.current;
|
|
7548
7564
|
if (content) return hideOthers(content);
|
|
7549
7565
|
}, []);
|
|
@@ -7565,7 +7581,7 @@ var MenuRootContentModal = React43.forwardRef(
|
|
|
7565
7581
|
);
|
|
7566
7582
|
}
|
|
7567
7583
|
);
|
|
7568
|
-
var MenuRootContentNonModal =
|
|
7584
|
+
var MenuRootContentNonModal = React44.forwardRef((props, forwardedRef) => {
|
|
7569
7585
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7570
7586
|
return /* @__PURE__ */ jsx(
|
|
7571
7587
|
MenuContentImpl,
|
|
@@ -7580,7 +7596,7 @@ var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef) => {
|
|
|
7580
7596
|
);
|
|
7581
7597
|
});
|
|
7582
7598
|
var Slot2 = createSlot2("MenuContent.ScrollLock");
|
|
7583
|
-
var MenuContentImpl =
|
|
7599
|
+
var MenuContentImpl = React44.forwardRef(
|
|
7584
7600
|
(props, forwardedRef) => {
|
|
7585
7601
|
const {
|
|
7586
7602
|
__scopeMenu,
|
|
@@ -7603,16 +7619,16 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7603
7619
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7604
7620
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7605
7621
|
const getItems = useCollection2(__scopeMenu);
|
|
7606
|
-
const [currentItemId, setCurrentItemId] =
|
|
7607
|
-
const contentRef =
|
|
7622
|
+
const [currentItemId, setCurrentItemId] = React44.useState(null);
|
|
7623
|
+
const contentRef = React44.useRef(null);
|
|
7608
7624
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
7609
|
-
const timerRef =
|
|
7610
|
-
const searchRef =
|
|
7611
|
-
const pointerGraceTimerRef =
|
|
7612
|
-
const pointerGraceIntentRef =
|
|
7613
|
-
const pointerDirRef =
|
|
7614
|
-
const lastPointerXRef =
|
|
7615
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
7625
|
+
const timerRef = React44.useRef(0);
|
|
7626
|
+
const searchRef = React44.useRef("");
|
|
7627
|
+
const pointerGraceTimerRef = React44.useRef(0);
|
|
7628
|
+
const pointerGraceIntentRef = React44.useRef(null);
|
|
7629
|
+
const pointerDirRef = React44.useRef("right");
|
|
7630
|
+
const lastPointerXRef = React44.useRef(0);
|
|
7631
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React44.Fragment;
|
|
7616
7632
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
7617
7633
|
const handleTypeaheadSearch = (key) => {
|
|
7618
7634
|
const search = searchRef.current + key;
|
|
@@ -7631,11 +7647,11 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7631
7647
|
setTimeout(() => newItem.focus());
|
|
7632
7648
|
}
|
|
7633
7649
|
};
|
|
7634
|
-
|
|
7650
|
+
React44.useEffect(() => {
|
|
7635
7651
|
return () => window.clearTimeout(timerRef.current);
|
|
7636
7652
|
}, []);
|
|
7637
7653
|
useFocusGuards();
|
|
7638
|
-
const isPointerMovingToSubmenu =
|
|
7654
|
+
const isPointerMovingToSubmenu = React44.useCallback((event) => {
|
|
7639
7655
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
7640
7656
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
7641
7657
|
}, []);
|
|
@@ -7644,13 +7660,13 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7644
7660
|
{
|
|
7645
7661
|
scope: __scopeMenu,
|
|
7646
7662
|
searchRef,
|
|
7647
|
-
onItemEnter:
|
|
7663
|
+
onItemEnter: React44.useCallback(
|
|
7648
7664
|
(event) => {
|
|
7649
7665
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7650
7666
|
},
|
|
7651
7667
|
[isPointerMovingToSubmenu]
|
|
7652
7668
|
),
|
|
7653
|
-
onItemLeave:
|
|
7669
|
+
onItemLeave: React44.useCallback(
|
|
7654
7670
|
(event) => {
|
|
7655
7671
|
if (isPointerMovingToSubmenu(event)) return;
|
|
7656
7672
|
contentRef.current?.focus();
|
|
@@ -7658,14 +7674,14 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7658
7674
|
},
|
|
7659
7675
|
[isPointerMovingToSubmenu]
|
|
7660
7676
|
),
|
|
7661
|
-
onTriggerLeave:
|
|
7677
|
+
onTriggerLeave: React44.useCallback(
|
|
7662
7678
|
(event) => {
|
|
7663
7679
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7664
7680
|
},
|
|
7665
7681
|
[isPointerMovingToSubmenu]
|
|
7666
7682
|
),
|
|
7667
7683
|
pointerGraceTimerRef,
|
|
7668
|
-
onPointerGraceIntentChange:
|
|
7684
|
+
onPointerGraceIntentChange: React44.useCallback((intent) => {
|
|
7669
7685
|
pointerGraceIntentRef.current = intent;
|
|
7670
7686
|
}, []),
|
|
7671
7687
|
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
@@ -7764,7 +7780,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7764
7780
|
);
|
|
7765
7781
|
MenuContent.displayName = CONTENT_NAME2;
|
|
7766
7782
|
var GROUP_NAME2 = "MenuGroup";
|
|
7767
|
-
var MenuGroup =
|
|
7783
|
+
var MenuGroup = React44.forwardRef(
|
|
7768
7784
|
(props, forwardedRef) => {
|
|
7769
7785
|
const { __scopeMenu, ...groupProps } = props;
|
|
7770
7786
|
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -7772,7 +7788,7 @@ var MenuGroup = React43.forwardRef(
|
|
|
7772
7788
|
);
|
|
7773
7789
|
MenuGroup.displayName = GROUP_NAME2;
|
|
7774
7790
|
var LABEL_NAME = "MenuLabel";
|
|
7775
|
-
var MenuLabel =
|
|
7791
|
+
var MenuLabel = React44.forwardRef(
|
|
7776
7792
|
(props, forwardedRef) => {
|
|
7777
7793
|
const { __scopeMenu, ...labelProps } = props;
|
|
7778
7794
|
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -7781,14 +7797,14 @@ var MenuLabel = React43.forwardRef(
|
|
|
7781
7797
|
MenuLabel.displayName = LABEL_NAME;
|
|
7782
7798
|
var ITEM_NAME2 = "MenuItem";
|
|
7783
7799
|
var ITEM_SELECT = "menu.itemSelect";
|
|
7784
|
-
var MenuItem =
|
|
7800
|
+
var MenuItem = React44.forwardRef(
|
|
7785
7801
|
(props, forwardedRef) => {
|
|
7786
7802
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
7787
|
-
const ref =
|
|
7803
|
+
const ref = React44.useRef(null);
|
|
7788
7804
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
7789
7805
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
7790
7806
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7791
|
-
const isPointerDownRef =
|
|
7807
|
+
const isPointerDownRef = React44.useRef(false);
|
|
7792
7808
|
const handleSelect = () => {
|
|
7793
7809
|
const menuItem = ref.current;
|
|
7794
7810
|
if (!disabled && menuItem) {
|
|
@@ -7829,16 +7845,16 @@ var MenuItem = React43.forwardRef(
|
|
|
7829
7845
|
}
|
|
7830
7846
|
);
|
|
7831
7847
|
MenuItem.displayName = ITEM_NAME2;
|
|
7832
|
-
var MenuItemImpl =
|
|
7848
|
+
var MenuItemImpl = React44.forwardRef(
|
|
7833
7849
|
(props, forwardedRef) => {
|
|
7834
7850
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
7835
7851
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
7836
7852
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7837
|
-
const ref =
|
|
7853
|
+
const ref = React44.useRef(null);
|
|
7838
7854
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7839
|
-
const [isFocused, setIsFocused] =
|
|
7840
|
-
const [textContent, setTextContent] =
|
|
7841
|
-
|
|
7855
|
+
const [isFocused, setIsFocused] = React44.useState(false);
|
|
7856
|
+
const [textContent, setTextContent] = React44.useState("");
|
|
7857
|
+
React44.useEffect(() => {
|
|
7842
7858
|
const menuItem = ref.current;
|
|
7843
7859
|
if (menuItem) {
|
|
7844
7860
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
@@ -7886,7 +7902,7 @@ var MenuItemImpl = React43.forwardRef(
|
|
|
7886
7902
|
}
|
|
7887
7903
|
);
|
|
7888
7904
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
7889
|
-
var MenuCheckboxItem =
|
|
7905
|
+
var MenuCheckboxItem = React44.forwardRef(
|
|
7890
7906
|
(props, forwardedRef) => {
|
|
7891
7907
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
7892
7908
|
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
@@ -7913,7 +7929,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
7913
7929
|
{ value: void 0, onValueChange: () => {
|
|
7914
7930
|
} }
|
|
7915
7931
|
);
|
|
7916
|
-
var MenuRadioGroup =
|
|
7932
|
+
var MenuRadioGroup = React44.forwardRef(
|
|
7917
7933
|
(props, forwardedRef) => {
|
|
7918
7934
|
const { value, onValueChange, ...groupProps } = props;
|
|
7919
7935
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -7922,7 +7938,7 @@ var MenuRadioGroup = React43.forwardRef(
|
|
|
7922
7938
|
);
|
|
7923
7939
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7924
7940
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
7925
|
-
var MenuRadioItem =
|
|
7941
|
+
var MenuRadioItem = React44.forwardRef(
|
|
7926
7942
|
(props, forwardedRef) => {
|
|
7927
7943
|
const { value, ...radioItemProps } = props;
|
|
7928
7944
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -7950,7 +7966,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
7950
7966
|
ITEM_INDICATOR_NAME,
|
|
7951
7967
|
{ checked: false }
|
|
7952
7968
|
);
|
|
7953
|
-
var MenuItemIndicator =
|
|
7969
|
+
var MenuItemIndicator = React44.forwardRef(
|
|
7954
7970
|
(props, forwardedRef) => {
|
|
7955
7971
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
7956
7972
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -7972,7 +7988,7 @@ var MenuItemIndicator = React43.forwardRef(
|
|
|
7972
7988
|
);
|
|
7973
7989
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
7974
7990
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
7975
|
-
var MenuSeparator =
|
|
7991
|
+
var MenuSeparator = React44.forwardRef(
|
|
7976
7992
|
(props, forwardedRef) => {
|
|
7977
7993
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7978
7994
|
return /* @__PURE__ */ jsx(
|
|
@@ -7988,7 +8004,7 @@ var MenuSeparator = React43.forwardRef(
|
|
|
7988
8004
|
);
|
|
7989
8005
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
7990
8006
|
var ARROW_NAME2 = "MenuArrow";
|
|
7991
|
-
var MenuArrow =
|
|
8007
|
+
var MenuArrow = React44.forwardRef(
|
|
7992
8008
|
(props, forwardedRef) => {
|
|
7993
8009
|
const { __scopeMenu, ...arrowProps } = props;
|
|
7994
8010
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -8002,10 +8018,10 @@ var MenuSub = (props) => {
|
|
|
8002
8018
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
8003
8019
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
8004
8020
|
const popperScope = usePopperScope(__scopeMenu);
|
|
8005
|
-
const [trigger, setTrigger] =
|
|
8006
|
-
const [content, setContent] =
|
|
8021
|
+
const [trigger, setTrigger] = React44.useState(null);
|
|
8022
|
+
const [content, setContent] = React44.useState(null);
|
|
8007
8023
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
8008
|
-
|
|
8024
|
+
React44.useEffect(() => {
|
|
8009
8025
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
8010
8026
|
return () => handleOpenChange(false);
|
|
8011
8027
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
@@ -8033,21 +8049,21 @@ var MenuSub = (props) => {
|
|
|
8033
8049
|
};
|
|
8034
8050
|
MenuSub.displayName = SUB_NAME;
|
|
8035
8051
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
8036
|
-
var MenuSubTrigger =
|
|
8052
|
+
var MenuSubTrigger = React44.forwardRef(
|
|
8037
8053
|
(props, forwardedRef) => {
|
|
8038
8054
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8039
8055
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8040
8056
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8041
8057
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8042
|
-
const openTimerRef =
|
|
8058
|
+
const openTimerRef = React44.useRef(null);
|
|
8043
8059
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
8044
8060
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
8045
|
-
const clearOpenTimer =
|
|
8061
|
+
const clearOpenTimer = React44.useCallback(() => {
|
|
8046
8062
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
8047
8063
|
openTimerRef.current = null;
|
|
8048
8064
|
}, []);
|
|
8049
|
-
|
|
8050
|
-
|
|
8065
|
+
React44.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
8066
|
+
React44.useEffect(() => {
|
|
8051
8067
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
8052
8068
|
return () => {
|
|
8053
8069
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -8134,14 +8150,14 @@ var MenuSubTrigger = React43.forwardRef(
|
|
|
8134
8150
|
);
|
|
8135
8151
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
8136
8152
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
8137
|
-
var MenuSubContent =
|
|
8153
|
+
var MenuSubContent = React44.forwardRef(
|
|
8138
8154
|
(props, forwardedRef) => {
|
|
8139
8155
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8140
8156
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
8141
8157
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8142
8158
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8143
8159
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
8144
|
-
const ref =
|
|
8160
|
+
const ref = React44.useRef(null);
|
|
8145
8161
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8146
8162
|
return /* @__PURE__ */ jsx(Collection2.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection2.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(
|
|
8147
8163
|
MenuContentImpl,
|
|
@@ -8270,7 +8286,7 @@ var DropdownMenu = (props) => {
|
|
|
8270
8286
|
modal = true
|
|
8271
8287
|
} = props;
|
|
8272
8288
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8273
|
-
const triggerRef =
|
|
8289
|
+
const triggerRef = React44.useRef(null);
|
|
8274
8290
|
const [open, setOpen] = useControllableState({
|
|
8275
8291
|
prop: openProp,
|
|
8276
8292
|
defaultProp: defaultOpen ?? false,
|
|
@@ -8286,7 +8302,7 @@ var DropdownMenu = (props) => {
|
|
|
8286
8302
|
contentId: useId(),
|
|
8287
8303
|
open,
|
|
8288
8304
|
onOpenChange: setOpen,
|
|
8289
|
-
onOpenToggle:
|
|
8305
|
+
onOpenToggle: React44.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8290
8306
|
modal,
|
|
8291
8307
|
children: /* @__PURE__ */ jsx(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
8292
8308
|
}
|
|
@@ -8294,7 +8310,7 @@ var DropdownMenu = (props) => {
|
|
|
8294
8310
|
};
|
|
8295
8311
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
8296
8312
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8297
|
-
var DropdownMenuTrigger =
|
|
8313
|
+
var DropdownMenuTrigger = React44.forwardRef(
|
|
8298
8314
|
(props, forwardedRef) => {
|
|
8299
8315
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8300
8316
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -8337,12 +8353,12 @@ var DropdownMenuPortal = (props) => {
|
|
|
8337
8353
|
};
|
|
8338
8354
|
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
8339
8355
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
8340
|
-
var DropdownMenuContent =
|
|
8356
|
+
var DropdownMenuContent = React44.forwardRef(
|
|
8341
8357
|
(props, forwardedRef) => {
|
|
8342
8358
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8343
8359
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
8344
8360
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8345
|
-
const hasInteractedOutsideRef =
|
|
8361
|
+
const hasInteractedOutsideRef = React44.useRef(false);
|
|
8346
8362
|
return /* @__PURE__ */ jsx(
|
|
8347
8363
|
Content2,
|
|
8348
8364
|
{
|
|
@@ -8379,7 +8395,7 @@ var DropdownMenuContent = React43.forwardRef(
|
|
|
8379
8395
|
);
|
|
8380
8396
|
DropdownMenuContent.displayName = CONTENT_NAME3;
|
|
8381
8397
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
8382
|
-
var DropdownMenuGroup =
|
|
8398
|
+
var DropdownMenuGroup = React44.forwardRef(
|
|
8383
8399
|
(props, forwardedRef) => {
|
|
8384
8400
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
8385
8401
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8388,7 +8404,7 @@ var DropdownMenuGroup = React43.forwardRef(
|
|
|
8388
8404
|
);
|
|
8389
8405
|
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
8390
8406
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
8391
|
-
var DropdownMenuLabel =
|
|
8407
|
+
var DropdownMenuLabel = React44.forwardRef(
|
|
8392
8408
|
(props, forwardedRef) => {
|
|
8393
8409
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8394
8410
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8397,7 +8413,7 @@ var DropdownMenuLabel = React43.forwardRef(
|
|
|
8397
8413
|
);
|
|
8398
8414
|
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
8399
8415
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
8400
|
-
var DropdownMenuItem =
|
|
8416
|
+
var DropdownMenuItem = React44.forwardRef(
|
|
8401
8417
|
(props, forwardedRef) => {
|
|
8402
8418
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
8403
8419
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8406,42 +8422,42 @@ var DropdownMenuItem = React43.forwardRef(
|
|
|
8406
8422
|
);
|
|
8407
8423
|
DropdownMenuItem.displayName = ITEM_NAME3;
|
|
8408
8424
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
8409
|
-
var DropdownMenuCheckboxItem =
|
|
8425
|
+
var DropdownMenuCheckboxItem = React44.forwardRef((props, forwardedRef) => {
|
|
8410
8426
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
8411
8427
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8412
8428
|
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
8413
8429
|
});
|
|
8414
8430
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
8415
8431
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
8416
|
-
var DropdownMenuRadioGroup =
|
|
8432
|
+
var DropdownMenuRadioGroup = React44.forwardRef((props, forwardedRef) => {
|
|
8417
8433
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
8418
8434
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8419
8435
|
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
8420
8436
|
});
|
|
8421
8437
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
8422
8438
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
8423
|
-
var DropdownMenuRadioItem =
|
|
8439
|
+
var DropdownMenuRadioItem = React44.forwardRef((props, forwardedRef) => {
|
|
8424
8440
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
8425
8441
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8426
8442
|
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
8427
8443
|
});
|
|
8428
8444
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
8429
8445
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
8430
|
-
var DropdownMenuItemIndicator =
|
|
8446
|
+
var DropdownMenuItemIndicator = React44.forwardRef((props, forwardedRef) => {
|
|
8431
8447
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
8432
8448
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8433
8449
|
return /* @__PURE__ */ jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
8434
8450
|
});
|
|
8435
8451
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
8436
8452
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
8437
|
-
var DropdownMenuSeparator =
|
|
8453
|
+
var DropdownMenuSeparator = React44.forwardRef((props, forwardedRef) => {
|
|
8438
8454
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
8439
8455
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8440
8456
|
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
8441
8457
|
});
|
|
8442
8458
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
8443
8459
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
8444
|
-
var DropdownMenuArrow =
|
|
8460
|
+
var DropdownMenuArrow = React44.forwardRef(
|
|
8445
8461
|
(props, forwardedRef) => {
|
|
8446
8462
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
8447
8463
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8461,14 +8477,14 @@ var DropdownMenuSub = (props) => {
|
|
|
8461
8477
|
return /* @__PURE__ */ jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
8462
8478
|
};
|
|
8463
8479
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
8464
|
-
var DropdownMenuSubTrigger =
|
|
8480
|
+
var DropdownMenuSubTrigger = React44.forwardRef((props, forwardedRef) => {
|
|
8465
8481
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
8466
8482
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8467
8483
|
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
8468
8484
|
});
|
|
8469
8485
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
8470
8486
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
8471
|
-
var DropdownMenuSubContent =
|
|
8487
|
+
var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
|
|
8472
8488
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
8473
8489
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8474
8490
|
return /* @__PURE__ */ jsx(
|
|
@@ -8507,20 +8523,107 @@ var Separator2 = DropdownMenuSeparator;
|
|
|
8507
8523
|
var Sub2 = DropdownMenuSub;
|
|
8508
8524
|
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
8509
8525
|
var SubContent2 = DropdownMenuSubContent;
|
|
8526
|
+
|
|
8527
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
8528
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
8529
|
+
var mergeClasses = (...classes) => classes.filter((className, index2, array) => {
|
|
8530
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index2;
|
|
8531
|
+
}).join(" ").trim();
|
|
8532
|
+
|
|
8533
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
8534
|
+
var defaultAttributes = {
|
|
8535
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8536
|
+
width: 24,
|
|
8537
|
+
height: 24,
|
|
8538
|
+
viewBox: "0 0 24 24",
|
|
8539
|
+
fill: "none",
|
|
8540
|
+
stroke: "currentColor",
|
|
8541
|
+
strokeWidth: 2,
|
|
8542
|
+
strokeLinecap: "round",
|
|
8543
|
+
strokeLinejoin: "round"
|
|
8544
|
+
};
|
|
8545
|
+
|
|
8546
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/Icon.js
|
|
8547
|
+
var Icon = forwardRef(
|
|
8548
|
+
({
|
|
8549
|
+
color = "currentColor",
|
|
8550
|
+
size: size4 = 24,
|
|
8551
|
+
strokeWidth = 2,
|
|
8552
|
+
absoluteStrokeWidth,
|
|
8553
|
+
className = "",
|
|
8554
|
+
children,
|
|
8555
|
+
iconNode,
|
|
8556
|
+
...rest
|
|
8557
|
+
}, ref) => {
|
|
8558
|
+
return createElement(
|
|
8559
|
+
"svg",
|
|
8560
|
+
{
|
|
8561
|
+
ref,
|
|
8562
|
+
...defaultAttributes,
|
|
8563
|
+
width: size4,
|
|
8564
|
+
height: size4,
|
|
8565
|
+
stroke: color,
|
|
8566
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size4) : strokeWidth,
|
|
8567
|
+
className: mergeClasses("lucide", className),
|
|
8568
|
+
...rest
|
|
8569
|
+
},
|
|
8570
|
+
[
|
|
8571
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
8572
|
+
...Array.isArray(children) ? children : [children]
|
|
8573
|
+
]
|
|
8574
|
+
);
|
|
8575
|
+
}
|
|
8576
|
+
);
|
|
8577
|
+
|
|
8578
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
8579
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
8580
|
+
const Component = forwardRef(
|
|
8581
|
+
({ className, ...props }, ref) => createElement(Icon, {
|
|
8582
|
+
ref,
|
|
8583
|
+
iconNode,
|
|
8584
|
+
className: mergeClasses(`lucide-${toKebabCase(iconName)}`, className),
|
|
8585
|
+
...props
|
|
8586
|
+
})
|
|
8587
|
+
);
|
|
8588
|
+
Component.displayName = `${iconName}`;
|
|
8589
|
+
return Component;
|
|
8590
|
+
};
|
|
8591
|
+
|
|
8592
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/icons/check.js
|
|
8593
|
+
var __iconNode = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
8594
|
+
var Check = createLucideIcon("Check", __iconNode);
|
|
8595
|
+
|
|
8596
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/icons/chevron-down.js
|
|
8597
|
+
var __iconNode2 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
8598
|
+
var ChevronDown = createLucideIcon("ChevronDown", __iconNode2);
|
|
8599
|
+
|
|
8600
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
8601
|
+
var __iconNode3 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
8602
|
+
var ChevronRight = createLucideIcon("ChevronRight", __iconNode3);
|
|
8603
|
+
|
|
8604
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/icons/chevron-up.js
|
|
8605
|
+
var __iconNode4 = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
8606
|
+
var ChevronUp = createLucideIcon("ChevronUp", __iconNode4);
|
|
8607
|
+
|
|
8608
|
+
// ../../node_modules/.pnpm/lucide-react@0.476.0_react@19.2.2/node_modules/lucide-react/dist/esm/icons/circle.js
|
|
8609
|
+
var __iconNode5 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
8610
|
+
var Circle = createLucideIcon("Circle", __iconNode5);
|
|
8611
|
+
|
|
8612
|
+
// src/components/ui/dropdown-menu.tsx
|
|
8510
8613
|
function DropdownMenu2({
|
|
8511
8614
|
...props
|
|
8512
8615
|
}) {
|
|
8513
|
-
return /* @__PURE__ */
|
|
8616
|
+
return /* @__PURE__ */ React44.createElement(Root23, { "data-slot": "dropdown-menu", ...props });
|
|
8514
8617
|
}
|
|
8515
8618
|
function DropdownMenuPortal2({
|
|
8516
8619
|
...props
|
|
8517
8620
|
}) {
|
|
8518
|
-
return /* @__PURE__ */
|
|
8621
|
+
return /* @__PURE__ */ React44.createElement(Portal22, { "data-slot": "dropdown-menu-portal", ...props });
|
|
8519
8622
|
}
|
|
8520
8623
|
function DropdownMenuTrigger2({
|
|
8521
8624
|
...props
|
|
8522
8625
|
}) {
|
|
8523
|
-
return /* @__PURE__ */
|
|
8626
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8524
8627
|
Trigger,
|
|
8525
8628
|
{
|
|
8526
8629
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -8533,7 +8636,7 @@ function DropdownMenuContent2({
|
|
|
8533
8636
|
sideOffset = 4,
|
|
8534
8637
|
...props
|
|
8535
8638
|
}) {
|
|
8536
|
-
return /* @__PURE__ */
|
|
8639
|
+
return /* @__PURE__ */ React44.createElement(Portal22, null, /* @__PURE__ */ React44.createElement(
|
|
8537
8640
|
Content22,
|
|
8538
8641
|
{
|
|
8539
8642
|
"data-slot": "dropdown-menu-content",
|
|
@@ -8550,30 +8653,30 @@ function DropdownMenuClose({
|
|
|
8550
8653
|
className,
|
|
8551
8654
|
...props
|
|
8552
8655
|
}) {
|
|
8553
|
-
return /* @__PURE__ */
|
|
8656
|
+
return /* @__PURE__ */ React44.createElement(Item22, { "data-slot": "dropdown-menu-close", className: "hidden", ...props });
|
|
8554
8657
|
}
|
|
8555
8658
|
function DropdownMenuGroup2({
|
|
8556
8659
|
...props
|
|
8557
8660
|
}) {
|
|
8558
|
-
return /* @__PURE__ */
|
|
8661
|
+
return /* @__PURE__ */ React44.createElement(Group2, { "data-slot": "dropdown-menu-group", ...props });
|
|
8559
8662
|
}
|
|
8560
8663
|
function ConfirmationDropdownMenuItem({
|
|
8561
8664
|
...props
|
|
8562
8665
|
}) {
|
|
8563
8666
|
const { onClick: originalOnClick, ...rest } = props;
|
|
8564
|
-
const [isConfirming, setIsConfirming] =
|
|
8565
|
-
return !isConfirming ? /* @__PURE__ */
|
|
8667
|
+
const [isConfirming, setIsConfirming] = React44.useState(false);
|
|
8668
|
+
return !isConfirming ? /* @__PURE__ */ React44.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8566
8669
|
setIsConfirming(true);
|
|
8567
8670
|
e.preventDefault();
|
|
8568
8671
|
e.stopPropagation();
|
|
8569
|
-
} }) : /* @__PURE__ */
|
|
8672
|
+
} }) : /* @__PURE__ */ React44.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8570
8673
|
if (originalOnClick) {
|
|
8571
8674
|
setIsConfirming(false);
|
|
8572
8675
|
originalOnClick(e);
|
|
8573
8676
|
e.preventDefault();
|
|
8574
8677
|
e.stopPropagation();
|
|
8575
8678
|
}
|
|
8576
|
-
} }, /* @__PURE__ */
|
|
8679
|
+
} }, /* @__PURE__ */ React44.createElement("div", { className: "flex flex-row gap-2 items-center" }, /* @__PURE__ */ React44.createElement("div", { className: "text-destructive" }, "Are you sure ?")));
|
|
8577
8680
|
}
|
|
8578
8681
|
function DropdownMenuItem2({
|
|
8579
8682
|
className,
|
|
@@ -8581,7 +8684,7 @@ function DropdownMenuItem2({
|
|
|
8581
8684
|
variant = "default",
|
|
8582
8685
|
...props
|
|
8583
8686
|
}) {
|
|
8584
|
-
return /* @__PURE__ */
|
|
8687
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8585
8688
|
Item22,
|
|
8586
8689
|
{
|
|
8587
8690
|
"data-slot": "dropdown-menu-item",
|
|
@@ -8601,7 +8704,7 @@ function DropdownMenuCheckboxItem2({
|
|
|
8601
8704
|
checked,
|
|
8602
8705
|
...props
|
|
8603
8706
|
}) {
|
|
8604
|
-
return /* @__PURE__ */
|
|
8707
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8605
8708
|
CheckboxItem2,
|
|
8606
8709
|
{
|
|
8607
8710
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -8612,14 +8715,14 @@ function DropdownMenuCheckboxItem2({
|
|
|
8612
8715
|
checked,
|
|
8613
8716
|
...props
|
|
8614
8717
|
},
|
|
8615
|
-
/* @__PURE__ */
|
|
8718
|
+
/* @__PURE__ */ React44.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.createElement(ItemIndicator2, null, /* @__PURE__ */ React44.createElement(Check, { className: "uii:size-4" }))),
|
|
8616
8719
|
children
|
|
8617
8720
|
);
|
|
8618
8721
|
}
|
|
8619
8722
|
function DropdownMenuRadioGroup2({
|
|
8620
8723
|
...props
|
|
8621
8724
|
}) {
|
|
8622
|
-
return /* @__PURE__ */
|
|
8725
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8623
8726
|
RadioGroup2,
|
|
8624
8727
|
{
|
|
8625
8728
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -8632,7 +8735,7 @@ function DropdownMenuRadioItem2({
|
|
|
8632
8735
|
children,
|
|
8633
8736
|
...props
|
|
8634
8737
|
}) {
|
|
8635
|
-
return /* @__PURE__ */
|
|
8738
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8636
8739
|
RadioItem2,
|
|
8637
8740
|
{
|
|
8638
8741
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -8642,7 +8745,7 @@ function DropdownMenuRadioItem2({
|
|
|
8642
8745
|
),
|
|
8643
8746
|
...props
|
|
8644
8747
|
},
|
|
8645
|
-
/* @__PURE__ */
|
|
8748
|
+
/* @__PURE__ */ React44.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.createElement(ItemIndicator2, null, /* @__PURE__ */ React44.createElement(Circle, { className: "uii:size-2 uii:fill-current" }))),
|
|
8646
8749
|
children
|
|
8647
8750
|
);
|
|
8648
8751
|
}
|
|
@@ -8651,7 +8754,7 @@ function DropdownMenuLabel2({
|
|
|
8651
8754
|
inset,
|
|
8652
8755
|
...props
|
|
8653
8756
|
}) {
|
|
8654
|
-
return /* @__PURE__ */
|
|
8757
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8655
8758
|
Label2,
|
|
8656
8759
|
{
|
|
8657
8760
|
"data-slot": "dropdown-menu-label",
|
|
@@ -8668,7 +8771,7 @@ function DropdownMenuSeparator2({
|
|
|
8668
8771
|
className,
|
|
8669
8772
|
...props
|
|
8670
8773
|
}) {
|
|
8671
|
-
return /* @__PURE__ */
|
|
8774
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8672
8775
|
Separator2,
|
|
8673
8776
|
{
|
|
8674
8777
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -8681,7 +8784,7 @@ function DropdownMenuShortcut({
|
|
|
8681
8784
|
className,
|
|
8682
8785
|
...props
|
|
8683
8786
|
}) {
|
|
8684
|
-
return /* @__PURE__ */
|
|
8787
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8685
8788
|
"span",
|
|
8686
8789
|
{
|
|
8687
8790
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -8696,7 +8799,7 @@ function DropdownMenuShortcut({
|
|
|
8696
8799
|
function DropdownMenuSub2({
|
|
8697
8800
|
...props
|
|
8698
8801
|
}) {
|
|
8699
|
-
return /* @__PURE__ */
|
|
8802
|
+
return /* @__PURE__ */ React44.createElement(Sub2, { "data-slot": "dropdown-menu-sub", ...props });
|
|
8700
8803
|
}
|
|
8701
8804
|
function DropdownMenuSubTrigger2({
|
|
8702
8805
|
className,
|
|
@@ -8704,7 +8807,7 @@ function DropdownMenuSubTrigger2({
|
|
|
8704
8807
|
children,
|
|
8705
8808
|
...props
|
|
8706
8809
|
}) {
|
|
8707
|
-
return /* @__PURE__ */
|
|
8810
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8708
8811
|
SubTrigger2,
|
|
8709
8812
|
{
|
|
8710
8813
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
@@ -8716,14 +8819,14 @@ function DropdownMenuSubTrigger2({
|
|
|
8716
8819
|
...props
|
|
8717
8820
|
},
|
|
8718
8821
|
children,
|
|
8719
|
-
/* @__PURE__ */
|
|
8822
|
+
/* @__PURE__ */ React44.createElement(ChevronRight, { className: "uii:ml-auto uii:size-4" })
|
|
8720
8823
|
);
|
|
8721
8824
|
}
|
|
8722
8825
|
function DropdownMenuSubContent2({
|
|
8723
8826
|
className,
|
|
8724
8827
|
...props
|
|
8725
8828
|
}) {
|
|
8726
|
-
return /* @__PURE__ */
|
|
8829
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8727
8830
|
SubContent2,
|
|
8728
8831
|
{
|
|
8729
8832
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -8743,6 +8846,7 @@ __export(fields_exports, {
|
|
|
8743
8846
|
InferredTypesContext: () => InferredTypesContext,
|
|
8744
8847
|
InferredTypesProvider: () => InferredTypesProvider,
|
|
8745
8848
|
Input: () => Input,
|
|
8849
|
+
LogicToggleButton: () => LogicToggleButton,
|
|
8746
8850
|
NestedFieldProvider: () => NestedFieldProvider,
|
|
8747
8851
|
NodePropertyProvider: () => NodePropertyProvider,
|
|
8748
8852
|
OPERATORS_BY_TYPE: () => OPERATORS_BY_TYPE,
|
|
@@ -8756,6 +8860,7 @@ __export(fields_exports, {
|
|
|
8756
8860
|
getOperatorsForType: () => getOperatorsForType,
|
|
8757
8861
|
getStringConstants: () => getStringConstants,
|
|
8758
8862
|
intersectTypes: () => intersectTypes,
|
|
8863
|
+
logicToggleButtonStyles: () => logicToggleButtonStyles,
|
|
8759
8864
|
normalizeFieldValue: () => normalizeFieldValue,
|
|
8760
8865
|
parseInferSyntax: () => parseInferSyntax,
|
|
8761
8866
|
parseInferredTypes: () => parseInferredTypes,
|
|
@@ -8782,7 +8887,7 @@ __export(fields_exports, {
|
|
|
8782
8887
|
var DevContext = createContext(null);
|
|
8783
8888
|
function useResolvedExpectedType(expectedType, devCtx) {
|
|
8784
8889
|
const inferredTypes = devCtx?.inferredTypes;
|
|
8785
|
-
return
|
|
8890
|
+
return React44.useMemo(() => {
|
|
8786
8891
|
if (!expectedType) return "any";
|
|
8787
8892
|
if (!expectedType.startsWith("$infer<")) {
|
|
8788
8893
|
return expectedType;
|
|
@@ -8827,16 +8932,16 @@ function Input({
|
|
|
8827
8932
|
}) {
|
|
8828
8933
|
const devCtx = useContext(DevContext);
|
|
8829
8934
|
const resolvedExpectedType = useResolvedExpectedType(expectedType, devCtx);
|
|
8830
|
-
const displayValue =
|
|
8935
|
+
const displayValue = React44.useMemo(() => {
|
|
8831
8936
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
8832
8937
|
return String(value.expression ?? "");
|
|
8833
8938
|
}
|
|
8834
8939
|
return String(value ?? "");
|
|
8835
8940
|
}, [value]);
|
|
8836
|
-
const isExpression =
|
|
8941
|
+
const isExpression = React44.useMemo(() => {
|
|
8837
8942
|
return value != null && typeof value === "object" && "expression" in value;
|
|
8838
8943
|
}, [value]);
|
|
8839
|
-
const handleChange =
|
|
8944
|
+
const handleChange = React44.useCallback((e) => {
|
|
8840
8945
|
const newValue = e.target.value;
|
|
8841
8946
|
if (newValue.includes("{{")) {
|
|
8842
8947
|
onChange({
|
|
@@ -8849,7 +8954,7 @@ function Input({
|
|
|
8849
8954
|
}, [onChange]);
|
|
8850
8955
|
const showError = hasRequiredError || required && !displayValue;
|
|
8851
8956
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
8852
|
-
return /* @__PURE__ */
|
|
8957
|
+
return /* @__PURE__ */ React44.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React44.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React44.createElement(
|
|
8853
8958
|
"label",
|
|
8854
8959
|
{
|
|
8855
8960
|
htmlFor: fieldName,
|
|
@@ -8857,7 +8962,7 @@ function Input({
|
|
|
8857
8962
|
},
|
|
8858
8963
|
label,
|
|
8859
8964
|
":"
|
|
8860
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
8965
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44.createElement(
|
|
8861
8966
|
"span",
|
|
8862
8967
|
{
|
|
8863
8968
|
className: cn(
|
|
@@ -8867,7 +8972,7 @@ function Input({
|
|
|
8867
8972
|
title: resolvedExpectedType
|
|
8868
8973
|
},
|
|
8869
8974
|
resolvedExpectedType
|
|
8870
|
-
), showError && /* @__PURE__ */
|
|
8975
|
+
), showError && /* @__PURE__ */ React44.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.createElement("div", { className: "uii:mt-0.5" }, /* @__PURE__ */ React44.createElement(
|
|
8871
8976
|
"input",
|
|
8872
8977
|
{
|
|
8873
8978
|
id: fieldName,
|
|
@@ -8895,8 +9000,8 @@ function clamp2(value, [min2, max2]) {
|
|
|
8895
9000
|
return Math.min(max2, Math.max(min2, value));
|
|
8896
9001
|
}
|
|
8897
9002
|
function usePrevious(value) {
|
|
8898
|
-
const ref =
|
|
8899
|
-
return
|
|
9003
|
+
const ref = React44.useRef({ value, previous: value });
|
|
9004
|
+
return React44.useMemo(() => {
|
|
8900
9005
|
if (ref.current.value !== value) {
|
|
8901
9006
|
ref.current.previous = ref.current.value;
|
|
8902
9007
|
ref.current.value = value;
|
|
@@ -8918,7 +9023,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
8918
9023
|
wordWrap: "normal"
|
|
8919
9024
|
});
|
|
8920
9025
|
var NAME3 = "VisuallyHidden";
|
|
8921
|
-
var VisuallyHidden =
|
|
9026
|
+
var VisuallyHidden = React44.forwardRef(
|
|
8922
9027
|
(props, forwardedRef) => {
|
|
8923
9028
|
return /* @__PURE__ */ jsx(
|
|
8924
9029
|
Primitive.span,
|
|
@@ -8960,9 +9065,9 @@ var Select = (props) => {
|
|
|
8960
9065
|
form
|
|
8961
9066
|
} = props;
|
|
8962
9067
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
8963
|
-
const [trigger, setTrigger] =
|
|
8964
|
-
const [valueNode, setValueNode] =
|
|
8965
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
9068
|
+
const [trigger, setTrigger] = React44.useState(null);
|
|
9069
|
+
const [valueNode, setValueNode] = React44.useState(null);
|
|
9070
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React44.useState(false);
|
|
8966
9071
|
const direction = useDirection(dir);
|
|
8967
9072
|
const [open, setOpen] = useControllableState({
|
|
8968
9073
|
prop: openProp,
|
|
@@ -8976,9 +9081,9 @@ var Select = (props) => {
|
|
|
8976
9081
|
onChange: onValueChange,
|
|
8977
9082
|
caller: SELECT_NAME
|
|
8978
9083
|
});
|
|
8979
|
-
const triggerPointerDownPosRef =
|
|
9084
|
+
const triggerPointerDownPosRef = React44.useRef(null);
|
|
8980
9085
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
8981
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
9086
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React44.useState(/* @__PURE__ */ new Set());
|
|
8982
9087
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
8983
9088
|
return /* @__PURE__ */ jsx(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs(
|
|
8984
9089
|
SelectProvider,
|
|
@@ -9004,10 +9109,10 @@ var Select = (props) => {
|
|
|
9004
9109
|
SelectNativeOptionsProvider,
|
|
9005
9110
|
{
|
|
9006
9111
|
scope: props.__scopeSelect,
|
|
9007
|
-
onNativeOptionAdd:
|
|
9112
|
+
onNativeOptionAdd: React44.useCallback((option) => {
|
|
9008
9113
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
9009
9114
|
}, []),
|
|
9010
|
-
onNativeOptionRemove:
|
|
9115
|
+
onNativeOptionRemove: React44.useCallback((option) => {
|
|
9011
9116
|
setNativeOptionsSet((prev) => {
|
|
9012
9117
|
const optionsSet = new Set(prev);
|
|
9013
9118
|
optionsSet.delete(option);
|
|
@@ -9042,7 +9147,7 @@ var Select = (props) => {
|
|
|
9042
9147
|
};
|
|
9043
9148
|
Select.displayName = SELECT_NAME;
|
|
9044
9149
|
var TRIGGER_NAME2 = "SelectTrigger";
|
|
9045
|
-
var SelectTrigger =
|
|
9150
|
+
var SelectTrigger = React44.forwardRef(
|
|
9046
9151
|
(props, forwardedRef) => {
|
|
9047
9152
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
9048
9153
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -9050,7 +9155,7 @@ var SelectTrigger = React43.forwardRef(
|
|
|
9050
9155
|
const isDisabled = context.disabled || disabled;
|
|
9051
9156
|
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
9052
9157
|
const getItems = useCollection3(__scopeSelect);
|
|
9053
|
-
const pointerTypeRef =
|
|
9158
|
+
const pointerTypeRef = React44.useRef("touch");
|
|
9054
9159
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
9055
9160
|
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
9056
9161
|
const currentItem = enabledItems.find((item) => item.value === context.value);
|
|
@@ -9120,7 +9225,7 @@ var SelectTrigger = React43.forwardRef(
|
|
|
9120
9225
|
);
|
|
9121
9226
|
SelectTrigger.displayName = TRIGGER_NAME2;
|
|
9122
9227
|
var VALUE_NAME = "SelectValue";
|
|
9123
|
-
var SelectValue =
|
|
9228
|
+
var SelectValue = React44.forwardRef(
|
|
9124
9229
|
(props, forwardedRef) => {
|
|
9125
9230
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
9126
9231
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
@@ -9143,7 +9248,7 @@ var SelectValue = React43.forwardRef(
|
|
|
9143
9248
|
);
|
|
9144
9249
|
SelectValue.displayName = VALUE_NAME;
|
|
9145
9250
|
var ICON_NAME = "SelectIcon";
|
|
9146
|
-
var SelectIcon =
|
|
9251
|
+
var SelectIcon = React44.forwardRef(
|
|
9147
9252
|
(props, forwardedRef) => {
|
|
9148
9253
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
9149
9254
|
return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
@@ -9156,10 +9261,10 @@ var SelectPortal = (props) => {
|
|
|
9156
9261
|
};
|
|
9157
9262
|
SelectPortal.displayName = PORTAL_NAME4;
|
|
9158
9263
|
var CONTENT_NAME4 = "SelectContent";
|
|
9159
|
-
var SelectContent =
|
|
9264
|
+
var SelectContent = React44.forwardRef(
|
|
9160
9265
|
(props, forwardedRef) => {
|
|
9161
9266
|
const context = useSelectContext(CONTENT_NAME4, props.__scopeSelect);
|
|
9162
|
-
const [fragment, setFragment] =
|
|
9267
|
+
const [fragment, setFragment] = React44.useState();
|
|
9163
9268
|
useLayoutEffect2(() => {
|
|
9164
9269
|
setFragment(new DocumentFragment());
|
|
9165
9270
|
}, []);
|
|
@@ -9178,7 +9283,7 @@ var CONTENT_MARGIN = 10;
|
|
|
9178
9283
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME4);
|
|
9179
9284
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
9180
9285
|
var Slot3 = createSlot2("SelectContent.RemoveScroll");
|
|
9181
|
-
var SelectContentImpl =
|
|
9286
|
+
var SelectContentImpl = React44.forwardRef(
|
|
9182
9287
|
(props, forwardedRef) => {
|
|
9183
9288
|
const {
|
|
9184
9289
|
__scopeSelect,
|
|
@@ -9202,21 +9307,21 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9202
9307
|
...contentProps
|
|
9203
9308
|
} = props;
|
|
9204
9309
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9205
|
-
const [content, setContent] =
|
|
9206
|
-
const [viewport, setViewport] =
|
|
9310
|
+
const [content, setContent] = React44.useState(null);
|
|
9311
|
+
const [viewport, setViewport] = React44.useState(null);
|
|
9207
9312
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9208
|
-
const [selectedItem, setSelectedItem] =
|
|
9209
|
-
const [selectedItemText, setSelectedItemText] =
|
|
9313
|
+
const [selectedItem, setSelectedItem] = React44.useState(null);
|
|
9314
|
+
const [selectedItemText, setSelectedItemText] = React44.useState(
|
|
9210
9315
|
null
|
|
9211
9316
|
);
|
|
9212
9317
|
const getItems = useCollection3(__scopeSelect);
|
|
9213
|
-
const [isPositioned, setIsPositioned] =
|
|
9214
|
-
const firstValidItemFoundRef =
|
|
9215
|
-
|
|
9318
|
+
const [isPositioned, setIsPositioned] = React44.useState(false);
|
|
9319
|
+
const firstValidItemFoundRef = React44.useRef(false);
|
|
9320
|
+
React44.useEffect(() => {
|
|
9216
9321
|
if (content) return hideOthers(content);
|
|
9217
9322
|
}, [content]);
|
|
9218
9323
|
useFocusGuards();
|
|
9219
|
-
const focusFirst4 =
|
|
9324
|
+
const focusFirst4 = React44.useCallback(
|
|
9220
9325
|
(candidates) => {
|
|
9221
9326
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
9222
9327
|
const [lastItem] = restItems.slice(-1);
|
|
@@ -9232,17 +9337,17 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9232
9337
|
},
|
|
9233
9338
|
[getItems, viewport]
|
|
9234
9339
|
);
|
|
9235
|
-
const focusSelectedItem =
|
|
9340
|
+
const focusSelectedItem = React44.useCallback(
|
|
9236
9341
|
() => focusFirst4([selectedItem, content]),
|
|
9237
9342
|
[focusFirst4, selectedItem, content]
|
|
9238
9343
|
);
|
|
9239
|
-
|
|
9344
|
+
React44.useEffect(() => {
|
|
9240
9345
|
if (isPositioned) {
|
|
9241
9346
|
focusSelectedItem();
|
|
9242
9347
|
}
|
|
9243
9348
|
}, [isPositioned, focusSelectedItem]);
|
|
9244
9349
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
9245
|
-
|
|
9350
|
+
React44.useEffect(() => {
|
|
9246
9351
|
if (content) {
|
|
9247
9352
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
9248
9353
|
const handlePointerMove = (event) => {
|
|
@@ -9272,7 +9377,7 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9272
9377
|
};
|
|
9273
9378
|
}
|
|
9274
9379
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
9275
|
-
|
|
9380
|
+
React44.useEffect(() => {
|
|
9276
9381
|
const close = () => onOpenChange(false);
|
|
9277
9382
|
window.addEventListener("blur", close);
|
|
9278
9383
|
window.addEventListener("resize", close);
|
|
@@ -9289,7 +9394,7 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9289
9394
|
setTimeout(() => nextItem.ref.current.focus());
|
|
9290
9395
|
}
|
|
9291
9396
|
});
|
|
9292
|
-
const itemRefCallback =
|
|
9397
|
+
const itemRefCallback = React44.useCallback(
|
|
9293
9398
|
(node, value, disabled) => {
|
|
9294
9399
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9295
9400
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9300,8 +9405,8 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9300
9405
|
},
|
|
9301
9406
|
[context.value]
|
|
9302
9407
|
);
|
|
9303
|
-
const handleItemLeave =
|
|
9304
|
-
const itemTextRefCallback =
|
|
9408
|
+
const handleItemLeave = React44.useCallback(() => content?.focus(), [content]);
|
|
9409
|
+
const itemTextRefCallback = React44.useCallback(
|
|
9305
9410
|
(node, value, disabled) => {
|
|
9306
9411
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9307
9412
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9412,18 +9517,18 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9412
9517
|
);
|
|
9413
9518
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
9414
9519
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
9415
|
-
var SelectItemAlignedPosition =
|
|
9520
|
+
var SelectItemAlignedPosition = React44.forwardRef((props, forwardedRef) => {
|
|
9416
9521
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
9417
9522
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9418
9523
|
const contentContext = useSelectContentContext(CONTENT_NAME4, __scopeSelect);
|
|
9419
|
-
const [contentWrapper, setContentWrapper] =
|
|
9420
|
-
const [content, setContent] =
|
|
9524
|
+
const [contentWrapper, setContentWrapper] = React44.useState(null);
|
|
9525
|
+
const [content, setContent] = React44.useState(null);
|
|
9421
9526
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9422
9527
|
const getItems = useCollection3(__scopeSelect);
|
|
9423
|
-
const shouldExpandOnScrollRef =
|
|
9424
|
-
const shouldRepositionRef =
|
|
9528
|
+
const shouldExpandOnScrollRef = React44.useRef(false);
|
|
9529
|
+
const shouldRepositionRef = React44.useRef(true);
|
|
9425
9530
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
9426
|
-
const position =
|
|
9531
|
+
const position = React44.useCallback(() => {
|
|
9427
9532
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
9428
9533
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
9429
9534
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -9523,11 +9628,11 @@ var SelectItemAlignedPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9523
9628
|
onPlaced
|
|
9524
9629
|
]);
|
|
9525
9630
|
useLayoutEffect2(() => position(), [position]);
|
|
9526
|
-
const [contentZIndex, setContentZIndex] =
|
|
9631
|
+
const [contentZIndex, setContentZIndex] = React44.useState();
|
|
9527
9632
|
useLayoutEffect2(() => {
|
|
9528
9633
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
9529
9634
|
}, [content]);
|
|
9530
|
-
const handleScrollButtonChange =
|
|
9635
|
+
const handleScrollButtonChange = React44.useCallback(
|
|
9531
9636
|
(node) => {
|
|
9532
9637
|
if (node && shouldRepositionRef.current === true) {
|
|
9533
9638
|
position();
|
|
@@ -9576,7 +9681,7 @@ var SelectItemAlignedPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9576
9681
|
});
|
|
9577
9682
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
9578
9683
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
9579
|
-
var SelectPopperPosition =
|
|
9684
|
+
var SelectPopperPosition = React44.forwardRef((props, forwardedRef) => {
|
|
9580
9685
|
const {
|
|
9581
9686
|
__scopeSelect,
|
|
9582
9687
|
align = "start",
|
|
@@ -9611,13 +9716,13 @@ var SelectPopperPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9611
9716
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
9612
9717
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME4, {});
|
|
9613
9718
|
var VIEWPORT_NAME = "SelectViewport";
|
|
9614
|
-
var SelectViewport =
|
|
9719
|
+
var SelectViewport = React44.forwardRef(
|
|
9615
9720
|
(props, forwardedRef) => {
|
|
9616
9721
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
9617
9722
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
9618
9723
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
9619
9724
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
9620
|
-
const prevScrollTopRef =
|
|
9725
|
+
const prevScrollTopRef = React44.useRef(0);
|
|
9621
9726
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9622
9727
|
/* @__PURE__ */ jsx(
|
|
9623
9728
|
"style",
|
|
@@ -9680,7 +9785,7 @@ var SelectViewport = React43.forwardRef(
|
|
|
9680
9785
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
9681
9786
|
var GROUP_NAME4 = "SelectGroup";
|
|
9682
9787
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME4);
|
|
9683
|
-
var SelectGroup =
|
|
9788
|
+
var SelectGroup = React44.forwardRef(
|
|
9684
9789
|
(props, forwardedRef) => {
|
|
9685
9790
|
const { __scopeSelect, ...groupProps } = props;
|
|
9686
9791
|
const groupId = useId();
|
|
@@ -9689,7 +9794,7 @@ var SelectGroup = React43.forwardRef(
|
|
|
9689
9794
|
);
|
|
9690
9795
|
SelectGroup.displayName = GROUP_NAME4;
|
|
9691
9796
|
var LABEL_NAME3 = "SelectLabel";
|
|
9692
|
-
var SelectLabel =
|
|
9797
|
+
var SelectLabel = React44.forwardRef(
|
|
9693
9798
|
(props, forwardedRef) => {
|
|
9694
9799
|
const { __scopeSelect, ...labelProps } = props;
|
|
9695
9800
|
const groupContext = useSelectGroupContext(LABEL_NAME3, __scopeSelect);
|
|
@@ -9699,7 +9804,7 @@ var SelectLabel = React43.forwardRef(
|
|
|
9699
9804
|
SelectLabel.displayName = LABEL_NAME3;
|
|
9700
9805
|
var ITEM_NAME4 = "SelectItem";
|
|
9701
9806
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME4);
|
|
9702
|
-
var SelectItem =
|
|
9807
|
+
var SelectItem = React44.forwardRef(
|
|
9703
9808
|
(props, forwardedRef) => {
|
|
9704
9809
|
const {
|
|
9705
9810
|
__scopeSelect,
|
|
@@ -9711,14 +9816,14 @@ var SelectItem = React43.forwardRef(
|
|
|
9711
9816
|
const context = useSelectContext(ITEM_NAME4, __scopeSelect);
|
|
9712
9817
|
const contentContext = useSelectContentContext(ITEM_NAME4, __scopeSelect);
|
|
9713
9818
|
const isSelected = context.value === value;
|
|
9714
|
-
const [textValue, setTextValue] =
|
|
9715
|
-
const [isFocused, setIsFocused] =
|
|
9819
|
+
const [textValue, setTextValue] = React44.useState(textValueProp ?? "");
|
|
9820
|
+
const [isFocused, setIsFocused] = React44.useState(false);
|
|
9716
9821
|
const composedRefs = useComposedRefs(
|
|
9717
9822
|
forwardedRef,
|
|
9718
9823
|
(node) => contentContext.itemRefCallback?.(node, value, disabled)
|
|
9719
9824
|
);
|
|
9720
9825
|
const textId = useId();
|
|
9721
|
-
const pointerTypeRef =
|
|
9826
|
+
const pointerTypeRef = React44.useRef("touch");
|
|
9722
9827
|
const handleSelect = () => {
|
|
9723
9828
|
if (!disabled) {
|
|
9724
9829
|
context.onValueChange(value);
|
|
@@ -9738,7 +9843,7 @@ var SelectItem = React43.forwardRef(
|
|
|
9738
9843
|
disabled,
|
|
9739
9844
|
textId,
|
|
9740
9845
|
isSelected,
|
|
9741
|
-
onItemTextChange:
|
|
9846
|
+
onItemTextChange: React44.useCallback((node) => {
|
|
9742
9847
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
9743
9848
|
}, []),
|
|
9744
9849
|
children: /* @__PURE__ */ jsx(
|
|
@@ -9801,14 +9906,14 @@ var SelectItem = React43.forwardRef(
|
|
|
9801
9906
|
);
|
|
9802
9907
|
SelectItem.displayName = ITEM_NAME4;
|
|
9803
9908
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
9804
|
-
var SelectItemText =
|
|
9909
|
+
var SelectItemText = React44.forwardRef(
|
|
9805
9910
|
(props, forwardedRef) => {
|
|
9806
9911
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
9807
9912
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9808
9913
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9809
9914
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9810
9915
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9811
|
-
const [itemTextNode, setItemTextNode] =
|
|
9916
|
+
const [itemTextNode, setItemTextNode] = React44.useState(null);
|
|
9812
9917
|
const composedRefs = useComposedRefs(
|
|
9813
9918
|
forwardedRef,
|
|
9814
9919
|
(node) => setItemTextNode(node),
|
|
@@ -9816,7 +9921,7 @@ var SelectItemText = React43.forwardRef(
|
|
|
9816
9921
|
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
|
9817
9922
|
);
|
|
9818
9923
|
const textContent = itemTextNode?.textContent;
|
|
9819
|
-
const nativeOption =
|
|
9924
|
+
const nativeOption = React44.useMemo(
|
|
9820
9925
|
() => /* @__PURE__ */ jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
9821
9926
|
[itemContext.disabled, itemContext.value, textContent]
|
|
9822
9927
|
);
|
|
@@ -9833,7 +9938,7 @@ var SelectItemText = React43.forwardRef(
|
|
|
9833
9938
|
);
|
|
9834
9939
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
9835
9940
|
var ITEM_INDICATOR_NAME2 = "SelectItemIndicator";
|
|
9836
|
-
var SelectItemIndicator =
|
|
9941
|
+
var SelectItemIndicator = React44.forwardRef(
|
|
9837
9942
|
(props, forwardedRef) => {
|
|
9838
9943
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
9839
9944
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME2, __scopeSelect);
|
|
@@ -9842,10 +9947,10 @@ var SelectItemIndicator = React43.forwardRef(
|
|
|
9842
9947
|
);
|
|
9843
9948
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME2;
|
|
9844
9949
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
9845
|
-
var SelectScrollUpButton =
|
|
9950
|
+
var SelectScrollUpButton = React44.forwardRef((props, forwardedRef) => {
|
|
9846
9951
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9847
9952
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9848
|
-
const [canScrollUp, setCanScrollUp] =
|
|
9953
|
+
const [canScrollUp, setCanScrollUp] = React44.useState(false);
|
|
9849
9954
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9850
9955
|
useLayoutEffect2(() => {
|
|
9851
9956
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9875,10 +9980,10 @@ var SelectScrollUpButton = React43.forwardRef((props, forwardedRef) => {
|
|
|
9875
9980
|
});
|
|
9876
9981
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
9877
9982
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
9878
|
-
var SelectScrollDownButton =
|
|
9983
|
+
var SelectScrollDownButton = React44.forwardRef((props, forwardedRef) => {
|
|
9879
9984
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9880
9985
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9881
|
-
const [canScrollDown, setCanScrollDown] =
|
|
9986
|
+
const [canScrollDown, setCanScrollDown] = React44.useState(false);
|
|
9882
9987
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9883
9988
|
useLayoutEffect2(() => {
|
|
9884
9989
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9908,18 +10013,18 @@ var SelectScrollDownButton = React43.forwardRef((props, forwardedRef) => {
|
|
|
9908
10013
|
) : null;
|
|
9909
10014
|
});
|
|
9910
10015
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
9911
|
-
var SelectScrollButtonImpl =
|
|
10016
|
+
var SelectScrollButtonImpl = React44.forwardRef((props, forwardedRef) => {
|
|
9912
10017
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
9913
10018
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
9914
|
-
const autoScrollTimerRef =
|
|
10019
|
+
const autoScrollTimerRef = React44.useRef(null);
|
|
9915
10020
|
const getItems = useCollection3(__scopeSelect);
|
|
9916
|
-
const clearAutoScrollTimer =
|
|
10021
|
+
const clearAutoScrollTimer = React44.useCallback(() => {
|
|
9917
10022
|
if (autoScrollTimerRef.current !== null) {
|
|
9918
10023
|
window.clearInterval(autoScrollTimerRef.current);
|
|
9919
10024
|
autoScrollTimerRef.current = null;
|
|
9920
10025
|
}
|
|
9921
10026
|
}, []);
|
|
9922
|
-
|
|
10027
|
+
React44.useEffect(() => {
|
|
9923
10028
|
return () => clearAutoScrollTimer();
|
|
9924
10029
|
}, [clearAutoScrollTimer]);
|
|
9925
10030
|
useLayoutEffect2(() => {
|
|
@@ -9951,7 +10056,7 @@ var SelectScrollButtonImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
9951
10056
|
);
|
|
9952
10057
|
});
|
|
9953
10058
|
var SEPARATOR_NAME3 = "SelectSeparator";
|
|
9954
|
-
var SelectSeparator =
|
|
10059
|
+
var SelectSeparator = React44.forwardRef(
|
|
9955
10060
|
(props, forwardedRef) => {
|
|
9956
10061
|
const { __scopeSelect, ...separatorProps } = props;
|
|
9957
10062
|
return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
@@ -9959,7 +10064,7 @@ var SelectSeparator = React43.forwardRef(
|
|
|
9959
10064
|
);
|
|
9960
10065
|
SelectSeparator.displayName = SEPARATOR_NAME3;
|
|
9961
10066
|
var ARROW_NAME4 = "SelectArrow";
|
|
9962
|
-
var SelectArrow =
|
|
10067
|
+
var SelectArrow = React44.forwardRef(
|
|
9963
10068
|
(props, forwardedRef) => {
|
|
9964
10069
|
const { __scopeSelect, ...arrowProps } = props;
|
|
9965
10070
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -9970,12 +10075,12 @@ var SelectArrow = React43.forwardRef(
|
|
|
9970
10075
|
);
|
|
9971
10076
|
SelectArrow.displayName = ARROW_NAME4;
|
|
9972
10077
|
var BUBBLE_INPUT_NAME = "SelectBubbleInput";
|
|
9973
|
-
var SelectBubbleInput =
|
|
10078
|
+
var SelectBubbleInput = React44.forwardRef(
|
|
9974
10079
|
({ __scopeSelect, value, ...props }, forwardedRef) => {
|
|
9975
|
-
const ref =
|
|
10080
|
+
const ref = React44.useRef(null);
|
|
9976
10081
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
9977
10082
|
const prevValue = usePrevious(value);
|
|
9978
|
-
|
|
10083
|
+
React44.useEffect(() => {
|
|
9979
10084
|
const select = ref.current;
|
|
9980
10085
|
if (!select) return;
|
|
9981
10086
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -10007,9 +10112,9 @@ function shouldShowPlaceholder(value) {
|
|
|
10007
10112
|
}
|
|
10008
10113
|
function useTypeaheadSearch(onSearchChange) {
|
|
10009
10114
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
10010
|
-
const searchRef =
|
|
10011
|
-
const timerRef =
|
|
10012
|
-
const handleTypeaheadSearch =
|
|
10115
|
+
const searchRef = React44.useRef("");
|
|
10116
|
+
const timerRef = React44.useRef(0);
|
|
10117
|
+
const handleTypeaheadSearch = React44.useCallback(
|
|
10013
10118
|
(key) => {
|
|
10014
10119
|
const search = searchRef.current + key;
|
|
10015
10120
|
handleSearchChange(search);
|
|
@@ -10021,11 +10126,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
10021
10126
|
},
|
|
10022
10127
|
[handleSearchChange]
|
|
10023
10128
|
);
|
|
10024
|
-
const resetTypeahead =
|
|
10129
|
+
const resetTypeahead = React44.useCallback(() => {
|
|
10025
10130
|
searchRef.current = "";
|
|
10026
10131
|
window.clearTimeout(timerRef.current);
|
|
10027
10132
|
}, []);
|
|
10028
|
-
|
|
10133
|
+
React44.useEffect(() => {
|
|
10029
10134
|
return () => window.clearTimeout(timerRef.current);
|
|
10030
10135
|
}, []);
|
|
10031
10136
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -10048,7 +10153,7 @@ function wrapArray3(array, startIndex) {
|
|
|
10048
10153
|
var Root24 = Select;
|
|
10049
10154
|
var Trigger2 = SelectTrigger;
|
|
10050
10155
|
var Value = SelectValue;
|
|
10051
|
-
var
|
|
10156
|
+
var Icon2 = SelectIcon;
|
|
10052
10157
|
var Portal3 = SelectPortal;
|
|
10053
10158
|
var Content23 = SelectContent;
|
|
10054
10159
|
var Viewport = SelectViewport;
|
|
@@ -10057,22 +10162,24 @@ var ItemText = SelectItemText;
|
|
|
10057
10162
|
var ItemIndicator3 = SelectItemIndicator;
|
|
10058
10163
|
var ScrollUpButton = SelectScrollUpButton;
|
|
10059
10164
|
var ScrollDownButton = SelectScrollDownButton;
|
|
10165
|
+
|
|
10166
|
+
// src/components/ui/select.tsx
|
|
10060
10167
|
function Select2({
|
|
10061
10168
|
...props
|
|
10062
10169
|
}) {
|
|
10063
|
-
return /* @__PURE__ */
|
|
10170
|
+
return /* @__PURE__ */ React44.createElement(Root24, { "data-slot": "select", ...props });
|
|
10064
10171
|
}
|
|
10065
10172
|
function SelectValue2({
|
|
10066
10173
|
...props
|
|
10067
10174
|
}) {
|
|
10068
|
-
return /* @__PURE__ */
|
|
10175
|
+
return /* @__PURE__ */ React44.createElement(Value, { "data-slot": "select-value", ...props });
|
|
10069
10176
|
}
|
|
10070
10177
|
function SelectTrigger2({
|
|
10071
10178
|
className,
|
|
10072
10179
|
children,
|
|
10073
10180
|
...props
|
|
10074
10181
|
}) {
|
|
10075
|
-
return /* @__PURE__ */
|
|
10182
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10076
10183
|
Trigger2,
|
|
10077
10184
|
{
|
|
10078
10185
|
"data-slot": "select-trigger",
|
|
@@ -10083,7 +10190,7 @@ function SelectTrigger2({
|
|
|
10083
10190
|
...props
|
|
10084
10191
|
},
|
|
10085
10192
|
children,
|
|
10086
|
-
/* @__PURE__ */
|
|
10193
|
+
/* @__PURE__ */ React44.createElement(Icon2, { asChild: true }, /* @__PURE__ */ React44.createElement(ChevronDown, { className: "uii:size-4 uii:opacity-50" }))
|
|
10087
10194
|
);
|
|
10088
10195
|
}
|
|
10089
10196
|
function SelectContent2({
|
|
@@ -10095,7 +10202,7 @@ function SelectContent2({
|
|
|
10095
10202
|
hideScrollDownButton = false,
|
|
10096
10203
|
...props
|
|
10097
10204
|
}) {
|
|
10098
|
-
return /* @__PURE__ */
|
|
10205
|
+
return /* @__PURE__ */ React44.createElement(Portal3, null, /* @__PURE__ */ React44.createElement(
|
|
10099
10206
|
Content23,
|
|
10100
10207
|
{
|
|
10101
10208
|
"data-slot": "select-content",
|
|
@@ -10108,8 +10215,8 @@ function SelectContent2({
|
|
|
10108
10215
|
position,
|
|
10109
10216
|
...props
|
|
10110
10217
|
},
|
|
10111
|
-
!hideScrollUpButton && /* @__PURE__ */
|
|
10112
|
-
/* @__PURE__ */
|
|
10218
|
+
!hideScrollUpButton && /* @__PURE__ */ React44.createElement(SelectScrollUpButton2, null),
|
|
10219
|
+
/* @__PURE__ */ React44.createElement(
|
|
10113
10220
|
Viewport,
|
|
10114
10221
|
{
|
|
10115
10222
|
className: cn(
|
|
@@ -10119,8 +10226,8 @@ function SelectContent2({
|
|
|
10119
10226
|
},
|
|
10120
10227
|
children
|
|
10121
10228
|
),
|
|
10122
|
-
footer ? /* @__PURE__ */
|
|
10123
|
-
!hideScrollDownButton && /* @__PURE__ */
|
|
10229
|
+
footer ? /* @__PURE__ */ React44.createElement("div", { className: "uii:border-t uii:p-2 uii:bg-popover" }, footer) : null,
|
|
10230
|
+
!hideScrollDownButton && /* @__PURE__ */ React44.createElement(SelectScrollDownButton2, null)
|
|
10124
10231
|
));
|
|
10125
10232
|
}
|
|
10126
10233
|
function SelectItem2({
|
|
@@ -10128,7 +10235,7 @@ function SelectItem2({
|
|
|
10128
10235
|
children,
|
|
10129
10236
|
...props
|
|
10130
10237
|
}) {
|
|
10131
|
-
return /* @__PURE__ */
|
|
10238
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10132
10239
|
Item3,
|
|
10133
10240
|
{
|
|
10134
10241
|
"data-slot": "select-item",
|
|
@@ -10138,15 +10245,15 @@ function SelectItem2({
|
|
|
10138
10245
|
),
|
|
10139
10246
|
...props
|
|
10140
10247
|
},
|
|
10141
|
-
/* @__PURE__ */
|
|
10142
|
-
/* @__PURE__ */
|
|
10248
|
+
/* @__PURE__ */ React44.createElement("span", { className: "uii:absolute uii:right-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center" }, /* @__PURE__ */ React44.createElement(ItemIndicator3, null, /* @__PURE__ */ React44.createElement(Check, { className: "uii:size-4" }))),
|
|
10249
|
+
/* @__PURE__ */ React44.createElement(ItemText, null, children)
|
|
10143
10250
|
);
|
|
10144
10251
|
}
|
|
10145
10252
|
function SelectScrollUpButton2({
|
|
10146
10253
|
className,
|
|
10147
10254
|
...props
|
|
10148
10255
|
}) {
|
|
10149
|
-
return /* @__PURE__ */
|
|
10256
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10150
10257
|
ScrollUpButton,
|
|
10151
10258
|
{
|
|
10152
10259
|
"data-slot": "select-scroll-up-button",
|
|
@@ -10156,14 +10263,14 @@ function SelectScrollUpButton2({
|
|
|
10156
10263
|
),
|
|
10157
10264
|
...props
|
|
10158
10265
|
},
|
|
10159
|
-
/* @__PURE__ */
|
|
10266
|
+
/* @__PURE__ */ React44.createElement(ChevronUp, { className: "uii:size-4" })
|
|
10160
10267
|
);
|
|
10161
10268
|
}
|
|
10162
10269
|
function SelectScrollDownButton2({
|
|
10163
10270
|
className,
|
|
10164
10271
|
...props
|
|
10165
10272
|
}) {
|
|
10166
|
-
return /* @__PURE__ */
|
|
10273
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10167
10274
|
ScrollDownButton,
|
|
10168
10275
|
{
|
|
10169
10276
|
"data-slot": "select-scroll-down-button",
|
|
@@ -10173,14 +10280,14 @@ function SelectScrollDownButton2({
|
|
|
10173
10280
|
),
|
|
10174
10281
|
...props
|
|
10175
10282
|
},
|
|
10176
|
-
/* @__PURE__ */
|
|
10283
|
+
/* @__PURE__ */ React44.createElement(ChevronDown, { className: "uii:size-4" })
|
|
10177
10284
|
);
|
|
10178
10285
|
}
|
|
10179
10286
|
|
|
10180
10287
|
// src/components/fields/Select.tsx
|
|
10181
10288
|
function useResolvedExpectedType2(expectedType, devCtx) {
|
|
10182
10289
|
const inferredTypes = devCtx?.inferredTypes;
|
|
10183
|
-
return
|
|
10290
|
+
return React44.useMemo(() => {
|
|
10184
10291
|
if (!expectedType) return "any";
|
|
10185
10292
|
if (!expectedType.startsWith("$infer<")) {
|
|
10186
10293
|
return expectedType;
|
|
@@ -10227,36 +10334,36 @@ function Select3({
|
|
|
10227
10334
|
}) {
|
|
10228
10335
|
const devCtx = useContext(DevContext);
|
|
10229
10336
|
const resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
|
|
10230
|
-
const [isExpressionMode, setIsExpressionMode] =
|
|
10231
|
-
const [expressionValue, setExpressionValue] =
|
|
10232
|
-
const options =
|
|
10337
|
+
const [isExpressionMode, setIsExpressionMode] = React44.useState(false);
|
|
10338
|
+
const [expressionValue, setExpressionValue] = React44.useState("");
|
|
10339
|
+
const options = React44.useMemo(() => {
|
|
10233
10340
|
return rawOptions.map(
|
|
10234
10341
|
(opt) => typeof opt === "string" ? { value: opt, label: opt } : opt
|
|
10235
10342
|
);
|
|
10236
10343
|
}, [rawOptions]);
|
|
10237
|
-
const displayValue =
|
|
10344
|
+
const displayValue = React44.useMemo(() => {
|
|
10238
10345
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
10239
10346
|
return String(value.expression ?? "");
|
|
10240
10347
|
}
|
|
10241
10348
|
return String(value ?? "");
|
|
10242
10349
|
}, [value]);
|
|
10243
|
-
const isExpression =
|
|
10350
|
+
const isExpression = React44.useMemo(() => {
|
|
10244
10351
|
return value && typeof value === "object" && "expression" in value;
|
|
10245
10352
|
}, [value]);
|
|
10246
|
-
|
|
10353
|
+
React44.useEffect(() => {
|
|
10247
10354
|
if (isExpression) {
|
|
10248
10355
|
setIsExpressionMode(true);
|
|
10249
10356
|
setExpressionValue(displayValue);
|
|
10250
10357
|
}
|
|
10251
10358
|
}, [isExpression, displayValue]);
|
|
10252
|
-
const handleSelectChange =
|
|
10359
|
+
const handleSelectChange = React44.useCallback((newValue) => {
|
|
10253
10360
|
if (newValue === "__expression__") {
|
|
10254
10361
|
setIsExpressionMode(true);
|
|
10255
10362
|
return;
|
|
10256
10363
|
}
|
|
10257
10364
|
onChange(newValue);
|
|
10258
10365
|
}, [onChange]);
|
|
10259
|
-
const handleExpressionChange =
|
|
10366
|
+
const handleExpressionChange = React44.useCallback((e) => {
|
|
10260
10367
|
const newValue = e.target.value;
|
|
10261
10368
|
setExpressionValue(newValue);
|
|
10262
10369
|
onChange({
|
|
@@ -10264,7 +10371,7 @@ function Select3({
|
|
|
10264
10371
|
type: "expression"
|
|
10265
10372
|
});
|
|
10266
10373
|
}, [onChange]);
|
|
10267
|
-
const handleSwitchToValue =
|
|
10374
|
+
const handleSwitchToValue = React44.useCallback(() => {
|
|
10268
10375
|
setIsExpressionMode(false);
|
|
10269
10376
|
setExpressionValue("");
|
|
10270
10377
|
onChange("");
|
|
@@ -10293,7 +10400,7 @@ function Select3({
|
|
|
10293
10400
|
hasError: showError
|
|
10294
10401
|
};
|
|
10295
10402
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
10296
|
-
return /* @__PURE__ */
|
|
10403
|
+
return /* @__PURE__ */ React44.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React44.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React44.createElement(
|
|
10297
10404
|
"label",
|
|
10298
10405
|
{
|
|
10299
10406
|
htmlFor: fieldName,
|
|
@@ -10301,7 +10408,7 @@ function Select3({
|
|
|
10301
10408
|
},
|
|
10302
10409
|
label,
|
|
10303
10410
|
":"
|
|
10304
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
10411
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44.createElement(
|
|
10305
10412
|
"span",
|
|
10306
10413
|
{
|
|
10307
10414
|
className: cn(
|
|
@@ -10311,12 +10418,12 @@ function Select3({
|
|
|
10311
10418
|
title: resolvedExpectedType
|
|
10312
10419
|
},
|
|
10313
10420
|
resolvedExpectedType
|
|
10314
|
-
), showError && /* @__PURE__ */
|
|
10421
|
+
), showError && /* @__PURE__ */ React44.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.createElement("div", { className: "uii:mt-0.5" }, children ? (
|
|
10315
10422
|
// Use custom render function
|
|
10316
10423
|
children(renderProps)
|
|
10317
10424
|
) : isExpressionMode ? (
|
|
10318
10425
|
// Expression mode - show input with clear button
|
|
10319
|
-
/* @__PURE__ */
|
|
10426
|
+
/* @__PURE__ */ React44.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.createElement(
|
|
10320
10427
|
"input",
|
|
10321
10428
|
{
|
|
10322
10429
|
id: fieldName,
|
|
@@ -10332,7 +10439,7 @@ function Select3({
|
|
|
10332
10439
|
disabled && "uii:opacity-50 uii:cursor-not-allowed"
|
|
10333
10440
|
)
|
|
10334
10441
|
}
|
|
10335
|
-
), /* @__PURE__ */
|
|
10442
|
+
), /* @__PURE__ */ React44.createElement(
|
|
10336
10443
|
"button",
|
|
10337
10444
|
{
|
|
10338
10445
|
type: "button",
|
|
@@ -10374,21 +10481,21 @@ function Select3({
|
|
|
10374
10481
|
// 📝 Custom Expression
|
|
10375
10482
|
// </option>
|
|
10376
10483
|
// </select>
|
|
10377
|
-
/* @__PURE__ */
|
|
10484
|
+
/* @__PURE__ */ React44.createElement(
|
|
10378
10485
|
Select2,
|
|
10379
10486
|
{
|
|
10380
10487
|
value: displayValue,
|
|
10381
10488
|
onValueChange: (e) => handleSelectChange(e),
|
|
10382
10489
|
disabled: disabled ?? disabled
|
|
10383
10490
|
},
|
|
10384
|
-
/* @__PURE__ */
|
|
10491
|
+
/* @__PURE__ */ React44.createElement(
|
|
10385
10492
|
SelectTrigger2,
|
|
10386
10493
|
{
|
|
10387
10494
|
className: "ui:w-full ui:h-9 ui:px-3 ui:border ui:border-input ui:rounded-sm ui:bg-background"
|
|
10388
10495
|
},
|
|
10389
|
-
/* @__PURE__ */
|
|
10496
|
+
/* @__PURE__ */ React44.createElement(SelectValue2, { placeholder })
|
|
10390
10497
|
),
|
|
10391
|
-
/* @__PURE__ */
|
|
10498
|
+
/* @__PURE__ */ React44.createElement(SelectContent2, null, options.map((opt) => /* @__PURE__ */ React44.createElement(SelectItem2, { key: opt.value, value: opt.value }, opt.node ? opt.node : /* @__PURE__ */ React44.createElement(React44.Fragment, null, opt.label))))
|
|
10392
10499
|
)
|
|
10393
10500
|
)));
|
|
10394
10501
|
}
|
|
@@ -10519,12 +10626,12 @@ function useFieldPath(fieldName) {
|
|
|
10519
10626
|
return fieldName;
|
|
10520
10627
|
}
|
|
10521
10628
|
function TemplateFieldProvider({ children }) {
|
|
10522
|
-
return /* @__PURE__ */
|
|
10629
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10523
10630
|
}
|
|
10524
10631
|
function NestedFieldProvider({
|
|
10525
10632
|
children
|
|
10526
10633
|
}) {
|
|
10527
|
-
return /* @__PURE__ */
|
|
10634
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10528
10635
|
}
|
|
10529
10636
|
var InferredTypesContext = createContext(null);
|
|
10530
10637
|
function useInferredTypes() {
|
|
@@ -10542,7 +10649,7 @@ function useInferredTypes() {
|
|
|
10542
10649
|
return realContext;
|
|
10543
10650
|
}
|
|
10544
10651
|
function InferredTypesProvider({ children }) {
|
|
10545
|
-
return /* @__PURE__ */
|
|
10652
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10546
10653
|
}
|
|
10547
10654
|
function intersectTypes(types) {
|
|
10548
10655
|
const validTypes = types.filter((t) => !!t && t.length > 0);
|
|
@@ -10603,7 +10710,7 @@ function getOperatorsForType(type) {
|
|
|
10603
10710
|
];
|
|
10604
10711
|
}
|
|
10605
10712
|
function NodePropertyProvider({ children }) {
|
|
10606
|
-
return /* @__PURE__ */
|
|
10713
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10607
10714
|
}
|
|
10608
10715
|
function useSetFieldMetadataOnly() {
|
|
10609
10716
|
return useCallback((_fieldKey, _metadata) => {
|
|
@@ -10618,7 +10725,7 @@ function useNodeProperty(key) {
|
|
|
10618
10725
|
const [devValue, setDevValue] = useState(
|
|
10619
10726
|
() => devContext?.data?.[key]
|
|
10620
10727
|
);
|
|
10621
|
-
|
|
10728
|
+
React44__default.useEffect(() => {
|
|
10622
10729
|
if (devContext) {
|
|
10623
10730
|
setDevValue(devContext.data[key]);
|
|
10624
10731
|
}
|
|
@@ -10642,7 +10749,7 @@ function useNodeProperties() {
|
|
|
10642
10749
|
const [devData, setDevData] = useState(
|
|
10643
10750
|
() => devContext?.data ?? {}
|
|
10644
10751
|
);
|
|
10645
|
-
|
|
10752
|
+
React44__default.useEffect(() => {
|
|
10646
10753
|
if (devContext) {
|
|
10647
10754
|
setDevData({ ...devContext.data });
|
|
10648
10755
|
}
|
|
@@ -10668,7 +10775,7 @@ function useInferredType(fieldName) {
|
|
|
10668
10775
|
const [devInferredType, setDevInferredType] = useState(
|
|
10669
10776
|
() => devContext?.inferredTypes?.[fieldName]
|
|
10670
10777
|
);
|
|
10671
|
-
|
|
10778
|
+
React44__default.useEffect(() => {
|
|
10672
10779
|
if (devContext) {
|
|
10673
10780
|
setDevInferredType(devContext.inferredTypes[fieldName]);
|
|
10674
10781
|
}
|
|
@@ -10730,7 +10837,7 @@ function useAllInferredTypes() {
|
|
|
10730
10837
|
const [devTypes, setDevTypes] = useState(
|
|
10731
10838
|
() => devContext?.inferredTypes ?? {}
|
|
10732
10839
|
);
|
|
10733
|
-
|
|
10840
|
+
React44__default.useEffect(() => {
|
|
10734
10841
|
if (devContext) {
|
|
10735
10842
|
setDevTypes({ ...devContext.inferredTypes });
|
|
10736
10843
|
}
|
|
@@ -10794,7 +10901,26 @@ function useFieldValidation() {
|
|
|
10794
10901
|
validateField
|
|
10795
10902
|
};
|
|
10796
10903
|
}
|
|
10904
|
+
/*! Bundled license information:
|
|
10905
|
+
|
|
10906
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
10907
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
10908
|
+
lucide-react/dist/esm/Icon.js:
|
|
10909
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
10910
|
+
lucide-react/dist/esm/icons/check.js:
|
|
10911
|
+
lucide-react/dist/esm/icons/chevron-down.js:
|
|
10912
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
10913
|
+
lucide-react/dist/esm/icons/chevron-up.js:
|
|
10914
|
+
lucide-react/dist/esm/icons/circle.js:
|
|
10915
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
10916
|
+
(**
|
|
10917
|
+
* @license lucide-react v0.476.0 - ISC
|
|
10918
|
+
*
|
|
10919
|
+
* This source code is licensed under the ISC license.
|
|
10920
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10921
|
+
*)
|
|
10922
|
+
*/
|
|
10797
10923
|
|
|
10798
|
-
export { Button, ConfirmationDropdownMenuItem, DropdownMenu2 as DropdownMenu, DropdownMenuCheckboxItem2 as DropdownMenuCheckboxItem, DropdownMenuClose, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuGroup2 as DropdownMenuGroup, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuPortal2 as DropdownMenuPortal, DropdownMenuRadioGroup2 as DropdownMenuRadioGroup, DropdownMenuRadioItem2 as DropdownMenuRadioItem, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub2 as DropdownMenuSub, DropdownMenuSubContent2 as DropdownMenuSubContent, DropdownMenuSubTrigger2 as DropdownMenuSubTrigger, DropdownMenuTrigger2 as DropdownMenuTrigger, ToggleButton, buttonVariants, fields_exports as fields, toggleButtonVariants };
|
|
10924
|
+
export { Button, ConfirmationDropdownMenuItem, DropdownMenu2 as DropdownMenu, DropdownMenuCheckboxItem2 as DropdownMenuCheckboxItem, DropdownMenuClose, DropdownMenuContent2 as DropdownMenuContent, DropdownMenuGroup2 as DropdownMenuGroup, DropdownMenuItem2 as DropdownMenuItem, DropdownMenuLabel2 as DropdownMenuLabel, DropdownMenuPortal2 as DropdownMenuPortal, DropdownMenuRadioGroup2 as DropdownMenuRadioGroup, DropdownMenuRadioItem2 as DropdownMenuRadioItem, DropdownMenuSeparator2 as DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub2 as DropdownMenuSub, DropdownMenuSubContent2 as DropdownMenuSubContent, DropdownMenuSubTrigger2 as DropdownMenuSubTrigger, DropdownMenuTrigger2 as DropdownMenuTrigger, LogicToggleButton, ToggleButton, buttonVariants, fields_exports as fields, logicToggleButtonStyles, toggleButtonVariants };
|
|
10799
10925
|
//# sourceMappingURL=index.js.map
|
|
10800
10926
|
//# sourceMappingURL=index.js.map
|