@dxos/react-ui 0.8.2-main.12df754 → 0.8.2-main.36232bc
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/lib/browser/index.mjs +1148 -1148
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +1097 -1097
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1148 -1148
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +2 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/package.json +13 -13
- package/src/components/Avatars/Avatar.tsx +1 -1
- package/src/components/Popover/Popover.tsx +3 -0
- package/src/components/index.ts +1 -1
|
@@ -204,7 +204,7 @@ var AvatarContent = /* @__PURE__ */ forwardRef2(({ icon, classNames, ...props },
|
|
|
204
204
|
return /* @__PURE__ */ React3.createElement(DxAvatar, {
|
|
205
205
|
...props,
|
|
206
206
|
icon: href,
|
|
207
|
-
labelId,
|
|
207
|
+
"aria-labelledby": labelId,
|
|
208
208
|
"aria-describedby": descriptionId,
|
|
209
209
|
rootClassName: mx(classNames),
|
|
210
210
|
ref: forwardedRef
|
|
@@ -881,1310 +881,1310 @@ var AlertDialog = {
|
|
|
881
881
|
Action: AlertDialogAction
|
|
882
882
|
};
|
|
883
883
|
|
|
884
|
-
// packages/ui/react-ui/src/components/
|
|
885
|
-
import
|
|
886
|
-
import {
|
|
887
|
-
import {
|
|
888
|
-
import
|
|
889
|
-
|
|
890
|
-
var
|
|
891
|
-
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
892
|
-
var ContextMenuContent = /* @__PURE__ */ forwardRef13(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
884
|
+
// packages/ui/react-ui/src/components/Input/Input.tsx
|
|
885
|
+
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
886
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
887
|
+
import React19, { forwardRef as forwardRef13, useCallback as useCallback4 } from "react";
|
|
888
|
+
import { InputRoot, PinInput as PinInputPrimitive, TextInput as TextInputPrimitive, TextArea as TextAreaPrimitive, useInputContext, INPUT_NAME, Description as DescriptionPrimitive, DescriptionAndValidation as DescriptionAndValidationPrimitive, Label as LabelPrimitive, Validation as ValidationPrimitive } from "@dxos/react-input";
|
|
889
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
890
|
+
var Label = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
893
891
|
const { tx } = useThemeContext();
|
|
894
|
-
|
|
895
|
-
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
896
|
-
return /* @__PURE__ */ React19.createElement(ContextMenuPrimitive.Content, {
|
|
892
|
+
return /* @__PURE__ */ React19.createElement(LabelPrimitive, {
|
|
897
893
|
...props,
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
elevation
|
|
894
|
+
className: tx("input.label", "input__label", {
|
|
895
|
+
srOnly
|
|
901
896
|
}, classNames),
|
|
902
897
|
ref: forwardedRef
|
|
903
898
|
}, children);
|
|
904
899
|
});
|
|
905
|
-
var
|
|
900
|
+
var Description = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
906
901
|
const { tx } = useThemeContext();
|
|
907
|
-
|
|
908
|
-
return /* @__PURE__ */ React19.createElement(Root5, {
|
|
902
|
+
return /* @__PURE__ */ React19.createElement(DescriptionPrimitive, {
|
|
909
903
|
...props,
|
|
910
|
-
className: tx("
|
|
904
|
+
className: tx("input.description", "input__description", {
|
|
905
|
+
srOnly
|
|
906
|
+
}, classNames),
|
|
911
907
|
ref: forwardedRef
|
|
912
908
|
}, children);
|
|
913
909
|
});
|
|
914
|
-
var
|
|
910
|
+
var Validation = /* @__PURE__ */ forwardRef13(({ __inputScope, srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
915
911
|
const { tx } = useThemeContext();
|
|
916
|
-
|
|
912
|
+
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
913
|
+
return /* @__PURE__ */ React19.createElement(ValidationPrimitive, {
|
|
917
914
|
...props,
|
|
918
|
-
className: tx("
|
|
915
|
+
className: tx("input.validation", `input__validation-message input__validation-message--${validationValence}`, {
|
|
916
|
+
srOnly,
|
|
917
|
+
validationValence
|
|
918
|
+
}, classNames),
|
|
919
919
|
ref: forwardedRef
|
|
920
|
-
});
|
|
920
|
+
}, children);
|
|
921
921
|
});
|
|
922
|
-
var
|
|
923
|
-
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
924
|
-
var ContextMenuItem = /* @__PURE__ */ forwardRef13(({ classNames, ...props }, forwardedRef) => {
|
|
922
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef13(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
925
923
|
const { tx } = useThemeContext();
|
|
926
|
-
return /* @__PURE__ */ React19.createElement(
|
|
924
|
+
return /* @__PURE__ */ React19.createElement(DescriptionAndValidationPrimitive, {
|
|
927
925
|
...props,
|
|
928
|
-
className: tx("
|
|
926
|
+
className: tx("input.descriptionAndValidation", "input__description-and-validation", {
|
|
927
|
+
srOnly
|
|
928
|
+
}, classNames),
|
|
929
929
|
ref: forwardedRef
|
|
930
|
-
});
|
|
930
|
+
}, children);
|
|
931
931
|
});
|
|
932
|
-
var
|
|
932
|
+
var PinInput = /* @__PURE__ */ forwardRef13(({ density: propsDensity, elevation: propsElevation, segmentClassName: propsSegmentClassName, inputClassName, variant, ...props }, forwardedRef) => {
|
|
933
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
933
934
|
const { tx } = useThemeContext();
|
|
934
|
-
|
|
935
|
+
const density = useDensityContext(propsDensity);
|
|
936
|
+
const elevation = useElevationContext(propsElevation);
|
|
937
|
+
const segmentClassName = useCallback4(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
938
|
+
variant: "static",
|
|
939
|
+
focused,
|
|
940
|
+
disabled: props.disabled,
|
|
941
|
+
density,
|
|
942
|
+
elevation,
|
|
943
|
+
validationValence
|
|
944
|
+
}, propsSegmentClassName), [
|
|
945
|
+
tx,
|
|
946
|
+
props.disabled,
|
|
947
|
+
elevation,
|
|
948
|
+
propsElevation,
|
|
949
|
+
density
|
|
950
|
+
]);
|
|
951
|
+
return /* @__PURE__ */ React19.createElement(PinInputPrimitive, {
|
|
935
952
|
...props,
|
|
936
|
-
|
|
953
|
+
segmentClassName,
|
|
954
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
955
|
+
autoFocus: true
|
|
956
|
+
},
|
|
957
|
+
inputClassName: tx("input.inputWithSegments", "input input--pin", {
|
|
958
|
+
disabled: props.disabled
|
|
959
|
+
}, inputClassName),
|
|
937
960
|
ref: forwardedRef
|
|
938
961
|
});
|
|
939
962
|
});
|
|
940
|
-
var
|
|
941
|
-
const {
|
|
942
|
-
|
|
963
|
+
var TextInput = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
964
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
965
|
+
const themeContextValue = useThemeContext();
|
|
966
|
+
const density = useDensityContext(propsDensity);
|
|
967
|
+
const elevation = useElevationContext(propsElevation);
|
|
968
|
+
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
969
|
+
const { tx } = themeContextValue;
|
|
970
|
+
return /* @__PURE__ */ React19.createElement(TextInputPrimitive, {
|
|
943
971
|
...props,
|
|
944
|
-
className: tx("
|
|
972
|
+
className: tx("input.input", "input", {
|
|
973
|
+
variant,
|
|
974
|
+
disabled: props.disabled,
|
|
975
|
+
density,
|
|
976
|
+
elevation,
|
|
977
|
+
validationValence
|
|
978
|
+
}, classNames),
|
|
979
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
980
|
+
autoFocus: true
|
|
981
|
+
},
|
|
945
982
|
ref: forwardedRef
|
|
946
983
|
});
|
|
947
984
|
});
|
|
948
|
-
var
|
|
985
|
+
var TextArea = /* @__PURE__ */ forwardRef13(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
986
|
+
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
949
987
|
const { tx } = useThemeContext();
|
|
950
|
-
|
|
988
|
+
const density = useDensityContext(propsDensity);
|
|
989
|
+
const elevation = useElevationContext(propsElevation);
|
|
990
|
+
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
991
|
+
return /* @__PURE__ */ React19.createElement(TextAreaPrimitive, {
|
|
951
992
|
...props,
|
|
952
|
-
className: tx("
|
|
993
|
+
className: tx("input.input", "input--text-area", {
|
|
994
|
+
variant,
|
|
995
|
+
disabled: props.disabled,
|
|
996
|
+
density,
|
|
997
|
+
elevation,
|
|
998
|
+
validationValence
|
|
999
|
+
}, classNames),
|
|
1000
|
+
...props.autoFocus && !hasIosKeyboard2 && {
|
|
1001
|
+
autoFocus: true
|
|
1002
|
+
},
|
|
953
1003
|
ref: forwardedRef
|
|
954
1004
|
});
|
|
955
1005
|
});
|
|
956
|
-
var
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
Viewport: ContextMenuViewport,
|
|
962
|
-
Arrow: ContextMenuArrow,
|
|
963
|
-
Group: ContextMenuGroup,
|
|
964
|
-
Item: ContextMenuItem,
|
|
965
|
-
CheckboxItem: ContextMenuCheckboxItem,
|
|
966
|
-
ItemIndicator: ContextMenuItemIndicator,
|
|
967
|
-
Separator: ContextMenuSeparator,
|
|
968
|
-
GroupLabel: ContextMenuGroupLabel
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
// packages/ui/react-ui/src/components/Menus/DropdownMenu.tsx
|
|
972
|
-
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
973
|
-
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
974
|
-
import { createContextScope } from "@radix-ui/react-context";
|
|
975
|
-
import { useId as useId2 } from "@radix-ui/react-id";
|
|
976
|
-
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
977
|
-
import { createMenuScope } from "@radix-ui/react-menu";
|
|
978
|
-
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
979
|
-
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
980
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
981
|
-
import React20, { useRef, useCallback as useCallback4, forwardRef as forwardRef14, useEffect as useEffect3 } from "react";
|
|
982
|
-
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
983
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
984
|
-
createMenuScope
|
|
985
|
-
]);
|
|
986
|
-
var useMenuScope = createMenuScope();
|
|
987
|
-
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
988
|
-
var DropdownMenuRoot = (props) => {
|
|
989
|
-
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
990
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
991
|
-
const triggerRef = useRef(null);
|
|
992
|
-
const [open = false, setOpen] = useControllableState({
|
|
993
|
-
prop: openProp,
|
|
994
|
-
defaultProp: defaultOpen,
|
|
995
|
-
onChange: onOpenChange
|
|
1006
|
+
var Checkbox = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, weight = "bold", classNames, ...props }, forwardedRef) => {
|
|
1007
|
+
const [checked, onCheckedChange] = useControllableState({
|
|
1008
|
+
prop: propsChecked,
|
|
1009
|
+
defaultProp: propsDefaultChecked,
|
|
1010
|
+
onChange: propsOnCheckedChange
|
|
996
1011
|
});
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1019
|
-
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
1020
|
-
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
1021
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1022
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1023
|
-
asChild: true,
|
|
1024
|
-
...menuScope
|
|
1025
|
-
}, /* @__PURE__ */ React20.createElement(Primitive7.button, {
|
|
1026
|
-
type: "button",
|
|
1027
|
-
id: context.triggerId,
|
|
1028
|
-
"aria-haspopup": "menu",
|
|
1029
|
-
"aria-expanded": context.open,
|
|
1030
|
-
"aria-controls": context.open ? context.contentId : void 0,
|
|
1031
|
-
"data-state": context.open ? "open" : "closed",
|
|
1032
|
-
"data-disabled": disabled ? "" : void 0,
|
|
1033
|
-
disabled,
|
|
1034
|
-
...triggerProps,
|
|
1035
|
-
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
1036
|
-
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
1037
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
1038
|
-
context.onOpenToggle();
|
|
1039
|
-
if (!context.open) {
|
|
1040
|
-
event.preventDefault();
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
|
-
}),
|
|
1044
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
1045
|
-
if (disabled) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
if ([
|
|
1049
|
-
"Enter",
|
|
1050
|
-
" "
|
|
1051
|
-
].includes(event.key)) {
|
|
1052
|
-
context.onOpenToggle();
|
|
1053
|
-
}
|
|
1054
|
-
if (event.key === "ArrowDown") {
|
|
1055
|
-
context.onOpenChange(true);
|
|
1056
|
-
}
|
|
1057
|
-
if ([
|
|
1058
|
-
"Enter",
|
|
1059
|
-
" ",
|
|
1060
|
-
"ArrowDown"
|
|
1061
|
-
].includes(event.key)) {
|
|
1062
|
-
event.preventDefault();
|
|
1063
|
-
}
|
|
1012
|
+
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1013
|
+
const { tx } = useThemeContext();
|
|
1014
|
+
return /* @__PURE__ */ React19.createElement(CheckboxPrimitive, {
|
|
1015
|
+
...props,
|
|
1016
|
+
checked,
|
|
1017
|
+
onCheckedChange,
|
|
1018
|
+
id,
|
|
1019
|
+
"aria-describedby": descriptionId,
|
|
1020
|
+
...validationValence === "error" && {
|
|
1021
|
+
"aria-invalid": "true",
|
|
1022
|
+
"aria-errormessage": errorMessageId
|
|
1023
|
+
},
|
|
1024
|
+
className: tx("input.checkbox", "input--checkbox", {
|
|
1025
|
+
size
|
|
1026
|
+
}, "shrink-0", classNames),
|
|
1027
|
+
ref: forwardedRef
|
|
1028
|
+
}, /* @__PURE__ */ React19.createElement(Icon, {
|
|
1029
|
+
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1030
|
+
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1031
|
+
size,
|
|
1032
|
+
checked
|
|
1064
1033
|
})
|
|
1065
1034
|
}));
|
|
1066
1035
|
});
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1073
|
-
useEffect3(() => {
|
|
1074
|
-
if (virtualRef.current) {
|
|
1075
|
-
context.triggerRef.current = virtualRef.current;
|
|
1076
|
-
}
|
|
1077
|
-
});
|
|
1078
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Anchor, {
|
|
1079
|
-
...menuScope,
|
|
1080
|
-
virtualRef
|
|
1081
|
-
});
|
|
1082
|
-
};
|
|
1083
|
-
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
1084
|
-
var PORTAL_NAME = "DropdownMenuPortal";
|
|
1085
|
-
var DropdownMenuPortal = (props) => {
|
|
1086
|
-
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1087
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1088
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Portal, {
|
|
1089
|
-
...menuScope,
|
|
1090
|
-
...portalProps
|
|
1036
|
+
var Switch = /* @__PURE__ */ forwardRef13(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1037
|
+
const [checked, onCheckedChange] = useControllableState({
|
|
1038
|
+
prop: propsChecked,
|
|
1039
|
+
defaultProp: propsDefaultChecked ?? false,
|
|
1040
|
+
onChange: propsOnCheckedChange
|
|
1091
1041
|
});
|
|
1092
|
-
};
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1042
|
+
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1043
|
+
return /* @__PURE__ */ React19.createElement("input", {
|
|
1044
|
+
type: "checkbox",
|
|
1045
|
+
className: mx3("dx-checkbox--switch dx-focus-ring", classNames),
|
|
1046
|
+
checked,
|
|
1047
|
+
onChange: (event) => {
|
|
1048
|
+
onCheckedChange(event.target.checked);
|
|
1049
|
+
},
|
|
1050
|
+
id,
|
|
1051
|
+
"aria-describedby": descriptionId,
|
|
1098
1052
|
...props,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1053
|
+
...validationValence === "error" && {
|
|
1054
|
+
"aria-invalid": "true",
|
|
1055
|
+
"aria-errormessage": errorMessageId
|
|
1056
|
+
},
|
|
1057
|
+
ref: forwardedRef
|
|
1058
|
+
});
|
|
1102
1059
|
});
|
|
1103
|
-
var
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1060
|
+
var Input = {
|
|
1061
|
+
Root: InputRoot,
|
|
1062
|
+
PinInput,
|
|
1063
|
+
TextInput,
|
|
1064
|
+
TextArea,
|
|
1065
|
+
Checkbox,
|
|
1066
|
+
Switch,
|
|
1067
|
+
Label,
|
|
1068
|
+
Description,
|
|
1069
|
+
Validation,
|
|
1070
|
+
DescriptionAndValidation
|
|
1071
|
+
};
|
|
1072
|
+
|
|
1073
|
+
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1074
|
+
import { CaretDown, CaretRight } from "@phosphor-icons/react";
|
|
1075
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1076
|
+
import React21, { forwardRef as forwardRef14 } from "react";
|
|
1077
|
+
import { List as ListPrimitive, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, ListItemCollapsibleContent, ListItem as ListPrimitiveItem, LIST_NAME, LIST_ITEM_NAME, useListContext, useListItemContext } from "@dxos/react-list";
|
|
1078
|
+
|
|
1079
|
+
// packages/ui/react-ui/src/components/Lists/ListDropIndicator.tsx
|
|
1080
|
+
import React20 from "react";
|
|
1081
|
+
var edgeToOrientationMap = {
|
|
1082
|
+
top: "horizontal",
|
|
1083
|
+
bottom: "horizontal",
|
|
1084
|
+
left: "vertical",
|
|
1085
|
+
right: "vertical"
|
|
1086
|
+
};
|
|
1087
|
+
var orientationStyles = {
|
|
1088
|
+
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1089
|
+
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1090
|
+
};
|
|
1091
|
+
var edgeStyles = {
|
|
1092
|
+
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
1093
|
+
right: "right-[--line-offset] before:right-[--offset-terminal]",
|
|
1094
|
+
bottom: "bottom-[--line-offset] before:bottom-[--offset-terminal]",
|
|
1095
|
+
left: "left-[--line-offset] before:left-[--offset-terminal]"
|
|
1096
|
+
};
|
|
1097
|
+
var strokeSize = 2;
|
|
1098
|
+
var terminalSize = 8;
|
|
1099
|
+
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1100
|
+
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1101
|
+
const orientation = edgeToOrientationMap[edge];
|
|
1102
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1103
|
+
role: "none",
|
|
1137
1104
|
style: {
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
}
|
|
1105
|
+
"--line-thickness": `${strokeSize}px`,
|
|
1106
|
+
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
1107
|
+
"--line-inset": `${lineInset}px`,
|
|
1108
|
+
"--terminal-size": `${terminalSize}px`,
|
|
1109
|
+
"--terminal-radius": `${terminalSize / 2}px`,
|
|
1110
|
+
"--terminal-inset": `${terminalInset}px`,
|
|
1111
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
1112
|
+
},
|
|
1113
|
+
className: `absolute z-10 pointer-events-none bg-accentSurface before:content-[''] before:w-[--terminal-size] before:h-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`
|
|
1148
1114
|
});
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
var
|
|
1153
|
-
const {
|
|
1154
|
-
const
|
|
1155
|
-
return /* @__PURE__ */
|
|
1156
|
-
|
|
1157
|
-
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1118
|
+
var List = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1119
|
+
const { tx } = useThemeContext();
|
|
1120
|
+
const density = useDensityContext(props.density);
|
|
1121
|
+
return /* @__PURE__ */ React21.createElement(DensityProvider, {
|
|
1122
|
+
density
|
|
1123
|
+
}, /* @__PURE__ */ React21.createElement(ListPrimitive, {
|
|
1124
|
+
...props,
|
|
1125
|
+
className: tx("list.root", "list", {}, classNames),
|
|
1158
1126
|
ref: forwardedRef
|
|
1159
|
-
});
|
|
1127
|
+
}, children));
|
|
1160
1128
|
});
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1165
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1129
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef14(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
1130
|
+
const Root5 = asChild ? Slot6 : "div";
|
|
1131
|
+
const density = useDensityContext();
|
|
1166
1132
|
const { tx } = useThemeContext();
|
|
1167
|
-
return /* @__PURE__ */
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1133
|
+
return /* @__PURE__ */ React21.createElement(Root5, {
|
|
1134
|
+
...!asChild && {
|
|
1135
|
+
role: "none"
|
|
1136
|
+
},
|
|
1137
|
+
...props,
|
|
1138
|
+
className: tx("list.item.endcap", "list__listItem__endcap", {
|
|
1139
|
+
density
|
|
1140
|
+
}, classNames),
|
|
1171
1141
|
ref: forwardedRef
|
|
1142
|
+
}, children);
|
|
1143
|
+
});
|
|
1144
|
+
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
1145
|
+
const density = useDensityContext();
|
|
1146
|
+
const { tx } = useThemeContext();
|
|
1147
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1148
|
+
role: "none",
|
|
1149
|
+
...props,
|
|
1150
|
+
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
1151
|
+
density
|
|
1152
|
+
}, classNames)
|
|
1172
1153
|
});
|
|
1154
|
+
};
|
|
1155
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef14(({ children, classNames, ...props }, forwardedRef) => {
|
|
1156
|
+
const { tx } = useThemeContext();
|
|
1157
|
+
const density = useDensityContext();
|
|
1158
|
+
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemHeading, {
|
|
1159
|
+
...props,
|
|
1160
|
+
className: tx("list.item.heading", "list__listItem__heading", {
|
|
1161
|
+
density
|
|
1162
|
+
}, classNames),
|
|
1163
|
+
ref: forwardedRef
|
|
1164
|
+
}, children);
|
|
1173
1165
|
});
|
|
1174
|
-
|
|
1175
|
-
var ITEM_NAME = "DropdownMenuItem";
|
|
1176
|
-
var DropdownMenuItem = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1177
|
-
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1178
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1166
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef14(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
1179
1167
|
const { tx } = useThemeContext();
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1168
|
+
const density = useDensityContext();
|
|
1169
|
+
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1170
|
+
const Icon3 = open ? CaretDown : CaretRight;
|
|
1171
|
+
return /* @__PURE__ */ React21.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1172
|
+
...props,
|
|
1173
|
+
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
1174
|
+
density
|
|
1175
|
+
}, classNames),
|
|
1184
1176
|
ref: forwardedRef
|
|
1185
|
-
}
|
|
1177
|
+
}, children || /* @__PURE__ */ React21.createElement(Icon3, {
|
|
1178
|
+
weight: "bold",
|
|
1179
|
+
className: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1180
|
+
}));
|
|
1186
1181
|
});
|
|
1187
|
-
|
|
1188
|
-
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1189
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1190
|
-
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1191
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1182
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1192
1183
|
const { tx } = useThemeContext();
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
...
|
|
1196
|
-
className: tx("
|
|
1184
|
+
const density = useDensityContext();
|
|
1185
|
+
return /* @__PURE__ */ React21.createElement(ListPrimitiveItem, {
|
|
1186
|
+
...props,
|
|
1187
|
+
className: tx("list.item.root", "list__listItem", {
|
|
1188
|
+
density,
|
|
1189
|
+
collapsible: props.collapsible
|
|
1190
|
+
}, classNames),
|
|
1197
1191
|
ref: forwardedRef
|
|
1198
|
-
});
|
|
1192
|
+
}, children);
|
|
1199
1193
|
});
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1194
|
+
var ListItem = {
|
|
1195
|
+
Root: ListItemRoot,
|
|
1196
|
+
Endcap: ListItemEndcap,
|
|
1197
|
+
Heading: ListItemHeading,
|
|
1198
|
+
OpenTrigger: ListItemOpenTrigger,
|
|
1199
|
+
CollapsibleContent: ListItemCollapsibleContent,
|
|
1200
|
+
MockOpenTrigger: MockListItemOpenTrigger,
|
|
1201
|
+
DropIndicator: ListDropIndicator
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1204
|
+
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1205
|
+
import React23, { forwardRef as forwardRef15 } from "react";
|
|
1206
|
+
|
|
1207
|
+
// packages/ui/react-ui/src/components/Lists/TreeDropIndicator.tsx
|
|
1208
|
+
import React22 from "react";
|
|
1209
|
+
var edgeToOrientationMap2 = {
|
|
1210
|
+
"reorder-above": "sibling",
|
|
1211
|
+
"reorder-below": "sibling",
|
|
1212
|
+
"make-child": "child",
|
|
1213
|
+
reparent: "child"
|
|
1214
|
+
};
|
|
1215
|
+
var orientationStyles2 = {
|
|
1216
|
+
// TODO(wittjosiah): Stop using left/right here.
|
|
1217
|
+
sibling: "bs-[--line-thickness] left-[--horizontal-indent] right-0 bg-accentSurface before:left-[--negative-terminal-size]",
|
|
1218
|
+
child: "is-full block-start-0 block-end-0 border-[length:--line-thickness] before:invisible"
|
|
1219
|
+
};
|
|
1220
|
+
var instructionStyles = {
|
|
1221
|
+
"reorder-above": "block-start-[--line-offset] before:block-start-[--offset-terminal]",
|
|
1222
|
+
"reorder-below": "block-end-[--line-offset] before:block-end-[--offset-terminal]",
|
|
1223
|
+
"make-child": "border-accentSurface",
|
|
1224
|
+
// TODO(wittjosiah): This is not occurring in the current implementation.
|
|
1225
|
+
reparent: ""
|
|
1226
|
+
};
|
|
1227
|
+
var strokeSize2 = 2;
|
|
1228
|
+
var terminalSize2 = 8;
|
|
1229
|
+
var offsetToAlignTerminalWithLine2 = (strokeSize2 - terminalSize2) / 2;
|
|
1230
|
+
var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
1231
|
+
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize2}px))`;
|
|
1232
|
+
const isBlocked = instruction.type === "instruction-blocked";
|
|
1233
|
+
const desiredInstruction = isBlocked ? instruction.desired : instruction;
|
|
1234
|
+
const orientation = edgeToOrientationMap2[desiredInstruction.type];
|
|
1235
|
+
if (isBlocked) {
|
|
1236
|
+
return null;
|
|
1237
|
+
}
|
|
1238
|
+
return /* @__PURE__ */ React22.createElement("div", {
|
|
1239
|
+
style: {
|
|
1240
|
+
"--line-thickness": `${strokeSize2}px`,
|
|
1241
|
+
"--line-offset": `${lineOffset}`,
|
|
1242
|
+
"--terminal-size": `${terminalSize2}px`,
|
|
1243
|
+
"--terminal-radius": `${terminalSize2 / 2}px`,
|
|
1244
|
+
"--negative-terminal-size": `-${terminalSize2}px`,
|
|
1245
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine2}px`,
|
|
1246
|
+
"--horizontal-indent": `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`
|
|
1247
|
+
},
|
|
1248
|
+
className: `absolute z-10 pointer-events-none before:is-[--terminal-size] before:bs-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles2[orientation]} ${instructionStyles[desiredInstruction.type]}`
|
|
1249
|
+
});
|
|
1250
|
+
};
|
|
1251
|
+
|
|
1252
|
+
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1253
|
+
var TreeRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1254
|
+
return /* @__PURE__ */ React23.createElement(List, {
|
|
1255
|
+
...props,
|
|
1208
1256
|
ref: forwardedRef
|
|
1209
1257
|
});
|
|
1210
1258
|
});
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.RadioItem, {
|
|
1217
|
-
...menuScope,
|
|
1218
|
-
...radioItemProps,
|
|
1259
|
+
var TreeBranch = /* @__PURE__ */ forwardRef15(({ __listScope, ...props }, forwardedRef) => {
|
|
1260
|
+
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
1261
|
+
return /* @__PURE__ */ React23.createElement(List, {
|
|
1262
|
+
...props,
|
|
1263
|
+
"aria-labelledby": headingId,
|
|
1219
1264
|
ref: forwardedRef
|
|
1220
1265
|
});
|
|
1221
1266
|
});
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1227
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.ItemIndicator, {
|
|
1228
|
-
...menuScope,
|
|
1229
|
-
...itemIndicatorProps,
|
|
1230
|
-
ref: forwardedRef
|
|
1231
|
-
});
|
|
1232
|
-
});
|
|
1233
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1234
|
-
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1235
|
-
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1236
|
-
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1237
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1238
|
-
const { tx } = useThemeContext();
|
|
1239
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Separator, {
|
|
1240
|
-
...menuScope,
|
|
1241
|
-
...separatorProps,
|
|
1242
|
-
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
1243
|
-
ref: forwardedRef
|
|
1244
|
-
});
|
|
1245
|
-
});
|
|
1246
|
-
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1247
|
-
var ARROW_NAME = "DropdownMenuArrow";
|
|
1248
|
-
var DropdownMenuArrow = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1249
|
-
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1250
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1251
|
-
const { tx } = useThemeContext();
|
|
1252
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Arrow, {
|
|
1253
|
-
...menuScope,
|
|
1254
|
-
...arrowProps,
|
|
1255
|
-
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
1267
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1268
|
+
return /* @__PURE__ */ React23.createElement(ListItem.Root, {
|
|
1269
|
+
role: "treeitem",
|
|
1270
|
+
...props,
|
|
1256
1271
|
ref: forwardedRef
|
|
1257
1272
|
});
|
|
1258
1273
|
});
|
|
1259
|
-
|
|
1260
|
-
var
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
onChange: onOpenChange
|
|
1267
|
-
});
|
|
1268
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.Sub, {
|
|
1269
|
-
...menuScope,
|
|
1270
|
-
open,
|
|
1271
|
-
onOpenChange: setOpen
|
|
1272
|
-
}, children);
|
|
1274
|
+
var TreeItemHeading = ListItem.Heading;
|
|
1275
|
+
var TreeItemOpenTrigger = ListItem.OpenTrigger;
|
|
1276
|
+
var MockTreeItemOpenTrigger = ListItem.MockOpenTrigger;
|
|
1277
|
+
var TreeItemBody = ListItem.CollapsibleContent;
|
|
1278
|
+
var Tree = {
|
|
1279
|
+
Root: TreeRoot,
|
|
1280
|
+
Branch: TreeBranch
|
|
1273
1281
|
};
|
|
1274
|
-
var
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
ref: forwardedRef
|
|
1282
|
-
});
|
|
1283
|
-
});
|
|
1284
|
-
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1285
|
-
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1286
|
-
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef14((props, forwardedRef) => {
|
|
1287
|
-
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1288
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1289
|
-
return /* @__PURE__ */ React20.createElement(MenuPrimitive.SubContent, {
|
|
1290
|
-
...menuScope,
|
|
1291
|
-
...subContentProps,
|
|
1292
|
-
ref: forwardedRef,
|
|
1293
|
-
style: {
|
|
1294
|
-
...props.style,
|
|
1295
|
-
// re-namespace exposed content custom properties
|
|
1296
|
-
...{
|
|
1297
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1298
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
1299
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
1300
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1301
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
});
|
|
1305
|
-
});
|
|
1306
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
1307
|
-
var DropdownMenu = {
|
|
1308
|
-
Root: DropdownMenuRoot,
|
|
1309
|
-
Trigger: DropdownMenuTrigger,
|
|
1310
|
-
VirtualTrigger: DropdownMenuVirtualTrigger,
|
|
1311
|
-
Portal: DropdownMenuPortal,
|
|
1312
|
-
Content: DropdownMenuContent,
|
|
1313
|
-
Viewport: DropdownMenuViewport,
|
|
1314
|
-
Group: DropdownMenuGroup,
|
|
1315
|
-
GroupLabel: DropdownMenuGroupLabel,
|
|
1316
|
-
Item: DropdownMenuItem,
|
|
1317
|
-
CheckboxItem: DropdownMenuCheckboxItem,
|
|
1318
|
-
RadioGroup: DropdownMenuRadioGroup,
|
|
1319
|
-
RadioItem: DropdownMenuRadioItem,
|
|
1320
|
-
ItemIndicator: DropdownMenuItemIndicator,
|
|
1321
|
-
Separator: DropdownMenuSeparator,
|
|
1322
|
-
Arrow: DropdownMenuArrow,
|
|
1323
|
-
Sub: DropdownMenuSub,
|
|
1324
|
-
SubTrigger: DropdownMenuSubTrigger,
|
|
1325
|
-
SubContent: DropdownMenuSubContent
|
|
1282
|
+
var TreeItem = {
|
|
1283
|
+
Root: TreeItemRoot,
|
|
1284
|
+
Heading: TreeItemHeading,
|
|
1285
|
+
Body: TreeItemBody,
|
|
1286
|
+
OpenTrigger: TreeItemOpenTrigger,
|
|
1287
|
+
MockOpenTrigger: MockTreeItemOpenTrigger,
|
|
1288
|
+
DropIndicator: TreeDropIndicator
|
|
1326
1289
|
};
|
|
1327
|
-
var useDropdownMenuMenuScope = useMenuScope;
|
|
1328
1290
|
|
|
1329
|
-
// packages/ui/react-ui/src/components/
|
|
1330
|
-
import {
|
|
1291
|
+
// packages/ui/react-ui/src/components/Lists/Treegrid.tsx
|
|
1292
|
+
import { useArrowNavigationGroup, useFocusableGroup } from "@fluentui/react-tabster";
|
|
1293
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
1294
|
+
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
1295
|
+
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
1331
1296
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1332
|
-
import
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
var
|
|
1297
|
+
import React24, { forwardRef as forwardRef16 } from "react";
|
|
1298
|
+
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
1299
|
+
var [createTreegridRowContext, createTreegridRowScope] = createContextScope(TREEGRID_ROW_NAME, []);
|
|
1300
|
+
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
1301
|
+
var PATH_SEPARATOR = "~";
|
|
1302
|
+
var PARENT_OF_SEPARATOR = " ";
|
|
1303
|
+
var TreegridRoot = /* @__PURE__ */ forwardRef16(({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
1336
1304
|
const { tx } = useThemeContext();
|
|
1337
|
-
|
|
1305
|
+
const Root5 = asChild ? Slot7 : Primitive6.div;
|
|
1306
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
1307
|
+
axis: "vertical",
|
|
1308
|
+
tabbable: false,
|
|
1309
|
+
circular: true
|
|
1310
|
+
});
|
|
1311
|
+
return /* @__PURE__ */ React24.createElement(Root5, {
|
|
1312
|
+
role: "treegrid",
|
|
1313
|
+
...arrowNavigationAttrs,
|
|
1338
1314
|
...props,
|
|
1339
|
-
className: tx("
|
|
1340
|
-
|
|
1341
|
-
|
|
1315
|
+
className: tx("treegrid.root", "treegrid", {}, classNames),
|
|
1316
|
+
style: {
|
|
1317
|
+
...style,
|
|
1318
|
+
gridTemplateColumns
|
|
1319
|
+
},
|
|
1342
1320
|
ref: forwardedRef
|
|
1343
1321
|
}, children);
|
|
1344
1322
|
});
|
|
1345
|
-
var
|
|
1323
|
+
var TreegridRow = /* @__PURE__ */ forwardRef16(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
1346
1324
|
const { tx } = useThemeContext();
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1325
|
+
const Root5 = asChild ? Slot7 : Primitive6.div;
|
|
1326
|
+
const pathParts = id.split(PATH_SEPARATOR);
|
|
1327
|
+
const level = pathParts.length - 1;
|
|
1328
|
+
const [open, onOpenChange] = useControllableState2({
|
|
1329
|
+
prop: propsOpen,
|
|
1330
|
+
onChange: propsOnOpenChange,
|
|
1331
|
+
defaultProp: defaultOpen
|
|
1332
|
+
});
|
|
1333
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
1334
|
+
tabBehavior: "limited"
|
|
1335
|
+
});
|
|
1336
|
+
const arrowGroupAttrs = useArrowNavigationGroup({
|
|
1337
|
+
axis: "horizontal",
|
|
1338
|
+
tabbable: false,
|
|
1339
|
+
circular: false,
|
|
1340
|
+
memorizeCurrent: false
|
|
1341
|
+
});
|
|
1342
|
+
return /* @__PURE__ */ React24.createElement(TreegridRowProvider, {
|
|
1343
|
+
open,
|
|
1344
|
+
onOpenChange,
|
|
1345
|
+
scope: __treegridRowScope
|
|
1346
|
+
}, /* @__PURE__ */ React24.createElement(Root5, {
|
|
1347
|
+
role: "row",
|
|
1348
|
+
"aria-level": level,
|
|
1349
|
+
className: tx("treegrid.row", "treegrid__row", {
|
|
1350
|
+
level
|
|
1351
1351
|
}, classNames),
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
return /* @__PURE__ */ React21.createElement(ValidationPrimitive, {
|
|
1352
|
+
...parentOf && {
|
|
1353
|
+
"aria-expanded": open,
|
|
1354
|
+
"aria-owns": parentOf
|
|
1355
|
+
},
|
|
1356
|
+
tabIndex: 0,
|
|
1357
|
+
...focusableGroupAttrs,
|
|
1359
1358
|
...props,
|
|
1360
|
-
|
|
1361
|
-
srOnly,
|
|
1362
|
-
validationValence
|
|
1363
|
-
}, classNames),
|
|
1359
|
+
id,
|
|
1364
1360
|
ref: forwardedRef
|
|
1365
|
-
},
|
|
1361
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1362
|
+
role: "none",
|
|
1363
|
+
className: "contents",
|
|
1364
|
+
...arrowGroupAttrs
|
|
1365
|
+
}, children)));
|
|
1366
1366
|
});
|
|
1367
|
-
var
|
|
1367
|
+
var TreegridCell = /* @__PURE__ */ forwardRef16(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
1368
1368
|
const { tx } = useThemeContext();
|
|
1369
|
-
return /* @__PURE__ */
|
|
1370
|
-
|
|
1371
|
-
className: tx("
|
|
1372
|
-
|
|
1369
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1370
|
+
role: "gridcell",
|
|
1371
|
+
className: tx("treegrid.cell", "treegrid__cell", {
|
|
1372
|
+
indent
|
|
1373
1373
|
}, classNames),
|
|
1374
|
+
...props,
|
|
1374
1375
|
ref: forwardedRef
|
|
1375
1376
|
}, children);
|
|
1376
1377
|
});
|
|
1377
|
-
var
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1378
|
+
var Treegrid = {
|
|
1379
|
+
Root: TreegridRoot,
|
|
1380
|
+
Row: TreegridRow,
|
|
1381
|
+
Cell: TreegridCell,
|
|
1382
|
+
PARENT_OF_SEPARATOR,
|
|
1383
|
+
PATH_SEPARATOR,
|
|
1384
|
+
createTreegridRowScope,
|
|
1385
|
+
useTreegridRowContext
|
|
1386
|
+
};
|
|
1387
|
+
|
|
1388
|
+
// packages/ui/react-ui/src/components/Main/Main.tsx
|
|
1389
|
+
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
1390
|
+
import { Root as DialogRoot2, DialogContent as DialogContent2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
1391
|
+
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
1392
|
+
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
1393
|
+
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
1394
|
+
import React25, { forwardRef as forwardRef17, useCallback as useCallback6, useEffect as useEffect4, useRef, useState as useState8 } from "react";
|
|
1395
|
+
import { log } from "@dxos/log";
|
|
1396
|
+
import { useMediaQuery, useForwardedRef } from "@dxos/react-hooks";
|
|
1397
|
+
|
|
1398
|
+
// packages/ui/react-ui/src/components/Main/useSwipeToDismiss.ts
|
|
1399
|
+
import { useCallback as useCallback5, useEffect as useEffect3, useState as useState7 } from "react";
|
|
1400
|
+
var MotionState;
|
|
1401
|
+
(function(MotionState2) {
|
|
1402
|
+
MotionState2[MotionState2["IDLE"] = 0] = "IDLE";
|
|
1403
|
+
MotionState2[MotionState2["DEBOUNCING"] = 1] = "DEBOUNCING";
|
|
1404
|
+
MotionState2[MotionState2["FOLLOWING"] = 2] = "FOLLOWING";
|
|
1405
|
+
})(MotionState || (MotionState = {}));
|
|
1406
|
+
var useSwipeToDismiss = (ref, {
|
|
1407
|
+
onDismiss,
|
|
1408
|
+
dismissThreshold = 64,
|
|
1409
|
+
debounceThreshold = 8,
|
|
1410
|
+
offset = 0
|
|
1411
|
+
/* side = 'inline-start' */
|
|
1412
|
+
}) => {
|
|
1413
|
+
const $root = ref.current;
|
|
1414
|
+
const [motionState, setMotionState] = useState7(0);
|
|
1415
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
1416
|
+
const setIdle = useCallback5(() => {
|
|
1417
|
+
setMotionState(0);
|
|
1418
|
+
$root?.style.removeProperty("inset-inline-start");
|
|
1419
|
+
$root?.style.setProperty("transition-duration", "200ms");
|
|
1420
|
+
}, [
|
|
1421
|
+
$root
|
|
1395
1422
|
]);
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1423
|
+
const setFollowing = useCallback5(() => {
|
|
1424
|
+
setMotionState(2);
|
|
1425
|
+
$root?.style.setProperty("transition-duration", "0ms");
|
|
1426
|
+
}, [
|
|
1427
|
+
$root
|
|
1428
|
+
]);
|
|
1429
|
+
const handlePointerDown = useCallback5(({ screenX }) => {
|
|
1430
|
+
if (motionState === 0) {
|
|
1431
|
+
setMotionState(1);
|
|
1432
|
+
setGestureStartX(screenX);
|
|
1433
|
+
}
|
|
1434
|
+
}, [
|
|
1435
|
+
motionState
|
|
1436
|
+
]);
|
|
1437
|
+
const handlePointerMove = useCallback5(({ screenX }) => {
|
|
1438
|
+
if ($root) {
|
|
1439
|
+
const delta = Math.min(screenX - gestureStartX, 0);
|
|
1440
|
+
switch (motionState) {
|
|
1441
|
+
case 2:
|
|
1442
|
+
if (Math.abs(delta) > dismissThreshold) {
|
|
1443
|
+
setIdle();
|
|
1444
|
+
onDismiss?.();
|
|
1445
|
+
} else {
|
|
1446
|
+
$root.style.setProperty("inset-inline-start", `${offset + delta}px`);
|
|
1447
|
+
}
|
|
1448
|
+
break;
|
|
1449
|
+
case 1:
|
|
1450
|
+
if (Math.abs(delta) > debounceThreshold) {
|
|
1451
|
+
setFollowing();
|
|
1452
|
+
}
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}, [
|
|
1457
|
+
$root,
|
|
1458
|
+
motionState,
|
|
1459
|
+
gestureStartX
|
|
1460
|
+
]);
|
|
1461
|
+
const handlePointerUp = useCallback5(() => {
|
|
1462
|
+
setIdle();
|
|
1463
|
+
}, [
|
|
1464
|
+
setIdle
|
|
1465
|
+
]);
|
|
1466
|
+
useEffect3(() => {
|
|
1467
|
+
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
1468
|
+
return () => {
|
|
1469
|
+
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
1470
|
+
};
|
|
1471
|
+
}, [
|
|
1472
|
+
$root,
|
|
1473
|
+
handlePointerDown
|
|
1474
|
+
]);
|
|
1475
|
+
useEffect3(() => {
|
|
1476
|
+
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
1477
|
+
return () => {
|
|
1478
|
+
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
1479
|
+
};
|
|
1480
|
+
}, [
|
|
1481
|
+
$root,
|
|
1482
|
+
handlePointerMove
|
|
1483
|
+
]);
|
|
1484
|
+
useEffect3(() => {
|
|
1485
|
+
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
1486
|
+
return () => {
|
|
1487
|
+
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
1488
|
+
};
|
|
1489
|
+
}, [
|
|
1490
|
+
$root,
|
|
1491
|
+
handlePointerUp
|
|
1492
|
+
]);
|
|
1493
|
+
};
|
|
1494
|
+
|
|
1495
|
+
// packages/ui/react-ui/src/components/Main/Main.tsx
|
|
1496
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
1497
|
+
var MAIN_ROOT_NAME = "MainRoot";
|
|
1498
|
+
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
1499
|
+
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
1500
|
+
var MAIN_NAME = "Main";
|
|
1501
|
+
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
1502
|
+
var landmarkAttr = "data-main-landmark";
|
|
1503
|
+
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
1504
|
+
const handleKeyDown = useCallback6((event) => {
|
|
1505
|
+
const target = event.target;
|
|
1506
|
+
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
1507
|
+
event.preventDefault();
|
|
1508
|
+
const landmarks = Array.from(document.querySelectorAll(`[${landmarkAttr}]:not([inert])`)).map((el) => el.hasAttribute(landmarkAttr) ? parseInt(el.getAttribute(landmarkAttr)) : NaN).sort();
|
|
1509
|
+
const l = landmarks.length;
|
|
1510
|
+
const cursor = landmarks.indexOf(parseInt(target.getAttribute(landmarkAttr)));
|
|
1511
|
+
const nextLandmark = landmarks[(cursor + l + (event.getModifierState("Shift") ? -1 : 1)) % l];
|
|
1512
|
+
document.querySelector(`[${landmarkAttr}="${nextLandmark}"]`)?.focus();
|
|
1513
|
+
}
|
|
1514
|
+
propsOnKeyDown?.(event);
|
|
1515
|
+
}, [
|
|
1516
|
+
propsOnKeyDown
|
|
1517
|
+
]);
|
|
1518
|
+
const focusableGroupAttrs = window ? {} : {
|
|
1519
|
+
tabBehavior: "limited",
|
|
1520
|
+
ignoreDefaultKeydown: {
|
|
1521
|
+
Tab: true
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1524
|
+
return {
|
|
1525
|
+
onKeyDown: handleKeyDown,
|
|
1526
|
+
[landmarkAttr]: landmark,
|
|
1527
|
+
tabIndex: 0,
|
|
1528
|
+
...focusableGroupAttrs
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
1532
|
+
resizing: false,
|
|
1533
|
+
navigationSidebarState: "closed",
|
|
1534
|
+
setNavigationSidebarState: (nextState) => {
|
|
1535
|
+
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
1536
|
+
F: __dxlog_file,
|
|
1537
|
+
L: 82,
|
|
1538
|
+
S: void 0,
|
|
1539
|
+
C: (f, a) => f(...a)
|
|
1540
|
+
});
|
|
1541
|
+
},
|
|
1542
|
+
complementarySidebarState: "closed",
|
|
1543
|
+
setComplementarySidebarState: (nextState) => {
|
|
1544
|
+
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
1545
|
+
F: __dxlog_file,
|
|
1546
|
+
L: 87,
|
|
1547
|
+
S: void 0,
|
|
1548
|
+
C: (f, a) => f(...a)
|
|
1549
|
+
});
|
|
1550
|
+
}
|
|
1429
1551
|
});
|
|
1430
|
-
var
|
|
1431
|
-
const {
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1552
|
+
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
1553
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
1554
|
+
return {
|
|
1555
|
+
navigationSidebarState,
|
|
1556
|
+
setNavigationSidebarState,
|
|
1557
|
+
toggleNavigationSidebar: useCallback6(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
1558
|
+
navigationSidebarState,
|
|
1559
|
+
setNavigationSidebarState
|
|
1560
|
+
]),
|
|
1561
|
+
openNavigationSidebar: useCallback6(() => setNavigationSidebarState("expanded"), []),
|
|
1562
|
+
collapseNavigationSidebar: useCallback6(() => setNavigationSidebarState("collapsed"), []),
|
|
1563
|
+
closeNavigationSidebar: useCallback6(() => setNavigationSidebarState("closed"), []),
|
|
1564
|
+
complementarySidebarState,
|
|
1565
|
+
setComplementarySidebarState,
|
|
1566
|
+
toggleComplementarySidebar: useCallback6(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
1567
|
+
complementarySidebarState,
|
|
1568
|
+
setComplementarySidebarState
|
|
1569
|
+
]),
|
|
1570
|
+
openComplementarySidebar: useCallback6(() => setComplementarySidebarState("expanded"), []),
|
|
1571
|
+
collapseComplementarySidebar: useCallback6(() => setComplementarySidebarState("collapsed"), []),
|
|
1572
|
+
closeComplementarySidebar: useCallback6(() => setComplementarySidebarState("closed"), [])
|
|
1573
|
+
};
|
|
1574
|
+
};
|
|
1575
|
+
var resizeDebounce = 3e3;
|
|
1576
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
1577
|
+
const [isLg] = useMediaQuery("lg", {
|
|
1578
|
+
ssr: false
|
|
1449
1579
|
});
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
defaultProp: propsDefaultChecked,
|
|
1455
|
-
onChange: propsOnCheckedChange
|
|
1580
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState3({
|
|
1581
|
+
prop: propsNavigationSidebarState,
|
|
1582
|
+
defaultProp: defaultNavigationSidebarState,
|
|
1583
|
+
onChange: onNavigationSidebarStateChange
|
|
1456
1584
|
});
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
checked,
|
|
1462
|
-
onCheckedChange,
|
|
1463
|
-
id,
|
|
1464
|
-
"aria-describedby": descriptionId,
|
|
1465
|
-
...validationValence === "error" && {
|
|
1466
|
-
"aria-invalid": "true",
|
|
1467
|
-
"aria-errormessage": errorMessageId
|
|
1468
|
-
},
|
|
1469
|
-
className: tx("input.checkbox", "input--checkbox", {
|
|
1470
|
-
size
|
|
1471
|
-
}, "shrink-0", classNames),
|
|
1472
|
-
ref: forwardedRef
|
|
1473
|
-
}, /* @__PURE__ */ React21.createElement(Icon, {
|
|
1474
|
-
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1475
|
-
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1476
|
-
size,
|
|
1477
|
-
checked
|
|
1478
|
-
})
|
|
1479
|
-
}));
|
|
1480
|
-
});
|
|
1481
|
-
var Switch = /* @__PURE__ */ forwardRef15(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1482
|
-
const [checked, onCheckedChange] = useControllableState2({
|
|
1483
|
-
prop: propsChecked,
|
|
1484
|
-
defaultProp: propsDefaultChecked ?? false,
|
|
1485
|
-
onChange: propsOnCheckedChange
|
|
1585
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = useControllableState3({
|
|
1586
|
+
prop: propsComplementarySidebarState,
|
|
1587
|
+
defaultProp: defaultComplementarySidebarState,
|
|
1588
|
+
onChange: onComplementarySidebarStateChange
|
|
1486
1589
|
});
|
|
1487
|
-
const
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1590
|
+
const [resizing, setResizing] = useState8(false);
|
|
1591
|
+
const resizeInterval = useRef(null);
|
|
1592
|
+
const handleResize = useCallback6(() => {
|
|
1593
|
+
setResizing(true);
|
|
1594
|
+
if (resizeInterval.current) {
|
|
1595
|
+
clearTimeout(resizeInterval.current);
|
|
1596
|
+
}
|
|
1597
|
+
resizeInterval.current = setTimeout(() => {
|
|
1598
|
+
setResizing(false);
|
|
1599
|
+
resizeInterval.current = null;
|
|
1600
|
+
}, resizeDebounce);
|
|
1601
|
+
}, []);
|
|
1602
|
+
useEffect4(() => {
|
|
1603
|
+
window.addEventListener("resize", handleResize);
|
|
1604
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
1605
|
+
}, [
|
|
1606
|
+
handleResize
|
|
1607
|
+
]);
|
|
1608
|
+
return /* @__PURE__ */ React25.createElement(MainProvider, {
|
|
1497
1609
|
...props,
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
});
|
|
1504
|
-
});
|
|
1505
|
-
var Input = {
|
|
1506
|
-
Root: InputRoot,
|
|
1507
|
-
PinInput,
|
|
1508
|
-
TextInput,
|
|
1509
|
-
TextArea,
|
|
1510
|
-
Checkbox,
|
|
1511
|
-
Switch,
|
|
1512
|
-
Label: Label3,
|
|
1513
|
-
Description,
|
|
1514
|
-
Validation,
|
|
1515
|
-
DescriptionAndValidation
|
|
1516
|
-
};
|
|
1517
|
-
|
|
1518
|
-
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1519
|
-
import { CaretDown, CaretRight } from "@phosphor-icons/react";
|
|
1520
|
-
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
1521
|
-
import React23, { forwardRef as forwardRef16 } from "react";
|
|
1522
|
-
import { List as ListPrimitive, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, ListItemCollapsibleContent, ListItem as ListPrimitiveItem, LIST_NAME, LIST_ITEM_NAME, useListContext, useListItemContext } from "@dxos/react-list";
|
|
1523
|
-
|
|
1524
|
-
// packages/ui/react-ui/src/components/Lists/ListDropIndicator.tsx
|
|
1525
|
-
import React22 from "react";
|
|
1526
|
-
var edgeToOrientationMap = {
|
|
1527
|
-
top: "horizontal",
|
|
1528
|
-
bottom: "horizontal",
|
|
1529
|
-
left: "vertical",
|
|
1530
|
-
right: "vertical"
|
|
1531
|
-
};
|
|
1532
|
-
var orientationStyles = {
|
|
1533
|
-
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1534
|
-
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1610
|
+
navigationSidebarState,
|
|
1611
|
+
setNavigationSidebarState,
|
|
1612
|
+
complementarySidebarState,
|
|
1613
|
+
setComplementarySidebarState,
|
|
1614
|
+
resizing
|
|
1615
|
+
}, children);
|
|
1535
1616
|
};
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
bottom: "bottom-[--line-offset] before:bottom-[--offset-terminal]",
|
|
1540
|
-
left: "left-[--line-offset] before:left-[--offset-terminal]"
|
|
1617
|
+
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
1618
|
+
var handleOpenAutoFocus = (event) => {
|
|
1619
|
+
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
1541
1620
|
};
|
|
1542
|
-
var
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1546
|
-
const orientation = edgeToOrientationMap[edge];
|
|
1547
|
-
return /* @__PURE__ */ React22.createElement("div", {
|
|
1548
|
-
role: "none",
|
|
1549
|
-
style: {
|
|
1550
|
-
"--line-thickness": `${strokeSize}px`,
|
|
1551
|
-
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
1552
|
-
"--line-inset": `${lineInset}px`,
|
|
1553
|
-
"--terminal-size": `${terminalSize}px`,
|
|
1554
|
-
"--terminal-radius": `${terminalSize / 2}px`,
|
|
1555
|
-
"--terminal-inset": `${terminalInset}px`,
|
|
1556
|
-
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
1557
|
-
},
|
|
1558
|
-
className: `absolute z-10 pointer-events-none bg-accentSurface before:content-[''] before:w-[--terminal-size] before:h-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles[orientation]} ${edgeStyles[edge]}`
|
|
1621
|
+
var MainSidebar = /* @__PURE__ */ forwardRef17(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
1622
|
+
const [isLg] = useMediaQuery("lg", {
|
|
1623
|
+
ssr: false
|
|
1559
1624
|
});
|
|
1560
|
-
};
|
|
1561
|
-
|
|
1562
|
-
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1563
|
-
var List = /* @__PURE__ */ forwardRef16(({ classNames, children, ...props }, forwardedRef) => {
|
|
1564
1625
|
const { tx } = useThemeContext();
|
|
1565
|
-
const
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1626
|
+
const { t } = useTranslation();
|
|
1627
|
+
const ref = useForwardedRef(forwardedRef);
|
|
1628
|
+
const noopRef = useRef(null);
|
|
1629
|
+
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
1630
|
+
onDismiss: () => onStateChange?.("closed")
|
|
1631
|
+
});
|
|
1632
|
+
const handleKeyDown = useCallback6((event) => {
|
|
1633
|
+
if (event.key === "Escape") {
|
|
1634
|
+
event.target.closest("[data-tabster]")?.focus();
|
|
1635
|
+
}
|
|
1636
|
+
props.onKeyDown?.(event);
|
|
1637
|
+
}, [
|
|
1638
|
+
props.onKeyDown
|
|
1639
|
+
]);
|
|
1640
|
+
const Root5 = isLg ? Primitive7.div : DialogContent2;
|
|
1641
|
+
return /* @__PURE__ */ React25.createElement(DialogRoot2, {
|
|
1642
|
+
open: state !== "closed",
|
|
1643
|
+
"aria-label": toLocalizedString(label, t),
|
|
1644
|
+
modal: false
|
|
1645
|
+
}, !isLg && /* @__PURE__ */ React25.createElement(DialogTitle2, {
|
|
1646
|
+
className: "sr-only"
|
|
1647
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React25.createElement(Root5, {
|
|
1648
|
+
...!isLg && {
|
|
1649
|
+
forceMount: true,
|
|
1650
|
+
tabIndex: -1,
|
|
1651
|
+
onOpenAutoFocus: onOpenAutoFocus ?? handleOpenAutoFocus
|
|
1652
|
+
},
|
|
1569
1653
|
...props,
|
|
1570
|
-
|
|
1571
|
-
|
|
1654
|
+
"data-side": side === "inline-end" ? "ie" : "is",
|
|
1655
|
+
"data-state": state,
|
|
1656
|
+
"data-resizing": resizing ? "true" : "false",
|
|
1657
|
+
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
1658
|
+
onKeyDown: handleKeyDown,
|
|
1659
|
+
...state === "closed" && {
|
|
1660
|
+
inert: "true"
|
|
1661
|
+
},
|
|
1662
|
+
ref
|
|
1572
1663
|
}, children));
|
|
1573
1664
|
});
|
|
1574
|
-
var
|
|
1575
|
-
const
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
...!asChild && {
|
|
1580
|
-
role: "none"
|
|
1581
|
-
},
|
|
1665
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
1666
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
1667
|
+
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
1668
|
+
return /* @__PURE__ */ React25.createElement(MainSidebar, {
|
|
1669
|
+
...mover,
|
|
1582
1670
|
...props,
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1671
|
+
state: navigationSidebarState,
|
|
1672
|
+
onStateChange: setNavigationSidebarState,
|
|
1673
|
+
resizing,
|
|
1674
|
+
side: "inline-start",
|
|
1586
1675
|
ref: forwardedRef
|
|
1587
|
-
}, children);
|
|
1588
|
-
});
|
|
1589
|
-
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
1590
|
-
const density = useDensityContext();
|
|
1591
|
-
const { tx } = useThemeContext();
|
|
1592
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
1593
|
-
role: "none",
|
|
1594
|
-
...props,
|
|
1595
|
-
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
1596
|
-
density
|
|
1597
|
-
}, classNames)
|
|
1598
1676
|
});
|
|
1599
|
-
};
|
|
1600
|
-
var ListItemHeading = /* @__PURE__ */ forwardRef16(({ children, classNames, ...props }, forwardedRef) => {
|
|
1601
|
-
const { tx } = useThemeContext();
|
|
1602
|
-
const density = useDensityContext();
|
|
1603
|
-
return /* @__PURE__ */ React23.createElement(ListPrimitiveItemHeading, {
|
|
1604
|
-
...props,
|
|
1605
|
-
className: tx("list.item.heading", "list__listItem__heading", {
|
|
1606
|
-
density
|
|
1607
|
-
}, classNames),
|
|
1608
|
-
ref: forwardedRef
|
|
1609
|
-
}, children);
|
|
1610
|
-
});
|
|
1611
|
-
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef16(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
1612
|
-
const { tx } = useThemeContext();
|
|
1613
|
-
const density = useDensityContext();
|
|
1614
|
-
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1615
|
-
const Icon3 = open ? CaretDown : CaretRight;
|
|
1616
|
-
return /* @__PURE__ */ React23.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1617
|
-
...props,
|
|
1618
|
-
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
1619
|
-
density
|
|
1620
|
-
}, classNames),
|
|
1621
|
-
ref: forwardedRef
|
|
1622
|
-
}, children || /* @__PURE__ */ React23.createElement(Icon3, {
|
|
1623
|
-
weight: "bold",
|
|
1624
|
-
className: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1625
|
-
}));
|
|
1626
1677
|
});
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
density,
|
|
1634
|
-
collapsible: props.collapsible
|
|
1635
|
-
}, classNames),
|
|
1636
|
-
ref: forwardedRef
|
|
1637
|
-
}, children);
|
|
1638
|
-
});
|
|
1639
|
-
var ListItem = {
|
|
1640
|
-
Root: ListItemRoot,
|
|
1641
|
-
Endcap: ListItemEndcap,
|
|
1642
|
-
Heading: ListItemHeading,
|
|
1643
|
-
OpenTrigger: ListItemOpenTrigger,
|
|
1644
|
-
CollapsibleContent: ListItemCollapsibleContent,
|
|
1645
|
-
MockOpenTrigger: MockListItemOpenTrigger,
|
|
1646
|
-
DropIndicator: ListDropIndicator
|
|
1647
|
-
};
|
|
1648
|
-
|
|
1649
|
-
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1650
|
-
import React25, { forwardRef as forwardRef17 } from "react";
|
|
1651
|
-
|
|
1652
|
-
// packages/ui/react-ui/src/components/Lists/TreeDropIndicator.tsx
|
|
1653
|
-
import React24 from "react";
|
|
1654
|
-
var edgeToOrientationMap2 = {
|
|
1655
|
-
"reorder-above": "sibling",
|
|
1656
|
-
"reorder-below": "sibling",
|
|
1657
|
-
"make-child": "child",
|
|
1658
|
-
reparent: "child"
|
|
1659
|
-
};
|
|
1660
|
-
var orientationStyles2 = {
|
|
1661
|
-
// TODO(wittjosiah): Stop using left/right here.
|
|
1662
|
-
sibling: "bs-[--line-thickness] left-[--horizontal-indent] right-0 bg-accentSurface before:left-[--negative-terminal-size]",
|
|
1663
|
-
child: "is-full block-start-0 block-end-0 border-[length:--line-thickness] before:invisible"
|
|
1664
|
-
};
|
|
1665
|
-
var instructionStyles = {
|
|
1666
|
-
"reorder-above": "block-start-[--line-offset] before:block-start-[--offset-terminal]",
|
|
1667
|
-
"reorder-below": "block-end-[--line-offset] before:block-end-[--offset-terminal]",
|
|
1668
|
-
"make-child": "border-accentSurface",
|
|
1669
|
-
// TODO(wittjosiah): This is not occurring in the current implementation.
|
|
1670
|
-
reparent: ""
|
|
1671
|
-
};
|
|
1672
|
-
var strokeSize2 = 2;
|
|
1673
|
-
var terminalSize2 = 8;
|
|
1674
|
-
var offsetToAlignTerminalWithLine2 = (strokeSize2 - terminalSize2) / 2;
|
|
1675
|
-
var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
1676
|
-
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize2}px))`;
|
|
1677
|
-
const isBlocked = instruction.type === "instruction-blocked";
|
|
1678
|
-
const desiredInstruction = isBlocked ? instruction.desired : instruction;
|
|
1679
|
-
const orientation = edgeToOrientationMap2[desiredInstruction.type];
|
|
1680
|
-
if (isBlocked) {
|
|
1681
|
-
return null;
|
|
1682
|
-
}
|
|
1683
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
1684
|
-
style: {
|
|
1685
|
-
"--line-thickness": `${strokeSize2}px`,
|
|
1686
|
-
"--line-offset": `${lineOffset}`,
|
|
1687
|
-
"--terminal-size": `${terminalSize2}px`,
|
|
1688
|
-
"--terminal-radius": `${terminalSize2 / 2}px`,
|
|
1689
|
-
"--negative-terminal-size": `-${terminalSize2}px`,
|
|
1690
|
-
"--offset-terminal": `${offsetToAlignTerminalWithLine2}px`,
|
|
1691
|
-
"--horizontal-indent": `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`
|
|
1692
|
-
},
|
|
1693
|
-
className: `absolute z-10 pointer-events-none before:is-[--terminal-size] before:bs-[--terminal-size] box-border before:absolute before:border-[length:--line-thickness] before:border-solid before:border-accentSurface before:rounded-full ${orientationStyles2[orientation]} ${instructionStyles[desiredInstruction.type]}`
|
|
1694
|
-
});
|
|
1695
|
-
};
|
|
1696
|
-
|
|
1697
|
-
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1698
|
-
var TreeRoot = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
1699
|
-
return /* @__PURE__ */ React25.createElement(List, {
|
|
1678
|
+
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
1679
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
1680
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
1681
|
+
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
1682
|
+
return /* @__PURE__ */ React25.createElement(MainSidebar, {
|
|
1683
|
+
...mover,
|
|
1700
1684
|
...props,
|
|
1685
|
+
state: complementarySidebarState,
|
|
1686
|
+
onStateChange: setComplementarySidebarState,
|
|
1687
|
+
resizing,
|
|
1688
|
+
side: "inline-end",
|
|
1701
1689
|
ref: forwardedRef
|
|
1702
1690
|
});
|
|
1703
1691
|
});
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1692
|
+
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
1693
|
+
var MainContent = /* @__PURE__ */ forwardRef17(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
1694
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
1695
|
+
const { tx } = useThemeContext();
|
|
1696
|
+
const Root5 = asChild ? Slot8 : role ? "div" : "main";
|
|
1697
|
+
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
1698
|
+
return /* @__PURE__ */ React25.createElement(Root5, {
|
|
1699
|
+
role,
|
|
1700
|
+
...handlesFocus && {
|
|
1701
|
+
...mover
|
|
1702
|
+
},
|
|
1707
1703
|
...props,
|
|
1708
|
-
"
|
|
1704
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
1705
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
1706
|
+
className: tx("main.content", "main", {
|
|
1707
|
+
bounce,
|
|
1708
|
+
handlesFocus
|
|
1709
|
+
}, classNames),
|
|
1709
1710
|
ref: forwardedRef
|
|
1710
|
-
});
|
|
1711
|
+
}, children);
|
|
1711
1712
|
});
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1713
|
+
MainContent.displayName = MAIN_NAME;
|
|
1714
|
+
var MainOverlay = /* @__PURE__ */ forwardRef17(({ classNames, ...props }, forwardedRef) => {
|
|
1715
|
+
const [isLg] = useMediaQuery("lg", {
|
|
1716
|
+
ssr: false
|
|
1717
|
+
});
|
|
1718
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
1719
|
+
const { tx } = useThemeContext();
|
|
1720
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
1721
|
+
onClick: () => {
|
|
1722
|
+
setNavigationSidebarState("collapsed");
|
|
1723
|
+
setComplementarySidebarState("collapsed");
|
|
1724
|
+
},
|
|
1715
1725
|
...props,
|
|
1726
|
+
className: tx("main.overlay", "main__overlay", {
|
|
1727
|
+
isLg,
|
|
1728
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
1729
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
1730
|
+
}, classNames),
|
|
1731
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
1732
|
+
"aria-hidden": "true",
|
|
1716
1733
|
ref: forwardedRef
|
|
1717
1734
|
});
|
|
1718
1735
|
});
|
|
1719
|
-
var
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
Branch: TreeBranch
|
|
1726
|
-
};
|
|
1727
|
-
var TreeItem = {
|
|
1728
|
-
Root: TreeItemRoot,
|
|
1729
|
-
Heading: TreeItemHeading,
|
|
1730
|
-
Body: TreeItemBody,
|
|
1731
|
-
OpenTrigger: TreeItemOpenTrigger,
|
|
1732
|
-
MockOpenTrigger: MockTreeItemOpenTrigger,
|
|
1733
|
-
DropIndicator: TreeDropIndicator
|
|
1736
|
+
var Main = {
|
|
1737
|
+
Root: MainRoot,
|
|
1738
|
+
Content: MainContent,
|
|
1739
|
+
Overlay: MainOverlay,
|
|
1740
|
+
NavigationSidebar: MainNavigationSidebar,
|
|
1741
|
+
ComplementarySidebar: MainComplementarySidebar
|
|
1734
1742
|
};
|
|
1735
1743
|
|
|
1736
|
-
// packages/ui/react-ui/src/components/
|
|
1737
|
-
import
|
|
1738
|
-
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
1744
|
+
// packages/ui/react-ui/src/components/Menus/ContextMenu.tsx
|
|
1745
|
+
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
1739
1746
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
1740
1747
|
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
1741
|
-
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
1742
1748
|
import React26, { forwardRef as forwardRef18 } from "react";
|
|
1743
|
-
var
|
|
1744
|
-
var
|
|
1745
|
-
var
|
|
1746
|
-
var
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
+
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
1750
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1751
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1752
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef18(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
1753
|
+
const { tx } = useThemeContext();
|
|
1754
|
+
const elevation = useElevationContext();
|
|
1755
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1756
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Content, {
|
|
1757
|
+
...props,
|
|
1758
|
+
collisionPadding: safeCollisionPadding,
|
|
1759
|
+
className: tx("menu.content", "menu", {
|
|
1760
|
+
elevation
|
|
1761
|
+
}, classNames),
|
|
1762
|
+
ref: forwardedRef
|
|
1763
|
+
}, children);
|
|
1764
|
+
});
|
|
1765
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef18(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1749
1766
|
const { tx } = useThemeContext();
|
|
1750
1767
|
const Root5 = asChild ? Slot9 : Primitive8.div;
|
|
1751
|
-
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
1752
|
-
axis: "vertical",
|
|
1753
|
-
tabbable: false,
|
|
1754
|
-
circular: true
|
|
1755
|
-
});
|
|
1756
1768
|
return /* @__PURE__ */ React26.createElement(Root5, {
|
|
1757
|
-
role: "treegrid",
|
|
1758
|
-
...arrowNavigationAttrs,
|
|
1759
1769
|
...props,
|
|
1760
|
-
className: tx("
|
|
1761
|
-
style: {
|
|
1762
|
-
...style,
|
|
1763
|
-
gridTemplateColumns
|
|
1764
|
-
},
|
|
1770
|
+
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
1765
1771
|
ref: forwardedRef
|
|
1766
1772
|
}, children);
|
|
1767
1773
|
});
|
|
1768
|
-
var
|
|
1774
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1769
1775
|
const { tx } = useThemeContext();
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
prop: propsOpen,
|
|
1775
|
-
onChange: propsOnOpenChange,
|
|
1776
|
-
defaultProp: defaultOpen
|
|
1776
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Arrow, {
|
|
1777
|
+
...props,
|
|
1778
|
+
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
1779
|
+
ref: forwardedRef
|
|
1777
1780
|
});
|
|
1778
|
-
|
|
1779
|
-
|
|
1781
|
+
});
|
|
1782
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
1783
|
+
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
1784
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1785
|
+
const { tx } = useThemeContext();
|
|
1786
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Item, {
|
|
1787
|
+
...props,
|
|
1788
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
1789
|
+
ref: forwardedRef
|
|
1780
1790
|
});
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1791
|
+
});
|
|
1792
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1793
|
+
const { tx } = useThemeContext();
|
|
1794
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
1795
|
+
...props,
|
|
1796
|
+
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
1797
|
+
ref: forwardedRef
|
|
1786
1798
|
});
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
}, /* @__PURE__ */ React26.createElement(Root5, {
|
|
1792
|
-
role: "row",
|
|
1793
|
-
"aria-level": level,
|
|
1794
|
-
className: tx("treegrid.row", "treegrid__row", {
|
|
1795
|
-
level
|
|
1796
|
-
}, classNames),
|
|
1797
|
-
...parentOf && {
|
|
1798
|
-
"aria-expanded": open,
|
|
1799
|
-
"aria-owns": parentOf
|
|
1800
|
-
},
|
|
1801
|
-
tabIndex: 0,
|
|
1802
|
-
...focusableGroupAttrs,
|
|
1799
|
+
});
|
|
1800
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1801
|
+
const { tx } = useThemeContext();
|
|
1802
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Separator, {
|
|
1803
1803
|
...props,
|
|
1804
|
-
|
|
1804
|
+
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
1805
1805
|
ref: forwardedRef
|
|
1806
|
-
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1806
|
+
});
|
|
1807
|
+
});
|
|
1808
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1809
|
+
const { tx } = useThemeContext();
|
|
1810
|
+
return /* @__PURE__ */ React26.createElement(ContextMenuPrimitive.Label, {
|
|
1811
|
+
...props,
|
|
1812
|
+
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
1813
|
+
ref: forwardedRef
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
var ContextMenu2 = {
|
|
1817
|
+
Root: ContextMenuRoot,
|
|
1818
|
+
Trigger: ContextMenuTrigger,
|
|
1819
|
+
Portal: ContextMenuPortal,
|
|
1820
|
+
Content: ContextMenuContent,
|
|
1821
|
+
Viewport: ContextMenuViewport,
|
|
1822
|
+
Arrow: ContextMenuArrow,
|
|
1823
|
+
Group: ContextMenuGroup,
|
|
1824
|
+
Item: ContextMenuItem,
|
|
1825
|
+
CheckboxItem: ContextMenuCheckboxItem,
|
|
1826
|
+
ItemIndicator: ContextMenuItemIndicator,
|
|
1827
|
+
Separator: ContextMenuSeparator,
|
|
1828
|
+
GroupLabel: ContextMenuGroupLabel
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
// packages/ui/react-ui/src/components/Menus/DropdownMenu.tsx
|
|
1832
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
1833
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
1834
|
+
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
1835
|
+
import { useId as useId2 } from "@radix-ui/react-id";
|
|
1836
|
+
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
1837
|
+
import { createMenuScope } from "@radix-ui/react-menu";
|
|
1838
|
+
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
1839
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
1840
|
+
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
1841
|
+
import React27, { useRef as useRef2, useCallback as useCallback7, forwardRef as forwardRef19, useEffect as useEffect5 } from "react";
|
|
1842
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1843
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope2(DROPDOWN_MENU_NAME, [
|
|
1844
|
+
createMenuScope
|
|
1845
|
+
]);
|
|
1846
|
+
var useMenuScope = createMenuScope();
|
|
1847
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
1848
|
+
var DropdownMenuRoot = (props) => {
|
|
1849
|
+
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
1850
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1851
|
+
const triggerRef = useRef2(null);
|
|
1852
|
+
const [open = false, setOpen] = useControllableState4({
|
|
1853
|
+
prop: openProp,
|
|
1854
|
+
defaultProp: defaultOpen,
|
|
1855
|
+
onChange: onOpenChange
|
|
1856
|
+
});
|
|
1857
|
+
return /* @__PURE__ */ React27.createElement(DropdownMenuProvider, {
|
|
1858
|
+
scope: __scopeDropdownMenu,
|
|
1859
|
+
triggerId: useId2(),
|
|
1860
|
+
triggerRef,
|
|
1861
|
+
contentId: useId2(),
|
|
1862
|
+
open,
|
|
1863
|
+
onOpenChange: setOpen,
|
|
1864
|
+
onOpenToggle: useCallback7(() => setOpen((prevOpen) => !prevOpen), [
|
|
1865
|
+
setOpen
|
|
1866
|
+
]),
|
|
1867
|
+
modal
|
|
1868
|
+
}, /* @__PURE__ */ React27.createElement(MenuPrimitive.Root, {
|
|
1869
|
+
...menuScope,
|
|
1870
|
+
open,
|
|
1871
|
+
onOpenChange: setOpen,
|
|
1872
|
+
dir,
|
|
1873
|
+
modal
|
|
1874
|
+
}, children));
|
|
1875
|
+
};
|
|
1876
|
+
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
1877
|
+
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
1878
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
1879
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
1880
|
+
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
1881
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1882
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Anchor, {
|
|
1883
|
+
asChild: true,
|
|
1884
|
+
...menuScope
|
|
1885
|
+
}, /* @__PURE__ */ React27.createElement(Primitive9.button, {
|
|
1886
|
+
type: "button",
|
|
1887
|
+
id: context.triggerId,
|
|
1888
|
+
"aria-haspopup": "menu",
|
|
1889
|
+
"aria-expanded": context.open,
|
|
1890
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
1891
|
+
"data-state": context.open ? "open" : "closed",
|
|
1892
|
+
"data-disabled": disabled ? "" : void 0,
|
|
1893
|
+
disabled,
|
|
1894
|
+
...triggerProps,
|
|
1895
|
+
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
1896
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
1897
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
1898
|
+
context.onOpenToggle();
|
|
1899
|
+
if (!context.open) {
|
|
1900
|
+
event.preventDefault();
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}),
|
|
1904
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
1905
|
+
if (disabled) {
|
|
1906
|
+
return;
|
|
1907
|
+
}
|
|
1908
|
+
if ([
|
|
1909
|
+
"Enter",
|
|
1910
|
+
" "
|
|
1911
|
+
].includes(event.key)) {
|
|
1912
|
+
context.onOpenToggle();
|
|
1913
|
+
}
|
|
1914
|
+
if (event.key === "ArrowDown") {
|
|
1915
|
+
context.onOpenChange(true);
|
|
1916
|
+
}
|
|
1917
|
+
if ([
|
|
1918
|
+
"Enter",
|
|
1919
|
+
" ",
|
|
1920
|
+
"ArrowDown"
|
|
1921
|
+
].includes(event.key)) {
|
|
1922
|
+
event.preventDefault();
|
|
1923
|
+
}
|
|
1924
|
+
})
|
|
1925
|
+
}));
|
|
1811
1926
|
});
|
|
1812
|
-
|
|
1927
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
1928
|
+
var VIRTUAL_TRIGGER_NAME = "DropdownMenuVirtualTrigger";
|
|
1929
|
+
var DropdownMenuVirtualTrigger = (props) => {
|
|
1930
|
+
const { __scopeDropdownMenu, virtualRef } = props;
|
|
1931
|
+
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
1932
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1933
|
+
useEffect5(() => {
|
|
1934
|
+
if (virtualRef.current) {
|
|
1935
|
+
context.triggerRef.current = virtualRef.current;
|
|
1936
|
+
}
|
|
1937
|
+
});
|
|
1938
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Anchor, {
|
|
1939
|
+
...menuScope,
|
|
1940
|
+
virtualRef
|
|
1941
|
+
});
|
|
1942
|
+
};
|
|
1943
|
+
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
1944
|
+
var PORTAL_NAME = "DropdownMenuPortal";
|
|
1945
|
+
var DropdownMenuPortal = (props) => {
|
|
1946
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1947
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1948
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Portal, {
|
|
1949
|
+
...menuScope,
|
|
1950
|
+
...portalProps
|
|
1951
|
+
});
|
|
1952
|
+
};
|
|
1953
|
+
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1954
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef19(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1813
1955
|
const { tx } = useThemeContext();
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
className: tx("treegrid.cell", "treegrid__cell", {
|
|
1817
|
-
indent
|
|
1818
|
-
}, classNames),
|
|
1956
|
+
const Root5 = asChild ? Slot10 : Primitive9.div;
|
|
1957
|
+
return /* @__PURE__ */ React27.createElement(Root5, {
|
|
1819
1958
|
...props,
|
|
1959
|
+
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
1820
1960
|
ref: forwardedRef
|
|
1821
1961
|
}, children);
|
|
1822
1962
|
});
|
|
1823
|
-
var
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
// packages/ui/react-ui/src/components/Main/useSwipeToDismiss.ts
|
|
1844
|
-
import { useCallback as useCallback6, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1845
|
-
var MotionState;
|
|
1846
|
-
(function(MotionState2) {
|
|
1847
|
-
MotionState2[MotionState2["IDLE"] = 0] = "IDLE";
|
|
1848
|
-
MotionState2[MotionState2["DEBOUNCING"] = 1] = "DEBOUNCING";
|
|
1849
|
-
MotionState2[MotionState2["FOLLOWING"] = 2] = "FOLLOWING";
|
|
1850
|
-
})(MotionState || (MotionState = {}));
|
|
1851
|
-
var useSwipeToDismiss = (ref, {
|
|
1852
|
-
onDismiss,
|
|
1853
|
-
dismissThreshold = 64,
|
|
1854
|
-
debounceThreshold = 8,
|
|
1855
|
-
offset = 0
|
|
1856
|
-
/* side = 'inline-start' */
|
|
1857
|
-
}) => {
|
|
1858
|
-
const $root = ref.current;
|
|
1859
|
-
const [motionState, setMotionState] = useState7(0);
|
|
1860
|
-
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
1861
|
-
const setIdle = useCallback6(() => {
|
|
1862
|
-
setMotionState(0);
|
|
1863
|
-
$root?.style.removeProperty("inset-inline-start");
|
|
1864
|
-
$root?.style.setProperty("transition-duration", "200ms");
|
|
1865
|
-
}, [
|
|
1866
|
-
$root
|
|
1867
|
-
]);
|
|
1868
|
-
const setFollowing = useCallback6(() => {
|
|
1869
|
-
setMotionState(2);
|
|
1870
|
-
$root?.style.setProperty("transition-duration", "0ms");
|
|
1871
|
-
}, [
|
|
1872
|
-
$root
|
|
1873
|
-
]);
|
|
1874
|
-
const handlePointerDown = useCallback6(({ screenX }) => {
|
|
1875
|
-
if (motionState === 0) {
|
|
1876
|
-
setMotionState(1);
|
|
1877
|
-
setGestureStartX(screenX);
|
|
1878
|
-
}
|
|
1879
|
-
}, [
|
|
1880
|
-
motionState
|
|
1881
|
-
]);
|
|
1882
|
-
const handlePointerMove = useCallback6(({ screenX }) => {
|
|
1883
|
-
if ($root) {
|
|
1884
|
-
const delta = Math.min(screenX - gestureStartX, 0);
|
|
1885
|
-
switch (motionState) {
|
|
1886
|
-
case 2:
|
|
1887
|
-
if (Math.abs(delta) > dismissThreshold) {
|
|
1888
|
-
setIdle();
|
|
1889
|
-
onDismiss?.();
|
|
1890
|
-
} else {
|
|
1891
|
-
$root.style.setProperty("inset-inline-start", `${offset + delta}px`);
|
|
1892
|
-
}
|
|
1893
|
-
break;
|
|
1894
|
-
case 1:
|
|
1895
|
-
if (Math.abs(delta) > debounceThreshold) {
|
|
1896
|
-
setFollowing();
|
|
1897
|
-
}
|
|
1898
|
-
break;
|
|
1963
|
+
var CONTENT_NAME = "DropdownMenuContent";
|
|
1964
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
1965
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
1966
|
+
const { tx } = useThemeContext();
|
|
1967
|
+
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
1968
|
+
const elevation = useElevationContext();
|
|
1969
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1970
|
+
const hasInteractedOutsideRef = useRef2(false);
|
|
1971
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1972
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Content, {
|
|
1973
|
+
id: context.contentId,
|
|
1974
|
+
"aria-labelledby": context.triggerId,
|
|
1975
|
+
...menuScope,
|
|
1976
|
+
...contentProps,
|
|
1977
|
+
collisionPadding: safeCollisionPadding,
|
|
1978
|
+
ref: forwardedRef,
|
|
1979
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1980
|
+
if (!hasInteractedOutsideRef.current) {
|
|
1981
|
+
context.triggerRef.current?.focus();
|
|
1899
1982
|
}
|
|
1900
|
-
|
|
1901
|
-
}, [
|
|
1902
|
-
$root,
|
|
1903
|
-
motionState,
|
|
1904
|
-
gestureStartX
|
|
1905
|
-
]);
|
|
1906
|
-
const handlePointerUp = useCallback6(() => {
|
|
1907
|
-
setIdle();
|
|
1908
|
-
}, [
|
|
1909
|
-
setIdle
|
|
1910
|
-
]);
|
|
1911
|
-
useEffect4(() => {
|
|
1912
|
-
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
1913
|
-
return () => {
|
|
1914
|
-
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
1915
|
-
};
|
|
1916
|
-
}, [
|
|
1917
|
-
$root,
|
|
1918
|
-
handlePointerDown
|
|
1919
|
-
]);
|
|
1920
|
-
useEffect4(() => {
|
|
1921
|
-
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
1922
|
-
return () => {
|
|
1923
|
-
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
1924
|
-
};
|
|
1925
|
-
}, [
|
|
1926
|
-
$root,
|
|
1927
|
-
handlePointerMove
|
|
1928
|
-
]);
|
|
1929
|
-
useEffect4(() => {
|
|
1930
|
-
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
1931
|
-
return () => {
|
|
1932
|
-
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
1933
|
-
};
|
|
1934
|
-
}, [
|
|
1935
|
-
$root,
|
|
1936
|
-
handlePointerUp
|
|
1937
|
-
]);
|
|
1938
|
-
};
|
|
1939
|
-
|
|
1940
|
-
// packages/ui/react-ui/src/components/Main/Main.tsx
|
|
1941
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/ui/react-ui/src/components/Main/Main.tsx";
|
|
1942
|
-
var MAIN_ROOT_NAME = "MainRoot";
|
|
1943
|
-
var NAVIGATION_SIDEBAR_NAME = "NavigationSidebar";
|
|
1944
|
-
var COMPLEMENTARY_SIDEBAR_NAME = "ComplementarySidebar";
|
|
1945
|
-
var MAIN_NAME = "Main";
|
|
1946
|
-
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
1947
|
-
var landmarkAttr = "data-main-landmark";
|
|
1948
|
-
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
1949
|
-
const handleKeyDown = useCallback7((event) => {
|
|
1950
|
-
const target = event.target;
|
|
1951
|
-
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
1983
|
+
hasInteractedOutsideRef.current = false;
|
|
1952
1984
|
event.preventDefault();
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
const
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1985
|
+
}),
|
|
1986
|
+
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
1987
|
+
const originalEvent = event.detail.originalEvent;
|
|
1988
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1989
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
1990
|
+
if (!context.modal || isRightClick) {
|
|
1991
|
+
hasInteractedOutsideRef.current = true;
|
|
1992
|
+
}
|
|
1993
|
+
}),
|
|
1994
|
+
className: tx("menu.content", "menu", {
|
|
1995
|
+
elevation
|
|
1996
|
+
}, classNames),
|
|
1997
|
+
style: {
|
|
1998
|
+
...props.style,
|
|
1999
|
+
// re-namespace exposed content custom properties
|
|
2000
|
+
...{
|
|
2001
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2002
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
2003
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
2004
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2005
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2006
|
+
}
|
|
1967
2007
|
}
|
|
1968
|
-
};
|
|
1969
|
-
return {
|
|
1970
|
-
onKeyDown: handleKeyDown,
|
|
1971
|
-
[landmarkAttr]: landmark,
|
|
1972
|
-
tabIndex: 0,
|
|
1973
|
-
...focusableGroupAttrs
|
|
1974
|
-
};
|
|
1975
|
-
};
|
|
1976
|
-
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
1977
|
-
resizing: false,
|
|
1978
|
-
navigationSidebarState: "closed",
|
|
1979
|
-
setNavigationSidebarState: (nextState) => {
|
|
1980
|
-
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
1981
|
-
F: __dxlog_file,
|
|
1982
|
-
L: 82,
|
|
1983
|
-
S: void 0,
|
|
1984
|
-
C: (f, a) => f(...a)
|
|
1985
|
-
});
|
|
1986
|
-
},
|
|
1987
|
-
complementarySidebarState: "closed",
|
|
1988
|
-
setComplementarySidebarState: (nextState) => {
|
|
1989
|
-
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
1990
|
-
F: __dxlog_file,
|
|
1991
|
-
L: 87,
|
|
1992
|
-
S: void 0,
|
|
1993
|
-
C: (f, a) => f(...a)
|
|
1994
|
-
});
|
|
1995
|
-
}
|
|
1996
|
-
});
|
|
1997
|
-
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
1998
|
-
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
1999
|
-
return {
|
|
2000
|
-
navigationSidebarState,
|
|
2001
|
-
setNavigationSidebarState,
|
|
2002
|
-
toggleNavigationSidebar: useCallback7(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2003
|
-
navigationSidebarState,
|
|
2004
|
-
setNavigationSidebarState
|
|
2005
|
-
]),
|
|
2006
|
-
openNavigationSidebar: useCallback7(() => setNavigationSidebarState("expanded"), []),
|
|
2007
|
-
collapseNavigationSidebar: useCallback7(() => setNavigationSidebarState("collapsed"), []),
|
|
2008
|
-
closeNavigationSidebar: useCallback7(() => setNavigationSidebarState("closed"), []),
|
|
2009
|
-
complementarySidebarState,
|
|
2010
|
-
setComplementarySidebarState,
|
|
2011
|
-
toggleComplementarySidebar: useCallback7(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2012
|
-
complementarySidebarState,
|
|
2013
|
-
setComplementarySidebarState
|
|
2014
|
-
]),
|
|
2015
|
-
openComplementarySidebar: useCallback7(() => setComplementarySidebarState("expanded"), []),
|
|
2016
|
-
collapseComplementarySidebar: useCallback7(() => setComplementarySidebarState("collapsed"), []),
|
|
2017
|
-
closeComplementarySidebar: useCallback7(() => setComplementarySidebarState("closed"), [])
|
|
2018
|
-
};
|
|
2019
|
-
};
|
|
2020
|
-
var resizeDebounce = 3e3;
|
|
2021
|
-
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2022
|
-
const [isLg] = useMediaQuery("lg", {
|
|
2023
|
-
ssr: false
|
|
2024
|
-
});
|
|
2025
|
-
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2026
|
-
prop: propsNavigationSidebarState,
|
|
2027
|
-
defaultProp: defaultNavigationSidebarState,
|
|
2028
|
-
onChange: onNavigationSidebarStateChange
|
|
2029
2008
|
});
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2009
|
+
});
|
|
2010
|
+
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
2011
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
2012
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2013
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
2014
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2015
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Group, {
|
|
2016
|
+
...menuScope,
|
|
2017
|
+
...groupProps,
|
|
2018
|
+
ref: forwardedRef
|
|
2034
2019
|
});
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
},
|
|
2046
|
-
|
|
2047
|
-
useEffect5(() => {
|
|
2048
|
-
window.addEventListener("resize", handleResize);
|
|
2049
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
2050
|
-
}, [
|
|
2051
|
-
handleResize
|
|
2052
|
-
]);
|
|
2053
|
-
return /* @__PURE__ */ React27.createElement(MainProvider, {
|
|
2054
|
-
...props,
|
|
2055
|
-
navigationSidebarState,
|
|
2056
|
-
setNavigationSidebarState,
|
|
2057
|
-
complementarySidebarState,
|
|
2058
|
-
setComplementarySidebarState,
|
|
2059
|
-
resizing
|
|
2060
|
-
}, children);
|
|
2061
|
-
};
|
|
2062
|
-
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2063
|
-
var handleOpenAutoFocus = (event) => {
|
|
2064
|
-
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2065
|
-
};
|
|
2066
|
-
var MainSidebar = /* @__PURE__ */ forwardRef19(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2067
|
-
const [isLg] = useMediaQuery("lg", {
|
|
2068
|
-
ssr: false
|
|
2020
|
+
});
|
|
2021
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
2022
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
2023
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2024
|
+
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
2025
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2026
|
+
const { tx } = useThemeContext();
|
|
2027
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Label, {
|
|
2028
|
+
...menuScope,
|
|
2029
|
+
...labelProps,
|
|
2030
|
+
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
2031
|
+
ref: forwardedRef
|
|
2069
2032
|
});
|
|
2033
|
+
});
|
|
2034
|
+
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
2035
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
2036
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2037
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
2038
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2070
2039
|
const { tx } = useThemeContext();
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2040
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Item, {
|
|
2041
|
+
...menuScope,
|
|
2042
|
+
...itemProps,
|
|
2043
|
+
className: tx("menu.item", "menu__item", {}, classNames),
|
|
2044
|
+
ref: forwardedRef
|
|
2076
2045
|
});
|
|
2077
|
-
const handleKeyDown = useCallback7((event) => {
|
|
2078
|
-
if (event.key === "Escape") {
|
|
2079
|
-
event.target.closest("[data-tabster]")?.focus();
|
|
2080
|
-
}
|
|
2081
|
-
props.onKeyDown?.(event);
|
|
2082
|
-
}, [
|
|
2083
|
-
props.onKeyDown
|
|
2084
|
-
]);
|
|
2085
|
-
const Root5 = isLg ? Primitive9.div : DialogContent2;
|
|
2086
|
-
return /* @__PURE__ */ React27.createElement(DialogRoot2, {
|
|
2087
|
-
open: state !== "closed",
|
|
2088
|
-
"aria-label": toLocalizedString(label, t),
|
|
2089
|
-
modal: false
|
|
2090
|
-
}, !isLg && /* @__PURE__ */ React27.createElement(DialogTitle2, {
|
|
2091
|
-
className: "sr-only"
|
|
2092
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */ React27.createElement(Root5, {
|
|
2093
|
-
...!isLg && {
|
|
2094
|
-
forceMount: true,
|
|
2095
|
-
tabIndex: -1,
|
|
2096
|
-
onOpenAutoFocus: onOpenAutoFocus ?? handleOpenAutoFocus
|
|
2097
|
-
},
|
|
2098
|
-
...props,
|
|
2099
|
-
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2100
|
-
"data-state": state,
|
|
2101
|
-
"data-resizing": resizing ? "true" : "false",
|
|
2102
|
-
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2103
|
-
onKeyDown: handleKeyDown,
|
|
2104
|
-
...state === "closed" && {
|
|
2105
|
-
inert: "true"
|
|
2106
|
-
},
|
|
2107
|
-
ref
|
|
2108
|
-
}, children));
|
|
2109
2046
|
});
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2047
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
2048
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
2049
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2050
|
+
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
2051
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2052
|
+
const { tx } = useThemeContext();
|
|
2053
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.CheckboxItem, {
|
|
2054
|
+
...menuScope,
|
|
2055
|
+
...checkboxItemProps,
|
|
2056
|
+
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
2120
2057
|
ref: forwardedRef
|
|
2121
2058
|
});
|
|
2122
2059
|
});
|
|
2123
|
-
|
|
2124
|
-
var
|
|
2125
|
-
|
|
2126
|
-
const
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
...
|
|
2130
|
-
|
|
2131
|
-
onStateChange: setComplementarySidebarState,
|
|
2132
|
-
resizing,
|
|
2133
|
-
side: "inline-end",
|
|
2060
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
2061
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
2062
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2063
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
2064
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2065
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.RadioGroup, {
|
|
2066
|
+
...menuScope,
|
|
2067
|
+
...radioGroupProps,
|
|
2134
2068
|
ref: forwardedRef
|
|
2135
2069
|
});
|
|
2136
2070
|
});
|
|
2137
|
-
|
|
2138
|
-
var
|
|
2139
|
-
|
|
2140
|
-
const {
|
|
2141
|
-
const
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
...handlesFocus && {
|
|
2146
|
-
...mover
|
|
2147
|
-
},
|
|
2148
|
-
...props,
|
|
2149
|
-
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2150
|
-
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2151
|
-
className: tx("main.content", "main", {
|
|
2152
|
-
bounce,
|
|
2153
|
-
handlesFocus
|
|
2154
|
-
}, classNames),
|
|
2071
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
2072
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
2073
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2074
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
2075
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2076
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.RadioItem, {
|
|
2077
|
+
...menuScope,
|
|
2078
|
+
...radioItemProps,
|
|
2155
2079
|
ref: forwardedRef
|
|
2156
|
-
}
|
|
2080
|
+
});
|
|
2157
2081
|
});
|
|
2158
|
-
|
|
2159
|
-
var
|
|
2160
|
-
|
|
2161
|
-
|
|
2082
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
2083
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
2084
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2085
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
2086
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2087
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.ItemIndicator, {
|
|
2088
|
+
...menuScope,
|
|
2089
|
+
...itemIndicatorProps,
|
|
2090
|
+
ref: forwardedRef
|
|
2162
2091
|
});
|
|
2163
|
-
|
|
2092
|
+
});
|
|
2093
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
2094
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
2095
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2096
|
+
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
2097
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2164
2098
|
const { tx } = useThemeContext();
|
|
2165
|
-
return /* @__PURE__ */ React27.createElement(
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
},
|
|
2170
|
-
...props,
|
|
2171
|
-
className: tx("main.overlay", "main__overlay", {
|
|
2172
|
-
isLg,
|
|
2173
|
-
inlineStartSidebarOpen: navigationSidebarState,
|
|
2174
|
-
inlineEndSidebarOpen: complementarySidebarState
|
|
2175
|
-
}, classNames),
|
|
2176
|
-
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2177
|
-
"aria-hidden": "true",
|
|
2099
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Separator, {
|
|
2100
|
+
...menuScope,
|
|
2101
|
+
...separatorProps,
|
|
2102
|
+
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
2178
2103
|
ref: forwardedRef
|
|
2179
2104
|
});
|
|
2180
2105
|
});
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2106
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
2107
|
+
var ARROW_NAME = "DropdownMenuArrow";
|
|
2108
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2109
|
+
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
2110
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2111
|
+
const { tx } = useThemeContext();
|
|
2112
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Arrow, {
|
|
2113
|
+
...menuScope,
|
|
2114
|
+
...arrowProps,
|
|
2115
|
+
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
2116
|
+
ref: forwardedRef
|
|
2117
|
+
});
|
|
2118
|
+
});
|
|
2119
|
+
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
2120
|
+
var DropdownMenuSub = (props) => {
|
|
2121
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
2122
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2123
|
+
const [open = false, setOpen] = useControllableState4({
|
|
2124
|
+
prop: openProp,
|
|
2125
|
+
defaultProp: defaultOpen,
|
|
2126
|
+
onChange: onOpenChange
|
|
2127
|
+
});
|
|
2128
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.Sub, {
|
|
2129
|
+
...menuScope,
|
|
2130
|
+
open,
|
|
2131
|
+
onOpenChange: setOpen
|
|
2132
|
+
}, children);
|
|
2133
|
+
};
|
|
2134
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
2135
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2136
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
2137
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2138
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.SubTrigger, {
|
|
2139
|
+
...menuScope,
|
|
2140
|
+
...subTriggerProps,
|
|
2141
|
+
ref: forwardedRef
|
|
2142
|
+
});
|
|
2143
|
+
});
|
|
2144
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
2145
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
2146
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef19((props, forwardedRef) => {
|
|
2147
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
2148
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
2149
|
+
return /* @__PURE__ */ React27.createElement(MenuPrimitive.SubContent, {
|
|
2150
|
+
...menuScope,
|
|
2151
|
+
...subContentProps,
|
|
2152
|
+
ref: forwardedRef,
|
|
2153
|
+
style: {
|
|
2154
|
+
...props.style,
|
|
2155
|
+
// re-namespace exposed content custom properties
|
|
2156
|
+
...{
|
|
2157
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2158
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
2159
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
2160
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2161
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
});
|
|
2165
|
+
});
|
|
2166
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
2167
|
+
var DropdownMenu = {
|
|
2168
|
+
Root: DropdownMenuRoot,
|
|
2169
|
+
Trigger: DropdownMenuTrigger,
|
|
2170
|
+
VirtualTrigger: DropdownMenuVirtualTrigger,
|
|
2171
|
+
Portal: DropdownMenuPortal,
|
|
2172
|
+
Content: DropdownMenuContent,
|
|
2173
|
+
Viewport: DropdownMenuViewport,
|
|
2174
|
+
Group: DropdownMenuGroup,
|
|
2175
|
+
GroupLabel: DropdownMenuGroupLabel,
|
|
2176
|
+
Item: DropdownMenuItem,
|
|
2177
|
+
CheckboxItem: DropdownMenuCheckboxItem,
|
|
2178
|
+
RadioGroup: DropdownMenuRadioGroup,
|
|
2179
|
+
RadioItem: DropdownMenuRadioItem,
|
|
2180
|
+
ItemIndicator: DropdownMenuItemIndicator,
|
|
2181
|
+
Separator: DropdownMenuSeparator,
|
|
2182
|
+
Arrow: DropdownMenuArrow,
|
|
2183
|
+
Sub: DropdownMenuSub,
|
|
2184
|
+
SubTrigger: DropdownMenuSubTrigger,
|
|
2185
|
+
SubContent: DropdownMenuSubContent
|
|
2187
2186
|
};
|
|
2187
|
+
var useDropdownMenuMenuScope = useMenuScope;
|
|
2188
2188
|
|
|
2189
2189
|
// packages/ui/react-ui/src/components/Message/Message.tsx
|
|
2190
2190
|
import { createContext as createContext11 } from "@radix-ui/react-context";
|