@dxos/react-ui 0.6.14-main.2b6a0f3 → 0.6.14-main.69511f5
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 +697 -169
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +670 -140
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +697 -169
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Buttons/Button.d.ts +1 -1
- package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +105 -44
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +25 -25
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +87 -21
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +16 -11
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/package.json +25 -20
- package/src/components/Buttons/Button.tsx +46 -36
- package/src/components/Icon/Icon.tsx +11 -9
- package/src/components/Menus/DropdownMenu.stories.tsx +40 -1
- package/src/components/Menus/DropdownMenu.tsx +518 -69
- package/src/components/Popover/Popover.stories.tsx +24 -1
- package/src/components/Popover/Popover.tsx +524 -55
|
@@ -124,8 +124,8 @@ var useVisualViewport = (deps) => {
|
|
|
124
124
|
// packages/ui/react-ui/src/components/AnchoredOverflow/AnchoredOverflow.tsx
|
|
125
125
|
var AnchoredOverflowRoot = /* @__PURE__ */ forwardRef(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
126
126
|
const { tx } = useThemeContext();
|
|
127
|
-
const
|
|
128
|
-
return /* @__PURE__ */ React2.createElement(
|
|
127
|
+
const Root5 = asChild ? Slot : Primitive.div;
|
|
128
|
+
return /* @__PURE__ */ React2.createElement(Root5, {
|
|
129
129
|
role: "none",
|
|
130
130
|
...props,
|
|
131
131
|
className: tx("anchoredOverflow.root", "overflow-anchored", {}, classNames),
|
|
@@ -134,8 +134,8 @@ var AnchoredOverflowRoot = /* @__PURE__ */ forwardRef(({ asChild, classNames, ch
|
|
|
134
134
|
});
|
|
135
135
|
var AnchoredOverflowAnchor = /* @__PURE__ */ forwardRef(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
136
136
|
const { tx } = useThemeContext();
|
|
137
|
-
const
|
|
138
|
-
return /* @__PURE__ */ React2.createElement(
|
|
137
|
+
const Root5 = asChild ? Slot : Primitive.div;
|
|
138
|
+
return /* @__PURE__ */ React2.createElement(Root5, {
|
|
139
139
|
role: "none",
|
|
140
140
|
...props,
|
|
141
141
|
className: tx("anchoredOverflow.anchor", "overflow-anchor", {}, classNames),
|
|
@@ -156,8 +156,8 @@ import React4, { forwardRef as forwardRef3 } from "react";
|
|
|
156
156
|
import { useId } from "@dxos/react-hooks";
|
|
157
157
|
|
|
158
158
|
// packages/ui/react-ui/src/components/Icon/Icon.tsx
|
|
159
|
-
import React3, { forwardRef as forwardRef2 } from "react";
|
|
160
|
-
var Icon = /* @__PURE__ */ forwardRef2(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
159
|
+
import React3, { forwardRef as forwardRef2, memo } from "react";
|
|
160
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
161
161
|
const { tx } = useThemeContext();
|
|
162
162
|
return /* @__PURE__ */ React3.createElement("svg", {
|
|
163
163
|
...props,
|
|
@@ -168,7 +168,7 @@ var Icon = /* @__PURE__ */ forwardRef2(({ icon, classNames, size, ...props }, fo
|
|
|
168
168
|
}, /* @__PURE__ */ React3.createElement("use", {
|
|
169
169
|
href: `/icons.svg#${icon}`
|
|
170
170
|
}));
|
|
171
|
-
});
|
|
171
|
+
}));
|
|
172
172
|
|
|
173
173
|
// packages/ui/react-ui/src/components/Avatars/Avatar.tsx
|
|
174
174
|
var AVATAR_NAME = "Avatar";
|
|
@@ -262,10 +262,10 @@ var AvatarFrame = /* @__PURE__ */ forwardRef3(({ classNames, children, ...props
|
|
|
262
262
|
}));
|
|
263
263
|
});
|
|
264
264
|
var AvatarLabel = /* @__PURE__ */ forwardRef3(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
265
|
-
const
|
|
265
|
+
const Root5 = asChild ? Slot2 : Primitive2.span;
|
|
266
266
|
const { tx } = useThemeContext();
|
|
267
267
|
const { labelId } = useAvatarContext("AvatarLabel");
|
|
268
|
-
return /* @__PURE__ */ React4.createElement(
|
|
268
|
+
return /* @__PURE__ */ React4.createElement(Root5, {
|
|
269
269
|
...props,
|
|
270
270
|
id: labelId,
|
|
271
271
|
ref: forwardedRef,
|
|
@@ -275,10 +275,10 @@ var AvatarLabel = /* @__PURE__ */ forwardRef3(({ asChild, srOnly, classNames, ..
|
|
|
275
275
|
});
|
|
276
276
|
});
|
|
277
277
|
var AvatarDescription = /* @__PURE__ */ forwardRef3(({ asChild, srOnly, classNames, ...props }, forwardedRef) => {
|
|
278
|
-
const
|
|
278
|
+
const Root5 = asChild ? Slot2 : Primitive2.span;
|
|
279
279
|
const { tx } = useThemeContext();
|
|
280
280
|
const { descriptionId } = useAvatarContext("AvatarDescription");
|
|
281
|
-
return /* @__PURE__ */ React4.createElement(
|
|
281
|
+
return /* @__PURE__ */ React4.createElement(Root5, {
|
|
282
282
|
...props,
|
|
283
283
|
id: descriptionId,
|
|
284
284
|
ref: forwardedRef,
|
|
@@ -441,8 +441,8 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
441
441
|
import React6, { forwardRef as forwardRef5 } from "react";
|
|
442
442
|
var Link = /* @__PURE__ */ forwardRef5(({ asChild, variant, classNames, ...props }, forwardedRef) => {
|
|
443
443
|
const { tx } = useThemeContext();
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */ React6.createElement(
|
|
444
|
+
const Root5 = asChild ? Slot3 : Primitive3.a;
|
|
445
|
+
return /* @__PURE__ */ React6.createElement(Root5, {
|
|
446
446
|
...props,
|
|
447
447
|
className: tx("link.root", "link", {
|
|
448
448
|
variant
|
|
@@ -454,8 +454,8 @@ var Link = /* @__PURE__ */ forwardRef5(({ asChild, variant, classNames, ...props
|
|
|
454
454
|
// packages/ui/react-ui/src/components/Breadcrumb/Breadcrumb.tsx
|
|
455
455
|
var BreadcrumbRoot = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
456
456
|
const { tx } = useThemeContext();
|
|
457
|
-
const
|
|
458
|
-
return /* @__PURE__ */ React7.createElement(
|
|
457
|
+
const Root5 = asChild ? Slot4 : Primitive4.div;
|
|
458
|
+
return /* @__PURE__ */ React7.createElement(Root5, {
|
|
459
459
|
role: "navigation",
|
|
460
460
|
...props,
|
|
461
461
|
className: tx("breadcrumb.root", "breadcrumb", {}, classNames),
|
|
@@ -464,8 +464,8 @@ var BreadcrumbRoot = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...prop
|
|
|
464
464
|
});
|
|
465
465
|
var BreadcrumbList = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
466
466
|
const { tx } = useThemeContext();
|
|
467
|
-
const
|
|
468
|
-
return /* @__PURE__ */ React7.createElement(
|
|
467
|
+
const Root5 = asChild ? Slot4 : Primitive4.ol;
|
|
468
|
+
return /* @__PURE__ */ React7.createElement(Root5, {
|
|
469
469
|
role: "list",
|
|
470
470
|
...props,
|
|
471
471
|
className: tx("breadcrumb.list", "breadcrumb__list", {}, classNames),
|
|
@@ -474,8 +474,8 @@ var BreadcrumbList = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...prop
|
|
|
474
474
|
});
|
|
475
475
|
var BreadcrumbListItem = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
476
476
|
const { tx } = useThemeContext();
|
|
477
|
-
const
|
|
478
|
-
return /* @__PURE__ */ React7.createElement(
|
|
477
|
+
const Root5 = asChild ? Slot4 : Primitive4.li;
|
|
478
|
+
return /* @__PURE__ */ React7.createElement(Root5, {
|
|
479
479
|
role: "listitem",
|
|
480
480
|
...props,
|
|
481
481
|
className: tx("breadcrumb.listItem", "breadcrumb__list__item", {}, classNames),
|
|
@@ -483,16 +483,16 @@ var BreadcrumbListItem = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...
|
|
|
483
483
|
});
|
|
484
484
|
});
|
|
485
485
|
var BreadcrumbLink = /* @__PURE__ */ forwardRef6(({ asChild, ...props }, forwardedRef) => {
|
|
486
|
-
const
|
|
487
|
-
return /* @__PURE__ */ React7.createElement(
|
|
486
|
+
const Root5 = asChild ? Slot4 : Link;
|
|
487
|
+
return /* @__PURE__ */ React7.createElement(Root5, {
|
|
488
488
|
...props,
|
|
489
489
|
ref: forwardedRef
|
|
490
490
|
});
|
|
491
491
|
});
|
|
492
492
|
var BreadcrumbCurrent = /* @__PURE__ */ forwardRef6(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
493
493
|
const { tx } = useThemeContext();
|
|
494
|
-
const
|
|
495
|
-
return /* @__PURE__ */ React7.createElement(
|
|
494
|
+
const Root5 = asChild ? Slot4 : "h1";
|
|
495
|
+
return /* @__PURE__ */ React7.createElement(Root5, {
|
|
496
496
|
...props,
|
|
497
497
|
"aria-current": "page",
|
|
498
498
|
className: tx("breadcrumb.current", "breadcrumb__item__heading--current", {}, classNames),
|
|
@@ -523,19 +523,19 @@ var Breadcrumb = {
|
|
|
523
523
|
import { createContext as createContext3 } from "@radix-ui/react-context";
|
|
524
524
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
525
525
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
526
|
-
import React8, { forwardRef as forwardRef7 } from "react";
|
|
526
|
+
import React8, { forwardRef as forwardRef7, memo as memo2 } from "react";
|
|
527
527
|
var BUTTON_GROUP_NAME = "ButtonGroup";
|
|
528
528
|
var BUTTON_NAME = "Button";
|
|
529
529
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext3(BUTTON_GROUP_NAME, {
|
|
530
530
|
inGroup: false
|
|
531
531
|
});
|
|
532
|
-
var Button = /* @__PURE__ */ forwardRef7(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
532
|
+
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef7(({ classNames, children, density: propsDensity, elevation: propsElevation, variant = "default", asChild, ...props }, ref) => {
|
|
533
533
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
534
534
|
const { tx } = useThemeContext();
|
|
535
535
|
const elevation = useElevationContext(propsElevation);
|
|
536
536
|
const density = useDensityContext(propsDensity);
|
|
537
|
-
const
|
|
538
|
-
return /* @__PURE__ */ React8.createElement(
|
|
537
|
+
const Root5 = asChild ? Slot5 : Primitive5.button;
|
|
538
|
+
return /* @__PURE__ */ React8.createElement(Root5, {
|
|
539
539
|
ref,
|
|
540
540
|
...props,
|
|
541
541
|
"data-variant": variant,
|
|
@@ -552,13 +552,13 @@ var Button = /* @__PURE__ */ forwardRef7(({ classNames, children, density: props
|
|
|
552
552
|
disabled: true
|
|
553
553
|
}
|
|
554
554
|
}, children);
|
|
555
|
-
});
|
|
555
|
+
}));
|
|
556
556
|
Button.displayName = BUTTON_NAME;
|
|
557
557
|
var ButtonGroup = /* @__PURE__ */ forwardRef7(({ children, elevation: propsElevation, classNames, asChild, ...props }, forwardedRef) => {
|
|
558
558
|
const { tx } = useThemeContext();
|
|
559
559
|
const elevation = useElevationContext(propsElevation);
|
|
560
|
-
const
|
|
561
|
-
return /* @__PURE__ */ React8.createElement(
|
|
560
|
+
const Root5 = asChild ? Slot5 : Primitive5.div;
|
|
561
|
+
return /* @__PURE__ */ React8.createElement(Root5, {
|
|
562
562
|
role: "none",
|
|
563
563
|
...props,
|
|
564
564
|
className: tx("button.group", "button-group", {
|
|
@@ -788,8 +788,8 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef12(({ classNames, children, .
|
|
|
788
788
|
});
|
|
789
789
|
var ContextMenuViewport = /* @__PURE__ */ forwardRef12(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
790
790
|
const { tx } = useThemeContext();
|
|
791
|
-
const
|
|
792
|
-
return /* @__PURE__ */ React14.createElement(
|
|
791
|
+
const Root5 = asChild ? Slot6 : Primitive6.div;
|
|
792
|
+
return /* @__PURE__ */ React14.createElement(Root5, {
|
|
793
793
|
...props,
|
|
794
794
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
795
795
|
ref: forwardedRef
|
|
@@ -853,99 +853,364 @@ var ContextMenu2 = {
|
|
|
853
853
|
};
|
|
854
854
|
|
|
855
855
|
// packages/ui/react-ui/src/components/Menus/DropdownMenu.tsx
|
|
856
|
-
import
|
|
856
|
+
import { composeEventHandlers } from "@radix-ui/primitive";
|
|
857
|
+
import { composeRefs } from "@radix-ui/react-compose-refs";
|
|
858
|
+
import { createContextScope } from "@radix-ui/react-context";
|
|
859
|
+
import { useId as useId3 } from "@radix-ui/react-id";
|
|
860
|
+
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
861
|
+
import { createMenuScope } from "@radix-ui/react-menu";
|
|
857
862
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
858
863
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
859
|
-
import
|
|
860
|
-
|
|
861
|
-
var
|
|
862
|
-
var
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
var
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
864
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
865
|
+
import React15, { useRef, useCallback, forwardRef as forwardRef13, useEffect as useEffect3 } from "react";
|
|
866
|
+
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
867
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
868
|
+
createMenuScope
|
|
869
|
+
]);
|
|
870
|
+
var useMenuScope = createMenuScope();
|
|
871
|
+
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
872
|
+
var DropdownMenuRoot = (props) => {
|
|
873
|
+
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
874
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
875
|
+
const triggerRef = useRef(null);
|
|
876
|
+
const [open = false, setOpen] = useControllableState({
|
|
877
|
+
prop: openProp,
|
|
878
|
+
defaultProp: defaultOpen,
|
|
879
|
+
onChange: onOpenChange
|
|
880
|
+
});
|
|
881
|
+
return /* @__PURE__ */ React15.createElement(DropdownMenuProvider, {
|
|
882
|
+
scope: __scopeDropdownMenu,
|
|
883
|
+
triggerId: useId3(),
|
|
884
|
+
triggerRef,
|
|
885
|
+
contentId: useId3(),
|
|
886
|
+
open,
|
|
887
|
+
onOpenChange: setOpen,
|
|
888
|
+
onOpenToggle: useCallback(() => setOpen((prevOpen) => !prevOpen), [
|
|
889
|
+
setOpen
|
|
890
|
+
]),
|
|
891
|
+
modal
|
|
892
|
+
}, /* @__PURE__ */ React15.createElement(MenuPrimitive.Root, {
|
|
893
|
+
...menuScope,
|
|
894
|
+
open,
|
|
895
|
+
onOpenChange: setOpen,
|
|
896
|
+
dir,
|
|
897
|
+
modal
|
|
875
898
|
}, children));
|
|
899
|
+
};
|
|
900
|
+
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
901
|
+
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
902
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
903
|
+
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
904
|
+
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
905
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
906
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Anchor, {
|
|
907
|
+
asChild: true,
|
|
908
|
+
...menuScope
|
|
909
|
+
}, /* @__PURE__ */ React15.createElement(Primitive7.button, {
|
|
910
|
+
type: "button",
|
|
911
|
+
id: context.triggerId,
|
|
912
|
+
"aria-haspopup": "menu",
|
|
913
|
+
"aria-expanded": context.open,
|
|
914
|
+
"aria-controls": context.open ? context.contentId : void 0,
|
|
915
|
+
"data-state": context.open ? "open" : "closed",
|
|
916
|
+
"data-disabled": disabled ? "" : void 0,
|
|
917
|
+
disabled,
|
|
918
|
+
...triggerProps,
|
|
919
|
+
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
920
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
921
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
922
|
+
context.onOpenToggle();
|
|
923
|
+
if (!context.open) {
|
|
924
|
+
event.preventDefault();
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
}),
|
|
928
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
929
|
+
if (disabled) {
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
if ([
|
|
933
|
+
"Enter",
|
|
934
|
+
" "
|
|
935
|
+
].includes(event.key)) {
|
|
936
|
+
context.onOpenToggle();
|
|
937
|
+
}
|
|
938
|
+
if (event.key === "ArrowDown") {
|
|
939
|
+
context.onOpenChange(true);
|
|
940
|
+
}
|
|
941
|
+
if ([
|
|
942
|
+
"Enter",
|
|
943
|
+
" ",
|
|
944
|
+
"ArrowDown"
|
|
945
|
+
].includes(event.key)) {
|
|
946
|
+
event.preventDefault();
|
|
947
|
+
}
|
|
948
|
+
})
|
|
949
|
+
}));
|
|
876
950
|
});
|
|
951
|
+
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
952
|
+
var VIRTUAL_TRIGGER_NAME = "DropdownMenuVirtualTrigger";
|
|
953
|
+
var DropdownMenuVirtualTrigger = (props) => {
|
|
954
|
+
const { __scopeDropdownMenu, virtualRef } = props;
|
|
955
|
+
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
956
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
957
|
+
useEffect3(() => {
|
|
958
|
+
if (virtualRef.current) {
|
|
959
|
+
context.triggerRef.current = virtualRef.current;
|
|
960
|
+
}
|
|
961
|
+
});
|
|
962
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Anchor, {
|
|
963
|
+
...menuScope,
|
|
964
|
+
virtualRef
|
|
965
|
+
});
|
|
966
|
+
};
|
|
967
|
+
DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
|
|
968
|
+
var PORTAL_NAME = "DropdownMenuPortal";
|
|
969
|
+
var DropdownMenuPortal = (props) => {
|
|
970
|
+
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
971
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
972
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Portal, {
|
|
973
|
+
...menuScope,
|
|
974
|
+
...portalProps
|
|
975
|
+
});
|
|
976
|
+
};
|
|
977
|
+
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
877
978
|
var DropdownMenuViewport = /* @__PURE__ */ forwardRef13(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
878
979
|
const { tx } = useThemeContext();
|
|
879
|
-
const
|
|
880
|
-
return /* @__PURE__ */ React15.createElement(
|
|
980
|
+
const Root5 = asChild ? Slot7 : Primitive7.div;
|
|
981
|
+
return /* @__PURE__ */ React15.createElement(Root5, {
|
|
881
982
|
...props,
|
|
882
983
|
className: tx("menu.viewport", "menu__viewport", {}, classNames),
|
|
883
984
|
ref: forwardedRef
|
|
884
985
|
}, children);
|
|
885
986
|
});
|
|
886
|
-
var
|
|
987
|
+
var CONTENT_NAME = "DropdownMenuContent";
|
|
988
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
989
|
+
const { __scopeDropdownMenu, classNames, ...contentProps } = props;
|
|
990
|
+
const { tx } = useThemeContext();
|
|
991
|
+
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
992
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
993
|
+
const hasInteractedOutsideRef = useRef(false);
|
|
994
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Content, {
|
|
995
|
+
id: context.contentId,
|
|
996
|
+
"aria-labelledby": context.triggerId,
|
|
997
|
+
...menuScope,
|
|
998
|
+
...contentProps,
|
|
999
|
+
ref: forwardedRef,
|
|
1000
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1001
|
+
if (!hasInteractedOutsideRef.current) {
|
|
1002
|
+
context.triggerRef.current?.focus();
|
|
1003
|
+
}
|
|
1004
|
+
hasInteractedOutsideRef.current = false;
|
|
1005
|
+
event.preventDefault();
|
|
1006
|
+
}),
|
|
1007
|
+
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
1008
|
+
const originalEvent = event.detail.originalEvent;
|
|
1009
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
1010
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
1011
|
+
if (!context.modal || isRightClick) {
|
|
1012
|
+
hasInteractedOutsideRef.current = true;
|
|
1013
|
+
}
|
|
1014
|
+
}),
|
|
1015
|
+
className: tx("menu.content", "menu", {}, classNames),
|
|
1016
|
+
style: {
|
|
1017
|
+
...props.style,
|
|
1018
|
+
// re-namespace exposed content custom properties
|
|
1019
|
+
...{
|
|
1020
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1021
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
1022
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
1023
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1024
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
});
|
|
1028
|
+
});
|
|
1029
|
+
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1030
|
+
var GROUP_NAME = "DropdownMenuGroup";
|
|
1031
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1032
|
+
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1033
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1034
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Group, {
|
|
1035
|
+
...menuScope,
|
|
1036
|
+
...groupProps,
|
|
1037
|
+
ref: forwardedRef
|
|
1038
|
+
});
|
|
1039
|
+
});
|
|
1040
|
+
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1041
|
+
var LABEL_NAME = "DropdownMenuLabel";
|
|
1042
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1043
|
+
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1044
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
887
1045
|
const { tx } = useThemeContext();
|
|
888
|
-
return /* @__PURE__ */ React15.createElement(
|
|
889
|
-
...
|
|
890
|
-
|
|
1046
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Label, {
|
|
1047
|
+
...menuScope,
|
|
1048
|
+
...labelProps,
|
|
1049
|
+
className: tx("menu.groupLabel", "menu__group__label", {}, classNames),
|
|
891
1050
|
ref: forwardedRef
|
|
892
1051
|
});
|
|
893
1052
|
});
|
|
894
|
-
|
|
895
|
-
var
|
|
896
|
-
var DropdownMenuItem = /* @__PURE__ */ forwardRef13((
|
|
1053
|
+
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1054
|
+
var ITEM_NAME = "DropdownMenuItem";
|
|
1055
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1056
|
+
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1057
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
897
1058
|
const { tx } = useThemeContext();
|
|
898
|
-
return /* @__PURE__ */ React15.createElement(
|
|
899
|
-
...
|
|
1059
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Item, {
|
|
1060
|
+
...menuScope,
|
|
1061
|
+
...itemProps,
|
|
900
1062
|
className: tx("menu.item", "menu__item", {}, classNames),
|
|
901
1063
|
ref: forwardedRef
|
|
902
1064
|
});
|
|
903
1065
|
});
|
|
904
|
-
|
|
1066
|
+
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1067
|
+
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1068
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1069
|
+
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1070
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
905
1071
|
const { tx } = useThemeContext();
|
|
906
|
-
return /* @__PURE__ */ React15.createElement(
|
|
907
|
-
...
|
|
1072
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.CheckboxItem, {
|
|
1073
|
+
...menuScope,
|
|
1074
|
+
...checkboxItemProps,
|
|
908
1075
|
className: tx("menu.item", "menu__item--checkbox", {}, classNames),
|
|
909
1076
|
ref: forwardedRef
|
|
910
1077
|
});
|
|
911
1078
|
});
|
|
912
|
-
|
|
1079
|
+
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1080
|
+
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
1081
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1082
|
+
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1083
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1084
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.RadioGroup, {
|
|
1085
|
+
...menuScope,
|
|
1086
|
+
...radioGroupProps,
|
|
1087
|
+
ref: forwardedRef
|
|
1088
|
+
});
|
|
1089
|
+
});
|
|
1090
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1091
|
+
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
1092
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1093
|
+
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
1094
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1095
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.RadioItem, {
|
|
1096
|
+
...menuScope,
|
|
1097
|
+
...radioItemProps,
|
|
1098
|
+
ref: forwardedRef
|
|
1099
|
+
});
|
|
1100
|
+
});
|
|
1101
|
+
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1102
|
+
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1103
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1104
|
+
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1105
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1106
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.ItemIndicator, {
|
|
1107
|
+
...menuScope,
|
|
1108
|
+
...itemIndicatorProps,
|
|
1109
|
+
ref: forwardedRef
|
|
1110
|
+
});
|
|
1111
|
+
});
|
|
1112
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1113
|
+
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1114
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1115
|
+
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1116
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
913
1117
|
const { tx } = useThemeContext();
|
|
914
|
-
return /* @__PURE__ */ React15.createElement(
|
|
915
|
-
...
|
|
1118
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Separator, {
|
|
1119
|
+
...menuScope,
|
|
1120
|
+
...separatorProps,
|
|
916
1121
|
className: tx("menu.separator", "menu__item", {}, classNames),
|
|
917
1122
|
ref: forwardedRef
|
|
918
1123
|
});
|
|
919
1124
|
});
|
|
920
|
-
|
|
1125
|
+
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1126
|
+
var ARROW_NAME = "DropdownMenuArrow";
|
|
1127
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1128
|
+
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1129
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
921
1130
|
const { tx } = useThemeContext();
|
|
922
|
-
return /* @__PURE__ */ React15.createElement(
|
|
923
|
-
...
|
|
924
|
-
|
|
1131
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Arrow, {
|
|
1132
|
+
...menuScope,
|
|
1133
|
+
...arrowProps,
|
|
1134
|
+
className: tx("menu.arrow", "menu__arrow", {}, classNames),
|
|
925
1135
|
ref: forwardedRef
|
|
926
1136
|
});
|
|
927
1137
|
});
|
|
928
|
-
|
|
1138
|
+
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
1139
|
+
var DropdownMenuSub = (props) => {
|
|
1140
|
+
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
1141
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1142
|
+
const [open = false, setOpen] = useControllableState({
|
|
1143
|
+
prop: openProp,
|
|
1144
|
+
defaultProp: defaultOpen,
|
|
1145
|
+
onChange: onOpenChange
|
|
1146
|
+
});
|
|
1147
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.Sub, {
|
|
1148
|
+
...menuScope,
|
|
1149
|
+
open,
|
|
1150
|
+
onOpenChange: setOpen
|
|
1151
|
+
}, children);
|
|
1152
|
+
};
|
|
1153
|
+
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1154
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1155
|
+
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1156
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1157
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.SubTrigger, {
|
|
1158
|
+
...menuScope,
|
|
1159
|
+
...subTriggerProps,
|
|
1160
|
+
ref: forwardedRef
|
|
1161
|
+
});
|
|
1162
|
+
});
|
|
1163
|
+
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1164
|
+
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1165
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1166
|
+
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1167
|
+
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1168
|
+
return /* @__PURE__ */ React15.createElement(MenuPrimitive.SubContent, {
|
|
1169
|
+
...menuScope,
|
|
1170
|
+
...subContentProps,
|
|
1171
|
+
ref: forwardedRef,
|
|
1172
|
+
style: {
|
|
1173
|
+
...props.style,
|
|
1174
|
+
// re-namespace exposed content custom properties
|
|
1175
|
+
...{
|
|
1176
|
+
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
1177
|
+
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
1178
|
+
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
1179
|
+
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
1180
|
+
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
});
|
|
1184
|
+
});
|
|
1185
|
+
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
1186
|
+
var DropdownMenu = {
|
|
929
1187
|
Root: DropdownMenuRoot,
|
|
930
1188
|
Trigger: DropdownMenuTrigger,
|
|
1189
|
+
VirtualTrigger: DropdownMenuVirtualTrigger,
|
|
931
1190
|
Portal: DropdownMenuPortal,
|
|
932
1191
|
Content: DropdownMenuContent,
|
|
933
1192
|
Viewport: DropdownMenuViewport,
|
|
934
|
-
Arrow: DropdownMenuArrow,
|
|
935
1193
|
Group: DropdownMenuGroup,
|
|
1194
|
+
GroupLabel: DropdownMenuGroupLabel,
|
|
936
1195
|
Item: DropdownMenuItem,
|
|
937
1196
|
CheckboxItem: DropdownMenuCheckboxItem,
|
|
1197
|
+
RadioGroup: DropdownMenuRadioGroup,
|
|
1198
|
+
RadioItem: DropdownMenuRadioItem,
|
|
938
1199
|
ItemIndicator: DropdownMenuItemIndicator,
|
|
939
1200
|
Separator: DropdownMenuSeparator,
|
|
940
|
-
|
|
1201
|
+
Arrow: DropdownMenuArrow,
|
|
1202
|
+
Sub: DropdownMenuSub,
|
|
1203
|
+
SubTrigger: DropdownMenuSubTrigger,
|
|
1204
|
+
SubContent: DropdownMenuSubContent
|
|
941
1205
|
};
|
|
1206
|
+
var useDropdownMenuMenuScope = useMenuScope;
|
|
942
1207
|
|
|
943
1208
|
// packages/ui/react-ui/src/components/Input/Input.tsx
|
|
944
1209
|
import { Check, Minus } from "@phosphor-icons/react";
|
|
945
1210
|
import { Root as CheckboxPrimitive, Indicator as CheckboxIndicatorPrimitive } from "@radix-ui/react-checkbox";
|
|
946
1211
|
import { Root as SwitchPrimitive, Thumb as SwitchThumbPrimitive } from "@radix-ui/react-switch";
|
|
947
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
948
|
-
import React16, { forwardRef as forwardRef14, Fragment, useCallback } from "react";
|
|
1212
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1213
|
+
import React16, { forwardRef as forwardRef14, Fragment, useCallback as useCallback2 } from "react";
|
|
949
1214
|
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";
|
|
950
1215
|
var Label3 = /* @__PURE__ */ forwardRef14(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
951
1216
|
const { tx } = useThemeContext();
|
|
@@ -994,7 +1259,7 @@ var PinInput = /* @__PURE__ */ forwardRef14(({ density: propsDensity, elevation:
|
|
|
994
1259
|
const { tx } = useThemeContext();
|
|
995
1260
|
const density = useDensityContext(propsDensity);
|
|
996
1261
|
const elevation = useElevationContext(propsElevation);
|
|
997
|
-
const segmentClassName =
|
|
1262
|
+
const segmentClassName = useCallback2(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
998
1263
|
variant: "static",
|
|
999
1264
|
focused,
|
|
1000
1265
|
disabled: props.disabled,
|
|
@@ -1064,7 +1329,7 @@ var TextArea = /* @__PURE__ */ forwardRef14(({ __inputScope, classNames, density
|
|
|
1064
1329
|
});
|
|
1065
1330
|
});
|
|
1066
1331
|
var Checkbox = /* @__PURE__ */ forwardRef14(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, weight = "bold", classNames, ...props }, forwardedRef) => {
|
|
1067
|
-
const [checked, onCheckedChange] =
|
|
1332
|
+
const [checked, onCheckedChange] = useControllableState2({
|
|
1068
1333
|
prop: propsChecked,
|
|
1069
1334
|
defaultProp: propsDefaultChecked,
|
|
1070
1335
|
onChange: propsOnCheckedChange
|
|
@@ -1097,7 +1362,7 @@ var Checkbox = /* @__PURE__ */ forwardRef14(({ __inputScope, checked: propsCheck
|
|
|
1097
1362
|
});
|
|
1098
1363
|
var Switch = /* @__PURE__ */ forwardRef14(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size = 5, classNames, ...props }, forwardedRef) => {
|
|
1099
1364
|
const { tx } = useThemeContext();
|
|
1100
|
-
const [checked, onCheckedChange] =
|
|
1365
|
+
const [checked, onCheckedChange] = useControllableState2({
|
|
1101
1366
|
prop: propsChecked,
|
|
1102
1367
|
defaultProp: propsDefaultChecked,
|
|
1103
1368
|
onChange: propsOnCheckedChange
|
|
@@ -1166,10 +1431,10 @@ var List = /* @__PURE__ */ forwardRef15(({ classNames, children, ...props }, for
|
|
|
1166
1431
|
}, children));
|
|
1167
1432
|
});
|
|
1168
1433
|
var ListItemEndcap = /* @__PURE__ */ forwardRef15(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
1169
|
-
const
|
|
1434
|
+
const Root5 = asChild ? Slot8 : "div";
|
|
1170
1435
|
const density = useDensityContext();
|
|
1171
1436
|
const { tx } = useThemeContext();
|
|
1172
|
-
return /* @__PURE__ */ React18.createElement(
|
|
1437
|
+
return /* @__PURE__ */ React18.createElement(Root5, {
|
|
1173
1438
|
...!asChild && {
|
|
1174
1439
|
role: "none"
|
|
1175
1440
|
},
|
|
@@ -1280,25 +1545,25 @@ var TreeItem = {
|
|
|
1280
1545
|
|
|
1281
1546
|
// packages/ui/react-ui/src/components/Lists/Treegrid.tsx
|
|
1282
1547
|
import { useFocusableGroup, useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
1283
|
-
import { createContextScope } from "@radix-ui/react-context";
|
|
1548
|
+
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
1284
1549
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
1285
1550
|
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
1286
|
-
import { useControllableState as
|
|
1551
|
+
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
1287
1552
|
import React20, { forwardRef as forwardRef17 } from "react";
|
|
1288
1553
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
1289
|
-
var [createTreegridRowContext, createTreegridRowScope] =
|
|
1554
|
+
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
1290
1555
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
1291
1556
|
var PATH_SEPARATOR = "~";
|
|
1292
1557
|
var PARENT_OF_SEPARATOR = " ";
|
|
1293
1558
|
var TreegridRoot = /* @__PURE__ */ forwardRef17(({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
1294
1559
|
const { tx } = useThemeContext();
|
|
1295
|
-
const
|
|
1560
|
+
const Root5 = asChild ? Slot9 : Primitive8.div;
|
|
1296
1561
|
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
1297
1562
|
axis: "vertical",
|
|
1298
1563
|
tabbable: false,
|
|
1299
1564
|
circular: true
|
|
1300
1565
|
});
|
|
1301
|
-
return /* @__PURE__ */ React20.createElement(
|
|
1566
|
+
return /* @__PURE__ */ React20.createElement(Root5, {
|
|
1302
1567
|
role: "treegrid",
|
|
1303
1568
|
...arrowNavigationAttrs,
|
|
1304
1569
|
...props,
|
|
@@ -1312,10 +1577,10 @@ var TreegridRoot = /* @__PURE__ */ forwardRef17(({ asChild, classNames, children
|
|
|
1312
1577
|
});
|
|
1313
1578
|
var TreegridRow = /* @__PURE__ */ forwardRef17(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
1314
1579
|
const { tx } = useThemeContext();
|
|
1315
|
-
const
|
|
1580
|
+
const Root5 = asChild ? Slot9 : Primitive8.div;
|
|
1316
1581
|
const pathParts = id.split(PATH_SEPARATOR);
|
|
1317
1582
|
const level = pathParts.length - 1;
|
|
1318
|
-
const [open, onOpenChange] =
|
|
1583
|
+
const [open, onOpenChange] = useControllableState3({
|
|
1319
1584
|
prop: propsOpen,
|
|
1320
1585
|
onChange: propsOnOpenChange,
|
|
1321
1586
|
defaultProp: defaultOpen
|
|
@@ -1333,7 +1598,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef17(({ __treegridRowScope, asChild, c
|
|
|
1333
1598
|
open,
|
|
1334
1599
|
onOpenChange,
|
|
1335
1600
|
scope: __treegridRowScope
|
|
1336
|
-
}, /* @__PURE__ */ React20.createElement(
|
|
1601
|
+
}, /* @__PURE__ */ React20.createElement(Root5, {
|
|
1337
1602
|
role: "row",
|
|
1338
1603
|
"aria-level": level,
|
|
1339
1604
|
className: tx("treegrid.row", "treegrid__row", {
|
|
@@ -1382,13 +1647,13 @@ import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
|
1382
1647
|
import { Root as DialogRoot2, DialogContent as DialogContent2 } from "@radix-ui/react-dialog";
|
|
1383
1648
|
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
1384
1649
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
1385
|
-
import { useControllableState as
|
|
1386
|
-
import React21, { forwardRef as forwardRef18, useCallback as
|
|
1650
|
+
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
1651
|
+
import React21, { forwardRef as forwardRef18, useCallback as useCallback4, useEffect as useEffect5, useRef as useRef2, useState as useState4 } from "react";
|
|
1387
1652
|
import { log } from "@dxos/log";
|
|
1388
1653
|
import { useMediaQuery, useForwardedRef } from "@dxos/react-hooks";
|
|
1389
1654
|
|
|
1390
1655
|
// packages/ui/react-ui/src/components/Main/useSwipeToDismiss.ts
|
|
1391
|
-
import { useCallback as
|
|
1656
|
+
import { useCallback as useCallback3, useEffect as useEffect4, useState as useState3 } from "react";
|
|
1392
1657
|
var MotionState;
|
|
1393
1658
|
(function(MotionState2) {
|
|
1394
1659
|
MotionState2[MotionState2["IDLE"] = 0] = "IDLE";
|
|
@@ -1405,20 +1670,20 @@ var useSwipeToDismiss = (ref, {
|
|
|
1405
1670
|
const $root = ref.current;
|
|
1406
1671
|
const [motionState, setMotionState] = useState3(0);
|
|
1407
1672
|
const [gestureStartX, setGestureStartX] = useState3(0);
|
|
1408
|
-
const setIdle =
|
|
1673
|
+
const setIdle = useCallback3(() => {
|
|
1409
1674
|
setMotionState(0);
|
|
1410
1675
|
$root?.style.removeProperty("inset-inline-start");
|
|
1411
1676
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
1412
1677
|
}, [
|
|
1413
1678
|
$root
|
|
1414
1679
|
]);
|
|
1415
|
-
const setFollowing =
|
|
1680
|
+
const setFollowing = useCallback3(() => {
|
|
1416
1681
|
setMotionState(2);
|
|
1417
1682
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
1418
1683
|
}, [
|
|
1419
1684
|
$root
|
|
1420
1685
|
]);
|
|
1421
|
-
const handlePointerDown =
|
|
1686
|
+
const handlePointerDown = useCallback3(({ screenX }) => {
|
|
1422
1687
|
if (motionState === 0) {
|
|
1423
1688
|
setMotionState(1);
|
|
1424
1689
|
setGestureStartX(screenX);
|
|
@@ -1426,7 +1691,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1426
1691
|
}, [
|
|
1427
1692
|
motionState
|
|
1428
1693
|
]);
|
|
1429
|
-
const handlePointerMove =
|
|
1694
|
+
const handlePointerMove = useCallback3(({ screenX }) => {
|
|
1430
1695
|
if ($root) {
|
|
1431
1696
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
1432
1697
|
switch (motionState) {
|
|
@@ -1450,12 +1715,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
1450
1715
|
motionState,
|
|
1451
1716
|
gestureStartX
|
|
1452
1717
|
]);
|
|
1453
|
-
const handlePointerUp =
|
|
1718
|
+
const handlePointerUp = useCallback3(() => {
|
|
1454
1719
|
setIdle();
|
|
1455
1720
|
}, [
|
|
1456
1721
|
setIdle
|
|
1457
1722
|
]);
|
|
1458
|
-
|
|
1723
|
+
useEffect4(() => {
|
|
1459
1724
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
1460
1725
|
return () => {
|
|
1461
1726
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -1464,7 +1729,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1464
1729
|
$root,
|
|
1465
1730
|
handlePointerDown
|
|
1466
1731
|
]);
|
|
1467
|
-
|
|
1732
|
+
useEffect4(() => {
|
|
1468
1733
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
1469
1734
|
return () => {
|
|
1470
1735
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -1473,7 +1738,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1473
1738
|
$root,
|
|
1474
1739
|
handlePointerMove
|
|
1475
1740
|
]);
|
|
1476
|
-
|
|
1741
|
+
useEffect4(() => {
|
|
1477
1742
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
1478
1743
|
return () => {
|
|
1479
1744
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -1493,7 +1758,7 @@ var MAIN_NAME = "Main";
|
|
|
1493
1758
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
1494
1759
|
var landmarkAttr = "data-main-landmark";
|
|
1495
1760
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
1496
|
-
const handleKeyDown =
|
|
1761
|
+
const handleKeyDown = useCallback4((event) => {
|
|
1497
1762
|
const target = event.target;
|
|
1498
1763
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
1499
1764
|
event.preventDefault();
|
|
@@ -1546,26 +1811,26 @@ var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
|
1546
1811
|
return {
|
|
1547
1812
|
navigationSidebarOpen,
|
|
1548
1813
|
setNavigationSidebarOpen,
|
|
1549
|
-
toggleNavigationSidebar:
|
|
1814
|
+
toggleNavigationSidebar: useCallback4(() => setNavigationSidebarOpen(!navigationSidebarOpen), [
|
|
1550
1815
|
navigationSidebarOpen,
|
|
1551
1816
|
setNavigationSidebarOpen
|
|
1552
1817
|
]),
|
|
1553
|
-
openNavigationSidebar:
|
|
1818
|
+
openNavigationSidebar: useCallback4(() => setNavigationSidebarOpen(true), [
|
|
1554
1819
|
setNavigationSidebarOpen
|
|
1555
1820
|
]),
|
|
1556
|
-
closeNavigationSidebar:
|
|
1821
|
+
closeNavigationSidebar: useCallback4(() => setNavigationSidebarOpen(false), [
|
|
1557
1822
|
setNavigationSidebarOpen
|
|
1558
1823
|
]),
|
|
1559
1824
|
complementarySidebarOpen,
|
|
1560
1825
|
setComplementarySidebarOpen,
|
|
1561
|
-
toggleComplementarySidebar:
|
|
1826
|
+
toggleComplementarySidebar: useCallback4(() => setComplementarySidebarOpen(!complementarySidebarOpen), [
|
|
1562
1827
|
complementarySidebarOpen,
|
|
1563
1828
|
setComplementarySidebarOpen
|
|
1564
1829
|
]),
|
|
1565
|
-
openComplementarySidebar:
|
|
1830
|
+
openComplementarySidebar: useCallback4(() => setComplementarySidebarOpen(true), [
|
|
1566
1831
|
setComplementarySidebarOpen
|
|
1567
1832
|
]),
|
|
1568
|
-
closeComplementarySidebar:
|
|
1833
|
+
closeComplementarySidebar: useCallback4(() => setComplementarySidebarOpen(false), [
|
|
1569
1834
|
setComplementarySidebarOpen
|
|
1570
1835
|
])
|
|
1571
1836
|
};
|
|
@@ -1575,19 +1840,19 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
1575
1840
|
const [isLg] = useMediaQuery("lg", {
|
|
1576
1841
|
ssr: false
|
|
1577
1842
|
});
|
|
1578
|
-
const [navigationSidebarOpen = isLg, setNavigationSidebarOpen] =
|
|
1843
|
+
const [navigationSidebarOpen = isLg, setNavigationSidebarOpen] = useControllableState4({
|
|
1579
1844
|
prop: propsNavigationSidebarOpen,
|
|
1580
1845
|
defaultProp: defaultNavigationSidebarOpen,
|
|
1581
1846
|
onChange: onNavigationSidebarOpenChange
|
|
1582
1847
|
});
|
|
1583
|
-
const [complementarySidebarOpen = false, setComplementarySidebarOpen] =
|
|
1848
|
+
const [complementarySidebarOpen = false, setComplementarySidebarOpen] = useControllableState4({
|
|
1584
1849
|
prop: propsComplementarySidebarOpen,
|
|
1585
1850
|
defaultProp: defaultComplementarySidebarOpen,
|
|
1586
1851
|
onChange: onComplementarySidebarOpenChange
|
|
1587
1852
|
});
|
|
1588
1853
|
const [resizing, setResizing] = useState4(false);
|
|
1589
|
-
const resizeInterval =
|
|
1590
|
-
const handleResize =
|
|
1854
|
+
const resizeInterval = useRef2(null);
|
|
1855
|
+
const handleResize = useCallback4(() => {
|
|
1591
1856
|
setResizing(true);
|
|
1592
1857
|
if (resizeInterval.current) {
|
|
1593
1858
|
clearTimeout(resizeInterval.current);
|
|
@@ -1597,7 +1862,7 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
1597
1862
|
resizeInterval.current = null;
|
|
1598
1863
|
}, resizeDebounce);
|
|
1599
1864
|
}, []);
|
|
1600
|
-
|
|
1865
|
+
useEffect5(() => {
|
|
1601
1866
|
window.addEventListener("resize", handleResize);
|
|
1602
1867
|
return () => window.removeEventListener("resize", handleResize);
|
|
1603
1868
|
}, [
|
|
@@ -1622,11 +1887,11 @@ var MainSidebar = /* @__PURE__ */ forwardRef18(({ classNames, children, swipeToD
|
|
|
1622
1887
|
});
|
|
1623
1888
|
const { tx } = useThemeContext();
|
|
1624
1889
|
const ref = useForwardedRef(forwardedRef);
|
|
1625
|
-
const noopRef =
|
|
1890
|
+
const noopRef = useRef2(null);
|
|
1626
1891
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
1627
1892
|
onDismiss: () => setOpen(false)
|
|
1628
1893
|
});
|
|
1629
|
-
const handleKeyDown =
|
|
1894
|
+
const handleKeyDown = useCallback4((event) => {
|
|
1630
1895
|
if (event.key === "Escape") {
|
|
1631
1896
|
event.target.closest("[data-tabster]")?.focus();
|
|
1632
1897
|
}
|
|
@@ -1634,11 +1899,11 @@ var MainSidebar = /* @__PURE__ */ forwardRef18(({ classNames, children, swipeToD
|
|
|
1634
1899
|
}, [
|
|
1635
1900
|
props.onKeyDown
|
|
1636
1901
|
]);
|
|
1637
|
-
const
|
|
1902
|
+
const Root5 = isLg ? Primitive9.div : DialogContent2;
|
|
1638
1903
|
return /* @__PURE__ */ React21.createElement(DialogRoot2, {
|
|
1639
1904
|
open,
|
|
1640
1905
|
modal: false
|
|
1641
|
-
}, /* @__PURE__ */ React21.createElement(
|
|
1906
|
+
}, /* @__PURE__ */ React21.createElement(Root5, {
|
|
1642
1907
|
...!isLg && {
|
|
1643
1908
|
forceMount: true,
|
|
1644
1909
|
tabIndex: -1,
|
|
@@ -1689,9 +1954,9 @@ MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
|
1689
1954
|
var MainContent = /* @__PURE__ */ forwardRef18(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
1690
1955
|
const { navigationSidebarOpen, complementarySidebarOpen } = useMainContext(MAIN_NAME);
|
|
1691
1956
|
const { tx } = useThemeContext();
|
|
1692
|
-
const
|
|
1957
|
+
const Root5 = asChild ? Slot10 : role ? "div" : "main";
|
|
1693
1958
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
1694
|
-
return /* @__PURE__ */ React21.createElement(
|
|
1959
|
+
return /* @__PURE__ */ React21.createElement(Root5, {
|
|
1695
1960
|
role,
|
|
1696
1961
|
...handlesFocus && {
|
|
1697
1962
|
...mover
|
|
@@ -1732,9 +1997,9 @@ var MainOverlay = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwar
|
|
|
1732
1997
|
var MainNotch = /* @__PURE__ */ forwardRef18(({ classNames, ...props }, forwardedRef) => {
|
|
1733
1998
|
const { tx } = useThemeContext();
|
|
1734
1999
|
const { navigationSidebarOpen } = useMainContext(MAIN_NAME);
|
|
1735
|
-
const notchElement =
|
|
2000
|
+
const notchElement = useRef2(null);
|
|
1736
2001
|
const ref = useComposedRefs(forwardedRef, notchElement);
|
|
1737
|
-
const handleKeyDown =
|
|
2002
|
+
const handleKeyDown = useCallback4((event) => {
|
|
1738
2003
|
switch (event.key) {
|
|
1739
2004
|
case "Escape":
|
|
1740
2005
|
props?.onKeyDown?.(event);
|
|
@@ -1767,19 +2032,19 @@ import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
|
1767
2032
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
1768
2033
|
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
1769
2034
|
import React22, { forwardRef as forwardRef19 } from "react";
|
|
1770
|
-
import { useId as
|
|
2035
|
+
import { useId as useId4 } from "@dxos/react-hooks";
|
|
1771
2036
|
var MESSAGE_NAME = "Message";
|
|
1772
2037
|
var [MessageProvider, useMessageContext] = createContext9(MESSAGE_NAME);
|
|
1773
2038
|
var MessageRoot = /* @__PURE__ */ forwardRef19(({ asChild, valence, elevation: propsElevation, className, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
1774
2039
|
const { tx } = useThemeContext();
|
|
1775
|
-
const titleId =
|
|
1776
|
-
const descriptionId =
|
|
2040
|
+
const titleId = useId4("message__title", propsTitleId);
|
|
2041
|
+
const descriptionId = useId4("message__description", propsDescriptionId);
|
|
1777
2042
|
const elevation = useElevationContext(propsElevation);
|
|
1778
|
-
const
|
|
2043
|
+
const Root5 = asChild ? Slot11 : Primitive10.div;
|
|
1779
2044
|
return /* @__PURE__ */ React22.createElement(MessageProvider, {
|
|
1780
2045
|
titleId,
|
|
1781
2046
|
descriptionId
|
|
1782
|
-
}, /* @__PURE__ */ React22.createElement(
|
|
2047
|
+
}, /* @__PURE__ */ React22.createElement(Root5, {
|
|
1783
2048
|
...props,
|
|
1784
2049
|
className: tx("message.root", "message", {
|
|
1785
2050
|
valence,
|
|
@@ -1795,8 +2060,8 @@ var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
|
1795
2060
|
var MessageTitle = /* @__PURE__ */ forwardRef19(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
1796
2061
|
const { tx } = useThemeContext();
|
|
1797
2062
|
const { titleId } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
1798
|
-
const
|
|
1799
|
-
return /* @__PURE__ */ React22.createElement(
|
|
2063
|
+
const Root5 = asChild ? Slot11 : Primitive10.h2;
|
|
2064
|
+
return /* @__PURE__ */ React22.createElement(Root5, {
|
|
1800
2065
|
...props,
|
|
1801
2066
|
className: tx("message.title", "message__title", {}, className),
|
|
1802
2067
|
id: titleId,
|
|
@@ -1808,8 +2073,8 @@ var MESSAGE_BODY_NAME = "MessageBody";
|
|
|
1808
2073
|
var MessageBody = /* @__PURE__ */ forwardRef19(({ asChild, className, children, ...props }, forwardedRef) => {
|
|
1809
2074
|
const { tx } = useThemeContext();
|
|
1810
2075
|
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
1811
|
-
const
|
|
1812
|
-
return /* @__PURE__ */ React22.createElement(
|
|
2076
|
+
const Root5 = asChild ? Slot11 : Primitive10.p;
|
|
2077
|
+
return /* @__PURE__ */ React22.createElement(Root5, {
|
|
1813
2078
|
...props,
|
|
1814
2079
|
className: tx("message.body", "message__body", {}, className),
|
|
1815
2080
|
id: descriptionId,
|
|
@@ -1824,39 +2089,298 @@ var Message = {
|
|
|
1824
2089
|
};
|
|
1825
2090
|
|
|
1826
2091
|
// packages/ui/react-ui/src/components/Popover/Popover.tsx
|
|
1827
|
-
import {
|
|
2092
|
+
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
2093
|
+
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
2094
|
+
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
2095
|
+
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
2096
|
+
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
2097
|
+
import { FocusScope } from "@radix-ui/react-focus-scope";
|
|
2098
|
+
import { useId as useId5 } from "@radix-ui/react-id";
|
|
2099
|
+
import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
2100
|
+
import { createPopperScope } from "@radix-ui/react-popper";
|
|
2101
|
+
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
2102
|
+
import { Presence } from "@radix-ui/react-presence";
|
|
1828
2103
|
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
1829
2104
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
1830
|
-
import
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
var
|
|
1835
|
-
var
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
2105
|
+
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2106
|
+
import { hideOthers } from "aria-hidden";
|
|
2107
|
+
import React23, { forwardRef as forwardRef20, useRef as useRef3, useCallback as useCallback5, useState as useState5, useEffect as useEffect6 } from "react";
|
|
2108
|
+
import { RemoveScroll } from "react-remove-scroll";
|
|
2109
|
+
var POPOVER_NAME = "Popover";
|
|
2110
|
+
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
2111
|
+
createPopperScope
|
|
2112
|
+
]);
|
|
2113
|
+
var usePopperScope = createPopperScope();
|
|
2114
|
+
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
2115
|
+
var PopoverRoot = (props) => {
|
|
2116
|
+
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
2117
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2118
|
+
const triggerRef = useRef3(null);
|
|
2119
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState5(false);
|
|
2120
|
+
const [open = false, setOpen] = useControllableState5({
|
|
2121
|
+
prop: openProp,
|
|
2122
|
+
defaultProp: defaultOpen,
|
|
2123
|
+
onChange: onOpenChange
|
|
2124
|
+
});
|
|
2125
|
+
return /* @__PURE__ */ React23.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React23.createElement(PopoverProvider, {
|
|
2126
|
+
scope: __scopePopover,
|
|
2127
|
+
contentId: useId5(),
|
|
2128
|
+
triggerRef,
|
|
2129
|
+
open,
|
|
2130
|
+
onOpenChange: setOpen,
|
|
2131
|
+
onOpenToggle: useCallback5(() => setOpen((prevOpen) => !prevOpen), [
|
|
2132
|
+
setOpen
|
|
2133
|
+
]),
|
|
2134
|
+
hasCustomAnchor,
|
|
2135
|
+
onCustomAnchorAdd: useCallback5(() => setHasCustomAnchor(true), []),
|
|
2136
|
+
onCustomAnchorRemove: useCallback5(() => setHasCustomAnchor(false), []),
|
|
2137
|
+
modal
|
|
2138
|
+
}, children));
|
|
2139
|
+
};
|
|
2140
|
+
PopoverRoot.displayName = POPOVER_NAME;
|
|
2141
|
+
var ANCHOR_NAME = "PopoverAnchor";
|
|
2142
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2143
|
+
const { __scopePopover, ...anchorProps } = props;
|
|
2144
|
+
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
2145
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2146
|
+
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
2147
|
+
useEffect6(() => {
|
|
2148
|
+
onCustomAnchorAdd();
|
|
2149
|
+
return () => onCustomAnchorRemove();
|
|
2150
|
+
}, [
|
|
2151
|
+
onCustomAnchorAdd,
|
|
2152
|
+
onCustomAnchorRemove
|
|
2153
|
+
]);
|
|
2154
|
+
return /* @__PURE__ */ React23.createElement(PopperPrimitive.Anchor, {
|
|
2155
|
+
...popperScope,
|
|
2156
|
+
...anchorProps,
|
|
2157
|
+
ref: forwardedRef
|
|
2158
|
+
});
|
|
2159
|
+
});
|
|
2160
|
+
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
2161
|
+
var TRIGGER_NAME2 = "PopoverTrigger";
|
|
2162
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2163
|
+
const { __scopePopover, ...triggerProps } = props;
|
|
2164
|
+
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
2165
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2166
|
+
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
2167
|
+
const trigger = /* @__PURE__ */ React23.createElement(Primitive11.button, {
|
|
2168
|
+
type: "button",
|
|
2169
|
+
"aria-haspopup": "dialog",
|
|
2170
|
+
"aria-expanded": context.open,
|
|
2171
|
+
"aria-controls": context.contentId,
|
|
2172
|
+
"data-state": getState(context.open),
|
|
2173
|
+
...triggerProps,
|
|
2174
|
+
ref: composedTriggerRef,
|
|
2175
|
+
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
2176
|
+
});
|
|
2177
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React23.createElement(PopperPrimitive.Anchor, {
|
|
2178
|
+
asChild: true,
|
|
2179
|
+
...popperScope
|
|
2180
|
+
}, trigger);
|
|
2181
|
+
});
|
|
2182
|
+
PopoverTrigger.displayName = TRIGGER_NAME2;
|
|
2183
|
+
var VIRTUAL_TRIGGER_NAME2 = "PopoverVirtualTrigger";
|
|
2184
|
+
var PopoverVirtualTrigger = (props) => {
|
|
2185
|
+
const { __scopePopover, virtualRef } = props;
|
|
2186
|
+
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
2187
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2188
|
+
useEffect6(() => {
|
|
2189
|
+
if (virtualRef.current) {
|
|
2190
|
+
context.triggerRef.current = virtualRef.current;
|
|
2191
|
+
}
|
|
2192
|
+
});
|
|
2193
|
+
return /* @__PURE__ */ React23.createElement(PopperPrimitive.Anchor, {
|
|
2194
|
+
...popperScope,
|
|
2195
|
+
virtualRef
|
|
2196
|
+
});
|
|
2197
|
+
};
|
|
2198
|
+
PopoverVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME2;
|
|
2199
|
+
var PORTAL_NAME2 = "PopoverPortal";
|
|
2200
|
+
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
2201
|
+
forceMount: void 0
|
|
2202
|
+
});
|
|
2203
|
+
var PopoverPortal = (props) => {
|
|
2204
|
+
const { __scopePopover, forceMount, children, container } = props;
|
|
2205
|
+
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
2206
|
+
return /* @__PURE__ */ React23.createElement(PortalProvider, {
|
|
2207
|
+
scope: __scopePopover,
|
|
2208
|
+
forceMount
|
|
2209
|
+
}, /* @__PURE__ */ React23.createElement(Presence, {
|
|
2210
|
+
present: forceMount || context.open
|
|
2211
|
+
}, /* @__PURE__ */ React23.createElement(PortalPrimitive, {
|
|
2212
|
+
asChild: true,
|
|
2213
|
+
container
|
|
2214
|
+
}, children)));
|
|
2215
|
+
};
|
|
2216
|
+
PopoverPortal.displayName = PORTAL_NAME2;
|
|
2217
|
+
var CONTENT_NAME2 = "PopoverContent";
|
|
2218
|
+
var PopoverContent = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2219
|
+
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
2220
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2221
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2222
|
+
return /* @__PURE__ */ React23.createElement(Presence, {
|
|
2223
|
+
present: forceMount || context.open
|
|
2224
|
+
}, context.modal ? /* @__PURE__ */ React23.createElement(PopoverContentModal, {
|
|
2225
|
+
...contentProps,
|
|
2226
|
+
ref: forwardedRef
|
|
2227
|
+
}) : /* @__PURE__ */ React23.createElement(PopoverContentNonModal, {
|
|
2228
|
+
...contentProps,
|
|
1841
2229
|
ref: forwardedRef
|
|
2230
|
+
}));
|
|
2231
|
+
});
|
|
2232
|
+
PopoverContent.displayName = CONTENT_NAME2;
|
|
2233
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2234
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2235
|
+
const contentRef = useRef3(null);
|
|
2236
|
+
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
2237
|
+
const isRightClickOutsideRef = useRef3(false);
|
|
2238
|
+
useEffect6(() => {
|
|
2239
|
+
const content = contentRef.current;
|
|
2240
|
+
if (content) {
|
|
2241
|
+
return hideOthers(content);
|
|
2242
|
+
}
|
|
2243
|
+
}, []);
|
|
2244
|
+
return /* @__PURE__ */ React23.createElement(RemoveScroll, {
|
|
2245
|
+
as: Slot12,
|
|
2246
|
+
allowPinchZoom: true
|
|
2247
|
+
}, /* @__PURE__ */ React23.createElement(PopoverContentImpl, {
|
|
2248
|
+
...props,
|
|
2249
|
+
ref: composedRefs,
|
|
2250
|
+
// we make sure we're not trapping once it's been closed
|
|
2251
|
+
// (closed !== unmounted when animating out)
|
|
2252
|
+
trapFocus: context.open,
|
|
2253
|
+
disableOutsidePointerEvents: true,
|
|
2254
|
+
onCloseAutoFocus: composeEventHandlers2(props.onCloseAutoFocus, (event) => {
|
|
2255
|
+
event.preventDefault();
|
|
2256
|
+
if (!isRightClickOutsideRef.current) {
|
|
2257
|
+
context.triggerRef.current?.focus();
|
|
2258
|
+
}
|
|
2259
|
+
}),
|
|
2260
|
+
onPointerDownOutside: composeEventHandlers2(props.onPointerDownOutside, (event) => {
|
|
2261
|
+
const originalEvent = event.detail.originalEvent;
|
|
2262
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
2263
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
2264
|
+
isRightClickOutsideRef.current = isRightClick;
|
|
2265
|
+
}, {
|
|
2266
|
+
checkForDefaultPrevented: false
|
|
2267
|
+
}),
|
|
2268
|
+
// When focus is trapped, a `focusout` event may still happen.
|
|
2269
|
+
// We make sure we don't trigger our `onDismiss` in such case.
|
|
2270
|
+
onFocusOutside: composeEventHandlers2(props.onFocusOutside, (event) => event.preventDefault(), {
|
|
2271
|
+
checkForDefaultPrevented: false
|
|
2272
|
+
})
|
|
2273
|
+
}));
|
|
2274
|
+
});
|
|
2275
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2276
|
+
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2277
|
+
const hasInteractedOutsideRef = useRef3(false);
|
|
2278
|
+
const hasPointerDownOutsideRef = useRef3(false);
|
|
2279
|
+
return /* @__PURE__ */ React23.createElement(PopoverContentImpl, {
|
|
2280
|
+
...props,
|
|
2281
|
+
ref: forwardedRef,
|
|
2282
|
+
trapFocus: false,
|
|
2283
|
+
disableOutsidePointerEvents: false,
|
|
2284
|
+
onCloseAutoFocus: (event) => {
|
|
2285
|
+
props.onCloseAutoFocus?.(event);
|
|
2286
|
+
if (!event.defaultPrevented) {
|
|
2287
|
+
if (!hasInteractedOutsideRef.current) {
|
|
2288
|
+
context.triggerRef.current?.focus();
|
|
2289
|
+
}
|
|
2290
|
+
event.preventDefault();
|
|
2291
|
+
}
|
|
2292
|
+
hasInteractedOutsideRef.current = false;
|
|
2293
|
+
hasPointerDownOutsideRef.current = false;
|
|
2294
|
+
},
|
|
2295
|
+
onInteractOutside: (event) => {
|
|
2296
|
+
props.onInteractOutside?.(event);
|
|
2297
|
+
if (!event.defaultPrevented) {
|
|
2298
|
+
hasInteractedOutsideRef.current = true;
|
|
2299
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
2300
|
+
hasPointerDownOutsideRef.current = true;
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
const target = event.target;
|
|
2304
|
+
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
2305
|
+
if (targetIsTrigger) {
|
|
2306
|
+
event.preventDefault();
|
|
2307
|
+
}
|
|
2308
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
2309
|
+
event.preventDefault();
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
1842
2312
|
});
|
|
1843
2313
|
});
|
|
1844
|
-
var
|
|
2314
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2315
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, classNames, ...contentProps } = props;
|
|
2316
|
+
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2317
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
1845
2318
|
const { tx } = useThemeContext();
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
2319
|
+
useFocusGuards();
|
|
2320
|
+
return /* @__PURE__ */ React23.createElement(FocusScope, {
|
|
2321
|
+
asChild: true,
|
|
2322
|
+
loop: true,
|
|
2323
|
+
trapped: trapFocus,
|
|
2324
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
2325
|
+
onUnmountAutoFocus: onCloseAutoFocus
|
|
2326
|
+
}, /* @__PURE__ */ React23.createElement(DismissableLayer, {
|
|
2327
|
+
asChild: true,
|
|
2328
|
+
disableOutsidePointerEvents,
|
|
2329
|
+
onInteractOutside,
|
|
2330
|
+
onEscapeKeyDown,
|
|
2331
|
+
onPointerDownOutside,
|
|
2332
|
+
onFocusOutside,
|
|
2333
|
+
onDismiss: () => context.onOpenChange(false)
|
|
2334
|
+
}, /* @__PURE__ */ React23.createElement(PopperPrimitive.Content, {
|
|
2335
|
+
"data-state": getState(context.open),
|
|
2336
|
+
role: "dialog",
|
|
2337
|
+
id: context.contentId,
|
|
2338
|
+
...popperScope,
|
|
2339
|
+
...contentProps,
|
|
1850
2340
|
className: tx("popover.content", "popover", {}, classNames),
|
|
2341
|
+
ref: forwardedRef,
|
|
2342
|
+
style: {
|
|
2343
|
+
...contentProps.style,
|
|
2344
|
+
// re-namespace exposed content custom properties
|
|
2345
|
+
...{
|
|
2346
|
+
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
2347
|
+
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
2348
|
+
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
2349
|
+
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
2350
|
+
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
})));
|
|
2354
|
+
});
|
|
2355
|
+
var CLOSE_NAME = "PopoverClose";
|
|
2356
|
+
var PopoverClose = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2357
|
+
const { __scopePopover, ...closeProps } = props;
|
|
2358
|
+
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2359
|
+
return /* @__PURE__ */ React23.createElement(Primitive11.button, {
|
|
2360
|
+
type: "button",
|
|
2361
|
+
...closeProps,
|
|
2362
|
+
ref: forwardedRef,
|
|
2363
|
+
onClick: composeEventHandlers2(props.onClick, () => context.onOpenChange(false))
|
|
2364
|
+
});
|
|
2365
|
+
});
|
|
2366
|
+
PopoverClose.displayName = CLOSE_NAME;
|
|
2367
|
+
var ARROW_NAME2 = "PopoverArrow";
|
|
2368
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2369
|
+
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
2370
|
+
const popperScope = usePopperScope(__scopePopover);
|
|
2371
|
+
const { tx } = useThemeContext();
|
|
2372
|
+
return /* @__PURE__ */ React23.createElement(PopperPrimitive.Arrow, {
|
|
2373
|
+
...popperScope,
|
|
2374
|
+
...arrowProps,
|
|
2375
|
+
className: tx("popover.arrow", "popover__arrow", {}, classNames),
|
|
1851
2376
|
ref: forwardedRef
|
|
1852
|
-
}
|
|
1853
|
-
elevation: "chrome"
|
|
1854
|
-
}, children));
|
|
2377
|
+
});
|
|
1855
2378
|
});
|
|
2379
|
+
PopoverArrow.displayName = ARROW_NAME2;
|
|
1856
2380
|
var PopoverViewport = /* @__PURE__ */ forwardRef20(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
1857
2381
|
const { tx } = useThemeContext();
|
|
1858
|
-
const
|
|
1859
|
-
return /* @__PURE__ */ React23.createElement(
|
|
2382
|
+
const Root5 = asChild ? Slot12 : Primitive11.div;
|
|
2383
|
+
return /* @__PURE__ */ React23.createElement(Root5, {
|
|
1860
2384
|
...props,
|
|
1861
2385
|
className: tx("popover.viewport", "popover__viewport", {
|
|
1862
2386
|
constrainInline,
|
|
@@ -1865,14 +2389,16 @@ var PopoverViewport = /* @__PURE__ */ forwardRef20(({ classNames, asChild, const
|
|
|
1865
2389
|
ref: forwardedRef
|
|
1866
2390
|
}, children);
|
|
1867
2391
|
});
|
|
2392
|
+
var getState = (open) => open ? "open" : "closed";
|
|
1868
2393
|
var Popover = {
|
|
1869
2394
|
Root: PopoverRoot,
|
|
1870
|
-
Portal: PopoverPortal,
|
|
1871
|
-
Trigger: PopoverTrigger,
|
|
1872
2395
|
Anchor: PopoverAnchor,
|
|
1873
|
-
|
|
1874
|
-
|
|
2396
|
+
Trigger: PopoverTrigger,
|
|
2397
|
+
VirtualTrigger: PopoverVirtualTrigger,
|
|
2398
|
+
Portal: PopoverPortal,
|
|
1875
2399
|
Content: PopoverContent,
|
|
2400
|
+
Close: PopoverClose,
|
|
2401
|
+
Arrow: PopoverArrow,
|
|
1876
2402
|
Viewport: PopoverViewport
|
|
1877
2403
|
};
|
|
1878
2404
|
|
|
@@ -2095,8 +2621,8 @@ import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
|
2095
2621
|
import React28, { forwardRef as forwardRef24 } from "react";
|
|
2096
2622
|
var Tag = /* @__PURE__ */ forwardRef24(({ asChild, palette, classNames, ...props }, forwardedRef) => {
|
|
2097
2623
|
const { tx } = useThemeContext();
|
|
2098
|
-
const
|
|
2099
|
-
return /* @__PURE__ */ React28.createElement(
|
|
2624
|
+
const Root5 = asChild ? Slot13 : Primitive12.span;
|
|
2625
|
+
return /* @__PURE__ */ React28.createElement(Root5, {
|
|
2100
2626
|
...props,
|
|
2101
2627
|
className: tx("tag.root", "tag", {
|
|
2102
2628
|
palette
|
|
@@ -2130,8 +2656,8 @@ var ToastRoot = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }
|
|
|
2130
2656
|
});
|
|
2131
2657
|
var ToastBody = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2132
2658
|
const { tx } = useThemeContext();
|
|
2133
|
-
const
|
|
2134
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2659
|
+
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
2660
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2135
2661
|
...props,
|
|
2136
2662
|
className: tx("toast.body", "toast__body", {}, classNames),
|
|
2137
2663
|
ref: forwardedRef
|
|
@@ -2139,8 +2665,8 @@ var ToastBody = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props },
|
|
|
2139
2665
|
});
|
|
2140
2666
|
var ToastTitle = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2141
2667
|
const { tx } = useThemeContext();
|
|
2142
|
-
const
|
|
2143
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2668
|
+
const Root5 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
2669
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2144
2670
|
...props,
|
|
2145
2671
|
className: tx("toast.title", "toast__title", {}, classNames),
|
|
2146
2672
|
ref: forwardedRef
|
|
@@ -2148,8 +2674,8 @@ var ToastTitle = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props }
|
|
|
2148
2674
|
});
|
|
2149
2675
|
var ToastDescription = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2150
2676
|
const { tx } = useThemeContext();
|
|
2151
|
-
const
|
|
2152
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2677
|
+
const Root5 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
2678
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2153
2679
|
...props,
|
|
2154
2680
|
className: tx("toast.description", "toast__description", {}, classNames),
|
|
2155
2681
|
ref: forwardedRef
|
|
@@ -2157,8 +2683,8 @@ var ToastDescription = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...p
|
|
|
2157
2683
|
});
|
|
2158
2684
|
var ToastActions = /* @__PURE__ */ forwardRef25(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2159
2685
|
const { tx } = useThemeContext();
|
|
2160
|
-
const
|
|
2161
|
-
return /* @__PURE__ */ React29.createElement(
|
|
2686
|
+
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
2687
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2162
2688
|
...props,
|
|
2163
2689
|
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
2164
2690
|
ref: forwardedRef
|
|
@@ -2291,7 +2817,7 @@ var Tooltip = {
|
|
|
2291
2817
|
|
|
2292
2818
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
2293
2819
|
import { createKeyborg } from "keyborg";
|
|
2294
|
-
import React32, { createContext as createContext10, useEffect as
|
|
2820
|
+
import React32, { createContext as createContext10, useEffect as useEffect7 } from "react";
|
|
2295
2821
|
|
|
2296
2822
|
// packages/ui/react-ui/src/util/hasIosKeyboard.ts
|
|
2297
2823
|
var hasIosKeyboard = () => {
|
|
@@ -2301,7 +2827,7 @@ var hasIosKeyboard = () => {
|
|
|
2301
2827
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
2302
2828
|
var ThemeContext = /* @__PURE__ */ createContext10(void 0);
|
|
2303
2829
|
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", rootElevation = "base" }) => {
|
|
2304
|
-
|
|
2830
|
+
useEffect7(() => {
|
|
2305
2831
|
if (document.defaultView) {
|
|
2306
2832
|
const kb = createKeyborg(document.defaultView);
|
|
2307
2833
|
kb.subscribe(handleInputModalityChange);
|
|
@@ -2345,7 +2871,7 @@ export {
|
|
|
2345
2871
|
DensityContext,
|
|
2346
2872
|
DensityProvider,
|
|
2347
2873
|
Dialog,
|
|
2348
|
-
|
|
2874
|
+
DropdownMenu,
|
|
2349
2875
|
ElevationContext,
|
|
2350
2876
|
ElevationProvider,
|
|
2351
2877
|
Icon,
|
|
@@ -2375,14 +2901,16 @@ export {
|
|
|
2375
2901
|
Tree,
|
|
2376
2902
|
TreeItem,
|
|
2377
2903
|
Treegrid,
|
|
2904
|
+
createDropdownMenuScope,
|
|
2905
|
+
createPopoverScope,
|
|
2378
2906
|
hasIosKeyboard,
|
|
2379
2907
|
isLabel,
|
|
2380
2908
|
toLocalizedString,
|
|
2381
2909
|
useAvatarContext,
|
|
2382
2910
|
useButtonGroupContext,
|
|
2383
2911
|
useDensityContext,
|
|
2384
|
-
|
|
2385
|
-
|
|
2912
|
+
useDropdownMenuContext,
|
|
2913
|
+
useDropdownMenuMenuScope,
|
|
2386
2914
|
useElevationContext,
|
|
2387
2915
|
useListContext,
|
|
2388
2916
|
useListItemContext,
|