@process.co/ui 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/ui.css +77 -0
- package/dist/components/fields/index.cjs +19 -0
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.d.cts +1 -1
- package/dist/components/fields/index.d.ts +1 -1
- package/dist/components/fields/index.js +18 -1
- package/dist/components/fields/index.js.map +1 -1
- package/dist/{index-19C2gVyr.d.cts → index-D9NS5Zgl.d.cts} +13 -2
- package/dist/{index-19C2gVyr.d.ts → index-D9NS5Zgl.d.ts} +13 -2
- package/dist/index.cjs +449 -428
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +404 -385
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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';
|
|
@@ -41,10 +41,10 @@ function composeRefs(...refs) {
|
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
function useComposedRefs(...refs) {
|
|
44
|
-
return
|
|
44
|
+
return React44.useCallback(composeRefs(...refs), refs);
|
|
45
45
|
}
|
|
46
46
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
47
|
-
var use =
|
|
47
|
+
var use = React44[" use ".trim().toString()];
|
|
48
48
|
function isPromiseLike(value) {
|
|
49
49
|
return typeof value === "object" && value !== null && "then" in value;
|
|
50
50
|
}
|
|
@@ -54,24 +54,24 @@ function isLazyComponent(element) {
|
|
|
54
54
|
// @__NO_SIDE_EFFECTS__
|
|
55
55
|
function createSlot(ownerName) {
|
|
56
56
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
57
|
-
const Slot22 =
|
|
57
|
+
const Slot22 = React44.forwardRef((props, forwardedRef) => {
|
|
58
58
|
let { children, ...slotProps } = props;
|
|
59
59
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
60
60
|
children = use(children._payload);
|
|
61
61
|
}
|
|
62
|
-
const childrenArray =
|
|
62
|
+
const childrenArray = React44.Children.toArray(children);
|
|
63
63
|
const slottable = childrenArray.find(isSlottable);
|
|
64
64
|
if (slottable) {
|
|
65
65
|
const newElement = slottable.props.children;
|
|
66
66
|
const newChildren = childrenArray.map((child) => {
|
|
67
67
|
if (child === slottable) {
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
68
|
+
if (React44.Children.count(newElement) > 1) return React44.Children.only(null);
|
|
69
|
+
return React44.isValidElement(newElement) ? newElement.props.children : null;
|
|
70
70
|
} else {
|
|
71
71
|
return child;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
-
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 });
|
|
75
75
|
}
|
|
76
76
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
77
77
|
});
|
|
@@ -81,27 +81,27 @@ function createSlot(ownerName) {
|
|
|
81
81
|
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
82
82
|
// @__NO_SIDE_EFFECTS__
|
|
83
83
|
function createSlotClone(ownerName) {
|
|
84
|
-
const SlotClone =
|
|
84
|
+
const SlotClone = React44.forwardRef((props, forwardedRef) => {
|
|
85
85
|
let { children, ...slotProps } = props;
|
|
86
86
|
if (isLazyComponent(children) && typeof use === "function") {
|
|
87
87
|
children = use(children._payload);
|
|
88
88
|
}
|
|
89
|
-
if (
|
|
89
|
+
if (React44.isValidElement(children)) {
|
|
90
90
|
const childrenRef = getElementRef(children);
|
|
91
91
|
const props2 = mergeProps(slotProps, children.props);
|
|
92
|
-
if (children.type !==
|
|
92
|
+
if (children.type !== React44.Fragment) {
|
|
93
93
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return React44.cloneElement(children, props2);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return React44.Children.count(children) > 1 ? React44.Children.only(null) : null;
|
|
98
98
|
});
|
|
99
99
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
100
100
|
return SlotClone;
|
|
101
101
|
}
|
|
102
102
|
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
103
103
|
function isSlottable(child) {
|
|
104
|
-
return
|
|
104
|
+
return React44.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
105
105
|
}
|
|
106
106
|
function mergeProps(slotProps, childProps) {
|
|
107
107
|
const overrideProps = { ...childProps };
|
|
@@ -3248,7 +3248,7 @@ function Button({
|
|
|
3248
3248
|
...props
|
|
3249
3249
|
}) {
|
|
3250
3250
|
const Comp = asChild ? Slot : "button";
|
|
3251
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3252
3252
|
Comp,
|
|
3253
3253
|
{
|
|
3254
3254
|
"data-slot": "button",
|
|
@@ -3265,9 +3265,9 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
3265
3265
|
}
|
|
3266
3266
|
};
|
|
3267
3267
|
}
|
|
3268
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3268
|
+
var useLayoutEffect2 = globalThis?.document ? React44.useLayoutEffect : () => {
|
|
3269
3269
|
};
|
|
3270
|
-
var useInsertionEffect =
|
|
3270
|
+
var useInsertionEffect = React44[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3271
3271
|
function useControllableState({
|
|
3272
3272
|
prop,
|
|
3273
3273
|
defaultProp,
|
|
@@ -3282,8 +3282,8 @@ function useControllableState({
|
|
|
3282
3282
|
const isControlled = prop !== void 0;
|
|
3283
3283
|
const value = isControlled ? prop : uncontrolledProp;
|
|
3284
3284
|
{
|
|
3285
|
-
const isControlledRef =
|
|
3286
|
-
|
|
3285
|
+
const isControlledRef = React44.useRef(prop !== void 0);
|
|
3286
|
+
React44.useEffect(() => {
|
|
3287
3287
|
const wasControlled = isControlledRef.current;
|
|
3288
3288
|
if (wasControlled !== isControlled) {
|
|
3289
3289
|
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -3295,7 +3295,7 @@ function useControllableState({
|
|
|
3295
3295
|
isControlledRef.current = isControlled;
|
|
3296
3296
|
}, [isControlled, caller]);
|
|
3297
3297
|
}
|
|
3298
|
-
const setValue =
|
|
3298
|
+
const setValue = React44.useCallback(
|
|
3299
3299
|
(nextValue) => {
|
|
3300
3300
|
if (isControlled) {
|
|
3301
3301
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -3314,13 +3314,13 @@ function useUncontrolledState({
|
|
|
3314
3314
|
defaultProp,
|
|
3315
3315
|
onChange
|
|
3316
3316
|
}) {
|
|
3317
|
-
const [value, setValue] =
|
|
3318
|
-
const prevValueRef =
|
|
3319
|
-
const onChangeRef =
|
|
3317
|
+
const [value, setValue] = React44.useState(defaultProp);
|
|
3318
|
+
const prevValueRef = React44.useRef(value);
|
|
3319
|
+
const onChangeRef = React44.useRef(onChange);
|
|
3320
3320
|
useInsertionEffect(() => {
|
|
3321
3321
|
onChangeRef.current = onChange;
|
|
3322
3322
|
}, [onChange]);
|
|
3323
|
-
|
|
3323
|
+
React44.useEffect(() => {
|
|
3324
3324
|
if (prevValueRef.current !== value) {
|
|
3325
3325
|
onChangeRef.current?.(value);
|
|
3326
3326
|
prevValueRef.current = value;
|
|
@@ -3334,21 +3334,21 @@ function isFunction(value) {
|
|
|
3334
3334
|
// @__NO_SIDE_EFFECTS__
|
|
3335
3335
|
function createSlot2(ownerName) {
|
|
3336
3336
|
const SlotClone = /* @__PURE__ */ createSlotClone2(ownerName);
|
|
3337
|
-
const Slot22 =
|
|
3337
|
+
const Slot22 = React44.forwardRef((props, forwardedRef) => {
|
|
3338
3338
|
const { children, ...slotProps } = props;
|
|
3339
|
-
const childrenArray =
|
|
3339
|
+
const childrenArray = React44.Children.toArray(children);
|
|
3340
3340
|
const slottable = childrenArray.find(isSlottable2);
|
|
3341
3341
|
if (slottable) {
|
|
3342
3342
|
const newElement = slottable.props.children;
|
|
3343
3343
|
const newChildren = childrenArray.map((child) => {
|
|
3344
3344
|
if (child === slottable) {
|
|
3345
|
-
if (
|
|
3346
|
-
return
|
|
3345
|
+
if (React44.Children.count(newElement) > 1) return React44.Children.only(null);
|
|
3346
|
+
return React44.isValidElement(newElement) ? newElement.props.children : null;
|
|
3347
3347
|
} else {
|
|
3348
3348
|
return child;
|
|
3349
3349
|
}
|
|
3350
3350
|
});
|
|
3351
|
-
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 });
|
|
3352
3352
|
}
|
|
3353
3353
|
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
3354
3354
|
});
|
|
@@ -3357,24 +3357,24 @@ function createSlot2(ownerName) {
|
|
|
3357
3357
|
}
|
|
3358
3358
|
// @__NO_SIDE_EFFECTS__
|
|
3359
3359
|
function createSlotClone2(ownerName) {
|
|
3360
|
-
const SlotClone =
|
|
3360
|
+
const SlotClone = React44.forwardRef((props, forwardedRef) => {
|
|
3361
3361
|
const { children, ...slotProps } = props;
|
|
3362
|
-
if (
|
|
3362
|
+
if (React44.isValidElement(children)) {
|
|
3363
3363
|
const childrenRef = getElementRef2(children);
|
|
3364
3364
|
const props2 = mergeProps2(slotProps, children.props);
|
|
3365
|
-
if (children.type !==
|
|
3365
|
+
if (children.type !== React44.Fragment) {
|
|
3366
3366
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
3367
3367
|
}
|
|
3368
|
-
return
|
|
3368
|
+
return React44.cloneElement(children, props2);
|
|
3369
3369
|
}
|
|
3370
|
-
return
|
|
3370
|
+
return React44.Children.count(children) > 1 ? React44.Children.only(null) : null;
|
|
3371
3371
|
});
|
|
3372
3372
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
3373
3373
|
return SlotClone;
|
|
3374
3374
|
}
|
|
3375
3375
|
var SLOTTABLE_IDENTIFIER2 = Symbol("radix.slottable");
|
|
3376
3376
|
function isSlottable2(child) {
|
|
3377
|
-
return
|
|
3377
|
+
return React44.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER2;
|
|
3378
3378
|
}
|
|
3379
3379
|
function mergeProps2(slotProps, childProps) {
|
|
3380
3380
|
const overrideProps = { ...childProps };
|
|
@@ -3434,7 +3434,7 @@ var NODES = [
|
|
|
3434
3434
|
];
|
|
3435
3435
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
3436
3436
|
const Slot4 = createSlot2(`Primitive.${node}`);
|
|
3437
|
-
const Node2 =
|
|
3437
|
+
const Node2 = React44.forwardRef((props, forwardedRef) => {
|
|
3438
3438
|
const { asChild, ...primitiveProps } = props;
|
|
3439
3439
|
const Comp = asChild ? Slot4 : node;
|
|
3440
3440
|
if (typeof window !== "undefined") {
|
|
@@ -3449,7 +3449,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
3449
3449
|
if (target) ReactDOM4.flushSync(() => target.dispatchEvent(event));
|
|
3450
3450
|
}
|
|
3451
3451
|
var NAME = "Toggle";
|
|
3452
|
-
var Toggle =
|
|
3452
|
+
var Toggle = React44.forwardRef((props, forwardedRef) => {
|
|
3453
3453
|
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
3454
3454
|
const [pressed, setPressed] = useControllableState({
|
|
3455
3455
|
prop: pressedProp,
|
|
@@ -3503,7 +3503,7 @@ var toggleButtonVariants = cva(
|
|
|
3503
3503
|
}
|
|
3504
3504
|
);
|
|
3505
3505
|
function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
3506
|
-
return /* @__PURE__ */
|
|
3506
|
+
return /* @__PURE__ */ React44.createElement(
|
|
3507
3507
|
Root,
|
|
3508
3508
|
{
|
|
3509
3509
|
"data-slot": "toggle-button",
|
|
@@ -3512,22 +3512,39 @@ function ToggleButton({ className, variant, size: size4, ...props }) {
|
|
|
3512
3512
|
}
|
|
3513
3513
|
);
|
|
3514
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
|
+
}
|
|
3515
3532
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
3516
3533
|
let defaultContexts = [];
|
|
3517
3534
|
function createContext32(rootComponentName, defaultContext) {
|
|
3518
|
-
const BaseContext =
|
|
3535
|
+
const BaseContext = React44.createContext(defaultContext);
|
|
3519
3536
|
const index2 = defaultContexts.length;
|
|
3520
3537
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
3521
3538
|
const Provider = (props) => {
|
|
3522
3539
|
const { scope, children, ...context } = props;
|
|
3523
3540
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3524
|
-
const value =
|
|
3541
|
+
const value = React44.useMemo(() => context, Object.values(context));
|
|
3525
3542
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
3526
3543
|
};
|
|
3527
3544
|
Provider.displayName = rootComponentName + "Provider";
|
|
3528
3545
|
function useContext22(consumerName, scope) {
|
|
3529
3546
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3530
|
-
const context =
|
|
3547
|
+
const context = React44.useContext(Context);
|
|
3531
3548
|
if (context) return context;
|
|
3532
3549
|
if (defaultContext !== void 0) return defaultContext;
|
|
3533
3550
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -3536,11 +3553,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
3536
3553
|
}
|
|
3537
3554
|
const createScope = () => {
|
|
3538
3555
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
3539
|
-
return
|
|
3556
|
+
return React44.createContext(defaultContext);
|
|
3540
3557
|
});
|
|
3541
3558
|
return function useScope(scope) {
|
|
3542
3559
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
3543
|
-
return
|
|
3560
|
+
return React44.useMemo(
|
|
3544
3561
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
3545
3562
|
[scope, contexts]
|
|
3546
3563
|
);
|
|
@@ -3563,7 +3580,7 @@ function composeContextScopes(...scopes) {
|
|
|
3563
3580
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
3564
3581
|
return { ...nextScopes2, ...currentScope };
|
|
3565
3582
|
}, {});
|
|
3566
|
-
return
|
|
3583
|
+
return React44.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
3567
3584
|
};
|
|
3568
3585
|
};
|
|
3569
3586
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -3578,14 +3595,14 @@ function createCollection(name) {
|
|
|
3578
3595
|
);
|
|
3579
3596
|
const CollectionProvider = (props) => {
|
|
3580
3597
|
const { scope, children } = props;
|
|
3581
|
-
const ref =
|
|
3582
|
-
const itemMap =
|
|
3598
|
+
const ref = React44__default.useRef(null);
|
|
3599
|
+
const itemMap = React44__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
3583
3600
|
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
3584
3601
|
};
|
|
3585
3602
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
3586
3603
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
3587
3604
|
const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);
|
|
3588
|
-
const CollectionSlot =
|
|
3605
|
+
const CollectionSlot = React44__default.forwardRef(
|
|
3589
3606
|
(props, forwardedRef) => {
|
|
3590
3607
|
const { scope, children } = props;
|
|
3591
3608
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -3597,13 +3614,13 @@ function createCollection(name) {
|
|
|
3597
3614
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
3598
3615
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
3599
3616
|
const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);
|
|
3600
|
-
const CollectionItemSlot =
|
|
3617
|
+
const CollectionItemSlot = React44__default.forwardRef(
|
|
3601
3618
|
(props, forwardedRef) => {
|
|
3602
3619
|
const { scope, children, ...itemData } = props;
|
|
3603
|
-
const ref =
|
|
3620
|
+
const ref = React44__default.useRef(null);
|
|
3604
3621
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3605
3622
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
3606
|
-
|
|
3623
|
+
React44__default.useEffect(() => {
|
|
3607
3624
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
3608
3625
|
return () => void context.itemMap.delete(ref);
|
|
3609
3626
|
});
|
|
@@ -3613,7 +3630,7 @@ function createCollection(name) {
|
|
|
3613
3630
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
3614
3631
|
function useCollection4(scope) {
|
|
3615
3632
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
3616
|
-
const getItems =
|
|
3633
|
+
const getItems = React44__default.useCallback(() => {
|
|
3617
3634
|
const collectionNode = context.collectionRef.current;
|
|
3618
3635
|
if (!collectionNode) return [];
|
|
3619
3636
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -3631,21 +3648,21 @@ function createCollection(name) {
|
|
|
3631
3648
|
createCollectionScope4
|
|
3632
3649
|
];
|
|
3633
3650
|
}
|
|
3634
|
-
var DirectionContext =
|
|
3651
|
+
var DirectionContext = React44.createContext(void 0);
|
|
3635
3652
|
function useDirection(localDir) {
|
|
3636
|
-
const globalDir =
|
|
3653
|
+
const globalDir = React44.useContext(DirectionContext);
|
|
3637
3654
|
return localDir || globalDir || "ltr";
|
|
3638
3655
|
}
|
|
3639
3656
|
function useCallbackRef(callback) {
|
|
3640
|
-
const callbackRef =
|
|
3641
|
-
|
|
3657
|
+
const callbackRef = React44.useRef(callback);
|
|
3658
|
+
React44.useEffect(() => {
|
|
3642
3659
|
callbackRef.current = callback;
|
|
3643
3660
|
});
|
|
3644
|
-
return
|
|
3661
|
+
return React44.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
3645
3662
|
}
|
|
3646
3663
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
3647
3664
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
3648
|
-
|
|
3665
|
+
React44.useEffect(() => {
|
|
3649
3666
|
const handleKeyDown = (event) => {
|
|
3650
3667
|
if (event.key === "Escape") {
|
|
3651
3668
|
onEscapeKeyDown(event);
|
|
@@ -3660,12 +3677,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
3660
3677
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3661
3678
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3662
3679
|
var originalBodyPointerEvents;
|
|
3663
|
-
var DismissableLayerContext =
|
|
3680
|
+
var DismissableLayerContext = React44.createContext({
|
|
3664
3681
|
layers: /* @__PURE__ */ new Set(),
|
|
3665
3682
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3666
3683
|
branches: /* @__PURE__ */ new Set()
|
|
3667
3684
|
});
|
|
3668
|
-
var DismissableLayer =
|
|
3685
|
+
var DismissableLayer = React44.forwardRef(
|
|
3669
3686
|
(props, forwardedRef) => {
|
|
3670
3687
|
const {
|
|
3671
3688
|
disableOutsidePointerEvents = false,
|
|
@@ -3676,10 +3693,10 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3676
3693
|
onDismiss,
|
|
3677
3694
|
...layerProps
|
|
3678
3695
|
} = props;
|
|
3679
|
-
const context =
|
|
3680
|
-
const [node, setNode] =
|
|
3696
|
+
const context = React44.useContext(DismissableLayerContext);
|
|
3697
|
+
const [node, setNode] = React44.useState(null);
|
|
3681
3698
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3682
|
-
const [, force] =
|
|
3699
|
+
const [, force] = React44.useState({});
|
|
3683
3700
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3684
3701
|
const layers = Array.from(context.layers);
|
|
3685
3702
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -3712,7 +3729,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3712
3729
|
onDismiss();
|
|
3713
3730
|
}
|
|
3714
3731
|
}, ownerDocument);
|
|
3715
|
-
|
|
3732
|
+
React44.useEffect(() => {
|
|
3716
3733
|
if (!node) return;
|
|
3717
3734
|
if (disableOutsidePointerEvents) {
|
|
3718
3735
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -3729,7 +3746,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3729
3746
|
}
|
|
3730
3747
|
};
|
|
3731
3748
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3732
|
-
|
|
3749
|
+
React44.useEffect(() => {
|
|
3733
3750
|
return () => {
|
|
3734
3751
|
if (!node) return;
|
|
3735
3752
|
context.layers.delete(node);
|
|
@@ -3737,7 +3754,7 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3737
3754
|
dispatchUpdate();
|
|
3738
3755
|
};
|
|
3739
3756
|
}, [node, context]);
|
|
3740
|
-
|
|
3757
|
+
React44.useEffect(() => {
|
|
3741
3758
|
const handleUpdate = () => force({});
|
|
3742
3759
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3743
3760
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -3763,11 +3780,11 @@ var DismissableLayer = React43.forwardRef(
|
|
|
3763
3780
|
);
|
|
3764
3781
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3765
3782
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3766
|
-
var DismissableLayerBranch =
|
|
3767
|
-
const context =
|
|
3768
|
-
const ref =
|
|
3783
|
+
var DismissableLayerBranch = React44.forwardRef((props, forwardedRef) => {
|
|
3784
|
+
const context = React44.useContext(DismissableLayerContext);
|
|
3785
|
+
const ref = React44.useRef(null);
|
|
3769
3786
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3770
|
-
|
|
3787
|
+
React44.useEffect(() => {
|
|
3771
3788
|
const node = ref.current;
|
|
3772
3789
|
if (node) {
|
|
3773
3790
|
context.branches.add(node);
|
|
@@ -3781,10 +3798,10 @@ var DismissableLayerBranch = React43.forwardRef((props, forwardedRef) => {
|
|
|
3781
3798
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3782
3799
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
3783
3800
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3784
|
-
const isPointerInsideReactTreeRef =
|
|
3785
|
-
const handleClickRef =
|
|
3801
|
+
const isPointerInsideReactTreeRef = React44.useRef(false);
|
|
3802
|
+
const handleClickRef = React44.useRef(() => {
|
|
3786
3803
|
});
|
|
3787
|
-
|
|
3804
|
+
React44.useEffect(() => {
|
|
3788
3805
|
const handlePointerDown = (event) => {
|
|
3789
3806
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3790
3807
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -3824,8 +3841,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
3824
3841
|
}
|
|
3825
3842
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3826
3843
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3827
|
-
const isFocusInsideReactTreeRef =
|
|
3828
|
-
|
|
3844
|
+
const isFocusInsideReactTreeRef = React44.useRef(false);
|
|
3845
|
+
React44.useEffect(() => {
|
|
3829
3846
|
const handleFocus = (event) => {
|
|
3830
3847
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3831
3848
|
const eventDetail = { originalEvent: event };
|
|
@@ -3858,7 +3875,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
3858
3875
|
}
|
|
3859
3876
|
var count = 0;
|
|
3860
3877
|
function useFocusGuards() {
|
|
3861
|
-
|
|
3878
|
+
React44.useEffect(() => {
|
|
3862
3879
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3863
3880
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
3864
3881
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -3885,7 +3902,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
3885
3902
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3886
3903
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3887
3904
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
3888
|
-
var FocusScope =
|
|
3905
|
+
var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
3889
3906
|
const {
|
|
3890
3907
|
loop = false,
|
|
3891
3908
|
trapped = false,
|
|
@@ -3893,12 +3910,12 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3893
3910
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
3894
3911
|
...scopeProps
|
|
3895
3912
|
} = props;
|
|
3896
|
-
const [container, setContainer] =
|
|
3913
|
+
const [container, setContainer] = React44.useState(null);
|
|
3897
3914
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3898
3915
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3899
|
-
const lastFocusedElementRef =
|
|
3916
|
+
const lastFocusedElementRef = React44.useRef(null);
|
|
3900
3917
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
3901
|
-
const focusScope =
|
|
3918
|
+
const focusScope = React44.useRef({
|
|
3902
3919
|
paused: false,
|
|
3903
3920
|
pause() {
|
|
3904
3921
|
this.paused = true;
|
|
@@ -3907,7 +3924,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3907
3924
|
this.paused = false;
|
|
3908
3925
|
}
|
|
3909
3926
|
}).current;
|
|
3910
|
-
|
|
3927
|
+
React44.useEffect(() => {
|
|
3911
3928
|
if (trapped) {
|
|
3912
3929
|
let handleFocusIn2 = function(event) {
|
|
3913
3930
|
if (focusScope.paused || !container) return;
|
|
@@ -3942,7 +3959,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3942
3959
|
};
|
|
3943
3960
|
}
|
|
3944
3961
|
}, [trapped, container, focusScope.paused]);
|
|
3945
|
-
|
|
3962
|
+
React44.useEffect(() => {
|
|
3946
3963
|
if (container) {
|
|
3947
3964
|
focusScopesStack.add(focusScope);
|
|
3948
3965
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3973,7 +3990,7 @@ var FocusScope = React43.forwardRef((props, forwardedRef) => {
|
|
|
3973
3990
|
};
|
|
3974
3991
|
}
|
|
3975
3992
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3976
|
-
const handleKeyDown =
|
|
3993
|
+
const handleKeyDown = React44.useCallback(
|
|
3977
3994
|
(event) => {
|
|
3978
3995
|
if (!loop && !trapped) return;
|
|
3979
3996
|
if (focusScope.paused) return;
|
|
@@ -4080,10 +4097,10 @@ function arrayRemove(array, item) {
|
|
|
4080
4097
|
function removeLinks(items) {
|
|
4081
4098
|
return items.filter((item) => item.tagName !== "A");
|
|
4082
4099
|
}
|
|
4083
|
-
var useReactId =
|
|
4100
|
+
var useReactId = React44[" useId ".trim().toString()] || (() => void 0);
|
|
4084
4101
|
var count2 = 0;
|
|
4085
4102
|
function useId(deterministicId) {
|
|
4086
|
-
const [id, setId] =
|
|
4103
|
+
const [id, setId] = React44.useState(useReactId());
|
|
4087
4104
|
useLayoutEffect2(() => {
|
|
4088
4105
|
setId((reactId) => reactId ?? String(count2++));
|
|
4089
4106
|
}, [deterministicId]);
|
|
@@ -5758,7 +5775,7 @@ function roundByDPR(element, value) {
|
|
|
5758
5775
|
return Math.round(value * dpr) / dpr;
|
|
5759
5776
|
}
|
|
5760
5777
|
function useLatestRef(value) {
|
|
5761
|
-
const ref =
|
|
5778
|
+
const ref = React44.useRef(value);
|
|
5762
5779
|
index(() => {
|
|
5763
5780
|
ref.current = value;
|
|
5764
5781
|
});
|
|
@@ -5781,7 +5798,7 @@ function useFloating(options) {
|
|
|
5781
5798
|
whileElementsMounted,
|
|
5782
5799
|
open
|
|
5783
5800
|
} = options;
|
|
5784
|
-
const [data, setData] =
|
|
5801
|
+
const [data, setData] = React44.useState({
|
|
5785
5802
|
x: 0,
|
|
5786
5803
|
y: 0,
|
|
5787
5804
|
strategy,
|
|
@@ -5789,19 +5806,19 @@ function useFloating(options) {
|
|
|
5789
5806
|
middlewareData: {},
|
|
5790
5807
|
isPositioned: false
|
|
5791
5808
|
});
|
|
5792
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
5809
|
+
const [latestMiddleware, setLatestMiddleware] = React44.useState(middleware);
|
|
5793
5810
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
5794
5811
|
setLatestMiddleware(middleware);
|
|
5795
5812
|
}
|
|
5796
|
-
const [_reference, _setReference] =
|
|
5797
|
-
const [_floating, _setFloating] =
|
|
5798
|
-
const setReference =
|
|
5813
|
+
const [_reference, _setReference] = React44.useState(null);
|
|
5814
|
+
const [_floating, _setFloating] = React44.useState(null);
|
|
5815
|
+
const setReference = React44.useCallback((node) => {
|
|
5799
5816
|
if (node !== referenceRef.current) {
|
|
5800
5817
|
referenceRef.current = node;
|
|
5801
5818
|
_setReference(node);
|
|
5802
5819
|
}
|
|
5803
5820
|
}, []);
|
|
5804
|
-
const setFloating =
|
|
5821
|
+
const setFloating = React44.useCallback((node) => {
|
|
5805
5822
|
if (node !== floatingRef.current) {
|
|
5806
5823
|
floatingRef.current = node;
|
|
5807
5824
|
_setFloating(node);
|
|
@@ -5809,14 +5826,14 @@ function useFloating(options) {
|
|
|
5809
5826
|
}, []);
|
|
5810
5827
|
const referenceEl = externalReference || _reference;
|
|
5811
5828
|
const floatingEl = externalFloating || _floating;
|
|
5812
|
-
const referenceRef =
|
|
5813
|
-
const floatingRef =
|
|
5814
|
-
const dataRef =
|
|
5829
|
+
const referenceRef = React44.useRef(null);
|
|
5830
|
+
const floatingRef = React44.useRef(null);
|
|
5831
|
+
const dataRef = React44.useRef(data);
|
|
5815
5832
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
5816
5833
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
5817
5834
|
const platformRef = useLatestRef(platform2);
|
|
5818
5835
|
const openRef = useLatestRef(open);
|
|
5819
|
-
const update =
|
|
5836
|
+
const update = React44.useCallback(() => {
|
|
5820
5837
|
if (!referenceRef.current || !floatingRef.current) {
|
|
5821
5838
|
return;
|
|
5822
5839
|
}
|
|
@@ -5854,7 +5871,7 @@ function useFloating(options) {
|
|
|
5854
5871
|
}));
|
|
5855
5872
|
}
|
|
5856
5873
|
}, [open]);
|
|
5857
|
-
const isMountedRef =
|
|
5874
|
+
const isMountedRef = React44.useRef(false);
|
|
5858
5875
|
index(() => {
|
|
5859
5876
|
isMountedRef.current = true;
|
|
5860
5877
|
return () => {
|
|
@@ -5871,17 +5888,17 @@ function useFloating(options) {
|
|
|
5871
5888
|
update();
|
|
5872
5889
|
}
|
|
5873
5890
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
5874
|
-
const refs =
|
|
5891
|
+
const refs = React44.useMemo(() => ({
|
|
5875
5892
|
reference: referenceRef,
|
|
5876
5893
|
floating: floatingRef,
|
|
5877
5894
|
setReference,
|
|
5878
5895
|
setFloating
|
|
5879
5896
|
}), [setReference, setFloating]);
|
|
5880
|
-
const elements =
|
|
5897
|
+
const elements = React44.useMemo(() => ({
|
|
5881
5898
|
reference: referenceEl,
|
|
5882
5899
|
floating: floatingEl
|
|
5883
5900
|
}), [referenceEl, floatingEl]);
|
|
5884
|
-
const floatingStyles =
|
|
5901
|
+
const floatingStyles = React44.useMemo(() => {
|
|
5885
5902
|
const initialStyles = {
|
|
5886
5903
|
position: strategy,
|
|
5887
5904
|
left: 0,
|
|
@@ -5907,7 +5924,7 @@ function useFloating(options) {
|
|
|
5907
5924
|
top: y
|
|
5908
5925
|
};
|
|
5909
5926
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
5910
|
-
return
|
|
5927
|
+
return React44.useMemo(() => ({
|
|
5911
5928
|
...data,
|
|
5912
5929
|
update,
|
|
5913
5930
|
refs,
|
|
@@ -5975,7 +5992,7 @@ var arrow3 = (options, deps) => ({
|
|
|
5975
5992
|
options: [options, deps]
|
|
5976
5993
|
});
|
|
5977
5994
|
var NAME2 = "Arrow";
|
|
5978
|
-
var Arrow =
|
|
5995
|
+
var Arrow = React44.forwardRef((props, forwardedRef) => {
|
|
5979
5996
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5980
5997
|
return /* @__PURE__ */ jsx(
|
|
5981
5998
|
Primitive.svg,
|
|
@@ -5993,7 +6010,7 @@ var Arrow = React43.forwardRef((props, forwardedRef) => {
|
|
|
5993
6010
|
Arrow.displayName = NAME2;
|
|
5994
6011
|
var Root2 = Arrow;
|
|
5995
6012
|
function useSize(element) {
|
|
5996
|
-
const [size4, setSize] =
|
|
6013
|
+
const [size4, setSize] = React44.useState(void 0);
|
|
5997
6014
|
useLayoutEffect2(() => {
|
|
5998
6015
|
if (element) {
|
|
5999
6016
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -6031,19 +6048,19 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
6031
6048
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
6032
6049
|
var Popper = (props) => {
|
|
6033
6050
|
const { __scopePopper, children } = props;
|
|
6034
|
-
const [anchor, setAnchor] =
|
|
6051
|
+
const [anchor, setAnchor] = React44.useState(null);
|
|
6035
6052
|
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
6036
6053
|
};
|
|
6037
6054
|
Popper.displayName = POPPER_NAME;
|
|
6038
6055
|
var ANCHOR_NAME = "PopperAnchor";
|
|
6039
|
-
var PopperAnchor =
|
|
6056
|
+
var PopperAnchor = React44.forwardRef(
|
|
6040
6057
|
(props, forwardedRef) => {
|
|
6041
6058
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
6042
6059
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
6043
|
-
const ref =
|
|
6060
|
+
const ref = React44.useRef(null);
|
|
6044
6061
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6045
|
-
const anchorRef =
|
|
6046
|
-
|
|
6062
|
+
const anchorRef = React44.useRef(null);
|
|
6063
|
+
React44.useEffect(() => {
|
|
6047
6064
|
const previousAnchor = anchorRef.current;
|
|
6048
6065
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
6049
6066
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -6056,7 +6073,7 @@ var PopperAnchor = React43.forwardRef(
|
|
|
6056
6073
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
6057
6074
|
var CONTENT_NAME = "PopperContent";
|
|
6058
6075
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
6059
|
-
var PopperContent =
|
|
6076
|
+
var PopperContent = React44.forwardRef(
|
|
6060
6077
|
(props, forwardedRef) => {
|
|
6061
6078
|
const {
|
|
6062
6079
|
__scopePopper,
|
|
@@ -6075,9 +6092,9 @@ var PopperContent = React43.forwardRef(
|
|
|
6075
6092
|
...contentProps
|
|
6076
6093
|
} = props;
|
|
6077
6094
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
6078
|
-
const [content, setContent] =
|
|
6095
|
+
const [content, setContent] = React44.useState(null);
|
|
6079
6096
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
6080
|
-
const [arrow4, setArrow] =
|
|
6097
|
+
const [arrow4, setArrow] = React44.useState(null);
|
|
6081
6098
|
const arrowSize = useSize(arrow4);
|
|
6082
6099
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
6083
6100
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -6139,7 +6156,7 @@ var PopperContent = React43.forwardRef(
|
|
|
6139
6156
|
const arrowX = middlewareData.arrow?.x;
|
|
6140
6157
|
const arrowY = middlewareData.arrow?.y;
|
|
6141
6158
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
6142
|
-
const [contentZIndex, setContentZIndex] =
|
|
6159
|
+
const [contentZIndex, setContentZIndex] = React44.useState();
|
|
6143
6160
|
useLayoutEffect2(() => {
|
|
6144
6161
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
6145
6162
|
}, [content]);
|
|
@@ -6205,7 +6222,7 @@ var OPPOSITE_SIDE = {
|
|
|
6205
6222
|
bottom: "top",
|
|
6206
6223
|
left: "right"
|
|
6207
6224
|
};
|
|
6208
|
-
var PopperArrow =
|
|
6225
|
+
var PopperArrow = React44.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
6209
6226
|
const { __scopePopper, ...arrowProps } = props;
|
|
6210
6227
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
6211
6228
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -6296,16 +6313,16 @@ var Anchor = PopperAnchor;
|
|
|
6296
6313
|
var Content = PopperContent;
|
|
6297
6314
|
var Arrow2 = PopperArrow;
|
|
6298
6315
|
var PORTAL_NAME = "Portal";
|
|
6299
|
-
var Portal =
|
|
6316
|
+
var Portal = React44.forwardRef((props, forwardedRef) => {
|
|
6300
6317
|
const { container: containerProp, ...portalProps } = props;
|
|
6301
|
-
const [mounted, setMounted] =
|
|
6318
|
+
const [mounted, setMounted] = React44.useState(false);
|
|
6302
6319
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6303
6320
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6304
6321
|
return container ? ReactDOM4__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
6305
6322
|
});
|
|
6306
6323
|
Portal.displayName = PORTAL_NAME;
|
|
6307
6324
|
function useStateMachine(initialState, machine) {
|
|
6308
|
-
return
|
|
6325
|
+
return React44.useReducer((state, event) => {
|
|
6309
6326
|
const nextState = machine[state][event];
|
|
6310
6327
|
return nextState ?? state;
|
|
6311
6328
|
}, initialState);
|
|
@@ -6313,17 +6330,17 @@ function useStateMachine(initialState, machine) {
|
|
|
6313
6330
|
var Presence = (props) => {
|
|
6314
6331
|
const { present, children } = props;
|
|
6315
6332
|
const presence = usePresence(present);
|
|
6316
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
6333
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React44.Children.only(children);
|
|
6317
6334
|
const ref = useComposedRefs(presence.ref, getElementRef3(child));
|
|
6318
6335
|
const forceMount = typeof children === "function";
|
|
6319
|
-
return forceMount || presence.isPresent ?
|
|
6336
|
+
return forceMount || presence.isPresent ? React44.cloneElement(child, { ref }) : null;
|
|
6320
6337
|
};
|
|
6321
6338
|
Presence.displayName = "Presence";
|
|
6322
6339
|
function usePresence(present) {
|
|
6323
|
-
const [node, setNode] =
|
|
6324
|
-
const stylesRef =
|
|
6325
|
-
const prevPresentRef =
|
|
6326
|
-
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");
|
|
6327
6344
|
const initialState = present ? "mounted" : "unmounted";
|
|
6328
6345
|
const [state, send] = useStateMachine(initialState, {
|
|
6329
6346
|
mounted: {
|
|
@@ -6338,7 +6355,7 @@ function usePresence(present) {
|
|
|
6338
6355
|
MOUNT: "mounted"
|
|
6339
6356
|
}
|
|
6340
6357
|
});
|
|
6341
|
-
|
|
6358
|
+
React44.useEffect(() => {
|
|
6342
6359
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
6343
6360
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
6344
6361
|
}, [state]);
|
|
@@ -6404,7 +6421,7 @@ function usePresence(present) {
|
|
|
6404
6421
|
}, [node, send]);
|
|
6405
6422
|
return {
|
|
6406
6423
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
6407
|
-
ref:
|
|
6424
|
+
ref: React44.useCallback((node2) => {
|
|
6408
6425
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
6409
6426
|
setNode(node2);
|
|
6410
6427
|
}, [])
|
|
@@ -6435,13 +6452,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6435
6452
|
[createCollectionScope]
|
|
6436
6453
|
);
|
|
6437
6454
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
6438
|
-
var RovingFocusGroup =
|
|
6455
|
+
var RovingFocusGroup = React44.forwardRef(
|
|
6439
6456
|
(props, forwardedRef) => {
|
|
6440
6457
|
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6441
6458
|
}
|
|
6442
6459
|
);
|
|
6443
6460
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
6444
|
-
var RovingFocusGroupImpl =
|
|
6461
|
+
var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
6445
6462
|
const {
|
|
6446
6463
|
__scopeRovingFocusGroup,
|
|
6447
6464
|
orientation,
|
|
@@ -6454,7 +6471,7 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6454
6471
|
preventScrollOnEntryFocus = false,
|
|
6455
6472
|
...groupProps
|
|
6456
6473
|
} = props;
|
|
6457
|
-
const ref =
|
|
6474
|
+
const ref = React44.useRef(null);
|
|
6458
6475
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6459
6476
|
const direction = useDirection(dir);
|
|
6460
6477
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -6463,12 +6480,12 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6463
6480
|
onChange: onCurrentTabStopIdChange,
|
|
6464
6481
|
caller: GROUP_NAME
|
|
6465
6482
|
});
|
|
6466
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
6483
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React44.useState(false);
|
|
6467
6484
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
6468
6485
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6469
|
-
const isClickFocusRef =
|
|
6470
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
6471
|
-
|
|
6486
|
+
const isClickFocusRef = React44.useRef(false);
|
|
6487
|
+
const [focusableItemsCount, setFocusableItemsCount] = React44.useState(0);
|
|
6488
|
+
React44.useEffect(() => {
|
|
6472
6489
|
const node = ref.current;
|
|
6473
6490
|
if (node) {
|
|
6474
6491
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -6483,16 +6500,16 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6483
6500
|
dir: direction,
|
|
6484
6501
|
loop,
|
|
6485
6502
|
currentTabStopId,
|
|
6486
|
-
onItemFocus:
|
|
6503
|
+
onItemFocus: React44.useCallback(
|
|
6487
6504
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
6488
6505
|
[setCurrentTabStopId]
|
|
6489
6506
|
),
|
|
6490
|
-
onItemShiftTab:
|
|
6491
|
-
onFocusableItemAdd:
|
|
6507
|
+
onItemShiftTab: React44.useCallback(() => setIsTabbingBackOut(true), []),
|
|
6508
|
+
onFocusableItemAdd: React44.useCallback(
|
|
6492
6509
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
6493
6510
|
[]
|
|
6494
6511
|
),
|
|
6495
|
-
onFocusableItemRemove:
|
|
6512
|
+
onFocusableItemRemove: React44.useCallback(
|
|
6496
6513
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6497
6514
|
[]
|
|
6498
6515
|
),
|
|
@@ -6532,7 +6549,7 @@ var RovingFocusGroupImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
6532
6549
|
);
|
|
6533
6550
|
});
|
|
6534
6551
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
6535
|
-
var RovingFocusGroupItem =
|
|
6552
|
+
var RovingFocusGroupItem = React44.forwardRef(
|
|
6536
6553
|
(props, forwardedRef) => {
|
|
6537
6554
|
const {
|
|
6538
6555
|
__scopeRovingFocusGroup,
|
|
@@ -6548,7 +6565,7 @@ var RovingFocusGroupItem = React43.forwardRef(
|
|
|
6548
6565
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
6549
6566
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6550
6567
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
6551
|
-
|
|
6568
|
+
React44.useEffect(() => {
|
|
6552
6569
|
if (focusable) {
|
|
6553
6570
|
onFocusableItemAdd();
|
|
6554
6571
|
return () => onFocusableItemRemove();
|
|
@@ -6829,7 +6846,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6829
6846
|
ref.callback = callback;
|
|
6830
6847
|
return ref.facade;
|
|
6831
6848
|
}
|
|
6832
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6849
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React44.useLayoutEffect : React44.useEffect;
|
|
6833
6850
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6834
6851
|
function useMergeRefs(refs, defaultValue) {
|
|
6835
6852
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -6953,7 +6970,7 @@ var SideCar = function(_a) {
|
|
|
6953
6970
|
if (!Target) {
|
|
6954
6971
|
throw new Error("Sidecar medium not found");
|
|
6955
6972
|
}
|
|
6956
|
-
return
|
|
6973
|
+
return React44.createElement(Target, __assign({}, rest));
|
|
6957
6974
|
};
|
|
6958
6975
|
SideCar.isSideCarExport = true;
|
|
6959
6976
|
function exportSidecar(medium, exported) {
|
|
@@ -6968,9 +6985,9 @@ var effectCar = createSidecarMedium();
|
|
|
6968
6985
|
var nothing = function() {
|
|
6969
6986
|
return;
|
|
6970
6987
|
};
|
|
6971
|
-
var RemoveScroll =
|
|
6972
|
-
var ref =
|
|
6973
|
-
var _a =
|
|
6988
|
+
var RemoveScroll = React44.forwardRef(function(props, parentRef) {
|
|
6989
|
+
var ref = React44.useRef(null);
|
|
6990
|
+
var _a = React44.useState({
|
|
6974
6991
|
onScrollCapture: nothing,
|
|
6975
6992
|
onWheelCapture: nothing,
|
|
6976
6993
|
onTouchMoveCapture: nothing
|
|
@@ -6979,11 +6996,11 @@ var RemoveScroll = React43.forwardRef(function(props, parentRef) {
|
|
|
6979
6996
|
var SideCar2 = sideCar;
|
|
6980
6997
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6981
6998
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6982
|
-
return
|
|
6983
|
-
|
|
6999
|
+
return React44.createElement(
|
|
7000
|
+
React44.Fragment,
|
|
6984
7001
|
null,
|
|
6985
|
-
enabled &&
|
|
6986
|
-
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)
|
|
6987
7004
|
);
|
|
6988
7005
|
});
|
|
6989
7006
|
RemoveScroll.defaultProps = {
|
|
@@ -7052,7 +7069,7 @@ var stylesheetSingleton = function() {
|
|
|
7052
7069
|
var styleHookSingleton = function() {
|
|
7053
7070
|
var sheet = stylesheetSingleton();
|
|
7054
7071
|
return function(styles, isDynamic) {
|
|
7055
|
-
|
|
7072
|
+
React44.useEffect(function() {
|
|
7056
7073
|
sheet.add(styles);
|
|
7057
7074
|
return function() {
|
|
7058
7075
|
sheet.remove();
|
|
@@ -7126,7 +7143,7 @@ var getCurrentUseCounter = function() {
|
|
|
7126
7143
|
return isFinite(counter) ? counter : 0;
|
|
7127
7144
|
};
|
|
7128
7145
|
var useLockAttribute = function() {
|
|
7129
|
-
|
|
7146
|
+
React44.useEffect(function() {
|
|
7130
7147
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7131
7148
|
return function() {
|
|
7132
7149
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7141,10 +7158,10 @@ var useLockAttribute = function() {
|
|
|
7141
7158
|
var RemoveScrollBar = function(_a) {
|
|
7142
7159
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7143
7160
|
useLockAttribute();
|
|
7144
|
-
var gap =
|
|
7161
|
+
var gap = React44.useMemo(function() {
|
|
7145
7162
|
return getGapWidth(gapMode);
|
|
7146
7163
|
}, [gapMode]);
|
|
7147
|
-
return
|
|
7164
|
+
return React44.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7148
7165
|
};
|
|
7149
7166
|
|
|
7150
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
|
|
@@ -7285,16 +7302,16 @@ var generateStyle = function(id) {
|
|
|
7285
7302
|
var idCounter = 0;
|
|
7286
7303
|
var lockStack = [];
|
|
7287
7304
|
function RemoveScrollSideCar(props) {
|
|
7288
|
-
var shouldPreventQueue =
|
|
7289
|
-
var touchStartRef =
|
|
7290
|
-
var activeAxis =
|
|
7291
|
-
var id =
|
|
7292
|
-
var Style2 =
|
|
7293
|
-
var lastProps =
|
|
7294
|
-
|
|
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() {
|
|
7295
7312
|
lastProps.current = props;
|
|
7296
7313
|
}, [props]);
|
|
7297
|
-
|
|
7314
|
+
React44.useEffect(function() {
|
|
7298
7315
|
if (props.inert) {
|
|
7299
7316
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7300
7317
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -7310,7 +7327,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7310
7327
|
}
|
|
7311
7328
|
return;
|
|
7312
7329
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7313
|
-
var shouldCancelEvent =
|
|
7330
|
+
var shouldCancelEvent = React44.useCallback(function(event, parent) {
|
|
7314
7331
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7315
7332
|
return !lastProps.current.allowPinchZoom;
|
|
7316
7333
|
}
|
|
@@ -7346,7 +7363,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7346
7363
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7347
7364
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
7348
7365
|
}, []);
|
|
7349
|
-
var shouldPrevent =
|
|
7366
|
+
var shouldPrevent = React44.useCallback(function(_event) {
|
|
7350
7367
|
var event = _event;
|
|
7351
7368
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7352
7369
|
return;
|
|
@@ -7373,7 +7390,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7373
7390
|
}
|
|
7374
7391
|
}
|
|
7375
7392
|
}, []);
|
|
7376
|
-
var shouldCancel =
|
|
7393
|
+
var shouldCancel = React44.useCallback(function(name, delta, target, should) {
|
|
7377
7394
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7378
7395
|
shouldPreventQueue.current.push(event);
|
|
7379
7396
|
setTimeout(function() {
|
|
@@ -7382,17 +7399,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7382
7399
|
});
|
|
7383
7400
|
}, 1);
|
|
7384
7401
|
}, []);
|
|
7385
|
-
var scrollTouchStart =
|
|
7402
|
+
var scrollTouchStart = React44.useCallback(function(event) {
|
|
7386
7403
|
touchStartRef.current = getTouchXY(event);
|
|
7387
7404
|
activeAxis.current = void 0;
|
|
7388
7405
|
}, []);
|
|
7389
|
-
var scrollWheel =
|
|
7406
|
+
var scrollWheel = React44.useCallback(function(event) {
|
|
7390
7407
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7391
7408
|
}, []);
|
|
7392
|
-
var scrollTouchMove =
|
|
7409
|
+
var scrollTouchMove = React44.useCallback(function(event) {
|
|
7393
7410
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7394
7411
|
}, []);
|
|
7395
|
-
|
|
7412
|
+
React44.useEffect(function() {
|
|
7396
7413
|
lockStack.push(Style2);
|
|
7397
7414
|
props.setCallbacks({
|
|
7398
7415
|
onScrollCapture: scrollWheel,
|
|
@@ -7412,11 +7429,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7412
7429
|
};
|
|
7413
7430
|
}, []);
|
|
7414
7431
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7415
|
-
return
|
|
7416
|
-
|
|
7432
|
+
return React44.createElement(
|
|
7433
|
+
React44.Fragment,
|
|
7417
7434
|
null,
|
|
7418
|
-
inert ?
|
|
7419
|
-
removeScrollBar ?
|
|
7435
|
+
inert ? React44.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7436
|
+
removeScrollBar ? React44.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7420
7437
|
);
|
|
7421
7438
|
}
|
|
7422
7439
|
function getOutermostShadowParent(node) {
|
|
@@ -7435,8 +7452,8 @@ function getOutermostShadowParent(node) {
|
|
|
7435
7452
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7436
7453
|
|
|
7437
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
|
|
7438
|
-
var ReactRemoveScroll =
|
|
7439
|
-
return
|
|
7455
|
+
var ReactRemoveScroll = React44.forwardRef(function(props, ref) {
|
|
7456
|
+
return React44.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7440
7457
|
});
|
|
7441
7458
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7442
7459
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7466,11 +7483,11 @@ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
|
7466
7483
|
var Menu = (props) => {
|
|
7467
7484
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
7468
7485
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7469
|
-
const [content, setContent] =
|
|
7470
|
-
const isUsingKeyboardRef =
|
|
7486
|
+
const [content, setContent] = React44.useState(null);
|
|
7487
|
+
const isUsingKeyboardRef = React44.useRef(false);
|
|
7471
7488
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
7472
7489
|
const direction = useDirection(dir);
|
|
7473
|
-
|
|
7490
|
+
React44.useEffect(() => {
|
|
7474
7491
|
const handleKeyDown = () => {
|
|
7475
7492
|
isUsingKeyboardRef.current = true;
|
|
7476
7493
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
@@ -7496,7 +7513,7 @@ var Menu = (props) => {
|
|
|
7496
7513
|
MenuRootProvider,
|
|
7497
7514
|
{
|
|
7498
7515
|
scope: __scopeMenu,
|
|
7499
|
-
onClose:
|
|
7516
|
+
onClose: React44.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
7500
7517
|
isUsingKeyboardRef,
|
|
7501
7518
|
dir: direction,
|
|
7502
7519
|
modal,
|
|
@@ -7508,7 +7525,7 @@ var Menu = (props) => {
|
|
|
7508
7525
|
};
|
|
7509
7526
|
Menu.displayName = MENU_NAME;
|
|
7510
7527
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
7511
|
-
var MenuAnchor =
|
|
7528
|
+
var MenuAnchor = React44.forwardRef(
|
|
7512
7529
|
(props, forwardedRef) => {
|
|
7513
7530
|
const { __scopeMenu, ...anchorProps } = props;
|
|
7514
7531
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -7528,7 +7545,7 @@ var MenuPortal = (props) => {
|
|
|
7528
7545
|
MenuPortal.displayName = PORTAL_NAME2;
|
|
7529
7546
|
var CONTENT_NAME2 = "MenuContent";
|
|
7530
7547
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
7531
|
-
var MenuContent =
|
|
7548
|
+
var MenuContent = React44.forwardRef(
|
|
7532
7549
|
(props, forwardedRef) => {
|
|
7533
7550
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7534
7551
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7537,12 +7554,12 @@ var MenuContent = React43.forwardRef(
|
|
|
7537
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 }) }) }) });
|
|
7538
7555
|
}
|
|
7539
7556
|
);
|
|
7540
|
-
var MenuRootContentModal =
|
|
7557
|
+
var MenuRootContentModal = React44.forwardRef(
|
|
7541
7558
|
(props, forwardedRef) => {
|
|
7542
7559
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7543
|
-
const ref =
|
|
7560
|
+
const ref = React44.useRef(null);
|
|
7544
7561
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7545
|
-
|
|
7562
|
+
React44.useEffect(() => {
|
|
7546
7563
|
const content = ref.current;
|
|
7547
7564
|
if (content) return hideOthers(content);
|
|
7548
7565
|
}, []);
|
|
@@ -7564,7 +7581,7 @@ var MenuRootContentModal = React43.forwardRef(
|
|
|
7564
7581
|
);
|
|
7565
7582
|
}
|
|
7566
7583
|
);
|
|
7567
|
-
var MenuRootContentNonModal =
|
|
7584
|
+
var MenuRootContentNonModal = React44.forwardRef((props, forwardedRef) => {
|
|
7568
7585
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7569
7586
|
return /* @__PURE__ */ jsx(
|
|
7570
7587
|
MenuContentImpl,
|
|
@@ -7579,7 +7596,7 @@ var MenuRootContentNonModal = React43.forwardRef((props, forwardedRef) => {
|
|
|
7579
7596
|
);
|
|
7580
7597
|
});
|
|
7581
7598
|
var Slot2 = createSlot2("MenuContent.ScrollLock");
|
|
7582
|
-
var MenuContentImpl =
|
|
7599
|
+
var MenuContentImpl = React44.forwardRef(
|
|
7583
7600
|
(props, forwardedRef) => {
|
|
7584
7601
|
const {
|
|
7585
7602
|
__scopeMenu,
|
|
@@ -7602,16 +7619,16 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7602
7619
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7603
7620
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7604
7621
|
const getItems = useCollection2(__scopeMenu);
|
|
7605
|
-
const [currentItemId, setCurrentItemId] =
|
|
7606
|
-
const contentRef =
|
|
7622
|
+
const [currentItemId, setCurrentItemId] = React44.useState(null);
|
|
7623
|
+
const contentRef = React44.useRef(null);
|
|
7607
7624
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
7608
|
-
const timerRef =
|
|
7609
|
-
const searchRef =
|
|
7610
|
-
const pointerGraceTimerRef =
|
|
7611
|
-
const pointerGraceIntentRef =
|
|
7612
|
-
const pointerDirRef =
|
|
7613
|
-
const lastPointerXRef =
|
|
7614
|
-
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;
|
|
7615
7632
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
7616
7633
|
const handleTypeaheadSearch = (key) => {
|
|
7617
7634
|
const search = searchRef.current + key;
|
|
@@ -7630,11 +7647,11 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7630
7647
|
setTimeout(() => newItem.focus());
|
|
7631
7648
|
}
|
|
7632
7649
|
};
|
|
7633
|
-
|
|
7650
|
+
React44.useEffect(() => {
|
|
7634
7651
|
return () => window.clearTimeout(timerRef.current);
|
|
7635
7652
|
}, []);
|
|
7636
7653
|
useFocusGuards();
|
|
7637
|
-
const isPointerMovingToSubmenu =
|
|
7654
|
+
const isPointerMovingToSubmenu = React44.useCallback((event) => {
|
|
7638
7655
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
7639
7656
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
7640
7657
|
}, []);
|
|
@@ -7643,13 +7660,13 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7643
7660
|
{
|
|
7644
7661
|
scope: __scopeMenu,
|
|
7645
7662
|
searchRef,
|
|
7646
|
-
onItemEnter:
|
|
7663
|
+
onItemEnter: React44.useCallback(
|
|
7647
7664
|
(event) => {
|
|
7648
7665
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7649
7666
|
},
|
|
7650
7667
|
[isPointerMovingToSubmenu]
|
|
7651
7668
|
),
|
|
7652
|
-
onItemLeave:
|
|
7669
|
+
onItemLeave: React44.useCallback(
|
|
7653
7670
|
(event) => {
|
|
7654
7671
|
if (isPointerMovingToSubmenu(event)) return;
|
|
7655
7672
|
contentRef.current?.focus();
|
|
@@ -7657,14 +7674,14 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7657
7674
|
},
|
|
7658
7675
|
[isPointerMovingToSubmenu]
|
|
7659
7676
|
),
|
|
7660
|
-
onTriggerLeave:
|
|
7677
|
+
onTriggerLeave: React44.useCallback(
|
|
7661
7678
|
(event) => {
|
|
7662
7679
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7663
7680
|
},
|
|
7664
7681
|
[isPointerMovingToSubmenu]
|
|
7665
7682
|
),
|
|
7666
7683
|
pointerGraceTimerRef,
|
|
7667
|
-
onPointerGraceIntentChange:
|
|
7684
|
+
onPointerGraceIntentChange: React44.useCallback((intent) => {
|
|
7668
7685
|
pointerGraceIntentRef.current = intent;
|
|
7669
7686
|
}, []),
|
|
7670
7687
|
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
@@ -7763,7 +7780,7 @@ var MenuContentImpl = React43.forwardRef(
|
|
|
7763
7780
|
);
|
|
7764
7781
|
MenuContent.displayName = CONTENT_NAME2;
|
|
7765
7782
|
var GROUP_NAME2 = "MenuGroup";
|
|
7766
|
-
var MenuGroup =
|
|
7783
|
+
var MenuGroup = React44.forwardRef(
|
|
7767
7784
|
(props, forwardedRef) => {
|
|
7768
7785
|
const { __scopeMenu, ...groupProps } = props;
|
|
7769
7786
|
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -7771,7 +7788,7 @@ var MenuGroup = React43.forwardRef(
|
|
|
7771
7788
|
);
|
|
7772
7789
|
MenuGroup.displayName = GROUP_NAME2;
|
|
7773
7790
|
var LABEL_NAME = "MenuLabel";
|
|
7774
|
-
var MenuLabel =
|
|
7791
|
+
var MenuLabel = React44.forwardRef(
|
|
7775
7792
|
(props, forwardedRef) => {
|
|
7776
7793
|
const { __scopeMenu, ...labelProps } = props;
|
|
7777
7794
|
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -7780,14 +7797,14 @@ var MenuLabel = React43.forwardRef(
|
|
|
7780
7797
|
MenuLabel.displayName = LABEL_NAME;
|
|
7781
7798
|
var ITEM_NAME2 = "MenuItem";
|
|
7782
7799
|
var ITEM_SELECT = "menu.itemSelect";
|
|
7783
|
-
var MenuItem =
|
|
7800
|
+
var MenuItem = React44.forwardRef(
|
|
7784
7801
|
(props, forwardedRef) => {
|
|
7785
7802
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
7786
|
-
const ref =
|
|
7803
|
+
const ref = React44.useRef(null);
|
|
7787
7804
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
7788
7805
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
7789
7806
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7790
|
-
const isPointerDownRef =
|
|
7807
|
+
const isPointerDownRef = React44.useRef(false);
|
|
7791
7808
|
const handleSelect = () => {
|
|
7792
7809
|
const menuItem = ref.current;
|
|
7793
7810
|
if (!disabled && menuItem) {
|
|
@@ -7828,16 +7845,16 @@ var MenuItem = React43.forwardRef(
|
|
|
7828
7845
|
}
|
|
7829
7846
|
);
|
|
7830
7847
|
MenuItem.displayName = ITEM_NAME2;
|
|
7831
|
-
var MenuItemImpl =
|
|
7848
|
+
var MenuItemImpl = React44.forwardRef(
|
|
7832
7849
|
(props, forwardedRef) => {
|
|
7833
7850
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
7834
7851
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
7835
7852
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7836
|
-
const ref =
|
|
7853
|
+
const ref = React44.useRef(null);
|
|
7837
7854
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7838
|
-
const [isFocused, setIsFocused] =
|
|
7839
|
-
const [textContent, setTextContent] =
|
|
7840
|
-
|
|
7855
|
+
const [isFocused, setIsFocused] = React44.useState(false);
|
|
7856
|
+
const [textContent, setTextContent] = React44.useState("");
|
|
7857
|
+
React44.useEffect(() => {
|
|
7841
7858
|
const menuItem = ref.current;
|
|
7842
7859
|
if (menuItem) {
|
|
7843
7860
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
@@ -7885,7 +7902,7 @@ var MenuItemImpl = React43.forwardRef(
|
|
|
7885
7902
|
}
|
|
7886
7903
|
);
|
|
7887
7904
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
7888
|
-
var MenuCheckboxItem =
|
|
7905
|
+
var MenuCheckboxItem = React44.forwardRef(
|
|
7889
7906
|
(props, forwardedRef) => {
|
|
7890
7907
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
7891
7908
|
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
@@ -7912,7 +7929,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
7912
7929
|
{ value: void 0, onValueChange: () => {
|
|
7913
7930
|
} }
|
|
7914
7931
|
);
|
|
7915
|
-
var MenuRadioGroup =
|
|
7932
|
+
var MenuRadioGroup = React44.forwardRef(
|
|
7916
7933
|
(props, forwardedRef) => {
|
|
7917
7934
|
const { value, onValueChange, ...groupProps } = props;
|
|
7918
7935
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -7921,7 +7938,7 @@ var MenuRadioGroup = React43.forwardRef(
|
|
|
7921
7938
|
);
|
|
7922
7939
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7923
7940
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
7924
|
-
var MenuRadioItem =
|
|
7941
|
+
var MenuRadioItem = React44.forwardRef(
|
|
7925
7942
|
(props, forwardedRef) => {
|
|
7926
7943
|
const { value, ...radioItemProps } = props;
|
|
7927
7944
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -7949,7 +7966,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
7949
7966
|
ITEM_INDICATOR_NAME,
|
|
7950
7967
|
{ checked: false }
|
|
7951
7968
|
);
|
|
7952
|
-
var MenuItemIndicator =
|
|
7969
|
+
var MenuItemIndicator = React44.forwardRef(
|
|
7953
7970
|
(props, forwardedRef) => {
|
|
7954
7971
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
7955
7972
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -7971,7 +7988,7 @@ var MenuItemIndicator = React43.forwardRef(
|
|
|
7971
7988
|
);
|
|
7972
7989
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
7973
7990
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
7974
|
-
var MenuSeparator =
|
|
7991
|
+
var MenuSeparator = React44.forwardRef(
|
|
7975
7992
|
(props, forwardedRef) => {
|
|
7976
7993
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7977
7994
|
return /* @__PURE__ */ jsx(
|
|
@@ -7987,7 +8004,7 @@ var MenuSeparator = React43.forwardRef(
|
|
|
7987
8004
|
);
|
|
7988
8005
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
7989
8006
|
var ARROW_NAME2 = "MenuArrow";
|
|
7990
|
-
var MenuArrow =
|
|
8007
|
+
var MenuArrow = React44.forwardRef(
|
|
7991
8008
|
(props, forwardedRef) => {
|
|
7992
8009
|
const { __scopeMenu, ...arrowProps } = props;
|
|
7993
8010
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -8001,10 +8018,10 @@ var MenuSub = (props) => {
|
|
|
8001
8018
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
8002
8019
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
8003
8020
|
const popperScope = usePopperScope(__scopeMenu);
|
|
8004
|
-
const [trigger, setTrigger] =
|
|
8005
|
-
const [content, setContent] =
|
|
8021
|
+
const [trigger, setTrigger] = React44.useState(null);
|
|
8022
|
+
const [content, setContent] = React44.useState(null);
|
|
8006
8023
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
8007
|
-
|
|
8024
|
+
React44.useEffect(() => {
|
|
8008
8025
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
8009
8026
|
return () => handleOpenChange(false);
|
|
8010
8027
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
@@ -8032,21 +8049,21 @@ var MenuSub = (props) => {
|
|
|
8032
8049
|
};
|
|
8033
8050
|
MenuSub.displayName = SUB_NAME;
|
|
8034
8051
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
8035
|
-
var MenuSubTrigger =
|
|
8052
|
+
var MenuSubTrigger = React44.forwardRef(
|
|
8036
8053
|
(props, forwardedRef) => {
|
|
8037
8054
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8038
8055
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8039
8056
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8040
8057
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8041
|
-
const openTimerRef =
|
|
8058
|
+
const openTimerRef = React44.useRef(null);
|
|
8042
8059
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
8043
8060
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
8044
|
-
const clearOpenTimer =
|
|
8061
|
+
const clearOpenTimer = React44.useCallback(() => {
|
|
8045
8062
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
8046
8063
|
openTimerRef.current = null;
|
|
8047
8064
|
}, []);
|
|
8048
|
-
|
|
8049
|
-
|
|
8065
|
+
React44.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
8066
|
+
React44.useEffect(() => {
|
|
8050
8067
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
8051
8068
|
return () => {
|
|
8052
8069
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -8133,14 +8150,14 @@ var MenuSubTrigger = React43.forwardRef(
|
|
|
8133
8150
|
);
|
|
8134
8151
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
8135
8152
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
8136
|
-
var MenuSubContent =
|
|
8153
|
+
var MenuSubContent = React44.forwardRef(
|
|
8137
8154
|
(props, forwardedRef) => {
|
|
8138
8155
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8139
8156
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
8140
8157
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8141
8158
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8142
8159
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
8143
|
-
const ref =
|
|
8160
|
+
const ref = React44.useRef(null);
|
|
8144
8161
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8145
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(
|
|
8146
8163
|
MenuContentImpl,
|
|
@@ -8269,7 +8286,7 @@ var DropdownMenu = (props) => {
|
|
|
8269
8286
|
modal = true
|
|
8270
8287
|
} = props;
|
|
8271
8288
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8272
|
-
const triggerRef =
|
|
8289
|
+
const triggerRef = React44.useRef(null);
|
|
8273
8290
|
const [open, setOpen] = useControllableState({
|
|
8274
8291
|
prop: openProp,
|
|
8275
8292
|
defaultProp: defaultOpen ?? false,
|
|
@@ -8285,7 +8302,7 @@ var DropdownMenu = (props) => {
|
|
|
8285
8302
|
contentId: useId(),
|
|
8286
8303
|
open,
|
|
8287
8304
|
onOpenChange: setOpen,
|
|
8288
|
-
onOpenToggle:
|
|
8305
|
+
onOpenToggle: React44.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8289
8306
|
modal,
|
|
8290
8307
|
children: /* @__PURE__ */ jsx(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
8291
8308
|
}
|
|
@@ -8293,7 +8310,7 @@ var DropdownMenu = (props) => {
|
|
|
8293
8310
|
};
|
|
8294
8311
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
8295
8312
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8296
|
-
var DropdownMenuTrigger =
|
|
8313
|
+
var DropdownMenuTrigger = React44.forwardRef(
|
|
8297
8314
|
(props, forwardedRef) => {
|
|
8298
8315
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8299
8316
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -8336,12 +8353,12 @@ var DropdownMenuPortal = (props) => {
|
|
|
8336
8353
|
};
|
|
8337
8354
|
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
8338
8355
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
8339
|
-
var DropdownMenuContent =
|
|
8356
|
+
var DropdownMenuContent = React44.forwardRef(
|
|
8340
8357
|
(props, forwardedRef) => {
|
|
8341
8358
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8342
8359
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
8343
8360
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8344
|
-
const hasInteractedOutsideRef =
|
|
8361
|
+
const hasInteractedOutsideRef = React44.useRef(false);
|
|
8345
8362
|
return /* @__PURE__ */ jsx(
|
|
8346
8363
|
Content2,
|
|
8347
8364
|
{
|
|
@@ -8378,7 +8395,7 @@ var DropdownMenuContent = React43.forwardRef(
|
|
|
8378
8395
|
);
|
|
8379
8396
|
DropdownMenuContent.displayName = CONTENT_NAME3;
|
|
8380
8397
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
8381
|
-
var DropdownMenuGroup =
|
|
8398
|
+
var DropdownMenuGroup = React44.forwardRef(
|
|
8382
8399
|
(props, forwardedRef) => {
|
|
8383
8400
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
8384
8401
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8387,7 +8404,7 @@ var DropdownMenuGroup = React43.forwardRef(
|
|
|
8387
8404
|
);
|
|
8388
8405
|
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
8389
8406
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
8390
|
-
var DropdownMenuLabel =
|
|
8407
|
+
var DropdownMenuLabel = React44.forwardRef(
|
|
8391
8408
|
(props, forwardedRef) => {
|
|
8392
8409
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8393
8410
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8396,7 +8413,7 @@ var DropdownMenuLabel = React43.forwardRef(
|
|
|
8396
8413
|
);
|
|
8397
8414
|
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
8398
8415
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
8399
|
-
var DropdownMenuItem =
|
|
8416
|
+
var DropdownMenuItem = React44.forwardRef(
|
|
8400
8417
|
(props, forwardedRef) => {
|
|
8401
8418
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
8402
8419
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8405,42 +8422,42 @@ var DropdownMenuItem = React43.forwardRef(
|
|
|
8405
8422
|
);
|
|
8406
8423
|
DropdownMenuItem.displayName = ITEM_NAME3;
|
|
8407
8424
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
8408
|
-
var DropdownMenuCheckboxItem =
|
|
8425
|
+
var DropdownMenuCheckboxItem = React44.forwardRef((props, forwardedRef) => {
|
|
8409
8426
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
8410
8427
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8411
8428
|
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
8412
8429
|
});
|
|
8413
8430
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
8414
8431
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
8415
|
-
var DropdownMenuRadioGroup =
|
|
8432
|
+
var DropdownMenuRadioGroup = React44.forwardRef((props, forwardedRef) => {
|
|
8416
8433
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
8417
8434
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8418
8435
|
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
8419
8436
|
});
|
|
8420
8437
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
8421
8438
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
8422
|
-
var DropdownMenuRadioItem =
|
|
8439
|
+
var DropdownMenuRadioItem = React44.forwardRef((props, forwardedRef) => {
|
|
8423
8440
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
8424
8441
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8425
8442
|
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
8426
8443
|
});
|
|
8427
8444
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
8428
8445
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
8429
|
-
var DropdownMenuItemIndicator =
|
|
8446
|
+
var DropdownMenuItemIndicator = React44.forwardRef((props, forwardedRef) => {
|
|
8430
8447
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
8431
8448
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8432
8449
|
return /* @__PURE__ */ jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
8433
8450
|
});
|
|
8434
8451
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
8435
8452
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
8436
|
-
var DropdownMenuSeparator =
|
|
8453
|
+
var DropdownMenuSeparator = React44.forwardRef((props, forwardedRef) => {
|
|
8437
8454
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
8438
8455
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8439
8456
|
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
8440
8457
|
});
|
|
8441
8458
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
8442
8459
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
8443
|
-
var DropdownMenuArrow =
|
|
8460
|
+
var DropdownMenuArrow = React44.forwardRef(
|
|
8444
8461
|
(props, forwardedRef) => {
|
|
8445
8462
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
8446
8463
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8460,14 +8477,14 @@ var DropdownMenuSub = (props) => {
|
|
|
8460
8477
|
return /* @__PURE__ */ jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
8461
8478
|
};
|
|
8462
8479
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
8463
|
-
var DropdownMenuSubTrigger =
|
|
8480
|
+
var DropdownMenuSubTrigger = React44.forwardRef((props, forwardedRef) => {
|
|
8464
8481
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
8465
8482
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8466
8483
|
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
8467
8484
|
});
|
|
8468
8485
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
8469
8486
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
8470
|
-
var DropdownMenuSubContent =
|
|
8487
|
+
var DropdownMenuSubContent = React44.forwardRef((props, forwardedRef) => {
|
|
8471
8488
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
8472
8489
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8473
8490
|
return /* @__PURE__ */ jsx(
|
|
@@ -8596,17 +8613,17 @@ var Circle = createLucideIcon("Circle", __iconNode5);
|
|
|
8596
8613
|
function DropdownMenu2({
|
|
8597
8614
|
...props
|
|
8598
8615
|
}) {
|
|
8599
|
-
return /* @__PURE__ */
|
|
8616
|
+
return /* @__PURE__ */ React44.createElement(Root23, { "data-slot": "dropdown-menu", ...props });
|
|
8600
8617
|
}
|
|
8601
8618
|
function DropdownMenuPortal2({
|
|
8602
8619
|
...props
|
|
8603
8620
|
}) {
|
|
8604
|
-
return /* @__PURE__ */
|
|
8621
|
+
return /* @__PURE__ */ React44.createElement(Portal22, { "data-slot": "dropdown-menu-portal", ...props });
|
|
8605
8622
|
}
|
|
8606
8623
|
function DropdownMenuTrigger2({
|
|
8607
8624
|
...props
|
|
8608
8625
|
}) {
|
|
8609
|
-
return /* @__PURE__ */
|
|
8626
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8610
8627
|
Trigger,
|
|
8611
8628
|
{
|
|
8612
8629
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -8619,7 +8636,7 @@ function DropdownMenuContent2({
|
|
|
8619
8636
|
sideOffset = 4,
|
|
8620
8637
|
...props
|
|
8621
8638
|
}) {
|
|
8622
|
-
return /* @__PURE__ */
|
|
8639
|
+
return /* @__PURE__ */ React44.createElement(Portal22, null, /* @__PURE__ */ React44.createElement(
|
|
8623
8640
|
Content22,
|
|
8624
8641
|
{
|
|
8625
8642
|
"data-slot": "dropdown-menu-content",
|
|
@@ -8636,30 +8653,30 @@ function DropdownMenuClose({
|
|
|
8636
8653
|
className,
|
|
8637
8654
|
...props
|
|
8638
8655
|
}) {
|
|
8639
|
-
return /* @__PURE__ */
|
|
8656
|
+
return /* @__PURE__ */ React44.createElement(Item22, { "data-slot": "dropdown-menu-close", className: "hidden", ...props });
|
|
8640
8657
|
}
|
|
8641
8658
|
function DropdownMenuGroup2({
|
|
8642
8659
|
...props
|
|
8643
8660
|
}) {
|
|
8644
|
-
return /* @__PURE__ */
|
|
8661
|
+
return /* @__PURE__ */ React44.createElement(Group2, { "data-slot": "dropdown-menu-group", ...props });
|
|
8645
8662
|
}
|
|
8646
8663
|
function ConfirmationDropdownMenuItem({
|
|
8647
8664
|
...props
|
|
8648
8665
|
}) {
|
|
8649
8666
|
const { onClick: originalOnClick, ...rest } = props;
|
|
8650
|
-
const [isConfirming, setIsConfirming] =
|
|
8651
|
-
return !isConfirming ? /* @__PURE__ */
|
|
8667
|
+
const [isConfirming, setIsConfirming] = React44.useState(false);
|
|
8668
|
+
return !isConfirming ? /* @__PURE__ */ React44.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8652
8669
|
setIsConfirming(true);
|
|
8653
8670
|
e.preventDefault();
|
|
8654
8671
|
e.stopPropagation();
|
|
8655
|
-
} }) : /* @__PURE__ */
|
|
8672
|
+
} }) : /* @__PURE__ */ React44.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8656
8673
|
if (originalOnClick) {
|
|
8657
8674
|
setIsConfirming(false);
|
|
8658
8675
|
originalOnClick(e);
|
|
8659
8676
|
e.preventDefault();
|
|
8660
8677
|
e.stopPropagation();
|
|
8661
8678
|
}
|
|
8662
|
-
} }, /* @__PURE__ */
|
|
8679
|
+
} }, /* @__PURE__ */ React44.createElement("div", { className: "flex flex-row gap-2 items-center" }, /* @__PURE__ */ React44.createElement("div", { className: "text-destructive" }, "Are you sure ?")));
|
|
8663
8680
|
}
|
|
8664
8681
|
function DropdownMenuItem2({
|
|
8665
8682
|
className,
|
|
@@ -8667,7 +8684,7 @@ function DropdownMenuItem2({
|
|
|
8667
8684
|
variant = "default",
|
|
8668
8685
|
...props
|
|
8669
8686
|
}) {
|
|
8670
|
-
return /* @__PURE__ */
|
|
8687
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8671
8688
|
Item22,
|
|
8672
8689
|
{
|
|
8673
8690
|
"data-slot": "dropdown-menu-item",
|
|
@@ -8687,7 +8704,7 @@ function DropdownMenuCheckboxItem2({
|
|
|
8687
8704
|
checked,
|
|
8688
8705
|
...props
|
|
8689
8706
|
}) {
|
|
8690
|
-
return /* @__PURE__ */
|
|
8707
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8691
8708
|
CheckboxItem2,
|
|
8692
8709
|
{
|
|
8693
8710
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -8698,14 +8715,14 @@ function DropdownMenuCheckboxItem2({
|
|
|
8698
8715
|
checked,
|
|
8699
8716
|
...props
|
|
8700
8717
|
},
|
|
8701
|
-
/* @__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" }))),
|
|
8702
8719
|
children
|
|
8703
8720
|
);
|
|
8704
8721
|
}
|
|
8705
8722
|
function DropdownMenuRadioGroup2({
|
|
8706
8723
|
...props
|
|
8707
8724
|
}) {
|
|
8708
|
-
return /* @__PURE__ */
|
|
8725
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8709
8726
|
RadioGroup2,
|
|
8710
8727
|
{
|
|
8711
8728
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -8718,7 +8735,7 @@ function DropdownMenuRadioItem2({
|
|
|
8718
8735
|
children,
|
|
8719
8736
|
...props
|
|
8720
8737
|
}) {
|
|
8721
|
-
return /* @__PURE__ */
|
|
8738
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8722
8739
|
RadioItem2,
|
|
8723
8740
|
{
|
|
8724
8741
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -8728,7 +8745,7 @@ function DropdownMenuRadioItem2({
|
|
|
8728
8745
|
),
|
|
8729
8746
|
...props
|
|
8730
8747
|
},
|
|
8731
|
-
/* @__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" }))),
|
|
8732
8749
|
children
|
|
8733
8750
|
);
|
|
8734
8751
|
}
|
|
@@ -8737,7 +8754,7 @@ function DropdownMenuLabel2({
|
|
|
8737
8754
|
inset,
|
|
8738
8755
|
...props
|
|
8739
8756
|
}) {
|
|
8740
|
-
return /* @__PURE__ */
|
|
8757
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8741
8758
|
Label2,
|
|
8742
8759
|
{
|
|
8743
8760
|
"data-slot": "dropdown-menu-label",
|
|
@@ -8754,7 +8771,7 @@ function DropdownMenuSeparator2({
|
|
|
8754
8771
|
className,
|
|
8755
8772
|
...props
|
|
8756
8773
|
}) {
|
|
8757
|
-
return /* @__PURE__ */
|
|
8774
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8758
8775
|
Separator2,
|
|
8759
8776
|
{
|
|
8760
8777
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -8767,7 +8784,7 @@ function DropdownMenuShortcut({
|
|
|
8767
8784
|
className,
|
|
8768
8785
|
...props
|
|
8769
8786
|
}) {
|
|
8770
|
-
return /* @__PURE__ */
|
|
8787
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8771
8788
|
"span",
|
|
8772
8789
|
{
|
|
8773
8790
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -8782,7 +8799,7 @@ function DropdownMenuShortcut({
|
|
|
8782
8799
|
function DropdownMenuSub2({
|
|
8783
8800
|
...props
|
|
8784
8801
|
}) {
|
|
8785
|
-
return /* @__PURE__ */
|
|
8802
|
+
return /* @__PURE__ */ React44.createElement(Sub2, { "data-slot": "dropdown-menu-sub", ...props });
|
|
8786
8803
|
}
|
|
8787
8804
|
function DropdownMenuSubTrigger2({
|
|
8788
8805
|
className,
|
|
@@ -8790,7 +8807,7 @@ function DropdownMenuSubTrigger2({
|
|
|
8790
8807
|
children,
|
|
8791
8808
|
...props
|
|
8792
8809
|
}) {
|
|
8793
|
-
return /* @__PURE__ */
|
|
8810
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8794
8811
|
SubTrigger2,
|
|
8795
8812
|
{
|
|
8796
8813
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
@@ -8802,14 +8819,14 @@ function DropdownMenuSubTrigger2({
|
|
|
8802
8819
|
...props
|
|
8803
8820
|
},
|
|
8804
8821
|
children,
|
|
8805
|
-
/* @__PURE__ */
|
|
8822
|
+
/* @__PURE__ */ React44.createElement(ChevronRight, { className: "uii:ml-auto uii:size-4" })
|
|
8806
8823
|
);
|
|
8807
8824
|
}
|
|
8808
8825
|
function DropdownMenuSubContent2({
|
|
8809
8826
|
className,
|
|
8810
8827
|
...props
|
|
8811
8828
|
}) {
|
|
8812
|
-
return /* @__PURE__ */
|
|
8829
|
+
return /* @__PURE__ */ React44.createElement(
|
|
8813
8830
|
SubContent2,
|
|
8814
8831
|
{
|
|
8815
8832
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -8829,6 +8846,7 @@ __export(fields_exports, {
|
|
|
8829
8846
|
InferredTypesContext: () => InferredTypesContext,
|
|
8830
8847
|
InferredTypesProvider: () => InferredTypesProvider,
|
|
8831
8848
|
Input: () => Input,
|
|
8849
|
+
LogicToggleButton: () => LogicToggleButton,
|
|
8832
8850
|
NestedFieldProvider: () => NestedFieldProvider,
|
|
8833
8851
|
NodePropertyProvider: () => NodePropertyProvider,
|
|
8834
8852
|
OPERATORS_BY_TYPE: () => OPERATORS_BY_TYPE,
|
|
@@ -8842,6 +8860,7 @@ __export(fields_exports, {
|
|
|
8842
8860
|
getOperatorsForType: () => getOperatorsForType,
|
|
8843
8861
|
getStringConstants: () => getStringConstants,
|
|
8844
8862
|
intersectTypes: () => intersectTypes,
|
|
8863
|
+
logicToggleButtonStyles: () => logicToggleButtonStyles,
|
|
8845
8864
|
normalizeFieldValue: () => normalizeFieldValue,
|
|
8846
8865
|
parseInferSyntax: () => parseInferSyntax,
|
|
8847
8866
|
parseInferredTypes: () => parseInferredTypes,
|
|
@@ -8868,7 +8887,7 @@ __export(fields_exports, {
|
|
|
8868
8887
|
var DevContext = createContext(null);
|
|
8869
8888
|
function useResolvedExpectedType(expectedType, devCtx) {
|
|
8870
8889
|
const inferredTypes = devCtx?.inferredTypes;
|
|
8871
|
-
return
|
|
8890
|
+
return React44.useMemo(() => {
|
|
8872
8891
|
if (!expectedType) return "any";
|
|
8873
8892
|
if (!expectedType.startsWith("$infer<")) {
|
|
8874
8893
|
return expectedType;
|
|
@@ -8913,16 +8932,16 @@ function Input({
|
|
|
8913
8932
|
}) {
|
|
8914
8933
|
const devCtx = useContext(DevContext);
|
|
8915
8934
|
const resolvedExpectedType = useResolvedExpectedType(expectedType, devCtx);
|
|
8916
|
-
const displayValue =
|
|
8935
|
+
const displayValue = React44.useMemo(() => {
|
|
8917
8936
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
8918
8937
|
return String(value.expression ?? "");
|
|
8919
8938
|
}
|
|
8920
8939
|
return String(value ?? "");
|
|
8921
8940
|
}, [value]);
|
|
8922
|
-
const isExpression =
|
|
8941
|
+
const isExpression = React44.useMemo(() => {
|
|
8923
8942
|
return value != null && typeof value === "object" && "expression" in value;
|
|
8924
8943
|
}, [value]);
|
|
8925
|
-
const handleChange =
|
|
8944
|
+
const handleChange = React44.useCallback((e) => {
|
|
8926
8945
|
const newValue = e.target.value;
|
|
8927
8946
|
if (newValue.includes("{{")) {
|
|
8928
8947
|
onChange({
|
|
@@ -8935,7 +8954,7 @@ function Input({
|
|
|
8935
8954
|
}, [onChange]);
|
|
8936
8955
|
const showError = hasRequiredError || required && !displayValue;
|
|
8937
8956
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
8938
|
-
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(
|
|
8939
8958
|
"label",
|
|
8940
8959
|
{
|
|
8941
8960
|
htmlFor: fieldName,
|
|
@@ -8943,7 +8962,7 @@ function Input({
|
|
|
8943
8962
|
},
|
|
8944
8963
|
label,
|
|
8945
8964
|
":"
|
|
8946
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
8965
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44.createElement(
|
|
8947
8966
|
"span",
|
|
8948
8967
|
{
|
|
8949
8968
|
className: cn(
|
|
@@ -8953,7 +8972,7 @@ function Input({
|
|
|
8953
8972
|
title: resolvedExpectedType
|
|
8954
8973
|
},
|
|
8955
8974
|
resolvedExpectedType
|
|
8956
|
-
), 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(
|
|
8957
8976
|
"input",
|
|
8958
8977
|
{
|
|
8959
8978
|
id: fieldName,
|
|
@@ -8981,8 +9000,8 @@ function clamp2(value, [min2, max2]) {
|
|
|
8981
9000
|
return Math.min(max2, Math.max(min2, value));
|
|
8982
9001
|
}
|
|
8983
9002
|
function usePrevious(value) {
|
|
8984
|
-
const ref =
|
|
8985
|
-
return
|
|
9003
|
+
const ref = React44.useRef({ value, previous: value });
|
|
9004
|
+
return React44.useMemo(() => {
|
|
8986
9005
|
if (ref.current.value !== value) {
|
|
8987
9006
|
ref.current.previous = ref.current.value;
|
|
8988
9007
|
ref.current.value = value;
|
|
@@ -9004,7 +9023,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
9004
9023
|
wordWrap: "normal"
|
|
9005
9024
|
});
|
|
9006
9025
|
var NAME3 = "VisuallyHidden";
|
|
9007
|
-
var VisuallyHidden =
|
|
9026
|
+
var VisuallyHidden = React44.forwardRef(
|
|
9008
9027
|
(props, forwardedRef) => {
|
|
9009
9028
|
return /* @__PURE__ */ jsx(
|
|
9010
9029
|
Primitive.span,
|
|
@@ -9046,9 +9065,9 @@ var Select = (props) => {
|
|
|
9046
9065
|
form
|
|
9047
9066
|
} = props;
|
|
9048
9067
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
9049
|
-
const [trigger, setTrigger] =
|
|
9050
|
-
const [valueNode, setValueNode] =
|
|
9051
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
9068
|
+
const [trigger, setTrigger] = React44.useState(null);
|
|
9069
|
+
const [valueNode, setValueNode] = React44.useState(null);
|
|
9070
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React44.useState(false);
|
|
9052
9071
|
const direction = useDirection(dir);
|
|
9053
9072
|
const [open, setOpen] = useControllableState({
|
|
9054
9073
|
prop: openProp,
|
|
@@ -9062,9 +9081,9 @@ var Select = (props) => {
|
|
|
9062
9081
|
onChange: onValueChange,
|
|
9063
9082
|
caller: SELECT_NAME
|
|
9064
9083
|
});
|
|
9065
|
-
const triggerPointerDownPosRef =
|
|
9084
|
+
const triggerPointerDownPosRef = React44.useRef(null);
|
|
9066
9085
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
9067
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
9086
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React44.useState(/* @__PURE__ */ new Set());
|
|
9068
9087
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
9069
9088
|
return /* @__PURE__ */ jsx(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs(
|
|
9070
9089
|
SelectProvider,
|
|
@@ -9090,10 +9109,10 @@ var Select = (props) => {
|
|
|
9090
9109
|
SelectNativeOptionsProvider,
|
|
9091
9110
|
{
|
|
9092
9111
|
scope: props.__scopeSelect,
|
|
9093
|
-
onNativeOptionAdd:
|
|
9112
|
+
onNativeOptionAdd: React44.useCallback((option) => {
|
|
9094
9113
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
9095
9114
|
}, []),
|
|
9096
|
-
onNativeOptionRemove:
|
|
9115
|
+
onNativeOptionRemove: React44.useCallback((option) => {
|
|
9097
9116
|
setNativeOptionsSet((prev) => {
|
|
9098
9117
|
const optionsSet = new Set(prev);
|
|
9099
9118
|
optionsSet.delete(option);
|
|
@@ -9128,7 +9147,7 @@ var Select = (props) => {
|
|
|
9128
9147
|
};
|
|
9129
9148
|
Select.displayName = SELECT_NAME;
|
|
9130
9149
|
var TRIGGER_NAME2 = "SelectTrigger";
|
|
9131
|
-
var SelectTrigger =
|
|
9150
|
+
var SelectTrigger = React44.forwardRef(
|
|
9132
9151
|
(props, forwardedRef) => {
|
|
9133
9152
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
9134
9153
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -9136,7 +9155,7 @@ var SelectTrigger = React43.forwardRef(
|
|
|
9136
9155
|
const isDisabled = context.disabled || disabled;
|
|
9137
9156
|
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
9138
9157
|
const getItems = useCollection3(__scopeSelect);
|
|
9139
|
-
const pointerTypeRef =
|
|
9158
|
+
const pointerTypeRef = React44.useRef("touch");
|
|
9140
9159
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
9141
9160
|
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
9142
9161
|
const currentItem = enabledItems.find((item) => item.value === context.value);
|
|
@@ -9206,7 +9225,7 @@ var SelectTrigger = React43.forwardRef(
|
|
|
9206
9225
|
);
|
|
9207
9226
|
SelectTrigger.displayName = TRIGGER_NAME2;
|
|
9208
9227
|
var VALUE_NAME = "SelectValue";
|
|
9209
|
-
var SelectValue =
|
|
9228
|
+
var SelectValue = React44.forwardRef(
|
|
9210
9229
|
(props, forwardedRef) => {
|
|
9211
9230
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
9212
9231
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
@@ -9229,7 +9248,7 @@ var SelectValue = React43.forwardRef(
|
|
|
9229
9248
|
);
|
|
9230
9249
|
SelectValue.displayName = VALUE_NAME;
|
|
9231
9250
|
var ICON_NAME = "SelectIcon";
|
|
9232
|
-
var SelectIcon =
|
|
9251
|
+
var SelectIcon = React44.forwardRef(
|
|
9233
9252
|
(props, forwardedRef) => {
|
|
9234
9253
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
9235
9254
|
return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
@@ -9242,10 +9261,10 @@ var SelectPortal = (props) => {
|
|
|
9242
9261
|
};
|
|
9243
9262
|
SelectPortal.displayName = PORTAL_NAME4;
|
|
9244
9263
|
var CONTENT_NAME4 = "SelectContent";
|
|
9245
|
-
var SelectContent =
|
|
9264
|
+
var SelectContent = React44.forwardRef(
|
|
9246
9265
|
(props, forwardedRef) => {
|
|
9247
9266
|
const context = useSelectContext(CONTENT_NAME4, props.__scopeSelect);
|
|
9248
|
-
const [fragment, setFragment] =
|
|
9267
|
+
const [fragment, setFragment] = React44.useState();
|
|
9249
9268
|
useLayoutEffect2(() => {
|
|
9250
9269
|
setFragment(new DocumentFragment());
|
|
9251
9270
|
}, []);
|
|
@@ -9264,7 +9283,7 @@ var CONTENT_MARGIN = 10;
|
|
|
9264
9283
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME4);
|
|
9265
9284
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
9266
9285
|
var Slot3 = createSlot2("SelectContent.RemoveScroll");
|
|
9267
|
-
var SelectContentImpl =
|
|
9286
|
+
var SelectContentImpl = React44.forwardRef(
|
|
9268
9287
|
(props, forwardedRef) => {
|
|
9269
9288
|
const {
|
|
9270
9289
|
__scopeSelect,
|
|
@@ -9288,21 +9307,21 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9288
9307
|
...contentProps
|
|
9289
9308
|
} = props;
|
|
9290
9309
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9291
|
-
const [content, setContent] =
|
|
9292
|
-
const [viewport, setViewport] =
|
|
9310
|
+
const [content, setContent] = React44.useState(null);
|
|
9311
|
+
const [viewport, setViewport] = React44.useState(null);
|
|
9293
9312
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9294
|
-
const [selectedItem, setSelectedItem] =
|
|
9295
|
-
const [selectedItemText, setSelectedItemText] =
|
|
9313
|
+
const [selectedItem, setSelectedItem] = React44.useState(null);
|
|
9314
|
+
const [selectedItemText, setSelectedItemText] = React44.useState(
|
|
9296
9315
|
null
|
|
9297
9316
|
);
|
|
9298
9317
|
const getItems = useCollection3(__scopeSelect);
|
|
9299
|
-
const [isPositioned, setIsPositioned] =
|
|
9300
|
-
const firstValidItemFoundRef =
|
|
9301
|
-
|
|
9318
|
+
const [isPositioned, setIsPositioned] = React44.useState(false);
|
|
9319
|
+
const firstValidItemFoundRef = React44.useRef(false);
|
|
9320
|
+
React44.useEffect(() => {
|
|
9302
9321
|
if (content) return hideOthers(content);
|
|
9303
9322
|
}, [content]);
|
|
9304
9323
|
useFocusGuards();
|
|
9305
|
-
const focusFirst4 =
|
|
9324
|
+
const focusFirst4 = React44.useCallback(
|
|
9306
9325
|
(candidates) => {
|
|
9307
9326
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
9308
9327
|
const [lastItem] = restItems.slice(-1);
|
|
@@ -9318,17 +9337,17 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9318
9337
|
},
|
|
9319
9338
|
[getItems, viewport]
|
|
9320
9339
|
);
|
|
9321
|
-
const focusSelectedItem =
|
|
9340
|
+
const focusSelectedItem = React44.useCallback(
|
|
9322
9341
|
() => focusFirst4([selectedItem, content]),
|
|
9323
9342
|
[focusFirst4, selectedItem, content]
|
|
9324
9343
|
);
|
|
9325
|
-
|
|
9344
|
+
React44.useEffect(() => {
|
|
9326
9345
|
if (isPositioned) {
|
|
9327
9346
|
focusSelectedItem();
|
|
9328
9347
|
}
|
|
9329
9348
|
}, [isPositioned, focusSelectedItem]);
|
|
9330
9349
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
9331
|
-
|
|
9350
|
+
React44.useEffect(() => {
|
|
9332
9351
|
if (content) {
|
|
9333
9352
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
9334
9353
|
const handlePointerMove = (event) => {
|
|
@@ -9358,7 +9377,7 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9358
9377
|
};
|
|
9359
9378
|
}
|
|
9360
9379
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
9361
|
-
|
|
9380
|
+
React44.useEffect(() => {
|
|
9362
9381
|
const close = () => onOpenChange(false);
|
|
9363
9382
|
window.addEventListener("blur", close);
|
|
9364
9383
|
window.addEventListener("resize", close);
|
|
@@ -9375,7 +9394,7 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9375
9394
|
setTimeout(() => nextItem.ref.current.focus());
|
|
9376
9395
|
}
|
|
9377
9396
|
});
|
|
9378
|
-
const itemRefCallback =
|
|
9397
|
+
const itemRefCallback = React44.useCallback(
|
|
9379
9398
|
(node, value, disabled) => {
|
|
9380
9399
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9381
9400
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9386,8 +9405,8 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9386
9405
|
},
|
|
9387
9406
|
[context.value]
|
|
9388
9407
|
);
|
|
9389
|
-
const handleItemLeave =
|
|
9390
|
-
const itemTextRefCallback =
|
|
9408
|
+
const handleItemLeave = React44.useCallback(() => content?.focus(), [content]);
|
|
9409
|
+
const itemTextRefCallback = React44.useCallback(
|
|
9391
9410
|
(node, value, disabled) => {
|
|
9392
9411
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9393
9412
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9498,18 +9517,18 @@ var SelectContentImpl = React43.forwardRef(
|
|
|
9498
9517
|
);
|
|
9499
9518
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
9500
9519
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
9501
|
-
var SelectItemAlignedPosition =
|
|
9520
|
+
var SelectItemAlignedPosition = React44.forwardRef((props, forwardedRef) => {
|
|
9502
9521
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
9503
9522
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9504
9523
|
const contentContext = useSelectContentContext(CONTENT_NAME4, __scopeSelect);
|
|
9505
|
-
const [contentWrapper, setContentWrapper] =
|
|
9506
|
-
const [content, setContent] =
|
|
9524
|
+
const [contentWrapper, setContentWrapper] = React44.useState(null);
|
|
9525
|
+
const [content, setContent] = React44.useState(null);
|
|
9507
9526
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9508
9527
|
const getItems = useCollection3(__scopeSelect);
|
|
9509
|
-
const shouldExpandOnScrollRef =
|
|
9510
|
-
const shouldRepositionRef =
|
|
9528
|
+
const shouldExpandOnScrollRef = React44.useRef(false);
|
|
9529
|
+
const shouldRepositionRef = React44.useRef(true);
|
|
9511
9530
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
9512
|
-
const position =
|
|
9531
|
+
const position = React44.useCallback(() => {
|
|
9513
9532
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
9514
9533
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
9515
9534
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -9609,11 +9628,11 @@ var SelectItemAlignedPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9609
9628
|
onPlaced
|
|
9610
9629
|
]);
|
|
9611
9630
|
useLayoutEffect2(() => position(), [position]);
|
|
9612
|
-
const [contentZIndex, setContentZIndex] =
|
|
9631
|
+
const [contentZIndex, setContentZIndex] = React44.useState();
|
|
9613
9632
|
useLayoutEffect2(() => {
|
|
9614
9633
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
9615
9634
|
}, [content]);
|
|
9616
|
-
const handleScrollButtonChange =
|
|
9635
|
+
const handleScrollButtonChange = React44.useCallback(
|
|
9617
9636
|
(node) => {
|
|
9618
9637
|
if (node && shouldRepositionRef.current === true) {
|
|
9619
9638
|
position();
|
|
@@ -9662,7 +9681,7 @@ var SelectItemAlignedPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9662
9681
|
});
|
|
9663
9682
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
9664
9683
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
9665
|
-
var SelectPopperPosition =
|
|
9684
|
+
var SelectPopperPosition = React44.forwardRef((props, forwardedRef) => {
|
|
9666
9685
|
const {
|
|
9667
9686
|
__scopeSelect,
|
|
9668
9687
|
align = "start",
|
|
@@ -9697,13 +9716,13 @@ var SelectPopperPosition = React43.forwardRef((props, forwardedRef) => {
|
|
|
9697
9716
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
9698
9717
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME4, {});
|
|
9699
9718
|
var VIEWPORT_NAME = "SelectViewport";
|
|
9700
|
-
var SelectViewport =
|
|
9719
|
+
var SelectViewport = React44.forwardRef(
|
|
9701
9720
|
(props, forwardedRef) => {
|
|
9702
9721
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
9703
9722
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
9704
9723
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
9705
9724
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
9706
|
-
const prevScrollTopRef =
|
|
9725
|
+
const prevScrollTopRef = React44.useRef(0);
|
|
9707
9726
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9708
9727
|
/* @__PURE__ */ jsx(
|
|
9709
9728
|
"style",
|
|
@@ -9766,7 +9785,7 @@ var SelectViewport = React43.forwardRef(
|
|
|
9766
9785
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
9767
9786
|
var GROUP_NAME4 = "SelectGroup";
|
|
9768
9787
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME4);
|
|
9769
|
-
var SelectGroup =
|
|
9788
|
+
var SelectGroup = React44.forwardRef(
|
|
9770
9789
|
(props, forwardedRef) => {
|
|
9771
9790
|
const { __scopeSelect, ...groupProps } = props;
|
|
9772
9791
|
const groupId = useId();
|
|
@@ -9775,7 +9794,7 @@ var SelectGroup = React43.forwardRef(
|
|
|
9775
9794
|
);
|
|
9776
9795
|
SelectGroup.displayName = GROUP_NAME4;
|
|
9777
9796
|
var LABEL_NAME3 = "SelectLabel";
|
|
9778
|
-
var SelectLabel =
|
|
9797
|
+
var SelectLabel = React44.forwardRef(
|
|
9779
9798
|
(props, forwardedRef) => {
|
|
9780
9799
|
const { __scopeSelect, ...labelProps } = props;
|
|
9781
9800
|
const groupContext = useSelectGroupContext(LABEL_NAME3, __scopeSelect);
|
|
@@ -9785,7 +9804,7 @@ var SelectLabel = React43.forwardRef(
|
|
|
9785
9804
|
SelectLabel.displayName = LABEL_NAME3;
|
|
9786
9805
|
var ITEM_NAME4 = "SelectItem";
|
|
9787
9806
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME4);
|
|
9788
|
-
var SelectItem =
|
|
9807
|
+
var SelectItem = React44.forwardRef(
|
|
9789
9808
|
(props, forwardedRef) => {
|
|
9790
9809
|
const {
|
|
9791
9810
|
__scopeSelect,
|
|
@@ -9797,14 +9816,14 @@ var SelectItem = React43.forwardRef(
|
|
|
9797
9816
|
const context = useSelectContext(ITEM_NAME4, __scopeSelect);
|
|
9798
9817
|
const contentContext = useSelectContentContext(ITEM_NAME4, __scopeSelect);
|
|
9799
9818
|
const isSelected = context.value === value;
|
|
9800
|
-
const [textValue, setTextValue] =
|
|
9801
|
-
const [isFocused, setIsFocused] =
|
|
9819
|
+
const [textValue, setTextValue] = React44.useState(textValueProp ?? "");
|
|
9820
|
+
const [isFocused, setIsFocused] = React44.useState(false);
|
|
9802
9821
|
const composedRefs = useComposedRefs(
|
|
9803
9822
|
forwardedRef,
|
|
9804
9823
|
(node) => contentContext.itemRefCallback?.(node, value, disabled)
|
|
9805
9824
|
);
|
|
9806
9825
|
const textId = useId();
|
|
9807
|
-
const pointerTypeRef =
|
|
9826
|
+
const pointerTypeRef = React44.useRef("touch");
|
|
9808
9827
|
const handleSelect = () => {
|
|
9809
9828
|
if (!disabled) {
|
|
9810
9829
|
context.onValueChange(value);
|
|
@@ -9824,7 +9843,7 @@ var SelectItem = React43.forwardRef(
|
|
|
9824
9843
|
disabled,
|
|
9825
9844
|
textId,
|
|
9826
9845
|
isSelected,
|
|
9827
|
-
onItemTextChange:
|
|
9846
|
+
onItemTextChange: React44.useCallback((node) => {
|
|
9828
9847
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
9829
9848
|
}, []),
|
|
9830
9849
|
children: /* @__PURE__ */ jsx(
|
|
@@ -9887,14 +9906,14 @@ var SelectItem = React43.forwardRef(
|
|
|
9887
9906
|
);
|
|
9888
9907
|
SelectItem.displayName = ITEM_NAME4;
|
|
9889
9908
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
9890
|
-
var SelectItemText =
|
|
9909
|
+
var SelectItemText = React44.forwardRef(
|
|
9891
9910
|
(props, forwardedRef) => {
|
|
9892
9911
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
9893
9912
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9894
9913
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9895
9914
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9896
9915
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9897
|
-
const [itemTextNode, setItemTextNode] =
|
|
9916
|
+
const [itemTextNode, setItemTextNode] = React44.useState(null);
|
|
9898
9917
|
const composedRefs = useComposedRefs(
|
|
9899
9918
|
forwardedRef,
|
|
9900
9919
|
(node) => setItemTextNode(node),
|
|
@@ -9902,7 +9921,7 @@ var SelectItemText = React43.forwardRef(
|
|
|
9902
9921
|
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
|
9903
9922
|
);
|
|
9904
9923
|
const textContent = itemTextNode?.textContent;
|
|
9905
|
-
const nativeOption =
|
|
9924
|
+
const nativeOption = React44.useMemo(
|
|
9906
9925
|
() => /* @__PURE__ */ jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
9907
9926
|
[itemContext.disabled, itemContext.value, textContent]
|
|
9908
9927
|
);
|
|
@@ -9919,7 +9938,7 @@ var SelectItemText = React43.forwardRef(
|
|
|
9919
9938
|
);
|
|
9920
9939
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
9921
9940
|
var ITEM_INDICATOR_NAME2 = "SelectItemIndicator";
|
|
9922
|
-
var SelectItemIndicator =
|
|
9941
|
+
var SelectItemIndicator = React44.forwardRef(
|
|
9923
9942
|
(props, forwardedRef) => {
|
|
9924
9943
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
9925
9944
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME2, __scopeSelect);
|
|
@@ -9928,10 +9947,10 @@ var SelectItemIndicator = React43.forwardRef(
|
|
|
9928
9947
|
);
|
|
9929
9948
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME2;
|
|
9930
9949
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
9931
|
-
var SelectScrollUpButton =
|
|
9950
|
+
var SelectScrollUpButton = React44.forwardRef((props, forwardedRef) => {
|
|
9932
9951
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9933
9952
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9934
|
-
const [canScrollUp, setCanScrollUp] =
|
|
9953
|
+
const [canScrollUp, setCanScrollUp] = React44.useState(false);
|
|
9935
9954
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9936
9955
|
useLayoutEffect2(() => {
|
|
9937
9956
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9961,10 +9980,10 @@ var SelectScrollUpButton = React43.forwardRef((props, forwardedRef) => {
|
|
|
9961
9980
|
});
|
|
9962
9981
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
9963
9982
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
9964
|
-
var SelectScrollDownButton =
|
|
9983
|
+
var SelectScrollDownButton = React44.forwardRef((props, forwardedRef) => {
|
|
9965
9984
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9966
9985
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
9967
|
-
const [canScrollDown, setCanScrollDown] =
|
|
9986
|
+
const [canScrollDown, setCanScrollDown] = React44.useState(false);
|
|
9968
9987
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9969
9988
|
useLayoutEffect2(() => {
|
|
9970
9989
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9994,18 +10013,18 @@ var SelectScrollDownButton = React43.forwardRef((props, forwardedRef) => {
|
|
|
9994
10013
|
) : null;
|
|
9995
10014
|
});
|
|
9996
10015
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
9997
|
-
var SelectScrollButtonImpl =
|
|
10016
|
+
var SelectScrollButtonImpl = React44.forwardRef((props, forwardedRef) => {
|
|
9998
10017
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
9999
10018
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
10000
|
-
const autoScrollTimerRef =
|
|
10019
|
+
const autoScrollTimerRef = React44.useRef(null);
|
|
10001
10020
|
const getItems = useCollection3(__scopeSelect);
|
|
10002
|
-
const clearAutoScrollTimer =
|
|
10021
|
+
const clearAutoScrollTimer = React44.useCallback(() => {
|
|
10003
10022
|
if (autoScrollTimerRef.current !== null) {
|
|
10004
10023
|
window.clearInterval(autoScrollTimerRef.current);
|
|
10005
10024
|
autoScrollTimerRef.current = null;
|
|
10006
10025
|
}
|
|
10007
10026
|
}, []);
|
|
10008
|
-
|
|
10027
|
+
React44.useEffect(() => {
|
|
10009
10028
|
return () => clearAutoScrollTimer();
|
|
10010
10029
|
}, [clearAutoScrollTimer]);
|
|
10011
10030
|
useLayoutEffect2(() => {
|
|
@@ -10037,7 +10056,7 @@ var SelectScrollButtonImpl = React43.forwardRef((props, forwardedRef) => {
|
|
|
10037
10056
|
);
|
|
10038
10057
|
});
|
|
10039
10058
|
var SEPARATOR_NAME3 = "SelectSeparator";
|
|
10040
|
-
var SelectSeparator =
|
|
10059
|
+
var SelectSeparator = React44.forwardRef(
|
|
10041
10060
|
(props, forwardedRef) => {
|
|
10042
10061
|
const { __scopeSelect, ...separatorProps } = props;
|
|
10043
10062
|
return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
@@ -10045,7 +10064,7 @@ var SelectSeparator = React43.forwardRef(
|
|
|
10045
10064
|
);
|
|
10046
10065
|
SelectSeparator.displayName = SEPARATOR_NAME3;
|
|
10047
10066
|
var ARROW_NAME4 = "SelectArrow";
|
|
10048
|
-
var SelectArrow =
|
|
10067
|
+
var SelectArrow = React44.forwardRef(
|
|
10049
10068
|
(props, forwardedRef) => {
|
|
10050
10069
|
const { __scopeSelect, ...arrowProps } = props;
|
|
10051
10070
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -10056,12 +10075,12 @@ var SelectArrow = React43.forwardRef(
|
|
|
10056
10075
|
);
|
|
10057
10076
|
SelectArrow.displayName = ARROW_NAME4;
|
|
10058
10077
|
var BUBBLE_INPUT_NAME = "SelectBubbleInput";
|
|
10059
|
-
var SelectBubbleInput =
|
|
10078
|
+
var SelectBubbleInput = React44.forwardRef(
|
|
10060
10079
|
({ __scopeSelect, value, ...props }, forwardedRef) => {
|
|
10061
|
-
const ref =
|
|
10080
|
+
const ref = React44.useRef(null);
|
|
10062
10081
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10063
10082
|
const prevValue = usePrevious(value);
|
|
10064
|
-
|
|
10083
|
+
React44.useEffect(() => {
|
|
10065
10084
|
const select = ref.current;
|
|
10066
10085
|
if (!select) return;
|
|
10067
10086
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -10093,9 +10112,9 @@ function shouldShowPlaceholder(value) {
|
|
|
10093
10112
|
}
|
|
10094
10113
|
function useTypeaheadSearch(onSearchChange) {
|
|
10095
10114
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
10096
|
-
const searchRef =
|
|
10097
|
-
const timerRef =
|
|
10098
|
-
const handleTypeaheadSearch =
|
|
10115
|
+
const searchRef = React44.useRef("");
|
|
10116
|
+
const timerRef = React44.useRef(0);
|
|
10117
|
+
const handleTypeaheadSearch = React44.useCallback(
|
|
10099
10118
|
(key) => {
|
|
10100
10119
|
const search = searchRef.current + key;
|
|
10101
10120
|
handleSearchChange(search);
|
|
@@ -10107,11 +10126,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
10107
10126
|
},
|
|
10108
10127
|
[handleSearchChange]
|
|
10109
10128
|
);
|
|
10110
|
-
const resetTypeahead =
|
|
10129
|
+
const resetTypeahead = React44.useCallback(() => {
|
|
10111
10130
|
searchRef.current = "";
|
|
10112
10131
|
window.clearTimeout(timerRef.current);
|
|
10113
10132
|
}, []);
|
|
10114
|
-
|
|
10133
|
+
React44.useEffect(() => {
|
|
10115
10134
|
return () => window.clearTimeout(timerRef.current);
|
|
10116
10135
|
}, []);
|
|
10117
10136
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -10148,19 +10167,19 @@ var ScrollDownButton = SelectScrollDownButton;
|
|
|
10148
10167
|
function Select2({
|
|
10149
10168
|
...props
|
|
10150
10169
|
}) {
|
|
10151
|
-
return /* @__PURE__ */
|
|
10170
|
+
return /* @__PURE__ */ React44.createElement(Root24, { "data-slot": "select", ...props });
|
|
10152
10171
|
}
|
|
10153
10172
|
function SelectValue2({
|
|
10154
10173
|
...props
|
|
10155
10174
|
}) {
|
|
10156
|
-
return /* @__PURE__ */
|
|
10175
|
+
return /* @__PURE__ */ React44.createElement(Value, { "data-slot": "select-value", ...props });
|
|
10157
10176
|
}
|
|
10158
10177
|
function SelectTrigger2({
|
|
10159
10178
|
className,
|
|
10160
10179
|
children,
|
|
10161
10180
|
...props
|
|
10162
10181
|
}) {
|
|
10163
|
-
return /* @__PURE__ */
|
|
10182
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10164
10183
|
Trigger2,
|
|
10165
10184
|
{
|
|
10166
10185
|
"data-slot": "select-trigger",
|
|
@@ -10171,7 +10190,7 @@ function SelectTrigger2({
|
|
|
10171
10190
|
...props
|
|
10172
10191
|
},
|
|
10173
10192
|
children,
|
|
10174
|
-
/* @__PURE__ */
|
|
10193
|
+
/* @__PURE__ */ React44.createElement(Icon2, { asChild: true }, /* @__PURE__ */ React44.createElement(ChevronDown, { className: "uii:size-4 uii:opacity-50" }))
|
|
10175
10194
|
);
|
|
10176
10195
|
}
|
|
10177
10196
|
function SelectContent2({
|
|
@@ -10183,7 +10202,7 @@ function SelectContent2({
|
|
|
10183
10202
|
hideScrollDownButton = false,
|
|
10184
10203
|
...props
|
|
10185
10204
|
}) {
|
|
10186
|
-
return /* @__PURE__ */
|
|
10205
|
+
return /* @__PURE__ */ React44.createElement(Portal3, null, /* @__PURE__ */ React44.createElement(
|
|
10187
10206
|
Content23,
|
|
10188
10207
|
{
|
|
10189
10208
|
"data-slot": "select-content",
|
|
@@ -10196,8 +10215,8 @@ function SelectContent2({
|
|
|
10196
10215
|
position,
|
|
10197
10216
|
...props
|
|
10198
10217
|
},
|
|
10199
|
-
!hideScrollUpButton && /* @__PURE__ */
|
|
10200
|
-
/* @__PURE__ */
|
|
10218
|
+
!hideScrollUpButton && /* @__PURE__ */ React44.createElement(SelectScrollUpButton2, null),
|
|
10219
|
+
/* @__PURE__ */ React44.createElement(
|
|
10201
10220
|
Viewport,
|
|
10202
10221
|
{
|
|
10203
10222
|
className: cn(
|
|
@@ -10207,8 +10226,8 @@ function SelectContent2({
|
|
|
10207
10226
|
},
|
|
10208
10227
|
children
|
|
10209
10228
|
),
|
|
10210
|
-
footer ? /* @__PURE__ */
|
|
10211
|
-
!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)
|
|
10212
10231
|
));
|
|
10213
10232
|
}
|
|
10214
10233
|
function SelectItem2({
|
|
@@ -10216,7 +10235,7 @@ function SelectItem2({
|
|
|
10216
10235
|
children,
|
|
10217
10236
|
...props
|
|
10218
10237
|
}) {
|
|
10219
|
-
return /* @__PURE__ */
|
|
10238
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10220
10239
|
Item3,
|
|
10221
10240
|
{
|
|
10222
10241
|
"data-slot": "select-item",
|
|
@@ -10226,15 +10245,15 @@ function SelectItem2({
|
|
|
10226
10245
|
),
|
|
10227
10246
|
...props
|
|
10228
10247
|
},
|
|
10229
|
-
/* @__PURE__ */
|
|
10230
|
-
/* @__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)
|
|
10231
10250
|
);
|
|
10232
10251
|
}
|
|
10233
10252
|
function SelectScrollUpButton2({
|
|
10234
10253
|
className,
|
|
10235
10254
|
...props
|
|
10236
10255
|
}) {
|
|
10237
|
-
return /* @__PURE__ */
|
|
10256
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10238
10257
|
ScrollUpButton,
|
|
10239
10258
|
{
|
|
10240
10259
|
"data-slot": "select-scroll-up-button",
|
|
@@ -10244,14 +10263,14 @@ function SelectScrollUpButton2({
|
|
|
10244
10263
|
),
|
|
10245
10264
|
...props
|
|
10246
10265
|
},
|
|
10247
|
-
/* @__PURE__ */
|
|
10266
|
+
/* @__PURE__ */ React44.createElement(ChevronUp, { className: "uii:size-4" })
|
|
10248
10267
|
);
|
|
10249
10268
|
}
|
|
10250
10269
|
function SelectScrollDownButton2({
|
|
10251
10270
|
className,
|
|
10252
10271
|
...props
|
|
10253
10272
|
}) {
|
|
10254
|
-
return /* @__PURE__ */
|
|
10273
|
+
return /* @__PURE__ */ React44.createElement(
|
|
10255
10274
|
ScrollDownButton,
|
|
10256
10275
|
{
|
|
10257
10276
|
"data-slot": "select-scroll-down-button",
|
|
@@ -10261,14 +10280,14 @@ function SelectScrollDownButton2({
|
|
|
10261
10280
|
),
|
|
10262
10281
|
...props
|
|
10263
10282
|
},
|
|
10264
|
-
/* @__PURE__ */
|
|
10283
|
+
/* @__PURE__ */ React44.createElement(ChevronDown, { className: "uii:size-4" })
|
|
10265
10284
|
);
|
|
10266
10285
|
}
|
|
10267
10286
|
|
|
10268
10287
|
// src/components/fields/Select.tsx
|
|
10269
10288
|
function useResolvedExpectedType2(expectedType, devCtx) {
|
|
10270
10289
|
const inferredTypes = devCtx?.inferredTypes;
|
|
10271
|
-
return
|
|
10290
|
+
return React44.useMemo(() => {
|
|
10272
10291
|
if (!expectedType) return "any";
|
|
10273
10292
|
if (!expectedType.startsWith("$infer<")) {
|
|
10274
10293
|
return expectedType;
|
|
@@ -10315,36 +10334,36 @@ function Select3({
|
|
|
10315
10334
|
}) {
|
|
10316
10335
|
const devCtx = useContext(DevContext);
|
|
10317
10336
|
const resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
|
|
10318
|
-
const [isExpressionMode, setIsExpressionMode] =
|
|
10319
|
-
const [expressionValue, setExpressionValue] =
|
|
10320
|
-
const options =
|
|
10337
|
+
const [isExpressionMode, setIsExpressionMode] = React44.useState(false);
|
|
10338
|
+
const [expressionValue, setExpressionValue] = React44.useState("");
|
|
10339
|
+
const options = React44.useMemo(() => {
|
|
10321
10340
|
return rawOptions.map(
|
|
10322
10341
|
(opt) => typeof opt === "string" ? { value: opt, label: opt } : opt
|
|
10323
10342
|
);
|
|
10324
10343
|
}, [rawOptions]);
|
|
10325
|
-
const displayValue =
|
|
10344
|
+
const displayValue = React44.useMemo(() => {
|
|
10326
10345
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
10327
10346
|
return String(value.expression ?? "");
|
|
10328
10347
|
}
|
|
10329
10348
|
return String(value ?? "");
|
|
10330
10349
|
}, [value]);
|
|
10331
|
-
const isExpression =
|
|
10350
|
+
const isExpression = React44.useMemo(() => {
|
|
10332
10351
|
return value && typeof value === "object" && "expression" in value;
|
|
10333
10352
|
}, [value]);
|
|
10334
|
-
|
|
10353
|
+
React44.useEffect(() => {
|
|
10335
10354
|
if (isExpression) {
|
|
10336
10355
|
setIsExpressionMode(true);
|
|
10337
10356
|
setExpressionValue(displayValue);
|
|
10338
10357
|
}
|
|
10339
10358
|
}, [isExpression, displayValue]);
|
|
10340
|
-
const handleSelectChange =
|
|
10359
|
+
const handleSelectChange = React44.useCallback((newValue) => {
|
|
10341
10360
|
if (newValue === "__expression__") {
|
|
10342
10361
|
setIsExpressionMode(true);
|
|
10343
10362
|
return;
|
|
10344
10363
|
}
|
|
10345
10364
|
onChange(newValue);
|
|
10346
10365
|
}, [onChange]);
|
|
10347
|
-
const handleExpressionChange =
|
|
10366
|
+
const handleExpressionChange = React44.useCallback((e) => {
|
|
10348
10367
|
const newValue = e.target.value;
|
|
10349
10368
|
setExpressionValue(newValue);
|
|
10350
10369
|
onChange({
|
|
@@ -10352,7 +10371,7 @@ function Select3({
|
|
|
10352
10371
|
type: "expression"
|
|
10353
10372
|
});
|
|
10354
10373
|
}, [onChange]);
|
|
10355
|
-
const handleSwitchToValue =
|
|
10374
|
+
const handleSwitchToValue = React44.useCallback(() => {
|
|
10356
10375
|
setIsExpressionMode(false);
|
|
10357
10376
|
setExpressionValue("");
|
|
10358
10377
|
onChange("");
|
|
@@ -10381,7 +10400,7 @@ function Select3({
|
|
|
10381
10400
|
hasError: showError
|
|
10382
10401
|
};
|
|
10383
10402
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
10384
|
-
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(
|
|
10385
10404
|
"label",
|
|
10386
10405
|
{
|
|
10387
10406
|
htmlFor: fieldName,
|
|
@@ -10389,7 +10408,7 @@ function Select3({
|
|
|
10389
10408
|
},
|
|
10390
10409
|
label,
|
|
10391
10410
|
":"
|
|
10392
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
10411
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React44.createElement(
|
|
10393
10412
|
"span",
|
|
10394
10413
|
{
|
|
10395
10414
|
className: cn(
|
|
@@ -10399,12 +10418,12 @@ function Select3({
|
|
|
10399
10418
|
title: resolvedExpectedType
|
|
10400
10419
|
},
|
|
10401
10420
|
resolvedExpectedType
|
|
10402
|
-
), 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 ? (
|
|
10403
10422
|
// Use custom render function
|
|
10404
10423
|
children(renderProps)
|
|
10405
10424
|
) : isExpressionMode ? (
|
|
10406
10425
|
// Expression mode - show input with clear button
|
|
10407
|
-
/* @__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(
|
|
10408
10427
|
"input",
|
|
10409
10428
|
{
|
|
10410
10429
|
id: fieldName,
|
|
@@ -10420,7 +10439,7 @@ function Select3({
|
|
|
10420
10439
|
disabled && "uii:opacity-50 uii:cursor-not-allowed"
|
|
10421
10440
|
)
|
|
10422
10441
|
}
|
|
10423
|
-
), /* @__PURE__ */
|
|
10442
|
+
), /* @__PURE__ */ React44.createElement(
|
|
10424
10443
|
"button",
|
|
10425
10444
|
{
|
|
10426
10445
|
type: "button",
|
|
@@ -10462,21 +10481,21 @@ function Select3({
|
|
|
10462
10481
|
// 📝 Custom Expression
|
|
10463
10482
|
// </option>
|
|
10464
10483
|
// </select>
|
|
10465
|
-
/* @__PURE__ */
|
|
10484
|
+
/* @__PURE__ */ React44.createElement(
|
|
10466
10485
|
Select2,
|
|
10467
10486
|
{
|
|
10468
10487
|
value: displayValue,
|
|
10469
10488
|
onValueChange: (e) => handleSelectChange(e),
|
|
10470
10489
|
disabled: disabled ?? disabled
|
|
10471
10490
|
},
|
|
10472
|
-
/* @__PURE__ */
|
|
10491
|
+
/* @__PURE__ */ React44.createElement(
|
|
10473
10492
|
SelectTrigger2,
|
|
10474
10493
|
{
|
|
10475
10494
|
className: "ui:w-full ui:h-9 ui:px-3 ui:border ui:border-input ui:rounded-sm ui:bg-background"
|
|
10476
10495
|
},
|
|
10477
|
-
/* @__PURE__ */
|
|
10496
|
+
/* @__PURE__ */ React44.createElement(SelectValue2, { placeholder })
|
|
10478
10497
|
),
|
|
10479
|
-
/* @__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))))
|
|
10480
10499
|
)
|
|
10481
10500
|
)));
|
|
10482
10501
|
}
|
|
@@ -10607,12 +10626,12 @@ function useFieldPath(fieldName) {
|
|
|
10607
10626
|
return fieldName;
|
|
10608
10627
|
}
|
|
10609
10628
|
function TemplateFieldProvider({ children }) {
|
|
10610
|
-
return /* @__PURE__ */
|
|
10629
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10611
10630
|
}
|
|
10612
10631
|
function NestedFieldProvider({
|
|
10613
10632
|
children
|
|
10614
10633
|
}) {
|
|
10615
|
-
return /* @__PURE__ */
|
|
10634
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10616
10635
|
}
|
|
10617
10636
|
var InferredTypesContext = createContext(null);
|
|
10618
10637
|
function useInferredTypes() {
|
|
@@ -10630,7 +10649,7 @@ function useInferredTypes() {
|
|
|
10630
10649
|
return realContext;
|
|
10631
10650
|
}
|
|
10632
10651
|
function InferredTypesProvider({ children }) {
|
|
10633
|
-
return /* @__PURE__ */
|
|
10652
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10634
10653
|
}
|
|
10635
10654
|
function intersectTypes(types) {
|
|
10636
10655
|
const validTypes = types.filter((t) => !!t && t.length > 0);
|
|
@@ -10691,7 +10710,7 @@ function getOperatorsForType(type) {
|
|
|
10691
10710
|
];
|
|
10692
10711
|
}
|
|
10693
10712
|
function NodePropertyProvider({ children }) {
|
|
10694
|
-
return /* @__PURE__ */
|
|
10713
|
+
return /* @__PURE__ */ React44__default.createElement(React44__default.Fragment, null, children);
|
|
10695
10714
|
}
|
|
10696
10715
|
function useSetFieldMetadataOnly() {
|
|
10697
10716
|
return useCallback((_fieldKey, _metadata) => {
|
|
@@ -10706,7 +10725,7 @@ function useNodeProperty(key) {
|
|
|
10706
10725
|
const [devValue, setDevValue] = useState(
|
|
10707
10726
|
() => devContext?.data?.[key]
|
|
10708
10727
|
);
|
|
10709
|
-
|
|
10728
|
+
React44__default.useEffect(() => {
|
|
10710
10729
|
if (devContext) {
|
|
10711
10730
|
setDevValue(devContext.data[key]);
|
|
10712
10731
|
}
|
|
@@ -10730,7 +10749,7 @@ function useNodeProperties() {
|
|
|
10730
10749
|
const [devData, setDevData] = useState(
|
|
10731
10750
|
() => devContext?.data ?? {}
|
|
10732
10751
|
);
|
|
10733
|
-
|
|
10752
|
+
React44__default.useEffect(() => {
|
|
10734
10753
|
if (devContext) {
|
|
10735
10754
|
setDevData({ ...devContext.data });
|
|
10736
10755
|
}
|
|
@@ -10756,7 +10775,7 @@ function useInferredType(fieldName) {
|
|
|
10756
10775
|
const [devInferredType, setDevInferredType] = useState(
|
|
10757
10776
|
() => devContext?.inferredTypes?.[fieldName]
|
|
10758
10777
|
);
|
|
10759
|
-
|
|
10778
|
+
React44__default.useEffect(() => {
|
|
10760
10779
|
if (devContext) {
|
|
10761
10780
|
setDevInferredType(devContext.inferredTypes[fieldName]);
|
|
10762
10781
|
}
|
|
@@ -10818,7 +10837,7 @@ function useAllInferredTypes() {
|
|
|
10818
10837
|
const [devTypes, setDevTypes] = useState(
|
|
10819
10838
|
() => devContext?.inferredTypes ?? {}
|
|
10820
10839
|
);
|
|
10821
|
-
|
|
10840
|
+
React44__default.useEffect(() => {
|
|
10822
10841
|
if (devContext) {
|
|
10823
10842
|
setDevTypes({ ...devContext.inferredTypes });
|
|
10824
10843
|
}
|
|
@@ -10902,6 +10921,6 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
10902
10921
|
*)
|
|
10903
10922
|
*/
|
|
10904
10923
|
|
|
10905
|
-
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 };
|
|
10906
10925
|
//# sourceMappingURL=index.js.map
|
|
10907
10926
|
//# sourceMappingURL=index.js.map
|