lizaui 9.0.11 → 9.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/button/index.es.js +1 -1
- package/dist/calendar/index.es.js +1 -1
- package/dist/checkbox/index.es.js +1 -1
- package/dist/chunks/{button-B0fpJrMg.js → button-CA3Y2GZ1.js} +2 -2
- package/dist/chunks/{button-B0fpJrMg.js.map → button-CA3Y2GZ1.js.map} +1 -1
- package/dist/chunks/{checkbox-C1Sssumg.js → checkbox-qzZKMLRN.js} +2 -2
- package/dist/chunks/{checkbox-C1Sssumg.js.map → checkbox-qzZKMLRN.js.map} +1 -1
- package/dist/chunks/{floating-ui.dom-DsMDyTcd.js → floating-ui.dom-N5ROFCJy.js} +1 -10
- package/dist/chunks/{floating-ui.dom-DsMDyTcd.js.map → floating-ui.dom-N5ROFCJy.js.map} +1 -1
- package/dist/chunks/{floating-ui.dom-Bd-QJw02.js → floating-ui.dom-NqZWWqNg.js} +4 -13
- package/dist/chunks/{floating-ui.dom-Bd-QJw02.js.map → floating-ui.dom-NqZWWqNg.js.map} +1 -1
- package/dist/chunks/index-CuySPbdY.js +559 -0
- package/dist/chunks/index-CuySPbdY.js.map +1 -0
- package/dist/chunks/index-DBDBh58Q.js +575 -0
- package/dist/chunks/index-DBDBh58Q.js.map +1 -0
- package/dist/chunks/index-DNSql2gU.js +662 -0
- package/dist/chunks/index-DNSql2gU.js.map +1 -0
- package/dist/chunks/{index-B4RTH1-D.js → index-DiC9dI6_.js} +4 -4
- package/dist/chunks/{index-B4RTH1-D.js.map → index-DiC9dI6_.js.map} +1 -1
- package/dist/chunks/index-DlZi5TkN.js +646 -0
- package/dist/chunks/index-DlZi5TkN.js.map +1 -0
- package/dist/chunks/{scroll-area-JgKF61tc.js → scroll-area-BcM0NCEM.js} +4 -4
- package/dist/chunks/{scroll-area-JgKF61tc.js.map → scroll-area-BcM0NCEM.js.map} +1 -1
- package/dist/chunks/{scroll-area-C0NhSIO2.js → scroll-area-CgJodNZ_.js} +27 -27
- package/dist/chunks/{scroll-area-C0NhSIO2.js.map → scroll-area-CgJodNZ_.js.map} +1 -1
- package/dist/chunks/{select-Dpyj5dUk.js → select-DaKy-WhC.js} +11 -367
- package/dist/chunks/select-DaKy-WhC.js.map +1 -0
- package/dist/chunks/{select-DGnc8VJi.js → select-DyihZY-4.js} +83 -439
- package/dist/chunks/select-DyihZY-4.js.map +1 -0
- package/dist/chunks/{textarea-D2_KC-J4.js → textarea-By2Vv44z.js} +36 -587
- package/dist/chunks/textarea-By2Vv44z.js.map +1 -0
- package/dist/chunks/{textarea-_HQpXiCX.js → textarea-ClJsk9Gp.js} +35 -586
- package/dist/chunks/textarea-ClJsk9Gp.js.map +1 -0
- package/dist/chunks/tooltip-D4UvkD2G.js +525 -0
- package/dist/chunks/tooltip-D4UvkD2G.js.map +1 -0
- package/dist/chunks/tooltip-WGeoFpGx.js +541 -0
- package/dist/chunks/tooltip-WGeoFpGx.js.map +1 -0
- package/dist/components/tooltip/tooltip.d.ts +1 -1
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/divider/index.es.js +1 -1
- package/dist/modal/index.es.js +1 -1
- package/dist/pagination/index.cjs.js +2 -2
- package/dist/pagination/index.es.js +3 -3
- package/dist/phone-input/index.cjs.js +2 -2
- package/dist/phone-input/index.es.js +3 -3
- package/dist/select-input/index.cjs.js +1 -1
- package/dist/select-input/index.es.js +2 -2
- package/dist/table/index.cjs.js +1 -1
- package/dist/table/index.es.js +2 -2
- package/dist/time-input/index.cjs.js +1 -1
- package/dist/time-input/index.es.js +2 -2
- package/dist/tooltip/index.cjs.js +1 -1
- package/dist/tooltip/index.es.js +1 -1
- package/dist/ui/index.cjs.js +292 -290
- package/dist/ui/index.cjs.js.map +1 -1
- package/dist/ui/index.es.js +192 -190
- package/dist/ui/index.es.js.map +1 -1
- package/package.json +10 -10
- package/dist/chunks/floating-ui.react-dom-CjlUwp8V.js +0 -294
- package/dist/chunks/floating-ui.react-dom-CjlUwp8V.js.map +0 -1
- package/dist/chunks/floating-ui.react-dom-D5BI9L2i.js +0 -310
- package/dist/chunks/floating-ui.react-dom-D5BI9L2i.js.map +0 -1
- package/dist/chunks/select-DGnc8VJi.js.map +0 -1
- package/dist/chunks/select-Dpyj5dUk.js.map +0 -1
- package/dist/chunks/textarea-D2_KC-J4.js.map +0 -1
- package/dist/chunks/textarea-_HQpXiCX.js.map +0 -1
- package/dist/chunks/tooltip-GGFk8ALK.js +0 -1402
- package/dist/chunks/tooltip-GGFk8ALK.js.map +0 -1
- package/dist/chunks/tooltip-JwIbppjO.js +0 -1387
- package/dist/chunks/tooltip-JwIbppjO.js.map +0 -1
package/dist/ui/index.cjs.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const textarea = require("../chunks/textarea-
|
|
3
|
+
const textarea = require("../chunks/textarea-By2Vv44z.js");
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const React = require("react");
|
|
6
|
+
const index = require("../chunks/index-DBDBh58Q.js");
|
|
6
7
|
const utils = require("../chunks/utils-ij3i9zTT.js");
|
|
7
8
|
const labelError = require("../chunks/label-error-C8lIsfXu.js");
|
|
8
|
-
const index = require("../chunks/index-C_sOsPRt.js");
|
|
9
|
-
const select = require("../chunks/select-
|
|
10
|
-
const index$
|
|
11
|
-
const index$
|
|
12
|
-
const
|
|
9
|
+
const index$1 = require("../chunks/index-C_sOsPRt.js");
|
|
10
|
+
const select = require("../chunks/select-DyihZY-4.js");
|
|
11
|
+
const index$2 = require("../chunks/index-BPW1Qzmi.js");
|
|
12
|
+
const index$3 = require("../chunks/index-DNSql2gU.js");
|
|
13
|
+
const index$4 = require("../chunks/index-DaMyCNJ8.js");
|
|
14
|
+
const scrollArea = require("../chunks/scroll-area-CgJodNZ_.js");
|
|
13
15
|
const ReactDOM = require("react-dom");
|
|
14
16
|
const button = require("../chunks/button-d5z8H59K.js");
|
|
15
17
|
function _interopNamespaceDefault(e) {
|
|
@@ -32,7 +34,7 @@ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
|
32
34
|
var NAME$1 = "Label";
|
|
33
35
|
var Label$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
34
36
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35
|
-
|
|
37
|
+
index.Primitive.label,
|
|
36
38
|
{
|
|
37
39
|
...props,
|
|
38
40
|
ref: forwardedRef,
|
|
@@ -64,7 +66,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
|
64
66
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
65
67
|
var GROUP_NAME$3 = "RovingFocusGroup";
|
|
66
68
|
var [Collection$4, useCollection$4, createCollectionScope$4] = select.createCollection(GROUP_NAME$3);
|
|
67
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] =
|
|
69
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = index.createContextScope(
|
|
68
70
|
GROUP_NAME$3,
|
|
69
71
|
[createCollectionScope$4]
|
|
70
72
|
);
|
|
@@ -89,16 +91,16 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
89
91
|
...groupProps
|
|
90
92
|
} = props;
|
|
91
93
|
const ref = React__namespace.useRef(null);
|
|
92
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
93
|
-
const direction = index$
|
|
94
|
-
const [currentTabStopId, setCurrentTabStopId] =
|
|
94
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
95
|
+
const direction = index$2.useDirection(dir);
|
|
96
|
+
const [currentTabStopId, setCurrentTabStopId] = index.useControllableState({
|
|
95
97
|
prop: currentTabStopIdProp,
|
|
96
98
|
defaultProp: defaultCurrentTabStopId ?? null,
|
|
97
99
|
onChange: onCurrentTabStopIdChange,
|
|
98
100
|
caller: GROUP_NAME$3
|
|
99
101
|
});
|
|
100
102
|
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
101
|
-
const handleEntryFocus =
|
|
103
|
+
const handleEntryFocus = index.useCallbackRef(onEntryFocus);
|
|
102
104
|
const getItems = useCollection$4(__scopeRovingFocusGroup);
|
|
103
105
|
const isClickFocusRef = React__namespace.useRef(false);
|
|
104
106
|
const [focusableItemsCount, setFocusableItemsCount] = React__namespace.useState(0);
|
|
@@ -131,17 +133,17 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
131
133
|
[]
|
|
132
134
|
),
|
|
133
135
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
|
-
|
|
136
|
+
index.Primitive.div,
|
|
135
137
|
{
|
|
136
138
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
137
139
|
"data-orientation": orientation,
|
|
138
140
|
...groupProps,
|
|
139
141
|
ref: composedRefs,
|
|
140
142
|
style: { outline: "none", ...props.style },
|
|
141
|
-
onMouseDown:
|
|
143
|
+
onMouseDown: index.composeEventHandlers(props.onMouseDown, () => {
|
|
142
144
|
isClickFocusRef.current = true;
|
|
143
145
|
}),
|
|
144
|
-
onFocus:
|
|
146
|
+
onFocus: index.composeEventHandlers(props.onFocus, (event) => {
|
|
145
147
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
146
148
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
147
149
|
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
@@ -159,7 +161,7 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
159
161
|
}
|
|
160
162
|
isClickFocusRef.current = false;
|
|
161
163
|
}),
|
|
162
|
-
onBlur:
|
|
164
|
+
onBlur: index.composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
163
165
|
}
|
|
164
166
|
)
|
|
165
167
|
}
|
|
@@ -176,7 +178,7 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
176
178
|
children,
|
|
177
179
|
...itemProps
|
|
178
180
|
} = props;
|
|
179
|
-
const autoId =
|
|
181
|
+
const autoId = index.useId();
|
|
180
182
|
const id = tabStopId || autoId;
|
|
181
183
|
const context = useRovingFocusContext(ITEM_NAME$6, __scopeRovingFocusGroup);
|
|
182
184
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
@@ -196,18 +198,18 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
196
198
|
focusable,
|
|
197
199
|
active,
|
|
198
200
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
-
|
|
201
|
+
index.Primitive.span,
|
|
200
202
|
{
|
|
201
203
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
202
204
|
"data-orientation": context.orientation,
|
|
203
205
|
...itemProps,
|
|
204
206
|
ref: forwardedRef,
|
|
205
|
-
onMouseDown:
|
|
207
|
+
onMouseDown: index.composeEventHandlers(props.onMouseDown, (event) => {
|
|
206
208
|
if (!focusable) event.preventDefault();
|
|
207
209
|
else context.onItemFocus(id);
|
|
208
210
|
}),
|
|
209
|
-
onFocus:
|
|
210
|
-
onKeyDown:
|
|
211
|
+
onFocus: index.composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
212
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
211
213
|
if (event.key === "Tab" && event.shiftKey) {
|
|
212
214
|
context.onItemShiftTab();
|
|
213
215
|
return;
|
|
@@ -283,12 +285,12 @@ var SUB_CLOSE_KEYS = {
|
|
|
283
285
|
};
|
|
284
286
|
var MENU_NAME$1 = "Menu";
|
|
285
287
|
var [Collection$3, useCollection$3, createCollectionScope$3] = select.createCollection(MENU_NAME$1);
|
|
286
|
-
var [createMenuContext, createMenuScope] =
|
|
288
|
+
var [createMenuContext, createMenuScope] = index.createContextScope(MENU_NAME$1, [
|
|
287
289
|
createCollectionScope$3,
|
|
288
|
-
|
|
290
|
+
index$3.createPopperScope,
|
|
289
291
|
createRovingFocusGroupScope
|
|
290
292
|
]);
|
|
291
|
-
var usePopperScope$2 =
|
|
293
|
+
var usePopperScope$2 = index$3.createPopperScope();
|
|
292
294
|
var useRovingFocusGroupScope$3 = createRovingFocusGroupScope();
|
|
293
295
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME$1);
|
|
294
296
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME$1);
|
|
@@ -297,8 +299,8 @@ var Menu$1 = (props) => {
|
|
|
297
299
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
298
300
|
const [content, setContent] = React__namespace.useState(null);
|
|
299
301
|
const isUsingKeyboardRef = React__namespace.useRef(false);
|
|
300
|
-
const handleOpenChange =
|
|
301
|
-
const direction = index$
|
|
302
|
+
const handleOpenChange = index.useCallbackRef(onOpenChange);
|
|
303
|
+
const direction = index$2.useDirection(dir);
|
|
302
304
|
React__namespace.useEffect(() => {
|
|
303
305
|
const handleKeyDown = () => {
|
|
304
306
|
isUsingKeyboardRef.current = true;
|
|
@@ -313,7 +315,7 @@ var Menu$1 = (props) => {
|
|
|
313
315
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
314
316
|
};
|
|
315
317
|
}, []);
|
|
316
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
318
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Root2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
317
319
|
MenuProvider,
|
|
318
320
|
{
|
|
319
321
|
scope: __scopeMenu,
|
|
@@ -341,7 +343,7 @@ var MenuAnchor = React__namespace.forwardRef(
|
|
|
341
343
|
(props, forwardedRef) => {
|
|
342
344
|
const { __scopeMenu, ...anchorProps } = props;
|
|
343
345
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
344
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
346
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
345
347
|
}
|
|
346
348
|
);
|
|
347
349
|
MenuAnchor.displayName = ANCHOR_NAME$1;
|
|
@@ -352,7 +354,7 @@ var [PortalProvider$2, usePortalContext$2] = createMenuContext(PORTAL_NAME$5, {
|
|
|
352
354
|
var MenuPortal = (props) => {
|
|
353
355
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
354
356
|
const context = useMenuContext(PORTAL_NAME$5, __scopeMenu);
|
|
355
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider$2, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
357
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider$2, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(index.Portal, { asChild: true, container, children }) }) });
|
|
356
358
|
};
|
|
357
359
|
MenuPortal.displayName = PORTAL_NAME$5;
|
|
358
360
|
var CONTENT_NAME$9 = "MenuContent";
|
|
@@ -363,14 +365,14 @@ var MenuContent = React__namespace.forwardRef(
|
|
|
363
365
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
364
366
|
const context = useMenuContext(CONTENT_NAME$9, props.__scopeMenu);
|
|
365
367
|
const rootContext = useMenuRootContext(CONTENT_NAME$9, props.__scopeMenu);
|
|
366
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
368
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
367
369
|
}
|
|
368
370
|
);
|
|
369
371
|
var MenuRootContentModal = React__namespace.forwardRef(
|
|
370
372
|
(props, forwardedRef) => {
|
|
371
373
|
const context = useMenuContext(CONTENT_NAME$9, props.__scopeMenu);
|
|
372
374
|
const ref = React__namespace.useRef(null);
|
|
373
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
375
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
374
376
|
React__namespace.useEffect(() => {
|
|
375
377
|
const content = ref.current;
|
|
376
378
|
if (content) return textarea.hideOthers(content);
|
|
@@ -383,7 +385,7 @@ var MenuRootContentModal = React__namespace.forwardRef(
|
|
|
383
385
|
trapFocus: context.open,
|
|
384
386
|
disableOutsidePointerEvents: context.open,
|
|
385
387
|
disableOutsideScroll: true,
|
|
386
|
-
onFocusOutside:
|
|
388
|
+
onFocusOutside: index.composeEventHandlers(
|
|
387
389
|
props.onFocusOutside,
|
|
388
390
|
(event) => event.preventDefault(),
|
|
389
391
|
{ checkForDefaultPrevented: false }
|
|
@@ -407,7 +409,7 @@ var MenuRootContentNonModal = React__namespace.forwardRef((props, forwardedRef)
|
|
|
407
409
|
}
|
|
408
410
|
);
|
|
409
411
|
});
|
|
410
|
-
var Slot$1 = index.createSlot("MenuContent.ScrollLock");
|
|
412
|
+
var Slot$1 = index$1.createSlot("MenuContent.ScrollLock");
|
|
411
413
|
var MenuContentImpl = React__namespace.forwardRef(
|
|
412
414
|
(props, forwardedRef) => {
|
|
413
415
|
const {
|
|
@@ -433,7 +435,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
433
435
|
const getItems = useCollection$3(__scopeMenu);
|
|
434
436
|
const [currentItemId, setCurrentItemId] = React__namespace.useState(null);
|
|
435
437
|
const contentRef = React__namespace.useRef(null);
|
|
436
|
-
const composedRefs = index.useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
438
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
437
439
|
const timerRef = React__namespace.useRef(0);
|
|
438
440
|
const searchRef = React__namespace.useRef("");
|
|
439
441
|
const pointerGraceTimerRef = React__namespace.useRef(0);
|
|
@@ -501,13 +503,13 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
501
503
|
{
|
|
502
504
|
asChild: true,
|
|
503
505
|
trapped: trapFocus,
|
|
504
|
-
onMountAutoFocus:
|
|
506
|
+
onMountAutoFocus: index.composeEventHandlers(onOpenAutoFocus, (event) => {
|
|
505
507
|
event.preventDefault();
|
|
506
508
|
contentRef.current?.focus({ preventScroll: true });
|
|
507
509
|
}),
|
|
508
510
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
509
511
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
510
|
-
|
|
512
|
+
index.DismissableLayer,
|
|
511
513
|
{
|
|
512
514
|
asChild: true,
|
|
513
515
|
disableOutsidePointerEvents,
|
|
@@ -526,12 +528,12 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
526
528
|
loop,
|
|
527
529
|
currentTabStopId: currentItemId,
|
|
528
530
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
529
|
-
onEntryFocus:
|
|
531
|
+
onEntryFocus: index.composeEventHandlers(onEntryFocus, (event) => {
|
|
530
532
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
531
533
|
}),
|
|
532
534
|
preventScrollOnEntryFocus: true,
|
|
533
535
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
534
|
-
|
|
536
|
+
index$3.Content,
|
|
535
537
|
{
|
|
536
538
|
role: "menu",
|
|
537
539
|
"aria-orientation": "vertical",
|
|
@@ -542,7 +544,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
542
544
|
...contentProps,
|
|
543
545
|
ref: composedRefs,
|
|
544
546
|
style: { outline: "none", ...contentProps.style },
|
|
545
|
-
onKeyDown:
|
|
547
|
+
onKeyDown: index.composeEventHandlers(contentProps.onKeyDown, (event) => {
|
|
546
548
|
const target = event.target;
|
|
547
549
|
const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
|
|
548
550
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
@@ -560,13 +562,13 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
560
562
|
if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
561
563
|
focusFirst$1(candidateNodes);
|
|
562
564
|
}),
|
|
563
|
-
onBlur:
|
|
565
|
+
onBlur: index.composeEventHandlers(props.onBlur, (event) => {
|
|
564
566
|
if (!event.currentTarget.contains(event.target)) {
|
|
565
567
|
window.clearTimeout(timerRef.current);
|
|
566
568
|
searchRef.current = "";
|
|
567
569
|
}
|
|
568
570
|
}),
|
|
569
|
-
onPointerMove:
|
|
571
|
+
onPointerMove: index.composeEventHandlers(
|
|
570
572
|
props.onPointerMove,
|
|
571
573
|
whenMouse$1((event) => {
|
|
572
574
|
const target = event.target;
|
|
@@ -595,7 +597,7 @@ var GROUP_NAME$2 = "MenuGroup";
|
|
|
595
597
|
var MenuGroup = React__namespace.forwardRef(
|
|
596
598
|
(props, forwardedRef) => {
|
|
597
599
|
const { __scopeMenu, ...groupProps } = props;
|
|
598
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
600
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
599
601
|
}
|
|
600
602
|
);
|
|
601
603
|
MenuGroup.displayName = GROUP_NAME$2;
|
|
@@ -603,7 +605,7 @@ var LABEL_NAME$2 = "MenuLabel";
|
|
|
603
605
|
var MenuLabel = React__namespace.forwardRef(
|
|
604
606
|
(props, forwardedRef) => {
|
|
605
607
|
const { __scopeMenu, ...labelProps } = props;
|
|
606
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
608
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { ...labelProps, ref: forwardedRef });
|
|
607
609
|
}
|
|
608
610
|
);
|
|
609
611
|
MenuLabel.displayName = LABEL_NAME$2;
|
|
@@ -615,14 +617,14 @@ var MenuItem = React__namespace.forwardRef(
|
|
|
615
617
|
const ref = React__namespace.useRef(null);
|
|
616
618
|
const rootContext = useMenuRootContext(ITEM_NAME$5, props.__scopeMenu);
|
|
617
619
|
const contentContext = useMenuContentContext(ITEM_NAME$5, props.__scopeMenu);
|
|
618
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
620
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
619
621
|
const isPointerDownRef = React__namespace.useRef(false);
|
|
620
622
|
const handleSelect = () => {
|
|
621
623
|
const menuItem = ref.current;
|
|
622
624
|
if (!disabled && menuItem) {
|
|
623
625
|
const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });
|
|
624
626
|
menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });
|
|
625
|
-
|
|
627
|
+
index.dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);
|
|
626
628
|
if (itemSelectEvent.defaultPrevented) {
|
|
627
629
|
isPointerDownRef.current = false;
|
|
628
630
|
} else {
|
|
@@ -636,15 +638,15 @@ var MenuItem = React__namespace.forwardRef(
|
|
|
636
638
|
...itemProps,
|
|
637
639
|
ref: composedRefs,
|
|
638
640
|
disabled,
|
|
639
|
-
onClick:
|
|
641
|
+
onClick: index.composeEventHandlers(props.onClick, handleSelect),
|
|
640
642
|
onPointerDown: (event) => {
|
|
641
643
|
props.onPointerDown?.(event);
|
|
642
644
|
isPointerDownRef.current = true;
|
|
643
645
|
},
|
|
644
|
-
onPointerUp:
|
|
646
|
+
onPointerUp: index.composeEventHandlers(props.onPointerUp, (event) => {
|
|
645
647
|
if (!isPointerDownRef.current) event.currentTarget?.click();
|
|
646
648
|
}),
|
|
647
|
-
onKeyDown:
|
|
649
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
648
650
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
649
651
|
if (disabled || isTypingAhead && event.key === " ") return;
|
|
650
652
|
if (SELECTION_KEYS.includes(event.key)) {
|
|
@@ -663,7 +665,7 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
663
665
|
const contentContext = useMenuContentContext(ITEM_NAME$5, __scopeMenu);
|
|
664
666
|
const rovingFocusGroupScope = useRovingFocusGroupScope$3(__scopeMenu);
|
|
665
667
|
const ref = React__namespace.useRef(null);
|
|
666
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
668
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
667
669
|
const [isFocused, setIsFocused] = React__namespace.useState(false);
|
|
668
670
|
const [textContent, setTextContent] = React__namespace.useState("");
|
|
669
671
|
React__namespace.useEffect(() => {
|
|
@@ -679,7 +681,7 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
679
681
|
disabled,
|
|
680
682
|
textValue: textValue ?? textContent,
|
|
681
683
|
children: /* @__PURE__ */ jsxRuntime.jsx(Item$2, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
682
|
-
|
|
684
|
+
index.Primitive.div,
|
|
683
685
|
{
|
|
684
686
|
role: "menuitem",
|
|
685
687
|
"data-highlighted": isFocused ? "" : void 0,
|
|
@@ -687,7 +689,7 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
687
689
|
"data-disabled": disabled ? "" : void 0,
|
|
688
690
|
...itemProps,
|
|
689
691
|
ref: composedRefs,
|
|
690
|
-
onPointerMove:
|
|
692
|
+
onPointerMove: index.composeEventHandlers(
|
|
691
693
|
props.onPointerMove,
|
|
692
694
|
whenMouse$1((event) => {
|
|
693
695
|
if (disabled) {
|
|
@@ -701,12 +703,12 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
701
703
|
}
|
|
702
704
|
})
|
|
703
705
|
),
|
|
704
|
-
onPointerLeave:
|
|
706
|
+
onPointerLeave: index.composeEventHandlers(
|
|
705
707
|
props.onPointerLeave,
|
|
706
708
|
whenMouse$1((event) => contentContext.onItemLeave(event))
|
|
707
709
|
),
|
|
708
|
-
onFocus:
|
|
709
|
-
onBlur:
|
|
710
|
+
onFocus: index.composeEventHandlers(props.onFocus, () => setIsFocused(true)),
|
|
711
|
+
onBlur: index.composeEventHandlers(props.onBlur, () => setIsFocused(false))
|
|
710
712
|
}
|
|
711
713
|
) })
|
|
712
714
|
}
|
|
@@ -725,7 +727,7 @@ var MenuCheckboxItem = React__namespace.forwardRef(
|
|
|
725
727
|
...checkboxItemProps,
|
|
726
728
|
ref: forwardedRef,
|
|
727
729
|
"data-state": getCheckedState(checked),
|
|
728
|
-
onSelect:
|
|
730
|
+
onSelect: index.composeEventHandlers(
|
|
729
731
|
checkboxItemProps.onSelect,
|
|
730
732
|
() => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
|
|
731
733
|
{ checkForDefaultPrevented: false }
|
|
@@ -744,7 +746,7 @@ var [RadioGroupProvider$1, useRadioGroupContext$1] = createMenuContext(
|
|
|
744
746
|
var MenuRadioGroup = React__namespace.forwardRef(
|
|
745
747
|
(props, forwardedRef) => {
|
|
746
748
|
const { value, onValueChange, ...groupProps } = props;
|
|
747
|
-
const handleValueChange =
|
|
749
|
+
const handleValueChange = index.useCallbackRef(onValueChange);
|
|
748
750
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupProvider$1, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
749
751
|
}
|
|
750
752
|
);
|
|
@@ -763,7 +765,7 @@ var MenuRadioItem = React__namespace.forwardRef(
|
|
|
763
765
|
...radioItemProps,
|
|
764
766
|
ref: forwardedRef,
|
|
765
767
|
"data-state": getCheckedState(checked),
|
|
766
|
-
onSelect:
|
|
768
|
+
onSelect: index.composeEventHandlers(
|
|
767
769
|
radioItemProps.onSelect,
|
|
768
770
|
() => context.onValueChange?.(value),
|
|
769
771
|
{ checkForDefaultPrevented: false }
|
|
@@ -783,11 +785,11 @@ var MenuItemIndicator = React__namespace.forwardRef(
|
|
|
783
785
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
784
786
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
785
787
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
786
|
-
|
|
788
|
+
index.Presence,
|
|
787
789
|
{
|
|
788
790
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
789
791
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
790
|
-
|
|
792
|
+
index.Primitive.span,
|
|
791
793
|
{
|
|
792
794
|
...itemIndicatorProps,
|
|
793
795
|
ref: forwardedRef,
|
|
@@ -804,7 +806,7 @@ var MenuSeparator = React__namespace.forwardRef(
|
|
|
804
806
|
(props, forwardedRef) => {
|
|
805
807
|
const { __scopeMenu, ...separatorProps } = props;
|
|
806
808
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
807
|
-
|
|
809
|
+
index.Primitive.div,
|
|
808
810
|
{
|
|
809
811
|
role: "separator",
|
|
810
812
|
"aria-orientation": "horizontal",
|
|
@@ -820,7 +822,7 @@ var MenuArrow = React__namespace.forwardRef(
|
|
|
820
822
|
(props, forwardedRef) => {
|
|
821
823
|
const { __scopeMenu, ...arrowProps } = props;
|
|
822
824
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
823
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
825
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
824
826
|
}
|
|
825
827
|
);
|
|
826
828
|
MenuArrow.displayName = ARROW_NAME$4;
|
|
@@ -832,12 +834,12 @@ var MenuSub = (props) => {
|
|
|
832
834
|
const popperScope = usePopperScope$2(__scopeMenu);
|
|
833
835
|
const [trigger, setTrigger] = React__namespace.useState(null);
|
|
834
836
|
const [content, setContent] = React__namespace.useState(null);
|
|
835
|
-
const handleOpenChange =
|
|
837
|
+
const handleOpenChange = index.useCallbackRef(onOpenChange);
|
|
836
838
|
React__namespace.useEffect(() => {
|
|
837
839
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
838
840
|
return () => handleOpenChange(false);
|
|
839
841
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
840
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
842
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Root2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
841
843
|
MenuProvider,
|
|
842
844
|
{
|
|
843
845
|
scope: __scopeMenu,
|
|
@@ -849,8 +851,8 @@ var MenuSub = (props) => {
|
|
|
849
851
|
MenuSubProvider,
|
|
850
852
|
{
|
|
851
853
|
scope: __scopeMenu,
|
|
852
|
-
contentId:
|
|
853
|
-
triggerId:
|
|
854
|
+
contentId: index.useId(),
|
|
855
|
+
triggerId: index.useId(),
|
|
854
856
|
trigger,
|
|
855
857
|
onTriggerChange: setTrigger,
|
|
856
858
|
children
|
|
@@ -891,14 +893,14 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
891
893
|
"aria-controls": subContext.contentId,
|
|
892
894
|
"data-state": getOpenState$1(context.open),
|
|
893
895
|
...props,
|
|
894
|
-
ref: index.composeRefs(forwardedRef, subContext.onTriggerChange),
|
|
896
|
+
ref: index$1.composeRefs(forwardedRef, subContext.onTriggerChange),
|
|
895
897
|
onClick: (event) => {
|
|
896
898
|
props.onClick?.(event);
|
|
897
899
|
if (props.disabled || event.defaultPrevented) return;
|
|
898
900
|
event.currentTarget.focus();
|
|
899
901
|
if (!context.open) context.onOpenChange(true);
|
|
900
902
|
},
|
|
901
|
-
onPointerMove:
|
|
903
|
+
onPointerMove: index.composeEventHandlers(
|
|
902
904
|
props.onPointerMove,
|
|
903
905
|
whenMouse$1((event) => {
|
|
904
906
|
contentContext.onItemEnter(event);
|
|
@@ -912,7 +914,7 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
912
914
|
}
|
|
913
915
|
})
|
|
914
916
|
),
|
|
915
|
-
onPointerLeave:
|
|
917
|
+
onPointerLeave: index.composeEventHandlers(
|
|
916
918
|
props.onPointerLeave,
|
|
917
919
|
whenMouse$1((event) => {
|
|
918
920
|
clearOpenTimer();
|
|
@@ -947,7 +949,7 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
947
949
|
}
|
|
948
950
|
})
|
|
949
951
|
),
|
|
950
|
-
onKeyDown:
|
|
952
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
951
953
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
952
954
|
if (props.disabled || isTypingAhead && event.key === " ") return;
|
|
953
955
|
if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
@@ -970,8 +972,8 @@ var MenuSubContent = React__namespace.forwardRef(
|
|
|
970
972
|
const rootContext = useMenuRootContext(CONTENT_NAME$9, props.__scopeMenu);
|
|
971
973
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$2, props.__scopeMenu);
|
|
972
974
|
const ref = React__namespace.useRef(null);
|
|
973
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
974
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
975
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
976
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$3.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
975
977
|
MenuContentImpl,
|
|
976
978
|
{
|
|
977
979
|
id: subContext.contentId,
|
|
@@ -988,14 +990,14 @@ var MenuSubContent = React__namespace.forwardRef(
|
|
|
988
990
|
event.preventDefault();
|
|
989
991
|
},
|
|
990
992
|
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
991
|
-
onFocusOutside:
|
|
993
|
+
onFocusOutside: index.composeEventHandlers(props.onFocusOutside, (event) => {
|
|
992
994
|
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
993
995
|
}),
|
|
994
|
-
onEscapeKeyDown:
|
|
996
|
+
onEscapeKeyDown: index.composeEventHandlers(props.onEscapeKeyDown, (event) => {
|
|
995
997
|
rootContext.onClose();
|
|
996
998
|
event.preventDefault();
|
|
997
999
|
}),
|
|
998
|
-
onKeyDown:
|
|
1000
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
999
1001
|
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
1000
1002
|
const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
1001
1003
|
if (isKeyDownInside && isCloseKey) {
|
|
@@ -1081,7 +1083,7 @@ var Sub = MenuSub;
|
|
|
1081
1083
|
var SubTrigger = MenuSubTrigger;
|
|
1082
1084
|
var SubContent = MenuSubContent;
|
|
1083
1085
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1084
|
-
var [createDropdownMenuContext
|
|
1086
|
+
var [createDropdownMenuContext] = index.createContextScope(
|
|
1085
1087
|
DROPDOWN_MENU_NAME,
|
|
1086
1088
|
[createMenuScope]
|
|
1087
1089
|
);
|
|
@@ -1099,7 +1101,7 @@ var DropdownMenu$1 = (props) => {
|
|
|
1099
1101
|
} = props;
|
|
1100
1102
|
const menuScope = useMenuScope$1(__scopeDropdownMenu);
|
|
1101
1103
|
const triggerRef = React__namespace.useRef(null);
|
|
1102
|
-
const [open, setOpen] =
|
|
1104
|
+
const [open, setOpen] = index.useControllableState({
|
|
1103
1105
|
prop: openProp,
|
|
1104
1106
|
defaultProp: defaultOpen ?? false,
|
|
1105
1107
|
onChange: onOpenChange,
|
|
@@ -1109,9 +1111,9 @@ var DropdownMenu$1 = (props) => {
|
|
|
1109
1111
|
DropdownMenuProvider,
|
|
1110
1112
|
{
|
|
1111
1113
|
scope: __scopeDropdownMenu,
|
|
1112
|
-
triggerId:
|
|
1114
|
+
triggerId: index.useId(),
|
|
1113
1115
|
triggerRef,
|
|
1114
|
-
contentId:
|
|
1116
|
+
contentId: index.useId(),
|
|
1115
1117
|
open,
|
|
1116
1118
|
onOpenChange: setOpen,
|
|
1117
1119
|
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
@@ -1128,7 +1130,7 @@ var DropdownMenuTrigger$1 = React__namespace.forwardRef(
|
|
|
1128
1130
|
const context = useDropdownMenuContext(TRIGGER_NAME$8, __scopeDropdownMenu);
|
|
1129
1131
|
const menuScope = useMenuScope$1(__scopeDropdownMenu);
|
|
1130
1132
|
return /* @__PURE__ */ jsxRuntime.jsx(Anchor2$1, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1131
|
-
|
|
1133
|
+
index.Primitive.button,
|
|
1132
1134
|
{
|
|
1133
1135
|
type: "button",
|
|
1134
1136
|
id: context.triggerId,
|
|
@@ -1139,14 +1141,14 @@ var DropdownMenuTrigger$1 = React__namespace.forwardRef(
|
|
|
1139
1141
|
"data-disabled": disabled ? "" : void 0,
|
|
1140
1142
|
disabled,
|
|
1141
1143
|
...triggerProps,
|
|
1142
|
-
ref: index.composeRefs(forwardedRef, context.triggerRef),
|
|
1143
|
-
onPointerDown:
|
|
1144
|
+
ref: index$1.composeRefs(forwardedRef, context.triggerRef),
|
|
1145
|
+
onPointerDown: index.composeEventHandlers(props.onPointerDown, (event) => {
|
|
1144
1146
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
1145
1147
|
context.onOpenToggle();
|
|
1146
1148
|
if (!context.open) event.preventDefault();
|
|
1147
1149
|
}
|
|
1148
1150
|
}),
|
|
1149
|
-
onKeyDown:
|
|
1151
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
1150
1152
|
if (disabled) return;
|
|
1151
1153
|
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
1152
1154
|
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
@@ -1179,12 +1181,12 @@ var DropdownMenuContent$1 = React__namespace.forwardRef(
|
|
|
1179
1181
|
...menuScope,
|
|
1180
1182
|
...contentProps,
|
|
1181
1183
|
ref: forwardedRef,
|
|
1182
|
-
onCloseAutoFocus:
|
|
1184
|
+
onCloseAutoFocus: index.composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1183
1185
|
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
1184
1186
|
hasInteractedOutsideRef.current = false;
|
|
1185
1187
|
event.preventDefault();
|
|
1186
1188
|
}),
|
|
1187
|
-
onInteractOutside:
|
|
1189
|
+
onInteractOutside: index.composeEventHandlers(props.onInteractOutside, (event) => {
|
|
1188
1190
|
const originalEvent = event.detail.originalEvent;
|
|
1189
1191
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1190
1192
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -1280,7 +1282,7 @@ DropdownMenuArrow.displayName = ARROW_NAME$3;
|
|
|
1280
1282
|
var DropdownMenuSub$1 = (props) => {
|
|
1281
1283
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
1282
1284
|
const menuScope = useMenuScope$1(__scopeDropdownMenu);
|
|
1283
|
-
const [open, setOpen] =
|
|
1285
|
+
const [open, setOpen] = index.useControllableState({
|
|
1284
1286
|
prop: openProp,
|
|
1285
1287
|
defaultProp: defaultOpen ?? false,
|
|
1286
1288
|
onChange: onOpenChange,
|
|
@@ -1336,9 +1338,9 @@ var Sub2$1 = DropdownMenuSub$1;
|
|
|
1336
1338
|
var SubTrigger2$1 = DropdownMenuSubTrigger$1;
|
|
1337
1339
|
var SubContent2$1 = DropdownMenuSubContent$1;
|
|
1338
1340
|
const __iconNode$3 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
1339
|
-
const ChevronRight = index$
|
|
1341
|
+
const ChevronRight = index$2.createLucideIcon("chevron-right", __iconNode$3);
|
|
1340
1342
|
const __iconNode$2 = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
1341
|
-
const Circle = index$
|
|
1343
|
+
const Circle = index$2.createLucideIcon("circle", __iconNode$2);
|
|
1342
1344
|
const __iconNode$1 = [
|
|
1343
1345
|
["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
|
|
1344
1346
|
["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
|
|
@@ -1347,9 +1349,9 @@ const __iconNode$1 = [
|
|
|
1347
1349
|
["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
|
|
1348
1350
|
["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
|
|
1349
1351
|
];
|
|
1350
|
-
const GripVertical = index$
|
|
1352
|
+
const GripVertical = index$2.createLucideIcon("grip-vertical", __iconNode$1);
|
|
1351
1353
|
const __iconNode = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
1352
|
-
const Minus = index$
|
|
1354
|
+
const Minus = index$2.createLucideIcon("minus", __iconNode);
|
|
1353
1355
|
function DropdownMenu({ ...props }) {
|
|
1354
1356
|
return /* @__PURE__ */ jsxRuntime.jsx(Root2$7, { "data-slot": "dropdown-menu", ...props });
|
|
1355
1357
|
}
|
|
@@ -1408,7 +1410,7 @@ function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
|
1408
1410
|
checked,
|
|
1409
1411
|
...props,
|
|
1410
1412
|
children: [
|
|
1411
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator2$1, { children: /* @__PURE__ */ jsxRuntime.jsx(index$
|
|
1413
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator2$1, { children: /* @__PURE__ */ jsxRuntime.jsx(index$2.Check, { className: "size-4" }) }) }),
|
|
1412
1414
|
children
|
|
1413
1415
|
]
|
|
1414
1416
|
}
|
|
@@ -1495,7 +1497,7 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
1495
1497
|
);
|
|
1496
1498
|
}
|
|
1497
1499
|
var TABS_NAME = "Tabs";
|
|
1498
|
-
var [createTabsContext
|
|
1500
|
+
var [createTabsContext] = index.createContextScope(TABS_NAME, [
|
|
1499
1501
|
createRovingFocusGroupScope
|
|
1500
1502
|
]);
|
|
1501
1503
|
var useRovingFocusGroupScope$2 = createRovingFocusGroupScope();
|
|
@@ -1512,8 +1514,8 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
1512
1514
|
activationMode = "automatic",
|
|
1513
1515
|
...tabsProps
|
|
1514
1516
|
} = props;
|
|
1515
|
-
const direction = index$
|
|
1516
|
-
const [value, setValue] =
|
|
1517
|
+
const direction = index$2.useDirection(dir);
|
|
1518
|
+
const [value, setValue] = index.useControllableState({
|
|
1517
1519
|
prop: valueProp,
|
|
1518
1520
|
onChange: onValueChange,
|
|
1519
1521
|
defaultProp: defaultValue ?? "",
|
|
@@ -1523,14 +1525,14 @@ var Tabs$1 = React__namespace.forwardRef(
|
|
|
1523
1525
|
TabsProvider,
|
|
1524
1526
|
{
|
|
1525
1527
|
scope: __scopeTabs,
|
|
1526
|
-
baseId:
|
|
1528
|
+
baseId: index.useId(),
|
|
1527
1529
|
value,
|
|
1528
1530
|
onValueChange: setValue,
|
|
1529
1531
|
orientation,
|
|
1530
1532
|
dir: direction,
|
|
1531
1533
|
activationMode,
|
|
1532
1534
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1533
|
-
|
|
1535
|
+
index.Primitive.div,
|
|
1534
1536
|
{
|
|
1535
1537
|
dir: direction,
|
|
1536
1538
|
"data-orientation": orientation,
|
|
@@ -1558,7 +1560,7 @@ var TabsList$1 = React__namespace.forwardRef(
|
|
|
1558
1560
|
dir: context.dir,
|
|
1559
1561
|
loop,
|
|
1560
1562
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1561
|
-
|
|
1563
|
+
index.Primitive.div,
|
|
1562
1564
|
{
|
|
1563
1565
|
role: "tablist",
|
|
1564
1566
|
"aria-orientation": context.orientation,
|
|
@@ -1588,7 +1590,7 @@ var TabsTrigger$1 = React__namespace.forwardRef(
|
|
|
1588
1590
|
focusable: !disabled,
|
|
1589
1591
|
active: isSelected,
|
|
1590
1592
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1591
|
-
|
|
1593
|
+
index.Primitive.button,
|
|
1592
1594
|
{
|
|
1593
1595
|
type: "button",
|
|
1594
1596
|
role: "tab",
|
|
@@ -1600,17 +1602,17 @@ var TabsTrigger$1 = React__namespace.forwardRef(
|
|
|
1600
1602
|
id: triggerId,
|
|
1601
1603
|
...triggerProps,
|
|
1602
1604
|
ref: forwardedRef,
|
|
1603
|
-
onMouseDown:
|
|
1605
|
+
onMouseDown: index.composeEventHandlers(props.onMouseDown, (event) => {
|
|
1604
1606
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
1605
1607
|
context.onValueChange(value);
|
|
1606
1608
|
} else {
|
|
1607
1609
|
event.preventDefault();
|
|
1608
1610
|
}
|
|
1609
1611
|
}),
|
|
1610
|
-
onKeyDown:
|
|
1612
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
1611
1613
|
if ([" ", "Enter"].includes(event.key)) context.onValueChange(value);
|
|
1612
1614
|
}),
|
|
1613
|
-
onFocus:
|
|
1615
|
+
onFocus: index.composeEventHandlers(props.onFocus, () => {
|
|
1614
1616
|
const isAutomaticActivation = context.activationMode !== "manual";
|
|
1615
1617
|
if (!isSelected && !disabled && isAutomaticActivation) {
|
|
1616
1618
|
context.onValueChange(value);
|
|
@@ -1636,8 +1638,8 @@ var TabsContent$1 = React__namespace.forwardRef(
|
|
|
1636
1638
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
1637
1639
|
return () => cancelAnimationFrame(rAF);
|
|
1638
1640
|
}, []);
|
|
1639
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1640
|
-
|
|
1641
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || isSelected, children: ({ present }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1642
|
+
index.Primitive.div,
|
|
1641
1643
|
{
|
|
1642
1644
|
"data-state": isSelected ? "active" : "inactive",
|
|
1643
1645
|
"data-orientation": context.orientation,
|
|
@@ -1865,7 +1867,7 @@ function subscribe() {
|
|
|
1865
1867
|
};
|
|
1866
1868
|
}
|
|
1867
1869
|
var AVATAR_NAME = "Avatar";
|
|
1868
|
-
var [createAvatarContext
|
|
1870
|
+
var [createAvatarContext] = index.createContextScope(AVATAR_NAME);
|
|
1869
1871
|
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
1870
1872
|
var Avatar$1 = React__namespace.forwardRef(
|
|
1871
1873
|
(props, forwardedRef) => {
|
|
@@ -1877,7 +1879,7 @@ var Avatar$1 = React__namespace.forwardRef(
|
|
|
1877
1879
|
scope: __scopeAvatar,
|
|
1878
1880
|
imageLoadingStatus,
|
|
1879
1881
|
onImageLoadingStatusChange: setImageLoadingStatus,
|
|
1880
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1882
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.span, { ...avatarProps, ref: forwardedRef })
|
|
1881
1883
|
}
|
|
1882
1884
|
);
|
|
1883
1885
|
}
|
|
@@ -1890,16 +1892,16 @@ var AvatarImage$1 = React__namespace.forwardRef(
|
|
|
1890
1892
|
}, ...imageProps } = props;
|
|
1891
1893
|
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
1892
1894
|
const imageLoadingStatus = useImageLoadingStatus(src, imageProps);
|
|
1893
|
-
const handleLoadingStatusChange =
|
|
1895
|
+
const handleLoadingStatusChange = index.useCallbackRef((status) => {
|
|
1894
1896
|
onLoadingStatusChange(status);
|
|
1895
1897
|
context.onImageLoadingStatusChange(status);
|
|
1896
1898
|
});
|
|
1897
|
-
|
|
1899
|
+
index.useLayoutEffect2(() => {
|
|
1898
1900
|
if (imageLoadingStatus !== "idle") {
|
|
1899
1901
|
handleLoadingStatusChange(imageLoadingStatus);
|
|
1900
1902
|
}
|
|
1901
1903
|
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
|
1902
|
-
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1904
|
+
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
|
1903
1905
|
}
|
|
1904
1906
|
);
|
|
1905
1907
|
AvatarImage$1.displayName = IMAGE_NAME;
|
|
@@ -1915,7 +1917,7 @@ var AvatarFallback$1 = React__namespace.forwardRef(
|
|
|
1915
1917
|
return () => window.clearTimeout(timerId);
|
|
1916
1918
|
}
|
|
1917
1919
|
}, [delayMs]);
|
|
1918
|
-
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1920
|
+
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
|
1919
1921
|
}
|
|
1920
1922
|
);
|
|
1921
1923
|
AvatarFallback$1.displayName = FALLBACK_NAME;
|
|
@@ -1944,10 +1946,10 @@ function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
|
|
1944
1946
|
const [loadingStatus, setLoadingStatus] = React__namespace.useState(
|
|
1945
1947
|
() => resolveLoadingStatus(image, src)
|
|
1946
1948
|
);
|
|
1947
|
-
|
|
1949
|
+
index.useLayoutEffect2(() => {
|
|
1948
1950
|
setLoadingStatus(resolveLoadingStatus(image, src));
|
|
1949
1951
|
}, [image, src]);
|
|
1950
|
-
|
|
1952
|
+
index.useLayoutEffect2(() => {
|
|
1951
1953
|
const updateStatus = (status) => () => {
|
|
1952
1954
|
setLoadingStatus(status);
|
|
1953
1955
|
};
|
|
@@ -1972,7 +1974,7 @@ function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
|
|
1972
1974
|
var Root$2 = Avatar$1;
|
|
1973
1975
|
var Image = AvatarImage$1;
|
|
1974
1976
|
var Fallback = AvatarFallback$1;
|
|
1975
|
-
const avatarStyles = index$
|
|
1977
|
+
const avatarStyles = index$4.cva(
|
|
1976
1978
|
"flex relative justify-center items-center box-border overflow-hidden align-middle z-0 outline-none data-[focus-visible=true]:z-10 data-[focus-visible=true]:outline-2 data-[focus-visible=true]:outline-focus data-[focus-visible=true]:outline-offset-2 text-tiny text-default-foreground rounded-full",
|
|
1977
1979
|
{
|
|
1978
1980
|
variants: {
|
|
@@ -2032,10 +2034,10 @@ function AvatarFallback({ className, ...props }) {
|
|
|
2032
2034
|
);
|
|
2033
2035
|
}
|
|
2034
2036
|
var POPOVER_NAME = "Popover";
|
|
2035
|
-
var [createPopoverContext
|
|
2036
|
-
|
|
2037
|
+
var [createPopoverContext] = index.createContextScope(POPOVER_NAME, [
|
|
2038
|
+
index$3.createPopperScope
|
|
2037
2039
|
]);
|
|
2038
|
-
var usePopperScope$1 =
|
|
2040
|
+
var usePopperScope$1 = index$3.createPopperScope();
|
|
2039
2041
|
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
2040
2042
|
var Popover$1 = (props) => {
|
|
2041
2043
|
const {
|
|
@@ -2049,17 +2051,17 @@ var Popover$1 = (props) => {
|
|
|
2049
2051
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
2050
2052
|
const triggerRef = React__namespace.useRef(null);
|
|
2051
2053
|
const [hasCustomAnchor, setHasCustomAnchor] = React__namespace.useState(false);
|
|
2052
|
-
const [open, setOpen] =
|
|
2054
|
+
const [open, setOpen] = index.useControllableState({
|
|
2053
2055
|
prop: openProp,
|
|
2054
2056
|
defaultProp: defaultOpen ?? false,
|
|
2055
2057
|
onChange: onOpenChange,
|
|
2056
2058
|
caller: POPOVER_NAME
|
|
2057
2059
|
});
|
|
2058
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2060
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Root2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2059
2061
|
PopoverProvider,
|
|
2060
2062
|
{
|
|
2061
2063
|
scope: __scopePopover,
|
|
2062
|
-
contentId:
|
|
2064
|
+
contentId: index.useId(),
|
|
2063
2065
|
triggerRef,
|
|
2064
2066
|
open,
|
|
2065
2067
|
onOpenChange: setOpen,
|
|
@@ -2084,7 +2086,7 @@ var PopoverAnchor$1 = React__namespace.forwardRef(
|
|
|
2084
2086
|
onCustomAnchorAdd();
|
|
2085
2087
|
return () => onCustomAnchorRemove();
|
|
2086
2088
|
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
2087
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2089
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
2088
2090
|
}
|
|
2089
2091
|
);
|
|
2090
2092
|
PopoverAnchor$1.displayName = ANCHOR_NAME;
|
|
@@ -2094,9 +2096,9 @@ var PopoverTrigger$1 = React__namespace.forwardRef(
|
|
|
2094
2096
|
const { __scopePopover, ...triggerProps } = props;
|
|
2095
2097
|
const context = usePopoverContext(TRIGGER_NAME$6, __scopePopover);
|
|
2096
2098
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
2097
|
-
const composedTriggerRef = index.useComposedRefs(forwardedRef, context.triggerRef);
|
|
2099
|
+
const composedTriggerRef = index$1.useComposedRefs(forwardedRef, context.triggerRef);
|
|
2098
2100
|
const trigger = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2099
|
-
|
|
2101
|
+
index.Primitive.button,
|
|
2100
2102
|
{
|
|
2101
2103
|
type: "button",
|
|
2102
2104
|
"aria-haspopup": "dialog",
|
|
@@ -2105,10 +2107,10 @@ var PopoverTrigger$1 = React__namespace.forwardRef(
|
|
|
2105
2107
|
"data-state": getState$3(context.open),
|
|
2106
2108
|
...triggerProps,
|
|
2107
2109
|
ref: composedTriggerRef,
|
|
2108
|
-
onClick:
|
|
2110
|
+
onClick: index.composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
2109
2111
|
}
|
|
2110
2112
|
);
|
|
2111
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2113
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntime.jsx(index$3.Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
2112
2114
|
}
|
|
2113
2115
|
);
|
|
2114
2116
|
PopoverTrigger$1.displayName = TRIGGER_NAME$6;
|
|
@@ -2119,7 +2121,7 @@ var [PortalProvider$1, usePortalContext$1] = createPopoverContext(PORTAL_NAME$3,
|
|
|
2119
2121
|
var PopoverPortal = (props) => {
|
|
2120
2122
|
const { __scopePopover, forceMount, children, container } = props;
|
|
2121
2123
|
const context = usePopoverContext(PORTAL_NAME$3, __scopePopover);
|
|
2122
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider$1, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2124
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider$1, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(index.Portal, { asChild: true, container, children }) }) });
|
|
2123
2125
|
};
|
|
2124
2126
|
PopoverPortal.displayName = PORTAL_NAME$3;
|
|
2125
2127
|
var CONTENT_NAME$6 = "PopoverContent";
|
|
@@ -2128,16 +2130,16 @@ var PopoverContent$1 = React__namespace.forwardRef(
|
|
|
2128
2130
|
const portalContext = usePortalContext$1(CONTENT_NAME$6, props.__scopePopover);
|
|
2129
2131
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2130
2132
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
2131
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2133
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntime.jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
2132
2134
|
}
|
|
2133
2135
|
);
|
|
2134
2136
|
PopoverContent$1.displayName = CONTENT_NAME$6;
|
|
2135
|
-
var Slot = index.createSlot("PopoverContent.RemoveScroll");
|
|
2137
|
+
var Slot = index$1.createSlot("PopoverContent.RemoveScroll");
|
|
2136
2138
|
var PopoverContentModal = React__namespace.forwardRef(
|
|
2137
2139
|
(props, forwardedRef) => {
|
|
2138
2140
|
const context = usePopoverContext(CONTENT_NAME$6, props.__scopePopover);
|
|
2139
2141
|
const contentRef = React__namespace.useRef(null);
|
|
2140
|
-
const composedRefs = index.useComposedRefs(forwardedRef, contentRef);
|
|
2142
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, contentRef);
|
|
2141
2143
|
const isRightClickOutsideRef = React__namespace.useRef(false);
|
|
2142
2144
|
React__namespace.useEffect(() => {
|
|
2143
2145
|
const content = contentRef.current;
|
|
@@ -2150,11 +2152,11 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
2150
2152
|
ref: composedRefs,
|
|
2151
2153
|
trapFocus: context.open,
|
|
2152
2154
|
disableOutsidePointerEvents: true,
|
|
2153
|
-
onCloseAutoFocus:
|
|
2155
|
+
onCloseAutoFocus: index.composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
2154
2156
|
event.preventDefault();
|
|
2155
2157
|
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
|
2156
2158
|
}),
|
|
2157
|
-
onPointerDownOutside:
|
|
2159
|
+
onPointerDownOutside: index.composeEventHandlers(
|
|
2158
2160
|
props.onPointerDownOutside,
|
|
2159
2161
|
(event) => {
|
|
2160
2162
|
const originalEvent = event.detail.originalEvent;
|
|
@@ -2164,7 +2166,7 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
2164
2166
|
},
|
|
2165
2167
|
{ checkForDefaultPrevented: false }
|
|
2166
2168
|
),
|
|
2167
|
-
onFocusOutside:
|
|
2169
|
+
onFocusOutside: index.composeEventHandlers(
|
|
2168
2170
|
props.onFocusOutside,
|
|
2169
2171
|
(event) => event.preventDefault(),
|
|
2170
2172
|
{ checkForDefaultPrevented: false }
|
|
@@ -2239,7 +2241,7 @@ var PopoverContentImpl = React__namespace.forwardRef(
|
|
|
2239
2241
|
onMountAutoFocus: onOpenAutoFocus,
|
|
2240
2242
|
onUnmountAutoFocus: onCloseAutoFocus,
|
|
2241
2243
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2242
|
-
|
|
2244
|
+
index.DismissableLayer,
|
|
2243
2245
|
{
|
|
2244
2246
|
asChild: true,
|
|
2245
2247
|
disableOutsidePointerEvents,
|
|
@@ -2249,7 +2251,7 @@ var PopoverContentImpl = React__namespace.forwardRef(
|
|
|
2249
2251
|
onFocusOutside,
|
|
2250
2252
|
onDismiss: () => context.onOpenChange(false),
|
|
2251
2253
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2252
|
-
|
|
2254
|
+
index$3.Content,
|
|
2253
2255
|
{
|
|
2254
2256
|
"data-state": getState$3(context.open),
|
|
2255
2257
|
role: "dialog",
|
|
@@ -2282,12 +2284,12 @@ var PopoverClose = React__namespace.forwardRef(
|
|
|
2282
2284
|
const { __scopePopover, ...closeProps } = props;
|
|
2283
2285
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2284
2286
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2285
|
-
|
|
2287
|
+
index.Primitive.button,
|
|
2286
2288
|
{
|
|
2287
2289
|
type: "button",
|
|
2288
2290
|
...closeProps,
|
|
2289
2291
|
ref: forwardedRef,
|
|
2290
|
-
onClick:
|
|
2292
|
+
onClick: index.composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
2291
2293
|
}
|
|
2292
2294
|
);
|
|
2293
2295
|
}
|
|
@@ -2298,7 +2300,7 @@ var PopoverArrow = React__namespace.forwardRef(
|
|
|
2298
2300
|
(props, forwardedRef) => {
|
|
2299
2301
|
const { __scopePopover, ...arrowProps } = props;
|
|
2300
2302
|
const popperScope = usePopperScope$1(__scopePopover);
|
|
2301
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
2302
2304
|
}
|
|
2303
2305
|
);
|
|
2304
2306
|
PopoverArrow.displayName = ARROW_NAME$2;
|
|
@@ -2353,7 +2355,7 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
|
|
|
2353
2355
|
let n = L(() => {
|
|
2354
2356
|
var e, a;
|
|
2355
2357
|
return { search: "", value: (a = (e = r.value) != null ? e : r.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
2356
|
-
}), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 =
|
|
2358
|
+
}), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = index.useId(), q = index.useId(), _ = index.useId(), I = React__namespace.useRef(null), v = ke();
|
|
2357
2359
|
k(() => {
|
|
2358
2360
|
if (R !== void 0) {
|
|
2359
2361
|
let e = R.trim();
|
|
@@ -2483,7 +2485,7 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
|
|
|
2483
2485
|
}, se = (e) => {
|
|
2484
2486
|
e.preventDefault(), e.metaKey ? X2(0) : e.altKey ? re(-1) : Q(-1);
|
|
2485
2487
|
};
|
|
2486
|
-
return React__namespace.createElement(
|
|
2488
|
+
return React__namespace.createElement(index.Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
2487
2489
|
var s;
|
|
2488
2490
|
(s = O.onKeyDown) == null || s.call(O, e);
|
|
2489
2491
|
let a = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
@@ -2526,7 +2528,7 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
|
|
|
2526
2528
|
} }, React__namespace.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B(r, (e) => React__namespace.createElement(de.Provider, { value: E }, React__namespace.createElement(ue.Provider, { value: U2 }, e))));
|
|
2527
2529
|
}), he = React__namespace.forwardRef((r, o) => {
|
|
2528
2530
|
var _, I;
|
|
2529
|
-
let n =
|
|
2531
|
+
let n = index.useId(), u2 = React__namespace.useRef(null), c = React__namespace.useContext(fe), d = K(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
2530
2532
|
k(() => {
|
|
2531
2533
|
if (!p2) return d.item(n, c == null ? void 0 : c.id);
|
|
2532
2534
|
}, [p2]);
|
|
@@ -2544,20 +2546,20 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
|
|
|
2544
2546
|
}
|
|
2545
2547
|
if (!x) return null;
|
|
2546
2548
|
let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
|
|
2547
|
-
return React__namespace.createElement(
|
|
2549
|
+
return React__namespace.createElement(index.Primitive.div, { ref: index$1.composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
|
|
2548
2550
|
}), Ee = React__namespace.forwardRef((r, o) => {
|
|
2549
|
-
let { heading: n, children: u2, forceMount: c, ...d } = r, f =
|
|
2551
|
+
let { heading: n, children: u2, forceMount: c, ...d } = r, f = index.useId(), p2 = React__namespace.useRef(null), b = React__namespace.useRef(null), m2 = index.useId(), R = K(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
|
|
2550
2552
|
k(() => R.group(f), []), ve(f, p2, [r.value, r.heading, b]);
|
|
2551
2553
|
let C = React__namespace.useMemo(() => ({ id: f, forceMount: c }), [c]);
|
|
2552
|
-
return React__namespace.createElement(
|
|
2554
|
+
return React__namespace.createElement(index.Primitive.div, { ref: index$1.composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && React__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B(r, (S) => React__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, React__namespace.createElement(fe.Provider, { value: C }, S))));
|
|
2553
2555
|
}), ye = React__namespace.forwardRef((r, o) => {
|
|
2554
2556
|
let { alwaysRender: n, ...u2 } = r, c = React__namespace.useRef(null), d = P((f) => !f.search);
|
|
2555
|
-
return !n && !d ? null : React__namespace.createElement(
|
|
2557
|
+
return !n && !d ? null : React__namespace.createElement(index.Primitive.div, { ref: index$1.composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
|
|
2556
2558
|
}), Se = React__namespace.forwardRef((r, o) => {
|
|
2557
2559
|
let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K();
|
|
2558
2560
|
return React__namespace.useEffect(() => {
|
|
2559
2561
|
r.value != null && d.setState("search", r.value);
|
|
2560
|
-
}, [r.value]), React__namespace.createElement(
|
|
2562
|
+
}, [r.value]), React__namespace.createElement(index.Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
|
|
2561
2563
|
c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
|
|
2562
2564
|
} });
|
|
2563
2565
|
}), Ce = React__namespace.forwardRef((r, o) => {
|
|
@@ -2574,13 +2576,13 @@ var N = '[cmdk-group=""]', Y = '[cmdk-group-items=""]', be = '[cmdk-group-headin
|
|
|
2574
2576
|
cancelAnimationFrame(x), C.unobserve(m2);
|
|
2575
2577
|
};
|
|
2576
2578
|
}
|
|
2577
|
-
}, []), React__namespace.createElement(
|
|
2579
|
+
}, []), React__namespace.createElement(index.Primitive.div, { ref: index$1.composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B(r, (m2) => React__namespace.createElement("div", { ref: index$1.composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
|
|
2578
2580
|
}), xe = React__namespace.forwardRef((r, o) => {
|
|
2579
2581
|
let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
|
|
2580
|
-
return React__namespace.createElement(textarea.Root, { open: n, onOpenChange: u2 }, React__namespace.createElement(textarea.Portal
|
|
2581
|
-
}), Ie = React__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? React__namespace.createElement(
|
|
2582
|
+
return React__namespace.createElement(textarea.Root, { open: n, onOpenChange: u2 }, React__namespace.createElement(textarea.Portal, { container: f }, React__namespace.createElement(textarea.Overlay, { "cmdk-overlay": "", className: c }), React__namespace.createElement(textarea.Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, React__namespace.createElement(me, { ref: o, ...p2 }))));
|
|
2583
|
+
}), Ie = React__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? React__namespace.createElement(index.Primitive.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null), Pe = React__namespace.forwardRef((r, o) => {
|
|
2582
2584
|
let { progress: n, children: u2, label: c = "Loading...", ...d } = r;
|
|
2583
|
-
return React__namespace.createElement(
|
|
2585
|
+
return React__namespace.createElement(index.Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B(r, (f) => React__namespace.createElement("div", { "aria-hidden": true }, f)));
|
|
2584
2586
|
}), _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
|
|
2585
2587
|
function we(r, o) {
|
|
2586
2588
|
let n = r.nextElementSibling;
|
|
@@ -2729,7 +2731,7 @@ function CommandShortcut({ className, ...props }) {
|
|
|
2729
2731
|
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "command-shortcut", className: utils.cn("text-muted-foreground ml-auto text-xs tracking-widest", className), ...props });
|
|
2730
2732
|
}
|
|
2731
2733
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
2732
|
-
var [createCollapsibleContext, createCollapsibleScope] =
|
|
2734
|
+
var [createCollapsibleContext, createCollapsibleScope] = index.createContextScope(COLLAPSIBLE_NAME);
|
|
2733
2735
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
2734
2736
|
var Collapsible = React__namespace.forwardRef(
|
|
2735
2737
|
(props, forwardedRef) => {
|
|
@@ -2741,7 +2743,7 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
2741
2743
|
onOpenChange,
|
|
2742
2744
|
...collapsibleProps
|
|
2743
2745
|
} = props;
|
|
2744
|
-
const [open, setOpen] =
|
|
2746
|
+
const [open, setOpen] = index.useControllableState({
|
|
2745
2747
|
prop: openProp,
|
|
2746
2748
|
defaultProp: defaultOpen ?? false,
|
|
2747
2749
|
onChange: onOpenChange,
|
|
@@ -2752,11 +2754,11 @@ var Collapsible = React__namespace.forwardRef(
|
|
|
2752
2754
|
{
|
|
2753
2755
|
scope: __scopeCollapsible,
|
|
2754
2756
|
disabled,
|
|
2755
|
-
contentId:
|
|
2757
|
+
contentId: index.useId(),
|
|
2756
2758
|
open,
|
|
2757
2759
|
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
2758
2760
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2759
|
-
|
|
2761
|
+
index.Primitive.div,
|
|
2760
2762
|
{
|
|
2761
2763
|
"data-state": getState$2(open),
|
|
2762
2764
|
"data-disabled": disabled ? "" : void 0,
|
|
@@ -2775,7 +2777,7 @@ var CollapsibleTrigger = React__namespace.forwardRef(
|
|
|
2775
2777
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
2776
2778
|
const context = useCollapsibleContext(TRIGGER_NAME$5, __scopeCollapsible);
|
|
2777
2779
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2778
|
-
|
|
2780
|
+
index.Primitive.button,
|
|
2779
2781
|
{
|
|
2780
2782
|
type: "button",
|
|
2781
2783
|
"aria-controls": context.contentId,
|
|
@@ -2785,7 +2787,7 @@ var CollapsibleTrigger = React__namespace.forwardRef(
|
|
|
2785
2787
|
disabled: context.disabled,
|
|
2786
2788
|
...triggerProps,
|
|
2787
2789
|
ref: forwardedRef,
|
|
2788
|
-
onClick:
|
|
2790
|
+
onClick: index.composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
2789
2791
|
}
|
|
2790
2792
|
);
|
|
2791
2793
|
}
|
|
@@ -2796,7 +2798,7 @@ var CollapsibleContent = React__namespace.forwardRef(
|
|
|
2796
2798
|
(props, forwardedRef) => {
|
|
2797
2799
|
const { forceMount, ...contentProps } = props;
|
|
2798
2800
|
const context = useCollapsibleContext(CONTENT_NAME$5, props.__scopeCollapsible);
|
|
2799
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2801
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsxRuntime.jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
|
|
2800
2802
|
}
|
|
2801
2803
|
);
|
|
2802
2804
|
CollapsibleContent.displayName = CONTENT_NAME$5;
|
|
@@ -2805,7 +2807,7 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2805
2807
|
const context = useCollapsibleContext(CONTENT_NAME$5, __scopeCollapsible);
|
|
2806
2808
|
const [isPresent, setIsPresent] = React__namespace.useState(present);
|
|
2807
2809
|
const ref = React__namespace.useRef(null);
|
|
2808
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
2810
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
2809
2811
|
const heightRef = React__namespace.useRef(0);
|
|
2810
2812
|
const height = heightRef.current;
|
|
2811
2813
|
const widthRef = React__namespace.useRef(0);
|
|
@@ -2817,7 +2819,7 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2817
2819
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
2818
2820
|
return () => cancelAnimationFrame(rAF);
|
|
2819
2821
|
}, []);
|
|
2820
|
-
|
|
2822
|
+
index.useLayoutEffect2(() => {
|
|
2821
2823
|
const node = ref.current;
|
|
2822
2824
|
if (node) {
|
|
2823
2825
|
originalStylesRef.current = originalStylesRef.current || {
|
|
@@ -2837,7 +2839,7 @@ var CollapsibleContentImpl = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
2837
2839
|
}
|
|
2838
2840
|
}, [context.open, present]);
|
|
2839
2841
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2840
|
-
|
|
2842
|
+
index.Primitive.div,
|
|
2841
2843
|
{
|
|
2842
2844
|
"data-state": getState$2(context.open),
|
|
2843
2845
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -2863,7 +2865,7 @@ var Content$1 = CollapsibleContent;
|
|
|
2863
2865
|
var ACCORDION_NAME = "Accordion";
|
|
2864
2866
|
var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
|
|
2865
2867
|
var [Collection$2, useCollection$2, createCollectionScope$2] = select.createCollection(ACCORDION_NAME);
|
|
2866
|
-
var [createAccordionContext
|
|
2868
|
+
var [createAccordionContext] = index.createContextScope(ACCORDION_NAME, [
|
|
2867
2869
|
createCollectionScope$2,
|
|
2868
2870
|
createCollapsibleScope
|
|
2869
2871
|
]);
|
|
@@ -2892,7 +2894,7 @@ var AccordionImplSingle = React.forwardRef(
|
|
|
2892
2894
|
collapsible = false,
|
|
2893
2895
|
...accordionSingleProps
|
|
2894
2896
|
} = props;
|
|
2895
|
-
const [value, setValue] =
|
|
2897
|
+
const [value, setValue] = index.useControllableState({
|
|
2896
2898
|
prop: valueProp,
|
|
2897
2899
|
defaultProp: defaultValue ?? "",
|
|
2898
2900
|
onChange: onValueChange,
|
|
@@ -2918,7 +2920,7 @@ var AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {
|
|
|
2918
2920
|
},
|
|
2919
2921
|
...accordionMultipleProps
|
|
2920
2922
|
} = props;
|
|
2921
|
-
const [value, setValue] =
|
|
2923
|
+
const [value, setValue] = index.useControllableState({
|
|
2922
2924
|
prop: valueProp,
|
|
2923
2925
|
defaultProp: defaultValue ?? [],
|
|
2924
2926
|
onChange: onValueChange,
|
|
@@ -2948,11 +2950,11 @@ var AccordionImpl = React.forwardRef(
|
|
|
2948
2950
|
(props, forwardedRef) => {
|
|
2949
2951
|
const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
|
|
2950
2952
|
const accordionRef = React.useRef(null);
|
|
2951
|
-
const composedRefs = index.useComposedRefs(accordionRef, forwardedRef);
|
|
2953
|
+
const composedRefs = index$1.useComposedRefs(accordionRef, forwardedRef);
|
|
2952
2954
|
const getItems = useCollection$2(__scopeAccordion);
|
|
2953
|
-
const direction = index$
|
|
2955
|
+
const direction = index$2.useDirection(dir);
|
|
2954
2956
|
const isDirectionLTR = direction === "ltr";
|
|
2955
|
-
const handleKeyDown =
|
|
2957
|
+
const handleKeyDown = index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
2956
2958
|
if (!ACCORDION_KEYS.includes(event.key)) return;
|
|
2957
2959
|
const target = event.target;
|
|
2958
2960
|
const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);
|
|
@@ -3022,7 +3024,7 @@ var AccordionImpl = React.forwardRef(
|
|
|
3022
3024
|
direction: dir,
|
|
3023
3025
|
orientation,
|
|
3024
3026
|
children: /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3025
|
-
|
|
3027
|
+
index.Primitive.div,
|
|
3026
3028
|
{
|
|
3027
3029
|
...accordionProps,
|
|
3028
3030
|
"data-orientation": orientation,
|
|
@@ -3042,7 +3044,7 @@ var AccordionItem$1 = React.forwardRef(
|
|
|
3042
3044
|
const accordionContext = useAccordionContext(ITEM_NAME$3, __scopeAccordion);
|
|
3043
3045
|
const valueContext = useAccordionValueContext(ITEM_NAME$3, __scopeAccordion);
|
|
3044
3046
|
const collapsibleScope = useCollapsibleScope(__scopeAccordion);
|
|
3045
|
-
const triggerId =
|
|
3047
|
+
const triggerId = index.useId();
|
|
3046
3048
|
const open = value && valueContext.value.includes(value) || false;
|
|
3047
3049
|
const disabled = accordionContext.disabled || props.disabled;
|
|
3048
3050
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3083,7 +3085,7 @@ var AccordionHeader = React.forwardRef(
|
|
|
3083
3085
|
const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
|
|
3084
3086
|
const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
|
|
3085
3087
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3086
|
-
|
|
3088
|
+
index.Primitive.h3,
|
|
3087
3089
|
{
|
|
3088
3090
|
"data-orientation": accordionContext.orientation,
|
|
3089
3091
|
"data-state": getState$1(itemContext.open),
|
|
@@ -3169,7 +3171,7 @@ function AccordionTrigger({ className, children, ...props }) {
|
|
|
3169
3171
|
...props,
|
|
3170
3172
|
children: [
|
|
3171
3173
|
children,
|
|
3172
|
-
/* @__PURE__ */ jsxRuntime.jsx(index$
|
|
3174
|
+
/* @__PURE__ */ jsxRuntime.jsx(index$2.ChevronDown, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
|
|
3173
3175
|
]
|
|
3174
3176
|
}
|
|
3175
3177
|
) });
|
|
@@ -3188,7 +3190,7 @@ function AccordionContent({ className, children, ...props }) {
|
|
|
3188
3190
|
var NAVIGATION_MENU_NAME = "NavigationMenu";
|
|
3189
3191
|
var [Collection$1, useCollection$1, createCollectionScope$1] = select.createCollection(NAVIGATION_MENU_NAME);
|
|
3190
3192
|
var [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] = select.createCollection(NAVIGATION_MENU_NAME);
|
|
3191
|
-
var [createNavigationMenuContext
|
|
3193
|
+
var [createNavigationMenuContext] = index.createContextScope(
|
|
3192
3194
|
NAVIGATION_MENU_NAME,
|
|
3193
3195
|
[createCollectionScope$1, createFocusGroupCollectionScope]
|
|
3194
3196
|
);
|
|
@@ -3208,13 +3210,13 @@ var NavigationMenu$1 = React__namespace.forwardRef(
|
|
|
3208
3210
|
...NavigationMenuProps
|
|
3209
3211
|
} = props;
|
|
3210
3212
|
const [navigationMenu, setNavigationMenu] = React__namespace.useState(null);
|
|
3211
|
-
const composedRef = index.useComposedRefs(forwardedRef, (node) => setNavigationMenu(node));
|
|
3212
|
-
const direction = index$
|
|
3213
|
+
const composedRef = index$1.useComposedRefs(forwardedRef, (node) => setNavigationMenu(node));
|
|
3214
|
+
const direction = index$2.useDirection(dir);
|
|
3213
3215
|
const openTimerRef = React__namespace.useRef(0);
|
|
3214
3216
|
const closeTimerRef = React__namespace.useRef(0);
|
|
3215
3217
|
const skipDelayTimerRef = React__namespace.useRef(0);
|
|
3216
3218
|
const [isOpenDelayed, setIsOpenDelayed] = React__namespace.useState(true);
|
|
3217
|
-
const [value, setValue] =
|
|
3219
|
+
const [value, setValue] = index.useControllableState({
|
|
3218
3220
|
prop: valueProp,
|
|
3219
3221
|
onChange: (value2) => {
|
|
3220
3222
|
const isOpen = value2 !== "";
|
|
@@ -3291,7 +3293,7 @@ var NavigationMenu$1 = React__namespace.forwardRef(
|
|
|
3291
3293
|
},
|
|
3292
3294
|
onItemDismiss: () => setValue(""),
|
|
3293
3295
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3294
|
-
|
|
3296
|
+
index.Primitive.nav,
|
|
3295
3297
|
{
|
|
3296
3298
|
"aria-label": "Main",
|
|
3297
3299
|
"data-orientation": orientation,
|
|
@@ -3317,7 +3319,7 @@ var NavigationMenuSub = React__namespace.forwardRef(
|
|
|
3317
3319
|
...subProps
|
|
3318
3320
|
} = props;
|
|
3319
3321
|
const context = useNavigationMenuContext(SUB_NAME$1, __scopeNavigationMenu);
|
|
3320
|
-
const [value, setValue] =
|
|
3322
|
+
const [value, setValue] = index.useControllableState({
|
|
3321
3323
|
prop: valueProp,
|
|
3322
3324
|
onChange: onValueChange,
|
|
3323
3325
|
defaultProp: defaultValue ?? "",
|
|
@@ -3335,7 +3337,7 @@ var NavigationMenuSub = React__namespace.forwardRef(
|
|
|
3335
3337
|
onTriggerEnter: (itemValue) => setValue(itemValue),
|
|
3336
3338
|
onItemSelect: (itemValue) => setValue(itemValue),
|
|
3337
3339
|
onItemDismiss: () => setValue(""),
|
|
3338
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3340
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { "data-orientation": orientation, ...subProps, ref: forwardedRef })
|
|
3339
3341
|
}
|
|
3340
3342
|
);
|
|
3341
3343
|
}
|
|
@@ -3368,19 +3370,19 @@ var NavigationMenuProvider = (props) => {
|
|
|
3368
3370
|
rootNavigationMenu,
|
|
3369
3371
|
value,
|
|
3370
3372
|
previousValue: select.usePrevious(value),
|
|
3371
|
-
baseId:
|
|
3373
|
+
baseId: index.useId(),
|
|
3372
3374
|
dir,
|
|
3373
3375
|
orientation,
|
|
3374
3376
|
viewport,
|
|
3375
3377
|
onViewportChange: setViewport,
|
|
3376
3378
|
indicatorTrack,
|
|
3377
3379
|
onIndicatorTrackChange: setIndicatorTrack,
|
|
3378
|
-
onTriggerEnter:
|
|
3379
|
-
onTriggerLeave:
|
|
3380
|
-
onContentEnter:
|
|
3381
|
-
onContentLeave:
|
|
3382
|
-
onItemSelect:
|
|
3383
|
-
onItemDismiss:
|
|
3380
|
+
onTriggerEnter: index.useCallbackRef(onTriggerEnter),
|
|
3381
|
+
onTriggerLeave: index.useCallbackRef(onTriggerLeave),
|
|
3382
|
+
onContentEnter: index.useCallbackRef(onContentEnter),
|
|
3383
|
+
onContentLeave: index.useCallbackRef(onContentLeave),
|
|
3384
|
+
onItemSelect: index.useCallbackRef(onItemSelect),
|
|
3385
|
+
onItemDismiss: index.useCallbackRef(onItemDismiss),
|
|
3384
3386
|
onViewportContentChange: React__namespace.useCallback((contentValue, contentData) => {
|
|
3385
3387
|
setViewportContent((prevContent) => {
|
|
3386
3388
|
prevContent.set(contentValue, contentData);
|
|
@@ -3403,8 +3405,8 @@ var NavigationMenuList$1 = React__namespace.forwardRef(
|
|
|
3403
3405
|
(props, forwardedRef) => {
|
|
3404
3406
|
const { __scopeNavigationMenu, ...listProps } = props;
|
|
3405
3407
|
const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu);
|
|
3406
|
-
const list = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3407
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3408
|
+
const list = /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.ul, { "data-orientation": context.orientation, ...listProps, ref: forwardedRef });
|
|
3409
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { style: { position: "relative" }, ref: context.onIndicatorTrackChange, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Slot, { scope: __scopeNavigationMenu, children: context.isRootMenu ? /* @__PURE__ */ jsxRuntime.jsx(FocusGroup, { asChild: true, children: list }) : list }) });
|
|
3408
3410
|
}
|
|
3409
3411
|
);
|
|
3410
3412
|
NavigationMenuList$1.displayName = LIST_NAME;
|
|
@@ -3413,7 +3415,7 @@ var [NavigationMenuItemContextProvider, useNavigationMenuItemContext] = createNa
|
|
|
3413
3415
|
var NavigationMenuItem$1 = React__namespace.forwardRef(
|
|
3414
3416
|
(props, forwardedRef) => {
|
|
3415
3417
|
const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props;
|
|
3416
|
-
const autoValue =
|
|
3418
|
+
const autoValue = index.useId();
|
|
3417
3419
|
const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE";
|
|
3418
3420
|
const contentRef = React__namespace.useRef(null);
|
|
3419
3421
|
const triggerRef = React__namespace.useRef(null);
|
|
@@ -3447,7 +3449,7 @@ var NavigationMenuItem$1 = React__namespace.forwardRef(
|
|
|
3447
3449
|
onFocusProxyEnter: handleContentEntry,
|
|
3448
3450
|
onRootContentClose: handleContentExit,
|
|
3449
3451
|
onContentFocusOutside: handleContentExit,
|
|
3450
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3452
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.li, { ...itemProps, ref: forwardedRef })
|
|
3451
3453
|
}
|
|
3452
3454
|
);
|
|
3453
3455
|
}
|
|
@@ -3459,7 +3461,7 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3459
3461
|
const context = useNavigationMenuContext(TRIGGER_NAME$3, props.__scopeNavigationMenu);
|
|
3460
3462
|
const itemContext = useNavigationMenuItemContext(TRIGGER_NAME$3, props.__scopeNavigationMenu);
|
|
3461
3463
|
const ref = React__namespace.useRef(null);
|
|
3462
|
-
const composedRefs = index.useComposedRefs(ref, itemContext.triggerRef, forwardedRef);
|
|
3464
|
+
const composedRefs = index$1.useComposedRefs(ref, itemContext.triggerRef, forwardedRef);
|
|
3463
3465
|
const triggerId = makeTriggerId(context.baseId, itemContext.value);
|
|
3464
3466
|
const contentId = makeContentId(context.baseId, itemContext.value);
|
|
3465
3467
|
const hasPointerMoveOpenedRef = React__namespace.useRef(false);
|
|
@@ -3467,7 +3469,7 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3467
3469
|
const open = itemContext.value === context.value;
|
|
3468
3470
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3469
3471
|
/* @__PURE__ */ jsxRuntime.jsx(Collection$1.ItemSlot, { scope: __scopeNavigationMenu, value: itemContext.value, children: /* @__PURE__ */ jsxRuntime.jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3470
|
-
|
|
3472
|
+
index.Primitive.button,
|
|
3471
3473
|
{
|
|
3472
3474
|
id: triggerId,
|
|
3473
3475
|
disabled,
|
|
@@ -3477,11 +3479,11 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3477
3479
|
"aria-controls": contentId,
|
|
3478
3480
|
...triggerProps,
|
|
3479
3481
|
ref: composedRefs,
|
|
3480
|
-
onPointerEnter:
|
|
3482
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, () => {
|
|
3481
3483
|
wasClickCloseRef.current = false;
|
|
3482
3484
|
itemContext.wasEscapeCloseRef.current = false;
|
|
3483
3485
|
}),
|
|
3484
|
-
onPointerMove:
|
|
3486
|
+
onPointerMove: index.composeEventHandlers(
|
|
3485
3487
|
props.onPointerMove,
|
|
3486
3488
|
whenMouse(() => {
|
|
3487
3489
|
if (disabled || wasClickCloseRef.current || itemContext.wasEscapeCloseRef.current || hasPointerMoveOpenedRef.current)
|
|
@@ -3490,7 +3492,7 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3490
3492
|
hasPointerMoveOpenedRef.current = true;
|
|
3491
3493
|
})
|
|
3492
3494
|
),
|
|
3493
|
-
onPointerLeave:
|
|
3495
|
+
onPointerLeave: index.composeEventHandlers(
|
|
3494
3496
|
props.onPointerLeave,
|
|
3495
3497
|
whenMouse(() => {
|
|
3496
3498
|
if (disabled) return;
|
|
@@ -3498,11 +3500,11 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3498
3500
|
hasPointerMoveOpenedRef.current = false;
|
|
3499
3501
|
})
|
|
3500
3502
|
),
|
|
3501
|
-
onClick:
|
|
3503
|
+
onClick: index.composeEventHandlers(props.onClick, () => {
|
|
3502
3504
|
context.onItemSelect(itemContext.value);
|
|
3503
3505
|
wasClickCloseRef.current = open;
|
|
3504
3506
|
}),
|
|
3505
|
-
onKeyDown:
|
|
3507
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
3506
3508
|
const verticalEntryKey = context.dir === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
3507
3509
|
const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[context.orientation];
|
|
3508
3510
|
if (open && event.key === entryKey) {
|
|
@@ -3514,7 +3516,7 @@ var NavigationMenuTrigger$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3514
3516
|
) }) }),
|
|
3515
3517
|
open && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3516
3518
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3517
|
-
|
|
3519
|
+
index$3.Root,
|
|
3518
3520
|
{
|
|
3519
3521
|
"aria-hidden": true,
|
|
3520
3522
|
tabIndex: 0,
|
|
@@ -3541,13 +3543,13 @@ var NavigationMenuLink$1 = React__namespace.forwardRef(
|
|
|
3541
3543
|
(props, forwardedRef) => {
|
|
3542
3544
|
const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props;
|
|
3543
3545
|
return /* @__PURE__ */ jsxRuntime.jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3544
|
-
|
|
3546
|
+
index.Primitive.a,
|
|
3545
3547
|
{
|
|
3546
3548
|
"data-active": active ? "" : void 0,
|
|
3547
3549
|
"aria-current": active ? "page" : void 0,
|
|
3548
3550
|
...linkProps,
|
|
3549
3551
|
ref: forwardedRef,
|
|
3550
|
-
onClick:
|
|
3552
|
+
onClick: index.composeEventHandlers(
|
|
3551
3553
|
props.onClick,
|
|
3552
3554
|
(event) => {
|
|
3553
3555
|
const target = event.target;
|
|
@@ -3556,13 +3558,13 @@ var NavigationMenuLink$1 = React__namespace.forwardRef(
|
|
|
3556
3558
|
cancelable: true
|
|
3557
3559
|
});
|
|
3558
3560
|
target.addEventListener(LINK_SELECT, (event2) => onSelect?.(event2), { once: true });
|
|
3559
|
-
|
|
3561
|
+
index.dispatchDiscreteCustomEvent(target, linkSelectEvent);
|
|
3560
3562
|
if (!linkSelectEvent.defaultPrevented && !event.metaKey) {
|
|
3561
3563
|
const rootContentDismissEvent = new CustomEvent(ROOT_CONTENT_DISMISS, {
|
|
3562
3564
|
bubbles: true,
|
|
3563
3565
|
cancelable: true
|
|
3564
3566
|
});
|
|
3565
|
-
|
|
3567
|
+
index.dispatchDiscreteCustomEvent(target, rootContentDismissEvent);
|
|
3566
3568
|
}
|
|
3567
3569
|
},
|
|
3568
3570
|
{ checkForDefaultPrevented: false }
|
|
@@ -3578,7 +3580,7 @@ var NavigationMenuIndicator$1 = React__namespace.forwardRef((props, forwardedRef
|
|
|
3578
3580
|
const context = useNavigationMenuContext(INDICATOR_NAME$2, props.__scopeNavigationMenu);
|
|
3579
3581
|
const isVisible = Boolean(context.value);
|
|
3580
3582
|
return context.indicatorTrack ? ReactDOM.createPortal(
|
|
3581
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3583
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || isVisible, children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuIndicatorImpl, { ...indicatorProps, ref: forwardedRef }) }),
|
|
3582
3584
|
context.indicatorTrack
|
|
3583
3585
|
) : null;
|
|
3584
3586
|
});
|
|
@@ -3609,7 +3611,7 @@ var NavigationMenuIndicatorImpl = React__namespace.forwardRef((props, forwardedR
|
|
|
3609
3611
|
useResizeObserver(activeTrigger, handlePositionChange);
|
|
3610
3612
|
useResizeObserver(context.indicatorTrack, handlePositionChange);
|
|
3611
3613
|
return position ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3612
|
-
|
|
3614
|
+
index.Primitive.div,
|
|
3613
3615
|
{
|
|
3614
3616
|
"aria-hidden": true,
|
|
3615
3617
|
"data-state": isVisible ? "visible" : "hidden",
|
|
@@ -3637,7 +3639,7 @@ var NavigationMenuContent$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3637
3639
|
const { forceMount, ...contentProps } = props;
|
|
3638
3640
|
const context = useNavigationMenuContext(CONTENT_NAME$3, props.__scopeNavigationMenu);
|
|
3639
3641
|
const itemContext = useNavigationMenuItemContext(CONTENT_NAME$3, props.__scopeNavigationMenu);
|
|
3640
|
-
const composedRefs = index.useComposedRefs(itemContext.contentRef, forwardedRef);
|
|
3642
|
+
const composedRefs = index$1.useComposedRefs(itemContext.contentRef, forwardedRef);
|
|
3641
3643
|
const open = itemContext.value === context.value;
|
|
3642
3644
|
const commonProps = {
|
|
3643
3645
|
value: itemContext.value,
|
|
@@ -3648,14 +3650,14 @@ var NavigationMenuContent$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3648
3650
|
onRootContentClose: itemContext.onRootContentClose,
|
|
3649
3651
|
...contentProps
|
|
3650
3652
|
};
|
|
3651
|
-
return !context.viewport ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3653
|
+
return !context.viewport ? /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || open, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3652
3654
|
NavigationMenuContentImpl,
|
|
3653
3655
|
{
|
|
3654
3656
|
"data-state": getOpenState(open),
|
|
3655
3657
|
...commonProps,
|
|
3656
3658
|
ref: composedRefs,
|
|
3657
|
-
onPointerEnter:
|
|
3658
|
-
onPointerLeave:
|
|
3659
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, context.onContentEnter),
|
|
3660
|
+
onPointerLeave: index.composeEventHandlers(
|
|
3659
3661
|
props.onPointerLeave,
|
|
3660
3662
|
whenMouse(context.onContentLeave)
|
|
3661
3663
|
),
|
|
@@ -3671,13 +3673,13 @@ NavigationMenuContent$1.displayName = CONTENT_NAME$3;
|
|
|
3671
3673
|
var ViewportContentMounter = React__namespace.forwardRef((props, forwardedRef) => {
|
|
3672
3674
|
const context = useNavigationMenuContext(CONTENT_NAME$3, props.__scopeNavigationMenu);
|
|
3673
3675
|
const { onViewportContentChange, onViewportContentRemove } = context;
|
|
3674
|
-
|
|
3676
|
+
index.useLayoutEffect2(() => {
|
|
3675
3677
|
onViewportContentChange(props.value, {
|
|
3676
3678
|
ref: forwardedRef,
|
|
3677
3679
|
...props
|
|
3678
3680
|
});
|
|
3679
3681
|
}, [props, forwardedRef, onViewportContentChange]);
|
|
3680
|
-
|
|
3682
|
+
index.useLayoutEffect2(() => {
|
|
3681
3683
|
return () => onViewportContentRemove(props.value);
|
|
3682
3684
|
}, [props.value, onViewportContentRemove]);
|
|
3683
3685
|
return null;
|
|
@@ -3696,7 +3698,7 @@ var NavigationMenuContentImpl = React__namespace.forwardRef((props, forwardedRef
|
|
|
3696
3698
|
} = props;
|
|
3697
3699
|
const context = useNavigationMenuContext(CONTENT_NAME$3, __scopeNavigationMenu);
|
|
3698
3700
|
const ref = React__namespace.useRef(null);
|
|
3699
|
-
const composedRefs = index.useComposedRefs(ref, forwardedRef);
|
|
3701
|
+
const composedRefs = index$1.useComposedRefs(ref, forwardedRef);
|
|
3700
3702
|
const triggerId = makeTriggerId(context.baseId, value);
|
|
3701
3703
|
const contentId = makeContentId(context.baseId, value);
|
|
3702
3704
|
const getItems = useCollection$1(__scopeNavigationMenu);
|
|
@@ -3734,7 +3736,7 @@ var NavigationMenuContentImpl = React__namespace.forwardRef((props, forwardedRef
|
|
|
3734
3736
|
return attribute;
|
|
3735
3737
|
}, [context.previousValue, context.value, context.dir, getItems, value]);
|
|
3736
3738
|
return /* @__PURE__ */ jsxRuntime.jsx(FocusGroup, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3737
|
-
|
|
3739
|
+
index.DismissableLayer,
|
|
3738
3740
|
{
|
|
3739
3741
|
id: contentId,
|
|
3740
3742
|
"aria-labelledby": triggerId,
|
|
@@ -3750,18 +3752,18 @@ var NavigationMenuContentImpl = React__namespace.forwardRef((props, forwardedRef
|
|
|
3750
3752
|
});
|
|
3751
3753
|
ref.current?.dispatchEvent(rootContentDismissEvent);
|
|
3752
3754
|
},
|
|
3753
|
-
onFocusOutside:
|
|
3755
|
+
onFocusOutside: index.composeEventHandlers(props.onFocusOutside, (event) => {
|
|
3754
3756
|
onContentFocusOutside();
|
|
3755
3757
|
const target = event.target;
|
|
3756
3758
|
if (context.rootNavigationMenu?.contains(target)) event.preventDefault();
|
|
3757
3759
|
}),
|
|
3758
|
-
onPointerDownOutside:
|
|
3760
|
+
onPointerDownOutside: index.composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
3759
3761
|
const target = event.target;
|
|
3760
3762
|
const isTrigger = getItems().some((item) => item.ref.current?.contains(target));
|
|
3761
3763
|
const isRootViewport = context.isRootMenu && context.viewport?.contains(target);
|
|
3762
3764
|
if (isTrigger || isRootViewport || !context.isRootMenu) event.preventDefault();
|
|
3763
3765
|
}),
|
|
3764
|
-
onKeyDown:
|
|
3766
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
3765
3767
|
const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
|
|
3766
3768
|
const isTabKey = event.key === "Tab" && !isMetaKey;
|
|
3767
3769
|
if (isTabKey) {
|
|
@@ -3777,7 +3779,7 @@ var NavigationMenuContentImpl = React__namespace.forwardRef((props, forwardedRef
|
|
|
3777
3779
|
}
|
|
3778
3780
|
}
|
|
3779
3781
|
}),
|
|
3780
|
-
onEscapeKeyDown:
|
|
3782
|
+
onEscapeKeyDown: index.composeEventHandlers(props.onEscapeKeyDown, (_event) => {
|
|
3781
3783
|
wasEscapeCloseRef.current = true;
|
|
3782
3784
|
})
|
|
3783
3785
|
}
|
|
@@ -3788,13 +3790,13 @@ var NavigationMenuViewport$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
3788
3790
|
const { forceMount, ...viewportProps } = props;
|
|
3789
3791
|
const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu);
|
|
3790
3792
|
const open = Boolean(context.value);
|
|
3791
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3793
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || open, children: /* @__PURE__ */ jsxRuntime.jsx(NavigationMenuViewportImpl, { ...viewportProps, ref: forwardedRef }) });
|
|
3792
3794
|
});
|
|
3793
3795
|
NavigationMenuViewport$1.displayName = VIEWPORT_NAME;
|
|
3794
3796
|
var NavigationMenuViewportImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
3795
3797
|
const { __scopeNavigationMenu, children, ...viewportImplProps } = props;
|
|
3796
3798
|
const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu);
|
|
3797
|
-
const composedRefs = index.useComposedRefs(forwardedRef, context.onViewportChange);
|
|
3799
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, context.onViewportChange);
|
|
3798
3800
|
const viewportContentContext = useViewportContentContext(
|
|
3799
3801
|
CONTENT_NAME$3,
|
|
3800
3802
|
props.__scopeNavigationMenu
|
|
@@ -3810,7 +3812,7 @@ var NavigationMenuViewportImpl = React__namespace.forwardRef((props, forwardedRe
|
|
|
3810
3812
|
};
|
|
3811
3813
|
useResizeObserver(content, handleSizeChange);
|
|
3812
3814
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3813
|
-
|
|
3815
|
+
index.Primitive.div,
|
|
3814
3816
|
{
|
|
3815
3817
|
"data-state": getOpenState(open),
|
|
3816
3818
|
"data-orientation": context.orientation,
|
|
@@ -3823,15 +3825,15 @@ var NavigationMenuViewportImpl = React__namespace.forwardRef((props, forwardedRe
|
|
|
3823
3825
|
["--radix-navigation-menu-viewport-height"]: viewportHeight,
|
|
3824
3826
|
...viewportImplProps.style
|
|
3825
3827
|
},
|
|
3826
|
-
onPointerEnter:
|
|
3827
|
-
onPointerLeave:
|
|
3828
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, context.onContentEnter),
|
|
3829
|
+
onPointerLeave: index.composeEventHandlers(props.onPointerLeave, whenMouse(context.onContentLeave)),
|
|
3828
3830
|
children: Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props2 }]) => {
|
|
3829
3831
|
const isActive = activeContentValue === value;
|
|
3830
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3832
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || isActive, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3831
3833
|
NavigationMenuContentImpl,
|
|
3832
3834
|
{
|
|
3833
3835
|
...props2,
|
|
3834
|
-
ref: index.composeRefs(ref, (node) => {
|
|
3836
|
+
ref: index$1.composeRefs(ref, (node) => {
|
|
3835
3837
|
if (isActive && node) setContent(node);
|
|
3836
3838
|
})
|
|
3837
3839
|
}
|
|
@@ -3845,7 +3847,7 @@ var FocusGroup = React__namespace.forwardRef(
|
|
|
3845
3847
|
(props, forwardedRef) => {
|
|
3846
3848
|
const { __scopeNavigationMenu, ...groupProps } = props;
|
|
3847
3849
|
const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu);
|
|
3848
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3850
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { dir: context.dir, ...groupProps, ref: forwardedRef }) }) });
|
|
3849
3851
|
}
|
|
3850
3852
|
);
|
|
3851
3853
|
var ARROW_KEYS$1 = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"];
|
|
@@ -3856,11 +3858,11 @@ var FocusGroupItem = React__namespace.forwardRef(
|
|
|
3856
3858
|
const getItems = useFocusGroupCollection(__scopeNavigationMenu);
|
|
3857
3859
|
const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu);
|
|
3858
3860
|
return /* @__PURE__ */ jsxRuntime.jsx(FocusGroupCollection.ItemSlot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3859
|
-
|
|
3861
|
+
index.Primitive.button,
|
|
3860
3862
|
{
|
|
3861
3863
|
...groupProps,
|
|
3862
3864
|
ref: forwardedRef,
|
|
3863
|
-
onKeyDown:
|
|
3865
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
3864
3866
|
const isFocusNavigationKey = ["Home", "End", ...ARROW_KEYS$1].includes(event.key);
|
|
3865
3867
|
if (isFocusNavigationKey) {
|
|
3866
3868
|
let candidateNodes = getItems().map((item) => item.ref.current);
|
|
@@ -3912,8 +3914,8 @@ function removeFromTabOrder(candidates) {
|
|
|
3912
3914
|
};
|
|
3913
3915
|
}
|
|
3914
3916
|
function useResizeObserver(element, onResize) {
|
|
3915
|
-
const handleResize =
|
|
3916
|
-
|
|
3917
|
+
const handleResize = index.useCallbackRef(onResize);
|
|
3918
|
+
index.useLayoutEffect2(() => {
|
|
3917
3919
|
let rAF = 0;
|
|
3918
3920
|
if (element) {
|
|
3919
3921
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -3981,7 +3983,7 @@ function NavigationMenuList({ className, ...props }) {
|
|
|
3981
3983
|
function NavigationMenuItem({ className, ...props }) {
|
|
3982
3984
|
return /* @__PURE__ */ jsxRuntime.jsx(Item, { "data-slot": "navigation-menu-item", className: utils.cn("relative", className), ...props });
|
|
3983
3985
|
}
|
|
3984
|
-
const navigationMenuTriggerStyle = index$
|
|
3986
|
+
const navigationMenuTriggerStyle = index$4.cva(
|
|
3985
3987
|
"group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
|
|
3986
3988
|
);
|
|
3987
3989
|
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
@@ -3995,7 +3997,7 @@ function NavigationMenuTrigger({ className, children, ...props }) {
|
|
|
3995
3997
|
children,
|
|
3996
3998
|
" ",
|
|
3997
3999
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3998
|
-
index$
|
|
4000
|
+
index$2.ChevronDown,
|
|
3999
4001
|
{
|
|
4000
4002
|
className: "relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
4001
4003
|
"aria-hidden": "true"
|
|
@@ -4158,7 +4160,7 @@ var AspectRatio$1 = React__namespace.forwardRef(
|
|
|
4158
4160
|
},
|
|
4159
4161
|
"data-radix-aspect-ratio-wrapper": "",
|
|
4160
4162
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4161
|
-
|
|
4163
|
+
index.Primitive.div,
|
|
4162
4164
|
{
|
|
4163
4165
|
...aspectRatioProps,
|
|
4164
4166
|
ref: forwardedRef,
|
|
@@ -4183,7 +4185,7 @@ function AspectRatio({ ...props }) {
|
|
|
4183
4185
|
return /* @__PURE__ */ jsxRuntime.jsx(Root, { "data-slot": "aspect-ratio", ...props });
|
|
4184
4186
|
}
|
|
4185
4187
|
var RADIO_NAME = "Radio";
|
|
4186
|
-
var [createRadioContext, createRadioScope] =
|
|
4188
|
+
var [createRadioContext, createRadioScope] = index.createContextScope(RADIO_NAME);
|
|
4187
4189
|
var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
|
|
4188
4190
|
var Radio = React__namespace.forwardRef(
|
|
4189
4191
|
(props, forwardedRef) => {
|
|
@@ -4199,12 +4201,12 @@ var Radio = React__namespace.forwardRef(
|
|
|
4199
4201
|
...radioProps
|
|
4200
4202
|
} = props;
|
|
4201
4203
|
const [button2, setButton] = React__namespace.useState(null);
|
|
4202
|
-
const composedRefs = index.useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
4204
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
4203
4205
|
const hasConsumerStoppedPropagationRef = React__namespace.useRef(false);
|
|
4204
4206
|
const isFormControl = button2 ? form || !!button2.closest("form") : true;
|
|
4205
4207
|
return /* @__PURE__ */ jsxRuntime.jsxs(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
|
|
4206
4208
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4207
|
-
|
|
4209
|
+
index.Primitive.button,
|
|
4208
4210
|
{
|
|
4209
4211
|
type: "button",
|
|
4210
4212
|
role: "radio",
|
|
@@ -4215,7 +4217,7 @@ var Radio = React__namespace.forwardRef(
|
|
|
4215
4217
|
value,
|
|
4216
4218
|
...radioProps,
|
|
4217
4219
|
ref: composedRefs,
|
|
4218
|
-
onClick:
|
|
4220
|
+
onClick: index.composeEventHandlers(props.onClick, (event) => {
|
|
4219
4221
|
if (!checked) onCheck?.();
|
|
4220
4222
|
if (isFormControl) {
|
|
4221
4223
|
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
@@ -4247,8 +4249,8 @@ var RadioIndicator = React__namespace.forwardRef(
|
|
|
4247
4249
|
(props, forwardedRef) => {
|
|
4248
4250
|
const { __scopeRadio, forceMount, ...indicatorProps } = props;
|
|
4249
4251
|
const context = useRadioContext(INDICATOR_NAME$1, __scopeRadio);
|
|
4250
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4251
|
-
|
|
4252
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4253
|
+
index.Primitive.span,
|
|
4252
4254
|
{
|
|
4253
4255
|
"data-state": getState(context.checked),
|
|
4254
4256
|
"data-disabled": context.disabled ? "" : void 0,
|
|
@@ -4269,9 +4271,9 @@ var RadioBubbleInput = React__namespace.forwardRef(
|
|
|
4269
4271
|
...props
|
|
4270
4272
|
}, forwardedRef) => {
|
|
4271
4273
|
const ref = React__namespace.useRef(null);
|
|
4272
|
-
const composedRefs = index.useComposedRefs(ref, forwardedRef);
|
|
4274
|
+
const composedRefs = index$1.useComposedRefs(ref, forwardedRef);
|
|
4273
4275
|
const prevChecked = select.usePrevious(checked);
|
|
4274
|
-
const controlSize =
|
|
4276
|
+
const controlSize = index$3.useSize(control);
|
|
4275
4277
|
React__namespace.useEffect(() => {
|
|
4276
4278
|
const input = ref.current;
|
|
4277
4279
|
if (!input) return;
|
|
@@ -4288,7 +4290,7 @@ var RadioBubbleInput = React__namespace.forwardRef(
|
|
|
4288
4290
|
}
|
|
4289
4291
|
}, [prevChecked, checked, bubbles]);
|
|
4290
4292
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4291
|
-
|
|
4293
|
+
index.Primitive.input,
|
|
4292
4294
|
{
|
|
4293
4295
|
type: "radio",
|
|
4294
4296
|
"aria-hidden": true,
|
|
@@ -4314,7 +4316,7 @@ function getState(checked) {
|
|
|
4314
4316
|
}
|
|
4315
4317
|
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
4316
4318
|
var RADIO_GROUP_NAME$1 = "RadioGroup";
|
|
4317
|
-
var [createRadioGroupContext
|
|
4319
|
+
var [createRadioGroupContext] = index.createContextScope(RADIO_GROUP_NAME$1, [
|
|
4318
4320
|
createRovingFocusGroupScope,
|
|
4319
4321
|
createRadioScope
|
|
4320
4322
|
]);
|
|
@@ -4337,8 +4339,8 @@ var RadioGroup$1 = React__namespace.forwardRef(
|
|
|
4337
4339
|
...groupProps
|
|
4338
4340
|
} = props;
|
|
4339
4341
|
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeRadioGroup);
|
|
4340
|
-
const direction = index$
|
|
4341
|
-
const [value, setValue] =
|
|
4342
|
+
const direction = index$2.useDirection(dir);
|
|
4343
|
+
const [value, setValue] = index.useControllableState({
|
|
4342
4344
|
prop: valueProp,
|
|
4343
4345
|
defaultProp: defaultValue ?? null,
|
|
4344
4346
|
onChange: onValueChange,
|
|
@@ -4362,7 +4364,7 @@ var RadioGroup$1 = React__namespace.forwardRef(
|
|
|
4362
4364
|
dir: direction,
|
|
4363
4365
|
loop,
|
|
4364
4366
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4365
|
-
|
|
4367
|
+
index.Primitive.div,
|
|
4366
4368
|
{
|
|
4367
4369
|
role: "radiogroup",
|
|
4368
4370
|
"aria-required": required,
|
|
@@ -4389,7 +4391,7 @@ var RadioGroupItem$1 = React__namespace.forwardRef(
|
|
|
4389
4391
|
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeRadioGroup);
|
|
4390
4392
|
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
4391
4393
|
const ref = React__namespace.useRef(null);
|
|
4392
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
4394
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
4393
4395
|
const checked = context.value === itemProps.value;
|
|
4394
4396
|
const isArrowKeyPressedRef = React__namespace.useRef(false);
|
|
4395
4397
|
React__namespace.useEffect(() => {
|
|
@@ -4424,10 +4426,10 @@ var RadioGroupItem$1 = React__namespace.forwardRef(
|
|
|
4424
4426
|
name: context.name,
|
|
4425
4427
|
ref: composedRefs,
|
|
4426
4428
|
onCheck: () => context.onValueChange(itemProps.value),
|
|
4427
|
-
onKeyDown:
|
|
4429
|
+
onKeyDown: index.composeEventHandlers((event) => {
|
|
4428
4430
|
if (event.key === "Enter") event.preventDefault();
|
|
4429
4431
|
}),
|
|
4430
|
-
onFocus:
|
|
4432
|
+
onFocus: index.composeEventHandlers(itemProps.onFocus, () => {
|
|
4431
4433
|
if (isArrowKeyPressedRef.current) ref.current?.click();
|
|
4432
4434
|
})
|
|
4433
4435
|
}
|
|
@@ -4476,7 +4478,7 @@ function SheetClose({ ...props }) {
|
|
|
4476
4478
|
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Close, { "data-slot": "sheet-close", ...props });
|
|
4477
4479
|
}
|
|
4478
4480
|
function SheetPortal({ ...props }) {
|
|
4479
|
-
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Portal
|
|
4481
|
+
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Portal, { "data-slot": "sheet-portal", ...props });
|
|
4480
4482
|
}
|
|
4481
4483
|
function SheetOverlay({ className, backdrop, ...props }) {
|
|
4482
4484
|
let overlayClass = "";
|
|
@@ -4567,7 +4569,7 @@ function SheetDescription({ className, ...props }) {
|
|
|
4567
4569
|
}
|
|
4568
4570
|
var MENUBAR_NAME = "Menubar";
|
|
4569
4571
|
var [Collection, useCollection, createCollectionScope] = select.createCollection(MENUBAR_NAME);
|
|
4570
|
-
var [createMenubarContext
|
|
4572
|
+
var [createMenubarContext] = index.createContextScope(MENUBAR_NAME, [
|
|
4571
4573
|
createCollectionScope,
|
|
4572
4574
|
createRovingFocusGroupScope
|
|
4573
4575
|
]);
|
|
@@ -4585,9 +4587,9 @@ var Menubar$1 = React__namespace.forwardRef(
|
|
|
4585
4587
|
dir,
|
|
4586
4588
|
...menubarProps
|
|
4587
4589
|
} = props;
|
|
4588
|
-
const direction = index$
|
|
4590
|
+
const direction = index$2.useDirection(dir);
|
|
4589
4591
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenubar);
|
|
4590
|
-
const [value, setValue] =
|
|
4592
|
+
const [value, setValue] = index.useControllableState({
|
|
4591
4593
|
prop: valueProp,
|
|
4592
4594
|
onChange: onValueChange,
|
|
4593
4595
|
defaultProp: defaultValue ?? "",
|
|
@@ -4626,7 +4628,7 @@ var Menubar$1 = React__namespace.forwardRef(
|
|
|
4626
4628
|
dir: direction,
|
|
4627
4629
|
currentTabStopId,
|
|
4628
4630
|
onCurrentTabStopIdChange: setCurrentTabStopId,
|
|
4629
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4631
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index.Primitive.div, { role: "menubar", ...menubarProps, ref: forwardedRef })
|
|
4630
4632
|
}
|
|
4631
4633
|
) }) })
|
|
4632
4634
|
}
|
|
@@ -4638,7 +4640,7 @@ var MENU_NAME = "MenubarMenu";
|
|
|
4638
4640
|
var [MenubarMenuProvider, useMenubarMenuContext] = createMenubarContext(MENU_NAME);
|
|
4639
4641
|
var MenubarMenu$1 = (props) => {
|
|
4640
4642
|
const { __scopeMenubar, value: valueProp, ...menuProps } = props;
|
|
4641
|
-
const autoValue =
|
|
4643
|
+
const autoValue = index.useId();
|
|
4642
4644
|
const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE";
|
|
4643
4645
|
const context = useMenubarContext(MENU_NAME, __scopeMenubar);
|
|
4644
4646
|
const menuScope = useMenuScope(__scopeMenubar);
|
|
@@ -4653,9 +4655,9 @@ var MenubarMenu$1 = (props) => {
|
|
|
4653
4655
|
{
|
|
4654
4656
|
scope: __scopeMenubar,
|
|
4655
4657
|
value,
|
|
4656
|
-
triggerId:
|
|
4658
|
+
triggerId: index.useId(),
|
|
4657
4659
|
triggerRef,
|
|
4658
|
-
contentId:
|
|
4660
|
+
contentId: index.useId(),
|
|
4659
4661
|
wasKeyboardTriggerOpenRef,
|
|
4660
4662
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4661
4663
|
Root3$1,
|
|
@@ -4683,7 +4685,7 @@ var MenubarTrigger$1 = React__namespace.forwardRef(
|
|
|
4683
4685
|
const context = useMenubarContext(TRIGGER_NAME$2, __scopeMenubar);
|
|
4684
4686
|
const menuContext = useMenubarMenuContext(TRIGGER_NAME$2, __scopeMenubar);
|
|
4685
4687
|
const ref = React__namespace.useRef(null);
|
|
4686
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref, menuContext.triggerRef);
|
|
4688
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref, menuContext.triggerRef);
|
|
4687
4689
|
const [isFocused, setIsFocused] = React__namespace.useState(false);
|
|
4688
4690
|
const open = context.value === menuContext.value;
|
|
4689
4691
|
return /* @__PURE__ */ jsxRuntime.jsx(Collection.ItemSlot, { scope: __scopeMenubar, value: menuContext.value, disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4694,7 +4696,7 @@ var MenubarTrigger$1 = React__namespace.forwardRef(
|
|
|
4694
4696
|
focusable: !disabled,
|
|
4695
4697
|
tabStopId: menuContext.value,
|
|
4696
4698
|
children: /* @__PURE__ */ jsxRuntime.jsx(Anchor2$1, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4697
|
-
|
|
4699
|
+
index.Primitive.button,
|
|
4698
4700
|
{
|
|
4699
4701
|
type: "button",
|
|
4700
4702
|
role: "menuitem",
|
|
@@ -4708,20 +4710,20 @@ var MenubarTrigger$1 = React__namespace.forwardRef(
|
|
|
4708
4710
|
disabled,
|
|
4709
4711
|
...triggerProps,
|
|
4710
4712
|
ref: composedRefs,
|
|
4711
|
-
onPointerDown:
|
|
4713
|
+
onPointerDown: index.composeEventHandlers(props.onPointerDown, (event) => {
|
|
4712
4714
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
4713
4715
|
context.onMenuOpen(menuContext.value);
|
|
4714
4716
|
if (!open) event.preventDefault();
|
|
4715
4717
|
}
|
|
4716
4718
|
}),
|
|
4717
|
-
onPointerEnter:
|
|
4719
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, () => {
|
|
4718
4720
|
const menubarOpen = Boolean(context.value);
|
|
4719
4721
|
if (menubarOpen && !open) {
|
|
4720
4722
|
context.onMenuOpen(menuContext.value);
|
|
4721
4723
|
ref.current?.focus();
|
|
4722
4724
|
}
|
|
4723
4725
|
}),
|
|
4724
|
-
onKeyDown:
|
|
4726
|
+
onKeyDown: index.composeEventHandlers(props.onKeyDown, (event) => {
|
|
4725
4727
|
if (disabled) return;
|
|
4726
4728
|
if (["Enter", " "].includes(event.key)) context.onMenuToggle(menuContext.value);
|
|
4727
4729
|
if (event.key === "ArrowDown") context.onMenuOpen(menuContext.value);
|
|
@@ -4730,8 +4732,8 @@ var MenubarTrigger$1 = React__namespace.forwardRef(
|
|
|
4730
4732
|
event.preventDefault();
|
|
4731
4733
|
}
|
|
4732
4734
|
}),
|
|
4733
|
-
onFocus:
|
|
4734
|
-
onBlur:
|
|
4735
|
+
onFocus: index.composeEventHandlers(props.onFocus, () => setIsFocused(true)),
|
|
4736
|
+
onBlur: index.composeEventHandlers(props.onBlur, () => setIsFocused(false))
|
|
4735
4737
|
}
|
|
4736
4738
|
) })
|
|
4737
4739
|
}
|
|
@@ -4765,7 +4767,7 @@ var MenubarContent$1 = React__namespace.forwardRef(
|
|
|
4765
4767
|
...contentProps,
|
|
4766
4768
|
ref: forwardedRef,
|
|
4767
4769
|
align,
|
|
4768
|
-
onCloseAutoFocus:
|
|
4770
|
+
onCloseAutoFocus: index.composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
4769
4771
|
const menubarOpen = Boolean(context.value);
|
|
4770
4772
|
if (!menubarOpen && !hasInteractedOutsideRef.current) {
|
|
4771
4773
|
menuContext.triggerRef.current?.focus();
|
|
@@ -4773,18 +4775,18 @@ var MenubarContent$1 = React__namespace.forwardRef(
|
|
|
4773
4775
|
hasInteractedOutsideRef.current = false;
|
|
4774
4776
|
event.preventDefault();
|
|
4775
4777
|
}),
|
|
4776
|
-
onFocusOutside:
|
|
4778
|
+
onFocusOutside: index.composeEventHandlers(props.onFocusOutside, (event) => {
|
|
4777
4779
|
const target = event.target;
|
|
4778
4780
|
const isMenubarTrigger = getItems().some((item) => item.ref.current?.contains(target));
|
|
4779
4781
|
if (isMenubarTrigger) event.preventDefault();
|
|
4780
4782
|
}),
|
|
4781
|
-
onInteractOutside:
|
|
4783
|
+
onInteractOutside: index.composeEventHandlers(props.onInteractOutside, () => {
|
|
4782
4784
|
hasInteractedOutsideRef.current = true;
|
|
4783
4785
|
}),
|
|
4784
4786
|
onEntryFocus: (event) => {
|
|
4785
4787
|
if (!menuContext.wasKeyboardTriggerOpenRef.current) event.preventDefault();
|
|
4786
4788
|
},
|
|
4787
|
-
onKeyDown:
|
|
4789
|
+
onKeyDown: index.composeEventHandlers(
|
|
4788
4790
|
props.onKeyDown,
|
|
4789
4791
|
(event) => {
|
|
4790
4792
|
if (["ArrowRight", "ArrowLeft"].includes(event.key)) {
|
|
@@ -4906,7 +4908,7 @@ var SUB_NAME = "MenubarSub";
|
|
|
4906
4908
|
var MenubarSub$1 = (props) => {
|
|
4907
4909
|
const { __scopeMenubar, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
4908
4910
|
const menuScope = useMenuScope(__scopeMenubar);
|
|
4909
|
-
const [open, setOpen] =
|
|
4911
|
+
const [open, setOpen] = index.useControllableState({
|
|
4910
4912
|
prop: openProp,
|
|
4911
4913
|
defaultProp: defaultOpen ?? false,
|
|
4912
4914
|
onChange: onOpenChange,
|
|
@@ -5068,7 +5070,7 @@ function MenubarCheckboxItem({ className, children, checked, ...props }) {
|
|
|
5068
5070
|
checked,
|
|
5069
5071
|
...props,
|
|
5070
5072
|
children: [
|
|
5071
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator2, { children: /* @__PURE__ */ jsxRuntime.jsx(index$
|
|
5073
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator2, { children: /* @__PURE__ */ jsxRuntime.jsx(index$2.Check, { className: "size-4" }) }) }),
|
|
5072
5074
|
children
|
|
5073
5075
|
]
|
|
5074
5076
|
}
|
|
@@ -5152,7 +5154,7 @@ function MenubarSubContent({ className, ...props }) {
|
|
|
5152
5154
|
);
|
|
5153
5155
|
}
|
|
5154
5156
|
var ROOT_NAME = "AlertDialog";
|
|
5155
|
-
var [createAlertDialogContext
|
|
5157
|
+
var [createAlertDialogContext] = index.createContextScope(ROOT_NAME, [
|
|
5156
5158
|
textarea.createDialogScope
|
|
5157
5159
|
]);
|
|
5158
5160
|
var useDialogScope = textarea.createDialogScope();
|
|
@@ -5175,7 +5177,7 @@ var PORTAL_NAME$1 = "AlertDialogPortal";
|
|
|
5175
5177
|
var AlertDialogPortal$1 = (props) => {
|
|
5176
5178
|
const { __scopeAlertDialog, ...portalProps } = props;
|
|
5177
5179
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
5178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Portal
|
|
5180
|
+
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Portal, { ...dialogScope, ...portalProps });
|
|
5179
5181
|
};
|
|
5180
5182
|
AlertDialogPortal$1.displayName = PORTAL_NAME$1;
|
|
5181
5183
|
var OVERLAY_NAME = "AlertDialogOverlay";
|
|
@@ -5189,13 +5191,13 @@ var AlertDialogOverlay$1 = React__namespace.forwardRef(
|
|
|
5189
5191
|
AlertDialogOverlay$1.displayName = OVERLAY_NAME;
|
|
5190
5192
|
var CONTENT_NAME$1 = "AlertDialogContent";
|
|
5191
5193
|
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME$1);
|
|
5192
|
-
var Slottable = index.createSlottable("AlertDialogContent");
|
|
5194
|
+
var Slottable = index$1.createSlottable("AlertDialogContent");
|
|
5193
5195
|
var AlertDialogContent$1 = React__namespace.forwardRef(
|
|
5194
5196
|
(props, forwardedRef) => {
|
|
5195
5197
|
const { __scopeAlertDialog, children, ...contentProps } = props;
|
|
5196
5198
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
5197
5199
|
const contentRef = React__namespace.useRef(null);
|
|
5198
|
-
const composedRefs = index.useComposedRefs(forwardedRef, contentRef);
|
|
5200
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, contentRef);
|
|
5199
5201
|
const cancelRef = React__namespace.useRef(null);
|
|
5200
5202
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5201
5203
|
textarea.WarningProvider,
|
|
@@ -5210,7 +5212,7 @@ var AlertDialogContent$1 = React__namespace.forwardRef(
|
|
|
5210
5212
|
...dialogScope,
|
|
5211
5213
|
...contentProps,
|
|
5212
5214
|
ref: composedRefs,
|
|
5213
|
-
onOpenAutoFocus:
|
|
5215
|
+
onOpenAutoFocus: index.composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
|
5214
5216
|
event.preventDefault();
|
|
5215
5217
|
cancelRef.current?.focus({ preventScroll: true });
|
|
5216
5218
|
}),
|
|
@@ -5258,7 +5260,7 @@ var AlertDialogCancel$1 = React__namespace.forwardRef(
|
|
|
5258
5260
|
const { __scopeAlertDialog, ...cancelProps } = props;
|
|
5259
5261
|
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
|
5260
5262
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
5261
|
-
const ref = index.useComposedRefs(forwardedRef, cancelRef);
|
|
5263
|
+
const ref = index$1.useComposedRefs(forwardedRef, cancelRef);
|
|
5262
5264
|
return /* @__PURE__ */ jsxRuntime.jsx(textarea.Close, { ...dialogScope, ...cancelProps, ref });
|
|
5263
5265
|
}
|
|
5264
5266
|
);
|
|
@@ -5379,10 +5381,10 @@ const AlertConfirmation = ({
|
|
|
5379
5381
|
};
|
|
5380
5382
|
var originalBodyUserSelect;
|
|
5381
5383
|
var HOVERCARD_NAME = "HoverCard";
|
|
5382
|
-
var [createHoverCardContext
|
|
5383
|
-
|
|
5384
|
+
var [createHoverCardContext] = index.createContextScope(HOVERCARD_NAME, [
|
|
5385
|
+
index$3.createPopperScope
|
|
5384
5386
|
]);
|
|
5385
|
-
var usePopperScope =
|
|
5387
|
+
var usePopperScope = index$3.createPopperScope();
|
|
5386
5388
|
var [HoverCardProvider, useHoverCardContext] = createHoverCardContext(HOVERCARD_NAME);
|
|
5387
5389
|
var HoverCard$1 = (props) => {
|
|
5388
5390
|
const {
|
|
@@ -5399,7 +5401,7 @@ var HoverCard$1 = (props) => {
|
|
|
5399
5401
|
const closeTimerRef = React__namespace.useRef(0);
|
|
5400
5402
|
const hasSelectionRef = React__namespace.useRef(false);
|
|
5401
5403
|
const isPointerDownOnContentRef = React__namespace.useRef(false);
|
|
5402
|
-
const [open, setOpen] =
|
|
5404
|
+
const [open, setOpen] = index.useControllableState({
|
|
5403
5405
|
prop: openProp,
|
|
5404
5406
|
defaultProp: defaultOpen ?? false,
|
|
5405
5407
|
onChange: onOpenChange,
|
|
@@ -5433,7 +5435,7 @@ var HoverCard$1 = (props) => {
|
|
|
5433
5435
|
onDismiss: handleDismiss,
|
|
5434
5436
|
hasSelectionRef,
|
|
5435
5437
|
isPointerDownOnContentRef,
|
|
5436
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5438
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(index$3.Root2, { ...popperScope, children })
|
|
5437
5439
|
}
|
|
5438
5440
|
);
|
|
5439
5441
|
};
|
|
@@ -5444,17 +5446,17 @@ var HoverCardTrigger$1 = React__namespace.forwardRef(
|
|
|
5444
5446
|
const { __scopeHoverCard, ...triggerProps } = props;
|
|
5445
5447
|
const context = useHoverCardContext(TRIGGER_NAME, __scopeHoverCard);
|
|
5446
5448
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
5447
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5448
|
-
|
|
5449
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Anchor, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5450
|
+
index.Primitive.a,
|
|
5449
5451
|
{
|
|
5450
5452
|
"data-state": context.open ? "open" : "closed",
|
|
5451
5453
|
...triggerProps,
|
|
5452
5454
|
ref: forwardedRef,
|
|
5453
|
-
onPointerEnter:
|
|
5454
|
-
onPointerLeave:
|
|
5455
|
-
onFocus:
|
|
5456
|
-
onBlur:
|
|
5457
|
-
onTouchStart:
|
|
5455
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),
|
|
5456
|
+
onPointerLeave: index.composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),
|
|
5457
|
+
onFocus: index.composeEventHandlers(props.onFocus, context.onOpen),
|
|
5458
|
+
onBlur: index.composeEventHandlers(props.onBlur, context.onClose),
|
|
5459
|
+
onTouchStart: index.composeEventHandlers(props.onTouchStart, (event) => event.preventDefault())
|
|
5458
5460
|
}
|
|
5459
5461
|
) });
|
|
5460
5462
|
}
|
|
@@ -5467,7 +5469,7 @@ var [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME, {
|
|
|
5467
5469
|
var HoverCardPortal = (props) => {
|
|
5468
5470
|
const { __scopeHoverCard, forceMount, children, container } = props;
|
|
5469
5471
|
const context = useHoverCardContext(PORTAL_NAME, __scopeHoverCard);
|
|
5470
|
-
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeHoverCard, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5472
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PortalProvider, { scope: __scopeHoverCard, forceMount, children: /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(index.Portal, { asChild: true, container, children }) }) });
|
|
5471
5473
|
};
|
|
5472
5474
|
HoverCardPortal.displayName = PORTAL_NAME;
|
|
5473
5475
|
var CONTENT_NAME = "HoverCardContent";
|
|
@@ -5476,13 +5478,13 @@ var HoverCardContent$1 = React__namespace.forwardRef(
|
|
|
5476
5478
|
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeHoverCard);
|
|
5477
5479
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
5478
5480
|
const context = useHoverCardContext(CONTENT_NAME, props.__scopeHoverCard);
|
|
5479
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5481
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index.Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5480
5482
|
HoverCardContentImpl,
|
|
5481
5483
|
{
|
|
5482
5484
|
"data-state": context.open ? "open" : "closed",
|
|
5483
5485
|
...contentProps,
|
|
5484
|
-
onPointerEnter:
|
|
5485
|
-
onPointerLeave:
|
|
5486
|
+
onPointerEnter: index.composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),
|
|
5487
|
+
onPointerLeave: index.composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),
|
|
5486
5488
|
ref: forwardedRef
|
|
5487
5489
|
}
|
|
5488
5490
|
) });
|
|
@@ -5501,7 +5503,7 @@ var HoverCardContentImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
5501
5503
|
const context = useHoverCardContext(CONTENT_NAME, __scopeHoverCard);
|
|
5502
5504
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
5503
5505
|
const ref = React__namespace.useRef(null);
|
|
5504
|
-
const composedRefs = index.useComposedRefs(forwardedRef, ref);
|
|
5506
|
+
const composedRefs = index$1.useComposedRefs(forwardedRef, ref);
|
|
5505
5507
|
const [containSelection, setContainSelection] = React__namespace.useState(false);
|
|
5506
5508
|
React__namespace.useEffect(() => {
|
|
5507
5509
|
if (containSelection) {
|
|
@@ -5540,23 +5542,23 @@ var HoverCardContentImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
5540
5542
|
}
|
|
5541
5543
|
});
|
|
5542
5544
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5543
|
-
|
|
5545
|
+
index.DismissableLayer,
|
|
5544
5546
|
{
|
|
5545
5547
|
asChild: true,
|
|
5546
5548
|
disableOutsidePointerEvents: false,
|
|
5547
5549
|
onInteractOutside,
|
|
5548
5550
|
onEscapeKeyDown,
|
|
5549
5551
|
onPointerDownOutside,
|
|
5550
|
-
onFocusOutside:
|
|
5552
|
+
onFocusOutside: index.composeEventHandlers(onFocusOutside, (event) => {
|
|
5551
5553
|
event.preventDefault();
|
|
5552
5554
|
}),
|
|
5553
5555
|
onDismiss: context.onDismiss,
|
|
5554
5556
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5555
|
-
|
|
5557
|
+
index$3.Content,
|
|
5556
5558
|
{
|
|
5557
5559
|
...popperScope,
|
|
5558
5560
|
...contentProps,
|
|
5559
|
-
onPointerDown:
|
|
5561
|
+
onPointerDown: index.composeEventHandlers(contentProps.onPointerDown, (event) => {
|
|
5560
5562
|
if (event.currentTarget.contains(event.target)) {
|
|
5561
5563
|
setContainSelection(true);
|
|
5562
5564
|
}
|
|
@@ -5588,7 +5590,7 @@ var HoverCardArrow = React__namespace.forwardRef(
|
|
|
5588
5590
|
(props, forwardedRef) => {
|
|
5589
5591
|
const { __scopeHoverCard, ...arrowProps } = props;
|
|
5590
5592
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
5591
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5593
|
+
return /* @__PURE__ */ jsxRuntime.jsx(index$3.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
5592
5594
|
}
|
|
5593
5595
|
);
|
|
5594
5596
|
HoverCardArrow.displayName = ARROW_NAME;
|