@overmap-ai/blocks 1.0.40-alpha.3 → 1.0.40-overlay.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ButtonGroup/ButtonGroup.d.ts +2 -1
- package/dist/ButtonGroup/context.d.ts +7 -2
- package/dist/CheckboxGroup/context.d.ts +6 -2
- package/dist/CheckboxGroup/utils.d.ts +1 -0
- package/dist/CheckedIndicator/CheckedIndicator.d.ts +3 -4
- package/dist/CollapsibleTree/CollapsibleTree.d.ts +5 -0
- package/dist/CollapsibleTree/context.d.ts +11 -0
- package/dist/CollapsibleTree/index.d.ts +2 -0
- package/dist/CollapsibleTree/typings.d.ts +58 -0
- package/dist/CommandMenu/CheckboxIndicator.d.ts +4 -2
- package/dist/CommandMenu/SelectedIndicator.d.ts +3 -2
- package/dist/CommandMenu/context.d.ts +3 -2
- package/dist/CommandMenu/utils.d.ts +4 -0
- package/dist/Heading/cva.d.ts +1 -1
- package/dist/HoverUtility/HoverUtility.d.ts +2 -2
- package/dist/Link/cva.d.ts +1 -1
- package/dist/Menu/{CheckboxItem.d.ts → CheckboxItem/CheckboxItem.d.ts} +1 -1
- package/dist/Menu/{CheckboxItemIndicator.d.ts → CheckboxItemIndicator/CheckboxItemIndicator.d.ts} +1 -1
- package/dist/Menu/{ClickTrigger.d.ts → ClickTrigger/ClickTrigger.d.ts} +1 -1
- package/dist/Menu/ClickTrigger/index.d.ts +1 -0
- package/dist/Menu/{Content.d.ts → Content/Content.d.ts} +1 -1
- package/dist/Menu/{menuContentContext.d.ts → Content/context.d.ts} +2 -2
- package/dist/Menu/Content/index.d.ts +2 -0
- package/dist/Menu/{ContextTrigger.d.ts → ContextTrigger/ContextTrigger.d.ts} +1 -1
- package/dist/Menu/ContextTrigger/index.d.ts +1 -0
- package/dist/Menu/{Group.d.ts → Group/Group.d.ts} +1 -1
- package/dist/Menu/Group/index.d.ts +1 -0
- package/dist/Menu/{InputField.d.ts → Input/Field.d.ts} +1 -1
- package/dist/Menu/{InputRoot.d.ts → Input/Root.d.ts} +1 -1
- package/dist/Menu/{InputSlot.d.ts → Input/Slot.d.ts} +1 -1
- package/dist/Menu/Input/index.d.ts +3 -0
- package/dist/Menu/{Item.d.ts → Item/Item.d.ts} +1 -1
- package/dist/Menu/Item/index.d.ts +1 -0
- package/dist/Menu/Label/index.d.ts +1 -0
- package/dist/Menu/{MultiSelectGroup.d.ts → MultiSelectGroup/MultiSelectGroup.d.ts} +1 -1
- package/dist/Menu/MultiSelectGroup/index.d.ts +1 -0
- package/dist/Menu/{MultiSelectItem.d.ts → MultiSelectItem/MultiSelectItem.d.ts} +1 -1
- package/dist/Menu/MultiSelectItem/index.d.ts +1 -0
- package/dist/Menu/PageContent/PageContent.d.ts +3 -0
- package/dist/Menu/PageContent/index.d.ts +1 -0
- package/dist/Menu/{PageTrigger.d.ts → PageTrigger/PageTrigger.d.ts} +1 -1
- package/dist/Menu/PageTrigger/index.d.ts +1 -0
- package/dist/Menu/{Pages.d.ts → Pages/Pages.d.ts} +1 -1
- package/dist/Menu/Pages/index.d.ts +2 -0
- package/dist/Menu/{Scroll.d.ts → Scroll/Scroll.d.ts} +1 -1
- package/dist/Menu/{SelectAllItem.d.ts → SelectAll/SelectAllItem.d.ts} +1 -1
- package/dist/Menu/SelectAll/index.d.ts +1 -0
- package/dist/Menu/{SelectGroup.d.ts → SelectGroup/SelectGroup.d.ts} +1 -1
- package/dist/Menu/SelectGroup/index.d.ts +1 -0
- package/dist/Menu/{SelectItem.d.ts → SelectItem/SelectItem.d.ts} +1 -1
- package/dist/Menu/SelectItem/index.d.ts +1 -0
- package/dist/Menu/SelectedIndicator/SelectedIndicator.d.ts +4 -0
- package/dist/{SelectedIndicator → Menu/SelectedIndicator}/context.d.ts +1 -0
- package/dist/Menu/SelectedIndicator/index.d.ts +2 -0
- package/dist/Menu/{Separator.d.ts → Separator/Separator.d.ts} +1 -1
- package/dist/Menu/Separator/index.d.ts +1 -0
- package/dist/Menu/{Sub.d.ts → Sub/Sub.d.ts} +1 -1
- package/dist/Menu/{subContentContext.d.ts → Sub/context.d.ts} +1 -1
- package/dist/Menu/Sub/index.d.ts +2 -0
- package/dist/Menu/{SubContent.d.ts → SubContent/SubContent.d.ts} +1 -1
- package/dist/Menu/SubContent/index.d.ts +1 -0
- package/dist/Menu/{SubTrigger.d.ts → SubTrigger/SubTrigger.d.ts} +1 -1
- package/dist/Menu/SubTrigger/index.d.ts +1 -0
- package/dist/Menu/{VirtualTrigger.d.ts → VirtualTrigger/VirtualTrigger.d.ts} +1 -1
- package/dist/Menu/VirtualTrigger/index.d.ts +1 -0
- package/dist/Menu/index.d.ts +7 -9
- package/dist/Menu/{Root.d.ts → root/Root.d.ts} +1 -1
- package/dist/Menu/{rootContext.d.ts → root/context.d.ts} +1 -1
- package/dist/Menu/root/index.d.ts +2 -0
- package/dist/Menu/utils.d.ts +6 -0
- package/dist/Overlay/Close.d.ts +5 -0
- package/dist/Overlay/Content.d.ts +6 -0
- package/dist/Overlay/Description.d.ts +5 -0
- package/dist/Overlay/Root.d.ts +5 -0
- package/dist/Overlay/Title.d.ts +5 -0
- package/dist/Overlay/Trigger.d.ts +5 -0
- package/dist/Overlay/cva.d.ts +1 -0
- package/dist/Overlay/index.d.ts +15 -0
- package/dist/SlideOut/SlideOut.d.ts +2 -1
- package/dist/Text/cva.d.ts +1 -1
- package/dist/blocks.js +918 -1181
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +1083 -1346
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/typings.d.ts +5 -0
- package/dist/utils.d.ts +30 -7
- package/package.json +1 -1
- package/dist/Menu/PageContent.d.ts +0 -2
- package/dist/Menu/SelectedIndicator.d.ts +0 -4
- package/dist/MenuV2/CheckboxItem.d.ts +0 -6
- package/dist/MenuV2/CheckboxItemIndicator.d.ts +0 -3
- package/dist/MenuV2/Group.d.ts +0 -4
- package/dist/MenuV2/GroupLabel.d.ts +0 -4
- package/dist/MenuV2/Item.d.ts +0 -6
- package/dist/MenuV2/MultiSelectAllItem.d.ts +0 -4
- package/dist/MenuV2/MultiSelectGroup.d.ts +0 -5
- package/dist/MenuV2/MultiSelectItem.d.ts +0 -5
- package/dist/MenuV2/Page.d.ts +0 -5
- package/dist/MenuV2/PageTriggerItem.d.ts +0 -5
- package/dist/MenuV2/Pages.d.ts +0 -7
- package/dist/MenuV2/Root.d.ts +0 -6
- package/dist/MenuV2/SelectGroup.d.ts +0 -4
- package/dist/MenuV2/SelectItem.d.ts +0 -5
- package/dist/MenuV2/SelectedIndicator.d.ts +0 -3
- package/dist/MenuV2/Separator.d.ts +0 -5
- package/dist/MenuV2/constants.d.ts +0 -9
- package/dist/MenuV2/context.d.ts +0 -17
- package/dist/MenuV2/cva.d.ts +0 -14
- package/dist/MenuV2/index.d.ts +0 -19
- package/dist/MenuV2/typings.d.ts +0 -9
- package/dist/MenuV2/utils.d.ts +0 -1
- package/dist/SelectedIndicator/SelectedIndicator.d.ts +0 -5
- package/dist/SelectedIndicator/index.d.ts +0 -2
- package/dist/hooks.d.ts +0 -20
- /package/dist/Menu/{Label.d.ts → Label/Label.d.ts} +0 -0
- /package/dist/Menu/{menuPagesContext.d.ts → Pages/context.d.ts} +0 -0
package/dist/blocks.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as RadixAlertDialog from "@radix-ui/react-alert-dialog";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { cva, cx } from "class-variance-authority";
|
|
4
|
-
import
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import React__default, { createContext, useContext, memo, useMemo, useState, useCallback, useEffect, useLayoutEffect, use, useRef } from "react";
|
|
5
6
|
import * as RadixAvatar from "@radix-ui/react-avatar";
|
|
6
7
|
import * as RadixCheckbox from "@radix-ui/react-checkbox";
|
|
7
8
|
import { useMediaQuery } from "react-responsive";
|
|
9
|
+
import * as RadixPrimitiveCollapsible from "@radix-ui/react-collapsible";
|
|
8
10
|
import { CommandItem, CommandRoot, CommandEmpty, CommandGroup, CommandInput, useCommandState, CommandList, CommandSeparator } from "cmdk";
|
|
9
11
|
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
10
12
|
import { DialogPortal, DialogContent as DialogContent$1, DialogTitle, DialogDescription, DialogOverlay as DialogOverlay$1, DialogTrigger } from "@radix-ui/react-dialog";
|
|
@@ -14,7 +16,7 @@ import * as RadixHoverCard from "@radix-ui/react-hover-card";
|
|
|
14
16
|
import { CSSTransition } from "react-transition-group";
|
|
15
17
|
import ReactDOM from "react-dom";
|
|
16
18
|
import { Slot } from "@radix-ui/react-slot";
|
|
17
|
-
import {
|
|
19
|
+
import { useFloatingNodeId, useFloating, offset, size, flip, shift, hide, autoUpdate, useRole, useDismiss, useClick, useListNavigation, useInteractions, FloatingTree, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList, useHover, safePolygon, useListItem, useMergeRefs } from "@floating-ui/react";
|
|
18
20
|
import * as RadixSeparator from "@radix-ui/react-separator";
|
|
19
21
|
import * as RadixOneTimePasswordField from "@radix-ui/react-one-time-password-field";
|
|
20
22
|
import { useErrorBoundary, ErrorBoundary } from "react-error-boundary";
|
|
@@ -786,6 +788,82 @@ const Checkbox = {
|
|
|
786
788
|
};
|
|
787
789
|
const SelectContext = createContext({});
|
|
788
790
|
const MultiSelectContext = createContext({});
|
|
791
|
+
const usePassiveLayoutEffect = React__default[typeof document !== "undefined" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"];
|
|
792
|
+
const useLatest = (current) => {
|
|
793
|
+
const storedValue = React.useRef(current);
|
|
794
|
+
React.useEffect(() => {
|
|
795
|
+
storedValue.current = current;
|
|
796
|
+
});
|
|
797
|
+
return storedValue;
|
|
798
|
+
};
|
|
799
|
+
function _ref() {
|
|
800
|
+
}
|
|
801
|
+
function useResizeObserver(target, callback, options = {}) {
|
|
802
|
+
const resizeObserver = getResizeObserver(options.polyfill);
|
|
803
|
+
const storedCallback = useLatest(callback);
|
|
804
|
+
usePassiveLayoutEffect(() => {
|
|
805
|
+
let didUnsubscribe = false;
|
|
806
|
+
const targetEl = target && "current" in target ? target.current : target;
|
|
807
|
+
if (!targetEl) return _ref;
|
|
808
|
+
function cb(entry, observer) {
|
|
809
|
+
if (didUnsubscribe) return;
|
|
810
|
+
storedCallback.current(entry, observer);
|
|
811
|
+
}
|
|
812
|
+
resizeObserver.subscribe(targetEl, cb);
|
|
813
|
+
return () => {
|
|
814
|
+
didUnsubscribe = true;
|
|
815
|
+
resizeObserver.unsubscribe(targetEl, cb);
|
|
816
|
+
};
|
|
817
|
+
}, [target, resizeObserver, storedCallback]);
|
|
818
|
+
return resizeObserver.observer;
|
|
819
|
+
}
|
|
820
|
+
function createResizeObserver(polyfill) {
|
|
821
|
+
let ticking = false;
|
|
822
|
+
let allEntries = [];
|
|
823
|
+
const callbacks = /* @__PURE__ */ new Map();
|
|
824
|
+
const observer = new (polyfill || window.ResizeObserver)((entries, obs) => {
|
|
825
|
+
allEntries = allEntries.concat(entries);
|
|
826
|
+
function _ref2() {
|
|
827
|
+
const triggered = /* @__PURE__ */ new Set();
|
|
828
|
+
for (let i = 0; i < allEntries.length; i++) {
|
|
829
|
+
if (triggered.has(allEntries[i].target)) continue;
|
|
830
|
+
triggered.add(allEntries[i].target);
|
|
831
|
+
const cbs = callbacks.get(allEntries[i].target);
|
|
832
|
+
cbs === null || cbs === void 0 ? void 0 : cbs.forEach((cb) => cb(allEntries[i], obs));
|
|
833
|
+
}
|
|
834
|
+
allEntries = [];
|
|
835
|
+
ticking = false;
|
|
836
|
+
}
|
|
837
|
+
if (!ticking) {
|
|
838
|
+
window.requestAnimationFrame(_ref2);
|
|
839
|
+
}
|
|
840
|
+
ticking = true;
|
|
841
|
+
});
|
|
842
|
+
return {
|
|
843
|
+
observer,
|
|
844
|
+
subscribe(target, callback) {
|
|
845
|
+
var _callbacks$get;
|
|
846
|
+
observer.observe(target);
|
|
847
|
+
const cbs = (_callbacks$get = callbacks.get(target)) !== null && _callbacks$get !== void 0 ? _callbacks$get : [];
|
|
848
|
+
cbs.push(callback);
|
|
849
|
+
callbacks.set(target, cbs);
|
|
850
|
+
},
|
|
851
|
+
unsubscribe(target, callback) {
|
|
852
|
+
var _callbacks$get2;
|
|
853
|
+
const cbs = (_callbacks$get2 = callbacks.get(target)) !== null && _callbacks$get2 !== void 0 ? _callbacks$get2 : [];
|
|
854
|
+
if (cbs.length === 1) {
|
|
855
|
+
observer.unobserve(target);
|
|
856
|
+
callbacks.delete(target);
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
const cbIndex = cbs.indexOf(callback);
|
|
860
|
+
if (cbIndex !== -1) cbs.splice(cbIndex, 1);
|
|
861
|
+
callbacks.set(target, cbs);
|
|
862
|
+
}
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
let _resizeObserver;
|
|
866
|
+
const getResizeObserver = (polyfill) => !_resizeObserver ? _resizeObserver = createResizeObserver(polyfill) : _resizeObserver;
|
|
789
867
|
const useViewportSize = (props) => {
|
|
790
868
|
const { xs: xsProps, sm: smProps, md: mdProps, lg: lgProps, xl: xlProps } = props;
|
|
791
869
|
const [prevSize, setPrevSize] = useState("initial");
|
|
@@ -803,14 +881,33 @@ const useViewportSize = (props) => {
|
|
|
803
881
|
}, [lg, md, sm, xl, xs]);
|
|
804
882
|
return { size: size2, prevSize, xs, sm, md, lg, xl };
|
|
805
883
|
};
|
|
806
|
-
|
|
884
|
+
const useStopEventPropagation = () => {
|
|
885
|
+
return useCallback((event) => {
|
|
886
|
+
event.stopPropagation();
|
|
887
|
+
}, []);
|
|
888
|
+
};
|
|
889
|
+
function useTextFilter(values, filterFunction) {
|
|
807
890
|
const [filteredOptions, setFilteredOptions] = useState([]);
|
|
808
891
|
const [filterValue, setFilterValue] = useState("");
|
|
809
892
|
useEffect(() => {
|
|
810
|
-
setFilteredOptions(
|
|
811
|
-
}, [filterFunction, filterValue,
|
|
893
|
+
setFilteredOptions(values.filter((value) => filterFunction(value, filterValue)));
|
|
894
|
+
}, [filterFunction, filterValue, values]);
|
|
812
895
|
return [filteredOptions, filterValue, setFilterValue];
|
|
813
896
|
}
|
|
897
|
+
const useSize = (target) => {
|
|
898
|
+
const [size2, setSize] = useState();
|
|
899
|
+
useLayoutEffect(() => {
|
|
900
|
+
var _a;
|
|
901
|
+
setSize((_a = target.current) == null ? void 0 : _a.getBoundingClientRect());
|
|
902
|
+
}, [target]);
|
|
903
|
+
const handleResize = useCallback((entry) => {
|
|
904
|
+
const rect = entry.contentRect;
|
|
905
|
+
setSize(rect);
|
|
906
|
+
}, []);
|
|
907
|
+
useResizeObserver(target, handleResize);
|
|
908
|
+
return size2;
|
|
909
|
+
};
|
|
910
|
+
const genericMemo = memo;
|
|
814
911
|
function useControlledState(initialState, state, setState) {
|
|
815
912
|
const [uncontrolledState, setUncontrolledState] = useState(initialState);
|
|
816
913
|
const handleStateChange = useCallback(
|
|
@@ -827,34 +924,26 @@ function useControlledState(initialState, state, setState) {
|
|
|
827
924
|
}, [state]);
|
|
828
925
|
return [state ?? uncontrolledState, handleStateChange];
|
|
829
926
|
}
|
|
830
|
-
function useFallbackId(id) {
|
|
831
|
-
const fallbackId = useId();
|
|
832
|
-
return id ?? fallbackId;
|
|
833
|
-
}
|
|
834
|
-
const genericMemo = memo;
|
|
835
927
|
function mergeRefs(refs) {
|
|
836
928
|
return (value) => {
|
|
837
|
-
const cleanups = refs.reduce(
|
|
838
|
-
(
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
} else {
|
|
844
|
-
cleanups2.push(() => {
|
|
845
|
-
ref(null);
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
} else if (ref != null) {
|
|
849
|
-
ref.current = value;
|
|
929
|
+
const cleanups = refs.reduce((cleanups2, ref) => {
|
|
930
|
+
if (typeof ref === "function") {
|
|
931
|
+
const cleanup = ref(value);
|
|
932
|
+
if (typeof cleanup === "function") {
|
|
933
|
+
cleanups2.push(cleanup);
|
|
934
|
+
} else {
|
|
850
935
|
cleanups2.push(() => {
|
|
851
|
-
ref
|
|
936
|
+
ref(null);
|
|
852
937
|
});
|
|
853
938
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
939
|
+
} else if (ref != null) {
|
|
940
|
+
ref.current = value;
|
|
941
|
+
cleanups2.push(() => {
|
|
942
|
+
ref.current = null;
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
return cleanups2;
|
|
946
|
+
}, []);
|
|
858
947
|
return () => {
|
|
859
948
|
cleanups.forEach((cleanup) => {
|
|
860
949
|
cleanup();
|
|
@@ -865,21 +954,6 @@ function mergeRefs(refs) {
|
|
|
865
954
|
const stopPropagation = (e) => {
|
|
866
955
|
e.stopPropagation();
|
|
867
956
|
};
|
|
868
|
-
function getSelectedState(selected) {
|
|
869
|
-
return selected ? "selected" : "unselected";
|
|
870
|
-
}
|
|
871
|
-
function getCheckedState(checked) {
|
|
872
|
-
return checked === true ? "checked" : checked === false ? "unchecked" : "indeterminate";
|
|
873
|
-
}
|
|
874
|
-
function getActiveState(active) {
|
|
875
|
-
return active ? "active" : "inactive";
|
|
876
|
-
}
|
|
877
|
-
function getBooleanState(value) {
|
|
878
|
-
return value ? "true" : "false";
|
|
879
|
-
}
|
|
880
|
-
function getOpenState(open) {
|
|
881
|
-
return open ? "open" : "closed";
|
|
882
|
-
}
|
|
883
957
|
const MultiSelectProvider = genericMemo(function MultiSelectProvider2(props) {
|
|
884
958
|
const { children, defaultValues, values: controlledValues, onValuesChange } = props;
|
|
885
959
|
const [itemValueMapping, setItemValueMapping] = useState(/* @__PURE__ */ new Set());
|
|
@@ -962,8 +1036,8 @@ const CheckboxGroupItem = memo((props) => {
|
|
|
962
1036
|
ref,
|
|
963
1037
|
className,
|
|
964
1038
|
value,
|
|
1039
|
+
accentColor,
|
|
965
1040
|
disabled,
|
|
966
|
-
accentColor = groupContext.accentColor,
|
|
967
1041
|
variant = groupContext.variant,
|
|
968
1042
|
size: size2 = groupContext.size,
|
|
969
1043
|
radius = groupContext.radius,
|
|
@@ -1000,6 +1074,9 @@ const CheckboxGroupItemIndicator = memo((props) => {
|
|
|
1000
1074
|
return /* @__PURE__ */ jsx(RadixCheckbox.Indicator, { className: cx("flex items-center justify-center", className), ref, ...rest });
|
|
1001
1075
|
});
|
|
1002
1076
|
CheckboxGroupItemIndicator.displayName = "CheckboxGroupItemIndicator";
|
|
1077
|
+
function getBooleanState$1(value) {
|
|
1078
|
+
return value ? "true" : "false";
|
|
1079
|
+
}
|
|
1003
1080
|
const CheckboxGroupRoot = memo((props) => {
|
|
1004
1081
|
const providerContext = useProvider();
|
|
1005
1082
|
const {
|
|
@@ -1022,22 +1099,20 @@ const CheckboxGroupRoot = memo((props) => {
|
|
|
1022
1099
|
name,
|
|
1023
1100
|
required,
|
|
1024
1101
|
disabled,
|
|
1025
|
-
// style props
|
|
1026
|
-
accentColor,
|
|
1027
1102
|
size: size2,
|
|
1028
1103
|
variant,
|
|
1029
1104
|
radius
|
|
1030
1105
|
}),
|
|
1031
|
-
[
|
|
1106
|
+
[disabled, name, radius, required, size2, variant]
|
|
1032
1107
|
);
|
|
1033
1108
|
return /* @__PURE__ */ jsx(
|
|
1034
1109
|
"div",
|
|
1035
1110
|
{
|
|
1036
1111
|
ref,
|
|
1037
1112
|
role: "group",
|
|
1038
|
-
"data-disabled": getBooleanState(!!disabled),
|
|
1113
|
+
"data-disabled": getBooleanState$1(!!disabled),
|
|
1039
1114
|
"data-accent-color": accentColor,
|
|
1040
|
-
"aria-disabled": getBooleanState(!!disabled),
|
|
1115
|
+
"aria-disabled": getBooleanState$1(!!disabled),
|
|
1041
1116
|
...rest,
|
|
1042
1117
|
children: /* @__PURE__ */ jsx(CheckboxGroupContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
|
|
1043
1118
|
MultiSelectProvider,
|
|
@@ -1057,8 +1132,8 @@ const CheckboxGroupSelectAllItem = memo((props) => {
|
|
|
1057
1132
|
const {
|
|
1058
1133
|
ref,
|
|
1059
1134
|
className,
|
|
1135
|
+
accentColor,
|
|
1060
1136
|
disabled,
|
|
1061
|
-
accentColor = groupContext.accentColor,
|
|
1062
1137
|
variant = groupContext.variant,
|
|
1063
1138
|
size: size2 = groupContext.size,
|
|
1064
1139
|
radius = groupContext.radius,
|
|
@@ -1089,39 +1164,137 @@ const CheckboxGroup = {
|
|
|
1089
1164
|
SelectAllItem: CheckboxGroupSelectAllItem,
|
|
1090
1165
|
ItemIndicator: CheckboxGroupItemIndicator
|
|
1091
1166
|
};
|
|
1092
|
-
const
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1167
|
+
const CollapsibleTreeContext = createContext(
|
|
1168
|
+
{}
|
|
1169
|
+
);
|
|
1170
|
+
function useCollapsibleTreeContext() {
|
|
1171
|
+
return useContext(CollapsibleTreeContext);
|
|
1172
|
+
}
|
|
1173
|
+
const CollapsibleNode = genericMemo(function(props) {
|
|
1174
|
+
const { meta, nodes, level = 0, disabled } = props;
|
|
1175
|
+
const [controlledOpenState, setControlledOpenState] = useState(false);
|
|
1176
|
+
const {
|
|
1177
|
+
nodeRenderer,
|
|
1178
|
+
disabled: disabledFromContext,
|
|
1179
|
+
onNodeOpen,
|
|
1180
|
+
onNodeClose,
|
|
1181
|
+
onNodeClick,
|
|
1182
|
+
nodeStyles,
|
|
1183
|
+
nodeClassName
|
|
1184
|
+
} = useCollapsibleTreeContext();
|
|
1185
|
+
const isDisabled = disabled ?? disabledFromContext;
|
|
1186
|
+
const handleClick = useCallback(() => {
|
|
1187
|
+
if (onNodeClick) onNodeClick(meta);
|
|
1188
|
+
}, [meta, onNodeClick]);
|
|
1189
|
+
const toggleOpenState = useCallback(() => {
|
|
1190
|
+
setControlledOpenState(!controlledOpenState);
|
|
1191
|
+
if (!controlledOpenState && onNodeOpen) onNodeOpen(meta);
|
|
1192
|
+
if (controlledOpenState && onNodeClose) onNodeClose(meta);
|
|
1193
|
+
}, [meta, onNodeClose, onNodeOpen, controlledOpenState]);
|
|
1194
|
+
const { children, style, className } = useMemo(() => {
|
|
1195
|
+
return nodeRenderer({
|
|
1196
|
+
meta,
|
|
1197
|
+
toggleOpen: toggleOpenState,
|
|
1198
|
+
open: controlledOpenState,
|
|
1199
|
+
disabled: isDisabled
|
|
1200
|
+
});
|
|
1201
|
+
}, [isDisabled, meta, nodeRenderer, toggleOpenState, controlledOpenState]);
|
|
1202
|
+
const combinedStyles = useMemo(
|
|
1203
|
+
() => ({
|
|
1204
|
+
// want node specific styles to overwrite and global node styles
|
|
1205
|
+
...nodeStyles,
|
|
1206
|
+
...style
|
|
1207
|
+
}),
|
|
1208
|
+
[nodeStyles, style]
|
|
1209
|
+
);
|
|
1210
|
+
return /* @__PURE__ */ jsx(RadixPrimitiveCollapsible.Root, { asChild: true, open: controlledOpenState, disabled: isDisabled, children: /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-col", children: [
|
|
1211
|
+
/* @__PURE__ */ jsx(
|
|
1212
|
+
"div",
|
|
1213
|
+
{
|
|
1214
|
+
onClick: handleClick,
|
|
1215
|
+
className: cx(nodeClassName, "flex w-full shrink-0 items-center", className),
|
|
1216
|
+
style: combinedStyles,
|
|
1217
|
+
"data-state": controlledOpenState ? "open" : "closed",
|
|
1218
|
+
"data-disabled": isDisabled,
|
|
1219
|
+
children
|
|
1220
|
+
}
|
|
1221
|
+
),
|
|
1222
|
+
nodes && nodes.length > 0 && /* @__PURE__ */ jsx(RadixPrimitiveCollapsible.Content, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: "flex h-max w-full flex-col pl-2", children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsx(
|
|
1223
|
+
CollapsibleNode,
|
|
1224
|
+
{
|
|
1225
|
+
level: level + 1,
|
|
1226
|
+
...treeNodeProps
|
|
1227
|
+
},
|
|
1228
|
+
`${level},${index}`
|
|
1229
|
+
)) }) })
|
|
1230
|
+
] }) });
|
|
1231
|
+
});
|
|
1232
|
+
const CollapsibleTree = genericMemo(function(props) {
|
|
1233
|
+
const {
|
|
1234
|
+
nodes,
|
|
1235
|
+
disabled = false,
|
|
1236
|
+
nodeClassName,
|
|
1237
|
+
nodeStyles,
|
|
1238
|
+
onNodeClick,
|
|
1239
|
+
onNodeClose,
|
|
1240
|
+
onNodeOpen,
|
|
1241
|
+
nodeRenderer,
|
|
1242
|
+
...rest
|
|
1243
|
+
} = props;
|
|
1244
|
+
return /* @__PURE__ */ jsx(
|
|
1245
|
+
CollapsibleTreeContext.Provider,
|
|
1246
|
+
{
|
|
1247
|
+
value: {
|
|
1248
|
+
nodeRenderer,
|
|
1249
|
+
nodeClassName,
|
|
1250
|
+
nodeStyles,
|
|
1251
|
+
disabled,
|
|
1252
|
+
onNodeClick,
|
|
1253
|
+
onNodeClose,
|
|
1254
|
+
onNodeOpen
|
|
1255
|
+
},
|
|
1256
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex h-max w-full flex-col", ...rest, children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsx(CollapsibleNode, { ...treeNodeProps }, `${0},${index}`)) })
|
|
1257
|
+
}
|
|
1258
|
+
);
|
|
1259
|
+
});
|
|
1260
|
+
const CommandMenuContext = createContext({});
|
|
1261
|
+
const SelectedIndicatorContext$1 = createContext(false);
|
|
1262
|
+
const CheckboxIndicatorContext = createContext(false);
|
|
1263
|
+
const CommandMenuPageContext = createContext({});
|
|
1264
|
+
const CommandMenuDialogContext = createContext({});
|
|
1265
|
+
function getSelectedState$1(selected) {
|
|
1266
|
+
return selected ? "selected" : "unselected";
|
|
1267
|
+
}
|
|
1268
|
+
function getCheckedState$1(checked) {
|
|
1269
|
+
return checked === true ? "checked" : checked === false ? "unchecked" : "indeterminate";
|
|
1270
|
+
}
|
|
1271
|
+
function getActiveState(active) {
|
|
1272
|
+
return active ? "active" : "inactive";
|
|
1273
|
+
}
|
|
1274
|
+
const CommandMenuCheckboxIndicator = memo((props) => {
|
|
1275
|
+
const { ref, className, children, ...rest } = props;
|
|
1276
|
+
const checkedState = use(CheckboxIndicatorContext);
|
|
1277
|
+
const computedChildren = useMemo(() => {
|
|
1278
|
+
return typeof children === "function" ? children(checkedState) : children;
|
|
1279
|
+
}, [checkedState, children]);
|
|
1097
1280
|
return /* @__PURE__ */ jsx(
|
|
1098
1281
|
"span",
|
|
1099
1282
|
{
|
|
1100
1283
|
ref,
|
|
1284
|
+
"data-state": getCheckedState$1(checkedState),
|
|
1101
1285
|
className: cx(
|
|
1102
|
-
"
|
|
1286
|
+
"inline-block size-max",
|
|
1103
1287
|
{
|
|
1104
|
-
invisible:
|
|
1288
|
+
invisible: checkedState === false
|
|
1105
1289
|
},
|
|
1106
1290
|
className
|
|
1107
1291
|
),
|
|
1108
|
-
"data-state": getCheckedState(checked),
|
|
1109
1292
|
...rest,
|
|
1110
1293
|
children: computedChildren
|
|
1111
1294
|
}
|
|
1112
1295
|
);
|
|
1113
1296
|
});
|
|
1114
|
-
CheckedIndicator.displayName = "CheckedIndicator";
|
|
1115
|
-
const CommandMenuCheckboxIndicator = memo((props) => {
|
|
1116
|
-
const { ref, children, ...rest } = props;
|
|
1117
|
-
return /* @__PURE__ */ jsx(CheckedIndicator, { ref, ...rest, children });
|
|
1118
|
-
});
|
|
1119
1297
|
CommandMenuCheckboxIndicator.displayName = "CommandMenuCheckboxIndicator";
|
|
1120
|
-
const CommandMenuContext = createContext({});
|
|
1121
|
-
const SelectedIndicatorContext$1 = createContext(false);
|
|
1122
|
-
const CheckboxIndicatorContext = createContext(false);
|
|
1123
|
-
const CommandMenuPageContext = createContext({});
|
|
1124
|
-
const CommandMenuDialogContext = createContext({});
|
|
1125
1298
|
const commandMenuContentCva = cva(
|
|
1126
1299
|
[
|
|
1127
1300
|
"ring",
|
|
@@ -1358,7 +1531,7 @@ const CommandMenuCheckboxItem = memo((props) => {
|
|
|
1358
1531
|
onSelect == null ? void 0 : onSelect();
|
|
1359
1532
|
onCheckedChange(checked !== true);
|
|
1360
1533
|
}, [checked, onCheckedChange, onSelect]);
|
|
1361
|
-
return /* @__PURE__ */ jsx(CheckboxIndicatorContext, { value: checked, children: /* @__PURE__ */ jsx(CommandMenuItem, { ref, onSelect: handleSelect, "data-state": getCheckedState(checked), ...rest, children }) });
|
|
1534
|
+
return /* @__PURE__ */ jsx(CheckboxIndicatorContext, { value: checked, children: /* @__PURE__ */ jsx(CommandMenuItem, { ref, onSelect: handleSelect, "data-state": getCheckedState$1(checked), ...rest, children }) });
|
|
1362
1535
|
});
|
|
1363
1536
|
CommandMenuCheckboxItem.displayName = "CommandMenuCheckboxItem";
|
|
1364
1537
|
const CommandMenuContent = memo((props) => {
|
|
@@ -1385,10 +1558,9 @@ const CommandMenuContent = memo((props) => {
|
|
|
1385
1558
|
return {
|
|
1386
1559
|
variant,
|
|
1387
1560
|
size: size2,
|
|
1388
|
-
radius
|
|
1389
|
-
accentColor
|
|
1561
|
+
radius
|
|
1390
1562
|
};
|
|
1391
|
-
}, [
|
|
1563
|
+
}, [radius, size2, variant]);
|
|
1392
1564
|
return /* @__PURE__ */ jsx(DialogPortal, { children: /* @__PURE__ */ jsx(
|
|
1393
1565
|
DialogContent$1,
|
|
1394
1566
|
{
|
|
@@ -1475,7 +1647,7 @@ const CommandMenuMultiSelectItem = genericMemo(function(props) {
|
|
|
1475
1647
|
{
|
|
1476
1648
|
ref,
|
|
1477
1649
|
onSelect: handleSelect,
|
|
1478
|
-
"data-state": getSelectedState(isSelected),
|
|
1650
|
+
"data-state": getSelectedState$1(isSelected),
|
|
1479
1651
|
"aria-selected": isSelected,
|
|
1480
1652
|
closeOnSelect,
|
|
1481
1653
|
...rest,
|
|
@@ -1549,7 +1721,7 @@ const CommandMenuRadioItem = genericMemo(function(props) {
|
|
|
1549
1721
|
selectValue(value);
|
|
1550
1722
|
}, [onSelect, selectValue, value]);
|
|
1551
1723
|
const isSelected = selected(value);
|
|
1552
|
-
return /* @__PURE__ */ jsx(SelectedIndicatorContext$1, { value: isSelected, children: /* @__PURE__ */ jsx(CommandMenuItem, { ref, onSelect: handleSelect, "data-state": getSelectedState(isSelected), ...rest, children }) });
|
|
1724
|
+
return /* @__PURE__ */ jsx(SelectedIndicatorContext$1, { value: isSelected, children: /* @__PURE__ */ jsx(CommandMenuItem, { ref, onSelect: handleSelect, "data-state": getSelectedState$1(isSelected), ...rest, children }) });
|
|
1553
1725
|
});
|
|
1554
1726
|
const CommandMenuRoot = memo((props) => {
|
|
1555
1727
|
const { children, defaultOpen, open: controlledOpen, onOpenChange, modal } = props;
|
|
@@ -1577,39 +1749,35 @@ const CommandMenuSelectAllItem = genericMemo(function(props) {
|
|
|
1577
1749
|
ref,
|
|
1578
1750
|
role: "menuitemcheckbox",
|
|
1579
1751
|
onSelect: handleSelect,
|
|
1580
|
-
"data-state": getCheckedState(selectedState),
|
|
1752
|
+
"data-state": getCheckedState$1(selectedState),
|
|
1581
1753
|
closeOnSelect,
|
|
1582
1754
|
...rest
|
|
1583
1755
|
}
|
|
1584
1756
|
) });
|
|
1585
1757
|
});
|
|
1586
|
-
const
|
|
1587
|
-
const
|
|
1588
|
-
const
|
|
1589
|
-
const
|
|
1590
|
-
|
|
1758
|
+
const CommandMenuSelectedIndicator = memo((props) => {
|
|
1759
|
+
const { ref, className, children, ...rest } = props;
|
|
1760
|
+
const isSelected = use(SelectedIndicatorContext$1);
|
|
1761
|
+
const computedChildren = useMemo(() => {
|
|
1762
|
+
return typeof children === "function" ? children(isSelected) : children;
|
|
1763
|
+
}, [isSelected, children]);
|
|
1591
1764
|
return /* @__PURE__ */ jsx(
|
|
1592
1765
|
"span",
|
|
1593
1766
|
{
|
|
1594
1767
|
ref,
|
|
1768
|
+
"data-state": getSelectedState$1(isSelected),
|
|
1595
1769
|
className: cx(
|
|
1596
|
-
"
|
|
1770
|
+
"inline-block size-max",
|
|
1597
1771
|
{
|
|
1598
1772
|
invisible: !isSelected
|
|
1599
1773
|
},
|
|
1600
1774
|
className
|
|
1601
1775
|
),
|
|
1602
|
-
"data-state": getSelectedState(isSelected),
|
|
1603
1776
|
...rest,
|
|
1604
1777
|
children: computedChildren
|
|
1605
1778
|
}
|
|
1606
1779
|
);
|
|
1607
1780
|
});
|
|
1608
|
-
SelectedIndicator.displayName = "SelectedIndicator";
|
|
1609
|
-
const CommandMenuSelectedIndicator = memo((props) => {
|
|
1610
|
-
const { ref, children, ...rest } = props;
|
|
1611
|
-
return /* @__PURE__ */ jsx(SelectedIndicator, { ref, ...rest, children });
|
|
1612
|
-
});
|
|
1613
1781
|
CommandMenuSelectedIndicator.displayName = "CommandMenuSelectedIndicator";
|
|
1614
1782
|
const CommandMenuSeparator = memo((props) => {
|
|
1615
1783
|
const { className, ref, spacing = false, ...rest } = props;
|
|
@@ -2086,7 +2254,7 @@ const HoverCard = {
|
|
|
2086
2254
|
Root: RadixHoverCard.Root,
|
|
2087
2255
|
Trigger: RadixHoverCard.Trigger
|
|
2088
2256
|
};
|
|
2089
|
-
const HoverUtility = memo(({ children, forceHover })
|
|
2257
|
+
const HoverUtility = memo(function Root({ children, forceHover }) {
|
|
2090
2258
|
const [isHovered, setIsHovered] = useState(false);
|
|
2091
2259
|
const handlePointerEnter = useCallback(() => {
|
|
2092
2260
|
setIsHovered(true);
|
|
@@ -2100,7 +2268,6 @@ const HoverUtility = memo(({ children, forceHover }) => {
|
|
|
2100
2268
|
onPointerLeave: handlePointerLeave
|
|
2101
2269
|
});
|
|
2102
2270
|
});
|
|
2103
|
-
HoverUtility.displayName = "HoverUtility";
|
|
2104
2271
|
const InputContext = createContext({});
|
|
2105
2272
|
const inputRoot$1 = cva(
|
|
2106
2273
|
[
|
|
@@ -2579,6 +2746,40 @@ const LayoutSlideOutOverlay = memo((props) => {
|
|
|
2579
2746
|
return showOverlay && /* @__PURE__ */ jsx("div", { className: cx("overmap-layout-overlay", "fixed inset-0", className), ref, ...rest, children });
|
|
2580
2747
|
});
|
|
2581
2748
|
LayoutSlideOutOverlay.displayName = "SlideOutOverlay";
|
|
2749
|
+
const MENU_OVERFLOW_PADDING = 20;
|
|
2750
|
+
const MENU_CONTENT_PADDING = 8;
|
|
2751
|
+
const MENU_MINIMUM_MAX_HEIGHT = 250;
|
|
2752
|
+
const computeOffsets = (side, alignment) => {
|
|
2753
|
+
switch (side) {
|
|
2754
|
+
case "right":
|
|
2755
|
+
if (alignment === "start") {
|
|
2756
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -MENU_CONTENT_PADDING };
|
|
2757
|
+
} else if (alignment === "end") {
|
|
2758
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
2759
|
+
}
|
|
2760
|
+
break;
|
|
2761
|
+
case "left":
|
|
2762
|
+
if (alignment === "start") {
|
|
2763
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -MENU_CONTENT_PADDING };
|
|
2764
|
+
} else if (alignment === "end") {
|
|
2765
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
2766
|
+
}
|
|
2767
|
+
break;
|
|
2768
|
+
}
|
|
2769
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: 0 };
|
|
2770
|
+
};
|
|
2771
|
+
function getSelectedState(selected) {
|
|
2772
|
+
return selected ? "selected" : "unselected";
|
|
2773
|
+
}
|
|
2774
|
+
function getCheckedState(checked) {
|
|
2775
|
+
return checked === true ? "checked" : checked === false ? "unchecked" : "indeterminate";
|
|
2776
|
+
}
|
|
2777
|
+
function getBooleanState(value) {
|
|
2778
|
+
return value ? "true" : "false";
|
|
2779
|
+
}
|
|
2780
|
+
function getOpenState(open) {
|
|
2781
|
+
return open ? "open" : "closed";
|
|
2782
|
+
}
|
|
2582
2783
|
function nextStateBasedOnType(open, type) {
|
|
2583
2784
|
switch (type) {
|
|
2584
2785
|
case "toggle":
|
|
@@ -2674,6 +2875,28 @@ const Link = memo((props) => {
|
|
|
2674
2875
|
);
|
|
2675
2876
|
});
|
|
2676
2877
|
Link.displayName = "Link";
|
|
2878
|
+
const CheckedIndicatorContext = createContext({});
|
|
2879
|
+
const CheckedIndicator = (props) => {
|
|
2880
|
+
const { children, ref, className, ...rest } = props;
|
|
2881
|
+
const checked = useContext(CheckedIndicatorContext);
|
|
2882
|
+
const computedChildren = typeof children === "function" ? children(checked === "indeterminate") : children;
|
|
2883
|
+
return /* @__PURE__ */ jsx(
|
|
2884
|
+
"span",
|
|
2885
|
+
{
|
|
2886
|
+
ref,
|
|
2887
|
+
className: cx(
|
|
2888
|
+
"flex size-max items-center",
|
|
2889
|
+
{
|
|
2890
|
+
invisible: checked === false
|
|
2891
|
+
},
|
|
2892
|
+
className
|
|
2893
|
+
),
|
|
2894
|
+
"data-state": getCheckedState$1(checked),
|
|
2895
|
+
...rest,
|
|
2896
|
+
children: computedChildren
|
|
2897
|
+
}
|
|
2898
|
+
);
|
|
2899
|
+
};
|
|
2677
2900
|
const menuItem = cva(
|
|
2678
2901
|
[
|
|
2679
2902
|
"select-none",
|
|
@@ -2819,115 +3042,100 @@ const inputRoot = cva(
|
|
|
2819
3042
|
}
|
|
2820
3043
|
}
|
|
2821
3044
|
);
|
|
2822
|
-
const MenuContentContext = createContext({});
|
|
2823
3045
|
const MenuContext = createContext({});
|
|
2824
|
-
const
|
|
2825
|
-
const
|
|
2826
|
-
const
|
|
2827
|
-
const rootMenuContext = use(MenuContext);
|
|
2828
|
-
const { getItemProps, activeIndex, setOpen, size: size2, variant, radius } = use(MenuContentContext);
|
|
2829
|
-
const { closeRoot } = use(SubContext);
|
|
3046
|
+
const useMenuContext = () => useContext(MenuContext);
|
|
3047
|
+
const DEFAULT_OFFSET = 5;
|
|
3048
|
+
const MenuRoot = memo((props) => {
|
|
2830
3049
|
const {
|
|
2831
|
-
ref: forwardedRef,
|
|
2832
|
-
className,
|
|
2833
3050
|
children,
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3051
|
+
side = "bottom",
|
|
3052
|
+
align = "center",
|
|
3053
|
+
offset: offset$1,
|
|
3054
|
+
loop = false,
|
|
3055
|
+
modal = false,
|
|
3056
|
+
// open state related props
|
|
3057
|
+
open: controlledOpen,
|
|
3058
|
+
onOpenChange,
|
|
3059
|
+
defaultOpen
|
|
2840
3060
|
} = props;
|
|
2841
|
-
const
|
|
2842
|
-
const
|
|
2843
|
-
const
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
"
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
switch (checked) {
|
|
2894
|
-
case true:
|
|
2895
|
-
onCheckedChange(false);
|
|
2896
|
-
break;
|
|
2897
|
-
case "indeterminate":
|
|
2898
|
-
case false:
|
|
2899
|
-
onCheckedChange(true);
|
|
2900
|
-
break;
|
|
2901
|
-
}
|
|
2902
|
-
}, [checked, onCheckedChange, onSelect]);
|
|
2903
|
-
return /* @__PURE__ */ jsx(CheckedIndicatorContext.Provider, { value: checked, children: /* @__PURE__ */ jsx(MenuItem$1, { ref, onSelect: handleSelect, ...rest }) });
|
|
2904
|
-
});
|
|
2905
|
-
MenuCheckboxItem$1.displayName = "MenuCheckboxItem";
|
|
2906
|
-
const MenuCheckboxItemIndicator = memo((props) => {
|
|
2907
|
-
const { ref, children, ...rest } = props;
|
|
2908
|
-
return /* @__PURE__ */ jsx(CheckedIndicator, { ref, ...rest, children });
|
|
2909
|
-
});
|
|
2910
|
-
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
2911
|
-
const MenuClickTrigger = memo((props) => {
|
|
2912
|
-
const { ref: forwardedRef, children, disabled = false } = props;
|
|
2913
|
-
const { getReferenceProps, refs, setTriggerType, open } = use(MenuContext);
|
|
2914
|
-
const mergedRefs = useMergeRefs([refs.setReference, forwardedRef]);
|
|
2915
|
-
useEffect(() => {
|
|
2916
|
-
setTriggerType("click");
|
|
2917
|
-
}, [setTriggerType]);
|
|
2918
|
-
return /* @__PURE__ */ jsx(
|
|
2919
|
-
Slot,
|
|
3061
|
+
const [open, setOpen] = useControlledState(defaultOpen ?? false, controlledOpen, onOpenChange);
|
|
3062
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
3063
|
+
const [triggerType, setTriggerType] = useState(null);
|
|
3064
|
+
const elementsRef = useRef([]);
|
|
3065
|
+
const nodeId = useFloatingNodeId();
|
|
3066
|
+
const { refs, floatingStyles, context, middlewareData } = useFloating({
|
|
3067
|
+
nodeId,
|
|
3068
|
+
strategy: "fixed",
|
|
3069
|
+
placement: side + (align !== "center" ? "-" + align : ""),
|
|
3070
|
+
whileElementsMounted: autoUpdate,
|
|
3071
|
+
open,
|
|
3072
|
+
onOpenChange: setOpen,
|
|
3073
|
+
middleware: [
|
|
3074
|
+
offset({ mainAxis: offset$1 ?? DEFAULT_OFFSET }),
|
|
3075
|
+
size({
|
|
3076
|
+
apply({ availableHeight, elements }) {
|
|
3077
|
+
elements.floating.style.setProperty(
|
|
3078
|
+
"--overmap-menu-available-height",
|
|
3079
|
+
`${Math.max(availableHeight, MENU_MINIMUM_MAX_HEIGHT)}px`
|
|
3080
|
+
);
|
|
3081
|
+
},
|
|
3082
|
+
padding: MENU_OVERFLOW_PADDING
|
|
3083
|
+
}),
|
|
3084
|
+
flip({ fallbackStrategy: "initialPlacement" }),
|
|
3085
|
+
shift({ padding: MENU_OVERFLOW_PADDING }),
|
|
3086
|
+
hide()
|
|
3087
|
+
]
|
|
3088
|
+
});
|
|
3089
|
+
const role = useRole(context, {
|
|
3090
|
+
role: "menu"
|
|
3091
|
+
});
|
|
3092
|
+
const dismiss = useDismiss(context, {
|
|
3093
|
+
capture: true,
|
|
3094
|
+
ancestorScroll: triggerType === "context" || triggerType === "virtual"
|
|
3095
|
+
});
|
|
3096
|
+
const click = useClick(context, {
|
|
3097
|
+
enabled: triggerType === "click"
|
|
3098
|
+
});
|
|
3099
|
+
const listNavigation = useListNavigation(context, {
|
|
3100
|
+
listRef: elementsRef,
|
|
3101
|
+
activeIndex,
|
|
3102
|
+
onNavigate: setActiveIndex,
|
|
3103
|
+
loop
|
|
3104
|
+
});
|
|
3105
|
+
const { getFloatingProps, getItemProps, getReferenceProps } = useInteractions([
|
|
3106
|
+
dismiss,
|
|
3107
|
+
listNavigation,
|
|
3108
|
+
click,
|
|
3109
|
+
role
|
|
3110
|
+
]);
|
|
3111
|
+
return /* @__PURE__ */ jsx(FloatingTree, { children: /* @__PURE__ */ jsx(
|
|
3112
|
+
MenuContext.Provider,
|
|
2920
3113
|
{
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
3114
|
+
value: {
|
|
3115
|
+
open,
|
|
3116
|
+
setOpen,
|
|
3117
|
+
refs,
|
|
3118
|
+
context,
|
|
3119
|
+
floatingStyles,
|
|
3120
|
+
elementsRef,
|
|
3121
|
+
getFloatingProps,
|
|
3122
|
+
getItemProps,
|
|
3123
|
+
getReferenceProps,
|
|
3124
|
+
nodeId,
|
|
3125
|
+
activeIndex,
|
|
3126
|
+
setActiveIndex,
|
|
3127
|
+
middlewareData,
|
|
3128
|
+
side,
|
|
3129
|
+
modal,
|
|
3130
|
+
setTriggerType
|
|
3131
|
+
},
|
|
2926
3132
|
children
|
|
2927
3133
|
}
|
|
2928
|
-
);
|
|
3134
|
+
) });
|
|
2929
3135
|
});
|
|
2930
|
-
|
|
3136
|
+
MenuRoot.displayName = "Root";
|
|
3137
|
+
const MenuContentContext = createContext({});
|
|
3138
|
+
const useMenuContentContext = () => useContext(MenuContentContext);
|
|
2931
3139
|
const MenuContent = memo((props) => {
|
|
2932
3140
|
var _a;
|
|
2933
3141
|
const providerContext = useProvider();
|
|
@@ -2956,7 +3164,7 @@ const MenuContent = memo((props) => {
|
|
|
2956
3164
|
floatingStyles,
|
|
2957
3165
|
modal,
|
|
2958
3166
|
side
|
|
2959
|
-
} =
|
|
3167
|
+
} = useMenuContext();
|
|
2960
3168
|
const computedFloatingStyles = useMemo(() => {
|
|
2961
3169
|
var _a2;
|
|
2962
3170
|
return {
|
|
@@ -3028,177 +3236,15 @@ const MenuContent = memo((props) => {
|
|
|
3028
3236
|
) }) });
|
|
3029
3237
|
});
|
|
3030
3238
|
MenuContent.displayName = "Menu.Content";
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
const { setOpen, refs, setTriggerType, open } = use(MenuContext);
|
|
3035
|
-
const mergedRefs = useMergeRefs([forwardedRef, ref]);
|
|
3036
|
-
useEffect(() => {
|
|
3037
|
-
setTriggerType("context");
|
|
3038
|
-
}, [setTriggerType]);
|
|
3039
|
-
const handleContextMenu = useCallback(
|
|
3040
|
-
(e) => {
|
|
3041
|
-
const { clientY, clientX } = e;
|
|
3042
|
-
if (!disabled && ref.current) {
|
|
3043
|
-
e.preventDefault();
|
|
3044
|
-
refs.setPositionReference({
|
|
3045
|
-
getBoundingClientRect() {
|
|
3046
|
-
return {
|
|
3047
|
-
x: clientX,
|
|
3048
|
-
y: clientY,
|
|
3049
|
-
top: clientY,
|
|
3050
|
-
left: clientX,
|
|
3051
|
-
height: 0,
|
|
3052
|
-
width: 0,
|
|
3053
|
-
bottom: clientY,
|
|
3054
|
-
right: clientX
|
|
3055
|
-
};
|
|
3056
|
-
},
|
|
3057
|
-
contextElement: ref.current
|
|
3058
|
-
});
|
|
3059
|
-
setOpen(true);
|
|
3060
|
-
}
|
|
3061
|
-
},
|
|
3062
|
-
[disabled, refs, setOpen]
|
|
3063
|
-
);
|
|
3064
|
-
return /* @__PURE__ */ jsx(
|
|
3065
|
-
Slot,
|
|
3066
|
-
{
|
|
3067
|
-
ref: mergedRefs,
|
|
3068
|
-
style: { WebkitTouchCallout: disabled ? "none" : "unset" },
|
|
3069
|
-
"aria-disabled": disabled,
|
|
3070
|
-
"data-disabled": getBooleanState(disabled),
|
|
3071
|
-
"data-state": getOpenState(open),
|
|
3072
|
-
onContextMenu: handleContextMenu,
|
|
3073
|
-
children
|
|
3074
|
-
}
|
|
3075
|
-
);
|
|
3076
|
-
});
|
|
3077
|
-
MenuContextTrigger.displayName = "MenuContextTrigger";
|
|
3078
|
-
const MenuGroup$1 = memo((props) => {
|
|
3079
|
-
const { ref, children, ...rest } = props;
|
|
3080
|
-
return /* @__PURE__ */ jsx("div", { ref, role: "group", ...rest, children });
|
|
3081
|
-
});
|
|
3082
|
-
MenuGroup$1.displayName = "MenuGroup";
|
|
3083
|
-
const MenuInputField = memo((props) => {
|
|
3084
|
-
const { ref: forwardedRef, className, onValueChange, onChange, disabled = false, ...rest } = props;
|
|
3085
|
-
const { activeIndex, getItemProps } = use(MenuContentContext);
|
|
3086
|
-
const { index, ref } = useListItem();
|
|
3087
|
-
const mergedRefs = useMergeRefs([ref, forwardedRef]);
|
|
3088
|
-
const handleChange = useCallback(
|
|
3089
|
-
(e) => {
|
|
3090
|
-
onChange == null ? void 0 : onChange(e);
|
|
3091
|
-
onValueChange == null ? void 0 : onValueChange(e.target.value);
|
|
3092
|
-
},
|
|
3093
|
-
[onChange, onValueChange]
|
|
3094
|
-
);
|
|
3095
|
-
useEffect(() => {
|
|
3096
|
-
return () => {
|
|
3097
|
-
onValueChange == null ? void 0 : onValueChange("");
|
|
3098
|
-
};
|
|
3099
|
-
}, []);
|
|
3100
|
-
return /* @__PURE__ */ jsx(
|
|
3101
|
-
"input",
|
|
3102
|
-
{
|
|
3103
|
-
className: cx("placeholder-(--base-a9)", "selection:bg-(--accent-a5)", "outline-none", className),
|
|
3104
|
-
ref: mergedRefs,
|
|
3105
|
-
disabled,
|
|
3106
|
-
"data-disabled": getBooleanState(disabled),
|
|
3107
|
-
...getItemProps({
|
|
3108
|
-
...rest,
|
|
3109
|
-
tabIndex: index === activeIndex ? 0 : -1,
|
|
3110
|
-
onChange: handleChange
|
|
3111
|
-
})
|
|
3112
|
-
}
|
|
3113
|
-
);
|
|
3114
|
-
});
|
|
3115
|
-
MenuInputField.displayName = "MenuInputField";
|
|
3116
|
-
const MenuInputRoot = memo((props) => {
|
|
3117
|
-
const { ref, className, ...rest } = props;
|
|
3118
|
-
const { size: size2 } = use(MenuContentContext);
|
|
3119
|
-
return /* @__PURE__ */ jsx("div", { className: cx(inputRoot({ size: size2 }), className), ref, ...rest });
|
|
3120
|
-
});
|
|
3121
|
-
MenuInputRoot.displayName = "MenuInputRoot";
|
|
3122
|
-
const MenuInputSlot = memo((props) => {
|
|
3123
|
-
const { ref, className, ...rest } = props;
|
|
3124
|
-
return /* @__PURE__ */ jsx("div", { className: cx("flex", "items-center", "text-(--base-a11)", className), ref, ...rest });
|
|
3125
|
-
});
|
|
3126
|
-
MenuInputSlot.displayName = "MenuInputSlot";
|
|
3127
|
-
const MenuLabel = memo((props) => {
|
|
3128
|
-
const { ref, className, ...rest } = props;
|
|
3129
|
-
const { size: size2 } = use(MenuContentContext);
|
|
3130
|
-
return /* @__PURE__ */ jsx("div", { ref, className: cx(menuLabelCva({ size: size2 }), className), ...rest });
|
|
3131
|
-
});
|
|
3132
|
-
MenuLabel.displayName = "MenuLabel";
|
|
3133
|
-
const MenuMultiSelectGroup$1 = genericMemo(function MenuMultiSelectGroup2(props) {
|
|
3134
|
-
const { ref, children, defaultValues, values, onValuesChange, ...rest } = props;
|
|
3135
|
-
return /* @__PURE__ */ jsx(MenuGroup$1, { ref, ...rest, children: /* @__PURE__ */ jsx(MultiSelectProvider, { defaultValues, values, onValuesChange, children }) });
|
|
3136
|
-
});
|
|
3137
|
-
const MenuMultiSelectItem$1 = genericMemo(function(props) {
|
|
3138
|
-
const { ref, onSelect, children, closeOnSelect = false, value, ...rest } = props;
|
|
3139
|
-
const { selected, selectValue, registerValue } = use(MultiSelectContext);
|
|
3140
|
-
useLayoutEffect(() => {
|
|
3141
|
-
return registerValue(value);
|
|
3142
|
-
}, [registerValue, value]);
|
|
3143
|
-
const isSelected = selected(value);
|
|
3144
|
-
const handleSelect = useCallback(() => {
|
|
3145
|
-
onSelect == null ? void 0 : onSelect();
|
|
3146
|
-
selectValue(value);
|
|
3147
|
-
}, [onSelect, selectValue, value]);
|
|
3148
|
-
const computedChildren = useMemo(() => {
|
|
3149
|
-
return typeof children === "function" ? ({ active }) => children({ selected: isSelected, active }) : children;
|
|
3150
|
-
}, [children, isSelected]);
|
|
3151
|
-
return /* @__PURE__ */ jsx(SelectedIndicatorContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsx(
|
|
3152
|
-
MenuItem$1,
|
|
3153
|
-
{
|
|
3154
|
-
ref,
|
|
3155
|
-
role: "menuitemcheckbox",
|
|
3156
|
-
onSelect: handleSelect,
|
|
3157
|
-
closeOnSelect,
|
|
3158
|
-
"data-state": getSelectedState(isSelected),
|
|
3159
|
-
...rest,
|
|
3160
|
-
children: computedChildren
|
|
3161
|
-
}
|
|
3162
|
-
) });
|
|
3163
|
-
});
|
|
3164
|
-
const PagesContext = createContext({});
|
|
3165
|
-
const MenuPageContent = memo((props) => {
|
|
3166
|
-
const { page, children } = props;
|
|
3167
|
-
const { activePage } = use(PagesContext);
|
|
3168
|
-
return activePage === page ? children : null;
|
|
3169
|
-
});
|
|
3170
|
-
MenuPageContent.displayName = "PageContent";
|
|
3171
|
-
const MenuPages$1 = memo((props) => {
|
|
3172
|
-
const { children, defaultPage, page, onPageChange } = props;
|
|
3173
|
-
const [activePage, setActivePage] = useControlledState(defaultPage ?? "", page, onPageChange);
|
|
3174
|
-
const contextValue = useMemo(() => ({ activePage, setActivePage }), [activePage, setActivePage]);
|
|
3175
|
-
return /* @__PURE__ */ jsx(PagesContext.Provider, { value: contextValue, children });
|
|
3176
|
-
});
|
|
3177
|
-
MenuPages$1.displayName = "MenuPages";
|
|
3178
|
-
const MenuPageTrigger = memo((props) => {
|
|
3179
|
-
const { ref, onSelect, page, ...rest } = props;
|
|
3180
|
-
const { refs, setActiveIndex } = use(MenuContentContext);
|
|
3181
|
-
const { setActivePage } = use(PagesContext);
|
|
3182
|
-
const handleSelect = useCallback(() => {
|
|
3183
|
-
var _a;
|
|
3184
|
-
onSelect == null ? void 0 : onSelect();
|
|
3185
|
-
setActivePage(page);
|
|
3186
|
-
(_a = refs.floating.current) == null ? void 0 : _a.focus();
|
|
3187
|
-
setActiveIndex(null);
|
|
3188
|
-
}, [onSelect, page, refs.floating, setActiveIndex, setActivePage]);
|
|
3189
|
-
return /* @__PURE__ */ jsx(MenuItem$1, { ref, onSelect: handleSelect, closeOnSelect: false, ...rest });
|
|
3190
|
-
});
|
|
3191
|
-
MenuPageTrigger.displayName = "MenuPageTrigger";
|
|
3192
|
-
const MENU_OVERFLOW_PADDING = 20;
|
|
3193
|
-
const MENU_CONTENT_PADDING = 8;
|
|
3194
|
-
const MENU_MINIMUM_MAX_HEIGHT = 250;
|
|
3195
|
-
const DEFAULT_OFFSET = 5;
|
|
3196
|
-
const MenuRoot$1 = memo((props) => {
|
|
3239
|
+
const SubContext = createContext({});
|
|
3240
|
+
const useSubContext = () => useContext(SubContext);
|
|
3241
|
+
const MenuSub = memo((props) => {
|
|
3197
3242
|
const {
|
|
3198
3243
|
children,
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3244
|
+
disabled = false,
|
|
3245
|
+
side = "right",
|
|
3246
|
+
align = "start",
|
|
3247
|
+
closeRoot = false,
|
|
3202
3248
|
loop = false,
|
|
3203
3249
|
modal = false,
|
|
3204
3250
|
// open state related props
|
|
@@ -3207,203 +3253,8 @@ const MenuRoot$1 = memo((props) => {
|
|
|
3207
3253
|
defaultOpen
|
|
3208
3254
|
} = props;
|
|
3209
3255
|
const [open, setOpen] = useControlledState(defaultOpen ?? false, controlledOpen, onOpenChange);
|
|
3210
|
-
const [activeIndex, setActiveIndex] = useState(null);
|
|
3211
|
-
const [triggerType, setTriggerType] = useState(null);
|
|
3212
|
-
const elementsRef = useRef([]);
|
|
3213
3256
|
const nodeId = useFloatingNodeId();
|
|
3214
|
-
const { refs, floatingStyles, context
|
|
3215
|
-
nodeId,
|
|
3216
|
-
strategy: "fixed",
|
|
3217
|
-
// TODO: probably some way with template string types to not need the "as Placement"
|
|
3218
|
-
placement: side + (align !== "center" ? "-" + align : ""),
|
|
3219
|
-
whileElementsMounted: autoUpdate,
|
|
3220
|
-
open,
|
|
3221
|
-
onOpenChange: setOpen,
|
|
3222
|
-
middleware: [
|
|
3223
|
-
offset({ mainAxis: offset$1 ?? DEFAULT_OFFSET }),
|
|
3224
|
-
size({
|
|
3225
|
-
apply({ availableHeight, elements }) {
|
|
3226
|
-
elements.floating.style.setProperty(
|
|
3227
|
-
"--overmap-menu-available-height",
|
|
3228
|
-
`${Math.max(availableHeight, MENU_MINIMUM_MAX_HEIGHT)}px`
|
|
3229
|
-
);
|
|
3230
|
-
},
|
|
3231
|
-
padding: MENU_OVERFLOW_PADDING
|
|
3232
|
-
}),
|
|
3233
|
-
flip({ fallbackStrategy: "initialPlacement" }),
|
|
3234
|
-
shift({ padding: MENU_OVERFLOW_PADDING }),
|
|
3235
|
-
hide()
|
|
3236
|
-
]
|
|
3237
|
-
});
|
|
3238
|
-
const role = useRole(context, {
|
|
3239
|
-
role: "menu"
|
|
3240
|
-
});
|
|
3241
|
-
const dismiss = useDismiss(context, {
|
|
3242
|
-
capture: true,
|
|
3243
|
-
ancestorScroll: triggerType === "context" || triggerType === "virtual"
|
|
3244
|
-
});
|
|
3245
|
-
const click = useClick(context, {
|
|
3246
|
-
enabled: triggerType === "click"
|
|
3247
|
-
});
|
|
3248
|
-
const listNavigation = useListNavigation(context, {
|
|
3249
|
-
listRef: elementsRef,
|
|
3250
|
-
activeIndex,
|
|
3251
|
-
onNavigate: setActiveIndex,
|
|
3252
|
-
loop
|
|
3253
|
-
});
|
|
3254
|
-
const { getFloatingProps, getItemProps, getReferenceProps } = useInteractions([
|
|
3255
|
-
dismiss,
|
|
3256
|
-
listNavigation,
|
|
3257
|
-
click,
|
|
3258
|
-
role
|
|
3259
|
-
]);
|
|
3260
|
-
return /* @__PURE__ */ jsx(FloatingTree, { children: /* @__PURE__ */ jsx(
|
|
3261
|
-
MenuContext.Provider,
|
|
3262
|
-
{
|
|
3263
|
-
value: {
|
|
3264
|
-
open,
|
|
3265
|
-
setOpen,
|
|
3266
|
-
refs,
|
|
3267
|
-
context,
|
|
3268
|
-
floatingStyles,
|
|
3269
|
-
elementsRef,
|
|
3270
|
-
getFloatingProps,
|
|
3271
|
-
getItemProps,
|
|
3272
|
-
getReferenceProps,
|
|
3273
|
-
nodeId,
|
|
3274
|
-
activeIndex,
|
|
3275
|
-
setActiveIndex,
|
|
3276
|
-
middlewareData,
|
|
3277
|
-
side,
|
|
3278
|
-
modal,
|
|
3279
|
-
setTriggerType
|
|
3280
|
-
},
|
|
3281
|
-
children
|
|
3282
|
-
}
|
|
3283
|
-
) });
|
|
3284
|
-
});
|
|
3285
|
-
MenuRoot$1.displayName = "Root";
|
|
3286
|
-
const MenuScroll = memo((props) => {
|
|
3287
|
-
const { ref, className, ...rest } = props;
|
|
3288
|
-
return /* @__PURE__ */ jsx(
|
|
3289
|
-
"div",
|
|
3290
|
-
{
|
|
3291
|
-
ref,
|
|
3292
|
-
className: cx(
|
|
3293
|
-
"h-full overflow-x-hidden overflow-y-auto [scrollbar-color:var(--base-6)_transparent] [scrollbar-width:thin]",
|
|
3294
|
-
className
|
|
3295
|
-
),
|
|
3296
|
-
...rest
|
|
3297
|
-
}
|
|
3298
|
-
);
|
|
3299
|
-
});
|
|
3300
|
-
MenuScroll.displayName = "MenuScroll";
|
|
3301
|
-
const MenuSelectAllItem$1 = genericMemo((props) => {
|
|
3302
|
-
const { ref, children, onSelect, closeOnSelect = false, ...rest } = props;
|
|
3303
|
-
const { allSelected, someSelected, toggleSelectAll } = use(MultiSelectContext);
|
|
3304
|
-
const selectedState = allSelected ? true : someSelected ? "indeterminate" : false;
|
|
3305
|
-
const handleSelect = useCallback(() => {
|
|
3306
|
-
onSelect == null ? void 0 : onSelect();
|
|
3307
|
-
toggleSelectAll();
|
|
3308
|
-
}, [onSelect, toggleSelectAll]);
|
|
3309
|
-
const computedChildren = useMemo(() => {
|
|
3310
|
-
return typeof children === "function" ? ({ active }) => children({ selected: selectedState, active }) : children;
|
|
3311
|
-
}, [children, selectedState]);
|
|
3312
|
-
return /* @__PURE__ */ jsx(CheckedIndicatorContext, { value: selectedState, children: /* @__PURE__ */ jsx(
|
|
3313
|
-
MenuItem$1,
|
|
3314
|
-
{
|
|
3315
|
-
onSelect: handleSelect,
|
|
3316
|
-
ref,
|
|
3317
|
-
"data-state": getCheckedState(selectedState),
|
|
3318
|
-
closeOnSelect,
|
|
3319
|
-
...rest,
|
|
3320
|
-
children: computedChildren
|
|
3321
|
-
}
|
|
3322
|
-
) });
|
|
3323
|
-
});
|
|
3324
|
-
const MenuSelectedIndicator$1 = memo((props) => {
|
|
3325
|
-
const { ref, children, ...rest } = props;
|
|
3326
|
-
return /* @__PURE__ */ jsx(SelectedIndicator, { ref, ...rest, children });
|
|
3327
|
-
});
|
|
3328
|
-
MenuSelectedIndicator$1.displayName = "MenuSelectedIndicator";
|
|
3329
|
-
const MenuSelectGroup$1 = genericMemo(function MenuSelectGroup2(props) {
|
|
3330
|
-
const { ref, children, required, defaultValue, value, onValueChange, ...rest } = props;
|
|
3331
|
-
return /* @__PURE__ */ jsx(MenuGroup$1, { ref, ...rest, children: required ? /* @__PURE__ */ jsx(SingleSelectRequiredProvider, { defaultValue, value, onValueChange, children }) : /* @__PURE__ */ jsx(
|
|
3332
|
-
SingleSelectNotRequiredProvider,
|
|
3333
|
-
{
|
|
3334
|
-
defaultValue,
|
|
3335
|
-
value,
|
|
3336
|
-
onValueChange,
|
|
3337
|
-
children
|
|
3338
|
-
}
|
|
3339
|
-
) });
|
|
3340
|
-
});
|
|
3341
|
-
const MenuSelectItem$1 = genericMemo(function(props) {
|
|
3342
|
-
const { ref, value, onSelect, children, closeOnSelect = true, ...rest } = props;
|
|
3343
|
-
const { selected, selectValue } = use(SelectContext);
|
|
3344
|
-
const isSelected = selected(value);
|
|
3345
|
-
const handleSelect = useCallback(() => {
|
|
3346
|
-
onSelect == null ? void 0 : onSelect();
|
|
3347
|
-
selectValue(value);
|
|
3348
|
-
}, [onSelect, selectValue, value]);
|
|
3349
|
-
const computedChildren = useMemo(() => {
|
|
3350
|
-
return typeof children === "function" ? ({ active }) => children({ selected: isSelected, active }) : children;
|
|
3351
|
-
}, [children, isSelected]);
|
|
3352
|
-
return /* @__PURE__ */ jsx(SelectedIndicatorContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsx(
|
|
3353
|
-
MenuItem$1,
|
|
3354
|
-
{
|
|
3355
|
-
ref,
|
|
3356
|
-
role: "menuitemcheckbox",
|
|
3357
|
-
onSelect: handleSelect,
|
|
3358
|
-
closeOnSelect,
|
|
3359
|
-
"data-state": getSelectedState(isSelected),
|
|
3360
|
-
...rest,
|
|
3361
|
-
children: computedChildren
|
|
3362
|
-
}
|
|
3363
|
-
) });
|
|
3364
|
-
});
|
|
3365
|
-
const MenuSeparator$1 = memo((props) => {
|
|
3366
|
-
const { ref, className, ...rest } = props;
|
|
3367
|
-
const { size: size2 } = use(MenuContentContext);
|
|
3368
|
-
return /* @__PURE__ */ jsx(RadixSeparator.Root, { className: cx(menuSeparator({ size: size2 }), className), ref, ...rest });
|
|
3369
|
-
});
|
|
3370
|
-
MenuSeparator$1.displayName = "MenuSeparator";
|
|
3371
|
-
const computeOffsets = (side, alignment) => {
|
|
3372
|
-
switch (side) {
|
|
3373
|
-
case "right":
|
|
3374
|
-
if (alignment === "start") {
|
|
3375
|
-
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -MENU_CONTENT_PADDING };
|
|
3376
|
-
} else if (alignment === "end") {
|
|
3377
|
-
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
3378
|
-
}
|
|
3379
|
-
break;
|
|
3380
|
-
case "left":
|
|
3381
|
-
if (alignment === "start") {
|
|
3382
|
-
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -MENU_CONTENT_PADDING };
|
|
3383
|
-
} else if (alignment === "end") {
|
|
3384
|
-
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
3385
|
-
}
|
|
3386
|
-
break;
|
|
3387
|
-
}
|
|
3388
|
-
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: 0 };
|
|
3389
|
-
};
|
|
3390
|
-
const MenuSub = memo((props) => {
|
|
3391
|
-
const {
|
|
3392
|
-
children,
|
|
3393
|
-
disabled = false,
|
|
3394
|
-
side = "right",
|
|
3395
|
-
align = "start",
|
|
3396
|
-
closeRoot = false,
|
|
3397
|
-
loop = false,
|
|
3398
|
-
modal = false,
|
|
3399
|
-
// open state related props
|
|
3400
|
-
open: controlledOpen,
|
|
3401
|
-
onOpenChange,
|
|
3402
|
-
defaultOpen
|
|
3403
|
-
} = props;
|
|
3404
|
-
const [open, setOpen] = useControlledState(defaultOpen ?? false, controlledOpen, onOpenChange);
|
|
3405
|
-
const nodeId = useFloatingNodeId();
|
|
3406
|
-
const { refs, floatingStyles, context } = useFloating({
|
|
3257
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
3407
3258
|
nodeId,
|
|
3408
3259
|
strategy: "fixed",
|
|
3409
3260
|
whileElementsMounted: autoUpdate,
|
|
@@ -3485,644 +3336,336 @@ const MenuSub = memo((props) => {
|
|
|
3485
3336
|
);
|
|
3486
3337
|
});
|
|
3487
3338
|
MenuSub.displayName = "SubMenu";
|
|
3488
|
-
const
|
|
3489
|
-
|
|
3490
|
-
const
|
|
3491
|
-
const {
|
|
3492
|
-
const {
|
|
3339
|
+
const TRIGGER_SELECT_KEYS = ["Enter", " "];
|
|
3340
|
+
const MenuItem = memo((props) => {
|
|
3341
|
+
const rootMenuContext = useMenuContext();
|
|
3342
|
+
const { getItemProps, activeIndex, setOpen, size: size2, variant, radius } = useMenuContentContext();
|
|
3343
|
+
const { closeRoot } = useSubContext();
|
|
3493
3344
|
const {
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
}
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3345
|
+
ref: forwardedRef,
|
|
3346
|
+
className,
|
|
3347
|
+
children,
|
|
3348
|
+
onSelect,
|
|
3349
|
+
onClick,
|
|
3350
|
+
onKeyDown,
|
|
3351
|
+
closeOnSelect = true,
|
|
3352
|
+
disabled = false,
|
|
3353
|
+
...rest
|
|
3354
|
+
} = props;
|
|
3355
|
+
const { ref, index } = useListItem();
|
|
3356
|
+
const mergeRefs2 = useMergeRefs([ref, forwardedRef]);
|
|
3357
|
+
const handleClick = useCallback(
|
|
3358
|
+
(e) => {
|
|
3359
|
+
e.stopPropagation();
|
|
3360
|
+
if (disabled) return;
|
|
3361
|
+
onClick == null ? void 0 : onClick(e);
|
|
3362
|
+
onSelect == null ? void 0 : onSelect();
|
|
3363
|
+
if (closeOnSelect) setOpen(false);
|
|
3364
|
+
if (closeRoot) rootMenuContext.setOpen(false);
|
|
3365
|
+
},
|
|
3366
|
+
[closeOnSelect, closeRoot, disabled, rootMenuContext, onClick, onSelect, setOpen]
|
|
3367
|
+
);
|
|
3368
|
+
const handleKeyDown = useCallback(
|
|
3369
|
+
(e) => {
|
|
3370
|
+
if (disabled) return;
|
|
3371
|
+
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
3372
|
+
if (TRIGGER_SELECT_KEYS.includes(e.key)) {
|
|
3373
|
+
onSelect == null ? void 0 : onSelect();
|
|
3374
|
+
if (closeOnSelect) setOpen(false);
|
|
3375
|
+
}
|
|
3376
|
+
},
|
|
3377
|
+
[closeOnSelect, disabled, onKeyDown, onSelect, setOpen]
|
|
3378
|
+
);
|
|
3379
|
+
const isActive = useMemo(() => index === activeIndex, [activeIndex, index]);
|
|
3380
|
+
const computedChildren = useMemo(() => {
|
|
3381
|
+
return typeof children === "function" ? children({ active: isActive, selected: false }) : children;
|
|
3382
|
+
}, [children, isActive]);
|
|
3383
|
+
return /* @__PURE__ */ jsx(
|
|
3384
|
+
"li",
|
|
3518
3385
|
{
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
children: /* @__PURE__ */ jsx(
|
|
3533
|
-
"div",
|
|
3534
|
-
{
|
|
3535
|
-
className: "outline-none",
|
|
3536
|
-
ref: mergeRefs2,
|
|
3537
|
-
style: computedFloatingStyles,
|
|
3538
|
-
...getFloatingProps(),
|
|
3539
|
-
children: /* @__PURE__ */ jsx(
|
|
3540
|
-
"ul",
|
|
3541
|
-
{
|
|
3542
|
-
className: cx(
|
|
3543
|
-
"overmap-menu-sub-content",
|
|
3544
|
-
menuContent({ size: size2 }),
|
|
3545
|
-
floating({ side, shadow: "3" }),
|
|
3546
|
-
radiusCva({ radius, maxLarge: true }),
|
|
3547
|
-
"max-h-(--overmap-menu-available-height)"
|
|
3548
|
-
),
|
|
3549
|
-
ref: forwardedRef,
|
|
3550
|
-
"data-state": getOpenState(open),
|
|
3551
|
-
"data-side": side,
|
|
3552
|
-
"data-accent-color": accentColor,
|
|
3553
|
-
...rest,
|
|
3554
|
-
children
|
|
3555
|
-
}
|
|
3556
|
-
)
|
|
3557
|
-
}
|
|
3558
|
-
)
|
|
3386
|
+
className: cx(menuItem({ size: size2, variant }), radiusCva({ radius, maxLarge: true }), className),
|
|
3387
|
+
ref: mergeRefs2,
|
|
3388
|
+
role: "menuitem",
|
|
3389
|
+
"data-disabled": getBooleanState(disabled),
|
|
3390
|
+
"aria-disabled": disabled,
|
|
3391
|
+
"data-highlighted": isActive ? "" : void 0,
|
|
3392
|
+
...getItemProps({
|
|
3393
|
+
onClick: handleClick,
|
|
3394
|
+
onKeyDown: handleKeyDown,
|
|
3395
|
+
tabIndex: isActive ? 0 : -1,
|
|
3396
|
+
...rest
|
|
3397
|
+
}),
|
|
3398
|
+
children: computedChildren
|
|
3559
3399
|
}
|
|
3560
|
-
)
|
|
3400
|
+
);
|
|
3561
3401
|
});
|
|
3562
|
-
|
|
3563
|
-
const
|
|
3564
|
-
const { ref
|
|
3565
|
-
const
|
|
3566
|
-
|
|
3402
|
+
MenuItem.displayName = "MenuItem";
|
|
3403
|
+
const MenuCheckboxItem = memo((props) => {
|
|
3404
|
+
const { ref, checked, onCheckedChange, onSelect, ...rest } = props;
|
|
3405
|
+
const handleSelect = useCallback(() => {
|
|
3406
|
+
onSelect == null ? void 0 : onSelect();
|
|
3407
|
+
switch (checked) {
|
|
3408
|
+
case true:
|
|
3409
|
+
onCheckedChange(false);
|
|
3410
|
+
break;
|
|
3411
|
+
case "indeterminate":
|
|
3412
|
+
case false:
|
|
3413
|
+
onCheckedChange(true);
|
|
3414
|
+
break;
|
|
3415
|
+
}
|
|
3416
|
+
}, [checked, onCheckedChange, onSelect]);
|
|
3417
|
+
return /* @__PURE__ */ jsx(CheckedIndicatorContext.Provider, { value: checked, children: /* @__PURE__ */ jsx(MenuItem, { ref, onSelect: handleSelect, ...rest }) });
|
|
3418
|
+
});
|
|
3419
|
+
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
3420
|
+
const MenuCheckboxItemIndicator = memo((props) => {
|
|
3421
|
+
const { ref, children, ...rest } = props;
|
|
3422
|
+
return /* @__PURE__ */ jsx(CheckedIndicator, { ref, ...rest, children });
|
|
3423
|
+
});
|
|
3424
|
+
MenuCheckboxItemIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
3425
|
+
const MenuClickTrigger = memo((props) => {
|
|
3426
|
+
const { ref: forwardedRef, children, disabled = false } = props;
|
|
3427
|
+
const { getReferenceProps, refs, setTriggerType, open } = useMenuContext();
|
|
3428
|
+
const mergedRefs = useMergeRefs([refs.setReference, forwardedRef]);
|
|
3429
|
+
useEffect(() => {
|
|
3430
|
+
setTriggerType("click");
|
|
3431
|
+
}, [setTriggerType]);
|
|
3567
3432
|
return /* @__PURE__ */ jsx(
|
|
3568
|
-
|
|
3433
|
+
Slot,
|
|
3569
3434
|
{
|
|
3570
3435
|
ref: mergedRefs,
|
|
3571
|
-
|
|
3572
|
-
"
|
|
3436
|
+
"aria-disabled": disabled,
|
|
3437
|
+
"data-disabled": getBooleanState(disabled),
|
|
3573
3438
|
"data-state": getOpenState(open),
|
|
3574
|
-
disabled,
|
|
3575
|
-
...getReferenceProps(rest),
|
|
3439
|
+
...getReferenceProps({ disabled }),
|
|
3576
3440
|
children
|
|
3577
3441
|
}
|
|
3578
3442
|
);
|
|
3579
3443
|
});
|
|
3580
|
-
|
|
3581
|
-
const
|
|
3582
|
-
const {
|
|
3583
|
-
const
|
|
3444
|
+
MenuClickTrigger.displayName = "MenuClickTrigger";
|
|
3445
|
+
const MenuContextTrigger = memo((props) => {
|
|
3446
|
+
const { ref: forwardedRef, children, disabled = false } = props;
|
|
3447
|
+
const ref = useRef(null);
|
|
3448
|
+
const { setOpen, refs, setTriggerType, open } = useMenuContext();
|
|
3449
|
+
const mergedRefs = useMergeRefs([forwardedRef, ref]);
|
|
3584
3450
|
useEffect(() => {
|
|
3585
|
-
setTriggerType("
|
|
3451
|
+
setTriggerType("context");
|
|
3586
3452
|
}, [setTriggerType]);
|
|
3587
|
-
|
|
3588
|
-
if (!disabled && virtualElement) {
|
|
3589
|
-
refs.setPositionReference(virtualElement);
|
|
3590
|
-
setOpen(true);
|
|
3591
|
-
} else {
|
|
3592
|
-
refs.setPositionReference(null);
|
|
3593
|
-
setOpen(false);
|
|
3594
|
-
}
|
|
3595
|
-
}, [disabled, refs, setOpen, virtualElement]);
|
|
3596
|
-
return null;
|
|
3597
|
-
});
|
|
3598
|
-
MenuVirtualTrigger.displayName = "VirtualTrigger";
|
|
3599
|
-
const Menu = {
|
|
3600
|
-
Root: MenuRoot$1,
|
|
3601
|
-
Content: MenuContent,
|
|
3602
|
-
// sub
|
|
3603
|
-
Sub: MenuSub,
|
|
3604
|
-
SubContent: MenuSubContent,
|
|
3605
|
-
SubTrigger: MenuSubTrigger,
|
|
3606
|
-
// pages
|
|
3607
|
-
Pages: MenuPages$1,
|
|
3608
|
-
PageContent: MenuPageContent,
|
|
3609
|
-
PageTrigger: MenuPageTrigger,
|
|
3610
|
-
// triggers
|
|
3611
|
-
ClickTrigger: MenuClickTrigger,
|
|
3612
|
-
ContextTrigger: MenuContextTrigger,
|
|
3613
|
-
VirtualTrigger: MenuVirtualTrigger,
|
|
3614
|
-
// groups
|
|
3615
|
-
Group: MenuGroup$1,
|
|
3616
|
-
SelectGroup: MenuSelectGroup$1,
|
|
3617
|
-
MultiSelectGroup: MenuMultiSelectGroup$1,
|
|
3618
|
-
// items
|
|
3619
|
-
Item: MenuItem$1,
|
|
3620
|
-
SelectItem: MenuSelectItem$1,
|
|
3621
|
-
MultiSelectItem: MenuMultiSelectItem$1,
|
|
3622
|
-
SelectAllItem: MenuSelectAllItem$1,
|
|
3623
|
-
CheckboxItem: MenuCheckboxItem$1,
|
|
3624
|
-
// indicators
|
|
3625
|
-
SelectedIndicator: MenuSelectedIndicator$1,
|
|
3626
|
-
CheckboxItemIndicator: MenuCheckboxItemIndicator,
|
|
3627
|
-
// input
|
|
3628
|
-
InputRoot: MenuInputRoot,
|
|
3629
|
-
InputField: MenuInputField,
|
|
3630
|
-
InputSlot: MenuInputSlot,
|
|
3631
|
-
// others
|
|
3632
|
-
Label: MenuLabel,
|
|
3633
|
-
Separator: MenuSeparator$1,
|
|
3634
|
-
Scroll: MenuScroll
|
|
3635
|
-
};
|
|
3636
|
-
const KEY_MAPPING = {
|
|
3637
|
-
next: "ArrowDown",
|
|
3638
|
-
prev: "ArrowUp",
|
|
3639
|
-
first: "PageUp",
|
|
3640
|
-
last: "PageDown",
|
|
3641
|
-
selectItem: "Enter"
|
|
3642
|
-
};
|
|
3643
|
-
const ITEM_SELECTOR = "menu-item";
|
|
3644
|
-
const GROUP_SELECTOR = "menu-group";
|
|
3645
|
-
const MenuRootContext = createContext({});
|
|
3646
|
-
const MenuGroupContext = createContext({});
|
|
3647
|
-
const MenuPageContext = createContext({});
|
|
3648
|
-
const menuRootCva = cva(["w-full", "outline-none"], {
|
|
3649
|
-
variants: {
|
|
3650
|
-
size: {
|
|
3651
|
-
xs: ["p-0.5", "text-xs", "min-w-30"],
|
|
3652
|
-
sm: ["p-0.75", "text-sm", "min-w-35"],
|
|
3653
|
-
md: ["p-1", "text-md", "min-w-40"],
|
|
3654
|
-
lg: ["p-1.25", "text-lg", "min-w-45"],
|
|
3655
|
-
xl: ["p-1.5", "text-xl", "min-w-50"]
|
|
3656
|
-
},
|
|
3657
|
-
radius: {
|
|
3658
|
-
none: ["rounded-none"],
|
|
3659
|
-
xs: ["rounded-xs"],
|
|
3660
|
-
sm: ["rounded-sm"],
|
|
3661
|
-
md: ["rounded-md"],
|
|
3662
|
-
lg: ["rounded-lg"],
|
|
3663
|
-
xl: ["rounded-lg"],
|
|
3664
|
-
full: ["rounded-lg"]
|
|
3665
|
-
}
|
|
3666
|
-
}
|
|
3667
|
-
});
|
|
3668
|
-
const menuItemCva = cva(
|
|
3669
|
-
[
|
|
3670
|
-
"select-none",
|
|
3671
|
-
"relative",
|
|
3672
|
-
"flex",
|
|
3673
|
-
"items-center",
|
|
3674
|
-
"outline-none",
|
|
3675
|
-
"data-[disabled=true]:text-(--base-a8)",
|
|
3676
|
-
"data-[disabled=true]:pointer-events-none",
|
|
3677
|
-
"shrink-0",
|
|
3678
|
-
"py-1",
|
|
3679
|
-
"text-(--base-12)"
|
|
3680
|
-
],
|
|
3681
|
-
{
|
|
3682
|
-
variants: {
|
|
3683
|
-
size: {
|
|
3684
|
-
xs: ["gap-1.5", "px-3"],
|
|
3685
|
-
sm: ["gap-1.75", "px-3.5"],
|
|
3686
|
-
md: ["gap-2", "px-4"],
|
|
3687
|
-
lg: ["gap-2.25", "px-4.5"],
|
|
3688
|
-
xl: ["gap-2.5", "px-5"]
|
|
3689
|
-
},
|
|
3690
|
-
variant: {
|
|
3691
|
-
solid: [
|
|
3692
|
-
"data-[active=true]:not-[data-[disabled=true]]:text-(--accent-contrast)",
|
|
3693
|
-
"data-[active=true]:not-[data-[disabled=true]]:bg-(--accent-a9)",
|
|
3694
|
-
"data-[active=true]:not-[data-[disabled=true]]:active:brightness-110"
|
|
3695
|
-
],
|
|
3696
|
-
soft: [
|
|
3697
|
-
"data-[active=true]:not-[data-[disabled=true]]:bg-(--accent-a3)",
|
|
3698
|
-
"data-[active=true]:not-[data-[disabled=true]]:active:bg-(--accent-a4)"
|
|
3699
|
-
]
|
|
3700
|
-
}
|
|
3701
|
-
}
|
|
3702
|
-
}
|
|
3703
|
-
);
|
|
3704
|
-
const menuGroupLabelCva = cva(["text-(--base-a11)", "flex", "items-center", "select-none", "py-1"], {
|
|
3705
|
-
variants: {
|
|
3706
|
-
size: {
|
|
3707
|
-
xs: ["gap-1.5", "px-3", "text-xs"],
|
|
3708
|
-
sm: ["gap-1.75", "px-3.5", "text-xs"],
|
|
3709
|
-
md: ["gap-2", "px-4", "text-sm"],
|
|
3710
|
-
lg: ["gap-2.25", "px-4.5", "text-base"],
|
|
3711
|
-
xl: ["gap-2.5", "px-5", "text-lg"]
|
|
3712
|
-
}
|
|
3713
|
-
}
|
|
3714
|
-
});
|
|
3715
|
-
const menuSeparatorCva = cva(["h-px", "bg-(--base-a6)", "w-auto", "shrink-0"], {
|
|
3716
|
-
variants: {
|
|
3717
|
-
size: {
|
|
3718
|
-
xs: ["-mx-0.5", "my-0.5"],
|
|
3719
|
-
sm: ["-mx-0.75", "my-0.75"],
|
|
3720
|
-
md: ["-mx-1", "my-1"],
|
|
3721
|
-
lg: ["-mx-1.25", "my-1.25"],
|
|
3722
|
-
xl: ["-mx-1.5", "my-1.5"]
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
|
-
});
|
|
3726
|
-
const MenuItem = memo((props) => {
|
|
3727
|
-
const {
|
|
3728
|
-
ref,
|
|
3729
|
-
children,
|
|
3730
|
-
className,
|
|
3731
|
-
disabled = false,
|
|
3732
|
-
onClick,
|
|
3733
|
-
onSelect,
|
|
3734
|
-
onPointerEnter,
|
|
3735
|
-
onPointerLeave,
|
|
3736
|
-
onPointerMove,
|
|
3737
|
-
...rest
|
|
3738
|
-
} = props;
|
|
3739
|
-
const internalRef = useRef(null);
|
|
3740
|
-
const itemId = useId();
|
|
3741
|
-
const { activeItemId, setActiveItemId, size: size2, variant, radius } = use(MenuRootContext);
|
|
3742
|
-
const isActive = itemId === activeItemId;
|
|
3743
|
-
const handleSelect = useCallback(
|
|
3744
|
-
(e) => {
|
|
3745
|
-
onSelect == null ? void 0 : onSelect(e);
|
|
3746
|
-
},
|
|
3747
|
-
[onSelect]
|
|
3748
|
-
);
|
|
3749
|
-
const handleClick = useCallback(
|
|
3750
|
-
(e) => {
|
|
3751
|
-
onClick == null ? void 0 : onClick(e);
|
|
3752
|
-
handleSelect(new Event("menu-select"));
|
|
3753
|
-
},
|
|
3754
|
-
[handleSelect, onClick]
|
|
3755
|
-
);
|
|
3756
|
-
const handlePointerEnter = useCallback(
|
|
3453
|
+
const handleContextMenu = useCallback(
|
|
3757
3454
|
(e) => {
|
|
3758
|
-
|
|
3759
|
-
if (
|
|
3760
|
-
|
|
3455
|
+
const { clientY, clientX } = e;
|
|
3456
|
+
if (!disabled && ref.current) {
|
|
3457
|
+
e.preventDefault();
|
|
3458
|
+
refs.setPositionReference({
|
|
3459
|
+
getBoundingClientRect() {
|
|
3460
|
+
return {
|
|
3461
|
+
x: clientX,
|
|
3462
|
+
y: clientY,
|
|
3463
|
+
top: clientY,
|
|
3464
|
+
left: clientX,
|
|
3465
|
+
height: 0,
|
|
3466
|
+
width: 0,
|
|
3467
|
+
bottom: clientY,
|
|
3468
|
+
right: clientX
|
|
3469
|
+
};
|
|
3470
|
+
},
|
|
3471
|
+
contextElement: ref.current
|
|
3472
|
+
});
|
|
3473
|
+
setOpen(true);
|
|
3474
|
+
}
|
|
3761
3475
|
},
|
|
3762
|
-
[
|
|
3476
|
+
[disabled, refs, setOpen]
|
|
3763
3477
|
);
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3478
|
+
return /* @__PURE__ */ jsx(
|
|
3479
|
+
Slot,
|
|
3480
|
+
{
|
|
3481
|
+
ref: mergedRefs,
|
|
3482
|
+
style: { WebkitTouchCallout: disabled ? "none" : "unset" },
|
|
3483
|
+
"aria-disabled": disabled,
|
|
3484
|
+
"data-disabled": getBooleanState(disabled),
|
|
3485
|
+
"data-state": getOpenState(open),
|
|
3486
|
+
onContextMenu: handleContextMenu,
|
|
3487
|
+
children
|
|
3488
|
+
}
|
|
3771
3489
|
);
|
|
3772
|
-
|
|
3490
|
+
});
|
|
3491
|
+
MenuContextTrigger.displayName = "MenuContextTrigger";
|
|
3492
|
+
const MenuGroup = memo((props) => {
|
|
3493
|
+
const { ref, children, ...rest } = props;
|
|
3494
|
+
return /* @__PURE__ */ jsx("div", { ref, role: "group", ...rest, children });
|
|
3495
|
+
});
|
|
3496
|
+
MenuGroup.displayName = "MenuGroup";
|
|
3497
|
+
const MenuInputField = memo((props) => {
|
|
3498
|
+
const { ref: forwardedRef, className, onValueChange, onChange, disabled = false, ...rest } = props;
|
|
3499
|
+
const { activeIndex, getItemProps } = useMenuContentContext();
|
|
3500
|
+
const { index, ref } = useListItem();
|
|
3501
|
+
const mergedRefs = useMergeRefs([ref, forwardedRef]);
|
|
3502
|
+
const handleChange = useCallback(
|
|
3773
3503
|
(e) => {
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
setActiveItemId(itemId);
|
|
3504
|
+
onChange == null ? void 0 : onChange(e);
|
|
3505
|
+
onValueChange == null ? void 0 : onValueChange(e.target.value);
|
|
3777
3506
|
},
|
|
3778
|
-
[
|
|
3507
|
+
[onChange, onValueChange]
|
|
3779
3508
|
);
|
|
3780
3509
|
useEffect(() => {
|
|
3781
|
-
if (!internalRef.current) return;
|
|
3782
|
-
const element = internalRef.current;
|
|
3783
|
-
element.addEventListener("menu-select", handleSelect);
|
|
3784
3510
|
return () => {
|
|
3785
|
-
|
|
3511
|
+
onValueChange == null ? void 0 : onValueChange("");
|
|
3786
3512
|
};
|
|
3787
|
-
}, [
|
|
3513
|
+
}, []);
|
|
3788
3514
|
return /* @__PURE__ */ jsx(
|
|
3789
|
-
"
|
|
3515
|
+
"input",
|
|
3790
3516
|
{
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
onClick: handleClick,
|
|
3795
|
-
onPointerEnter: handlePointerEnter,
|
|
3796
|
-
onPointerLeave: handlePointerLeave,
|
|
3797
|
-
onPointerMove: handlePointerMove,
|
|
3798
|
-
...{ [ITEM_SELECTOR]: itemId },
|
|
3799
|
-
"data-active": getBooleanState(isActive),
|
|
3517
|
+
className: cx("placeholder-(--base-a9)", "selection:bg-(--accent-a5)", "outline-none", className),
|
|
3518
|
+
ref: mergedRefs,
|
|
3519
|
+
disabled,
|
|
3800
3520
|
"data-disabled": getBooleanState(disabled),
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3521
|
+
...getItemProps({
|
|
3522
|
+
...rest,
|
|
3523
|
+
tabIndex: index === activeIndex ? 0 : -1,
|
|
3524
|
+
onChange: handleChange
|
|
3525
|
+
})
|
|
3804
3526
|
}
|
|
3805
3527
|
);
|
|
3806
3528
|
});
|
|
3807
|
-
|
|
3808
|
-
const
|
|
3809
|
-
const { ref,
|
|
3810
|
-
const
|
|
3811
|
-
|
|
3812
|
-
onSelect == null ? void 0 : onSelect(e);
|
|
3813
|
-
if (e.defaultPrevented) return;
|
|
3814
|
-
switch (checked) {
|
|
3815
|
-
case true:
|
|
3816
|
-
onCheckedChange(false);
|
|
3817
|
-
break;
|
|
3818
|
-
case "indeterminate":
|
|
3819
|
-
onCheckedChange(true);
|
|
3820
|
-
break;
|
|
3821
|
-
case false:
|
|
3822
|
-
onCheckedChange(true);
|
|
3823
|
-
break;
|
|
3824
|
-
}
|
|
3825
|
-
},
|
|
3826
|
-
[checked, onCheckedChange, onSelect]
|
|
3827
|
-
);
|
|
3828
|
-
return /* @__PURE__ */ jsx(CheckedIndicatorContext.Provider, { value: checked, children: /* @__PURE__ */ jsx(MenuItem, { ref, onSelect: handleSelect, ...rest }) });
|
|
3829
|
-
});
|
|
3830
|
-
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
3831
|
-
const MenuCheckedIndicator = memo((props) => {
|
|
3832
|
-
const { ref, children, ...rest } = props;
|
|
3833
|
-
return /* @__PURE__ */ jsx(CheckedIndicator, { ref, ...rest, children });
|
|
3834
|
-
});
|
|
3835
|
-
MenuCheckedIndicator.displayName = "MenuCheckboxItemIndicator";
|
|
3836
|
-
const MenuGroup = memo((props) => {
|
|
3837
|
-
const { ref, children, ...rest } = props;
|
|
3838
|
-
const groupId = useId();
|
|
3839
|
-
const [labelId, setLabelId] = useState(null);
|
|
3840
|
-
const contextValue = useMemo(
|
|
3841
|
-
() => ({
|
|
3842
|
-
labelId,
|
|
3843
|
-
setLabelId
|
|
3844
|
-
}),
|
|
3845
|
-
[labelId]
|
|
3846
|
-
);
|
|
3847
|
-
return /* @__PURE__ */ jsx("div", { ref, role: "group", ...{ [GROUP_SELECTOR]: groupId }, "aria-labelledby": labelId ?? void 0, ...rest, children: /* @__PURE__ */ jsx(MenuGroupContext, { value: contextValue, children }) });
|
|
3529
|
+
MenuInputField.displayName = "MenuInputField";
|
|
3530
|
+
const MenuInputRoot = memo((props) => {
|
|
3531
|
+
const { ref, className, ...rest } = props;
|
|
3532
|
+
const { size: size2 } = useMenuContentContext();
|
|
3533
|
+
return /* @__PURE__ */ jsx("div", { className: cx(inputRoot({ size: size2 }), className), ref, ...rest });
|
|
3848
3534
|
});
|
|
3849
|
-
|
|
3850
|
-
const
|
|
3851
|
-
const { ref,
|
|
3852
|
-
|
|
3853
|
-
const { size: size2 } = use(MenuRootContext);
|
|
3854
|
-
const { setLabelId } = use(MenuGroupContext);
|
|
3855
|
-
useEffect(() => {
|
|
3856
|
-
setLabelId(labelId);
|
|
3857
|
-
}, [labelId, setLabelId]);
|
|
3858
|
-
return /* @__PURE__ */ jsx("div", { ref, id: labelId, className: cx(menuGroupLabelCva({ size: size2 }), className), ...rest, children });
|
|
3535
|
+
MenuInputRoot.displayName = "MenuInputRoot";
|
|
3536
|
+
const MenuInputSlot = memo((props) => {
|
|
3537
|
+
const { ref, className, ...rest } = props;
|
|
3538
|
+
return /* @__PURE__ */ jsx("div", { className: cx("flex", "items-center", "text-(--base-a11)", className), ref, ...rest });
|
|
3859
3539
|
});
|
|
3860
|
-
|
|
3861
|
-
const
|
|
3862
|
-
const { ref,
|
|
3863
|
-
const {
|
|
3864
|
-
|
|
3865
|
-
const handleSelect = useCallback(
|
|
3866
|
-
(e) => {
|
|
3867
|
-
onSelect == null ? void 0 : onSelect(e);
|
|
3868
|
-
if (e.defaultPrevented) return;
|
|
3869
|
-
toggleSelectAll();
|
|
3870
|
-
},
|
|
3871
|
-
[onSelect, toggleSelectAll]
|
|
3872
|
-
);
|
|
3873
|
-
return /* @__PURE__ */ jsx(MenuItem, { onSelect: handleSelect, ref, "data-state": getCheckedState(selectedState), ...rest, children: /* @__PURE__ */ jsx(CheckedIndicatorContext, { value: selectedState, children }) });
|
|
3540
|
+
MenuInputSlot.displayName = "MenuInputSlot";
|
|
3541
|
+
const MenuLabel = memo((props) => {
|
|
3542
|
+
const { ref, className, ...rest } = props;
|
|
3543
|
+
const { size: size2 } = useMenuContentContext();
|
|
3544
|
+
return /* @__PURE__ */ jsx("div", { ref, className: cx(menuLabelCva({ size: size2 }), className), ...rest });
|
|
3874
3545
|
});
|
|
3875
|
-
|
|
3546
|
+
MenuLabel.displayName = "MenuLabel";
|
|
3547
|
+
const MenuMultiSelectGroup = genericMemo(function MenuMultiSelectGroup2(props) {
|
|
3876
3548
|
const { ref, children, defaultValues, values, onValuesChange, ...rest } = props;
|
|
3877
3549
|
return /* @__PURE__ */ jsx(MenuGroup, { ref, ...rest, children: /* @__PURE__ */ jsx(MultiSelectProvider, { defaultValues, values, onValuesChange, children }) });
|
|
3878
3550
|
});
|
|
3551
|
+
const SelectedIndicatorContext = createContext(false);
|
|
3552
|
+
const useSelectedIndicatorContext = () => useContext(SelectedIndicatorContext);
|
|
3553
|
+
const MenuSelectedIndicator = memo((props) => {
|
|
3554
|
+
const { ref, children, className, ...rest } = props;
|
|
3555
|
+
const isSelected = useSelectedIndicatorContext();
|
|
3556
|
+
return /* @__PURE__ */ jsx(
|
|
3557
|
+
"span",
|
|
3558
|
+
{
|
|
3559
|
+
ref,
|
|
3560
|
+
className: cx(
|
|
3561
|
+
"flex size-max items-center",
|
|
3562
|
+
{
|
|
3563
|
+
invisible: !isSelected
|
|
3564
|
+
},
|
|
3565
|
+
className
|
|
3566
|
+
),
|
|
3567
|
+
"data-state": getSelectedState(isSelected),
|
|
3568
|
+
...rest,
|
|
3569
|
+
children
|
|
3570
|
+
}
|
|
3571
|
+
);
|
|
3572
|
+
});
|
|
3573
|
+
MenuSelectedIndicator.displayName = "SelectedIndicator";
|
|
3879
3574
|
const MenuMultiSelectItem = genericMemo(function(props) {
|
|
3880
|
-
const { ref, onSelect, children, value, ...rest } = props;
|
|
3575
|
+
const { ref, onSelect, children, closeOnSelect = false, value, ...rest } = props;
|
|
3881
3576
|
const { selected, selectValue, registerValue } = use(MultiSelectContext);
|
|
3882
3577
|
useLayoutEffect(() => {
|
|
3883
3578
|
return registerValue(value);
|
|
3884
3579
|
}, [registerValue, value]);
|
|
3885
3580
|
const isSelected = selected(value);
|
|
3886
|
-
const handleSelect = useCallback(
|
|
3887
|
-
(
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
},
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
return /* @__PURE__ */ jsx(
|
|
3581
|
+
const handleSelect = useCallback(() => {
|
|
3582
|
+
onSelect == null ? void 0 : onSelect();
|
|
3583
|
+
selectValue(value);
|
|
3584
|
+
}, [onSelect, selectValue, value]);
|
|
3585
|
+
const computedChildren = useMemo(() => {
|
|
3586
|
+
return typeof children === "function" ? ({ active }) => children({ selected: isSelected, active }) : children;
|
|
3587
|
+
}, [children, isSelected]);
|
|
3588
|
+
return /* @__PURE__ */ jsx(SelectedIndicatorContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsx(
|
|
3895
3589
|
MenuItem,
|
|
3896
3590
|
{
|
|
3897
3591
|
ref,
|
|
3898
3592
|
role: "menuitemcheckbox",
|
|
3899
3593
|
onSelect: handleSelect,
|
|
3594
|
+
closeOnSelect,
|
|
3900
3595
|
"data-state": getSelectedState(isSelected),
|
|
3901
3596
|
...rest,
|
|
3902
|
-
children:
|
|
3597
|
+
children: computedChildren
|
|
3903
3598
|
}
|
|
3904
|
-
);
|
|
3905
|
-
});
|
|
3906
|
-
const
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
const
|
|
3910
|
-
|
|
3911
|
-
});
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
const
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
});
|
|
3925
|
-
|
|
3926
|
-
const MenuPageTriggerItem = memo((props) => {
|
|
3927
|
-
const { ref, children, page, onSelect, ...rest } = props;
|
|
3928
|
-
const { page: activePage, setPage } = use(MenuPageContext);
|
|
3929
|
-
const isActive = page === activePage;
|
|
3930
|
-
const handleSelect = useCallback(
|
|
3931
|
-
(e) => {
|
|
3932
|
-
onSelect == null ? void 0 : onSelect(e);
|
|
3933
|
-
if (e.defaultPrevented) return;
|
|
3934
|
-
setPage(page);
|
|
3935
|
-
},
|
|
3936
|
-
[onSelect, page, setPage]
|
|
3937
|
-
);
|
|
3938
|
-
return /* @__PURE__ */ jsx(MenuItem, { ref, onSelect: handleSelect, "data-state": getActiveState(isActive), ...rest, children: /* @__PURE__ */ jsx(SelectedIndicatorContext, { value: isActive, children }) });
|
|
3939
|
-
});
|
|
3940
|
-
MenuPageTriggerItem.displayName = "CommandMenuPageTriggerItem";
|
|
3941
|
-
const computeNextIndex = (index, length, direction, loop) => {
|
|
3942
|
-
switch (direction) {
|
|
3943
|
-
case "next":
|
|
3944
|
-
return index === length - 1 ? loop ? 0 : index : index + 1;
|
|
3945
|
-
case "prev":
|
|
3946
|
-
return index === 0 ? loop ? length - 1 : index : index - 1;
|
|
3947
|
-
}
|
|
3948
|
-
};
|
|
3949
|
-
const MenuRoot = memo((props) => {
|
|
3950
|
-
const providerContext = useProvider();
|
|
3951
|
-
const {
|
|
3952
|
-
ref,
|
|
3953
|
-
children,
|
|
3954
|
-
className,
|
|
3955
|
-
onKeyDown,
|
|
3956
|
-
loop = false,
|
|
3957
|
-
// style props
|
|
3958
|
-
radius = providerContext.radius,
|
|
3959
|
-
accentColor = "base",
|
|
3960
|
-
size: size2 = "md",
|
|
3961
|
-
variant = "soft",
|
|
3962
|
-
...rest
|
|
3963
|
-
} = props;
|
|
3964
|
-
const internalRef = useRef(null);
|
|
3965
|
-
const [activeItemId, setActiveItemId] = useState(null);
|
|
3966
|
-
const getItems = useCallback((element) => {
|
|
3967
|
-
return Array.from(element.querySelectorAll(`[${ITEM_SELECTOR}]:not([data-disabled=true]`));
|
|
3968
|
-
}, []);
|
|
3969
|
-
const getFirstItem = useCallback(
|
|
3970
|
-
(element) => {
|
|
3971
|
-
return getItems(element).at(0);
|
|
3972
|
-
},
|
|
3973
|
-
[getItems]
|
|
3974
|
-
);
|
|
3975
|
-
const getLastItem = useCallback(
|
|
3976
|
-
(element) => {
|
|
3977
|
-
return getItems(element).at(-1);
|
|
3978
|
-
},
|
|
3979
|
-
[getItems]
|
|
3980
|
-
);
|
|
3981
|
-
const getActiveItem = useCallback(
|
|
3982
|
-
(element) => {
|
|
3983
|
-
return getItems(element).find((itemEle) => itemEle.getAttribute(ITEM_SELECTOR) === activeItemId);
|
|
3984
|
-
},
|
|
3985
|
-
[activeItemId, getItems]
|
|
3986
|
-
);
|
|
3987
|
-
const getNextItem = useCallback(
|
|
3988
|
-
(element, direction) => {
|
|
3989
|
-
const items = getItems(element);
|
|
3990
|
-
const activeItem = getActiveItem(element);
|
|
3991
|
-
const activeItemIndex = items.findIndex((itemEle) => itemEle === activeItem);
|
|
3992
|
-
const nextItemIndex = computeNextIndex(activeItemIndex, items.length, direction, loop);
|
|
3993
|
-
return items[nextItemIndex];
|
|
3994
|
-
},
|
|
3995
|
-
[getActiveItem, getItems, loop]
|
|
3996
|
-
);
|
|
3997
|
-
const getGroups = useCallback(() => {
|
|
3998
|
-
if (!internalRef.current) return [];
|
|
3999
|
-
return Array.from(internalRef.current.querySelectorAll(`[${GROUP_SELECTOR}]`));
|
|
4000
|
-
}, []);
|
|
4001
|
-
const getActiveGroup = useCallback(() => {
|
|
3599
|
+
) });
|
|
3600
|
+
});
|
|
3601
|
+
const PagesContext = createContext({});
|
|
3602
|
+
const usePagesContext = () => useContext(PagesContext);
|
|
3603
|
+
const MenuPages = memo((props) => {
|
|
3604
|
+
const { children, defaultPage, page, onPageChange } = props;
|
|
3605
|
+
const [activePage, setActivePage] = useControlledState(defaultPage ?? "", page, onPageChange);
|
|
3606
|
+
const contextValue = useMemo(() => ({ activePage, setActivePage }), [activePage, setActivePage]);
|
|
3607
|
+
return /* @__PURE__ */ jsx(PagesContext.Provider, { value: contextValue, children });
|
|
3608
|
+
});
|
|
3609
|
+
MenuPages.displayName = "MenuPages";
|
|
3610
|
+
const MenuPageContent = (props) => {
|
|
3611
|
+
const { page, children } = props;
|
|
3612
|
+
const { activePage } = usePagesContext();
|
|
3613
|
+
return activePage === page ? children : null;
|
|
3614
|
+
};
|
|
3615
|
+
MenuPageContent.displayName = "PageContent";
|
|
3616
|
+
const MenuPageTrigger = memo((props) => {
|
|
3617
|
+
const { ref, onSelect, page, ...rest } = props;
|
|
3618
|
+
const { refs, setActiveIndex } = useMenuContentContext();
|
|
3619
|
+
const { setActivePage } = usePagesContext();
|
|
3620
|
+
const handleSelect = useCallback(() => {
|
|
4002
3621
|
var _a;
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
(
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
[getActiveGroup, getGroups, loop]
|
|
4014
|
-
);
|
|
4015
|
-
const getFirstGroup = useCallback(() => {
|
|
4016
|
-
return getGroups().at(0);
|
|
4017
|
-
}, [getGroups]);
|
|
4018
|
-
const getLastGroup = useCallback(() => {
|
|
4019
|
-
return getGroups().at(-1);
|
|
4020
|
-
}, [getGroups]);
|
|
4021
|
-
const handleKeyDown = useCallback(
|
|
4022
|
-
(e) => {
|
|
4023
|
-
onKeyDown == null ? void 0 : onKeyDown(e);
|
|
4024
|
-
if (e.defaultPrevented) return;
|
|
4025
|
-
switch (e.code) {
|
|
4026
|
-
case KEY_MAPPING.selectItem: {
|
|
4027
|
-
const activeItem = getActiveItem(internalRef.current);
|
|
4028
|
-
if (activeItem) activeItem.dispatchEvent(new Event("menu-select"));
|
|
4029
|
-
break;
|
|
4030
|
-
}
|
|
4031
|
-
case KEY_MAPPING.next: {
|
|
4032
|
-
let nextItem;
|
|
4033
|
-
if (e.shiftKey) {
|
|
4034
|
-
const nextGroup = getNextGroup("next");
|
|
4035
|
-
if (!nextGroup) return;
|
|
4036
|
-
nextItem = getFirstItem(nextGroup);
|
|
4037
|
-
} else {
|
|
4038
|
-
nextItem = getNextItem(internalRef.current, "next");
|
|
4039
|
-
}
|
|
4040
|
-
if (!nextItem) return;
|
|
4041
|
-
setActiveItemId(nextItem.getAttribute(ITEM_SELECTOR));
|
|
4042
|
-
break;
|
|
4043
|
-
}
|
|
4044
|
-
case KEY_MAPPING.prev: {
|
|
4045
|
-
let prevItem;
|
|
4046
|
-
if (e.shiftKey) {
|
|
4047
|
-
const prevGroup = getNextGroup("prev");
|
|
4048
|
-
if (!prevGroup) return;
|
|
4049
|
-
prevItem = getFirstItem(prevGroup);
|
|
4050
|
-
} else {
|
|
4051
|
-
prevItem = getNextItem(internalRef.current, "prev");
|
|
4052
|
-
}
|
|
4053
|
-
if (!prevItem) return;
|
|
4054
|
-
setActiveItemId(prevItem.getAttribute(ITEM_SELECTOR));
|
|
4055
|
-
break;
|
|
4056
|
-
}
|
|
4057
|
-
case KEY_MAPPING.first: {
|
|
4058
|
-
let firstItem;
|
|
4059
|
-
if (e.shiftKey) {
|
|
4060
|
-
const firstGroup = getFirstGroup();
|
|
4061
|
-
if (!firstGroup) return;
|
|
4062
|
-
firstItem = getFirstItem(firstGroup);
|
|
4063
|
-
} else {
|
|
4064
|
-
firstItem = getFirstItem(internalRef.current);
|
|
4065
|
-
}
|
|
4066
|
-
if (!firstItem) return;
|
|
4067
|
-
setActiveItemId(firstItem.getAttribute(ITEM_SELECTOR));
|
|
4068
|
-
break;
|
|
4069
|
-
}
|
|
4070
|
-
case KEY_MAPPING.last: {
|
|
4071
|
-
let lastItem;
|
|
4072
|
-
if (e.shiftKey) {
|
|
4073
|
-
const lastGroup = getLastGroup();
|
|
4074
|
-
if (!lastGroup) return;
|
|
4075
|
-
lastItem = getFirstItem(lastGroup);
|
|
4076
|
-
} else {
|
|
4077
|
-
lastItem = getLastItem(internalRef.current);
|
|
4078
|
-
}
|
|
4079
|
-
if (!lastItem) return;
|
|
4080
|
-
setActiveItemId(lastItem.getAttribute(ITEM_SELECTOR));
|
|
4081
|
-
break;
|
|
4082
|
-
}
|
|
4083
|
-
}
|
|
4084
|
-
},
|
|
4085
|
-
[getActiveItem, getFirstGroup, getFirstItem, getLastGroup, getLastItem, getNextGroup, getNextItem, onKeyDown]
|
|
4086
|
-
);
|
|
4087
|
-
useEffect(() => {
|
|
4088
|
-
const firstItem = getFirstItem(internalRef.current);
|
|
4089
|
-
if (!firstItem) return;
|
|
4090
|
-
setActiveItemId(firstItem.getAttribute(ITEM_SELECTOR));
|
|
4091
|
-
}, [getFirstItem]);
|
|
4092
|
-
const contextValue = useMemo(
|
|
4093
|
-
() => ({
|
|
4094
|
-
activeItemId,
|
|
4095
|
-
setActiveItemId,
|
|
4096
|
-
// style props
|
|
4097
|
-
accentColor,
|
|
4098
|
-
radius,
|
|
4099
|
-
variant,
|
|
4100
|
-
size: size2
|
|
4101
|
-
}),
|
|
4102
|
-
[accentColor, activeItemId, radius, size2, variant]
|
|
4103
|
-
);
|
|
3622
|
+
onSelect == null ? void 0 : onSelect();
|
|
3623
|
+
setActivePage(page);
|
|
3624
|
+
(_a = refs.floating.current) == null ? void 0 : _a.focus();
|
|
3625
|
+
setActiveIndex(null);
|
|
3626
|
+
}, [onSelect, page, refs.floating, setActiveIndex, setActivePage]);
|
|
3627
|
+
return /* @__PURE__ */ jsx(MenuItem, { ref, onSelect: handleSelect, closeOnSelect: false, ...rest });
|
|
3628
|
+
});
|
|
3629
|
+
MenuPageTrigger.displayName = "MenuPageTrigger";
|
|
3630
|
+
const MenuScroll = memo((props) => {
|
|
3631
|
+
const { ref, className, ...rest } = props;
|
|
4104
3632
|
return /* @__PURE__ */ jsx(
|
|
4105
3633
|
"div",
|
|
4106
3634
|
{
|
|
4107
|
-
ref
|
|
4108
|
-
className: cx(
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
"data-accent-color": accentColor,
|
|
4114
|
-
...rest,
|
|
4115
|
-
children: /* @__PURE__ */ jsx(MenuRootContext, { value: contextValue, children })
|
|
3635
|
+
ref,
|
|
3636
|
+
className: cx(
|
|
3637
|
+
"h-full overflow-x-hidden overflow-y-auto [scrollbar-color:var(--base-6)_transparent] [scrollbar-width:thin]",
|
|
3638
|
+
className
|
|
3639
|
+
),
|
|
3640
|
+
...rest
|
|
4116
3641
|
}
|
|
4117
3642
|
);
|
|
4118
3643
|
});
|
|
4119
|
-
|
|
4120
|
-
const
|
|
4121
|
-
const { ref, children, ...rest } = props;
|
|
4122
|
-
|
|
3644
|
+
MenuScroll.displayName = "MenuScroll";
|
|
3645
|
+
const MenuSelectAllItem = genericMemo((props) => {
|
|
3646
|
+
const { ref, children, onSelect, closeOnSelect = false, ...rest } = props;
|
|
3647
|
+
const { allSelected, someSelected, toggleSelectAll } = use(MultiSelectContext);
|
|
3648
|
+
const selectedState = allSelected ? true : someSelected ? "indeterminate" : false;
|
|
3649
|
+
const handleSelect = useCallback(() => {
|
|
3650
|
+
onSelect == null ? void 0 : onSelect();
|
|
3651
|
+
toggleSelectAll();
|
|
3652
|
+
}, [onSelect, toggleSelectAll]);
|
|
3653
|
+
const computedChildren = useMemo(() => {
|
|
3654
|
+
return typeof children === "function" ? ({ active }) => children({ selected: selectedState, active }) : children;
|
|
3655
|
+
}, [children, selectedState]);
|
|
3656
|
+
return /* @__PURE__ */ jsx(CheckedIndicatorContext, { value: selectedState, children: /* @__PURE__ */ jsx(
|
|
3657
|
+
MenuItem,
|
|
3658
|
+
{
|
|
3659
|
+
onSelect: handleSelect,
|
|
3660
|
+
ref,
|
|
3661
|
+
"data-state": getCheckedState(selectedState),
|
|
3662
|
+
closeOnSelect,
|
|
3663
|
+
...rest,
|
|
3664
|
+
children: computedChildren
|
|
3665
|
+
}
|
|
3666
|
+
) });
|
|
4123
3667
|
});
|
|
4124
|
-
|
|
4125
|
-
const MenuSelectGroup = genericMemo(function MenuSelectGroup22(props) {
|
|
3668
|
+
const MenuSelectGroup = genericMemo(function MenuSelectGroup2(props) {
|
|
4126
3669
|
const { ref, children, required, defaultValue, value, onValueChange, ...rest } = props;
|
|
4127
3670
|
return /* @__PURE__ */ jsx(MenuGroup, { ref, ...rest, children: required ? /* @__PURE__ */ jsx(SingleSelectRequiredProvider, { defaultValue, value, onValueChange, children }) : /* @__PURE__ */ jsx(
|
|
4128
3671
|
SingleSelectNotRequiredProvider,
|
|
@@ -4135,52 +3678,182 @@ const MenuSelectGroup = genericMemo(function MenuSelectGroup22(props) {
|
|
|
4135
3678
|
) });
|
|
4136
3679
|
});
|
|
4137
3680
|
const MenuSelectItem = genericMemo(function(props) {
|
|
4138
|
-
const { ref, value, onSelect, children, ...rest } = props;
|
|
3681
|
+
const { ref, value, onSelect, children, closeOnSelect = true, ...rest } = props;
|
|
4139
3682
|
const { selected, selectValue } = use(SelectContext);
|
|
4140
|
-
const isSelected = selected(value);
|
|
4141
|
-
const handleSelect = useCallback(
|
|
4142
|
-
(
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
},
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
return /* @__PURE__ */ jsx(
|
|
3683
|
+
const isSelected = useMemo(() => selected(value), [selected, value]);
|
|
3684
|
+
const handleSelect = useCallback(() => {
|
|
3685
|
+
onSelect == null ? void 0 : onSelect();
|
|
3686
|
+
selectValue(value);
|
|
3687
|
+
}, [onSelect, selectValue, value]);
|
|
3688
|
+
const computedChildren = useMemo(() => {
|
|
3689
|
+
return typeof children === "function" ? ({ active }) => children({ selected: isSelected, active }) : children;
|
|
3690
|
+
}, [children, isSelected]);
|
|
3691
|
+
return /* @__PURE__ */ jsx(SelectedIndicatorContext.Provider, { value: isSelected, children: /* @__PURE__ */ jsx(
|
|
4150
3692
|
MenuItem,
|
|
4151
3693
|
{
|
|
4152
3694
|
ref,
|
|
4153
3695
|
role: "menuitemcheckbox",
|
|
4154
3696
|
onSelect: handleSelect,
|
|
3697
|
+
closeOnSelect,
|
|
4155
3698
|
"data-state": getSelectedState(isSelected),
|
|
4156
3699
|
...rest,
|
|
4157
|
-
children:
|
|
3700
|
+
children: computedChildren
|
|
4158
3701
|
}
|
|
4159
|
-
);
|
|
3702
|
+
) });
|
|
4160
3703
|
});
|
|
4161
3704
|
const MenuSeparator = memo((props) => {
|
|
4162
3705
|
const { ref, className, ...rest } = props;
|
|
4163
|
-
const { size: size2 } =
|
|
4164
|
-
return /* @__PURE__ */ jsx(RadixSeparator.Root, { className: cx(
|
|
3706
|
+
const { size: size2 } = useMenuContentContext();
|
|
3707
|
+
return /* @__PURE__ */ jsx(RadixSeparator.Root, { className: cx(menuSeparator({ size: size2 }), className), ref, ...rest });
|
|
4165
3708
|
});
|
|
4166
3709
|
MenuSeparator.displayName = "MenuSeparator";
|
|
4167
|
-
const
|
|
3710
|
+
const MenuSubContent = memo((props) => {
|
|
3711
|
+
var _a;
|
|
3712
|
+
const { ref: forwardedRef, children, ...rest } = props;
|
|
3713
|
+
const { middlewareData } = useMenuContext();
|
|
3714
|
+
const { accentColor, radius, variant, size: size2 } = useMenuContentContext();
|
|
3715
|
+
const {
|
|
3716
|
+
open,
|
|
3717
|
+
nodeId,
|
|
3718
|
+
refs,
|
|
3719
|
+
context,
|
|
3720
|
+
getFloatingProps,
|
|
3721
|
+
getItemProps,
|
|
3722
|
+
activeIndex,
|
|
3723
|
+
setActiveIndex,
|
|
3724
|
+
elementsRef,
|
|
3725
|
+
floatingStyles,
|
|
3726
|
+
setOpen,
|
|
3727
|
+
side
|
|
3728
|
+
} = useSubContext();
|
|
3729
|
+
const wrapperRef = useRef(null);
|
|
3730
|
+
const mergeRefs2 = useMergeRefs([refs.setFloating, wrapperRef]);
|
|
3731
|
+
const computedFloatingStyles = useMemo(() => {
|
|
3732
|
+
var _a2;
|
|
3733
|
+
return {
|
|
3734
|
+
...floatingStyles,
|
|
3735
|
+
visibility: ((_a2 = middlewareData.hide) == null ? void 0 : _a2.referenceHidden) ? "hidden" : "visible"
|
|
3736
|
+
};
|
|
3737
|
+
}, [floatingStyles, (_a = middlewareData.hide) == null ? void 0 : _a.referenceHidden]);
|
|
3738
|
+
return /* @__PURE__ */ jsx(FloatingNode, { id: nodeId, children: open && /* @__PURE__ */ jsx(FloatingPortal, { children: /* @__PURE__ */ jsx(FloatingFocusManager, { context, initialFocus: wrapperRef, children: /* @__PURE__ */ jsx(FloatingList, { elementsRef, children: /* @__PURE__ */ jsx(
|
|
3739
|
+
MenuContentContext.Provider,
|
|
3740
|
+
{
|
|
3741
|
+
value: {
|
|
3742
|
+
getItemProps,
|
|
3743
|
+
activeIndex,
|
|
3744
|
+
setActiveIndex,
|
|
3745
|
+
elementsRef,
|
|
3746
|
+
open,
|
|
3747
|
+
setOpen,
|
|
3748
|
+
refs,
|
|
3749
|
+
size: size2,
|
|
3750
|
+
radius,
|
|
3751
|
+
accentColor,
|
|
3752
|
+
variant
|
|
3753
|
+
},
|
|
3754
|
+
children: /* @__PURE__ */ jsx(
|
|
3755
|
+
"div",
|
|
3756
|
+
{
|
|
3757
|
+
className: "outline-none",
|
|
3758
|
+
ref: mergeRefs2,
|
|
3759
|
+
style: computedFloatingStyles,
|
|
3760
|
+
...getFloatingProps(),
|
|
3761
|
+
children: /* @__PURE__ */ jsx(
|
|
3762
|
+
"ul",
|
|
3763
|
+
{
|
|
3764
|
+
className: cx(
|
|
3765
|
+
"overmap-menu-sub-content",
|
|
3766
|
+
menuContent({ size: size2 }),
|
|
3767
|
+
floating({ side, shadow: "3" }),
|
|
3768
|
+
radiusCva({ radius, maxLarge: true }),
|
|
3769
|
+
"max-h-(--overmap-menu-available-height)"
|
|
3770
|
+
),
|
|
3771
|
+
ref: forwardedRef,
|
|
3772
|
+
"data-state": getOpenState(open),
|
|
3773
|
+
"data-side": side,
|
|
3774
|
+
"data-accent-color": accentColor,
|
|
3775
|
+
...rest,
|
|
3776
|
+
children
|
|
3777
|
+
}
|
|
3778
|
+
)
|
|
3779
|
+
}
|
|
3780
|
+
)
|
|
3781
|
+
}
|
|
3782
|
+
) }) }) }) });
|
|
3783
|
+
});
|
|
3784
|
+
MenuSubContent.displayName = "MenuSubContent";
|
|
3785
|
+
const MenuSubTrigger = memo((props) => {
|
|
3786
|
+
const { ref: forwardedRef, children, ...rest } = props;
|
|
3787
|
+
const { refs, getReferenceProps, open, disabled } = useSubContext();
|
|
3788
|
+
const mergedRefs = useMergeRefs([forwardedRef, refs.setReference]);
|
|
3789
|
+
return /* @__PURE__ */ jsx(
|
|
3790
|
+
MenuItem,
|
|
3791
|
+
{
|
|
3792
|
+
ref: mergedRefs,
|
|
3793
|
+
closeOnSelect: false,
|
|
3794
|
+
"aria-haspopup": "menu",
|
|
3795
|
+
"data-state": getOpenState(open),
|
|
3796
|
+
disabled,
|
|
3797
|
+
...getReferenceProps(rest),
|
|
3798
|
+
children
|
|
3799
|
+
}
|
|
3800
|
+
);
|
|
3801
|
+
});
|
|
3802
|
+
MenuSubTrigger.displayName = "MenuSubTrigger";
|
|
3803
|
+
const MenuVirtualTrigger = memo((props) => {
|
|
3804
|
+
const { virtualElement, disabled } = props;
|
|
3805
|
+
const { refs, setTriggerType, setOpen } = useMenuContext();
|
|
3806
|
+
useEffect(() => {
|
|
3807
|
+
setTriggerType("virtual");
|
|
3808
|
+
}, [setTriggerType]);
|
|
3809
|
+
useEffect(() => {
|
|
3810
|
+
if (!disabled && virtualElement) {
|
|
3811
|
+
refs.setPositionReference(virtualElement);
|
|
3812
|
+
setOpen(true);
|
|
3813
|
+
} else {
|
|
3814
|
+
refs.setPositionReference(null);
|
|
3815
|
+
setOpen(false);
|
|
3816
|
+
}
|
|
3817
|
+
}, [disabled, refs, setOpen, virtualElement]);
|
|
3818
|
+
return null;
|
|
3819
|
+
});
|
|
3820
|
+
MenuVirtualTrigger.displayName = "VirtualTrigger";
|
|
3821
|
+
const Menu = {
|
|
4168
3822
|
Root: MenuRoot,
|
|
3823
|
+
Content: MenuContent,
|
|
3824
|
+
// sub
|
|
3825
|
+
Sub: MenuSub,
|
|
3826
|
+
SubContent: MenuSubContent,
|
|
3827
|
+
SubTrigger: MenuSubTrigger,
|
|
3828
|
+
// pages
|
|
3829
|
+
Pages: MenuPages,
|
|
3830
|
+
PageContent: MenuPageContent,
|
|
3831
|
+
PageTrigger: MenuPageTrigger,
|
|
3832
|
+
// triggers
|
|
3833
|
+
ClickTrigger: MenuClickTrigger,
|
|
3834
|
+
ContextTrigger: MenuContextTrigger,
|
|
3835
|
+
VirtualTrigger: MenuVirtualTrigger,
|
|
3836
|
+
// groups
|
|
4169
3837
|
Group: MenuGroup,
|
|
4170
|
-
GroupLabel: MenuGroupLabel,
|
|
4171
|
-
Item: MenuItem,
|
|
4172
|
-
Separator: MenuSeparator,
|
|
4173
3838
|
SelectGroup: MenuSelectGroup,
|
|
4174
|
-
SelectItem: MenuSelectItem,
|
|
4175
3839
|
MultiSelectGroup: MenuMultiSelectGroup,
|
|
3840
|
+
// items
|
|
3841
|
+
Item: MenuItem,
|
|
3842
|
+
SelectItem: MenuSelectItem,
|
|
4176
3843
|
MultiSelectItem: MenuMultiSelectItem,
|
|
4177
3844
|
SelectAllItem: MenuSelectAllItem,
|
|
4178
|
-
SelectedIndicator: MenuSelectedIndicator,
|
|
4179
3845
|
CheckboxItem: MenuCheckboxItem,
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
3846
|
+
// indicators
|
|
3847
|
+
SelectedIndicator: MenuSelectedIndicator,
|
|
3848
|
+
CheckboxItemIndicator: MenuCheckboxItemIndicator,
|
|
3849
|
+
// input
|
|
3850
|
+
InputRoot: MenuInputRoot,
|
|
3851
|
+
InputField: MenuInputField,
|
|
3852
|
+
InputSlot: MenuInputSlot,
|
|
3853
|
+
// others
|
|
3854
|
+
Label: MenuLabel,
|
|
3855
|
+
Separator: MenuSeparator,
|
|
3856
|
+
Scroll: MenuScroll
|
|
4184
3857
|
};
|
|
4185
3858
|
const OneTimePasswordFieldHiddenInput = memo((props) => {
|
|
4186
3859
|
return /* @__PURE__ */ jsx(RadixOneTimePasswordField.HiddenInput, { ...props });
|
|
@@ -4281,6 +3954,62 @@ const OneTimePasswordField = {
|
|
|
4281
3954
|
Input: OneTimePasswordFieldInput,
|
|
4282
3955
|
Root: OneTimePasswordFieldRoot
|
|
4283
3956
|
};
|
|
3957
|
+
const OverlayClose = memo((props) => {
|
|
3958
|
+
const { ref, ...rest } = props;
|
|
3959
|
+
return /* @__PURE__ */ jsx(RadixDialog.Close, { ref, ...rest });
|
|
3960
|
+
});
|
|
3961
|
+
OverlayClose.displayName = "OverlayClose";
|
|
3962
|
+
const overlayContentCva = cva([
|
|
3963
|
+
"fixed",
|
|
3964
|
+
"inset-0",
|
|
3965
|
+
"bg-(--color-background)",
|
|
3966
|
+
"data-[state='closed']:animate-out",
|
|
3967
|
+
"data-[state='closed']:fade-out-0",
|
|
3968
|
+
"data-[state='closed']:zoom-out-95",
|
|
3969
|
+
"data-[state='open']:animate-in",
|
|
3970
|
+
"data-[state='open']:fade-in-0",
|
|
3971
|
+
"data-[state='open']:zoom-in-95"
|
|
3972
|
+
]);
|
|
3973
|
+
const OverlayContent = memo((props) => {
|
|
3974
|
+
const { ref, container, className, ...rest } = props;
|
|
3975
|
+
return /* @__PURE__ */ jsx(RadixDialog.Portal, { container, children: /* @__PURE__ */ jsx(
|
|
3976
|
+
RadixDialog.Content,
|
|
3977
|
+
{
|
|
3978
|
+
className: cx(overlayContentCva(), className),
|
|
3979
|
+
ref,
|
|
3980
|
+
"data-floating-content": "",
|
|
3981
|
+
...rest
|
|
3982
|
+
}
|
|
3983
|
+
) });
|
|
3984
|
+
});
|
|
3985
|
+
OverlayContent.displayName = "OverlayContent";
|
|
3986
|
+
const OverlayDescription = memo((props) => {
|
|
3987
|
+
const { ref, ...rest } = props;
|
|
3988
|
+
return /* @__PURE__ */ jsx(RadixDialog.Description, { ref, ...rest });
|
|
3989
|
+
});
|
|
3990
|
+
OverlayDescription.displayName = "OverlayDescription";
|
|
3991
|
+
const OverlayRoot = memo((props) => {
|
|
3992
|
+
return /* @__PURE__ */ jsx(RadixDialog.Root, { ...props });
|
|
3993
|
+
});
|
|
3994
|
+
OverlayRoot.displayName = "OverlayRoot";
|
|
3995
|
+
const OverlayTitle = memo((props) => {
|
|
3996
|
+
const { ref, ...rest } = props;
|
|
3997
|
+
return /* @__PURE__ */ jsx(RadixDialog.Title, { ref, ...rest });
|
|
3998
|
+
});
|
|
3999
|
+
OverlayTitle.displayName = "OverlayTitle";
|
|
4000
|
+
const OverlayTrigger = memo((props) => {
|
|
4001
|
+
const { ref, ...rest } = props;
|
|
4002
|
+
return /* @__PURE__ */ jsx(RadixDialog.Trigger, { ref, ...rest });
|
|
4003
|
+
});
|
|
4004
|
+
OverlayTrigger.displayName = "OverlayTrigger";
|
|
4005
|
+
const Overlay = {
|
|
4006
|
+
Root: OverlayRoot,
|
|
4007
|
+
Content: OverlayContent,
|
|
4008
|
+
Title: OverlayTitle,
|
|
4009
|
+
Description: OverlayDescription,
|
|
4010
|
+
Trigger: OverlayTrigger,
|
|
4011
|
+
Close: OverlayClose
|
|
4012
|
+
};
|
|
4284
4013
|
const centerStyles = { placeSelf: "center" };
|
|
4285
4014
|
const ErrorFallback = memo((props) => {
|
|
4286
4015
|
const { absoluteCentering, message = "Something went wrong", onRetry } = props;
|
|
@@ -6421,6 +6150,7 @@ export {
|
|
|
6421
6150
|
CheckboxGroupSelectAllItem,
|
|
6422
6151
|
CheckboxIndicator,
|
|
6423
6152
|
CheckboxRoot,
|
|
6153
|
+
CollapsibleTree,
|
|
6424
6154
|
CommandMenu,
|
|
6425
6155
|
CommandMenuCheckboxIndicator,
|
|
6426
6156
|
CommandMenuCheckboxItem,
|
|
@@ -6469,38 +6199,44 @@ export {
|
|
|
6469
6199
|
Link,
|
|
6470
6200
|
LuIcon,
|
|
6471
6201
|
Menu,
|
|
6472
|
-
MenuCheckboxItem
|
|
6202
|
+
MenuCheckboxItem,
|
|
6473
6203
|
MenuCheckboxItemIndicator,
|
|
6474
6204
|
MenuClickTrigger,
|
|
6475
6205
|
MenuContent,
|
|
6476
6206
|
MenuContextTrigger,
|
|
6477
|
-
MenuGroup
|
|
6207
|
+
MenuGroup,
|
|
6478
6208
|
MenuInputField,
|
|
6479
6209
|
MenuInputRoot,
|
|
6480
6210
|
MenuInputSlot,
|
|
6481
|
-
MenuItem
|
|
6211
|
+
MenuItem,
|
|
6482
6212
|
MenuLabel,
|
|
6483
|
-
MenuMultiSelectGroup
|
|
6484
|
-
MenuMultiSelectItem
|
|
6213
|
+
MenuMultiSelectGroup,
|
|
6214
|
+
MenuMultiSelectItem,
|
|
6485
6215
|
MenuPageContent,
|
|
6486
6216
|
MenuPageTrigger,
|
|
6487
|
-
MenuPages
|
|
6488
|
-
MenuRoot
|
|
6217
|
+
MenuPages,
|
|
6218
|
+
MenuRoot,
|
|
6489
6219
|
MenuScroll,
|
|
6490
|
-
MenuSelectAllItem
|
|
6491
|
-
MenuSelectGroup
|
|
6492
|
-
MenuSelectItem
|
|
6493
|
-
MenuSelectedIndicator
|
|
6494
|
-
MenuSeparator
|
|
6220
|
+
MenuSelectAllItem,
|
|
6221
|
+
MenuSelectGroup,
|
|
6222
|
+
MenuSelectItem,
|
|
6223
|
+
MenuSelectedIndicator,
|
|
6224
|
+
MenuSeparator,
|
|
6495
6225
|
MenuSub,
|
|
6496
6226
|
MenuSubContent,
|
|
6497
6227
|
MenuSubTrigger,
|
|
6498
|
-
MenuV2,
|
|
6499
6228
|
MenuVirtualTrigger,
|
|
6500
6229
|
OneTimePasswordField,
|
|
6501
6230
|
OneTimePasswordFieldHiddenInput,
|
|
6502
6231
|
OneTimePasswordFieldInput,
|
|
6503
6232
|
OneTimePasswordFieldRoot,
|
|
6233
|
+
Overlay,
|
|
6234
|
+
OverlayClose,
|
|
6235
|
+
OverlayContent,
|
|
6236
|
+
OverlayDescription,
|
|
6237
|
+
OverlayRoot,
|
|
6238
|
+
OverlayTitle,
|
|
6239
|
+
OverlayTrigger,
|
|
6504
6240
|
OvermapErrorBoundary,
|
|
6505
6241
|
Popover,
|
|
6506
6242
|
PopoverArrow,
|
|
@@ -6521,6 +6257,7 @@ export {
|
|
|
6521
6257
|
SegmentedTabsList,
|
|
6522
6258
|
SegmentedTabsRoot,
|
|
6523
6259
|
SegmentedTabsTrigger,
|
|
6260
|
+
SelectedIndicatorContext,
|
|
6524
6261
|
Separator,
|
|
6525
6262
|
SlideOut,
|
|
6526
6263
|
Slider,
|
|
@@ -6557,12 +6294,6 @@ export {
|
|
|
6557
6294
|
badge,
|
|
6558
6295
|
buttonCva,
|
|
6559
6296
|
floating,
|
|
6560
|
-
genericMemo,
|
|
6561
|
-
getActiveState,
|
|
6562
|
-
getBooleanState,
|
|
6563
|
-
getCheckedState,
|
|
6564
|
-
getOpenState,
|
|
6565
|
-
getSelectedState,
|
|
6566
6297
|
mergeRefs,
|
|
6567
6298
|
radiusCva,
|
|
6568
6299
|
stopPropagation,
|
|
@@ -6570,9 +6301,15 @@ export {
|
|
|
6570
6301
|
useAlertDialog,
|
|
6571
6302
|
useButtonGroup,
|
|
6572
6303
|
useControlledState,
|
|
6573
|
-
useFallbackId,
|
|
6574
6304
|
useLayoutContext,
|
|
6305
|
+
useMenuContentContext,
|
|
6306
|
+
useMenuContext,
|
|
6307
|
+
usePagesContext,
|
|
6575
6308
|
useProvider,
|
|
6309
|
+
useSelectedIndicatorContext,
|
|
6310
|
+
useSize,
|
|
6311
|
+
useStopEventPropagation,
|
|
6312
|
+
useSubContext,
|
|
6576
6313
|
useTextFilter,
|
|
6577
6314
|
useToast,
|
|
6578
6315
|
useViewportSize
|