agent-relay-server 0.10.24 → 0.10.26
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/package.json +1 -1
- package/public/index.html +1185 -150
- package/runner/src/adapter.ts +1 -0
- package/runner/src/config.ts +7 -0
- package/src/routes.ts +1 -0
package/public/index.html
CHANGED
|
@@ -14076,7 +14076,7 @@ function createSlot(ownerName) {
|
|
|
14076
14076
|
Slot2.displayName = `${ownerName}.Slot`;
|
|
14077
14077
|
return Slot2;
|
|
14078
14078
|
}
|
|
14079
|
-
var Slot$
|
|
14079
|
+
var Slot$3 = /* @__PURE__ */ createSlot("Slot");
|
|
14080
14080
|
/* @__NO_SIDE_EFFECTS__ */
|
|
14081
14081
|
function createSlotClone(ownerName) {
|
|
14082
14082
|
const SlotClone = import_react.forwardRef((props, forwardedRef) => {
|
|
@@ -14925,8 +14925,8 @@ function removeLinks(items) {
|
|
|
14925
14925
|
}
|
|
14926
14926
|
//#endregion
|
|
14927
14927
|
//#region node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
14928
|
-
var PORTAL_NAME$
|
|
14929
|
-
var Portal$
|
|
14928
|
+
var PORTAL_NAME$5 = "Portal";
|
|
14929
|
+
var Portal$3 = import_react.forwardRef((props, forwardedRef) => {
|
|
14930
14930
|
const { container: containerProp, ...portalProps } = props;
|
|
14931
14931
|
const [mounted, setMounted] = import_react.useState(false);
|
|
14932
14932
|
useLayoutEffect2(() => setMounted(true), []);
|
|
@@ -14936,7 +14936,7 @@ var Portal$2 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
14936
14936
|
ref: forwardedRef
|
|
14937
14937
|
}), container) : null;
|
|
14938
14938
|
});
|
|
14939
|
-
Portal$
|
|
14939
|
+
Portal$3.displayName = PORTAL_NAME$5;
|
|
14940
14940
|
//#endregion
|
|
14941
14941
|
//#region node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
14942
14942
|
var count = 0;
|
|
@@ -15811,10 +15811,10 @@ var Dialog$1 = (props) => {
|
|
|
15811
15811
|
});
|
|
15812
15812
|
};
|
|
15813
15813
|
Dialog$1.displayName = DIALOG_NAME;
|
|
15814
|
-
var TRIGGER_NAME$
|
|
15814
|
+
var TRIGGER_NAME$4 = "DialogTrigger";
|
|
15815
15815
|
var DialogTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
15816
15816
|
const { __scopeDialog, ...triggerProps } = props;
|
|
15817
|
-
const context = useDialogContext(TRIGGER_NAME$
|
|
15817
|
+
const context = useDialogContext(TRIGGER_NAME$4, __scopeDialog);
|
|
15818
15818
|
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
15819
15819
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
15820
15820
|
type: "button",
|
|
@@ -15827,18 +15827,18 @@ var DialogTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15827
15827
|
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
15828
15828
|
});
|
|
15829
15829
|
});
|
|
15830
|
-
DialogTrigger.displayName = TRIGGER_NAME$
|
|
15831
|
-
var PORTAL_NAME$
|
|
15832
|
-
var [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$
|
|
15830
|
+
DialogTrigger.displayName = TRIGGER_NAME$4;
|
|
15831
|
+
var PORTAL_NAME$4 = "DialogPortal";
|
|
15832
|
+
var [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$4, { forceMount: void 0 });
|
|
15833
15833
|
var DialogPortal$1 = (props) => {
|
|
15834
15834
|
const { __scopeDialog, forceMount, children, container } = props;
|
|
15835
|
-
const context = useDialogContext(PORTAL_NAME$
|
|
15835
|
+
const context = useDialogContext(PORTAL_NAME$4, __scopeDialog);
|
|
15836
15836
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider$2, {
|
|
15837
15837
|
scope: __scopeDialog,
|
|
15838
15838
|
forceMount,
|
|
15839
15839
|
children: import_react.Children.map(children, (child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
15840
15840
|
present: forceMount || context.open,
|
|
15841
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$
|
|
15841
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$3, {
|
|
15842
15842
|
asChild: true,
|
|
15843
15843
|
container,
|
|
15844
15844
|
children: child
|
|
@@ -15846,7 +15846,7 @@ var DialogPortal$1 = (props) => {
|
|
|
15846
15846
|
}))
|
|
15847
15847
|
});
|
|
15848
15848
|
};
|
|
15849
|
-
DialogPortal$1.displayName = PORTAL_NAME$
|
|
15849
|
+
DialogPortal$1.displayName = PORTAL_NAME$4;
|
|
15850
15850
|
var OVERLAY_NAME = "DialogOverlay";
|
|
15851
15851
|
var DialogOverlay$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
15852
15852
|
const portalContext = usePortalContext$2(OVERLAY_NAME, props.__scopeDialog);
|
|
@@ -15861,12 +15861,12 @@ var DialogOverlay$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15861
15861
|
}) : null;
|
|
15862
15862
|
});
|
|
15863
15863
|
DialogOverlay$1.displayName = OVERLAY_NAME;
|
|
15864
|
-
var Slot$
|
|
15864
|
+
var Slot$2 = /* @__PURE__ */ createSlot("DialogOverlay.RemoveScroll");
|
|
15865
15865
|
var DialogOverlayImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
15866
15866
|
const { __scopeDialog, ...overlayProps } = props;
|
|
15867
15867
|
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
15868
15868
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReactRemoveScroll, {
|
|
15869
|
-
as: Slot$
|
|
15869
|
+
as: Slot$2,
|
|
15870
15870
|
allowPinchZoom: true,
|
|
15871
15871
|
shards: [context.contentRef],
|
|
15872
15872
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
@@ -15880,11 +15880,11 @@ var DialogOverlayImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15880
15880
|
})
|
|
15881
15881
|
});
|
|
15882
15882
|
});
|
|
15883
|
-
var CONTENT_NAME$
|
|
15883
|
+
var CONTENT_NAME$6 = "DialogContent";
|
|
15884
15884
|
var DialogContent$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
15885
|
-
const portalContext = usePortalContext$2(CONTENT_NAME$
|
|
15885
|
+
const portalContext = usePortalContext$2(CONTENT_NAME$6, props.__scopeDialog);
|
|
15886
15886
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
15887
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
15887
|
+
const context = useDialogContext(CONTENT_NAME$6, props.__scopeDialog);
|
|
15888
15888
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
15889
15889
|
present: forceMount || context.open,
|
|
15890
15890
|
children: context.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentModal, {
|
|
@@ -15896,9 +15896,9 @@ var DialogContent$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15896
15896
|
})
|
|
15897
15897
|
});
|
|
15898
15898
|
});
|
|
15899
|
-
DialogContent$1.displayName = CONTENT_NAME$
|
|
15899
|
+
DialogContent$1.displayName = CONTENT_NAME$6;
|
|
15900
15900
|
var DialogContentModal = import_react.forwardRef((props, forwardedRef) => {
|
|
15901
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
15901
|
+
const context = useDialogContext(CONTENT_NAME$6, props.__scopeDialog);
|
|
15902
15902
|
const contentRef = import_react.useRef(null);
|
|
15903
15903
|
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
15904
15904
|
import_react.useEffect(() => {
|
|
@@ -15923,7 +15923,7 @@ var DialogContentModal = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15923
15923
|
});
|
|
15924
15924
|
});
|
|
15925
15925
|
var DialogContentNonModal = import_react.forwardRef((props, forwardedRef) => {
|
|
15926
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
15926
|
+
const context = useDialogContext(CONTENT_NAME$6, props.__scopeDialog);
|
|
15927
15927
|
const hasInteractedOutsideRef = import_react.useRef(false);
|
|
15928
15928
|
const hasPointerDownOutsideRef = import_react.useRef(false);
|
|
15929
15929
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogContentImpl, {
|
|
@@ -15954,7 +15954,7 @@ var DialogContentNonModal = import_react.forwardRef((props, forwardedRef) => {
|
|
|
15954
15954
|
});
|
|
15955
15955
|
var DialogContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
15956
15956
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
15957
|
-
const context = useDialogContext(CONTENT_NAME$
|
|
15957
|
+
const context = useDialogContext(CONTENT_NAME$6, __scopeDialog);
|
|
15958
15958
|
const contentRef = import_react.useRef(null);
|
|
15959
15959
|
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
15960
15960
|
useFocusGuards();
|
|
@@ -16018,7 +16018,7 @@ function getState$1(open) {
|
|
|
16018
16018
|
}
|
|
16019
16019
|
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
16020
16020
|
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
16021
|
-
contentName: CONTENT_NAME$
|
|
16021
|
+
contentName: CONTENT_NAME$6,
|
|
16022
16022
|
titleName: TITLE_NAME,
|
|
16023
16023
|
docsSlug: "dialog"
|
|
16024
16024
|
});
|
|
@@ -16052,7 +16052,7 @@ var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
|
16052
16052
|
return null;
|
|
16053
16053
|
};
|
|
16054
16054
|
var Root$6 = Dialog$1;
|
|
16055
|
-
var Portal$
|
|
16055
|
+
var Portal$2 = DialogPortal$1;
|
|
16056
16056
|
var Overlay = DialogOverlay$1;
|
|
16057
16057
|
var Content$2 = DialogContent$1;
|
|
16058
16058
|
var Title = DialogTitle$1;
|
|
@@ -17813,11 +17813,11 @@ var PopperAnchor = import_react.forwardRef((props, forwardedRef) => {
|
|
|
17813
17813
|
});
|
|
17814
17814
|
});
|
|
17815
17815
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
17816
|
-
var CONTENT_NAME$
|
|
17817
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$
|
|
17816
|
+
var CONTENT_NAME$5 = "PopperContent";
|
|
17817
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$5);
|
|
17818
17818
|
var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
17819
17819
|
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
17820
|
-
const context = usePopperContext(CONTENT_NAME$
|
|
17820
|
+
const context = usePopperContext(CONTENT_NAME$5, __scopePopper);
|
|
17821
17821
|
const [content, setContent] = import_react.useState(null);
|
|
17822
17822
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
17823
17823
|
const [arrow$4, setArrow] = import_react.useState(null);
|
|
@@ -17930,8 +17930,8 @@ var PopperContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
17930
17930
|
})
|
|
17931
17931
|
});
|
|
17932
17932
|
});
|
|
17933
|
-
PopperContent.displayName = CONTENT_NAME$
|
|
17934
|
-
var ARROW_NAME$
|
|
17933
|
+
PopperContent.displayName = CONTENT_NAME$5;
|
|
17934
|
+
var ARROW_NAME$4 = "PopperArrow";
|
|
17935
17935
|
var OPPOSITE_SIDE = {
|
|
17936
17936
|
top: "bottom",
|
|
17937
17937
|
right: "left",
|
|
@@ -17940,7 +17940,7 @@ var OPPOSITE_SIDE = {
|
|
|
17940
17940
|
};
|
|
17941
17941
|
var PopperArrow = import_react.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
17942
17942
|
const { __scopePopper, ...arrowProps } = props;
|
|
17943
|
-
const contentContext = useContentContext(ARROW_NAME$
|
|
17943
|
+
const contentContext = useContentContext(ARROW_NAME$4, __scopePopper);
|
|
17944
17944
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
17945
17945
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
17946
17946
|
ref: contentContext.onArrowChange,
|
|
@@ -17973,7 +17973,7 @@ var PopperArrow = import_react.forwardRef(function PopperArrow2(props, forwarded
|
|
|
17973
17973
|
})
|
|
17974
17974
|
});
|
|
17975
17975
|
});
|
|
17976
|
-
PopperArrow.displayName = ARROW_NAME$
|
|
17976
|
+
PopperArrow.displayName = ARROW_NAME$4;
|
|
17977
17977
|
function isNotNull(value) {
|
|
17978
17978
|
return value !== null;
|
|
17979
17979
|
}
|
|
@@ -18018,7 +18018,7 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
18018
18018
|
const [side, align = "center"] = placement.split("-");
|
|
18019
18019
|
return [side, align];
|
|
18020
18020
|
}
|
|
18021
|
-
var Root2$
|
|
18021
|
+
var Root2$3 = Popper;
|
|
18022
18022
|
var Anchor$1 = PopperAnchor;
|
|
18023
18023
|
var Content$1 = PopperContent;
|
|
18024
18024
|
var Arrow = PopperArrow;
|
|
@@ -18029,14 +18029,14 @@ var EVENT_OPTIONS = {
|
|
|
18029
18029
|
bubbles: false,
|
|
18030
18030
|
cancelable: true
|
|
18031
18031
|
};
|
|
18032
|
-
var GROUP_NAME$
|
|
18033
|
-
var [Collection$
|
|
18034
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME$
|
|
18035
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$
|
|
18032
|
+
var GROUP_NAME$3 = "RovingFocusGroup";
|
|
18033
|
+
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection(GROUP_NAME$3);
|
|
18034
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(GROUP_NAME$3, [createCollectionScope$2]);
|
|
18035
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$3);
|
|
18036
18036
|
var RovingFocusGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
18037
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$
|
|
18037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$2.Provider, {
|
|
18038
18038
|
scope: props.__scopeRovingFocusGroup,
|
|
18039
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$
|
|
18039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$2.Slot, {
|
|
18040
18040
|
scope: props.__scopeRovingFocusGroup,
|
|
18041
18041
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RovingFocusGroupImpl, {
|
|
18042
18042
|
...props,
|
|
@@ -18045,7 +18045,7 @@ var RovingFocusGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18045
18045
|
})
|
|
18046
18046
|
});
|
|
18047
18047
|
});
|
|
18048
|
-
RovingFocusGroup.displayName = GROUP_NAME$
|
|
18048
|
+
RovingFocusGroup.displayName = GROUP_NAME$3;
|
|
18049
18049
|
var RovingFocusGroupImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
18050
18050
|
const { __scopeRovingFocusGroup, orientation, loop = false, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, preventScrollOnEntryFocus = false, ...groupProps } = props;
|
|
18051
18051
|
const ref = import_react.useRef(null);
|
|
@@ -18055,11 +18055,11 @@ var RovingFocusGroupImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18055
18055
|
prop: currentTabStopIdProp,
|
|
18056
18056
|
defaultProp: defaultCurrentTabStopId ?? null,
|
|
18057
18057
|
onChange: onCurrentTabStopIdChange,
|
|
18058
|
-
caller: GROUP_NAME$
|
|
18058
|
+
caller: GROUP_NAME$3
|
|
18059
18059
|
});
|
|
18060
18060
|
const [isTabbingBackOut, setIsTabbingBackOut] = import_react.useState(false);
|
|
18061
18061
|
const handleEntryFocus = useCallbackRef$1(onEntryFocus);
|
|
18062
|
-
const getItems = useCollection$
|
|
18062
|
+
const getItems = useCollection$2(__scopeRovingFocusGroup);
|
|
18063
18063
|
const isClickFocusRef = import_react.useRef(false);
|
|
18064
18064
|
const [focusableItemsCount, setFocusableItemsCount] = import_react.useState(0);
|
|
18065
18065
|
import_react.useEffect(() => {
|
|
@@ -18111,14 +18111,14 @@ var RovingFocusGroupImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18111
18111
|
})
|
|
18112
18112
|
});
|
|
18113
18113
|
});
|
|
18114
|
-
var ITEM_NAME$
|
|
18114
|
+
var ITEM_NAME$3 = "RovingFocusGroupItem";
|
|
18115
18115
|
var RovingFocusGroupItem = import_react.forwardRef((props, forwardedRef) => {
|
|
18116
18116
|
const { __scopeRovingFocusGroup, focusable = true, active = false, tabStopId, children, ...itemProps } = props;
|
|
18117
18117
|
const autoId = useId();
|
|
18118
18118
|
const id = tabStopId || autoId;
|
|
18119
|
-
const context = useRovingFocusContext(ITEM_NAME$
|
|
18119
|
+
const context = useRovingFocusContext(ITEM_NAME$3, __scopeRovingFocusGroup);
|
|
18120
18120
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
18121
|
-
const getItems = useCollection$
|
|
18121
|
+
const getItems = useCollection$2(__scopeRovingFocusGroup);
|
|
18122
18122
|
const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;
|
|
18123
18123
|
import_react.useEffect(() => {
|
|
18124
18124
|
if (focusable) {
|
|
@@ -18130,7 +18130,7 @@ var RovingFocusGroupItem = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18130
18130
|
onFocusableItemAdd,
|
|
18131
18131
|
onFocusableItemRemove
|
|
18132
18132
|
]);
|
|
18133
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$
|
|
18133
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$2.ItemSlot, {
|
|
18134
18134
|
scope: __scopeRovingFocusGroup,
|
|
18135
18135
|
id,
|
|
18136
18136
|
focusable,
|
|
@@ -18160,7 +18160,7 @@ var RovingFocusGroupItem = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18160
18160
|
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
18161
18161
|
if (focusIntent === "prev") candidateNodes.reverse();
|
|
18162
18162
|
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
18163
|
-
candidateNodes = context.loop ? wrapArray$
|
|
18163
|
+
candidateNodes = context.loop ? wrapArray$2(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
18164
18164
|
}
|
|
18165
18165
|
setTimeout(() => focusFirst$1(candidateNodes));
|
|
18166
18166
|
}
|
|
@@ -18172,7 +18172,7 @@ var RovingFocusGroupItem = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18172
18172
|
})
|
|
18173
18173
|
});
|
|
18174
18174
|
});
|
|
18175
|
-
RovingFocusGroupItem.displayName = ITEM_NAME$
|
|
18175
|
+
RovingFocusGroupItem.displayName = ITEM_NAME$3;
|
|
18176
18176
|
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
18177
18177
|
ArrowLeft: "prev",
|
|
18178
18178
|
ArrowUp: "prev",
|
|
@@ -18201,14 +18201,14 @@ function focusFirst$1(candidates, preventScroll = false) {
|
|
|
18201
18201
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
18202
18202
|
}
|
|
18203
18203
|
}
|
|
18204
|
-
function wrapArray$
|
|
18204
|
+
function wrapArray$2(array, startIndex) {
|
|
18205
18205
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
18206
18206
|
}
|
|
18207
18207
|
var Root$4 = RovingFocusGroup;
|
|
18208
|
-
var Item = RovingFocusGroupItem;
|
|
18208
|
+
var Item$1 = RovingFocusGroupItem;
|
|
18209
18209
|
//#endregion
|
|
18210
18210
|
//#region node_modules/@radix-ui/react-menu/dist/index.mjs
|
|
18211
|
-
var SELECTION_KEYS = ["Enter", " "];
|
|
18211
|
+
var SELECTION_KEYS$1 = ["Enter", " "];
|
|
18212
18212
|
var FIRST_KEYS = [
|
|
18213
18213
|
"ArrowDown",
|
|
18214
18214
|
"PageUp",
|
|
@@ -18221,27 +18221,27 @@ var LAST_KEYS = [
|
|
|
18221
18221
|
];
|
|
18222
18222
|
var FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
|
|
18223
18223
|
var SUB_OPEN_KEYS = {
|
|
18224
|
-
ltr: [...SELECTION_KEYS, "ArrowRight"],
|
|
18225
|
-
rtl: [...SELECTION_KEYS, "ArrowLeft"]
|
|
18224
|
+
ltr: [...SELECTION_KEYS$1, "ArrowRight"],
|
|
18225
|
+
rtl: [...SELECTION_KEYS$1, "ArrowLeft"]
|
|
18226
18226
|
};
|
|
18227
18227
|
var SUB_CLOSE_KEYS = {
|
|
18228
18228
|
ltr: ["ArrowLeft"],
|
|
18229
18229
|
rtl: ["ArrowRight"]
|
|
18230
18230
|
};
|
|
18231
18231
|
var MENU_NAME = "Menu";
|
|
18232
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
|
|
18232
|
+
var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection(MENU_NAME);
|
|
18233
18233
|
var [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [
|
|
18234
|
-
createCollectionScope,
|
|
18234
|
+
createCollectionScope$1,
|
|
18235
18235
|
createPopperScope,
|
|
18236
18236
|
createRovingFocusGroupScope
|
|
18237
18237
|
]);
|
|
18238
|
-
var usePopperScope$
|
|
18238
|
+
var usePopperScope$2 = createPopperScope();
|
|
18239
18239
|
var useRovingFocusGroupScope$1 = createRovingFocusGroupScope();
|
|
18240
18240
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
18241
18241
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
18242
18242
|
var Menu$1 = (props) => {
|
|
18243
18243
|
const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;
|
|
18244
|
-
const popperScope = usePopperScope$
|
|
18244
|
+
const popperScope = usePopperScope$2(__scopeMenu);
|
|
18245
18245
|
const [content, setContent] = import_react.useState(null);
|
|
18246
18246
|
const isUsingKeyboardRef = import_react.useRef(false);
|
|
18247
18247
|
const handleOpenChange = useCallbackRef$1(onOpenChange);
|
|
@@ -18266,7 +18266,7 @@ var Menu$1 = (props) => {
|
|
|
18266
18266
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
18267
18267
|
};
|
|
18268
18268
|
}, []);
|
|
18269
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$
|
|
18269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$3, {
|
|
18270
18270
|
...popperScope,
|
|
18271
18271
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuProvider, {
|
|
18272
18272
|
scope: __scopeMenu,
|
|
@@ -18289,7 +18289,7 @@ Menu$1.displayName = MENU_NAME;
|
|
|
18289
18289
|
var ANCHOR_NAME = "MenuAnchor";
|
|
18290
18290
|
var MenuAnchor = import_react.forwardRef((props, forwardedRef) => {
|
|
18291
18291
|
const { __scopeMenu, ...anchorProps } = props;
|
|
18292
|
-
const popperScope = usePopperScope$
|
|
18292
|
+
const popperScope = usePopperScope$2(__scopeMenu);
|
|
18293
18293
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor$1, {
|
|
18294
18294
|
...popperScope,
|
|
18295
18295
|
...anchorProps,
|
|
@@ -18297,17 +18297,17 @@ var MenuAnchor = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18297
18297
|
});
|
|
18298
18298
|
});
|
|
18299
18299
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
18300
|
-
var PORTAL_NAME$
|
|
18301
|
-
var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$
|
|
18300
|
+
var PORTAL_NAME$3 = "MenuPortal";
|
|
18301
|
+
var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$3, { forceMount: void 0 });
|
|
18302
18302
|
var MenuPortal = (props) => {
|
|
18303
18303
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
18304
|
-
const context = useMenuContext(PORTAL_NAME$
|
|
18304
|
+
const context = useMenuContext(PORTAL_NAME$3, __scopeMenu);
|
|
18305
18305
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PortalProvider$1, {
|
|
18306
18306
|
scope: __scopeMenu,
|
|
18307
18307
|
forceMount,
|
|
18308
18308
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
18309
18309
|
present: forceMount || context.open,
|
|
18310
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$
|
|
18310
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$3, {
|
|
18311
18311
|
asChild: true,
|
|
18312
18312
|
container,
|
|
18313
18313
|
children
|
|
@@ -18315,19 +18315,19 @@ var MenuPortal = (props) => {
|
|
|
18315
18315
|
})
|
|
18316
18316
|
});
|
|
18317
18317
|
};
|
|
18318
|
-
MenuPortal.displayName = PORTAL_NAME$
|
|
18319
|
-
var CONTENT_NAME$
|
|
18320
|
-
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$
|
|
18318
|
+
MenuPortal.displayName = PORTAL_NAME$3;
|
|
18319
|
+
var CONTENT_NAME$4 = "MenuContent";
|
|
18320
|
+
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$4);
|
|
18321
18321
|
var MenuContent = import_react.forwardRef((props, forwardedRef) => {
|
|
18322
|
-
const portalContext = usePortalContext$1(CONTENT_NAME$
|
|
18322
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$4, props.__scopeMenu);
|
|
18323
18323
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
18324
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
18325
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
18326
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
18324
|
+
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18325
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$1.Provider, {
|
|
18327
18327
|
scope: props.__scopeMenu,
|
|
18328
18328
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
18329
18329
|
present: forceMount || context.open,
|
|
18330
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
18330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$1.Slot, {
|
|
18331
18331
|
scope: props.__scopeMenu,
|
|
18332
18332
|
children: rootContext.modal ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuRootContentModal, {
|
|
18333
18333
|
...contentProps,
|
|
@@ -18341,7 +18341,7 @@ var MenuContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18341
18341
|
});
|
|
18342
18342
|
});
|
|
18343
18343
|
var MenuRootContentModal = import_react.forwardRef((props, forwardedRef) => {
|
|
18344
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
18344
|
+
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18345
18345
|
const ref = import_react.useRef(null);
|
|
18346
18346
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
18347
18347
|
import_react.useEffect(() => {
|
|
@@ -18359,7 +18359,7 @@ var MenuRootContentModal = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18359
18359
|
});
|
|
18360
18360
|
});
|
|
18361
18361
|
var MenuRootContentNonModal = import_react.forwardRef((props, forwardedRef) => {
|
|
18362
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
18362
|
+
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18363
18363
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuContentImpl, {
|
|
18364
18364
|
...props,
|
|
18365
18365
|
ref: forwardedRef,
|
|
@@ -18369,14 +18369,14 @@ var MenuRootContentNonModal = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18369
18369
|
onDismiss: () => context.onOpenChange(false)
|
|
18370
18370
|
});
|
|
18371
18371
|
});
|
|
18372
|
-
var Slot = /* @__PURE__ */ createSlot("MenuContent.ScrollLock");
|
|
18372
|
+
var Slot$1 = /* @__PURE__ */ createSlot("MenuContent.ScrollLock");
|
|
18373
18373
|
var MenuContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
18374
18374
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
18375
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
18376
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
18377
|
-
const popperScope = usePopperScope$
|
|
18375
|
+
const context = useMenuContext(CONTENT_NAME$4, __scopeMenu);
|
|
18376
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$4, __scopeMenu);
|
|
18377
|
+
const popperScope = usePopperScope$2(__scopeMenu);
|
|
18378
18378
|
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
|
|
18379
|
-
const getItems = useCollection(__scopeMenu);
|
|
18379
|
+
const getItems = useCollection$1(__scopeMenu);
|
|
18380
18380
|
const [currentItemId, setCurrentItemId] = import_react.useState(null);
|
|
18381
18381
|
const contentRef = import_react.useRef(null);
|
|
18382
18382
|
const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);
|
|
@@ -18388,7 +18388,7 @@ var MenuContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18388
18388
|
const lastPointerXRef = import_react.useRef(0);
|
|
18389
18389
|
const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : import_react.Fragment;
|
|
18390
18390
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
18391
|
-
as: Slot,
|
|
18391
|
+
as: Slot$1,
|
|
18392
18392
|
allowPinchZoom: true
|
|
18393
18393
|
} : void 0;
|
|
18394
18394
|
const handleTypeaheadSearch = (key) => {
|
|
@@ -18510,8 +18510,8 @@ var MenuContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18510
18510
|
})
|
|
18511
18511
|
});
|
|
18512
18512
|
});
|
|
18513
|
-
MenuContent.displayName = CONTENT_NAME$
|
|
18514
|
-
var GROUP_NAME$
|
|
18513
|
+
MenuContent.displayName = CONTENT_NAME$4;
|
|
18514
|
+
var GROUP_NAME$2 = "MenuGroup";
|
|
18515
18515
|
var MenuGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
18516
18516
|
const { __scopeMenu, ...groupProps } = props;
|
|
18517
18517
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
@@ -18520,8 +18520,8 @@ var MenuGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18520
18520
|
ref: forwardedRef
|
|
18521
18521
|
});
|
|
18522
18522
|
});
|
|
18523
|
-
MenuGroup.displayName = GROUP_NAME$
|
|
18524
|
-
var LABEL_NAME$
|
|
18523
|
+
MenuGroup.displayName = GROUP_NAME$2;
|
|
18524
|
+
var LABEL_NAME$2 = "MenuLabel";
|
|
18525
18525
|
var MenuLabel = import_react.forwardRef((props, forwardedRef) => {
|
|
18526
18526
|
const { __scopeMenu, ...labelProps } = props;
|
|
18527
18527
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
@@ -18529,14 +18529,14 @@ var MenuLabel = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18529
18529
|
ref: forwardedRef
|
|
18530
18530
|
});
|
|
18531
18531
|
});
|
|
18532
|
-
MenuLabel.displayName = LABEL_NAME$
|
|
18533
|
-
var ITEM_NAME$
|
|
18532
|
+
MenuLabel.displayName = LABEL_NAME$2;
|
|
18533
|
+
var ITEM_NAME$2 = "MenuItem";
|
|
18534
18534
|
var ITEM_SELECT = "menu.itemSelect";
|
|
18535
18535
|
var MenuItem = import_react.forwardRef((props, forwardedRef) => {
|
|
18536
18536
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
18537
18537
|
const ref = import_react.useRef(null);
|
|
18538
|
-
const rootContext = useMenuRootContext(ITEM_NAME$
|
|
18539
|
-
const contentContext = useMenuContentContext(ITEM_NAME$
|
|
18538
|
+
const rootContext = useMenuRootContext(ITEM_NAME$2, props.__scopeMenu);
|
|
18539
|
+
const contentContext = useMenuContentContext(ITEM_NAME$2, props.__scopeMenu);
|
|
18540
18540
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
18541
18541
|
const isPointerDownRef = import_react.useRef(false);
|
|
18542
18542
|
const handleSelect = () => {
|
|
@@ -18567,17 +18567,17 @@ var MenuItem = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18567
18567
|
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
18568
18568
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
18569
18569
|
if (disabled || isTypingAhead && event.key === " ") return;
|
|
18570
|
-
if (SELECTION_KEYS.includes(event.key)) {
|
|
18570
|
+
if (SELECTION_KEYS$1.includes(event.key)) {
|
|
18571
18571
|
event.currentTarget.click();
|
|
18572
18572
|
event.preventDefault();
|
|
18573
18573
|
}
|
|
18574
18574
|
})
|
|
18575
18575
|
});
|
|
18576
18576
|
});
|
|
18577
|
-
MenuItem.displayName = ITEM_NAME$
|
|
18577
|
+
MenuItem.displayName = ITEM_NAME$2;
|
|
18578
18578
|
var MenuItemImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
18579
18579
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
18580
|
-
const contentContext = useMenuContentContext(ITEM_NAME$
|
|
18580
|
+
const contentContext = useMenuContentContext(ITEM_NAME$2, __scopeMenu);
|
|
18581
18581
|
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
|
|
18582
18582
|
const ref = import_react.useRef(null);
|
|
18583
18583
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -18587,11 +18587,11 @@ var MenuItemImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18587
18587
|
const menuItem = ref.current;
|
|
18588
18588
|
if (menuItem) setTextContent((menuItem.textContent ?? "").trim());
|
|
18589
18589
|
}, [itemProps.children]);
|
|
18590
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
|
|
18590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$1.ItemSlot, {
|
|
18591
18591
|
scope: __scopeMenu,
|
|
18592
18592
|
disabled,
|
|
18593
18593
|
textValue: textValue ?? textContent,
|
|
18594
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Item, {
|
|
18594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Item$1, {
|
|
18595
18595
|
asChild: true,
|
|
18596
18596
|
...rovingFocusGroupScope,
|
|
18597
18597
|
focusable: !disabled,
|
|
@@ -18671,11 +18671,11 @@ var MenuRadioItem = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18671
18671
|
});
|
|
18672
18672
|
});
|
|
18673
18673
|
MenuRadioItem.displayName = RADIO_ITEM_NAME$1;
|
|
18674
|
-
var ITEM_INDICATOR_NAME = "MenuItemIndicator";
|
|
18675
|
-
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME, { checked: false });
|
|
18674
|
+
var ITEM_INDICATOR_NAME$1 = "MenuItemIndicator";
|
|
18675
|
+
var [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(ITEM_INDICATOR_NAME$1, { checked: false });
|
|
18676
18676
|
var MenuItemIndicator = import_react.forwardRef((props, forwardedRef) => {
|
|
18677
18677
|
const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;
|
|
18678
|
-
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
18678
|
+
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME$1, __scopeMenu);
|
|
18679
18679
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
18680
18680
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
18681
18681
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
@@ -18685,8 +18685,8 @@ var MenuItemIndicator = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18685
18685
|
})
|
|
18686
18686
|
});
|
|
18687
18687
|
});
|
|
18688
|
-
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
18689
|
-
var SEPARATOR_NAME$
|
|
18688
|
+
MenuItemIndicator.displayName = ITEM_INDICATOR_NAME$1;
|
|
18689
|
+
var SEPARATOR_NAME$2 = "MenuSeparator";
|
|
18690
18690
|
var MenuSeparator = import_react.forwardRef((props, forwardedRef) => {
|
|
18691
18691
|
const { __scopeMenu, ...separatorProps } = props;
|
|
18692
18692
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
@@ -18696,24 +18696,24 @@ var MenuSeparator = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18696
18696
|
ref: forwardedRef
|
|
18697
18697
|
});
|
|
18698
18698
|
});
|
|
18699
|
-
MenuSeparator.displayName = SEPARATOR_NAME$
|
|
18700
|
-
var ARROW_NAME$
|
|
18699
|
+
MenuSeparator.displayName = SEPARATOR_NAME$2;
|
|
18700
|
+
var ARROW_NAME$3 = "MenuArrow";
|
|
18701
18701
|
var MenuArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
18702
18702
|
const { __scopeMenu, ...arrowProps } = props;
|
|
18703
|
-
const popperScope = usePopperScope$
|
|
18703
|
+
const popperScope = usePopperScope$2(__scopeMenu);
|
|
18704
18704
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
|
|
18705
18705
|
...popperScope,
|
|
18706
18706
|
...arrowProps,
|
|
18707
18707
|
ref: forwardedRef
|
|
18708
18708
|
});
|
|
18709
18709
|
});
|
|
18710
|
-
MenuArrow.displayName = ARROW_NAME$
|
|
18710
|
+
MenuArrow.displayName = ARROW_NAME$3;
|
|
18711
18711
|
var SUB_NAME = "MenuSub";
|
|
18712
18712
|
var [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);
|
|
18713
18713
|
var MenuSub = (props) => {
|
|
18714
18714
|
const { __scopeMenu, children, open = false, onOpenChange } = props;
|
|
18715
18715
|
const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);
|
|
18716
|
-
const popperScope = usePopperScope$
|
|
18716
|
+
const popperScope = usePopperScope$2(__scopeMenu);
|
|
18717
18717
|
const [trigger, setTrigger] = import_react.useState(null);
|
|
18718
18718
|
const [content, setContent] = import_react.useState(null);
|
|
18719
18719
|
const handleOpenChange = useCallbackRef$1(onOpenChange);
|
|
@@ -18721,7 +18721,7 @@ var MenuSub = (props) => {
|
|
|
18721
18721
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
18722
18722
|
return () => handleOpenChange(false);
|
|
18723
18723
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
18724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$
|
|
18724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$3, {
|
|
18725
18725
|
...popperScope,
|
|
18726
18726
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuProvider, {
|
|
18727
18727
|
scope: __scopeMenu,
|
|
@@ -18847,18 +18847,18 @@ var MenuSubTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
|
18847
18847
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
|
|
18848
18848
|
var SUB_CONTENT_NAME$1 = "MenuSubContent";
|
|
18849
18849
|
var MenuSubContent = import_react.forwardRef((props, forwardedRef) => {
|
|
18850
|
-
const portalContext = usePortalContext$1(CONTENT_NAME$
|
|
18850
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$4, props.__scopeMenu);
|
|
18851
18851
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
18852
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
18853
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
18852
|
+
const context = useMenuContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18853
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$4, props.__scopeMenu);
|
|
18854
18854
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
18855
18855
|
const ref = import_react.useRef(null);
|
|
18856
18856
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
18857
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
18857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$1.Provider, {
|
|
18858
18858
|
scope: props.__scopeMenu,
|
|
18859
18859
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
18860
18860
|
present: forceMount || context.open,
|
|
18861
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
18861
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection$1.Slot, {
|
|
18862
18862
|
scope: props.__scopeMenu,
|
|
18863
18863
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MenuContentImpl, {
|
|
18864
18864
|
id: subContext.contentId,
|
|
@@ -18914,13 +18914,13 @@ function focusFirst(candidates) {
|
|
|
18914
18914
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
18915
18915
|
}
|
|
18916
18916
|
}
|
|
18917
|
-
function wrapArray(array, startIndex) {
|
|
18917
|
+
function wrapArray$1(array, startIndex) {
|
|
18918
18918
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
18919
18919
|
}
|
|
18920
18920
|
function getNextMatch(values, search, currentMatch) {
|
|
18921
18921
|
const normalizedSearch = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search;
|
|
18922
18922
|
const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
|
|
18923
|
-
let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
|
|
18923
|
+
let wrappedValues = wrapArray$1(values, Math.max(currentMatchIndex, 0));
|
|
18924
18924
|
if (normalizedSearch.length === 1) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
|
|
18925
18925
|
const nextMatch = wrappedValues.find((value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));
|
|
18926
18926
|
return nextMatch !== currentMatch ? nextMatch : void 0;
|
|
@@ -18951,15 +18951,15 @@ function whenMouse(handler) {
|
|
|
18951
18951
|
}
|
|
18952
18952
|
var Root3 = Menu$1;
|
|
18953
18953
|
var Anchor2 = MenuAnchor;
|
|
18954
|
-
var Portal = MenuPortal;
|
|
18955
|
-
var Content2$
|
|
18954
|
+
var Portal$1 = MenuPortal;
|
|
18955
|
+
var Content2$2 = MenuContent;
|
|
18956
18956
|
var Group$1 = MenuGroup;
|
|
18957
18957
|
var Label$2 = MenuLabel;
|
|
18958
18958
|
var Item2$1 = MenuItem;
|
|
18959
18959
|
var CheckboxItem = MenuCheckboxItem;
|
|
18960
18960
|
var RadioGroup = MenuRadioGroup;
|
|
18961
18961
|
var RadioItem = MenuRadioItem;
|
|
18962
|
-
var ItemIndicator = MenuItemIndicator;
|
|
18962
|
+
var ItemIndicator$1 = MenuItemIndicator;
|
|
18963
18963
|
var Separator$2 = MenuSeparator;
|
|
18964
18964
|
var Arrow2 = MenuArrow;
|
|
18965
18965
|
var SubTrigger = MenuSubTrigger;
|
|
@@ -19000,10 +19000,10 @@ var DropdownMenu$1 = (props) => {
|
|
|
19000
19000
|
});
|
|
19001
19001
|
};
|
|
19002
19002
|
DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
|
|
19003
|
-
var TRIGGER_NAME$
|
|
19003
|
+
var TRIGGER_NAME$3 = "DropdownMenuTrigger";
|
|
19004
19004
|
var DropdownMenuTrigger$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
19005
19005
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
19006
|
-
const context = useDropdownMenuContext(TRIGGER_NAME$
|
|
19006
|
+
const context = useDropdownMenuContext(TRIGGER_NAME$3, __scopeDropdownMenu);
|
|
19007
19007
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
19008
19008
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor2, {
|
|
19009
19009
|
asChild: true,
|
|
@@ -19038,24 +19038,24 @@ var DropdownMenuTrigger$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19038
19038
|
})
|
|
19039
19039
|
});
|
|
19040
19040
|
});
|
|
19041
|
-
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$
|
|
19042
|
-
var PORTAL_NAME$
|
|
19041
|
+
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$3;
|
|
19042
|
+
var PORTAL_NAME$2 = "DropdownMenuPortal";
|
|
19043
19043
|
var DropdownMenuPortal = (props) => {
|
|
19044
19044
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
19045
19045
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
19046
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, {
|
|
19046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$1, {
|
|
19047
19047
|
...menuScope,
|
|
19048
19048
|
...portalProps
|
|
19049
19049
|
});
|
|
19050
19050
|
};
|
|
19051
|
-
DropdownMenuPortal.displayName = PORTAL_NAME$
|
|
19052
|
-
var CONTENT_NAME$
|
|
19051
|
+
DropdownMenuPortal.displayName = PORTAL_NAME$2;
|
|
19052
|
+
var CONTENT_NAME$3 = "DropdownMenuContent";
|
|
19053
19053
|
var DropdownMenuContent$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
19054
19054
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
19055
|
-
const context = useDropdownMenuContext(CONTENT_NAME$
|
|
19055
|
+
const context = useDropdownMenuContext(CONTENT_NAME$3, __scopeDropdownMenu);
|
|
19056
19056
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
19057
19057
|
const hasInteractedOutsideRef = import_react.useRef(false);
|
|
19058
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2$
|
|
19058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2$2, {
|
|
19059
19059
|
id: context.contentId,
|
|
19060
19060
|
"aria-labelledby": context.triggerId,
|
|
19061
19061
|
...menuScope,
|
|
@@ -19082,8 +19082,8 @@ var DropdownMenuContent$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19082
19082
|
}
|
|
19083
19083
|
});
|
|
19084
19084
|
});
|
|
19085
|
-
DropdownMenuContent$1.displayName = CONTENT_NAME$
|
|
19086
|
-
var GROUP_NAME = "DropdownMenuGroup";
|
|
19085
|
+
DropdownMenuContent$1.displayName = CONTENT_NAME$3;
|
|
19086
|
+
var GROUP_NAME$1 = "DropdownMenuGroup";
|
|
19087
19087
|
var DropdownMenuGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
19088
19088
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
19089
19089
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -19093,8 +19093,8 @@ var DropdownMenuGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19093
19093
|
ref: forwardedRef
|
|
19094
19094
|
});
|
|
19095
19095
|
});
|
|
19096
|
-
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
19097
|
-
var LABEL_NAME = "DropdownMenuLabel";
|
|
19096
|
+
DropdownMenuGroup.displayName = GROUP_NAME$1;
|
|
19097
|
+
var LABEL_NAME$1 = "DropdownMenuLabel";
|
|
19098
19098
|
var DropdownMenuLabel$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
19099
19099
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
19100
19100
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -19104,8 +19104,8 @@ var DropdownMenuLabel$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19104
19104
|
ref: forwardedRef
|
|
19105
19105
|
});
|
|
19106
19106
|
});
|
|
19107
|
-
DropdownMenuLabel$1.displayName = LABEL_NAME;
|
|
19108
|
-
var ITEM_NAME = "DropdownMenuItem";
|
|
19107
|
+
DropdownMenuLabel$1.displayName = LABEL_NAME$1;
|
|
19108
|
+
var ITEM_NAME$1 = "DropdownMenuItem";
|
|
19109
19109
|
var DropdownMenuItem$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
19110
19110
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
19111
19111
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -19115,7 +19115,7 @@ var DropdownMenuItem$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19115
19115
|
ref: forwardedRef
|
|
19116
19116
|
});
|
|
19117
19117
|
});
|
|
19118
|
-
DropdownMenuItem$1.displayName = ITEM_NAME;
|
|
19118
|
+
DropdownMenuItem$1.displayName = ITEM_NAME$1;
|
|
19119
19119
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
19120
19120
|
var DropdownMenuCheckboxItem = import_react.forwardRef((props, forwardedRef) => {
|
|
19121
19121
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
@@ -19153,14 +19153,14 @@ var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
|
19153
19153
|
var DropdownMenuItemIndicator = import_react.forwardRef((props, forwardedRef) => {
|
|
19154
19154
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
19155
19155
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
19156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicator, {
|
|
19156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicator$1, {
|
|
19157
19157
|
...menuScope,
|
|
19158
19158
|
...itemIndicatorProps,
|
|
19159
19159
|
ref: forwardedRef
|
|
19160
19160
|
});
|
|
19161
19161
|
});
|
|
19162
19162
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
19163
|
-
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
19163
|
+
var SEPARATOR_NAME$1 = "DropdownMenuSeparator";
|
|
19164
19164
|
var DropdownMenuSeparator$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
19165
19165
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
19166
19166
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -19170,8 +19170,8 @@ var DropdownMenuSeparator$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19170
19170
|
ref: forwardedRef
|
|
19171
19171
|
});
|
|
19172
19172
|
});
|
|
19173
|
-
DropdownMenuSeparator$1.displayName = SEPARATOR_NAME;
|
|
19174
|
-
var ARROW_NAME$
|
|
19173
|
+
DropdownMenuSeparator$1.displayName = SEPARATOR_NAME$1;
|
|
19174
|
+
var ARROW_NAME$2 = "DropdownMenuArrow";
|
|
19175
19175
|
var DropdownMenuArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
19176
19176
|
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
19177
19177
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
@@ -19181,7 +19181,7 @@ var DropdownMenuArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19181
19181
|
ref: forwardedRef
|
|
19182
19182
|
});
|
|
19183
19183
|
});
|
|
19184
|
-
DropdownMenuArrow.displayName = ARROW_NAME$
|
|
19184
|
+
DropdownMenuArrow.displayName = ARROW_NAME$2;
|
|
19185
19185
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
19186
19186
|
var DropdownMenuSubTrigger = import_react.forwardRef((props, forwardedRef) => {
|
|
19187
19187
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
@@ -19212,10 +19212,10 @@ var DropdownMenuSubContent = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19212
19212
|
});
|
|
19213
19213
|
});
|
|
19214
19214
|
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
19215
|
-
var Root2$
|
|
19216
|
-
var Trigger$
|
|
19215
|
+
var Root2$2 = DropdownMenu$1;
|
|
19216
|
+
var Trigger$2 = DropdownMenuTrigger$1;
|
|
19217
19217
|
var Portal2 = DropdownMenuPortal;
|
|
19218
|
-
var Content2 = DropdownMenuContent$1;
|
|
19218
|
+
var Content2$1 = DropdownMenuContent$1;
|
|
19219
19219
|
var Label2 = DropdownMenuLabel$1;
|
|
19220
19220
|
var Item2 = DropdownMenuItem$1;
|
|
19221
19221
|
var Separator2 = DropdownMenuSeparator$1;
|
|
@@ -19297,10 +19297,10 @@ var ScrollArea$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19297
19297
|
});
|
|
19298
19298
|
});
|
|
19299
19299
|
ScrollArea$1.displayName = SCROLL_AREA_NAME;
|
|
19300
|
-
var VIEWPORT_NAME = "ScrollAreaViewport";
|
|
19300
|
+
var VIEWPORT_NAME$1 = "ScrollAreaViewport";
|
|
19301
19301
|
var ScrollAreaViewport = import_react.forwardRef((props, forwardedRef) => {
|
|
19302
19302
|
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
19303
|
-
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
|
|
19303
|
+
const context = useScrollAreaContext(VIEWPORT_NAME$1, __scopeScrollArea);
|
|
19304
19304
|
const composedRefs = useComposedRefs(forwardedRef, import_react.useRef(null), context.onViewportChange);
|
|
19305
19305
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
19306
19306
|
dangerouslySetInnerHTML: { __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}` },
|
|
@@ -19335,7 +19335,7 @@ var ScrollAreaViewport = import_react.forwardRef((props, forwardedRef) => {
|
|
|
19335
19335
|
})
|
|
19336
19336
|
})] });
|
|
19337
19337
|
});
|
|
19338
|
-
ScrollAreaViewport.displayName = VIEWPORT_NAME;
|
|
19338
|
+
ScrollAreaViewport.displayName = VIEWPORT_NAME$1;
|
|
19339
19339
|
var SCROLLBAR_NAME = "ScrollAreaScrollbar";
|
|
19340
19340
|
var ScrollAreaScrollbar = import_react.forwardRef((props, forwardedRef) => {
|
|
19341
19341
|
const { forceMount, ...scrollbarProps } = props;
|
|
@@ -19906,9 +19906,958 @@ function useResizeObserver(element, onResize) {
|
|
|
19906
19906
|
}, [element, handleResize]);
|
|
19907
19907
|
}
|
|
19908
19908
|
var Root$2 = ScrollArea$1;
|
|
19909
|
-
var Viewport = ScrollAreaViewport;
|
|
19909
|
+
var Viewport$1 = ScrollAreaViewport;
|
|
19910
19910
|
var Corner = ScrollAreaCorner;
|
|
19911
19911
|
//#endregion
|
|
19912
|
+
//#region node_modules/@radix-ui/react-select/dist/index.mjs
|
|
19913
|
+
var OPEN_KEYS = [
|
|
19914
|
+
" ",
|
|
19915
|
+
"Enter",
|
|
19916
|
+
"ArrowUp",
|
|
19917
|
+
"ArrowDown"
|
|
19918
|
+
];
|
|
19919
|
+
var SELECTION_KEYS = [" ", "Enter"];
|
|
19920
|
+
var SELECT_NAME = "Select";
|
|
19921
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(SELECT_NAME);
|
|
19922
|
+
var [createSelectContext, createSelectScope] = createContextScope(SELECT_NAME, [createCollectionScope, createPopperScope]);
|
|
19923
|
+
var usePopperScope$1 = createPopperScope();
|
|
19924
|
+
var [SelectProvider, useSelectContext] = createSelectContext(SELECT_NAME);
|
|
19925
|
+
var [SelectNativeOptionsProvider, useSelectNativeOptionsContext] = createSelectContext(SELECT_NAME);
|
|
19926
|
+
var Select$2 = (props) => {
|
|
19927
|
+
const { __scopeSelect, children, open: openProp, defaultOpen, onOpenChange, value: valueProp, defaultValue, onValueChange, dir, name, autoComplete, disabled, required, form } = props;
|
|
19928
|
+
const popperScope = usePopperScope$1(__scopeSelect);
|
|
19929
|
+
const [trigger, setTrigger] = import_react.useState(null);
|
|
19930
|
+
const [valueNode, setValueNode] = import_react.useState(null);
|
|
19931
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = import_react.useState(false);
|
|
19932
|
+
const direction = useDirection(dir);
|
|
19933
|
+
const [open, setOpen] = useControllableState({
|
|
19934
|
+
prop: openProp,
|
|
19935
|
+
defaultProp: defaultOpen ?? false,
|
|
19936
|
+
onChange: onOpenChange,
|
|
19937
|
+
caller: SELECT_NAME
|
|
19938
|
+
});
|
|
19939
|
+
const [value, setValue] = useControllableState({
|
|
19940
|
+
prop: valueProp,
|
|
19941
|
+
defaultProp: defaultValue,
|
|
19942
|
+
onChange: onValueChange,
|
|
19943
|
+
caller: SELECT_NAME
|
|
19944
|
+
});
|
|
19945
|
+
const triggerPointerDownPosRef = import_react.useRef(null);
|
|
19946
|
+
const isFormControl = trigger ? form || !!trigger.closest("form") : true;
|
|
19947
|
+
const [nativeOptionsSet, setNativeOptionsSet] = import_react.useState(/* @__PURE__ */ new Set());
|
|
19948
|
+
const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
|
|
19949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$3, {
|
|
19950
|
+
...popperScope,
|
|
19951
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectProvider, {
|
|
19952
|
+
required,
|
|
19953
|
+
scope: __scopeSelect,
|
|
19954
|
+
trigger,
|
|
19955
|
+
onTriggerChange: setTrigger,
|
|
19956
|
+
valueNode,
|
|
19957
|
+
onValueNodeChange: setValueNode,
|
|
19958
|
+
valueNodeHasChildren,
|
|
19959
|
+
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
19960
|
+
contentId: useId(),
|
|
19961
|
+
value,
|
|
19962
|
+
onValueChange: setValue,
|
|
19963
|
+
open,
|
|
19964
|
+
onOpenChange: setOpen,
|
|
19965
|
+
dir: direction,
|
|
19966
|
+
triggerPointerDownPosRef,
|
|
19967
|
+
disabled,
|
|
19968
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Provider, {
|
|
19969
|
+
scope: __scopeSelect,
|
|
19970
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectNativeOptionsProvider, {
|
|
19971
|
+
scope: props.__scopeSelect,
|
|
19972
|
+
onNativeOptionAdd: import_react.useCallback((option) => {
|
|
19973
|
+
setNativeOptionsSet((prev) => new Set(prev).add(option));
|
|
19974
|
+
}, []),
|
|
19975
|
+
onNativeOptionRemove: import_react.useCallback((option) => {
|
|
19976
|
+
setNativeOptionsSet((prev) => {
|
|
19977
|
+
const optionsSet = new Set(prev);
|
|
19978
|
+
optionsSet.delete(option);
|
|
19979
|
+
return optionsSet;
|
|
19980
|
+
});
|
|
19981
|
+
}, []),
|
|
19982
|
+
children
|
|
19983
|
+
})
|
|
19984
|
+
}), isFormControl ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectBubbleInput, {
|
|
19985
|
+
"aria-hidden": true,
|
|
19986
|
+
required,
|
|
19987
|
+
tabIndex: -1,
|
|
19988
|
+
name,
|
|
19989
|
+
autoComplete,
|
|
19990
|
+
value,
|
|
19991
|
+
onChange: (event) => setValue(event.target.value),
|
|
19992
|
+
disabled,
|
|
19993
|
+
form,
|
|
19994
|
+
children: [value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", { value: "" }) : null, Array.from(nativeOptionsSet)]
|
|
19995
|
+
}, nativeSelectKey) : null]
|
|
19996
|
+
})
|
|
19997
|
+
});
|
|
19998
|
+
};
|
|
19999
|
+
Select$2.displayName = SELECT_NAME;
|
|
20000
|
+
var TRIGGER_NAME$2 = "SelectTrigger";
|
|
20001
|
+
var SelectTrigger$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20002
|
+
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
20003
|
+
const popperScope = usePopperScope$1(__scopeSelect);
|
|
20004
|
+
const context = useSelectContext(TRIGGER_NAME$2, __scopeSelect);
|
|
20005
|
+
const isDisabled = context.disabled || disabled;
|
|
20006
|
+
const composedRefs = useComposedRefs(forwardedRef, context.onTriggerChange);
|
|
20007
|
+
const getItems = useCollection(__scopeSelect);
|
|
20008
|
+
const pointerTypeRef = import_react.useRef("touch");
|
|
20009
|
+
const [searchRef, handleTypeaheadSearch, resetTypeahead] = useTypeaheadSearch((search) => {
|
|
20010
|
+
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
20011
|
+
const nextItem = findNextItem(enabledItems, search, enabledItems.find((item) => item.value === context.value));
|
|
20012
|
+
if (nextItem !== void 0) context.onValueChange(nextItem.value);
|
|
20013
|
+
});
|
|
20014
|
+
const handleOpen = (pointerEvent) => {
|
|
20015
|
+
if (!isDisabled) {
|
|
20016
|
+
context.onOpenChange(true);
|
|
20017
|
+
resetTypeahead();
|
|
20018
|
+
}
|
|
20019
|
+
if (pointerEvent) context.triggerPointerDownPosRef.current = {
|
|
20020
|
+
x: Math.round(pointerEvent.pageX),
|
|
20021
|
+
y: Math.round(pointerEvent.pageY)
|
|
20022
|
+
};
|
|
20023
|
+
};
|
|
20024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Anchor$1, {
|
|
20025
|
+
asChild: true,
|
|
20026
|
+
...popperScope,
|
|
20027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.button, {
|
|
20028
|
+
type: "button",
|
|
20029
|
+
role: "combobox",
|
|
20030
|
+
"aria-controls": context.contentId,
|
|
20031
|
+
"aria-expanded": context.open,
|
|
20032
|
+
"aria-required": context.required,
|
|
20033
|
+
"aria-autocomplete": "none",
|
|
20034
|
+
dir: context.dir,
|
|
20035
|
+
"data-state": context.open ? "open" : "closed",
|
|
20036
|
+
disabled: isDisabled,
|
|
20037
|
+
"data-disabled": isDisabled ? "" : void 0,
|
|
20038
|
+
"data-placeholder": shouldShowPlaceholder(context.value) ? "" : void 0,
|
|
20039
|
+
...triggerProps,
|
|
20040
|
+
ref: composedRefs,
|
|
20041
|
+
onClick: composeEventHandlers(triggerProps.onClick, (event) => {
|
|
20042
|
+
event.currentTarget.focus();
|
|
20043
|
+
if (pointerTypeRef.current !== "mouse") handleOpen(event);
|
|
20044
|
+
}),
|
|
20045
|
+
onPointerDown: composeEventHandlers(triggerProps.onPointerDown, (event) => {
|
|
20046
|
+
pointerTypeRef.current = event.pointerType;
|
|
20047
|
+
const target = event.target;
|
|
20048
|
+
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
|
20049
|
+
if (event.button === 0 && event.ctrlKey === false && event.pointerType === "mouse") {
|
|
20050
|
+
handleOpen(event);
|
|
20051
|
+
event.preventDefault();
|
|
20052
|
+
}
|
|
20053
|
+
}),
|
|
20054
|
+
onKeyDown: composeEventHandlers(triggerProps.onKeyDown, (event) => {
|
|
20055
|
+
const isTypingAhead = searchRef.current !== "";
|
|
20056
|
+
if (!(event.ctrlKey || event.altKey || event.metaKey) && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
20057
|
+
if (isTypingAhead && event.key === " ") return;
|
|
20058
|
+
if (OPEN_KEYS.includes(event.key)) {
|
|
20059
|
+
handleOpen();
|
|
20060
|
+
event.preventDefault();
|
|
20061
|
+
}
|
|
20062
|
+
})
|
|
20063
|
+
})
|
|
20064
|
+
});
|
|
20065
|
+
});
|
|
20066
|
+
SelectTrigger$1.displayName = TRIGGER_NAME$2;
|
|
20067
|
+
var VALUE_NAME = "SelectValue";
|
|
20068
|
+
var SelectValue$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20069
|
+
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
20070
|
+
const context = useSelectContext(VALUE_NAME, __scopeSelect);
|
|
20071
|
+
const { onValueNodeHasChildrenChange } = context;
|
|
20072
|
+
const hasChildren = children !== void 0;
|
|
20073
|
+
const composedRefs = useComposedRefs(forwardedRef, context.onValueNodeChange);
|
|
20074
|
+
useLayoutEffect2(() => {
|
|
20075
|
+
onValueNodeHasChildrenChange(hasChildren);
|
|
20076
|
+
}, [onValueNodeHasChildrenChange, hasChildren]);
|
|
20077
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
20078
|
+
...valueProps,
|
|
20079
|
+
ref: composedRefs,
|
|
20080
|
+
style: { pointerEvents: "none" },
|
|
20081
|
+
children: shouldShowPlaceholder(context.value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: placeholder }) : children
|
|
20082
|
+
});
|
|
20083
|
+
});
|
|
20084
|
+
SelectValue$1.displayName = VALUE_NAME;
|
|
20085
|
+
var ICON_NAME = "SelectIcon";
|
|
20086
|
+
var SelectIcon = import_react.forwardRef((props, forwardedRef) => {
|
|
20087
|
+
const { __scopeSelect, children, ...iconProps } = props;
|
|
20088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
20089
|
+
"aria-hidden": true,
|
|
20090
|
+
...iconProps,
|
|
20091
|
+
ref: forwardedRef,
|
|
20092
|
+
children: children || "▼"
|
|
20093
|
+
});
|
|
20094
|
+
});
|
|
20095
|
+
SelectIcon.displayName = ICON_NAME;
|
|
20096
|
+
var PORTAL_NAME$1 = "SelectPortal";
|
|
20097
|
+
var SelectPortal = (props) => {
|
|
20098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$3, {
|
|
20099
|
+
asChild: true,
|
|
20100
|
+
...props
|
|
20101
|
+
});
|
|
20102
|
+
};
|
|
20103
|
+
SelectPortal.displayName = PORTAL_NAME$1;
|
|
20104
|
+
var CONTENT_NAME$2 = "SelectContent";
|
|
20105
|
+
var SelectContent$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20106
|
+
const context = useSelectContext(CONTENT_NAME$2, props.__scopeSelect);
|
|
20107
|
+
const [fragment, setFragment] = import_react.useState();
|
|
20108
|
+
useLayoutEffect2(() => {
|
|
20109
|
+
setFragment(new DocumentFragment());
|
|
20110
|
+
}, []);
|
|
20111
|
+
if (!context.open) {
|
|
20112
|
+
const frag = fragment;
|
|
20113
|
+
return frag ? import_react_dom.createPortal(/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
|
|
20114
|
+
scope: props.__scopeSelect,
|
|
20115
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
20116
|
+
scope: props.__scopeSelect,
|
|
20117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: props.children })
|
|
20118
|
+
})
|
|
20119
|
+
}), frag) : null;
|
|
20120
|
+
}
|
|
20121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentImpl, {
|
|
20122
|
+
...props,
|
|
20123
|
+
ref: forwardedRef
|
|
20124
|
+
});
|
|
20125
|
+
});
|
|
20126
|
+
SelectContent$1.displayName = CONTENT_NAME$2;
|
|
20127
|
+
var CONTENT_MARGIN = 10;
|
|
20128
|
+
var [SelectContentProvider, useSelectContentContext] = createSelectContext(CONTENT_NAME$2);
|
|
20129
|
+
var CONTENT_IMPL_NAME = "SelectContentImpl";
|
|
20130
|
+
var Slot = /* @__PURE__ */ createSlot("SelectContent.RemoveScroll");
|
|
20131
|
+
var SelectContentImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
20132
|
+
const { __scopeSelect, position = "item-aligned", onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, side, sideOffset, align, alignOffset, arrowPadding, collisionBoundary, collisionPadding, sticky, hideWhenDetached, avoidCollisions, ...contentProps } = props;
|
|
20133
|
+
const context = useSelectContext(CONTENT_NAME$2, __scopeSelect);
|
|
20134
|
+
const [content, setContent] = import_react.useState(null);
|
|
20135
|
+
const [viewport, setViewport] = import_react.useState(null);
|
|
20136
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
20137
|
+
const [selectedItem, setSelectedItem] = import_react.useState(null);
|
|
20138
|
+
const [selectedItemText, setSelectedItemText] = import_react.useState(null);
|
|
20139
|
+
const getItems = useCollection(__scopeSelect);
|
|
20140
|
+
const [isPositioned, setIsPositioned] = import_react.useState(false);
|
|
20141
|
+
const firstValidItemFoundRef = import_react.useRef(false);
|
|
20142
|
+
import_react.useEffect(() => {
|
|
20143
|
+
if (content) return hideOthers(content);
|
|
20144
|
+
}, [content]);
|
|
20145
|
+
useFocusGuards();
|
|
20146
|
+
const focusFirst = import_react.useCallback((candidates) => {
|
|
20147
|
+
const [firstItem, ...restItems] = getItems().map((item) => item.ref.current);
|
|
20148
|
+
const [lastItem] = restItems.slice(-1);
|
|
20149
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
20150
|
+
for (const candidate of candidates) {
|
|
20151
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
20152
|
+
candidate?.scrollIntoView({ block: "nearest" });
|
|
20153
|
+
if (candidate === firstItem && viewport) viewport.scrollTop = 0;
|
|
20154
|
+
if (candidate === lastItem && viewport) viewport.scrollTop = viewport.scrollHeight;
|
|
20155
|
+
candidate?.focus();
|
|
20156
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
20157
|
+
}
|
|
20158
|
+
}, [getItems, viewport]);
|
|
20159
|
+
const focusSelectedItem = import_react.useCallback(() => focusFirst([selectedItem, content]), [
|
|
20160
|
+
focusFirst,
|
|
20161
|
+
selectedItem,
|
|
20162
|
+
content
|
|
20163
|
+
]);
|
|
20164
|
+
import_react.useEffect(() => {
|
|
20165
|
+
if (isPositioned) focusSelectedItem();
|
|
20166
|
+
}, [isPositioned, focusSelectedItem]);
|
|
20167
|
+
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
20168
|
+
import_react.useEffect(() => {
|
|
20169
|
+
if (content) {
|
|
20170
|
+
let pointerMoveDelta = {
|
|
20171
|
+
x: 0,
|
|
20172
|
+
y: 0
|
|
20173
|
+
};
|
|
20174
|
+
const handlePointerMove = (event) => {
|
|
20175
|
+
pointerMoveDelta = {
|
|
20176
|
+
x: Math.abs(Math.round(event.pageX) - (triggerPointerDownPosRef.current?.x ?? 0)),
|
|
20177
|
+
y: Math.abs(Math.round(event.pageY) - (triggerPointerDownPosRef.current?.y ?? 0))
|
|
20178
|
+
};
|
|
20179
|
+
};
|
|
20180
|
+
const handlePointerUp = (event) => {
|
|
20181
|
+
if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10) event.preventDefault();
|
|
20182
|
+
else if (!content.contains(event.target)) onOpenChange(false);
|
|
20183
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
20184
|
+
triggerPointerDownPosRef.current = null;
|
|
20185
|
+
};
|
|
20186
|
+
if (triggerPointerDownPosRef.current !== null) {
|
|
20187
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
20188
|
+
document.addEventListener("pointerup", handlePointerUp, {
|
|
20189
|
+
capture: true,
|
|
20190
|
+
once: true
|
|
20191
|
+
});
|
|
20192
|
+
}
|
|
20193
|
+
return () => {
|
|
20194
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
20195
|
+
document.removeEventListener("pointerup", handlePointerUp, { capture: true });
|
|
20196
|
+
};
|
|
20197
|
+
}
|
|
20198
|
+
}, [
|
|
20199
|
+
content,
|
|
20200
|
+
onOpenChange,
|
|
20201
|
+
triggerPointerDownPosRef
|
|
20202
|
+
]);
|
|
20203
|
+
import_react.useEffect(() => {
|
|
20204
|
+
const close = () => onOpenChange(false);
|
|
20205
|
+
window.addEventListener("blur", close);
|
|
20206
|
+
window.addEventListener("resize", close);
|
|
20207
|
+
return () => {
|
|
20208
|
+
window.removeEventListener("blur", close);
|
|
20209
|
+
window.removeEventListener("resize", close);
|
|
20210
|
+
};
|
|
20211
|
+
}, [onOpenChange]);
|
|
20212
|
+
const [searchRef, handleTypeaheadSearch] = useTypeaheadSearch((search) => {
|
|
20213
|
+
const enabledItems = getItems().filter((item) => !item.disabled);
|
|
20214
|
+
const nextItem = findNextItem(enabledItems, search, enabledItems.find((item) => item.ref.current === document.activeElement));
|
|
20215
|
+
if (nextItem) setTimeout(() => nextItem.ref.current.focus());
|
|
20216
|
+
});
|
|
20217
|
+
const itemRefCallback = import_react.useCallback((node, value, disabled) => {
|
|
20218
|
+
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
20219
|
+
if (context.value !== void 0 && context.value === value || isFirstValidItem) {
|
|
20220
|
+
setSelectedItem(node);
|
|
20221
|
+
if (isFirstValidItem) firstValidItemFoundRef.current = true;
|
|
20222
|
+
}
|
|
20223
|
+
}, [context.value]);
|
|
20224
|
+
const handleItemLeave = import_react.useCallback(() => content?.focus(), [content]);
|
|
20225
|
+
const itemTextRefCallback = import_react.useCallback((node, value, disabled) => {
|
|
20226
|
+
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
20227
|
+
if (context.value !== void 0 && context.value === value || isFirstValidItem) setSelectedItemText(node);
|
|
20228
|
+
}, [context.value]);
|
|
20229
|
+
const SelectPosition = position === "popper" ? SelectPopperPosition : SelectItemAlignedPosition;
|
|
20230
|
+
const popperContentProps = SelectPosition === SelectPopperPosition ? {
|
|
20231
|
+
side,
|
|
20232
|
+
sideOffset,
|
|
20233
|
+
align,
|
|
20234
|
+
alignOffset,
|
|
20235
|
+
arrowPadding,
|
|
20236
|
+
collisionBoundary,
|
|
20237
|
+
collisionPadding,
|
|
20238
|
+
sticky,
|
|
20239
|
+
hideWhenDetached,
|
|
20240
|
+
avoidCollisions
|
|
20241
|
+
} : {};
|
|
20242
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContentProvider, {
|
|
20243
|
+
scope: __scopeSelect,
|
|
20244
|
+
content,
|
|
20245
|
+
viewport,
|
|
20246
|
+
onViewportChange: setViewport,
|
|
20247
|
+
itemRefCallback,
|
|
20248
|
+
selectedItem,
|
|
20249
|
+
onItemLeave: handleItemLeave,
|
|
20250
|
+
itemTextRefCallback,
|
|
20251
|
+
focusSelectedItem,
|
|
20252
|
+
selectedItemText,
|
|
20253
|
+
position,
|
|
20254
|
+
isPositioned,
|
|
20255
|
+
searchRef,
|
|
20256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReactRemoveScroll, {
|
|
20257
|
+
as: Slot,
|
|
20258
|
+
allowPinchZoom: true,
|
|
20259
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FocusScope, {
|
|
20260
|
+
asChild: true,
|
|
20261
|
+
trapped: context.open,
|
|
20262
|
+
onMountAutoFocus: (event) => {
|
|
20263
|
+
event.preventDefault();
|
|
20264
|
+
},
|
|
20265
|
+
onUnmountAutoFocus: composeEventHandlers(onCloseAutoFocus, (event) => {
|
|
20266
|
+
context.trigger?.focus({ preventScroll: true });
|
|
20267
|
+
event.preventDefault();
|
|
20268
|
+
}),
|
|
20269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DismissableLayer, {
|
|
20270
|
+
asChild: true,
|
|
20271
|
+
disableOutsidePointerEvents: true,
|
|
20272
|
+
onEscapeKeyDown,
|
|
20273
|
+
onPointerDownOutside,
|
|
20274
|
+
onFocusOutside: (event) => event.preventDefault(),
|
|
20275
|
+
onDismiss: () => context.onOpenChange(false),
|
|
20276
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectPosition, {
|
|
20277
|
+
role: "listbox",
|
|
20278
|
+
id: context.contentId,
|
|
20279
|
+
"data-state": context.open ? "open" : "closed",
|
|
20280
|
+
dir: context.dir,
|
|
20281
|
+
onContextMenu: (event) => event.preventDefault(),
|
|
20282
|
+
...contentProps,
|
|
20283
|
+
...popperContentProps,
|
|
20284
|
+
onPlaced: () => setIsPositioned(true),
|
|
20285
|
+
ref: composedRefs,
|
|
20286
|
+
style: {
|
|
20287
|
+
display: "flex",
|
|
20288
|
+
flexDirection: "column",
|
|
20289
|
+
outline: "none",
|
|
20290
|
+
...contentProps.style
|
|
20291
|
+
},
|
|
20292
|
+
onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {
|
|
20293
|
+
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
20294
|
+
if (event.key === "Tab") event.preventDefault();
|
|
20295
|
+
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
20296
|
+
if ([
|
|
20297
|
+
"ArrowUp",
|
|
20298
|
+
"ArrowDown",
|
|
20299
|
+
"Home",
|
|
20300
|
+
"End"
|
|
20301
|
+
].includes(event.key)) {
|
|
20302
|
+
let candidateNodes = getItems().filter((item) => !item.disabled).map((item) => item.ref.current);
|
|
20303
|
+
if (["ArrowUp", "End"].includes(event.key)) candidateNodes = candidateNodes.slice().reverse();
|
|
20304
|
+
if (["ArrowUp", "ArrowDown"].includes(event.key)) {
|
|
20305
|
+
const currentElement = event.target;
|
|
20306
|
+
const currentIndex = candidateNodes.indexOf(currentElement);
|
|
20307
|
+
candidateNodes = candidateNodes.slice(currentIndex + 1);
|
|
20308
|
+
}
|
|
20309
|
+
setTimeout(() => focusFirst(candidateNodes));
|
|
20310
|
+
event.preventDefault();
|
|
20311
|
+
}
|
|
20312
|
+
})
|
|
20313
|
+
})
|
|
20314
|
+
})
|
|
20315
|
+
})
|
|
20316
|
+
})
|
|
20317
|
+
});
|
|
20318
|
+
});
|
|
20319
|
+
SelectContentImpl.displayName = CONTENT_IMPL_NAME;
|
|
20320
|
+
var ITEM_ALIGNED_POSITION_NAME = "SelectItemAlignedPosition";
|
|
20321
|
+
var SelectItemAlignedPosition = import_react.forwardRef((props, forwardedRef) => {
|
|
20322
|
+
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
20323
|
+
const context = useSelectContext(CONTENT_NAME$2, __scopeSelect);
|
|
20324
|
+
const contentContext = useSelectContentContext(CONTENT_NAME$2, __scopeSelect);
|
|
20325
|
+
const [contentWrapper, setContentWrapper] = import_react.useState(null);
|
|
20326
|
+
const [content, setContent] = import_react.useState(null);
|
|
20327
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
20328
|
+
const getItems = useCollection(__scopeSelect);
|
|
20329
|
+
const shouldExpandOnScrollRef = import_react.useRef(false);
|
|
20330
|
+
const shouldRepositionRef = import_react.useRef(true);
|
|
20331
|
+
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
20332
|
+
const position = import_react.useCallback(() => {
|
|
20333
|
+
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
20334
|
+
const triggerRect = context.trigger.getBoundingClientRect();
|
|
20335
|
+
const contentRect = content.getBoundingClientRect();
|
|
20336
|
+
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
20337
|
+
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
20338
|
+
if (context.dir !== "rtl") {
|
|
20339
|
+
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
20340
|
+
const left = valueNodeRect.left - itemTextOffset;
|
|
20341
|
+
const leftDelta = triggerRect.left - left;
|
|
20342
|
+
const minContentWidth = triggerRect.width + leftDelta;
|
|
20343
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
20344
|
+
const rightEdge = window.innerWidth - CONTENT_MARGIN;
|
|
20345
|
+
const clampedLeft = clamp(left, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, rightEdge - contentWidth)]);
|
|
20346
|
+
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
20347
|
+
contentWrapper.style.left = clampedLeft + "px";
|
|
20348
|
+
} else {
|
|
20349
|
+
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
20350
|
+
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
20351
|
+
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
20352
|
+
const minContentWidth = triggerRect.width + rightDelta;
|
|
20353
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
20354
|
+
const leftEdge = window.innerWidth - CONTENT_MARGIN;
|
|
20355
|
+
const clampedRight = clamp(right, [CONTENT_MARGIN, Math.max(CONTENT_MARGIN, leftEdge - contentWidth)]);
|
|
20356
|
+
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
20357
|
+
contentWrapper.style.right = clampedRight + "px";
|
|
20358
|
+
}
|
|
20359
|
+
const items = getItems();
|
|
20360
|
+
const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
|
|
20361
|
+
const itemsHeight = viewport.scrollHeight;
|
|
20362
|
+
const contentStyles = window.getComputedStyle(content);
|
|
20363
|
+
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
20364
|
+
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
20365
|
+
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
20366
|
+
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
20367
|
+
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;
|
|
20368
|
+
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
20369
|
+
const viewportStyles = window.getComputedStyle(viewport);
|
|
20370
|
+
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
20371
|
+
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
20372
|
+
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - CONTENT_MARGIN;
|
|
20373
|
+
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
20374
|
+
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
20375
|
+
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
20376
|
+
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
20377
|
+
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
20378
|
+
if (contentTopToItemMiddle <= topEdgeToTriggerMiddle) {
|
|
20379
|
+
const isLastItem = items.length > 0 && selectedItem === items[items.length - 1].ref.current;
|
|
20380
|
+
contentWrapper.style.bottom = "0px";
|
|
20381
|
+
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
20382
|
+
const height = contentTopToItemMiddle + Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
20383
|
+
contentWrapper.style.height = height + "px";
|
|
20384
|
+
} else {
|
|
20385
|
+
const isFirstItem = items.length > 0 && selectedItem === items[0].ref.current;
|
|
20386
|
+
contentWrapper.style.top = "0px";
|
|
20387
|
+
const height = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight) + itemMiddleToContentBottom;
|
|
20388
|
+
contentWrapper.style.height = height + "px";
|
|
20389
|
+
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
20390
|
+
}
|
|
20391
|
+
contentWrapper.style.margin = `${CONTENT_MARGIN}px 0`;
|
|
20392
|
+
contentWrapper.style.minHeight = minContentHeight + "px";
|
|
20393
|
+
contentWrapper.style.maxHeight = availableHeight + "px";
|
|
20394
|
+
onPlaced?.();
|
|
20395
|
+
requestAnimationFrame(() => shouldExpandOnScrollRef.current = true);
|
|
20396
|
+
}
|
|
20397
|
+
}, [
|
|
20398
|
+
getItems,
|
|
20399
|
+
context.trigger,
|
|
20400
|
+
context.valueNode,
|
|
20401
|
+
contentWrapper,
|
|
20402
|
+
content,
|
|
20403
|
+
viewport,
|
|
20404
|
+
selectedItem,
|
|
20405
|
+
selectedItemText,
|
|
20406
|
+
context.dir,
|
|
20407
|
+
onPlaced
|
|
20408
|
+
]);
|
|
20409
|
+
useLayoutEffect2(() => position(), [position]);
|
|
20410
|
+
const [contentZIndex, setContentZIndex] = import_react.useState();
|
|
20411
|
+
useLayoutEffect2(() => {
|
|
20412
|
+
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
20413
|
+
}, [content]);
|
|
20414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectViewportProvider, {
|
|
20415
|
+
scope: __scopeSelect,
|
|
20416
|
+
contentWrapper,
|
|
20417
|
+
shouldExpandOnScrollRef,
|
|
20418
|
+
onScrollButtonChange: import_react.useCallback((node) => {
|
|
20419
|
+
if (node && shouldRepositionRef.current === true) {
|
|
20420
|
+
position();
|
|
20421
|
+
focusSelectedItem?.();
|
|
20422
|
+
shouldRepositionRef.current = false;
|
|
20423
|
+
}
|
|
20424
|
+
}, [position, focusSelectedItem]),
|
|
20425
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
20426
|
+
ref: setContentWrapper,
|
|
20427
|
+
style: {
|
|
20428
|
+
display: "flex",
|
|
20429
|
+
flexDirection: "column",
|
|
20430
|
+
position: "fixed",
|
|
20431
|
+
zIndex: contentZIndex
|
|
20432
|
+
},
|
|
20433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20434
|
+
...popperProps,
|
|
20435
|
+
ref: composedRefs,
|
|
20436
|
+
style: {
|
|
20437
|
+
boxSizing: "border-box",
|
|
20438
|
+
maxHeight: "100%",
|
|
20439
|
+
...popperProps.style
|
|
20440
|
+
}
|
|
20441
|
+
})
|
|
20442
|
+
})
|
|
20443
|
+
});
|
|
20444
|
+
});
|
|
20445
|
+
SelectItemAlignedPosition.displayName = ITEM_ALIGNED_POSITION_NAME;
|
|
20446
|
+
var POPPER_POSITION_NAME = "SelectPopperPosition";
|
|
20447
|
+
var SelectPopperPosition = import_react.forwardRef((props, forwardedRef) => {
|
|
20448
|
+
const { __scopeSelect, align = "start", collisionPadding = CONTENT_MARGIN, ...popperProps } = props;
|
|
20449
|
+
const popperScope = usePopperScope$1(__scopeSelect);
|
|
20450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content$1, {
|
|
20451
|
+
...popperScope,
|
|
20452
|
+
...popperProps,
|
|
20453
|
+
ref: forwardedRef,
|
|
20454
|
+
align,
|
|
20455
|
+
collisionPadding,
|
|
20456
|
+
style: {
|
|
20457
|
+
boxSizing: "border-box",
|
|
20458
|
+
...popperProps.style,
|
|
20459
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
20460
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
20461
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
20462
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
20463
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
20464
|
+
}
|
|
20465
|
+
});
|
|
20466
|
+
});
|
|
20467
|
+
SelectPopperPosition.displayName = POPPER_POSITION_NAME;
|
|
20468
|
+
var [SelectViewportProvider, useSelectViewportContext] = createSelectContext(CONTENT_NAME$2, {});
|
|
20469
|
+
var VIEWPORT_NAME = "SelectViewport";
|
|
20470
|
+
var SelectViewport = import_react.forwardRef((props, forwardedRef) => {
|
|
20471
|
+
const { __scopeSelect, nonce, ...viewportProps } = props;
|
|
20472
|
+
const contentContext = useSelectContentContext(VIEWPORT_NAME, __scopeSelect);
|
|
20473
|
+
const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
|
|
20474
|
+
const composedRefs = useComposedRefs(forwardedRef, contentContext.onViewportChange);
|
|
20475
|
+
const prevScrollTopRef = import_react.useRef(0);
|
|
20476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", {
|
|
20477
|
+
dangerouslySetInnerHTML: { __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}` },
|
|
20478
|
+
nonce
|
|
20479
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.Slot, {
|
|
20480
|
+
scope: __scopeSelect,
|
|
20481
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20482
|
+
"data-radix-select-viewport": "",
|
|
20483
|
+
role: "presentation",
|
|
20484
|
+
...viewportProps,
|
|
20485
|
+
ref: composedRefs,
|
|
20486
|
+
style: {
|
|
20487
|
+
position: "relative",
|
|
20488
|
+
flex: 1,
|
|
20489
|
+
overflow: "hidden auto",
|
|
20490
|
+
...viewportProps.style
|
|
20491
|
+
},
|
|
20492
|
+
onScroll: composeEventHandlers(viewportProps.onScroll, (event) => {
|
|
20493
|
+
const viewport = event.currentTarget;
|
|
20494
|
+
const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
|
|
20495
|
+
if (shouldExpandOnScrollRef?.current && contentWrapper) {
|
|
20496
|
+
const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
|
|
20497
|
+
if (scrolledBy > 0) {
|
|
20498
|
+
const availableHeight = window.innerHeight - CONTENT_MARGIN * 2;
|
|
20499
|
+
const cssMinHeight = parseFloat(contentWrapper.style.minHeight);
|
|
20500
|
+
const cssHeight = parseFloat(contentWrapper.style.height);
|
|
20501
|
+
const prevHeight = Math.max(cssMinHeight, cssHeight);
|
|
20502
|
+
if (prevHeight < availableHeight) {
|
|
20503
|
+
const nextHeight = prevHeight + scrolledBy;
|
|
20504
|
+
const clampedNextHeight = Math.min(availableHeight, nextHeight);
|
|
20505
|
+
const heightDiff = nextHeight - clampedNextHeight;
|
|
20506
|
+
contentWrapper.style.height = clampedNextHeight + "px";
|
|
20507
|
+
if (contentWrapper.style.bottom === "0px") {
|
|
20508
|
+
viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;
|
|
20509
|
+
contentWrapper.style.justifyContent = "flex-end";
|
|
20510
|
+
}
|
|
20511
|
+
}
|
|
20512
|
+
}
|
|
20513
|
+
}
|
|
20514
|
+
prevScrollTopRef.current = viewport.scrollTop;
|
|
20515
|
+
})
|
|
20516
|
+
})
|
|
20517
|
+
})] });
|
|
20518
|
+
});
|
|
20519
|
+
SelectViewport.displayName = VIEWPORT_NAME;
|
|
20520
|
+
var GROUP_NAME = "SelectGroup";
|
|
20521
|
+
var [SelectGroupContextProvider, useSelectGroupContext] = createSelectContext(GROUP_NAME);
|
|
20522
|
+
var SelectGroup = import_react.forwardRef((props, forwardedRef) => {
|
|
20523
|
+
const { __scopeSelect, ...groupProps } = props;
|
|
20524
|
+
const groupId = useId();
|
|
20525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectGroupContextProvider, {
|
|
20526
|
+
scope: __scopeSelect,
|
|
20527
|
+
id: groupId,
|
|
20528
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20529
|
+
role: "group",
|
|
20530
|
+
"aria-labelledby": groupId,
|
|
20531
|
+
...groupProps,
|
|
20532
|
+
ref: forwardedRef
|
|
20533
|
+
})
|
|
20534
|
+
});
|
|
20535
|
+
});
|
|
20536
|
+
SelectGroup.displayName = GROUP_NAME;
|
|
20537
|
+
var LABEL_NAME = "SelectLabel";
|
|
20538
|
+
var SelectLabel = import_react.forwardRef((props, forwardedRef) => {
|
|
20539
|
+
const { __scopeSelect, ...labelProps } = props;
|
|
20540
|
+
const groupContext = useSelectGroupContext(LABEL_NAME, __scopeSelect);
|
|
20541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20542
|
+
id: groupContext.id,
|
|
20543
|
+
...labelProps,
|
|
20544
|
+
ref: forwardedRef
|
|
20545
|
+
});
|
|
20546
|
+
});
|
|
20547
|
+
SelectLabel.displayName = LABEL_NAME;
|
|
20548
|
+
var ITEM_NAME = "SelectItem";
|
|
20549
|
+
var [SelectItemContextProvider, useSelectItemContext] = createSelectContext(ITEM_NAME);
|
|
20550
|
+
var SelectItem$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20551
|
+
const { __scopeSelect, value, disabled = false, textValue: textValueProp, ...itemProps } = props;
|
|
20552
|
+
const context = useSelectContext(ITEM_NAME, __scopeSelect);
|
|
20553
|
+
const contentContext = useSelectContentContext(ITEM_NAME, __scopeSelect);
|
|
20554
|
+
const isSelected = context.value === value;
|
|
20555
|
+
const [textValue, setTextValue] = import_react.useState(textValueProp ?? "");
|
|
20556
|
+
const [isFocused, setIsFocused] = import_react.useState(false);
|
|
20557
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => contentContext.itemRefCallback?.(node, value, disabled));
|
|
20558
|
+
const textId = useId();
|
|
20559
|
+
const pointerTypeRef = import_react.useRef("touch");
|
|
20560
|
+
const handleSelect = () => {
|
|
20561
|
+
if (!disabled) {
|
|
20562
|
+
context.onValueChange(value);
|
|
20563
|
+
context.onOpenChange(false);
|
|
20564
|
+
}
|
|
20565
|
+
};
|
|
20566
|
+
if (value === "") throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
|
|
20567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItemContextProvider, {
|
|
20568
|
+
scope: __scopeSelect,
|
|
20569
|
+
value,
|
|
20570
|
+
disabled,
|
|
20571
|
+
textId,
|
|
20572
|
+
isSelected,
|
|
20573
|
+
onItemTextChange: import_react.useCallback((node) => {
|
|
20574
|
+
setTextValue((prevTextValue) => prevTextValue || (node?.textContent ?? "").trim());
|
|
20575
|
+
}, []),
|
|
20576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Collection.ItemSlot, {
|
|
20577
|
+
scope: __scopeSelect,
|
|
20578
|
+
value,
|
|
20579
|
+
disabled,
|
|
20580
|
+
textValue,
|
|
20581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20582
|
+
role: "option",
|
|
20583
|
+
"aria-labelledby": textId,
|
|
20584
|
+
"data-highlighted": isFocused ? "" : void 0,
|
|
20585
|
+
"aria-selected": isSelected && isFocused,
|
|
20586
|
+
"data-state": isSelected ? "checked" : "unchecked",
|
|
20587
|
+
"aria-disabled": disabled || void 0,
|
|
20588
|
+
"data-disabled": disabled ? "" : void 0,
|
|
20589
|
+
tabIndex: disabled ? void 0 : -1,
|
|
20590
|
+
...itemProps,
|
|
20591
|
+
ref: composedRefs,
|
|
20592
|
+
onFocus: composeEventHandlers(itemProps.onFocus, () => setIsFocused(true)),
|
|
20593
|
+
onBlur: composeEventHandlers(itemProps.onBlur, () => setIsFocused(false)),
|
|
20594
|
+
onClick: composeEventHandlers(itemProps.onClick, () => {
|
|
20595
|
+
if (pointerTypeRef.current !== "mouse") handleSelect();
|
|
20596
|
+
}),
|
|
20597
|
+
onPointerUp: composeEventHandlers(itemProps.onPointerUp, () => {
|
|
20598
|
+
if (pointerTypeRef.current === "mouse") handleSelect();
|
|
20599
|
+
}),
|
|
20600
|
+
onPointerDown: composeEventHandlers(itemProps.onPointerDown, (event) => {
|
|
20601
|
+
pointerTypeRef.current = event.pointerType;
|
|
20602
|
+
}),
|
|
20603
|
+
onPointerMove: composeEventHandlers(itemProps.onPointerMove, (event) => {
|
|
20604
|
+
pointerTypeRef.current = event.pointerType;
|
|
20605
|
+
if (disabled) contentContext.onItemLeave?.();
|
|
20606
|
+
else if (pointerTypeRef.current === "mouse") event.currentTarget.focus({ preventScroll: true });
|
|
20607
|
+
}),
|
|
20608
|
+
onPointerLeave: composeEventHandlers(itemProps.onPointerLeave, (event) => {
|
|
20609
|
+
if (event.currentTarget === document.activeElement) contentContext.onItemLeave?.();
|
|
20610
|
+
}),
|
|
20611
|
+
onKeyDown: composeEventHandlers(itemProps.onKeyDown, (event) => {
|
|
20612
|
+
if (contentContext.searchRef?.current !== "" && event.key === " ") return;
|
|
20613
|
+
if (SELECTION_KEYS.includes(event.key)) handleSelect();
|
|
20614
|
+
if (event.key === " ") event.preventDefault();
|
|
20615
|
+
})
|
|
20616
|
+
})
|
|
20617
|
+
})
|
|
20618
|
+
});
|
|
20619
|
+
});
|
|
20620
|
+
SelectItem$1.displayName = ITEM_NAME;
|
|
20621
|
+
var ITEM_TEXT_NAME = "SelectItemText";
|
|
20622
|
+
var SelectItemText = import_react.forwardRef((props, forwardedRef) => {
|
|
20623
|
+
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
20624
|
+
const context = useSelectContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
20625
|
+
const contentContext = useSelectContentContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
20626
|
+
const itemContext = useSelectItemContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
20627
|
+
const nativeOptionsContext = useSelectNativeOptionsContext(ITEM_TEXT_NAME, __scopeSelect);
|
|
20628
|
+
const [itemTextNode, setItemTextNode] = import_react.useState(null);
|
|
20629
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setItemTextNode(node), itemContext.onItemTextChange, (node) => contentContext.itemTextRefCallback?.(node, itemContext.value, itemContext.disabled));
|
|
20630
|
+
const textContent = itemTextNode?.textContent;
|
|
20631
|
+
const nativeOption = import_react.useMemo(() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("option", {
|
|
20632
|
+
value: itemContext.value,
|
|
20633
|
+
disabled: itemContext.disabled,
|
|
20634
|
+
children: textContent
|
|
20635
|
+
}, itemContext.value), [
|
|
20636
|
+
itemContext.disabled,
|
|
20637
|
+
itemContext.value,
|
|
20638
|
+
textContent
|
|
20639
|
+
]);
|
|
20640
|
+
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
20641
|
+
useLayoutEffect2(() => {
|
|
20642
|
+
onNativeOptionAdd(nativeOption);
|
|
20643
|
+
return () => onNativeOptionRemove(nativeOption);
|
|
20644
|
+
}, [
|
|
20645
|
+
onNativeOptionAdd,
|
|
20646
|
+
onNativeOptionRemove,
|
|
20647
|
+
nativeOption
|
|
20648
|
+
]);
|
|
20649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
20650
|
+
id: itemContext.textId,
|
|
20651
|
+
...itemTextProps,
|
|
20652
|
+
ref: composedRefs
|
|
20653
|
+
}), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? import_react_dom.createPortal(itemTextProps.children, context.valueNode) : null] });
|
|
20654
|
+
});
|
|
20655
|
+
SelectItemText.displayName = ITEM_TEXT_NAME;
|
|
20656
|
+
var ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
20657
|
+
var SelectItemIndicator = import_react.forwardRef((props, forwardedRef) => {
|
|
20658
|
+
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
20659
|
+
return useSelectItemContext(ITEM_INDICATOR_NAME, __scopeSelect).isSelected ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.span, {
|
|
20660
|
+
"aria-hidden": true,
|
|
20661
|
+
...itemIndicatorProps,
|
|
20662
|
+
ref: forwardedRef
|
|
20663
|
+
}) : null;
|
|
20664
|
+
});
|
|
20665
|
+
SelectItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
20666
|
+
var SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
20667
|
+
var SelectScrollUpButton$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20668
|
+
const contentContext = useSelectContentContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
20669
|
+
const viewportContext = useSelectViewportContext(SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
20670
|
+
const [canScrollUp, setCanScrollUp] = import_react.useState(false);
|
|
20671
|
+
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
20672
|
+
useLayoutEffect2(() => {
|
|
20673
|
+
if (contentContext.viewport && contentContext.isPositioned) {
|
|
20674
|
+
let handleScroll2 = function() {
|
|
20675
|
+
setCanScrollUp(viewport.scrollTop > 0);
|
|
20676
|
+
};
|
|
20677
|
+
const viewport = contentContext.viewport;
|
|
20678
|
+
handleScroll2();
|
|
20679
|
+
viewport.addEventListener("scroll", handleScroll2);
|
|
20680
|
+
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
20681
|
+
}
|
|
20682
|
+
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
20683
|
+
return canScrollUp ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
|
|
20684
|
+
...props,
|
|
20685
|
+
ref: composedRefs,
|
|
20686
|
+
onAutoScroll: () => {
|
|
20687
|
+
const { viewport, selectedItem } = contentContext;
|
|
20688
|
+
if (viewport && selectedItem) viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;
|
|
20689
|
+
}
|
|
20690
|
+
}) : null;
|
|
20691
|
+
});
|
|
20692
|
+
SelectScrollUpButton$1.displayName = SCROLL_UP_BUTTON_NAME;
|
|
20693
|
+
var SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
20694
|
+
var SelectScrollDownButton$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
20695
|
+
const contentContext = useSelectContentContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
20696
|
+
const viewportContext = useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
20697
|
+
const [canScrollDown, setCanScrollDown] = import_react.useState(false);
|
|
20698
|
+
const composedRefs = useComposedRefs(forwardedRef, viewportContext.onScrollButtonChange);
|
|
20699
|
+
useLayoutEffect2(() => {
|
|
20700
|
+
if (contentContext.viewport && contentContext.isPositioned) {
|
|
20701
|
+
let handleScroll2 = function() {
|
|
20702
|
+
const maxScroll = viewport.scrollHeight - viewport.clientHeight;
|
|
20703
|
+
setCanScrollDown(Math.ceil(viewport.scrollTop) < maxScroll);
|
|
20704
|
+
};
|
|
20705
|
+
const viewport = contentContext.viewport;
|
|
20706
|
+
handleScroll2();
|
|
20707
|
+
viewport.addEventListener("scroll", handleScroll2);
|
|
20708
|
+
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
20709
|
+
}
|
|
20710
|
+
}, [contentContext.viewport, contentContext.isPositioned]);
|
|
20711
|
+
return canScrollDown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollButtonImpl, {
|
|
20712
|
+
...props,
|
|
20713
|
+
ref: composedRefs,
|
|
20714
|
+
onAutoScroll: () => {
|
|
20715
|
+
const { viewport, selectedItem } = contentContext;
|
|
20716
|
+
if (viewport && selectedItem) viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;
|
|
20717
|
+
}
|
|
20718
|
+
}) : null;
|
|
20719
|
+
});
|
|
20720
|
+
SelectScrollDownButton$1.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
20721
|
+
var SelectScrollButtonImpl = import_react.forwardRef((props, forwardedRef) => {
|
|
20722
|
+
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
20723
|
+
const contentContext = useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
20724
|
+
const autoScrollTimerRef = import_react.useRef(null);
|
|
20725
|
+
const getItems = useCollection(__scopeSelect);
|
|
20726
|
+
const clearAutoScrollTimer = import_react.useCallback(() => {
|
|
20727
|
+
if (autoScrollTimerRef.current !== null) {
|
|
20728
|
+
window.clearInterval(autoScrollTimerRef.current);
|
|
20729
|
+
autoScrollTimerRef.current = null;
|
|
20730
|
+
}
|
|
20731
|
+
}, []);
|
|
20732
|
+
import_react.useEffect(() => {
|
|
20733
|
+
return () => clearAutoScrollTimer();
|
|
20734
|
+
}, [clearAutoScrollTimer]);
|
|
20735
|
+
useLayoutEffect2(() => {
|
|
20736
|
+
getItems().find((item) => item.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
|
|
20737
|
+
}, [getItems]);
|
|
20738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20739
|
+
"aria-hidden": true,
|
|
20740
|
+
...scrollIndicatorProps,
|
|
20741
|
+
ref: forwardedRef,
|
|
20742
|
+
style: {
|
|
20743
|
+
flexShrink: 0,
|
|
20744
|
+
...scrollIndicatorProps.style
|
|
20745
|
+
},
|
|
20746
|
+
onPointerDown: composeEventHandlers(scrollIndicatorProps.onPointerDown, () => {
|
|
20747
|
+
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
20748
|
+
}),
|
|
20749
|
+
onPointerMove: composeEventHandlers(scrollIndicatorProps.onPointerMove, () => {
|
|
20750
|
+
contentContext.onItemLeave?.();
|
|
20751
|
+
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
20752
|
+
}),
|
|
20753
|
+
onPointerLeave: composeEventHandlers(scrollIndicatorProps.onPointerLeave, () => {
|
|
20754
|
+
clearAutoScrollTimer();
|
|
20755
|
+
})
|
|
20756
|
+
});
|
|
20757
|
+
});
|
|
20758
|
+
var SEPARATOR_NAME = "SelectSeparator";
|
|
20759
|
+
var SelectSeparator = import_react.forwardRef((props, forwardedRef) => {
|
|
20760
|
+
const { __scopeSelect, ...separatorProps } = props;
|
|
20761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.div, {
|
|
20762
|
+
"aria-hidden": true,
|
|
20763
|
+
...separatorProps,
|
|
20764
|
+
ref: forwardedRef
|
|
20765
|
+
});
|
|
20766
|
+
});
|
|
20767
|
+
SelectSeparator.displayName = SEPARATOR_NAME;
|
|
20768
|
+
var ARROW_NAME$1 = "SelectArrow";
|
|
20769
|
+
var SelectArrow = import_react.forwardRef((props, forwardedRef) => {
|
|
20770
|
+
const { __scopeSelect, ...arrowProps } = props;
|
|
20771
|
+
const popperScope = usePopperScope$1(__scopeSelect);
|
|
20772
|
+
const context = useSelectContext(ARROW_NAME$1, __scopeSelect);
|
|
20773
|
+
const contentContext = useSelectContentContext(ARROW_NAME$1, __scopeSelect);
|
|
20774
|
+
return context.open && contentContext.position === "popper" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Arrow, {
|
|
20775
|
+
...popperScope,
|
|
20776
|
+
...arrowProps,
|
|
20777
|
+
ref: forwardedRef
|
|
20778
|
+
}) : null;
|
|
20779
|
+
});
|
|
20780
|
+
SelectArrow.displayName = ARROW_NAME$1;
|
|
20781
|
+
var BUBBLE_INPUT_NAME$1 = "SelectBubbleInput";
|
|
20782
|
+
var SelectBubbleInput = import_react.forwardRef(({ __scopeSelect, value, ...props }, forwardedRef) => {
|
|
20783
|
+
const ref = import_react.useRef(null);
|
|
20784
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
20785
|
+
const prevValue = usePrevious(value);
|
|
20786
|
+
import_react.useEffect(() => {
|
|
20787
|
+
const select = ref.current;
|
|
20788
|
+
if (!select) return;
|
|
20789
|
+
const selectProto = window.HTMLSelectElement.prototype;
|
|
20790
|
+
const setValue = Object.getOwnPropertyDescriptor(selectProto, "value").set;
|
|
20791
|
+
if (prevValue !== value && setValue) {
|
|
20792
|
+
const event = new Event("change", { bubbles: true });
|
|
20793
|
+
setValue.call(select, value);
|
|
20794
|
+
select.dispatchEvent(event);
|
|
20795
|
+
}
|
|
20796
|
+
}, [prevValue, value]);
|
|
20797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Primitive.select, {
|
|
20798
|
+
...props,
|
|
20799
|
+
style: {
|
|
20800
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
20801
|
+
...props.style
|
|
20802
|
+
},
|
|
20803
|
+
ref: composedRefs,
|
|
20804
|
+
defaultValue: value
|
|
20805
|
+
});
|
|
20806
|
+
});
|
|
20807
|
+
SelectBubbleInput.displayName = BUBBLE_INPUT_NAME$1;
|
|
20808
|
+
function shouldShowPlaceholder(value) {
|
|
20809
|
+
return value === "" || value === void 0;
|
|
20810
|
+
}
|
|
20811
|
+
function useTypeaheadSearch(onSearchChange) {
|
|
20812
|
+
const handleSearchChange = useCallbackRef$1(onSearchChange);
|
|
20813
|
+
const searchRef = import_react.useRef("");
|
|
20814
|
+
const timerRef = import_react.useRef(0);
|
|
20815
|
+
const handleTypeaheadSearch = import_react.useCallback((key) => {
|
|
20816
|
+
const search = searchRef.current + key;
|
|
20817
|
+
handleSearchChange(search);
|
|
20818
|
+
(function updateSearch(value) {
|
|
20819
|
+
searchRef.current = value;
|
|
20820
|
+
window.clearTimeout(timerRef.current);
|
|
20821
|
+
if (value !== "") timerRef.current = window.setTimeout(() => updateSearch(""), 1e3);
|
|
20822
|
+
})(search);
|
|
20823
|
+
}, [handleSearchChange]);
|
|
20824
|
+
const resetTypeahead = import_react.useCallback(() => {
|
|
20825
|
+
searchRef.current = "";
|
|
20826
|
+
window.clearTimeout(timerRef.current);
|
|
20827
|
+
}, []);
|
|
20828
|
+
import_react.useEffect(() => {
|
|
20829
|
+
return () => window.clearTimeout(timerRef.current);
|
|
20830
|
+
}, []);
|
|
20831
|
+
return [
|
|
20832
|
+
searchRef,
|
|
20833
|
+
handleTypeaheadSearch,
|
|
20834
|
+
resetTypeahead
|
|
20835
|
+
];
|
|
20836
|
+
}
|
|
20837
|
+
function findNextItem(items, search, currentItem) {
|
|
20838
|
+
const normalizedSearch = search.length > 1 && Array.from(search).every((char) => char === search[0]) ? search[0] : search;
|
|
20839
|
+
const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;
|
|
20840
|
+
let wrappedItems = wrapArray(items, Math.max(currentItemIndex, 0));
|
|
20841
|
+
if (normalizedSearch.length === 1) wrappedItems = wrappedItems.filter((v) => v !== currentItem);
|
|
20842
|
+
const nextItem = wrappedItems.find((item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase()));
|
|
20843
|
+
return nextItem !== currentItem ? nextItem : void 0;
|
|
20844
|
+
}
|
|
20845
|
+
function wrapArray(array, startIndex) {
|
|
20846
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
20847
|
+
}
|
|
20848
|
+
var Root2$1 = Select$2;
|
|
20849
|
+
var Trigger$1 = SelectTrigger$1;
|
|
20850
|
+
var Value = SelectValue$1;
|
|
20851
|
+
var Icon$1 = SelectIcon;
|
|
20852
|
+
var Portal = SelectPortal;
|
|
20853
|
+
var Content2 = SelectContent$1;
|
|
20854
|
+
var Viewport = SelectViewport;
|
|
20855
|
+
var Item = SelectItem$1;
|
|
20856
|
+
var ItemText = SelectItemText;
|
|
20857
|
+
var ItemIndicator = SelectItemIndicator;
|
|
20858
|
+
var ScrollUpButton = SelectScrollUpButton$1;
|
|
20859
|
+
var ScrollDownButton = SelectScrollDownButton$1;
|
|
20860
|
+
//#endregion
|
|
19912
20861
|
//#region node_modules/@radix-ui/react-separator/dist/index.mjs
|
|
19913
20862
|
var NAME = "Separator";
|
|
19914
20863
|
var DEFAULT_ORIENTATION = "horizontal";
|
|
@@ -20101,7 +21050,7 @@ var TabsTrigger$1 = import_react.forwardRef((props, forwardedRef) => {
|
|
|
20101
21050
|
const triggerId = makeTriggerId(context.baseId, value);
|
|
20102
21051
|
const contentId = makeContentId(context.baseId, value);
|
|
20103
21052
|
const isSelected = value === context.value;
|
|
20104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Item, {
|
|
21053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Item$1, {
|
|
20105
21054
|
asChild: true,
|
|
20106
21055
|
...rovingFocusGroupScope,
|
|
20107
21056
|
focusable: !disabled,
|
|
@@ -20267,7 +21216,7 @@ var Tooltip = (props) => {
|
|
|
20267
21216
|
}
|
|
20268
21217
|
};
|
|
20269
21218
|
}, []);
|
|
20270
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$
|
|
21219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$3, {
|
|
20271
21220
|
...popperScope,
|
|
20272
21221
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TooltipContextProvider, {
|
|
20273
21222
|
scope: __scopeTooltip,
|
|
@@ -20355,7 +21304,7 @@ var TooltipPortal = (props) => {
|
|
|
20355
21304
|
forceMount,
|
|
20356
21305
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Presence, {
|
|
20357
21306
|
present: forceMount || context.open,
|
|
20358
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$
|
|
21307
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$3, {
|
|
20359
21308
|
asChild: true,
|
|
20360
21309
|
container,
|
|
20361
21310
|
children
|
|
@@ -24487,7 +25436,7 @@ var badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center
|
|
|
24487
25436
|
defaultVariants: { variant: "default" }
|
|
24488
25437
|
});
|
|
24489
25438
|
function Badge$1({ className, variant = "default", asChild = false, ...props }) {
|
|
24490
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot$
|
|
25439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot$3 : "span", {
|
|
24491
25440
|
"data-slot": "badge",
|
|
24492
25441
|
"data-variant": variant,
|
|
24493
25442
|
className: cn$1(badgeVariants({ variant }), className),
|
|
@@ -75101,19 +76050,19 @@ var lucide_react_exports = /* @__PURE__ */ __exportAll$1({
|
|
|
75101
76050
|
//#endregion
|
|
75102
76051
|
//#region src/components/ui/dropdown-menu.tsx
|
|
75103
76052
|
function DropdownMenu({ ...props }) {
|
|
75104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$
|
|
76053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$2, {
|
|
75105
76054
|
"data-slot": "dropdown-menu",
|
|
75106
76055
|
...props
|
|
75107
76056
|
});
|
|
75108
76057
|
}
|
|
75109
76058
|
function DropdownMenuTrigger({ ...props }) {
|
|
75110
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger$
|
|
76059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Trigger$2, {
|
|
75111
76060
|
"data-slot": "dropdown-menu-trigger",
|
|
75112
76061
|
...props
|
|
75113
76062
|
});
|
|
75114
76063
|
}
|
|
75115
76064
|
function DropdownMenuContent({ className, align = "start", sideOffset = 4, ...props }) {
|
|
75116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2, {
|
|
76065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal2, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Content2$1, {
|
|
75117
76066
|
"data-slot": "dropdown-menu-content",
|
|
75118
76067
|
sideOffset,
|
|
75119
76068
|
align,
|
|
@@ -75546,7 +76495,7 @@ function ScrollArea({ className, children, ...props }) {
|
|
|
75546
76495
|
className: cn$1("relative", className),
|
|
75547
76496
|
...props,
|
|
75548
76497
|
children: [
|
|
75549
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Viewport, {
|
|
76498
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Viewport$1, {
|
|
75550
76499
|
"data-slot": "scroll-area-viewport",
|
|
75551
76500
|
className: "size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",
|
|
75552
76501
|
children
|
|
@@ -98210,7 +99159,7 @@ var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify
|
|
|
98210
99159
|
}
|
|
98211
99160
|
});
|
|
98212
99161
|
function Button({ className, variant = "default", size = "default", asChild = false, ...props }) {
|
|
98213
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot$
|
|
99162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(asChild ? Slot$3 : "button", {
|
|
98214
99163
|
"data-slot": "button",
|
|
98215
99164
|
"data-variant": variant,
|
|
98216
99165
|
"data-size": size,
|
|
@@ -117653,7 +118602,7 @@ function Dialog({ ...props }) {
|
|
|
117653
118602
|
});
|
|
117654
118603
|
}
|
|
117655
118604
|
function DialogPortal({ ...props }) {
|
|
117656
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$
|
|
118605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$2, {
|
|
117657
118606
|
"data-slot": "dialog-portal",
|
|
117658
118607
|
...props
|
|
117659
118608
|
});
|
|
@@ -146193,6 +147142,78 @@ function nextRunText(now, nextRunAt) {
|
|
|
146193
147142
|
return `in ${Math.ceil(diff / 86400)}d`;
|
|
146194
147143
|
}
|
|
146195
147144
|
//#endregion
|
|
147145
|
+
//#region src/components/ui/select.tsx
|
|
147146
|
+
function Select$1({ ...props }) {
|
|
147147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Root2$1, {
|
|
147148
|
+
"data-slot": "select",
|
|
147149
|
+
...props
|
|
147150
|
+
});
|
|
147151
|
+
}
|
|
147152
|
+
function SelectValue({ ...props }) {
|
|
147153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Value, {
|
|
147154
|
+
"data-slot": "select-value",
|
|
147155
|
+
...props
|
|
147156
|
+
});
|
|
147157
|
+
}
|
|
147158
|
+
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
147159
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Trigger$1, {
|
|
147160
|
+
"data-slot": "select-trigger",
|
|
147161
|
+
"data-size": size,
|
|
147162
|
+
className: cn$1("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
147163
|
+
...props,
|
|
147164
|
+
children: [children, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon$1, {
|
|
147165
|
+
asChild: true,
|
|
147166
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, { className: "pointer-events-none size-4 text-muted-foreground" })
|
|
147167
|
+
})]
|
|
147168
|
+
});
|
|
147169
|
+
}
|
|
147170
|
+
function SelectContent({ className, children, position = "item-aligned", align = "center", ...props }) {
|
|
147171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Content2, {
|
|
147172
|
+
"data-slot": "select-content",
|
|
147173
|
+
"data-align-trigger": position === "item-aligned",
|
|
147174
|
+
className: cn$1("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
147175
|
+
position,
|
|
147176
|
+
align,
|
|
147177
|
+
...props,
|
|
147178
|
+
children: [
|
|
147179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollUpButton, {}),
|
|
147180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Viewport, {
|
|
147181
|
+
"data-position": position,
|
|
147182
|
+
className: cn$1("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)", position === "popper" && ""),
|
|
147183
|
+
children
|
|
147184
|
+
}),
|
|
147185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectScrollDownButton, {})
|
|
147186
|
+
]
|
|
147187
|
+
}) });
|
|
147188
|
+
}
|
|
147189
|
+
function SelectItem({ className, children, ...props }) {
|
|
147190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Item, {
|
|
147191
|
+
"data-slot": "select-item",
|
|
147192
|
+
className: cn$1("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
147193
|
+
...props,
|
|
147194
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
147195
|
+
className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center",
|
|
147196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: "pointer-events-none" }) })
|
|
147197
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ItemText, { children })]
|
|
147198
|
+
});
|
|
147199
|
+
}
|
|
147200
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
147201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollUpButton, {
|
|
147202
|
+
"data-slot": "select-scroll-up-button",
|
|
147203
|
+
className: cn$1("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
147204
|
+
...props,
|
|
147205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronUp, {})
|
|
147206
|
+
});
|
|
147207
|
+
}
|
|
147208
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
147209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScrollDownButton, {
|
|
147210
|
+
"data-slot": "select-scroll-down-button",
|
|
147211
|
+
className: cn$1("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
147212
|
+
...props,
|
|
147213
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {})
|
|
147214
|
+
});
|
|
147215
|
+
}
|
|
147216
|
+
//#endregion
|
|
146196
147217
|
//#region src/components/views/settings.tsx
|
|
146197
147218
|
var providers = ["claude", "codex"];
|
|
146198
147219
|
function SettingsView() {
|
|
@@ -146307,6 +147328,20 @@ function SettingsView() {
|
|
|
146307
147328
|
onChange: (e) => update({ defaultApprovalMode: e.target.value })
|
|
146308
147329
|
})
|
|
146309
147330
|
}),
|
|
147331
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
|
|
147332
|
+
label: "Chat capture mode",
|
|
147333
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Select$1, {
|
|
147334
|
+
value: config.chatCaptureMode ?? "final",
|
|
147335
|
+
onValueChange: (v) => update({ chatCaptureMode: v }),
|
|
147336
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectValue, {}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectContent, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, {
|
|
147337
|
+
value: "final",
|
|
147338
|
+
children: "Final response only"
|
|
147339
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, {
|
|
147340
|
+
value: "full",
|
|
147341
|
+
children: "Full turn (intermediate messages)"
|
|
147342
|
+
})] })]
|
|
147343
|
+
})
|
|
147344
|
+
}),
|
|
146310
147345
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Field, {
|
|
146311
147346
|
label: "tmux prefix",
|
|
146312
147347
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
|
|
@@ -146403,7 +147438,7 @@ function Sheet({ ...props }) {
|
|
|
146403
147438
|
});
|
|
146404
147439
|
}
|
|
146405
147440
|
function SheetPortal({ ...props }) {
|
|
146406
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$
|
|
147441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Portal$2, {
|
|
146407
147442
|
"data-slot": "sheet-portal",
|
|
146408
147443
|
...props
|
|
146409
147444
|
});
|