@process.co/ui 0.0.18 → 0.0.20
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 +22 -0
- package/dist/components/fields/index.cjs +12 -19
- package/dist/components/fields/index.cjs.map +1 -1
- package/dist/components/fields/index.js +12 -19
- package/dist/components/fields/index.js.map +1 -1
- package/dist/components/slots/index.cjs +3286 -0
- package/dist/components/slots/index.cjs.map +1 -0
- package/dist/components/slots/index.d.cts +2 -0
- package/dist/components/slots/index.d.ts +2 -0
- package/dist/components/slots/index.js +3263 -0
- package/dist/components/slots/index.js.map +1 -0
- package/dist/index-DeN5zh8_.d.cts +21 -0
- package/dist/index-DeN5zh8_.d.ts +21 -0
- package/dist/index.cjs +461 -448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +417 -405
- package/dist/index.js.map +1 -1
- package/package.json +11 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React45 from 'react';
|
|
2
|
+
import React45__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 React45.useCallback(composeRefs(...refs), refs);
|
|
45
45
|
}
|
|
46
46
|
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
47
|
-
var use =
|
|
47
|
+
var use = React45[" 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 = React45.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 = React45.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 (React45.Children.count(newElement) > 1) return React45.Children.only(null);
|
|
69
|
+
return React45.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: React45.isValidElement(newElement) ? React45.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 = React45.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 (React45.isValidElement(children)) {
|
|
90
90
|
const childrenRef = getElementRef(children);
|
|
91
91
|
const props2 = mergeProps(slotProps, children.props);
|
|
92
|
-
if (children.type !==
|
|
92
|
+
if (children.type !== React45.Fragment) {
|
|
93
93
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
94
94
|
}
|
|
95
|
-
return
|
|
95
|
+
return React45.cloneElement(children, props2);
|
|
96
96
|
}
|
|
97
|
-
return
|
|
97
|
+
return React45.Children.count(children) > 1 ? React45.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 React45.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__ */ React45.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 ? React45.useLayoutEffect : () => {
|
|
3269
3269
|
};
|
|
3270
|
-
var useInsertionEffect =
|
|
3270
|
+
var useInsertionEffect = React45[" 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 = React45.useRef(prop !== void 0);
|
|
3286
|
+
React45.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 = React45.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] = React45.useState(defaultProp);
|
|
3318
|
+
const prevValueRef = React45.useRef(value);
|
|
3319
|
+
const onChangeRef = React45.useRef(onChange);
|
|
3320
3320
|
useInsertionEffect(() => {
|
|
3321
3321
|
onChangeRef.current = onChange;
|
|
3322
3322
|
}, [onChange]);
|
|
3323
|
-
|
|
3323
|
+
React45.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 = React45.forwardRef((props, forwardedRef) => {
|
|
3338
3338
|
const { children, ...slotProps } = props;
|
|
3339
|
-
const childrenArray =
|
|
3339
|
+
const childrenArray = React45.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 (React45.Children.count(newElement) > 1) return React45.Children.only(null);
|
|
3346
|
+
return React45.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: React45.isValidElement(newElement) ? React45.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 = React45.forwardRef((props, forwardedRef) => {
|
|
3361
3361
|
const { children, ...slotProps } = props;
|
|
3362
|
-
if (
|
|
3362
|
+
if (React45.isValidElement(children)) {
|
|
3363
3363
|
const childrenRef = getElementRef2(children);
|
|
3364
3364
|
const props2 = mergeProps2(slotProps, children.props);
|
|
3365
|
-
if (children.type !==
|
|
3365
|
+
if (children.type !== React45.Fragment) {
|
|
3366
3366
|
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
3367
3367
|
}
|
|
3368
|
-
return
|
|
3368
|
+
return React45.cloneElement(children, props2);
|
|
3369
3369
|
}
|
|
3370
|
-
return
|
|
3370
|
+
return React45.Children.count(children) > 1 ? React45.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 React45.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 = React45.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 = React45.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__ */ React45.createElement(
|
|
3507
3507
|
Root,
|
|
3508
3508
|
{
|
|
3509
3509
|
"data-slot": "toggle-button",
|
|
@@ -3519,32 +3519,32 @@ var logicToggleButtonStyles = [
|
|
|
3519
3519
|
].join(" ");
|
|
3520
3520
|
var logicToggleButtonLabelStyles = "uii:inline-block uii:whitespace-nowrap uii:[transform:rotate(-90deg)]";
|
|
3521
3521
|
function LogicToggleButton({ className, children, ...props }) {
|
|
3522
|
-
return /* @__PURE__ */
|
|
3522
|
+
return /* @__PURE__ */ React45.createElement(
|
|
3523
3523
|
Root,
|
|
3524
3524
|
{
|
|
3525
3525
|
"data-slot": "logic-toggle-button",
|
|
3526
3526
|
className: cn(logicToggleButtonStyles, className),
|
|
3527
3527
|
...props
|
|
3528
3528
|
},
|
|
3529
|
-
children != null ? /* @__PURE__ */
|
|
3529
|
+
children != null ? /* @__PURE__ */ React45.createElement("span", { className: logicToggleButtonLabelStyles }, children) : null
|
|
3530
3530
|
);
|
|
3531
3531
|
}
|
|
3532
3532
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
3533
3533
|
let defaultContexts = [];
|
|
3534
3534
|
function createContext32(rootComponentName, defaultContext) {
|
|
3535
|
-
const BaseContext =
|
|
3535
|
+
const BaseContext = React45.createContext(defaultContext);
|
|
3536
3536
|
const index2 = defaultContexts.length;
|
|
3537
3537
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
3538
3538
|
const Provider = (props) => {
|
|
3539
3539
|
const { scope, children, ...context } = props;
|
|
3540
3540
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3541
|
-
const value =
|
|
3541
|
+
const value = React45.useMemo(() => context, Object.values(context));
|
|
3542
3542
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
3543
3543
|
};
|
|
3544
3544
|
Provider.displayName = rootComponentName + "Provider";
|
|
3545
3545
|
function useContext22(consumerName, scope) {
|
|
3546
3546
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3547
|
-
const context =
|
|
3547
|
+
const context = React45.useContext(Context);
|
|
3548
3548
|
if (context) return context;
|
|
3549
3549
|
if (defaultContext !== void 0) return defaultContext;
|
|
3550
3550
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -3553,11 +3553,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
3553
3553
|
}
|
|
3554
3554
|
const createScope = () => {
|
|
3555
3555
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
3556
|
-
return
|
|
3556
|
+
return React45.createContext(defaultContext);
|
|
3557
3557
|
});
|
|
3558
3558
|
return function useScope(scope) {
|
|
3559
3559
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
3560
|
-
return
|
|
3560
|
+
return React45.useMemo(
|
|
3561
3561
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
3562
3562
|
[scope, contexts]
|
|
3563
3563
|
);
|
|
@@ -3580,7 +3580,7 @@ function composeContextScopes(...scopes) {
|
|
|
3580
3580
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
3581
3581
|
return { ...nextScopes2, ...currentScope };
|
|
3582
3582
|
}, {});
|
|
3583
|
-
return
|
|
3583
|
+
return React45.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
3584
3584
|
};
|
|
3585
3585
|
};
|
|
3586
3586
|
createScope.scopeName = baseScope.scopeName;
|
|
@@ -3595,14 +3595,14 @@ function createCollection(name) {
|
|
|
3595
3595
|
);
|
|
3596
3596
|
const CollectionProvider = (props) => {
|
|
3597
3597
|
const { scope, children } = props;
|
|
3598
|
-
const ref =
|
|
3599
|
-
const itemMap =
|
|
3598
|
+
const ref = React45__default.useRef(null);
|
|
3599
|
+
const itemMap = React45__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
3600
3600
|
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
3601
3601
|
};
|
|
3602
3602
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
3603
3603
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
3604
3604
|
const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);
|
|
3605
|
-
const CollectionSlot =
|
|
3605
|
+
const CollectionSlot = React45__default.forwardRef(
|
|
3606
3606
|
(props, forwardedRef) => {
|
|
3607
3607
|
const { scope, children } = props;
|
|
3608
3608
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
@@ -3614,13 +3614,13 @@ function createCollection(name) {
|
|
|
3614
3614
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
3615
3615
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
3616
3616
|
const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);
|
|
3617
|
-
const CollectionItemSlot =
|
|
3617
|
+
const CollectionItemSlot = React45__default.forwardRef(
|
|
3618
3618
|
(props, forwardedRef) => {
|
|
3619
3619
|
const { scope, children, ...itemData } = props;
|
|
3620
|
-
const ref =
|
|
3620
|
+
const ref = React45__default.useRef(null);
|
|
3621
3621
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3622
3622
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
3623
|
-
|
|
3623
|
+
React45__default.useEffect(() => {
|
|
3624
3624
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
3625
3625
|
return () => void context.itemMap.delete(ref);
|
|
3626
3626
|
});
|
|
@@ -3630,7 +3630,7 @@ function createCollection(name) {
|
|
|
3630
3630
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
3631
3631
|
function useCollection4(scope) {
|
|
3632
3632
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
3633
|
-
const getItems =
|
|
3633
|
+
const getItems = React45__default.useCallback(() => {
|
|
3634
3634
|
const collectionNode = context.collectionRef.current;
|
|
3635
3635
|
if (!collectionNode) return [];
|
|
3636
3636
|
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
@@ -3648,21 +3648,21 @@ function createCollection(name) {
|
|
|
3648
3648
|
createCollectionScope4
|
|
3649
3649
|
];
|
|
3650
3650
|
}
|
|
3651
|
-
var DirectionContext =
|
|
3651
|
+
var DirectionContext = React45.createContext(void 0);
|
|
3652
3652
|
function useDirection(localDir) {
|
|
3653
|
-
const globalDir =
|
|
3653
|
+
const globalDir = React45.useContext(DirectionContext);
|
|
3654
3654
|
return localDir || globalDir || "ltr";
|
|
3655
3655
|
}
|
|
3656
3656
|
function useCallbackRef(callback) {
|
|
3657
|
-
const callbackRef =
|
|
3658
|
-
|
|
3657
|
+
const callbackRef = React45.useRef(callback);
|
|
3658
|
+
React45.useEffect(() => {
|
|
3659
3659
|
callbackRef.current = callback;
|
|
3660
3660
|
});
|
|
3661
|
-
return
|
|
3661
|
+
return React45.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
3662
3662
|
}
|
|
3663
3663
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
3664
3664
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
3665
|
-
|
|
3665
|
+
React45.useEffect(() => {
|
|
3666
3666
|
const handleKeyDown = (event) => {
|
|
3667
3667
|
if (event.key === "Escape") {
|
|
3668
3668
|
onEscapeKeyDown(event);
|
|
@@ -3677,12 +3677,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
3677
3677
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3678
3678
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3679
3679
|
var originalBodyPointerEvents;
|
|
3680
|
-
var DismissableLayerContext =
|
|
3680
|
+
var DismissableLayerContext = React45.createContext({
|
|
3681
3681
|
layers: /* @__PURE__ */ new Set(),
|
|
3682
3682
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3683
3683
|
branches: /* @__PURE__ */ new Set()
|
|
3684
3684
|
});
|
|
3685
|
-
var DismissableLayer =
|
|
3685
|
+
var DismissableLayer = React45.forwardRef(
|
|
3686
3686
|
(props, forwardedRef) => {
|
|
3687
3687
|
const {
|
|
3688
3688
|
disableOutsidePointerEvents = false,
|
|
@@ -3693,10 +3693,10 @@ var DismissableLayer = React44.forwardRef(
|
|
|
3693
3693
|
onDismiss,
|
|
3694
3694
|
...layerProps
|
|
3695
3695
|
} = props;
|
|
3696
|
-
const context =
|
|
3697
|
-
const [node, setNode] =
|
|
3696
|
+
const context = React45.useContext(DismissableLayerContext);
|
|
3697
|
+
const [node, setNode] = React45.useState(null);
|
|
3698
3698
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3699
|
-
const [, force] =
|
|
3699
|
+
const [, force] = React45.useState({});
|
|
3700
3700
|
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3701
3701
|
const layers = Array.from(context.layers);
|
|
3702
3702
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
@@ -3729,7 +3729,7 @@ var DismissableLayer = React44.forwardRef(
|
|
|
3729
3729
|
onDismiss();
|
|
3730
3730
|
}
|
|
3731
3731
|
}, ownerDocument);
|
|
3732
|
-
|
|
3732
|
+
React45.useEffect(() => {
|
|
3733
3733
|
if (!node) return;
|
|
3734
3734
|
if (disableOutsidePointerEvents) {
|
|
3735
3735
|
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
@@ -3746,7 +3746,7 @@ var DismissableLayer = React44.forwardRef(
|
|
|
3746
3746
|
}
|
|
3747
3747
|
};
|
|
3748
3748
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
3749
|
-
|
|
3749
|
+
React45.useEffect(() => {
|
|
3750
3750
|
return () => {
|
|
3751
3751
|
if (!node) return;
|
|
3752
3752
|
context.layers.delete(node);
|
|
@@ -3754,7 +3754,7 @@ var DismissableLayer = React44.forwardRef(
|
|
|
3754
3754
|
dispatchUpdate();
|
|
3755
3755
|
};
|
|
3756
3756
|
}, [node, context]);
|
|
3757
|
-
|
|
3757
|
+
React45.useEffect(() => {
|
|
3758
3758
|
const handleUpdate = () => force({});
|
|
3759
3759
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3760
3760
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
@@ -3780,11 +3780,11 @@ var DismissableLayer = React44.forwardRef(
|
|
|
3780
3780
|
);
|
|
3781
3781
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3782
3782
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3783
|
-
var DismissableLayerBranch =
|
|
3784
|
-
const context =
|
|
3785
|
-
const ref =
|
|
3783
|
+
var DismissableLayerBranch = React45.forwardRef((props, forwardedRef) => {
|
|
3784
|
+
const context = React45.useContext(DismissableLayerContext);
|
|
3785
|
+
const ref = React45.useRef(null);
|
|
3786
3786
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3787
|
-
|
|
3787
|
+
React45.useEffect(() => {
|
|
3788
3788
|
const node = ref.current;
|
|
3789
3789
|
if (node) {
|
|
3790
3790
|
context.branches.add(node);
|
|
@@ -3798,10 +3798,10 @@ var DismissableLayerBranch = React44.forwardRef((props, forwardedRef) => {
|
|
|
3798
3798
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3799
3799
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
3800
3800
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3801
|
-
const isPointerInsideReactTreeRef =
|
|
3802
|
-
const handleClickRef =
|
|
3801
|
+
const isPointerInsideReactTreeRef = React45.useRef(false);
|
|
3802
|
+
const handleClickRef = React45.useRef(() => {
|
|
3803
3803
|
});
|
|
3804
|
-
|
|
3804
|
+
React45.useEffect(() => {
|
|
3805
3805
|
const handlePointerDown = (event) => {
|
|
3806
3806
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3807
3807
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -3841,8 +3841,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
3841
3841
|
}
|
|
3842
3842
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3843
3843
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3844
|
-
const isFocusInsideReactTreeRef =
|
|
3845
|
-
|
|
3844
|
+
const isFocusInsideReactTreeRef = React45.useRef(false);
|
|
3845
|
+
React45.useEffect(() => {
|
|
3846
3846
|
const handleFocus = (event) => {
|
|
3847
3847
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
3848
3848
|
const eventDetail = { originalEvent: event };
|
|
@@ -3875,7 +3875,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
3875
3875
|
}
|
|
3876
3876
|
var count = 0;
|
|
3877
3877
|
function useFocusGuards() {
|
|
3878
|
-
|
|
3878
|
+
React45.useEffect(() => {
|
|
3879
3879
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
3880
3880
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
3881
3881
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
@@ -3902,7 +3902,7 @@ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
|
3902
3902
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
3903
3903
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
3904
3904
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
3905
|
-
var FocusScope =
|
|
3905
|
+
var FocusScope = React45.forwardRef((props, forwardedRef) => {
|
|
3906
3906
|
const {
|
|
3907
3907
|
loop = false,
|
|
3908
3908
|
trapped = false,
|
|
@@ -3910,12 +3910,12 @@ var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
|
3910
3910
|
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
3911
3911
|
...scopeProps
|
|
3912
3912
|
} = props;
|
|
3913
|
-
const [container, setContainer] =
|
|
3913
|
+
const [container, setContainer] = React45.useState(null);
|
|
3914
3914
|
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
3915
3915
|
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
3916
|
-
const lastFocusedElementRef =
|
|
3916
|
+
const lastFocusedElementRef = React45.useRef(null);
|
|
3917
3917
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
3918
|
-
const focusScope =
|
|
3918
|
+
const focusScope = React45.useRef({
|
|
3919
3919
|
paused: false,
|
|
3920
3920
|
pause() {
|
|
3921
3921
|
this.paused = true;
|
|
@@ -3924,7 +3924,7 @@ var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
|
3924
3924
|
this.paused = false;
|
|
3925
3925
|
}
|
|
3926
3926
|
}).current;
|
|
3927
|
-
|
|
3927
|
+
React45.useEffect(() => {
|
|
3928
3928
|
if (trapped) {
|
|
3929
3929
|
let handleFocusIn2 = function(event) {
|
|
3930
3930
|
if (focusScope.paused || !container) return;
|
|
@@ -3959,7 +3959,7 @@ var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
|
3959
3959
|
};
|
|
3960
3960
|
}
|
|
3961
3961
|
}, [trapped, container, focusScope.paused]);
|
|
3962
|
-
|
|
3962
|
+
React45.useEffect(() => {
|
|
3963
3963
|
if (container) {
|
|
3964
3964
|
focusScopesStack.add(focusScope);
|
|
3965
3965
|
const previouslyFocusedElement = document.activeElement;
|
|
@@ -3990,7 +3990,7 @@ var FocusScope = React44.forwardRef((props, forwardedRef) => {
|
|
|
3990
3990
|
};
|
|
3991
3991
|
}
|
|
3992
3992
|
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
3993
|
-
const handleKeyDown =
|
|
3993
|
+
const handleKeyDown = React45.useCallback(
|
|
3994
3994
|
(event) => {
|
|
3995
3995
|
if (!loop && !trapped) return;
|
|
3996
3996
|
if (focusScope.paused) return;
|
|
@@ -4097,10 +4097,10 @@ function arrayRemove(array, item) {
|
|
|
4097
4097
|
function removeLinks(items) {
|
|
4098
4098
|
return items.filter((item) => item.tagName !== "A");
|
|
4099
4099
|
}
|
|
4100
|
-
var useReactId =
|
|
4100
|
+
var useReactId = React45[" useId ".trim().toString()] || (() => void 0);
|
|
4101
4101
|
var count2 = 0;
|
|
4102
4102
|
function useId(deterministicId) {
|
|
4103
|
-
const [id, setId] =
|
|
4103
|
+
const [id, setId] = React45.useState(useReactId());
|
|
4104
4104
|
useLayoutEffect2(() => {
|
|
4105
4105
|
setId((reactId) => reactId ?? String(count2++));
|
|
4106
4106
|
}, [deterministicId]);
|
|
@@ -5775,7 +5775,7 @@ function roundByDPR(element, value) {
|
|
|
5775
5775
|
return Math.round(value * dpr) / dpr;
|
|
5776
5776
|
}
|
|
5777
5777
|
function useLatestRef(value) {
|
|
5778
|
-
const ref =
|
|
5778
|
+
const ref = React45.useRef(value);
|
|
5779
5779
|
index(() => {
|
|
5780
5780
|
ref.current = value;
|
|
5781
5781
|
});
|
|
@@ -5798,7 +5798,7 @@ function useFloating(options) {
|
|
|
5798
5798
|
whileElementsMounted,
|
|
5799
5799
|
open
|
|
5800
5800
|
} = options;
|
|
5801
|
-
const [data, setData] =
|
|
5801
|
+
const [data, setData] = React45.useState({
|
|
5802
5802
|
x: 0,
|
|
5803
5803
|
y: 0,
|
|
5804
5804
|
strategy,
|
|
@@ -5806,19 +5806,19 @@ function useFloating(options) {
|
|
|
5806
5806
|
middlewareData: {},
|
|
5807
5807
|
isPositioned: false
|
|
5808
5808
|
});
|
|
5809
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
5809
|
+
const [latestMiddleware, setLatestMiddleware] = React45.useState(middleware);
|
|
5810
5810
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
5811
5811
|
setLatestMiddleware(middleware);
|
|
5812
5812
|
}
|
|
5813
|
-
const [_reference, _setReference] =
|
|
5814
|
-
const [_floating, _setFloating] =
|
|
5815
|
-
const setReference =
|
|
5813
|
+
const [_reference, _setReference] = React45.useState(null);
|
|
5814
|
+
const [_floating, _setFloating] = React45.useState(null);
|
|
5815
|
+
const setReference = React45.useCallback((node) => {
|
|
5816
5816
|
if (node !== referenceRef.current) {
|
|
5817
5817
|
referenceRef.current = node;
|
|
5818
5818
|
_setReference(node);
|
|
5819
5819
|
}
|
|
5820
5820
|
}, []);
|
|
5821
|
-
const setFloating =
|
|
5821
|
+
const setFloating = React45.useCallback((node) => {
|
|
5822
5822
|
if (node !== floatingRef.current) {
|
|
5823
5823
|
floatingRef.current = node;
|
|
5824
5824
|
_setFloating(node);
|
|
@@ -5826,14 +5826,14 @@ function useFloating(options) {
|
|
|
5826
5826
|
}, []);
|
|
5827
5827
|
const referenceEl = externalReference || _reference;
|
|
5828
5828
|
const floatingEl = externalFloating || _floating;
|
|
5829
|
-
const referenceRef =
|
|
5830
|
-
const floatingRef =
|
|
5831
|
-
const dataRef =
|
|
5829
|
+
const referenceRef = React45.useRef(null);
|
|
5830
|
+
const floatingRef = React45.useRef(null);
|
|
5831
|
+
const dataRef = React45.useRef(data);
|
|
5832
5832
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
5833
5833
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
5834
5834
|
const platformRef = useLatestRef(platform2);
|
|
5835
5835
|
const openRef = useLatestRef(open);
|
|
5836
|
-
const update =
|
|
5836
|
+
const update = React45.useCallback(() => {
|
|
5837
5837
|
if (!referenceRef.current || !floatingRef.current) {
|
|
5838
5838
|
return;
|
|
5839
5839
|
}
|
|
@@ -5871,7 +5871,7 @@ function useFloating(options) {
|
|
|
5871
5871
|
}));
|
|
5872
5872
|
}
|
|
5873
5873
|
}, [open]);
|
|
5874
|
-
const isMountedRef =
|
|
5874
|
+
const isMountedRef = React45.useRef(false);
|
|
5875
5875
|
index(() => {
|
|
5876
5876
|
isMountedRef.current = true;
|
|
5877
5877
|
return () => {
|
|
@@ -5888,17 +5888,17 @@ function useFloating(options) {
|
|
|
5888
5888
|
update();
|
|
5889
5889
|
}
|
|
5890
5890
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
5891
|
-
const refs =
|
|
5891
|
+
const refs = React45.useMemo(() => ({
|
|
5892
5892
|
reference: referenceRef,
|
|
5893
5893
|
floating: floatingRef,
|
|
5894
5894
|
setReference,
|
|
5895
5895
|
setFloating
|
|
5896
5896
|
}), [setReference, setFloating]);
|
|
5897
|
-
const elements =
|
|
5897
|
+
const elements = React45.useMemo(() => ({
|
|
5898
5898
|
reference: referenceEl,
|
|
5899
5899
|
floating: floatingEl
|
|
5900
5900
|
}), [referenceEl, floatingEl]);
|
|
5901
|
-
const floatingStyles =
|
|
5901
|
+
const floatingStyles = React45.useMemo(() => {
|
|
5902
5902
|
const initialStyles = {
|
|
5903
5903
|
position: strategy,
|
|
5904
5904
|
left: 0,
|
|
@@ -5924,7 +5924,7 @@ function useFloating(options) {
|
|
|
5924
5924
|
top: y
|
|
5925
5925
|
};
|
|
5926
5926
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
5927
|
-
return
|
|
5927
|
+
return React45.useMemo(() => ({
|
|
5928
5928
|
...data,
|
|
5929
5929
|
update,
|
|
5930
5930
|
refs,
|
|
@@ -5992,7 +5992,7 @@ var arrow3 = (options, deps) => ({
|
|
|
5992
5992
|
options: [options, deps]
|
|
5993
5993
|
});
|
|
5994
5994
|
var NAME2 = "Arrow";
|
|
5995
|
-
var Arrow =
|
|
5995
|
+
var Arrow = React45.forwardRef((props, forwardedRef) => {
|
|
5996
5996
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5997
5997
|
return /* @__PURE__ */ jsx(
|
|
5998
5998
|
Primitive.svg,
|
|
@@ -6010,7 +6010,7 @@ var Arrow = React44.forwardRef((props, forwardedRef) => {
|
|
|
6010
6010
|
Arrow.displayName = NAME2;
|
|
6011
6011
|
var Root2 = Arrow;
|
|
6012
6012
|
function useSize(element) {
|
|
6013
|
-
const [size4, setSize] =
|
|
6013
|
+
const [size4, setSize] = React45.useState(void 0);
|
|
6014
6014
|
useLayoutEffect2(() => {
|
|
6015
6015
|
if (element) {
|
|
6016
6016
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
@@ -6048,19 +6048,19 @@ var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
|
6048
6048
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
6049
6049
|
var Popper = (props) => {
|
|
6050
6050
|
const { __scopePopper, children } = props;
|
|
6051
|
-
const [anchor, setAnchor] =
|
|
6051
|
+
const [anchor, setAnchor] = React45.useState(null);
|
|
6052
6052
|
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
6053
6053
|
};
|
|
6054
6054
|
Popper.displayName = POPPER_NAME;
|
|
6055
6055
|
var ANCHOR_NAME = "PopperAnchor";
|
|
6056
|
-
var PopperAnchor =
|
|
6056
|
+
var PopperAnchor = React45.forwardRef(
|
|
6057
6057
|
(props, forwardedRef) => {
|
|
6058
6058
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
6059
6059
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
6060
|
-
const ref =
|
|
6060
|
+
const ref = React45.useRef(null);
|
|
6061
6061
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6062
|
-
const anchorRef =
|
|
6063
|
-
|
|
6062
|
+
const anchorRef = React45.useRef(null);
|
|
6063
|
+
React45.useEffect(() => {
|
|
6064
6064
|
const previousAnchor = anchorRef.current;
|
|
6065
6065
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
6066
6066
|
if (previousAnchor !== anchorRef.current) {
|
|
@@ -6073,7 +6073,7 @@ var PopperAnchor = React44.forwardRef(
|
|
|
6073
6073
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
6074
6074
|
var CONTENT_NAME = "PopperContent";
|
|
6075
6075
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
6076
|
-
var PopperContent =
|
|
6076
|
+
var PopperContent = React45.forwardRef(
|
|
6077
6077
|
(props, forwardedRef) => {
|
|
6078
6078
|
const {
|
|
6079
6079
|
__scopePopper,
|
|
@@ -6092,9 +6092,9 @@ var PopperContent = React44.forwardRef(
|
|
|
6092
6092
|
...contentProps
|
|
6093
6093
|
} = props;
|
|
6094
6094
|
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
6095
|
-
const [content, setContent] =
|
|
6095
|
+
const [content, setContent] = React45.useState(null);
|
|
6096
6096
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
6097
|
-
const [arrow4, setArrow] =
|
|
6097
|
+
const [arrow4, setArrow] = React45.useState(null);
|
|
6098
6098
|
const arrowSize = useSize(arrow4);
|
|
6099
6099
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
6100
6100
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -6156,7 +6156,7 @@ var PopperContent = React44.forwardRef(
|
|
|
6156
6156
|
const arrowX = middlewareData.arrow?.x;
|
|
6157
6157
|
const arrowY = middlewareData.arrow?.y;
|
|
6158
6158
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
6159
|
-
const [contentZIndex, setContentZIndex] =
|
|
6159
|
+
const [contentZIndex, setContentZIndex] = React45.useState();
|
|
6160
6160
|
useLayoutEffect2(() => {
|
|
6161
6161
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
6162
6162
|
}, [content]);
|
|
@@ -6222,7 +6222,7 @@ var OPPOSITE_SIDE = {
|
|
|
6222
6222
|
bottom: "top",
|
|
6223
6223
|
left: "right"
|
|
6224
6224
|
};
|
|
6225
|
-
var PopperArrow =
|
|
6225
|
+
var PopperArrow = React45.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
6226
6226
|
const { __scopePopper, ...arrowProps } = props;
|
|
6227
6227
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
6228
6228
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -6313,16 +6313,16 @@ var Anchor = PopperAnchor;
|
|
|
6313
6313
|
var Content = PopperContent;
|
|
6314
6314
|
var Arrow2 = PopperArrow;
|
|
6315
6315
|
var PORTAL_NAME = "Portal";
|
|
6316
|
-
var Portal =
|
|
6316
|
+
var Portal = React45.forwardRef((props, forwardedRef) => {
|
|
6317
6317
|
const { container: containerProp, ...portalProps } = props;
|
|
6318
|
-
const [mounted, setMounted] =
|
|
6318
|
+
const [mounted, setMounted] = React45.useState(false);
|
|
6319
6319
|
useLayoutEffect2(() => setMounted(true), []);
|
|
6320
6320
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
6321
6321
|
return container ? ReactDOM4__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
6322
6322
|
});
|
|
6323
6323
|
Portal.displayName = PORTAL_NAME;
|
|
6324
6324
|
function useStateMachine(initialState, machine) {
|
|
6325
|
-
return
|
|
6325
|
+
return React45.useReducer((state, event) => {
|
|
6326
6326
|
const nextState = machine[state][event];
|
|
6327
6327
|
return nextState ?? state;
|
|
6328
6328
|
}, initialState);
|
|
@@ -6330,17 +6330,17 @@ function useStateMachine(initialState, machine) {
|
|
|
6330
6330
|
var Presence = (props) => {
|
|
6331
6331
|
const { present, children } = props;
|
|
6332
6332
|
const presence = usePresence(present);
|
|
6333
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
6333
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React45.Children.only(children);
|
|
6334
6334
|
const ref = useComposedRefs(presence.ref, getElementRef3(child));
|
|
6335
6335
|
const forceMount = typeof children === "function";
|
|
6336
|
-
return forceMount || presence.isPresent ?
|
|
6336
|
+
return forceMount || presence.isPresent ? React45.cloneElement(child, { ref }) : null;
|
|
6337
6337
|
};
|
|
6338
6338
|
Presence.displayName = "Presence";
|
|
6339
6339
|
function usePresence(present) {
|
|
6340
|
-
const [node, setNode] =
|
|
6341
|
-
const stylesRef =
|
|
6342
|
-
const prevPresentRef =
|
|
6343
|
-
const prevAnimationNameRef =
|
|
6340
|
+
const [node, setNode] = React45.useState();
|
|
6341
|
+
const stylesRef = React45.useRef(null);
|
|
6342
|
+
const prevPresentRef = React45.useRef(present);
|
|
6343
|
+
const prevAnimationNameRef = React45.useRef("none");
|
|
6344
6344
|
const initialState = present ? "mounted" : "unmounted";
|
|
6345
6345
|
const [state, send] = useStateMachine(initialState, {
|
|
6346
6346
|
mounted: {
|
|
@@ -6355,7 +6355,7 @@ function usePresence(present) {
|
|
|
6355
6355
|
MOUNT: "mounted"
|
|
6356
6356
|
}
|
|
6357
6357
|
});
|
|
6358
|
-
|
|
6358
|
+
React45.useEffect(() => {
|
|
6359
6359
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
6360
6360
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
6361
6361
|
}, [state]);
|
|
@@ -6421,7 +6421,7 @@ function usePresence(present) {
|
|
|
6421
6421
|
}, [node, send]);
|
|
6422
6422
|
return {
|
|
6423
6423
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
6424
|
-
ref:
|
|
6424
|
+
ref: React45.useCallback((node2) => {
|
|
6425
6425
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
6426
6426
|
setNode(node2);
|
|
6427
6427
|
}, [])
|
|
@@ -6452,13 +6452,13 @@ var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContext
|
|
|
6452
6452
|
[createCollectionScope]
|
|
6453
6453
|
);
|
|
6454
6454
|
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
6455
|
-
var RovingFocusGroup =
|
|
6455
|
+
var RovingFocusGroup = React45.forwardRef(
|
|
6456
6456
|
(props, forwardedRef) => {
|
|
6457
6457
|
return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
6458
6458
|
}
|
|
6459
6459
|
);
|
|
6460
6460
|
RovingFocusGroup.displayName = GROUP_NAME;
|
|
6461
|
-
var RovingFocusGroupImpl =
|
|
6461
|
+
var RovingFocusGroupImpl = React45.forwardRef((props, forwardedRef) => {
|
|
6462
6462
|
const {
|
|
6463
6463
|
__scopeRovingFocusGroup,
|
|
6464
6464
|
orientation,
|
|
@@ -6471,7 +6471,7 @@ var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
|
6471
6471
|
preventScrollOnEntryFocus = false,
|
|
6472
6472
|
...groupProps
|
|
6473
6473
|
} = props;
|
|
6474
|
-
const ref =
|
|
6474
|
+
const ref = React45.useRef(null);
|
|
6475
6475
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6476
6476
|
const direction = useDirection(dir);
|
|
6477
6477
|
const [currentTabStopId, setCurrentTabStopId] = useControllableState({
|
|
@@ -6480,12 +6480,12 @@ var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
|
6480
6480
|
onChange: onCurrentTabStopIdChange,
|
|
6481
6481
|
caller: GROUP_NAME
|
|
6482
6482
|
});
|
|
6483
|
-
const [isTabbingBackOut, setIsTabbingBackOut] =
|
|
6483
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React45.useState(false);
|
|
6484
6484
|
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
6485
6485
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6486
|
-
const isClickFocusRef =
|
|
6487
|
-
const [focusableItemsCount, setFocusableItemsCount] =
|
|
6488
|
-
|
|
6486
|
+
const isClickFocusRef = React45.useRef(false);
|
|
6487
|
+
const [focusableItemsCount, setFocusableItemsCount] = React45.useState(0);
|
|
6488
|
+
React45.useEffect(() => {
|
|
6489
6489
|
const node = ref.current;
|
|
6490
6490
|
if (node) {
|
|
6491
6491
|
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
@@ -6500,16 +6500,16 @@ var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
|
6500
6500
|
dir: direction,
|
|
6501
6501
|
loop,
|
|
6502
6502
|
currentTabStopId,
|
|
6503
|
-
onItemFocus:
|
|
6503
|
+
onItemFocus: React45.useCallback(
|
|
6504
6504
|
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
6505
6505
|
[setCurrentTabStopId]
|
|
6506
6506
|
),
|
|
6507
|
-
onItemShiftTab:
|
|
6508
|
-
onFocusableItemAdd:
|
|
6507
|
+
onItemShiftTab: React45.useCallback(() => setIsTabbingBackOut(true), []),
|
|
6508
|
+
onFocusableItemAdd: React45.useCallback(
|
|
6509
6509
|
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
6510
6510
|
[]
|
|
6511
6511
|
),
|
|
6512
|
-
onFocusableItemRemove:
|
|
6512
|
+
onFocusableItemRemove: React45.useCallback(
|
|
6513
6513
|
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
6514
6514
|
[]
|
|
6515
6515
|
),
|
|
@@ -6549,7 +6549,7 @@ var RovingFocusGroupImpl = React44.forwardRef((props, forwardedRef) => {
|
|
|
6549
6549
|
);
|
|
6550
6550
|
});
|
|
6551
6551
|
var ITEM_NAME = "RovingFocusGroupItem";
|
|
6552
|
-
var RovingFocusGroupItem =
|
|
6552
|
+
var RovingFocusGroupItem = React45.forwardRef(
|
|
6553
6553
|
(props, forwardedRef) => {
|
|
6554
6554
|
const {
|
|
6555
6555
|
__scopeRovingFocusGroup,
|
|
@@ -6565,7 +6565,7 @@ var RovingFocusGroupItem = React44.forwardRef(
|
|
|
6565
6565
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
6566
6566
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
6567
6567
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
6568
|
-
|
|
6568
|
+
React45.useEffect(() => {
|
|
6569
6569
|
if (focusable) {
|
|
6570
6570
|
onFocusableItemAdd();
|
|
6571
6571
|
return () => onFocusableItemRemove();
|
|
@@ -6846,7 +6846,7 @@ function useCallbackRef2(initialValue, callback) {
|
|
|
6846
6846
|
ref.callback = callback;
|
|
6847
6847
|
return ref.facade;
|
|
6848
6848
|
}
|
|
6849
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ?
|
|
6849
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React45.useLayoutEffect : React45.useEffect;
|
|
6850
6850
|
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
6851
6851
|
function useMergeRefs(refs, defaultValue) {
|
|
6852
6852
|
var callbackRef = useCallbackRef2(null, function(newValue) {
|
|
@@ -6970,7 +6970,7 @@ var SideCar = function(_a) {
|
|
|
6970
6970
|
if (!Target) {
|
|
6971
6971
|
throw new Error("Sidecar medium not found");
|
|
6972
6972
|
}
|
|
6973
|
-
return
|
|
6973
|
+
return React45.createElement(Target, __assign({}, rest));
|
|
6974
6974
|
};
|
|
6975
6975
|
SideCar.isSideCarExport = true;
|
|
6976
6976
|
function exportSidecar(medium, exported) {
|
|
@@ -6985,9 +6985,9 @@ var effectCar = createSidecarMedium();
|
|
|
6985
6985
|
var nothing = function() {
|
|
6986
6986
|
return;
|
|
6987
6987
|
};
|
|
6988
|
-
var RemoveScroll =
|
|
6989
|
-
var ref =
|
|
6990
|
-
var _a =
|
|
6988
|
+
var RemoveScroll = React45.forwardRef(function(props, parentRef) {
|
|
6989
|
+
var ref = React45.useRef(null);
|
|
6990
|
+
var _a = React45.useState({
|
|
6991
6991
|
onScrollCapture: nothing,
|
|
6992
6992
|
onWheelCapture: nothing,
|
|
6993
6993
|
onTouchMoveCapture: nothing
|
|
@@ -6996,11 +6996,11 @@ var RemoveScroll = React44.forwardRef(function(props, parentRef) {
|
|
|
6996
6996
|
var SideCar2 = sideCar;
|
|
6997
6997
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
6998
6998
|
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
6999
|
-
return
|
|
7000
|
-
|
|
6999
|
+
return React45.createElement(
|
|
7000
|
+
React45.Fragment,
|
|
7001
7001
|
null,
|
|
7002
|
-
enabled &&
|
|
7003
|
-
forwardProps ?
|
|
7002
|
+
enabled && React45.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
7003
|
+
forwardProps ? React45.cloneElement(React45.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React45.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
7004
7004
|
);
|
|
7005
7005
|
});
|
|
7006
7006
|
RemoveScroll.defaultProps = {
|
|
@@ -7069,7 +7069,7 @@ var stylesheetSingleton = function() {
|
|
|
7069
7069
|
var styleHookSingleton = function() {
|
|
7070
7070
|
var sheet = stylesheetSingleton();
|
|
7071
7071
|
return function(styles, isDynamic) {
|
|
7072
|
-
|
|
7072
|
+
React45.useEffect(function() {
|
|
7073
7073
|
sheet.add(styles);
|
|
7074
7074
|
return function() {
|
|
7075
7075
|
sheet.remove();
|
|
@@ -7143,7 +7143,7 @@ var getCurrentUseCounter = function() {
|
|
|
7143
7143
|
return isFinite(counter) ? counter : 0;
|
|
7144
7144
|
};
|
|
7145
7145
|
var useLockAttribute = function() {
|
|
7146
|
-
|
|
7146
|
+
React45.useEffect(function() {
|
|
7147
7147
|
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
7148
7148
|
return function() {
|
|
7149
7149
|
var newCounter = getCurrentUseCounter() - 1;
|
|
@@ -7158,10 +7158,10 @@ var useLockAttribute = function() {
|
|
|
7158
7158
|
var RemoveScrollBar = function(_a) {
|
|
7159
7159
|
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
7160
7160
|
useLockAttribute();
|
|
7161
|
-
var gap =
|
|
7161
|
+
var gap = React45.useMemo(function() {
|
|
7162
7162
|
return getGapWidth(gapMode);
|
|
7163
7163
|
}, [gapMode]);
|
|
7164
|
-
return
|
|
7164
|
+
return React45.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
7165
7165
|
};
|
|
7166
7166
|
|
|
7167
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
|
|
@@ -7302,16 +7302,16 @@ var generateStyle = function(id) {
|
|
|
7302
7302
|
var idCounter = 0;
|
|
7303
7303
|
var lockStack = [];
|
|
7304
7304
|
function RemoveScrollSideCar(props) {
|
|
7305
|
-
var shouldPreventQueue =
|
|
7306
|
-
var touchStartRef =
|
|
7307
|
-
var activeAxis =
|
|
7308
|
-
var id =
|
|
7309
|
-
var Style2 =
|
|
7310
|
-
var lastProps =
|
|
7311
|
-
|
|
7305
|
+
var shouldPreventQueue = React45.useRef([]);
|
|
7306
|
+
var touchStartRef = React45.useRef([0, 0]);
|
|
7307
|
+
var activeAxis = React45.useRef();
|
|
7308
|
+
var id = React45.useState(idCounter++)[0];
|
|
7309
|
+
var Style2 = React45.useState(styleSingleton)[0];
|
|
7310
|
+
var lastProps = React45.useRef(props);
|
|
7311
|
+
React45.useEffect(function() {
|
|
7312
7312
|
lastProps.current = props;
|
|
7313
7313
|
}, [props]);
|
|
7314
|
-
|
|
7314
|
+
React45.useEffect(function() {
|
|
7315
7315
|
if (props.inert) {
|
|
7316
7316
|
document.body.classList.add("block-interactivity-".concat(id));
|
|
7317
7317
|
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef)).filter(Boolean);
|
|
@@ -7327,7 +7327,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7327
7327
|
}
|
|
7328
7328
|
return;
|
|
7329
7329
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
7330
|
-
var shouldCancelEvent =
|
|
7330
|
+
var shouldCancelEvent = React45.useCallback(function(event, parent) {
|
|
7331
7331
|
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
7332
7332
|
return !lastProps.current.allowPinchZoom;
|
|
7333
7333
|
}
|
|
@@ -7363,7 +7363,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7363
7363
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
7364
7364
|
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
7365
7365
|
}, []);
|
|
7366
|
-
var shouldPrevent =
|
|
7366
|
+
var shouldPrevent = React45.useCallback(function(_event) {
|
|
7367
7367
|
var event = _event;
|
|
7368
7368
|
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
7369
7369
|
return;
|
|
@@ -7390,7 +7390,7 @@ function RemoveScrollSideCar(props) {
|
|
|
7390
7390
|
}
|
|
7391
7391
|
}
|
|
7392
7392
|
}, []);
|
|
7393
|
-
var shouldCancel =
|
|
7393
|
+
var shouldCancel = React45.useCallback(function(name, delta, target, should) {
|
|
7394
7394
|
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
7395
7395
|
shouldPreventQueue.current.push(event);
|
|
7396
7396
|
setTimeout(function() {
|
|
@@ -7399,17 +7399,17 @@ function RemoveScrollSideCar(props) {
|
|
|
7399
7399
|
});
|
|
7400
7400
|
}, 1);
|
|
7401
7401
|
}, []);
|
|
7402
|
-
var scrollTouchStart =
|
|
7402
|
+
var scrollTouchStart = React45.useCallback(function(event) {
|
|
7403
7403
|
touchStartRef.current = getTouchXY(event);
|
|
7404
7404
|
activeAxis.current = void 0;
|
|
7405
7405
|
}, []);
|
|
7406
|
-
var scrollWheel =
|
|
7406
|
+
var scrollWheel = React45.useCallback(function(event) {
|
|
7407
7407
|
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7408
7408
|
}, []);
|
|
7409
|
-
var scrollTouchMove =
|
|
7409
|
+
var scrollTouchMove = React45.useCallback(function(event) {
|
|
7410
7410
|
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
7411
7411
|
}, []);
|
|
7412
|
-
|
|
7412
|
+
React45.useEffect(function() {
|
|
7413
7413
|
lockStack.push(Style2);
|
|
7414
7414
|
props.setCallbacks({
|
|
7415
7415
|
onScrollCapture: scrollWheel,
|
|
@@ -7429,11 +7429,11 @@ function RemoveScrollSideCar(props) {
|
|
|
7429
7429
|
};
|
|
7430
7430
|
}, []);
|
|
7431
7431
|
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
7432
|
-
return
|
|
7433
|
-
|
|
7432
|
+
return React45.createElement(
|
|
7433
|
+
React45.Fragment,
|
|
7434
7434
|
null,
|
|
7435
|
-
inert ?
|
|
7436
|
-
removeScrollBar ?
|
|
7435
|
+
inert ? React45.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
7436
|
+
removeScrollBar ? React45.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
7437
7437
|
);
|
|
7438
7438
|
}
|
|
7439
7439
|
function getOutermostShadowParent(node) {
|
|
@@ -7452,8 +7452,8 @@ function getOutermostShadowParent(node) {
|
|
|
7452
7452
|
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
7453
7453
|
|
|
7454
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
|
|
7455
|
-
var ReactRemoveScroll =
|
|
7456
|
-
return
|
|
7455
|
+
var ReactRemoveScroll = React45.forwardRef(function(props, ref) {
|
|
7456
|
+
return React45.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
7457
7457
|
});
|
|
7458
7458
|
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
7459
7459
|
var Combination_default = ReactRemoveScroll;
|
|
@@ -7483,11 +7483,11 @@ var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
|
7483
7483
|
var Menu = (props) => {
|
|
7484
7484
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
7485
7485
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7486
|
-
const [content, setContent] =
|
|
7487
|
-
const isUsingKeyboardRef =
|
|
7486
|
+
const [content, setContent] = React45.useState(null);
|
|
7487
|
+
const isUsingKeyboardRef = React45.useRef(false);
|
|
7488
7488
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
7489
7489
|
const direction = useDirection(dir);
|
|
7490
|
-
|
|
7490
|
+
React45.useEffect(() => {
|
|
7491
7491
|
const handleKeyDown = () => {
|
|
7492
7492
|
isUsingKeyboardRef.current = true;
|
|
7493
7493
|
document.addEventListener("pointerdown", handlePointer, { capture: true, once: true });
|
|
@@ -7513,7 +7513,7 @@ var Menu = (props) => {
|
|
|
7513
7513
|
MenuRootProvider,
|
|
7514
7514
|
{
|
|
7515
7515
|
scope: __scopeMenu,
|
|
7516
|
-
onClose:
|
|
7516
|
+
onClose: React45.useCallback(() => handleOpenChange(false), [handleOpenChange]),
|
|
7517
7517
|
isUsingKeyboardRef,
|
|
7518
7518
|
dir: direction,
|
|
7519
7519
|
modal,
|
|
@@ -7525,7 +7525,7 @@ var Menu = (props) => {
|
|
|
7525
7525
|
};
|
|
7526
7526
|
Menu.displayName = MENU_NAME;
|
|
7527
7527
|
var ANCHOR_NAME2 = "MenuAnchor";
|
|
7528
|
-
var MenuAnchor =
|
|
7528
|
+
var MenuAnchor = React45.forwardRef(
|
|
7529
7529
|
(props, forwardedRef) => {
|
|
7530
7530
|
const { __scopeMenu, ...anchorProps } = props;
|
|
7531
7531
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -7545,7 +7545,7 @@ var MenuPortal = (props) => {
|
|
|
7545
7545
|
MenuPortal.displayName = PORTAL_NAME2;
|
|
7546
7546
|
var CONTENT_NAME2 = "MenuContent";
|
|
7547
7547
|
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME2);
|
|
7548
|
-
var MenuContent =
|
|
7548
|
+
var MenuContent = React45.forwardRef(
|
|
7549
7549
|
(props, forwardedRef) => {
|
|
7550
7550
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7551
7551
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
@@ -7554,12 +7554,12 @@ var MenuContent = React44.forwardRef(
|
|
|
7554
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 }) }) }) });
|
|
7555
7555
|
}
|
|
7556
7556
|
);
|
|
7557
|
-
var MenuRootContentModal =
|
|
7557
|
+
var MenuRootContentModal = React45.forwardRef(
|
|
7558
7558
|
(props, forwardedRef) => {
|
|
7559
7559
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7560
|
-
const ref =
|
|
7560
|
+
const ref = React45.useRef(null);
|
|
7561
7561
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7562
|
-
|
|
7562
|
+
React45.useEffect(() => {
|
|
7563
7563
|
const content = ref.current;
|
|
7564
7564
|
if (content) return hideOthers(content);
|
|
7565
7565
|
}, []);
|
|
@@ -7581,7 +7581,7 @@ var MenuRootContentModal = React44.forwardRef(
|
|
|
7581
7581
|
);
|
|
7582
7582
|
}
|
|
7583
7583
|
);
|
|
7584
|
-
var MenuRootContentNonModal =
|
|
7584
|
+
var MenuRootContentNonModal = React45.forwardRef((props, forwardedRef) => {
|
|
7585
7585
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
7586
7586
|
return /* @__PURE__ */ jsx(
|
|
7587
7587
|
MenuContentImpl,
|
|
@@ -7596,7 +7596,7 @@ var MenuRootContentNonModal = React44.forwardRef((props, forwardedRef) => {
|
|
|
7596
7596
|
);
|
|
7597
7597
|
});
|
|
7598
7598
|
var Slot2 = createSlot2("MenuContent.ScrollLock");
|
|
7599
|
-
var MenuContentImpl =
|
|
7599
|
+
var MenuContentImpl = React45.forwardRef(
|
|
7600
7600
|
(props, forwardedRef) => {
|
|
7601
7601
|
const {
|
|
7602
7602
|
__scopeMenu,
|
|
@@ -7619,16 +7619,16 @@ var MenuContentImpl = React44.forwardRef(
|
|
|
7619
7619
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7620
7620
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7621
7621
|
const getItems = useCollection2(__scopeMenu);
|
|
7622
|
-
const [currentItemId, setCurrentItemId] =
|
|
7623
|
-
const contentRef =
|
|
7622
|
+
const [currentItemId, setCurrentItemId] = React45.useState(null);
|
|
7623
|
+
const contentRef = React45.useRef(null);
|
|
7624
7624
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
7625
|
-
const timerRef =
|
|
7626
|
-
const searchRef =
|
|
7627
|
-
const pointerGraceTimerRef =
|
|
7628
|
-
const pointerGraceIntentRef =
|
|
7629
|
-
const pointerDirRef =
|
|
7630
|
-
const lastPointerXRef =
|
|
7631
|
-
const ScrollLockWrapper = disableOutsideScroll ? Combination_default :
|
|
7625
|
+
const timerRef = React45.useRef(0);
|
|
7626
|
+
const searchRef = React45.useRef("");
|
|
7627
|
+
const pointerGraceTimerRef = React45.useRef(0);
|
|
7628
|
+
const pointerGraceIntentRef = React45.useRef(null);
|
|
7629
|
+
const pointerDirRef = React45.useRef("right");
|
|
7630
|
+
const lastPointerXRef = React45.useRef(0);
|
|
7631
|
+
const ScrollLockWrapper = disableOutsideScroll ? Combination_default : React45.Fragment;
|
|
7632
7632
|
const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot2, allowPinchZoom: true } : void 0;
|
|
7633
7633
|
const handleTypeaheadSearch = (key) => {
|
|
7634
7634
|
const search = searchRef.current + key;
|
|
@@ -7647,11 +7647,11 @@ var MenuContentImpl = React44.forwardRef(
|
|
|
7647
7647
|
setTimeout(() => newItem.focus());
|
|
7648
7648
|
}
|
|
7649
7649
|
};
|
|
7650
|
-
|
|
7650
|
+
React45.useEffect(() => {
|
|
7651
7651
|
return () => window.clearTimeout(timerRef.current);
|
|
7652
7652
|
}, []);
|
|
7653
7653
|
useFocusGuards();
|
|
7654
|
-
const isPointerMovingToSubmenu =
|
|
7654
|
+
const isPointerMovingToSubmenu = React45.useCallback((event) => {
|
|
7655
7655
|
const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;
|
|
7656
7656
|
return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);
|
|
7657
7657
|
}, []);
|
|
@@ -7660,13 +7660,13 @@ var MenuContentImpl = React44.forwardRef(
|
|
|
7660
7660
|
{
|
|
7661
7661
|
scope: __scopeMenu,
|
|
7662
7662
|
searchRef,
|
|
7663
|
-
onItemEnter:
|
|
7663
|
+
onItemEnter: React45.useCallback(
|
|
7664
7664
|
(event) => {
|
|
7665
7665
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7666
7666
|
},
|
|
7667
7667
|
[isPointerMovingToSubmenu]
|
|
7668
7668
|
),
|
|
7669
|
-
onItemLeave:
|
|
7669
|
+
onItemLeave: React45.useCallback(
|
|
7670
7670
|
(event) => {
|
|
7671
7671
|
if (isPointerMovingToSubmenu(event)) return;
|
|
7672
7672
|
contentRef.current?.focus();
|
|
@@ -7674,14 +7674,14 @@ var MenuContentImpl = React44.forwardRef(
|
|
|
7674
7674
|
},
|
|
7675
7675
|
[isPointerMovingToSubmenu]
|
|
7676
7676
|
),
|
|
7677
|
-
onTriggerLeave:
|
|
7677
|
+
onTriggerLeave: React45.useCallback(
|
|
7678
7678
|
(event) => {
|
|
7679
7679
|
if (isPointerMovingToSubmenu(event)) event.preventDefault();
|
|
7680
7680
|
},
|
|
7681
7681
|
[isPointerMovingToSubmenu]
|
|
7682
7682
|
),
|
|
7683
7683
|
pointerGraceTimerRef,
|
|
7684
|
-
onPointerGraceIntentChange:
|
|
7684
|
+
onPointerGraceIntentChange: React45.useCallback((intent) => {
|
|
7685
7685
|
pointerGraceIntentRef.current = intent;
|
|
7686
7686
|
}, []),
|
|
7687
7687
|
children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(
|
|
@@ -7780,7 +7780,7 @@ var MenuContentImpl = React44.forwardRef(
|
|
|
7780
7780
|
);
|
|
7781
7781
|
MenuContent.displayName = CONTENT_NAME2;
|
|
7782
7782
|
var GROUP_NAME2 = "MenuGroup";
|
|
7783
|
-
var MenuGroup =
|
|
7783
|
+
var MenuGroup = React45.forwardRef(
|
|
7784
7784
|
(props, forwardedRef) => {
|
|
7785
7785
|
const { __scopeMenu, ...groupProps } = props;
|
|
7786
7786
|
return /* @__PURE__ */ jsx(Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
@@ -7788,7 +7788,7 @@ var MenuGroup = React44.forwardRef(
|
|
|
7788
7788
|
);
|
|
7789
7789
|
MenuGroup.displayName = GROUP_NAME2;
|
|
7790
7790
|
var LABEL_NAME = "MenuLabel";
|
|
7791
|
-
var MenuLabel =
|
|
7791
|
+
var MenuLabel = React45.forwardRef(
|
|
7792
7792
|
(props, forwardedRef) => {
|
|
7793
7793
|
const { __scopeMenu, ...labelProps } = props;
|
|
7794
7794
|
return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
@@ -7797,14 +7797,14 @@ var MenuLabel = React44.forwardRef(
|
|
|
7797
7797
|
MenuLabel.displayName = LABEL_NAME;
|
|
7798
7798
|
var ITEM_NAME2 = "MenuItem";
|
|
7799
7799
|
var ITEM_SELECT = "menu.itemSelect";
|
|
7800
|
-
var MenuItem =
|
|
7800
|
+
var MenuItem = React45.forwardRef(
|
|
7801
7801
|
(props, forwardedRef) => {
|
|
7802
7802
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
7803
|
-
const ref =
|
|
7803
|
+
const ref = React45.useRef(null);
|
|
7804
7804
|
const rootContext = useMenuRootContext(ITEM_NAME2, props.__scopeMenu);
|
|
7805
7805
|
const contentContext = useMenuContentContext(ITEM_NAME2, props.__scopeMenu);
|
|
7806
7806
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7807
|
-
const isPointerDownRef =
|
|
7807
|
+
const isPointerDownRef = React45.useRef(false);
|
|
7808
7808
|
const handleSelect = () => {
|
|
7809
7809
|
const menuItem = ref.current;
|
|
7810
7810
|
if (!disabled && menuItem) {
|
|
@@ -7845,16 +7845,16 @@ var MenuItem = React44.forwardRef(
|
|
|
7845
7845
|
}
|
|
7846
7846
|
);
|
|
7847
7847
|
MenuItem.displayName = ITEM_NAME2;
|
|
7848
|
-
var MenuItemImpl =
|
|
7848
|
+
var MenuItemImpl = React45.forwardRef(
|
|
7849
7849
|
(props, forwardedRef) => {
|
|
7850
7850
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
7851
7851
|
const contentContext = useMenuContentContext(ITEM_NAME2, __scopeMenu);
|
|
7852
7852
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7853
|
-
const ref =
|
|
7853
|
+
const ref = React45.useRef(null);
|
|
7854
7854
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7855
|
-
const [isFocused, setIsFocused] =
|
|
7856
|
-
const [textContent, setTextContent] =
|
|
7857
|
-
|
|
7855
|
+
const [isFocused, setIsFocused] = React45.useState(false);
|
|
7856
|
+
const [textContent, setTextContent] = React45.useState("");
|
|
7857
|
+
React45.useEffect(() => {
|
|
7858
7858
|
const menuItem = ref.current;
|
|
7859
7859
|
if (menuItem) {
|
|
7860
7860
|
setTextContent((menuItem.textContent ?? "").trim());
|
|
@@ -7902,7 +7902,7 @@ var MenuItemImpl = React44.forwardRef(
|
|
|
7902
7902
|
}
|
|
7903
7903
|
);
|
|
7904
7904
|
var CHECKBOX_ITEM_NAME = "MenuCheckboxItem";
|
|
7905
|
-
var MenuCheckboxItem =
|
|
7905
|
+
var MenuCheckboxItem = React45.forwardRef(
|
|
7906
7906
|
(props, forwardedRef) => {
|
|
7907
7907
|
const { checked = false, onCheckedChange, ...checkboxItemProps } = props;
|
|
7908
7908
|
return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(
|
|
@@ -7929,7 +7929,7 @@ var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
|
7929
7929
|
{ value: void 0, onValueChange: () => {
|
|
7930
7930
|
} }
|
|
7931
7931
|
);
|
|
7932
|
-
var MenuRadioGroup =
|
|
7932
|
+
var MenuRadioGroup = React45.forwardRef(
|
|
7933
7933
|
(props, forwardedRef) => {
|
|
7934
7934
|
const { value, onValueChange, ...groupProps } = props;
|
|
7935
7935
|
const handleValueChange = useCallbackRef(onValueChange);
|
|
@@ -7938,7 +7938,7 @@ var MenuRadioGroup = React44.forwardRef(
|
|
|
7938
7938
|
);
|
|
7939
7939
|
MenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
7940
7940
|
var RADIO_ITEM_NAME = "MenuRadioItem";
|
|
7941
|
-
var MenuRadioItem =
|
|
7941
|
+
var MenuRadioItem = React45.forwardRef(
|
|
7942
7942
|
(props, forwardedRef) => {
|
|
7943
7943
|
const { value, ...radioItemProps } = props;
|
|
7944
7944
|
const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);
|
|
@@ -7966,7 +7966,7 @@ var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(
|
|
|
7966
7966
|
ITEM_INDICATOR_NAME,
|
|
7967
7967
|
{ checked: false }
|
|
7968
7968
|
);
|
|
7969
|
-
var MenuItemIndicator =
|
|
7969
|
+
var MenuItemIndicator = React45.forwardRef(
|
|
7970
7970
|
(props, forwardedRef) => {
|
|
7971
7971
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
7972
7972
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
@@ -7988,7 +7988,7 @@ var MenuItemIndicator = React44.forwardRef(
|
|
|
7988
7988
|
);
|
|
7989
7989
|
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
7990
7990
|
var SEPARATOR_NAME = "MenuSeparator";
|
|
7991
|
-
var MenuSeparator =
|
|
7991
|
+
var MenuSeparator = React45.forwardRef(
|
|
7992
7992
|
(props, forwardedRef) => {
|
|
7993
7993
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7994
7994
|
return /* @__PURE__ */ jsx(
|
|
@@ -8004,7 +8004,7 @@ var MenuSeparator = React44.forwardRef(
|
|
|
8004
8004
|
);
|
|
8005
8005
|
MenuSeparator.displayName = SEPARATOR_NAME;
|
|
8006
8006
|
var ARROW_NAME2 = "MenuArrow";
|
|
8007
|
-
var MenuArrow =
|
|
8007
|
+
var MenuArrow = React45.forwardRef(
|
|
8008
8008
|
(props, forwardedRef) => {
|
|
8009
8009
|
const { __scopeMenu, ...arrowProps } = props;
|
|
8010
8010
|
const popperScope = usePopperScope(__scopeMenu);
|
|
@@ -8018,10 +8018,10 @@ var MenuSub = (props) => {
|
|
|
8018
8018
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
8019
8019
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
8020
8020
|
const popperScope = usePopperScope(__scopeMenu);
|
|
8021
|
-
const [trigger, setTrigger] =
|
|
8022
|
-
const [content, setContent] =
|
|
8021
|
+
const [trigger, setTrigger] = React45.useState(null);
|
|
8022
|
+
const [content, setContent] = React45.useState(null);
|
|
8023
8023
|
const handleOpenChange = useCallbackRef(onOpenChange);
|
|
8024
|
-
|
|
8024
|
+
React45.useEffect(() => {
|
|
8025
8025
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
8026
8026
|
return () => handleOpenChange(false);
|
|
8027
8027
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
@@ -8049,21 +8049,21 @@ var MenuSub = (props) => {
|
|
|
8049
8049
|
};
|
|
8050
8050
|
MenuSub.displayName = SUB_NAME;
|
|
8051
8051
|
var SUB_TRIGGER_NAME = "MenuSubTrigger";
|
|
8052
|
-
var MenuSubTrigger =
|
|
8052
|
+
var MenuSubTrigger = React45.forwardRef(
|
|
8053
8053
|
(props, forwardedRef) => {
|
|
8054
8054
|
const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8055
8055
|
const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8056
8056
|
const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8057
8057
|
const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);
|
|
8058
|
-
const openTimerRef =
|
|
8058
|
+
const openTimerRef = React45.useRef(null);
|
|
8059
8059
|
const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;
|
|
8060
8060
|
const scope = { __scopeMenu: props.__scopeMenu };
|
|
8061
|
-
const clearOpenTimer =
|
|
8061
|
+
const clearOpenTimer = React45.useCallback(() => {
|
|
8062
8062
|
if (openTimerRef.current) window.clearTimeout(openTimerRef.current);
|
|
8063
8063
|
openTimerRef.current = null;
|
|
8064
8064
|
}, []);
|
|
8065
|
-
|
|
8066
|
-
|
|
8065
|
+
React45.useEffect(() => clearOpenTimer, [clearOpenTimer]);
|
|
8066
|
+
React45.useEffect(() => {
|
|
8067
8067
|
const pointerGraceTimer = pointerGraceTimerRef.current;
|
|
8068
8068
|
return () => {
|
|
8069
8069
|
window.clearTimeout(pointerGraceTimer);
|
|
@@ -8150,14 +8150,14 @@ var MenuSubTrigger = React44.forwardRef(
|
|
|
8150
8150
|
);
|
|
8151
8151
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
8152
8152
|
var SUB_CONTENT_NAME = "MenuSubContent";
|
|
8153
|
-
var MenuSubContent =
|
|
8153
|
+
var MenuSubContent = React45.forwardRef(
|
|
8154
8154
|
(props, forwardedRef) => {
|
|
8155
8155
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8156
8156
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
8157
8157
|
const context = useMenuContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8158
8158
|
const rootContext = useMenuRootContext(CONTENT_NAME2, props.__scopeMenu);
|
|
8159
8159
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);
|
|
8160
|
-
const ref =
|
|
8160
|
+
const ref = React45.useRef(null);
|
|
8161
8161
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8162
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(
|
|
8163
8163
|
MenuContentImpl,
|
|
@@ -8286,7 +8286,7 @@ var DropdownMenu = (props) => {
|
|
|
8286
8286
|
modal = true
|
|
8287
8287
|
} = props;
|
|
8288
8288
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8289
|
-
const triggerRef =
|
|
8289
|
+
const triggerRef = React45.useRef(null);
|
|
8290
8290
|
const [open, setOpen] = useControllableState({
|
|
8291
8291
|
prop: openProp,
|
|
8292
8292
|
defaultProp: defaultOpen ?? false,
|
|
@@ -8302,7 +8302,7 @@ var DropdownMenu = (props) => {
|
|
|
8302
8302
|
contentId: useId(),
|
|
8303
8303
|
open,
|
|
8304
8304
|
onOpenChange: setOpen,
|
|
8305
|
-
onOpenToggle:
|
|
8305
|
+
onOpenToggle: React45.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8306
8306
|
modal,
|
|
8307
8307
|
children: /* @__PURE__ */ jsx(Root32, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
8308
8308
|
}
|
|
@@ -8310,7 +8310,7 @@ var DropdownMenu = (props) => {
|
|
|
8310
8310
|
};
|
|
8311
8311
|
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
8312
8312
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8313
|
-
var DropdownMenuTrigger =
|
|
8313
|
+
var DropdownMenuTrigger = React45.forwardRef(
|
|
8314
8314
|
(props, forwardedRef) => {
|
|
8315
8315
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8316
8316
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
@@ -8353,12 +8353,12 @@ var DropdownMenuPortal = (props) => {
|
|
|
8353
8353
|
};
|
|
8354
8354
|
DropdownMenuPortal.displayName = PORTAL_NAME3;
|
|
8355
8355
|
var CONTENT_NAME3 = "DropdownMenuContent";
|
|
8356
|
-
var DropdownMenuContent =
|
|
8356
|
+
var DropdownMenuContent = React45.forwardRef(
|
|
8357
8357
|
(props, forwardedRef) => {
|
|
8358
8358
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8359
8359
|
const context = useDropdownMenuContext(CONTENT_NAME3, __scopeDropdownMenu);
|
|
8360
8360
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8361
|
-
const hasInteractedOutsideRef =
|
|
8361
|
+
const hasInteractedOutsideRef = React45.useRef(false);
|
|
8362
8362
|
return /* @__PURE__ */ jsx(
|
|
8363
8363
|
Content2,
|
|
8364
8364
|
{
|
|
@@ -8395,7 +8395,7 @@ var DropdownMenuContent = React44.forwardRef(
|
|
|
8395
8395
|
);
|
|
8396
8396
|
DropdownMenuContent.displayName = CONTENT_NAME3;
|
|
8397
8397
|
var GROUP_NAME3 = "DropdownMenuGroup";
|
|
8398
|
-
var DropdownMenuGroup =
|
|
8398
|
+
var DropdownMenuGroup = React45.forwardRef(
|
|
8399
8399
|
(props, forwardedRef) => {
|
|
8400
8400
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
8401
8401
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8404,7 +8404,7 @@ var DropdownMenuGroup = React44.forwardRef(
|
|
|
8404
8404
|
);
|
|
8405
8405
|
DropdownMenuGroup.displayName = GROUP_NAME3;
|
|
8406
8406
|
var LABEL_NAME2 = "DropdownMenuLabel";
|
|
8407
|
-
var DropdownMenuLabel =
|
|
8407
|
+
var DropdownMenuLabel = React45.forwardRef(
|
|
8408
8408
|
(props, forwardedRef) => {
|
|
8409
8409
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8410
8410
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8413,7 +8413,7 @@ var DropdownMenuLabel = React44.forwardRef(
|
|
|
8413
8413
|
);
|
|
8414
8414
|
DropdownMenuLabel.displayName = LABEL_NAME2;
|
|
8415
8415
|
var ITEM_NAME3 = "DropdownMenuItem";
|
|
8416
|
-
var DropdownMenuItem =
|
|
8416
|
+
var DropdownMenuItem = React45.forwardRef(
|
|
8417
8417
|
(props, forwardedRef) => {
|
|
8418
8418
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
8419
8419
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8422,42 +8422,42 @@ var DropdownMenuItem = React44.forwardRef(
|
|
|
8422
8422
|
);
|
|
8423
8423
|
DropdownMenuItem.displayName = ITEM_NAME3;
|
|
8424
8424
|
var CHECKBOX_ITEM_NAME2 = "DropdownMenuCheckboxItem";
|
|
8425
|
-
var DropdownMenuCheckboxItem =
|
|
8425
|
+
var DropdownMenuCheckboxItem = React45.forwardRef((props, forwardedRef) => {
|
|
8426
8426
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
8427
8427
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8428
8428
|
return /* @__PURE__ */ jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
8429
8429
|
});
|
|
8430
8430
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME2;
|
|
8431
8431
|
var RADIO_GROUP_NAME2 = "DropdownMenuRadioGroup";
|
|
8432
|
-
var DropdownMenuRadioGroup =
|
|
8432
|
+
var DropdownMenuRadioGroup = React45.forwardRef((props, forwardedRef) => {
|
|
8433
8433
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
8434
8434
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8435
8435
|
return /* @__PURE__ */ jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
8436
8436
|
});
|
|
8437
8437
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME2;
|
|
8438
8438
|
var RADIO_ITEM_NAME2 = "DropdownMenuRadioItem";
|
|
8439
|
-
var DropdownMenuRadioItem =
|
|
8439
|
+
var DropdownMenuRadioItem = React45.forwardRef((props, forwardedRef) => {
|
|
8440
8440
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
8441
8441
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8442
8442
|
return /* @__PURE__ */ jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
8443
8443
|
});
|
|
8444
8444
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME2;
|
|
8445
8445
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
8446
|
-
var DropdownMenuItemIndicator =
|
|
8446
|
+
var DropdownMenuItemIndicator = React45.forwardRef((props, forwardedRef) => {
|
|
8447
8447
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
8448
8448
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8449
8449
|
return /* @__PURE__ */ jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
8450
8450
|
});
|
|
8451
8451
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
8452
8452
|
var SEPARATOR_NAME2 = "DropdownMenuSeparator";
|
|
8453
|
-
var DropdownMenuSeparator =
|
|
8453
|
+
var DropdownMenuSeparator = React45.forwardRef((props, forwardedRef) => {
|
|
8454
8454
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
8455
8455
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8456
8456
|
return /* @__PURE__ */ jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
8457
8457
|
});
|
|
8458
8458
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME2;
|
|
8459
8459
|
var ARROW_NAME3 = "DropdownMenuArrow";
|
|
8460
|
-
var DropdownMenuArrow =
|
|
8460
|
+
var DropdownMenuArrow = React45.forwardRef(
|
|
8461
8461
|
(props, forwardedRef) => {
|
|
8462
8462
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
8463
8463
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -8477,14 +8477,14 @@ var DropdownMenuSub = (props) => {
|
|
|
8477
8477
|
return /* @__PURE__ */ jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
8478
8478
|
};
|
|
8479
8479
|
var SUB_TRIGGER_NAME2 = "DropdownMenuSubTrigger";
|
|
8480
|
-
var DropdownMenuSubTrigger =
|
|
8480
|
+
var DropdownMenuSubTrigger = React45.forwardRef((props, forwardedRef) => {
|
|
8481
8481
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
8482
8482
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8483
8483
|
return /* @__PURE__ */ jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
8484
8484
|
});
|
|
8485
8485
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME2;
|
|
8486
8486
|
var SUB_CONTENT_NAME2 = "DropdownMenuSubContent";
|
|
8487
|
-
var DropdownMenuSubContent =
|
|
8487
|
+
var DropdownMenuSubContent = React45.forwardRef((props, forwardedRef) => {
|
|
8488
8488
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
8489
8489
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8490
8490
|
return /* @__PURE__ */ jsx(
|
|
@@ -8613,17 +8613,17 @@ var Circle = createLucideIcon("Circle", __iconNode5);
|
|
|
8613
8613
|
function DropdownMenu2({
|
|
8614
8614
|
...props
|
|
8615
8615
|
}) {
|
|
8616
|
-
return /* @__PURE__ */
|
|
8616
|
+
return /* @__PURE__ */ React45.createElement(Root23, { "data-slot": "dropdown-menu", ...props });
|
|
8617
8617
|
}
|
|
8618
8618
|
function DropdownMenuPortal2({
|
|
8619
8619
|
...props
|
|
8620
8620
|
}) {
|
|
8621
|
-
return /* @__PURE__ */
|
|
8621
|
+
return /* @__PURE__ */ React45.createElement(Portal22, { "data-slot": "dropdown-menu-portal", ...props });
|
|
8622
8622
|
}
|
|
8623
8623
|
function DropdownMenuTrigger2({
|
|
8624
8624
|
...props
|
|
8625
8625
|
}) {
|
|
8626
|
-
return /* @__PURE__ */
|
|
8626
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8627
8627
|
Trigger,
|
|
8628
8628
|
{
|
|
8629
8629
|
"data-slot": "dropdown-menu-trigger",
|
|
@@ -8636,7 +8636,7 @@ function DropdownMenuContent2({
|
|
|
8636
8636
|
sideOffset = 4,
|
|
8637
8637
|
...props
|
|
8638
8638
|
}) {
|
|
8639
|
-
return /* @__PURE__ */
|
|
8639
|
+
return /* @__PURE__ */ React45.createElement(Portal22, null, /* @__PURE__ */ React45.createElement(
|
|
8640
8640
|
Content22,
|
|
8641
8641
|
{
|
|
8642
8642
|
"data-slot": "dropdown-menu-content",
|
|
@@ -8653,30 +8653,30 @@ function DropdownMenuClose({
|
|
|
8653
8653
|
className,
|
|
8654
8654
|
...props
|
|
8655
8655
|
}) {
|
|
8656
|
-
return /* @__PURE__ */
|
|
8656
|
+
return /* @__PURE__ */ React45.createElement(Item22, { "data-slot": "dropdown-menu-close", className: "hidden", ...props });
|
|
8657
8657
|
}
|
|
8658
8658
|
function DropdownMenuGroup2({
|
|
8659
8659
|
...props
|
|
8660
8660
|
}) {
|
|
8661
|
-
return /* @__PURE__ */
|
|
8661
|
+
return /* @__PURE__ */ React45.createElement(Group2, { "data-slot": "dropdown-menu-group", ...props });
|
|
8662
8662
|
}
|
|
8663
8663
|
function ConfirmationDropdownMenuItem({
|
|
8664
8664
|
...props
|
|
8665
8665
|
}) {
|
|
8666
8666
|
const { onClick: originalOnClick, ...rest } = props;
|
|
8667
|
-
const [isConfirming, setIsConfirming] =
|
|
8668
|
-
return !isConfirming ? /* @__PURE__ */
|
|
8667
|
+
const [isConfirming, setIsConfirming] = React45.useState(false);
|
|
8668
|
+
return !isConfirming ? /* @__PURE__ */ React45.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8669
8669
|
setIsConfirming(true);
|
|
8670
8670
|
e.preventDefault();
|
|
8671
8671
|
e.stopPropagation();
|
|
8672
|
-
} }) : /* @__PURE__ */
|
|
8672
|
+
} }) : /* @__PURE__ */ React45.createElement(DropdownMenuItem2, { ...rest, onClick: (e) => {
|
|
8673
8673
|
if (originalOnClick) {
|
|
8674
8674
|
setIsConfirming(false);
|
|
8675
8675
|
originalOnClick(e);
|
|
8676
8676
|
e.preventDefault();
|
|
8677
8677
|
e.stopPropagation();
|
|
8678
8678
|
}
|
|
8679
|
-
} }, /* @__PURE__ */
|
|
8679
|
+
} }, /* @__PURE__ */ React45.createElement("div", { className: "flex flex-row gap-2 items-center" }, /* @__PURE__ */ React45.createElement("div", { className: "text-destructive" }, "Are you sure ?")));
|
|
8680
8680
|
}
|
|
8681
8681
|
function DropdownMenuItem2({
|
|
8682
8682
|
className,
|
|
@@ -8684,7 +8684,7 @@ function DropdownMenuItem2({
|
|
|
8684
8684
|
variant = "default",
|
|
8685
8685
|
...props
|
|
8686
8686
|
}) {
|
|
8687
|
-
return /* @__PURE__ */
|
|
8687
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8688
8688
|
Item22,
|
|
8689
8689
|
{
|
|
8690
8690
|
"data-slot": "dropdown-menu-item",
|
|
@@ -8704,7 +8704,7 @@ function DropdownMenuCheckboxItem2({
|
|
|
8704
8704
|
checked,
|
|
8705
8705
|
...props
|
|
8706
8706
|
}) {
|
|
8707
|
-
return /* @__PURE__ */
|
|
8707
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8708
8708
|
CheckboxItem2,
|
|
8709
8709
|
{
|
|
8710
8710
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
@@ -8715,14 +8715,14 @@ function DropdownMenuCheckboxItem2({
|
|
|
8715
8715
|
checked,
|
|
8716
8716
|
...props
|
|
8717
8717
|
},
|
|
8718
|
-
/* @__PURE__ */
|
|
8718
|
+
/* @__PURE__ */ React45.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__ */ React45.createElement(ItemIndicator2, null, /* @__PURE__ */ React45.createElement(Check, { className: "uii:size-4" }))),
|
|
8719
8719
|
children
|
|
8720
8720
|
);
|
|
8721
8721
|
}
|
|
8722
8722
|
function DropdownMenuRadioGroup2({
|
|
8723
8723
|
...props
|
|
8724
8724
|
}) {
|
|
8725
|
-
return /* @__PURE__ */
|
|
8725
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8726
8726
|
RadioGroup2,
|
|
8727
8727
|
{
|
|
8728
8728
|
"data-slot": "dropdown-menu-radio-group",
|
|
@@ -8735,7 +8735,7 @@ function DropdownMenuRadioItem2({
|
|
|
8735
8735
|
children,
|
|
8736
8736
|
...props
|
|
8737
8737
|
}) {
|
|
8738
|
-
return /* @__PURE__ */
|
|
8738
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8739
8739
|
RadioItem2,
|
|
8740
8740
|
{
|
|
8741
8741
|
"data-slot": "dropdown-menu-radio-item",
|
|
@@ -8745,7 +8745,7 @@ function DropdownMenuRadioItem2({
|
|
|
8745
8745
|
),
|
|
8746
8746
|
...props
|
|
8747
8747
|
},
|
|
8748
|
-
/* @__PURE__ */
|
|
8748
|
+
/* @__PURE__ */ React45.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__ */ React45.createElement(ItemIndicator2, null, /* @__PURE__ */ React45.createElement(Circle, { className: "uii:size-2 uii:fill-current" }))),
|
|
8749
8749
|
children
|
|
8750
8750
|
);
|
|
8751
8751
|
}
|
|
@@ -8754,7 +8754,7 @@ function DropdownMenuLabel2({
|
|
|
8754
8754
|
inset,
|
|
8755
8755
|
...props
|
|
8756
8756
|
}) {
|
|
8757
|
-
return /* @__PURE__ */
|
|
8757
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8758
8758
|
Label2,
|
|
8759
8759
|
{
|
|
8760
8760
|
"data-slot": "dropdown-menu-label",
|
|
@@ -8771,7 +8771,7 @@ function DropdownMenuSeparator2({
|
|
|
8771
8771
|
className,
|
|
8772
8772
|
...props
|
|
8773
8773
|
}) {
|
|
8774
|
-
return /* @__PURE__ */
|
|
8774
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8775
8775
|
Separator2,
|
|
8776
8776
|
{
|
|
8777
8777
|
"data-slot": "dropdown-menu-separator",
|
|
@@ -8784,7 +8784,7 @@ function DropdownMenuShortcut({
|
|
|
8784
8784
|
className,
|
|
8785
8785
|
...props
|
|
8786
8786
|
}) {
|
|
8787
|
-
return /* @__PURE__ */
|
|
8787
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8788
8788
|
"span",
|
|
8789
8789
|
{
|
|
8790
8790
|
"data-slot": "dropdown-menu-shortcut",
|
|
@@ -8799,7 +8799,7 @@ function DropdownMenuShortcut({
|
|
|
8799
8799
|
function DropdownMenuSub2({
|
|
8800
8800
|
...props
|
|
8801
8801
|
}) {
|
|
8802
|
-
return /* @__PURE__ */
|
|
8802
|
+
return /* @__PURE__ */ React45.createElement(Sub2, { "data-slot": "dropdown-menu-sub", ...props });
|
|
8803
8803
|
}
|
|
8804
8804
|
function DropdownMenuSubTrigger2({
|
|
8805
8805
|
className,
|
|
@@ -8807,7 +8807,7 @@ function DropdownMenuSubTrigger2({
|
|
|
8807
8807
|
children,
|
|
8808
8808
|
...props
|
|
8809
8809
|
}) {
|
|
8810
|
-
return /* @__PURE__ */
|
|
8810
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8811
8811
|
SubTrigger2,
|
|
8812
8812
|
{
|
|
8813
8813
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
@@ -8819,14 +8819,14 @@ function DropdownMenuSubTrigger2({
|
|
|
8819
8819
|
...props
|
|
8820
8820
|
},
|
|
8821
8821
|
children,
|
|
8822
|
-
/* @__PURE__ */
|
|
8822
|
+
/* @__PURE__ */ React45.createElement(ChevronRight, { className: "uii:ml-auto uii:size-4" })
|
|
8823
8823
|
);
|
|
8824
8824
|
}
|
|
8825
8825
|
function DropdownMenuSubContent2({
|
|
8826
8826
|
className,
|
|
8827
8827
|
...props
|
|
8828
8828
|
}) {
|
|
8829
|
-
return /* @__PURE__ */
|
|
8829
|
+
return /* @__PURE__ */ React45.createElement(
|
|
8830
8830
|
SubContent2,
|
|
8831
8831
|
{
|
|
8832
8832
|
"data-slot": "dropdown-menu-sub-content",
|
|
@@ -8887,7 +8887,7 @@ __export(fields_exports, {
|
|
|
8887
8887
|
var DevContext = createContext(null);
|
|
8888
8888
|
function useResolvedExpectedType(expectedType, devCtx) {
|
|
8889
8889
|
const inferredTypes = devCtx?.inferredTypes;
|
|
8890
|
-
return
|
|
8890
|
+
return React45.useMemo(() => {
|
|
8891
8891
|
if (!expectedType) return "any";
|
|
8892
8892
|
if (!expectedType.startsWith("$infer<")) {
|
|
8893
8893
|
return expectedType;
|
|
@@ -8935,29 +8935,22 @@ function Input({
|
|
|
8935
8935
|
}) {
|
|
8936
8936
|
const devCtx = useContext(DevContext);
|
|
8937
8937
|
const resolvedExpectedType = useResolvedExpectedType(expectedType, devCtx);
|
|
8938
|
-
const displayValue =
|
|
8938
|
+
const displayValue = React45.useMemo(() => {
|
|
8939
8939
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
8940
8940
|
return String(value.expression ?? "");
|
|
8941
8941
|
}
|
|
8942
8942
|
return String(value ?? "");
|
|
8943
8943
|
}, [value]);
|
|
8944
|
-
const isExpression =
|
|
8944
|
+
const isExpression = React45.useMemo(() => {
|
|
8945
8945
|
return value != null && typeof value === "object" && "expression" in value;
|
|
8946
8946
|
}, [value]);
|
|
8947
|
-
const handleChange =
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
expression: newValue,
|
|
8952
|
-
type: "expression"
|
|
8953
|
-
});
|
|
8954
|
-
} else {
|
|
8955
|
-
onChange(newValue);
|
|
8956
|
-
}
|
|
8957
|
-
}, [onChange]);
|
|
8947
|
+
const handleChange = React45.useCallback(
|
|
8948
|
+
(e) => onChange(e.target.value),
|
|
8949
|
+
[onChange]
|
|
8950
|
+
);
|
|
8958
8951
|
const showError = hasRequiredError || required && !displayValue;
|
|
8959
8952
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
8960
|
-
return /* @__PURE__ */
|
|
8953
|
+
return /* @__PURE__ */ React45.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React45.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React45.createElement(
|
|
8961
8954
|
"label",
|
|
8962
8955
|
{
|
|
8963
8956
|
htmlFor: fieldName,
|
|
@@ -8965,7 +8958,7 @@ function Input({
|
|
|
8965
8958
|
},
|
|
8966
8959
|
label,
|
|
8967
8960
|
":"
|
|
8968
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
8961
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React45.createElement(
|
|
8969
8962
|
"span",
|
|
8970
8963
|
{
|
|
8971
8964
|
className: cn(
|
|
@@ -8975,7 +8968,7 @@ function Input({
|
|
|
8975
8968
|
title: resolvedExpectedType
|
|
8976
8969
|
},
|
|
8977
8970
|
resolvedExpectedType
|
|
8978
|
-
), showError && /* @__PURE__ */
|
|
8971
|
+
), showError && /* @__PURE__ */ React45.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"), showCaseSensitivity && onCaseSensitiveChange && /* @__PURE__ */ React45.createElement(
|
|
8979
8972
|
"button",
|
|
8980
8973
|
{
|
|
8981
8974
|
type: "button",
|
|
@@ -8987,7 +8980,7 @@ function Input({
|
|
|
8987
8980
|
)
|
|
8988
8981
|
},
|
|
8989
8982
|
"Aa"
|
|
8990
|
-
)), /* @__PURE__ */
|
|
8983
|
+
)), /* @__PURE__ */ React45.createElement("div", { className: "uii:mt-0.5" }, /* @__PURE__ */ React45.createElement(
|
|
8991
8984
|
"input",
|
|
8992
8985
|
{
|
|
8993
8986
|
id: fieldName,
|
|
@@ -9015,8 +9008,8 @@ function clamp2(value, [min2, max2]) {
|
|
|
9015
9008
|
return Math.min(max2, Math.max(min2, value));
|
|
9016
9009
|
}
|
|
9017
9010
|
function usePrevious(value) {
|
|
9018
|
-
const ref =
|
|
9019
|
-
return
|
|
9011
|
+
const ref = React45.useRef({ value, previous: value });
|
|
9012
|
+
return React45.useMemo(() => {
|
|
9020
9013
|
if (ref.current.value !== value) {
|
|
9021
9014
|
ref.current.previous = ref.current.value;
|
|
9022
9015
|
ref.current.value = value;
|
|
@@ -9038,7 +9031,7 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
9038
9031
|
wordWrap: "normal"
|
|
9039
9032
|
});
|
|
9040
9033
|
var NAME3 = "VisuallyHidden";
|
|
9041
|
-
var VisuallyHidden =
|
|
9034
|
+
var VisuallyHidden = React45.forwardRef(
|
|
9042
9035
|
(props, forwardedRef) => {
|
|
9043
9036
|
return /* @__PURE__ */ jsx(
|
|
9044
9037
|
Primitive.span,
|
|
@@ -9080,9 +9073,9 @@ var Select = (props) => {
|
|
|
9080
9073
|
form
|
|
9081
9074
|
} = props;
|
|
9082
9075
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
9083
|
-
const [trigger, setTrigger] =
|
|
9084
|
-
const [valueNode, setValueNode] =
|
|
9085
|
-
const [valueNodeHasChildren, setValueNodeHasChildren] =
|
|
9076
|
+
const [trigger, setTrigger] = React45.useState(null);
|
|
9077
|
+
const [valueNode, setValueNode] = React45.useState(null);
|
|
9078
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = React45.useState(false);
|
|
9086
9079
|
const direction = useDirection(dir);
|
|
9087
9080
|
const [open, setOpen] = useControllableState({
|
|
9088
9081
|
prop: openProp,
|
|
@@ -9096,9 +9089,9 @@ var Select = (props) => {
|
|
|
9096
9089
|
onChange: onValueChange,
|
|
9097
9090
|
caller: SELECT_NAME
|
|
9098
9091
|
});
|
|
9099
|
-
const triggerPointerDownPosRef =
|
|
9092
|
+
const triggerPointerDownPosRef = React45.useRef(null);
|
|
9100
9093
|
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
9101
|
-
const [nativeOptionsSet, setNativeOptionsSet] =
|
|
9094
|
+
const [nativeOptionsSet, setNativeOptionsSet] = React45.useState(/* @__PURE__ */ new Set());
|
|
9102
9095
|
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
9103
9096
|
return /* @__PURE__ */ jsx(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs(
|
|
9104
9097
|
SelectProvider,
|
|
@@ -9124,10 +9117,10 @@ var Select = (props) => {
|
|
|
9124
9117
|
SelectNativeOptionsProvider,
|
|
9125
9118
|
{
|
|
9126
9119
|
scope: props.__scopeSelect,
|
|
9127
|
-
onNativeOptionAdd:
|
|
9120
|
+
onNativeOptionAdd: React45.useCallback((option) => {
|
|
9128
9121
|
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
9129
9122
|
}, []),
|
|
9130
|
-
onNativeOptionRemove:
|
|
9123
|
+
onNativeOptionRemove: React45.useCallback((option) => {
|
|
9131
9124
|
setNativeOptionsSet((prev) => {
|
|
9132
9125
|
const optionsSet = new Set(prev);
|
|
9133
9126
|
optionsSet.delete(option);
|
|
@@ -9162,7 +9155,7 @@ var Select = (props) => {
|
|
|
9162
9155
|
};
|
|
9163
9156
|
Select.displayName = SELECT_NAME;
|
|
9164
9157
|
var TRIGGER_NAME2 = "SelectTrigger";
|
|
9165
|
-
var SelectTrigger =
|
|
9158
|
+
var SelectTrigger = React45.forwardRef(
|
|
9166
9159
|
(props, forwardedRef) => {
|
|
9167
9160
|
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
9168
9161
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -9170,7 +9163,7 @@ var SelectTrigger = React44.forwardRef(
|
|
|
9170
9163
|
const isDisabled = context.disabled || disabled;
|
|
9171
9164
|
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
9172
9165
|
const getItems = useCollection3(__scopeSelect);
|
|
9173
|
-
const pointerTypeRef =
|
|
9166
|
+
const pointerTypeRef = React45.useRef("touch");
|
|
9174
9167
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
9175
9168
|
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
9176
9169
|
const currentItem = enabledItems.find((item) => item.value === context.value);
|
|
@@ -9240,7 +9233,7 @@ var SelectTrigger = React44.forwardRef(
|
|
|
9240
9233
|
);
|
|
9241
9234
|
SelectTrigger.displayName = TRIGGER_NAME2;
|
|
9242
9235
|
var VALUE_NAME = "SelectValue";
|
|
9243
|
-
var SelectValue =
|
|
9236
|
+
var SelectValue = React45.forwardRef(
|
|
9244
9237
|
(props, forwardedRef) => {
|
|
9245
9238
|
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
9246
9239
|
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
@@ -9263,7 +9256,7 @@ var SelectValue = React44.forwardRef(
|
|
|
9263
9256
|
);
|
|
9264
9257
|
SelectValue.displayName = VALUE_NAME;
|
|
9265
9258
|
var ICON_NAME = "SelectIcon";
|
|
9266
|
-
var SelectIcon =
|
|
9259
|
+
var SelectIcon = React45.forwardRef(
|
|
9267
9260
|
(props, forwardedRef) => {
|
|
9268
9261
|
const { __scopeSelect, children, ...iconProps } = props;
|
|
9269
9262
|
return /* @__PURE__ */ jsx(Primitive.span, { "aria-hidden": true, ...iconProps, ref: forwardedRef, children: children || "\u25BC" });
|
|
@@ -9276,10 +9269,10 @@ var SelectPortal = (props) => {
|
|
|
9276
9269
|
};
|
|
9277
9270
|
SelectPortal.displayName = PORTAL_NAME4;
|
|
9278
9271
|
var CONTENT_NAME4 = "SelectContent";
|
|
9279
|
-
var SelectContent =
|
|
9272
|
+
var SelectContent = React45.forwardRef(
|
|
9280
9273
|
(props, forwardedRef) => {
|
|
9281
9274
|
const context = useSelectContext(CONTENT_NAME4, props.__scopeSelect);
|
|
9282
|
-
const [fragment, setFragment] =
|
|
9275
|
+
const [fragment, setFragment] = React45.useState();
|
|
9283
9276
|
useLayoutEffect2(() => {
|
|
9284
9277
|
setFragment(new DocumentFragment());
|
|
9285
9278
|
}, []);
|
|
@@ -9298,7 +9291,7 @@ var CONTENT_MARGIN = 10;
|
|
|
9298
9291
|
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME4);
|
|
9299
9292
|
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
9300
9293
|
var Slot3 = createSlot2("SelectContent.RemoveScroll");
|
|
9301
|
-
var SelectContentImpl =
|
|
9294
|
+
var SelectContentImpl = React45.forwardRef(
|
|
9302
9295
|
(props, forwardedRef) => {
|
|
9303
9296
|
const {
|
|
9304
9297
|
__scopeSelect,
|
|
@@ -9322,21 +9315,21 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9322
9315
|
...contentProps
|
|
9323
9316
|
} = props;
|
|
9324
9317
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9325
|
-
const [content, setContent] =
|
|
9326
|
-
const [viewport, setViewport] =
|
|
9318
|
+
const [content, setContent] = React45.useState(null);
|
|
9319
|
+
const [viewport, setViewport] = React45.useState(null);
|
|
9327
9320
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9328
|
-
const [selectedItem, setSelectedItem] =
|
|
9329
|
-
const [selectedItemText, setSelectedItemText] =
|
|
9321
|
+
const [selectedItem, setSelectedItem] = React45.useState(null);
|
|
9322
|
+
const [selectedItemText, setSelectedItemText] = React45.useState(
|
|
9330
9323
|
null
|
|
9331
9324
|
);
|
|
9332
9325
|
const getItems = useCollection3(__scopeSelect);
|
|
9333
|
-
const [isPositioned, setIsPositioned] =
|
|
9334
|
-
const firstValidItemFoundRef =
|
|
9335
|
-
|
|
9326
|
+
const [isPositioned, setIsPositioned] = React45.useState(false);
|
|
9327
|
+
const firstValidItemFoundRef = React45.useRef(false);
|
|
9328
|
+
React45.useEffect(() => {
|
|
9336
9329
|
if (content) return hideOthers(content);
|
|
9337
9330
|
}, [content]);
|
|
9338
9331
|
useFocusGuards();
|
|
9339
|
-
const focusFirst4 =
|
|
9332
|
+
const focusFirst4 = React45.useCallback(
|
|
9340
9333
|
(candidates) => {
|
|
9341
9334
|
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
9342
9335
|
const [lastItem] = restItems.slice(-1);
|
|
@@ -9352,17 +9345,17 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9352
9345
|
},
|
|
9353
9346
|
[getItems, viewport]
|
|
9354
9347
|
);
|
|
9355
|
-
const focusSelectedItem =
|
|
9348
|
+
const focusSelectedItem = React45.useCallback(
|
|
9356
9349
|
() => focusFirst4([selectedItem, content]),
|
|
9357
9350
|
[focusFirst4, selectedItem, content]
|
|
9358
9351
|
);
|
|
9359
|
-
|
|
9352
|
+
React45.useEffect(() => {
|
|
9360
9353
|
if (isPositioned) {
|
|
9361
9354
|
focusSelectedItem();
|
|
9362
9355
|
}
|
|
9363
9356
|
}, [isPositioned, focusSelectedItem]);
|
|
9364
9357
|
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
9365
|
-
|
|
9358
|
+
React45.useEffect(() => {
|
|
9366
9359
|
if (content) {
|
|
9367
9360
|
let pointerMoveDelta = { x: 0, y: 0 };
|
|
9368
9361
|
const handlePointerMove = (event) => {
|
|
@@ -9392,7 +9385,7 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9392
9385
|
};
|
|
9393
9386
|
}
|
|
9394
9387
|
}, [content, onOpenChange, triggerPointerDownPosRef]);
|
|
9395
|
-
|
|
9388
|
+
React45.useEffect(() => {
|
|
9396
9389
|
const close = () => onOpenChange(false);
|
|
9397
9390
|
window.addEventListener("blur", close);
|
|
9398
9391
|
window.addEventListener("resize", close);
|
|
@@ -9409,7 +9402,7 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9409
9402
|
setTimeout(() => nextItem.ref.current.focus());
|
|
9410
9403
|
}
|
|
9411
9404
|
});
|
|
9412
|
-
const itemRefCallback =
|
|
9405
|
+
const itemRefCallback = React45.useCallback(
|
|
9413
9406
|
(node, value, disabled) => {
|
|
9414
9407
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9415
9408
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9420,8 +9413,8 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9420
9413
|
},
|
|
9421
9414
|
[context.value]
|
|
9422
9415
|
);
|
|
9423
|
-
const handleItemLeave =
|
|
9424
|
-
const itemTextRefCallback =
|
|
9416
|
+
const handleItemLeave = React45.useCallback(() => content?.focus(), [content]);
|
|
9417
|
+
const itemTextRefCallback = React45.useCallback(
|
|
9425
9418
|
(node, value, disabled) => {
|
|
9426
9419
|
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
9427
9420
|
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
@@ -9532,18 +9525,18 @@ var SelectContentImpl = React44.forwardRef(
|
|
|
9532
9525
|
);
|
|
9533
9526
|
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
9534
9527
|
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
9535
|
-
var SelectItemAlignedPosition =
|
|
9528
|
+
var SelectItemAlignedPosition = React45.forwardRef((props, forwardedRef) => {
|
|
9536
9529
|
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
9537
9530
|
const context = useSelectContext(CONTENT_NAME4, __scopeSelect);
|
|
9538
9531
|
const contentContext = useSelectContentContext(CONTENT_NAME4, __scopeSelect);
|
|
9539
|
-
const [contentWrapper, setContentWrapper] =
|
|
9540
|
-
const [content, setContent] =
|
|
9532
|
+
const [contentWrapper, setContentWrapper] = React45.useState(null);
|
|
9533
|
+
const [content, setContent] = React45.useState(null);
|
|
9541
9534
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
9542
9535
|
const getItems = useCollection3(__scopeSelect);
|
|
9543
|
-
const shouldExpandOnScrollRef =
|
|
9544
|
-
const shouldRepositionRef =
|
|
9536
|
+
const shouldExpandOnScrollRef = React45.useRef(false);
|
|
9537
|
+
const shouldRepositionRef = React45.useRef(true);
|
|
9545
9538
|
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
9546
|
-
const position =
|
|
9539
|
+
const position = React45.useCallback(() => {
|
|
9547
9540
|
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
9548
9541
|
const triggerRect = context.trigger.getBoundingClientRect();
|
|
9549
9542
|
const contentRect = content.getBoundingClientRect();
|
|
@@ -9643,11 +9636,11 @@ var SelectItemAlignedPosition = React44.forwardRef((props, forwardedRef) => {
|
|
|
9643
9636
|
onPlaced
|
|
9644
9637
|
]);
|
|
9645
9638
|
useLayoutEffect2(() => position(), [position]);
|
|
9646
|
-
const [contentZIndex, setContentZIndex] =
|
|
9639
|
+
const [contentZIndex, setContentZIndex] = React45.useState();
|
|
9647
9640
|
useLayoutEffect2(() => {
|
|
9648
9641
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
9649
9642
|
}, [content]);
|
|
9650
|
-
const handleScrollButtonChange =
|
|
9643
|
+
const handleScrollButtonChange = React45.useCallback(
|
|
9651
9644
|
(node) => {
|
|
9652
9645
|
if (node && shouldRepositionRef.current === true) {
|
|
9653
9646
|
position();
|
|
@@ -9696,7 +9689,7 @@ var SelectItemAlignedPosition = React44.forwardRef((props, forwardedRef) => {
|
|
|
9696
9689
|
});
|
|
9697
9690
|
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
9698
9691
|
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
9699
|
-
var SelectPopperPosition =
|
|
9692
|
+
var SelectPopperPosition = React45.forwardRef((props, forwardedRef) => {
|
|
9700
9693
|
const {
|
|
9701
9694
|
__scopeSelect,
|
|
9702
9695
|
align = "start",
|
|
@@ -9731,13 +9724,13 @@ var SelectPopperPosition = React44.forwardRef((props, forwardedRef) => {
|
|
|
9731
9724
|
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
9732
9725
|
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME4, {});
|
|
9733
9726
|
var VIEWPORT_NAME = "SelectViewport";
|
|
9734
|
-
var SelectViewport =
|
|
9727
|
+
var SelectViewport = React45.forwardRef(
|
|
9735
9728
|
(props, forwardedRef) => {
|
|
9736
9729
|
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
9737
9730
|
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
9738
9731
|
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
9739
9732
|
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
9740
|
-
const prevScrollTopRef =
|
|
9733
|
+
const prevScrollTopRef = React45.useRef(0);
|
|
9741
9734
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9742
9735
|
/* @__PURE__ */ jsx(
|
|
9743
9736
|
"style",
|
|
@@ -9800,7 +9793,7 @@ var SelectViewport = React44.forwardRef(
|
|
|
9800
9793
|
SelectViewport.displayName = VIEWPORT_NAME;
|
|
9801
9794
|
var GROUP_NAME4 = "SelectGroup";
|
|
9802
9795
|
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME4);
|
|
9803
|
-
var SelectGroup =
|
|
9796
|
+
var SelectGroup = React45.forwardRef(
|
|
9804
9797
|
(props, forwardedRef) => {
|
|
9805
9798
|
const { __scopeSelect, ...groupProps } = props;
|
|
9806
9799
|
const groupId = useId();
|
|
@@ -9809,7 +9802,7 @@ var SelectGroup = React44.forwardRef(
|
|
|
9809
9802
|
);
|
|
9810
9803
|
SelectGroup.displayName = GROUP_NAME4;
|
|
9811
9804
|
var LABEL_NAME3 = "SelectLabel";
|
|
9812
|
-
var SelectLabel =
|
|
9805
|
+
var SelectLabel = React45.forwardRef(
|
|
9813
9806
|
(props, forwardedRef) => {
|
|
9814
9807
|
const { __scopeSelect, ...labelProps } = props;
|
|
9815
9808
|
const groupContext = useSelectGroupContext(LABEL_NAME3, __scopeSelect);
|
|
@@ -9819,7 +9812,7 @@ var SelectLabel = React44.forwardRef(
|
|
|
9819
9812
|
SelectLabel.displayName = LABEL_NAME3;
|
|
9820
9813
|
var ITEM_NAME4 = "SelectItem";
|
|
9821
9814
|
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME4);
|
|
9822
|
-
var SelectItem =
|
|
9815
|
+
var SelectItem = React45.forwardRef(
|
|
9823
9816
|
(props, forwardedRef) => {
|
|
9824
9817
|
const {
|
|
9825
9818
|
__scopeSelect,
|
|
@@ -9831,14 +9824,14 @@ var SelectItem = React44.forwardRef(
|
|
|
9831
9824
|
const context = useSelectContext(ITEM_NAME4, __scopeSelect);
|
|
9832
9825
|
const contentContext = useSelectContentContext(ITEM_NAME4, __scopeSelect);
|
|
9833
9826
|
const isSelected = context.value === value;
|
|
9834
|
-
const [textValue, setTextValue] =
|
|
9835
|
-
const [isFocused, setIsFocused] =
|
|
9827
|
+
const [textValue, setTextValue] = React45.useState(textValueProp ?? "");
|
|
9828
|
+
const [isFocused, setIsFocused] = React45.useState(false);
|
|
9836
9829
|
const composedRefs = useComposedRefs(
|
|
9837
9830
|
forwardedRef,
|
|
9838
9831
|
(node) => contentContext.itemRefCallback?.(node, value, disabled)
|
|
9839
9832
|
);
|
|
9840
9833
|
const textId = useId();
|
|
9841
|
-
const pointerTypeRef =
|
|
9834
|
+
const pointerTypeRef = React45.useRef("touch");
|
|
9842
9835
|
const handleSelect = () => {
|
|
9843
9836
|
if (!disabled) {
|
|
9844
9837
|
context.onValueChange(value);
|
|
@@ -9858,7 +9851,7 @@ var SelectItem = React44.forwardRef(
|
|
|
9858
9851
|
disabled,
|
|
9859
9852
|
textId,
|
|
9860
9853
|
isSelected,
|
|
9861
|
-
onItemTextChange:
|
|
9854
|
+
onItemTextChange: React45.useCallback((node) => {
|
|
9862
9855
|
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
9863
9856
|
}, []),
|
|
9864
9857
|
children: /* @__PURE__ */ jsx(
|
|
@@ -9921,14 +9914,14 @@ var SelectItem = React44.forwardRef(
|
|
|
9921
9914
|
);
|
|
9922
9915
|
SelectItem.displayName = ITEM_NAME4;
|
|
9923
9916
|
var ITEM_TEXT_NAME = "SelectItemText";
|
|
9924
|
-
var SelectItemText =
|
|
9917
|
+
var SelectItemText = React45.forwardRef(
|
|
9925
9918
|
(props, forwardedRef) => {
|
|
9926
9919
|
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
9927
9920
|
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9928
9921
|
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9929
9922
|
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9930
9923
|
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
9931
|
-
const [itemTextNode, setItemTextNode] =
|
|
9924
|
+
const [itemTextNode, setItemTextNode] = React45.useState(null);
|
|
9932
9925
|
const composedRefs = useComposedRefs(
|
|
9933
9926
|
forwardedRef,
|
|
9934
9927
|
(node) => setItemTextNode(node),
|
|
@@ -9936,7 +9929,7 @@ var SelectItemText = React44.forwardRef(
|
|
|
9936
9929
|
(node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled)
|
|
9937
9930
|
);
|
|
9938
9931
|
const textContent = itemTextNode?.textContent;
|
|
9939
|
-
const nativeOption =
|
|
9932
|
+
const nativeOption = React45.useMemo(
|
|
9940
9933
|
() => /* @__PURE__ */ jsx("option", { value: itemContext.value, disabled: itemContext.disabled, children: textContent }, itemContext.value),
|
|
9941
9934
|
[itemContext.disabled, itemContext.value, textContent]
|
|
9942
9935
|
);
|
|
@@ -9953,7 +9946,7 @@ var SelectItemText = React44.forwardRef(
|
|
|
9953
9946
|
);
|
|
9954
9947
|
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
9955
9948
|
var ITEM_INDICATOR_NAME2 = "SelectItemIndicator";
|
|
9956
|
-
var SelectItemIndicator =
|
|
9949
|
+
var SelectItemIndicator = React45.forwardRef(
|
|
9957
9950
|
(props, forwardedRef) => {
|
|
9958
9951
|
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
9959
9952
|
const itemContext = useSelectItemContext(ITEM_INDICATOR_NAME2, __scopeSelect);
|
|
@@ -9962,10 +9955,10 @@ var SelectItemIndicator = React44.forwardRef(
|
|
|
9962
9955
|
);
|
|
9963
9956
|
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME2;
|
|
9964
9957
|
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
9965
|
-
var SelectScrollUpButton =
|
|
9958
|
+
var SelectScrollUpButton = React45.forwardRef((props, forwardedRef) => {
|
|
9966
9959
|
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9967
9960
|
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
9968
|
-
const [canScrollUp, setCanScrollUp] =
|
|
9961
|
+
const [canScrollUp, setCanScrollUp] = React45.useState(false);
|
|
9969
9962
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
9970
9963
|
useLayoutEffect2(() => {
|
|
9971
9964
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -9995,10 +9988,10 @@ var SelectScrollUpButton = React44.forwardRef((props, forwardedRef) => {
|
|
|
9995
9988
|
});
|
|
9996
9989
|
SelectScrollUpButton.displayName = SCROLL_UP_BUTTON_NAME;
|
|
9997
9990
|
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
9998
|
-
var SelectScrollDownButton =
|
|
9991
|
+
var SelectScrollDownButton = React45.forwardRef((props, forwardedRef) => {
|
|
9999
9992
|
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
10000
9993
|
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
10001
|
-
const [canScrollDown, setCanScrollDown] =
|
|
9994
|
+
const [canScrollDown, setCanScrollDown] = React45.useState(false);
|
|
10002
9995
|
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
10003
9996
|
useLayoutEffect2(() => {
|
|
10004
9997
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
@@ -10028,18 +10021,18 @@ var SelectScrollDownButton = React44.forwardRef((props, forwardedRef) => {
|
|
|
10028
10021
|
) : null;
|
|
10029
10022
|
});
|
|
10030
10023
|
SelectScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
10031
|
-
var SelectScrollButtonImpl =
|
|
10024
|
+
var SelectScrollButtonImpl = React45.forwardRef((props, forwardedRef) => {
|
|
10032
10025
|
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
10033
10026
|
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
10034
|
-
const autoScrollTimerRef =
|
|
10027
|
+
const autoScrollTimerRef = React45.useRef(null);
|
|
10035
10028
|
const getItems = useCollection3(__scopeSelect);
|
|
10036
|
-
const clearAutoScrollTimer =
|
|
10029
|
+
const clearAutoScrollTimer = React45.useCallback(() => {
|
|
10037
10030
|
if (autoScrollTimerRef.current !== null) {
|
|
10038
10031
|
window.clearInterval(autoScrollTimerRef.current);
|
|
10039
10032
|
autoScrollTimerRef.current = null;
|
|
10040
10033
|
}
|
|
10041
10034
|
}, []);
|
|
10042
|
-
|
|
10035
|
+
React45.useEffect(() => {
|
|
10043
10036
|
return () => clearAutoScrollTimer();
|
|
10044
10037
|
}, [clearAutoScrollTimer]);
|
|
10045
10038
|
useLayoutEffect2(() => {
|
|
@@ -10071,7 +10064,7 @@ var SelectScrollButtonImpl = React44.forwardRef((props, forwardedRef) => {
|
|
|
10071
10064
|
);
|
|
10072
10065
|
});
|
|
10073
10066
|
var SEPARATOR_NAME3 = "SelectSeparator";
|
|
10074
|
-
var SelectSeparator =
|
|
10067
|
+
var SelectSeparator = React45.forwardRef(
|
|
10075
10068
|
(props, forwardedRef) => {
|
|
10076
10069
|
const { __scopeSelect, ...separatorProps } = props;
|
|
10077
10070
|
return /* @__PURE__ */ jsx(Primitive.div, { "aria-hidden": true, ...separatorProps, ref: forwardedRef });
|
|
@@ -10079,7 +10072,7 @@ var SelectSeparator = React44.forwardRef(
|
|
|
10079
10072
|
);
|
|
10080
10073
|
SelectSeparator.displayName = SEPARATOR_NAME3;
|
|
10081
10074
|
var ARROW_NAME4 = "SelectArrow";
|
|
10082
|
-
var SelectArrow =
|
|
10075
|
+
var SelectArrow = React45.forwardRef(
|
|
10083
10076
|
(props, forwardedRef) => {
|
|
10084
10077
|
const { __scopeSelect, ...arrowProps } = props;
|
|
10085
10078
|
const popperScope = usePopperScope2(__scopeSelect);
|
|
@@ -10090,12 +10083,12 @@ var SelectArrow = React44.forwardRef(
|
|
|
10090
10083
|
);
|
|
10091
10084
|
SelectArrow.displayName = ARROW_NAME4;
|
|
10092
10085
|
var BUBBLE_INPUT_NAME = "SelectBubbleInput";
|
|
10093
|
-
var SelectBubbleInput =
|
|
10086
|
+
var SelectBubbleInput = React45.forwardRef(
|
|
10094
10087
|
({ __scopeSelect, value, ...props }, forwardedRef) => {
|
|
10095
|
-
const ref =
|
|
10088
|
+
const ref = React45.useRef(null);
|
|
10096
10089
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10097
10090
|
const prevValue = usePrevious(value);
|
|
10098
|
-
|
|
10091
|
+
React45.useEffect(() => {
|
|
10099
10092
|
const select = ref.current;
|
|
10100
10093
|
if (!select) return;
|
|
10101
10094
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -10127,9 +10120,9 @@ function shouldShowPlaceholder(value) {
|
|
|
10127
10120
|
}
|
|
10128
10121
|
function useTypeaheadSearch(onSearchChange) {
|
|
10129
10122
|
const handleSearchChange = useCallbackRef(onSearchChange);
|
|
10130
|
-
const searchRef =
|
|
10131
|
-
const timerRef =
|
|
10132
|
-
const handleTypeaheadSearch =
|
|
10123
|
+
const searchRef = React45.useRef("");
|
|
10124
|
+
const timerRef = React45.useRef(0);
|
|
10125
|
+
const handleTypeaheadSearch = React45.useCallback(
|
|
10133
10126
|
(key) => {
|
|
10134
10127
|
const search = searchRef.current + key;
|
|
10135
10128
|
handleSearchChange(search);
|
|
@@ -10141,11 +10134,11 @@ function useTypeaheadSearch(onSearchChange) {
|
|
|
10141
10134
|
},
|
|
10142
10135
|
[handleSearchChange]
|
|
10143
10136
|
);
|
|
10144
|
-
const resetTypeahead =
|
|
10137
|
+
const resetTypeahead = React45.useCallback(() => {
|
|
10145
10138
|
searchRef.current = "";
|
|
10146
10139
|
window.clearTimeout(timerRef.current);
|
|
10147
10140
|
}, []);
|
|
10148
|
-
|
|
10141
|
+
React45.useEffect(() => {
|
|
10149
10142
|
return () => window.clearTimeout(timerRef.current);
|
|
10150
10143
|
}, []);
|
|
10151
10144
|
return [searchRef, handleTypeaheadSearch, resetTypeahead];
|
|
@@ -10182,19 +10175,19 @@ var ScrollDownButton = SelectScrollDownButton;
|
|
|
10182
10175
|
function Select2({
|
|
10183
10176
|
...props
|
|
10184
10177
|
}) {
|
|
10185
|
-
return /* @__PURE__ */
|
|
10178
|
+
return /* @__PURE__ */ React45.createElement(Root24, { "data-slot": "select", ...props });
|
|
10186
10179
|
}
|
|
10187
10180
|
function SelectValue2({
|
|
10188
10181
|
...props
|
|
10189
10182
|
}) {
|
|
10190
|
-
return /* @__PURE__ */
|
|
10183
|
+
return /* @__PURE__ */ React45.createElement(Value, { "data-slot": "select-value", ...props });
|
|
10191
10184
|
}
|
|
10192
10185
|
function SelectTrigger2({
|
|
10193
10186
|
className,
|
|
10194
10187
|
children,
|
|
10195
10188
|
...props
|
|
10196
10189
|
}) {
|
|
10197
|
-
return /* @__PURE__ */
|
|
10190
|
+
return /* @__PURE__ */ React45.createElement(
|
|
10198
10191
|
Trigger2,
|
|
10199
10192
|
{
|
|
10200
10193
|
"data-slot": "select-trigger",
|
|
@@ -10205,7 +10198,7 @@ function SelectTrigger2({
|
|
|
10205
10198
|
...props
|
|
10206
10199
|
},
|
|
10207
10200
|
children,
|
|
10208
|
-
/* @__PURE__ */
|
|
10201
|
+
/* @__PURE__ */ React45.createElement(Icon2, { asChild: true }, /* @__PURE__ */ React45.createElement(ChevronDown, { className: "uii:size-4 uii:opacity-50" }))
|
|
10209
10202
|
);
|
|
10210
10203
|
}
|
|
10211
10204
|
function SelectContent2({
|
|
@@ -10217,7 +10210,7 @@ function SelectContent2({
|
|
|
10217
10210
|
hideScrollDownButton = false,
|
|
10218
10211
|
...props
|
|
10219
10212
|
}) {
|
|
10220
|
-
return /* @__PURE__ */
|
|
10213
|
+
return /* @__PURE__ */ React45.createElement(Portal3, null, /* @__PURE__ */ React45.createElement(
|
|
10221
10214
|
Content23,
|
|
10222
10215
|
{
|
|
10223
10216
|
"data-slot": "select-content",
|
|
@@ -10230,8 +10223,8 @@ function SelectContent2({
|
|
|
10230
10223
|
position,
|
|
10231
10224
|
...props
|
|
10232
10225
|
},
|
|
10233
|
-
!hideScrollUpButton && /* @__PURE__ */
|
|
10234
|
-
/* @__PURE__ */
|
|
10226
|
+
!hideScrollUpButton && /* @__PURE__ */ React45.createElement(SelectScrollUpButton2, null),
|
|
10227
|
+
/* @__PURE__ */ React45.createElement(
|
|
10235
10228
|
Viewport,
|
|
10236
10229
|
{
|
|
10237
10230
|
className: cn(
|
|
@@ -10241,8 +10234,8 @@ function SelectContent2({
|
|
|
10241
10234
|
},
|
|
10242
10235
|
children
|
|
10243
10236
|
),
|
|
10244
|
-
footer ? /* @__PURE__ */
|
|
10245
|
-
!hideScrollDownButton && /* @__PURE__ */
|
|
10237
|
+
footer ? /* @__PURE__ */ React45.createElement("div", { className: "uii:border-t uii:p-2 uii:bg-popover" }, footer) : null,
|
|
10238
|
+
!hideScrollDownButton && /* @__PURE__ */ React45.createElement(SelectScrollDownButton2, null)
|
|
10246
10239
|
));
|
|
10247
10240
|
}
|
|
10248
10241
|
function SelectItem2({
|
|
@@ -10250,7 +10243,7 @@ function SelectItem2({
|
|
|
10250
10243
|
children,
|
|
10251
10244
|
...props
|
|
10252
10245
|
}) {
|
|
10253
|
-
return /* @__PURE__ */
|
|
10246
|
+
return /* @__PURE__ */ React45.createElement(
|
|
10254
10247
|
Item3,
|
|
10255
10248
|
{
|
|
10256
10249
|
"data-slot": "select-item",
|
|
@@ -10260,15 +10253,15 @@ function SelectItem2({
|
|
|
10260
10253
|
),
|
|
10261
10254
|
...props
|
|
10262
10255
|
},
|
|
10263
|
-
/* @__PURE__ */
|
|
10264
|
-
/* @__PURE__ */
|
|
10256
|
+
/* @__PURE__ */ React45.createElement("span", { className: "uii:absolute uii:right-2 uii:flex uii:size-3.5 uii:items-center uii:justify-center" }, /* @__PURE__ */ React45.createElement(ItemIndicator3, null, /* @__PURE__ */ React45.createElement(Check, { className: "uii:size-4" }))),
|
|
10257
|
+
/* @__PURE__ */ React45.createElement(ItemText, null, children)
|
|
10265
10258
|
);
|
|
10266
10259
|
}
|
|
10267
10260
|
function SelectScrollUpButton2({
|
|
10268
10261
|
className,
|
|
10269
10262
|
...props
|
|
10270
10263
|
}) {
|
|
10271
|
-
return /* @__PURE__ */
|
|
10264
|
+
return /* @__PURE__ */ React45.createElement(
|
|
10272
10265
|
ScrollUpButton,
|
|
10273
10266
|
{
|
|
10274
10267
|
"data-slot": "select-scroll-up-button",
|
|
@@ -10278,14 +10271,14 @@ function SelectScrollUpButton2({
|
|
|
10278
10271
|
),
|
|
10279
10272
|
...props
|
|
10280
10273
|
},
|
|
10281
|
-
/* @__PURE__ */
|
|
10274
|
+
/* @__PURE__ */ React45.createElement(ChevronUp, { className: "uii:size-4" })
|
|
10282
10275
|
);
|
|
10283
10276
|
}
|
|
10284
10277
|
function SelectScrollDownButton2({
|
|
10285
10278
|
className,
|
|
10286
10279
|
...props
|
|
10287
10280
|
}) {
|
|
10288
|
-
return /* @__PURE__ */
|
|
10281
|
+
return /* @__PURE__ */ React45.createElement(
|
|
10289
10282
|
ScrollDownButton,
|
|
10290
10283
|
{
|
|
10291
10284
|
"data-slot": "select-scroll-down-button",
|
|
@@ -10295,14 +10288,14 @@ function SelectScrollDownButton2({
|
|
|
10295
10288
|
),
|
|
10296
10289
|
...props
|
|
10297
10290
|
},
|
|
10298
|
-
/* @__PURE__ */
|
|
10291
|
+
/* @__PURE__ */ React45.createElement(ChevronDown, { className: "uii:size-4" })
|
|
10299
10292
|
);
|
|
10300
10293
|
}
|
|
10301
10294
|
|
|
10302
10295
|
// src/components/fields/Select.tsx
|
|
10303
10296
|
function useResolvedExpectedType2(expectedType, devCtx) {
|
|
10304
10297
|
const inferredTypes = devCtx?.inferredTypes;
|
|
10305
|
-
return
|
|
10298
|
+
return React45.useMemo(() => {
|
|
10306
10299
|
if (!expectedType) return "any";
|
|
10307
10300
|
if (!expectedType.startsWith("$infer<")) {
|
|
10308
10301
|
return expectedType;
|
|
@@ -10349,44 +10342,44 @@ function Select3({
|
|
|
10349
10342
|
}) {
|
|
10350
10343
|
const devCtx = useContext(DevContext);
|
|
10351
10344
|
const resolvedExpectedType = useResolvedExpectedType2(expectedType, devCtx);
|
|
10352
|
-
const [isExpressionMode, setIsExpressionMode] =
|
|
10353
|
-
const [expressionValue, setExpressionValue] =
|
|
10354
|
-
const options =
|
|
10345
|
+
const [isExpressionMode, setIsExpressionMode] = React45.useState(false);
|
|
10346
|
+
const [expressionValue, setExpressionValue] = React45.useState("");
|
|
10347
|
+
const options = React45.useMemo(() => {
|
|
10355
10348
|
return rawOptions.map(
|
|
10356
10349
|
(opt) => typeof opt === "string" ? { value: opt, label: opt } : opt
|
|
10357
10350
|
);
|
|
10358
10351
|
}, [rawOptions]);
|
|
10359
|
-
const displayValue =
|
|
10352
|
+
const displayValue = React45.useMemo(() => {
|
|
10360
10353
|
if (value != null && typeof value === "object" && "expression" in value) {
|
|
10361
10354
|
return String(value.expression ?? "");
|
|
10362
10355
|
}
|
|
10363
10356
|
return String(value ?? "");
|
|
10364
10357
|
}, [value]);
|
|
10365
|
-
const isExpression =
|
|
10358
|
+
const isExpression = React45.useMemo(() => {
|
|
10366
10359
|
return value && typeof value === "object" && "expression" in value;
|
|
10367
10360
|
}, [value]);
|
|
10368
|
-
|
|
10361
|
+
React45.useEffect(() => {
|
|
10369
10362
|
if (isExpression) {
|
|
10370
10363
|
setIsExpressionMode(true);
|
|
10371
10364
|
setExpressionValue(displayValue);
|
|
10372
10365
|
}
|
|
10373
10366
|
}, [isExpression, displayValue]);
|
|
10374
|
-
const handleSelectChange =
|
|
10367
|
+
const handleSelectChange = React45.useCallback((newValue) => {
|
|
10375
10368
|
if (newValue === "__expression__") {
|
|
10376
10369
|
setIsExpressionMode(true);
|
|
10377
10370
|
return;
|
|
10378
10371
|
}
|
|
10379
10372
|
onChange(newValue);
|
|
10380
10373
|
}, [onChange]);
|
|
10381
|
-
const handleExpressionChange =
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
const handleSwitchToValue =
|
|
10374
|
+
const handleExpressionChange = React45.useCallback(
|
|
10375
|
+
(e) => {
|
|
10376
|
+
const newValue = e.target.value;
|
|
10377
|
+
setExpressionValue(newValue);
|
|
10378
|
+
onChange(newValue);
|
|
10379
|
+
},
|
|
10380
|
+
[onChange]
|
|
10381
|
+
);
|
|
10382
|
+
const handleSwitchToValue = React45.useCallback(() => {
|
|
10390
10383
|
setIsExpressionMode(false);
|
|
10391
10384
|
setExpressionValue("");
|
|
10392
10385
|
onChange("");
|
|
@@ -10415,7 +10408,7 @@ function Select3({
|
|
|
10415
10408
|
hasError: showError
|
|
10416
10409
|
};
|
|
10417
10410
|
const isWaiting = resolvedExpectedType.startsWith("Waiting for:") || resolvedExpectedType.startsWith("Subscribing to:");
|
|
10418
|
-
return /* @__PURE__ */
|
|
10411
|
+
return /* @__PURE__ */ React45.createElement("div", { className: cn("uii:mb-2", className) }, /* @__PURE__ */ React45.createElement("div", { className: "uii:flex uii:items-center uii:gap-2 uii:mt-2" }, /* @__PURE__ */ React45.createElement(
|
|
10419
10412
|
"label",
|
|
10420
10413
|
{
|
|
10421
10414
|
htmlFor: fieldName,
|
|
@@ -10423,7 +10416,7 @@ function Select3({
|
|
|
10423
10416
|
},
|
|
10424
10417
|
label,
|
|
10425
10418
|
":"
|
|
10426
|
-
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */
|
|
10419
|
+
), resolvedExpectedType !== "$.interface.timer" && /* @__PURE__ */ React45.createElement(
|
|
10427
10420
|
"span",
|
|
10428
10421
|
{
|
|
10429
10422
|
className: cn(
|
|
@@ -10433,12 +10426,12 @@ function Select3({
|
|
|
10433
10426
|
title: resolvedExpectedType
|
|
10434
10427
|
},
|
|
10435
10428
|
resolvedExpectedType
|
|
10436
|
-
), showError && /* @__PURE__ */
|
|
10429
|
+
), showError && /* @__PURE__ */ React45.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__ */ React45.createElement("div", { className: "uii:mt-0.5" }, children ? (
|
|
10437
10430
|
// Use custom render function
|
|
10438
10431
|
children(renderProps)
|
|
10439
10432
|
) : isExpressionMode ? (
|
|
10440
10433
|
// Expression mode - show input with clear button
|
|
10441
|
-
/* @__PURE__ */
|
|
10434
|
+
/* @__PURE__ */ React45.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__ */ React45.createElement(
|
|
10442
10435
|
"input",
|
|
10443
10436
|
{
|
|
10444
10437
|
id: fieldName,
|
|
@@ -10454,7 +10447,7 @@ function Select3({
|
|
|
10454
10447
|
disabled && "uii:opacity-50 uii:cursor-not-allowed"
|
|
10455
10448
|
)
|
|
10456
10449
|
}
|
|
10457
|
-
), /* @__PURE__ */
|
|
10450
|
+
), /* @__PURE__ */ React45.createElement(
|
|
10458
10451
|
"button",
|
|
10459
10452
|
{
|
|
10460
10453
|
type: "button",
|
|
@@ -10496,21 +10489,21 @@ function Select3({
|
|
|
10496
10489
|
// 📝 Custom Expression
|
|
10497
10490
|
// </option>
|
|
10498
10491
|
// </select>
|
|
10499
|
-
/* @__PURE__ */
|
|
10492
|
+
/* @__PURE__ */ React45.createElement(
|
|
10500
10493
|
Select2,
|
|
10501
10494
|
{
|
|
10502
10495
|
value: displayValue,
|
|
10503
10496
|
onValueChange: (e) => handleSelectChange(e),
|
|
10504
10497
|
disabled: disabled ?? disabled
|
|
10505
10498
|
},
|
|
10506
|
-
/* @__PURE__ */
|
|
10499
|
+
/* @__PURE__ */ React45.createElement(
|
|
10507
10500
|
SelectTrigger2,
|
|
10508
10501
|
{
|
|
10509
10502
|
className: "ui:w-full ui:h-9 ui:px-3 ui:border ui:border-input ui:rounded-sm ui:bg-background"
|
|
10510
10503
|
},
|
|
10511
|
-
/* @__PURE__ */
|
|
10504
|
+
/* @__PURE__ */ React45.createElement(SelectValue2, { placeholder })
|
|
10512
10505
|
),
|
|
10513
|
-
/* @__PURE__ */
|
|
10506
|
+
/* @__PURE__ */ React45.createElement(SelectContent2, null, options.map((opt) => /* @__PURE__ */ React45.createElement(SelectItem2, { key: opt.value, value: opt.value }, opt.node ? opt.node : /* @__PURE__ */ React45.createElement(React45.Fragment, null, opt.label))))
|
|
10514
10507
|
)
|
|
10515
10508
|
)));
|
|
10516
10509
|
}
|
|
@@ -10641,12 +10634,12 @@ function useFieldPath(fieldName) {
|
|
|
10641
10634
|
return fieldName;
|
|
10642
10635
|
}
|
|
10643
10636
|
function TemplateFieldProvider({ children }) {
|
|
10644
|
-
return /* @__PURE__ */
|
|
10637
|
+
return /* @__PURE__ */ React45__default.createElement(React45__default.Fragment, null, children);
|
|
10645
10638
|
}
|
|
10646
10639
|
function NestedFieldProvider({
|
|
10647
10640
|
children
|
|
10648
10641
|
}) {
|
|
10649
|
-
return /* @__PURE__ */
|
|
10642
|
+
return /* @__PURE__ */ React45__default.createElement(React45__default.Fragment, null, children);
|
|
10650
10643
|
}
|
|
10651
10644
|
var InferredTypesContext = createContext(null);
|
|
10652
10645
|
function useInferredTypes() {
|
|
@@ -10664,7 +10657,7 @@ function useInferredTypes() {
|
|
|
10664
10657
|
return realContext;
|
|
10665
10658
|
}
|
|
10666
10659
|
function InferredTypesProvider({ children }) {
|
|
10667
|
-
return /* @__PURE__ */
|
|
10660
|
+
return /* @__PURE__ */ React45__default.createElement(React45__default.Fragment, null, children);
|
|
10668
10661
|
}
|
|
10669
10662
|
function intersectTypes(types) {
|
|
10670
10663
|
const validTypes = types.filter((t) => !!t && t.length > 0);
|
|
@@ -10725,7 +10718,7 @@ function getOperatorsForType(type) {
|
|
|
10725
10718
|
];
|
|
10726
10719
|
}
|
|
10727
10720
|
function NodePropertyProvider({ children }) {
|
|
10728
|
-
return /* @__PURE__ */
|
|
10721
|
+
return /* @__PURE__ */ React45__default.createElement(React45__default.Fragment, null, children);
|
|
10729
10722
|
}
|
|
10730
10723
|
function useSetFieldMetadataOnly() {
|
|
10731
10724
|
return useCallback((_fieldKey, _metadata) => {
|
|
@@ -10740,7 +10733,7 @@ function useNodeProperty(key) {
|
|
|
10740
10733
|
const [devValue, setDevValue] = useState(
|
|
10741
10734
|
() => devContext?.data?.[key]
|
|
10742
10735
|
);
|
|
10743
|
-
|
|
10736
|
+
React45__default.useEffect(() => {
|
|
10744
10737
|
if (devContext) {
|
|
10745
10738
|
setDevValue(devContext.data[key]);
|
|
10746
10739
|
}
|
|
@@ -10764,7 +10757,7 @@ function useNodeProperties() {
|
|
|
10764
10757
|
const [devData, setDevData] = useState(
|
|
10765
10758
|
() => devContext?.data ?? {}
|
|
10766
10759
|
);
|
|
10767
|
-
|
|
10760
|
+
React45__default.useEffect(() => {
|
|
10768
10761
|
if (devContext) {
|
|
10769
10762
|
setDevData({ ...devContext.data });
|
|
10770
10763
|
}
|
|
@@ -10790,7 +10783,7 @@ function useInferredType(fieldName) {
|
|
|
10790
10783
|
const [devInferredType, setDevInferredType] = useState(
|
|
10791
10784
|
() => devContext?.inferredTypes?.[fieldName]
|
|
10792
10785
|
);
|
|
10793
|
-
|
|
10786
|
+
React45__default.useEffect(() => {
|
|
10794
10787
|
if (devContext) {
|
|
10795
10788
|
setDevInferredType(devContext.inferredTypes[fieldName]);
|
|
10796
10789
|
}
|
|
@@ -10852,7 +10845,7 @@ function useAllInferredTypes() {
|
|
|
10852
10845
|
const [devTypes, setDevTypes] = useState(
|
|
10853
10846
|
() => devContext?.inferredTypes ?? {}
|
|
10854
10847
|
);
|
|
10855
|
-
|
|
10848
|
+
React45__default.useEffect(() => {
|
|
10856
10849
|
if (devContext) {
|
|
10857
10850
|
setDevTypes({ ...devContext.inferredTypes });
|
|
10858
10851
|
}
|
|
@@ -10916,6 +10909,25 @@ function useFieldValidation() {
|
|
|
10916
10909
|
validateField
|
|
10917
10910
|
};
|
|
10918
10911
|
}
|
|
10912
|
+
|
|
10913
|
+
// src/components/slots/index.tsx
|
|
10914
|
+
var slots_exports = {};
|
|
10915
|
+
__export(slots_exports, {
|
|
10916
|
+
ExportManager: () => ExportManager,
|
|
10917
|
+
SlotElements: () => SlotElements
|
|
10918
|
+
});
|
|
10919
|
+
|
|
10920
|
+
// src/components/slots/SlotElements.tsx
|
|
10921
|
+
var SlotElements = (props) => {
|
|
10922
|
+
const { slotId } = props;
|
|
10923
|
+
return /* @__PURE__ */ React.createElement("div", { className: "uii:flex uii:flex-row uii:gap-2 uii:border-dashed uii:border uii:border-gray-300 \n uii:rounded-sm uii:p-2 uii:h-10 uii:w-full uii:items-center uii:justify-start uii:p-1" }, /* @__PURE__ */ React.createElement("div", { className: "uii:w-8 uii:h-8 uii:rounded-xs uii:overflow-hidden uii:flex uii:items-center uii:justify-center uii:relative uii:z-20" }, /* @__PURE__ */ React.createElement("img", { alt: "Send GET Request", className: "uii:w-8 uii:h-8 uii:object-contain uii:rounded-xs uii:z-20", src: "https://res.cloudinary.com/process-co/image/fetch/w_64,h_64,c_fill,g_face/https://res.cloudinary.com/process-co/image/upload/v1755226713/namespace-icons/http.svg" })), /* @__PURE__ */ React.createElement("div", { className: "uii:w-8 uii:h-8 uii:rounded-xs uii:overflow-hidden uii:flex uii:items-center uii:justify-center uii:relative uii:z-20" }, /* @__PURE__ */ React.createElement("img", { alt: "Send GET Request", className: "uii:w-8 uii:h-8 uii:object-contain uii:rounded-xs uii:z-20", src: "https://res.cloudinary.com/process-co/image/fetch/w_64,h_64,c_fill,g_face/https://res.cloudinary.com/process-co/image/upload/v1755227094/namespace-icons/mailgun.svg" })), /* @__PURE__ */ React.createElement("div", { className: "uii:w-8 uii:h-8 uii:rounded-xs uii:overflow-hidden uii:flex uii:items-center uii:justify-center uii:relative uii:z-20" }, /* @__PURE__ */ React.createElement("img", { alt: "Send GET Request", className: "uii:w-8 uii:h-8 uii:object-contain uii:rounded-xs uii:z-20", src: "https://res.cloudinary.com/process-co/image/upload/v1772002004/img.icons8.com.png" })), /* @__PURE__ */ React.createElement("div", { className: "uii:w-8 uii:h-8 uii:rounded-xs uii:overflow-hidden uii:flex uii:items-center uii:justify-center uii:relative uii:z-20" }, /* @__PURE__ */ React.createElement("img", { alt: "Send GET Request", className: "uii:w-8 uii:h-8 uii:object-contain uii:rounded-xs uii:z-20", src: "https://res.cloudinary.com/process-co/image/fetch/w_64,h_64,c_fill,g_face/https://res.cloudinary.com/process-co/image/upload/v1755226713/namespace-icons/http.svg" })));
|
|
10924
|
+
};
|
|
10925
|
+
|
|
10926
|
+
// src/components/slots/ExportManager.tsx
|
|
10927
|
+
var ExportManager = (props) => {
|
|
10928
|
+
const { slotId } = props;
|
|
10929
|
+
return /* @__PURE__ */ React.createElement(Button, { variant: "outline", size: "sm" }, "Manage Exports");
|
|
10930
|
+
};
|
|
10919
10931
|
/*! Bundled license information:
|
|
10920
10932
|
|
|
10921
10933
|
lucide-react/dist/esm/shared/src/utils.js:
|
|
@@ -10936,6 +10948,6 @@ lucide-react/dist/esm/lucide-react.js:
|
|
|
10936
10948
|
*)
|
|
10937
10949
|
*/
|
|
10938
10950
|
|
|
10939
|
-
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 };
|
|
10951
|
+
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, slots_exports as slots, toggleButtonVariants };
|
|
10940
10952
|
//# sourceMappingURL=index.js.map
|
|
10941
10953
|
//# sourceMappingURL=index.js.map
|