@dxos/react-ui 0.7.4 → 0.7.5-labs.071a3e2
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 +510 -347
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +766 -614
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +510 -347
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +5 -9
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +1 -2
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +6 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +5 -6
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +1 -3
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.d.ts +2 -0
- package/dist/types/src/components/Lists/List.d.ts.map +1 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts +13 -0
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/Lists/Tree.d.ts +2 -0
- package/dist/types/src/components/Lists/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts +8 -0
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +35 -24
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +2 -6
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -1
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +4 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -0
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +15 -5
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +7 -2
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +13 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts +9 -0
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -0
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts +10 -0
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -0
- package/dist/types/src/hooks/useVisualViewport.d.ts +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts +1 -1
- package/dist/types/src/util/ThemedClassName.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +43 -42
- package/src/components/Avatars/Avatar.tsx +3 -6
- package/src/components/Buttons/IconButton.tsx +25 -7
- package/src/components/Clipboard/CopyButton.tsx +1 -1
- package/src/components/Dialogs/AlertDialog.tsx +6 -2
- package/src/components/Dialogs/Dialog.tsx +7 -11
- package/src/components/Input/Input.stories.tsx +4 -6
- package/src/components/Input/Input.tsx +29 -44
- package/src/components/Lists/List.stories.tsx +2 -2
- package/src/components/Lists/List.tsx +3 -0
- package/src/components/Lists/ListDropIndicator.tsx +70 -0
- package/src/components/Lists/Tree.tsx +3 -0
- package/src/components/Lists/TreeDropIndicator.tsx +70 -0
- package/src/components/Main/Main.stories.tsx +1 -1
- package/src/components/Main/Main.tsx +79 -110
- package/src/components/Menus/ContextMenu.tsx +8 -6
- package/src/components/Menus/DropdownMenu.tsx +7 -4
- package/src/components/Popover/Popover.tsx +8 -2
- package/src/components/ScrollArea/ScrollArea.stories.tsx +2 -2
- package/src/components/Select/Select.tsx +7 -3
- package/src/components/Separator/Separator.tsx +14 -11
- package/src/components/Tag/Tag.stories.tsx +20 -31
- package/src/components/Tag/Tag.tsx +15 -6
- package/src/components/ThemeProvider/ThemeProvider.tsx +13 -5
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Toolbar/Toolbar.tsx +40 -10
- package/src/components/Tooltip/Tooltip.stories.tsx +13 -2
- package/src/components/Tooltip/Tooltip.tsx +18 -13
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useSafeArea.ts +25 -0
- package/src/hooks/useSafeCollisionPadding.ts +39 -0
- package/src/hooks/useVisualViewport.ts +11 -12
- package/src/testing/decorators/withVariants.tsx +4 -4
- package/src/util/ThemedClassName.ts +1 -1
- package/dist/types/src/playground/Surfaces.stories.d.ts +0 -21
- package/dist/types/src/playground/Surfaces.stories.d.ts.map +0 -1
- package/src/playground/Surfaces.stories.tsx +0 -73
|
@@ -22,13 +22,36 @@ var useElevationContext = (propsElevation) => {
|
|
|
22
22
|
return propsElevation ?? elevation;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
// packages/ui/react-ui/src/hooks/useSafeArea.ts
|
|
26
|
+
import { useCallback, useState } from "react";
|
|
27
|
+
import { useResize } from "@dxos/react-hooks";
|
|
28
|
+
var initialSafeArea = {
|
|
29
|
+
top: NaN,
|
|
30
|
+
right: NaN,
|
|
31
|
+
bottom: NaN,
|
|
32
|
+
left: NaN
|
|
33
|
+
};
|
|
34
|
+
var useSafeArea = () => {
|
|
35
|
+
const [padding, setPadding] = useState(initialSafeArea);
|
|
36
|
+
const handleResize = useCallback(() => {
|
|
37
|
+
setPadding({
|
|
38
|
+
top: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-top")),
|
|
39
|
+
right: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-right")),
|
|
40
|
+
bottom: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-bottom")),
|
|
41
|
+
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
42
|
+
});
|
|
43
|
+
}, []);
|
|
44
|
+
useResize(handleResize);
|
|
45
|
+
return padding;
|
|
46
|
+
};
|
|
47
|
+
|
|
25
48
|
// packages/ui/react-ui/src/hooks/useTranslationsContext.ts
|
|
26
49
|
import { useContext as useContext4 } from "react";
|
|
27
50
|
|
|
28
51
|
// packages/ui/react-ui/src/components/ThemeProvider/TranslationsProvider.tsx
|
|
29
52
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
30
53
|
import i18Next from "i18next";
|
|
31
|
-
import React, { useEffect, createContext, useState, Suspense, useContext as useContext3 } from "react";
|
|
54
|
+
import React, { useEffect, createContext, useState as useState2, Suspense, useContext as useContext3 } from "react";
|
|
32
55
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
33
56
|
var initialLng = "en-US";
|
|
34
57
|
var initialNs = "dxos-common";
|
|
@@ -63,7 +86,7 @@ var useTranslation = (...args) => {
|
|
|
63
86
|
};
|
|
64
87
|
};
|
|
65
88
|
var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtLocale }) => {
|
|
66
|
-
const [loaded, setLoaded] =
|
|
89
|
+
const [loaded, setLoaded] = useState2(false);
|
|
67
90
|
useEffect(() => {
|
|
68
91
|
setLoaded(false);
|
|
69
92
|
if (resourceExtensions && resourceExtensions.length) {
|
|
@@ -98,21 +121,18 @@ import { raise } from "@dxos/debug";
|
|
|
98
121
|
var useThemeContext = () => useContext5(ThemeContext) ?? raise(new Error("Missing ThemeContext"));
|
|
99
122
|
|
|
100
123
|
// packages/ui/react-ui/src/hooks/useVisualViewport.ts
|
|
101
|
-
import {
|
|
124
|
+
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
125
|
+
import { useResize as useResize2 } from "@dxos/react-hooks";
|
|
102
126
|
var useVisualViewport = (deps) => {
|
|
103
|
-
const [width, setWidth] =
|
|
104
|
-
const [height, setHeight] =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
window.visualViewport?.addEventListener("resize", handleResize);
|
|
113
|
-
handleResize();
|
|
114
|
-
return () => window.visualViewport?.removeEventListener("resize", handleResize);
|
|
115
|
-
}, deps ?? []);
|
|
127
|
+
const [width, setWidth] = useState3(null);
|
|
128
|
+
const [height, setHeight] = useState3(null);
|
|
129
|
+
const handleResize = useCallback2(() => {
|
|
130
|
+
if (window.visualViewport) {
|
|
131
|
+
setWidth(window.visualViewport.width);
|
|
132
|
+
setHeight(window.visualViewport.height);
|
|
133
|
+
}
|
|
134
|
+
}, []);
|
|
135
|
+
useResize2(handleResize);
|
|
116
136
|
return {
|
|
117
137
|
width,
|
|
118
138
|
height
|
|
@@ -572,11 +592,33 @@ var ButtonGroup = /* @__PURE__ */ forwardRef7(({ children, elevation: propsEleva
|
|
|
572
592
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
573
593
|
|
|
574
594
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
575
|
-
import React10, { forwardRef as forwardRef9 } from "react";
|
|
595
|
+
import React10, { forwardRef as forwardRef9, useState as useState4 } from "react";
|
|
576
596
|
|
|
577
597
|
// packages/ui/react-ui/src/components/Tooltip/Tooltip.tsx
|
|
578
598
|
import { Provider as TooltipProviderPrimitive, Root as TooltipRootPrimitive, TooltipContent as TooltipContentPrimitive, TooltipTrigger as TooltipTriggerPrimitive, TooltipPortal as TooltipPortalPrimitive, TooltipArrow as TooltipArrowPrimitive } from "@radix-ui/react-tooltip";
|
|
579
599
|
import React9, { forwardRef as forwardRef8 } from "react";
|
|
600
|
+
|
|
601
|
+
// packages/ui/react-ui/src/hooks/useSafeCollisionPadding.ts
|
|
602
|
+
import { useMemo } from "react";
|
|
603
|
+
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
604
|
+
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
605
|
+
var safePadding = (propsPadding, safePadding2, side) => {
|
|
606
|
+
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
607
|
+
};
|
|
608
|
+
var useSafeCollisionPadding = (collisionPadding) => {
|
|
609
|
+
const { safeAreaPadding } = useThemeContext();
|
|
610
|
+
return useMemo(() => ({
|
|
611
|
+
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
612
|
+
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
613
|
+
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
614
|
+
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
615
|
+
}), [
|
|
616
|
+
collisionPadding,
|
|
617
|
+
safeAreaPadding
|
|
618
|
+
]);
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
// packages/ui/react-ui/src/components/Tooltip/Tooltip.tsx
|
|
580
622
|
var TooltipProvider = TooltipProviderPrimitive;
|
|
581
623
|
var TooltipRoot = TooltipRootPrimitive;
|
|
582
624
|
var TooltipPortal = TooltipPortalPrimitive;
|
|
@@ -589,13 +631,17 @@ var TooltipArrow = /* @__PURE__ */ forwardRef8(({ classNames, ...props }, forwar
|
|
|
589
631
|
ref: forwardedRef
|
|
590
632
|
});
|
|
591
633
|
});
|
|
592
|
-
var TooltipContent = /* @__PURE__ */ forwardRef8(({ classNames, ...props }, forwardedRef) => {
|
|
634
|
+
var TooltipContent = /* @__PURE__ */ forwardRef8(({ classNames, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
593
635
|
const { tx } = useThemeContext();
|
|
636
|
+
const elevation = useElevationContext();
|
|
637
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
594
638
|
return /* @__PURE__ */ React9.createElement(TooltipContentPrimitive, {
|
|
595
639
|
sideOffset: 4,
|
|
596
|
-
collisionPadding: 8,
|
|
597
640
|
...props,
|
|
598
|
-
|
|
641
|
+
collisionPadding: safeCollisionPadding,
|
|
642
|
+
className: tx("tooltip.content", "tooltip", {
|
|
643
|
+
elevation
|
|
644
|
+
}, classNames),
|
|
599
645
|
ref: forwardedRef
|
|
600
646
|
});
|
|
601
647
|
});
|
|
@@ -609,20 +655,34 @@ var Tooltip = {
|
|
|
609
655
|
};
|
|
610
656
|
|
|
611
657
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
612
|
-
var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ tooltipPortal = true, tooltipZIndex: zIndex, ...props }, forwardedRef) => {
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
658
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
659
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState4(false);
|
|
660
|
+
const content = /* @__PURE__ */ React10.createElement(Tooltip.Content, {
|
|
661
|
+
...zIndex && {
|
|
662
|
+
style: {
|
|
663
|
+
zIndex
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
side: tooltipSide
|
|
617
667
|
}, props.label, /* @__PURE__ */ React10.createElement(Tooltip.Arrow, null));
|
|
618
|
-
return /* @__PURE__ */ React10.createElement(Tooltip.Root,
|
|
668
|
+
return /* @__PURE__ */ React10.createElement(Tooltip.Root, {
|
|
669
|
+
open: triggerTooltipOpen,
|
|
670
|
+
onOpenChange: (nextOpen) => {
|
|
671
|
+
if (suppressNextTooltip?.current) {
|
|
672
|
+
setTriggerTooltipOpen(false);
|
|
673
|
+
suppressNextTooltip.current = false;
|
|
674
|
+
} else {
|
|
675
|
+
setTriggerTooltipOpen(nextOpen);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}, /* @__PURE__ */ React10.createElement(Tooltip.Trigger, {
|
|
619
679
|
asChild: true
|
|
620
680
|
}, /* @__PURE__ */ React10.createElement(LabelledIconButton, {
|
|
621
681
|
...props,
|
|
622
682
|
ref: forwardedRef
|
|
623
683
|
})), tooltipPortal ? /* @__PURE__ */ React10.createElement(Tooltip.Portal, null, content) : content);
|
|
624
684
|
});
|
|
625
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, iconClassNames, ...props }, forwardedRef) => {
|
|
685
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
626
686
|
const { tx } = useThemeContext();
|
|
627
687
|
return /* @__PURE__ */ React10.createElement(Button, {
|
|
628
688
|
...props,
|
|
@@ -634,7 +694,10 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, la
|
|
|
634
694
|
classNames: iconClassNames
|
|
635
695
|
}), /* @__PURE__ */ React10.createElement("span", {
|
|
636
696
|
className: iconOnly ? "sr-only" : void 0
|
|
637
|
-
}, label)
|
|
697
|
+
}, label), caretDown && /* @__PURE__ */ React10.createElement(Icon, {
|
|
698
|
+
size: 3,
|
|
699
|
+
icon: "ph--caret-down--bold"
|
|
700
|
+
}));
|
|
638
701
|
});
|
|
639
702
|
var IconButton = /* @__PURE__ */ forwardRef9((props, forwardedRef) => props.iconOnly ? /* @__PURE__ */ React10.createElement(IconOnlyButton, {
|
|
640
703
|
...props,
|
|
@@ -687,7 +750,7 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef11(({ variant, elevation, densit
|
|
|
687
750
|
});
|
|
688
751
|
|
|
689
752
|
// packages/ui/react-ui/src/components/Clipboard/ClipboardProvider.tsx
|
|
690
|
-
import React13, { createContext as createContext4, useCallback, useContext as useContext6, useState as
|
|
753
|
+
import React13, { createContext as createContext4, useCallback as useCallback3, useContext as useContext6, useState as useState5 } from "react";
|
|
691
754
|
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
692
755
|
textValue: "",
|
|
693
756
|
setTextValue: async (_) => {
|
|
@@ -695,8 +758,8 @@ var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
|
695
758
|
});
|
|
696
759
|
var useClipboard = () => useContext6(ClipboardContext);
|
|
697
760
|
var ClipboardProvider = ({ children }) => {
|
|
698
|
-
const [textValue, setInternalTextValue] =
|
|
699
|
-
const setTextValue =
|
|
761
|
+
const [textValue, setInternalTextValue] = useState5("");
|
|
762
|
+
const setTextValue = useCallback3(async (nextValue) => {
|
|
700
763
|
await navigator.clipboard.writeText(nextValue);
|
|
701
764
|
return setInternalTextValue(nextValue);
|
|
702
765
|
}, []);
|
|
@@ -709,12 +772,12 @@ var ClipboardProvider = ({ children }) => {
|
|
|
709
772
|
};
|
|
710
773
|
|
|
711
774
|
// packages/ui/react-ui/src/components/Clipboard/CopyButton.tsx
|
|
712
|
-
import React17, { useState as
|
|
775
|
+
import React17, { useState as useState6 } from "react";
|
|
713
776
|
import { mx } from "@dxos/react-ui-theme";
|
|
714
777
|
|
|
715
778
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
716
779
|
import { createKeyborg } from "keyborg";
|
|
717
|
-
import React16, { createContext as createContext7, useEffect as
|
|
780
|
+
import React16, { createContext as createContext7, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
718
781
|
|
|
719
782
|
// packages/ui/react-ui/src/util/hasIosKeyboard.ts
|
|
720
783
|
var hasIosKeyboard = () => {
|
|
@@ -745,27 +808,35 @@ var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */ React15.cre
|
|
|
745
808
|
|
|
746
809
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
747
810
|
var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
748
|
-
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine",
|
|
749
|
-
|
|
811
|
+
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
812
|
+
useEffect2(() => {
|
|
750
813
|
if (document.defaultView) {
|
|
751
814
|
const kb = createKeyborg(document.defaultView);
|
|
752
815
|
kb.subscribe(handleInputModalityChange);
|
|
753
816
|
return () => kb.unsubscribe(handleInputModalityChange);
|
|
754
817
|
}
|
|
755
818
|
}, []);
|
|
819
|
+
const safeAreaPadding = useSafeArea();
|
|
820
|
+
const contextValue = useMemo2(() => ({
|
|
821
|
+
tx,
|
|
822
|
+
themeMode,
|
|
823
|
+
hasIosKeyboard: hasIosKeyboard(),
|
|
824
|
+
safeAreaPadding,
|
|
825
|
+
...rest
|
|
826
|
+
}), [
|
|
827
|
+
tx,
|
|
828
|
+
themeMode,
|
|
829
|
+
safeAreaPadding,
|
|
830
|
+
rest
|
|
831
|
+
]);
|
|
756
832
|
return /* @__PURE__ */ React16.createElement(ThemeContext.Provider, {
|
|
757
|
-
value:
|
|
758
|
-
tx,
|
|
759
|
-
themeMode,
|
|
760
|
-
hasIosKeyboard: hasIosKeyboard(),
|
|
761
|
-
...rest
|
|
762
|
-
}
|
|
833
|
+
value: contextValue
|
|
763
834
|
}, /* @__PURE__ */ React16.createElement(TranslationsProvider, {
|
|
764
835
|
fallback,
|
|
765
836
|
resourceExtensions,
|
|
766
837
|
appNs
|
|
767
838
|
}, /* @__PURE__ */ React16.createElement(ElevationProvider, {
|
|
768
|
-
elevation:
|
|
839
|
+
elevation: "base"
|
|
769
840
|
}, /* @__PURE__ */ React16.createElement(DensityProvider, {
|
|
770
841
|
density: rootDensity
|
|
771
842
|
}, children))));
|
|
@@ -817,15 +888,14 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
817
888
|
const { textValue, setTextValue } = useClipboard();
|
|
818
889
|
const isCopied = textValue === value;
|
|
819
890
|
const label = isCopied ? t("copy success label") : t("copy label");
|
|
820
|
-
const [open, setOpen] =
|
|
891
|
+
const [open, setOpen] = useState6(false);
|
|
821
892
|
return /* @__PURE__ */ React17.createElement(Tooltip.Root, {
|
|
822
893
|
delayDuration: 1500,
|
|
823
894
|
open,
|
|
824
895
|
onOpenChange: setOpen
|
|
825
896
|
}, /* @__PURE__ */ React17.createElement(Tooltip.Portal, null, /* @__PURE__ */ React17.createElement(Tooltip.Content, {
|
|
826
897
|
side: "bottom",
|
|
827
|
-
sideOffset: 12
|
|
828
|
-
classNames: "z-30"
|
|
898
|
+
sideOffset: 12
|
|
829
899
|
}, /* @__PURE__ */ React17.createElement("span", null, label), /* @__PURE__ */ React17.createElement(Tooltip.Arrow, null))), /* @__PURE__ */ React17.createElement(Tooltip.Trigger, {
|
|
830
900
|
"aria-label": label,
|
|
831
901
|
...props,
|
|
@@ -856,7 +926,9 @@ var Clipboard = {
|
|
|
856
926
|
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
857
927
|
import { Root as DialogRootPrimitive, DialogTrigger as DialogTriggerPrimitive, DialogPortal as DialogPortalPrimitive, DialogOverlay as DialogOverlayPrimitive, DialogTitle as DialogTitlePrimitive, DialogDescription as DialogDescriptionPrimitive, DialogClose as DialogClosePrimitive, DialogContent as DialogContentPrimitive } from "@radix-ui/react-dialog";
|
|
858
928
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
859
|
-
var DialogRoot =
|
|
929
|
+
var DialogRoot = (props) => /* @__PURE__ */ React18.createElement(ElevationProvider, {
|
|
930
|
+
elevation: "dialog"
|
|
931
|
+
}, /* @__PURE__ */ React18.createElement(DialogRootPrimitive, props));
|
|
860
932
|
var DialogTrigger = DialogTriggerPrimitive;
|
|
861
933
|
var DialogPortal = DialogPortalPrimitive;
|
|
862
934
|
var DialogTitle = /* @__PURE__ */ forwardRef12(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
@@ -889,7 +961,7 @@ var DialogOverlay = /* @__PURE__ */ forwardRef12(({ classNames, children, blockA
|
|
|
889
961
|
const { tx } = useThemeContext();
|
|
890
962
|
return /* @__PURE__ */ React18.createElement(DialogOverlayPrimitive, {
|
|
891
963
|
...props,
|
|
892
|
-
className: tx("dialog.overlay", "dialog__overlay", {}, classNames
|
|
964
|
+
className: tx("dialog.overlay", "dialog__overlay", {}, classNames),
|
|
893
965
|
ref: forwardedRef,
|
|
894
966
|
"data-block-align": blockAlign
|
|
895
967
|
}, /* @__PURE__ */ React18.createElement(OverlayLayoutProvider, {
|
|
@@ -906,9 +978,7 @@ var DialogContent = /* @__PURE__ */ forwardRef12(({ classNames, children, ...pro
|
|
|
906
978
|
inOverlayLayout
|
|
907
979
|
}, classNames),
|
|
908
980
|
ref: forwardedRef
|
|
909
|
-
},
|
|
910
|
-
elevation: "chrome"
|
|
911
|
-
}, children));
|
|
981
|
+
}, children);
|
|
912
982
|
});
|
|
913
983
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
914
984
|
var Dialog = {
|
|
@@ -926,7 +996,9 @@ var Dialog = {
|
|
|
926
996
|
import { Root as AlertDialogRootPrimitive, AlertDialogTrigger as AlertDialogTriggerPrimitive, AlertDialogPortal as AlertDialogPortalPrimitive, AlertDialogOverlay as AlertDialogOverlayPrimitive, AlertDialogTitle as AlertDialogTitlePrimitive, AlertDialogDescription as AlertDialogDescriptionPrimitive, AlertDialogAction as AlertDialogActionPrimitive, AlertDialogCancel as AlertDialogCancelPrimitive, AlertDialogContent as AlertDialogContentPrimitive } from "@radix-ui/react-alert-dialog";
|
|
927
997
|
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
928
998
|
import React19, { forwardRef as forwardRef13 } from "react";
|
|
929
|
-
var AlertDialogRoot =
|
|
999
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React19.createElement(ElevationProvider, {
|
|
1000
|
+
elevation: "dialog"
|
|
1001
|
+
}, /* @__PURE__ */ React19.createElement(AlertDialogRootPrimitive, props));
|
|
930
1002
|
var AlertDialogTrigger = AlertDialogTriggerPrimitive;
|
|
931
1003
|
var AlertDialogPortal = AlertDialogPortalPrimitive;
|
|
932
1004
|
var AlertDialogCancel = AlertDialogCancelPrimitive;
|
|
@@ -977,9 +1049,7 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef13(({ classNames, children, .
|
|
|
977
1049
|
inOverlayLayout
|
|
978
1050
|
}, classNames),
|
|
979
1051
|
ref: forwardedRef
|
|
980
|
-
},
|
|
981
|
-
elevation: "chrome"
|
|
982
|
-
}, children));
|
|
1052
|
+
}, children);
|
|
983
1053
|
});
|
|
984
1054
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
985
1055
|
var AlertDialog = {
|
|
@@ -1002,16 +1072,18 @@ import React20, { forwardRef as forwardRef14 } from "react";
|
|
|
1002
1072
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
1003
1073
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1004
1074
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1005
|
-
var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1075
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
1006
1076
|
const { tx } = useThemeContext();
|
|
1077
|
+
const elevation = useElevationContext();
|
|
1078
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1007
1079
|
return /* @__PURE__ */ React20.createElement(ContextMenuPrimitive.Content, {
|
|
1008
|
-
collisionPadding: 8,
|
|
1009
1080
|
...props,
|
|
1010
|
-
|
|
1081
|
+
collisionPadding: safeCollisionPadding,
|
|
1082
|
+
className: tx("menu.content", "menu", {
|
|
1083
|
+
elevation
|
|
1084
|
+
}, classNames),
|
|
1011
1085
|
ref: forwardedRef
|
|
1012
|
-
},
|
|
1013
|
-
elevation: "chrome"
|
|
1014
|
-
}, children));
|
|
1086
|
+
}, children);
|
|
1015
1087
|
});
|
|
1016
1088
|
var ContextMenuViewport = /* @__PURE__ */ forwardRef14(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1017
1089
|
const { tx } = useThemeContext();
|
|
@@ -1089,7 +1161,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
1089
1161
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
1090
1162
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
1091
1163
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
1092
|
-
import React21, { useRef, useCallback as
|
|
1164
|
+
import React21, { useRef, useCallback as useCallback4, forwardRef as forwardRef15, useEffect as useEffect3 } from "react";
|
|
1093
1165
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1094
1166
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
1095
1167
|
createMenuScope
|
|
@@ -1112,7 +1184,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
1112
1184
|
contentId: useId3(),
|
|
1113
1185
|
open,
|
|
1114
1186
|
onOpenChange: setOpen,
|
|
1115
|
-
onOpenToggle:
|
|
1187
|
+
onOpenToggle: useCallback4(() => setOpen((prevOpen) => !prevOpen), [
|
|
1116
1188
|
setOpen
|
|
1117
1189
|
]),
|
|
1118
1190
|
modal
|
|
@@ -1181,7 +1253,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1181
1253
|
const { __scopeDropdownMenu, virtualRef } = props;
|
|
1182
1254
|
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
1183
1255
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1184
|
-
|
|
1256
|
+
useEffect3(() => {
|
|
1185
1257
|
if (virtualRef.current) {
|
|
1186
1258
|
context.triggerRef.current = virtualRef.current;
|
|
1187
1259
|
}
|
|
@@ -1213,16 +1285,19 @@ var DropdownMenuViewport = /* @__PURE__ */ forwardRef15(({ classNames, asChild,
|
|
|
1213
1285
|
});
|
|
1214
1286
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1215
1287
|
var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1216
|
-
const { __scopeDropdownMenu, classNames, ...contentProps } = props;
|
|
1288
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
1217
1289
|
const { tx } = useThemeContext();
|
|
1218
1290
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
1291
|
+
const elevation = useElevationContext();
|
|
1219
1292
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1220
1293
|
const hasInteractedOutsideRef = useRef(false);
|
|
1294
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1221
1295
|
return /* @__PURE__ */ React21.createElement(MenuPrimitive.Content, {
|
|
1222
1296
|
id: context.contentId,
|
|
1223
1297
|
"aria-labelledby": context.triggerId,
|
|
1224
1298
|
...menuScope,
|
|
1225
1299
|
...contentProps,
|
|
1300
|
+
collisionPadding: safeCollisionPadding,
|
|
1226
1301
|
ref: forwardedRef,
|
|
1227
1302
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1228
1303
|
if (!hasInteractedOutsideRef.current) {
|
|
@@ -1239,7 +1314,9 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) =>
|
|
|
1239
1314
|
hasInteractedOutsideRef.current = true;
|
|
1240
1315
|
}
|
|
1241
1316
|
}),
|
|
1242
|
-
className: tx("menu.content", "menu", {
|
|
1317
|
+
className: tx("menu.content", "menu", {
|
|
1318
|
+
elevation
|
|
1319
|
+
}, classNames),
|
|
1243
1320
|
style: {
|
|
1244
1321
|
...props.style,
|
|
1245
1322
|
// re-namespace exposed content custom properties
|
|
@@ -1433,11 +1510,9 @@ var DropdownMenu = {
|
|
|
1433
1510
|
var useDropdownMenuMenuScope = useMenuScope;
|
|
1434
1511
|
|
|
1435
1512
|
// packages/ui/react-ui/src/components/Input/Input.tsx
|
|
1436
|
-
import {
|
|
1437
|
-
import { Root as CheckboxPrimitive, Indicator as CheckboxIndicatorPrimitive } from "@radix-ui/react-checkbox";
|
|
1438
|
-
import { Root as SwitchPrimitive, Thumb as SwitchThumbPrimitive } from "@radix-ui/react-switch";
|
|
1513
|
+
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1439
1514
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1440
|
-
import React22, { forwardRef as forwardRef16,
|
|
1515
|
+
import React22, { forwardRef as forwardRef16, useCallback as useCallback5 } from "react";
|
|
1441
1516
|
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";
|
|
1442
1517
|
var Label3 = /* @__PURE__ */ forwardRef16(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1443
1518
|
const { tx } = useThemeContext();
|
|
@@ -1486,7 +1561,7 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ density: propsDensity, elevation:
|
|
|
1486
1561
|
const { tx } = useThemeContext();
|
|
1487
1562
|
const density = useDensityContext(propsDensity);
|
|
1488
1563
|
const elevation = useElevationContext(propsElevation);
|
|
1489
|
-
const segmentClassName =
|
|
1564
|
+
const segmentClassName = useCallback5(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1490
1565
|
variant: "static",
|
|
1491
1566
|
focused,
|
|
1492
1567
|
disabled: props.disabled,
|
|
@@ -1563,7 +1638,6 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsCheck
|
|
|
1563
1638
|
});
|
|
1564
1639
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1565
1640
|
const { tx } = useThemeContext();
|
|
1566
|
-
const Icon3 = checked === "indeterminate" ? Minus : checked ? Check : Fragment;
|
|
1567
1641
|
return /* @__PURE__ */ React22.createElement(CheckboxPrimitive, {
|
|
1568
1642
|
...props,
|
|
1569
1643
|
checked,
|
|
@@ -1578,42 +1652,37 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsCheck
|
|
|
1578
1652
|
size
|
|
1579
1653
|
}, "shrink-0", classNames),
|
|
1580
1654
|
ref: forwardedRef
|
|
1581
|
-
}, /* @__PURE__ */ React22.createElement(
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
size
|
|
1655
|
+
}, /* @__PURE__ */ React22.createElement(Icon, {
|
|
1656
|
+
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
1657
|
+
classNames: tx("input.checkboxIndicator", "input--checkbox__indicator", {
|
|
1658
|
+
size,
|
|
1659
|
+
checked
|
|
1587
1660
|
})
|
|
1588
|
-
}))
|
|
1661
|
+
}));
|
|
1589
1662
|
});
|
|
1590
|
-
var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange,
|
|
1591
|
-
const { tx } = useThemeContext();
|
|
1663
|
+
var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, classNames, ...props }, forwardedRef) => {
|
|
1592
1664
|
const [checked, onCheckedChange] = useControllableState2({
|
|
1593
1665
|
prop: propsChecked,
|
|
1594
|
-
defaultProp: propsDefaultChecked,
|
|
1666
|
+
defaultProp: propsDefaultChecked ?? false,
|
|
1595
1667
|
onChange: propsOnCheckedChange
|
|
1596
1668
|
});
|
|
1597
1669
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1598
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1599
|
-
|
|
1670
|
+
return /* @__PURE__ */ React22.createElement("input", {
|
|
1671
|
+
type: "checkbox",
|
|
1672
|
+
className: "dx-checkbox--switch dx-focus-ring",
|
|
1600
1673
|
checked,
|
|
1601
|
-
|
|
1674
|
+
onChange: (event) => {
|
|
1675
|
+
onCheckedChange(event.target.checked);
|
|
1676
|
+
},
|
|
1602
1677
|
id,
|
|
1603
1678
|
"aria-describedby": descriptionId,
|
|
1679
|
+
...props,
|
|
1604
1680
|
...validationValence === "error" && {
|
|
1605
1681
|
"aria-invalid": "true",
|
|
1606
1682
|
"aria-errormessage": errorMessageId
|
|
1607
1683
|
},
|
|
1608
|
-
className: tx("input.switch", "input--switch", {
|
|
1609
|
-
size
|
|
1610
|
-
}, classNames),
|
|
1611
1684
|
ref: forwardedRef
|
|
1612
|
-
}
|
|
1613
|
-
className: tx("input.switchThumb", "input--switch__thumb", {
|
|
1614
|
-
size
|
|
1615
|
-
})
|
|
1616
|
-
}));
|
|
1685
|
+
});
|
|
1617
1686
|
});
|
|
1618
1687
|
var Input = {
|
|
1619
1688
|
Root: InputRoot,
|
|
@@ -1631,14 +1700,54 @@ var Input = {
|
|
|
1631
1700
|
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1632
1701
|
import { CaretDown, CaretRight } from "@phosphor-icons/react";
|
|
1633
1702
|
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
1634
|
-
import
|
|
1703
|
+
import React24, { forwardRef as forwardRef17 } from "react";
|
|
1635
1704
|
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";
|
|
1705
|
+
|
|
1706
|
+
// packages/ui/react-ui/src/components/Lists/ListDropIndicator.tsx
|
|
1707
|
+
import React23 from "react";
|
|
1708
|
+
var edgeToOrientationMap = {
|
|
1709
|
+
top: "horizontal",
|
|
1710
|
+
bottom: "horizontal",
|
|
1711
|
+
left: "vertical",
|
|
1712
|
+
right: "vertical"
|
|
1713
|
+
};
|
|
1714
|
+
var orientationStyles = {
|
|
1715
|
+
horizontal: "h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]",
|
|
1716
|
+
vertical: "w-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]"
|
|
1717
|
+
};
|
|
1718
|
+
var edgeStyles = {
|
|
1719
|
+
top: "top-[--line-offset] before:top-[--offset-terminal]",
|
|
1720
|
+
right: "right-[--line-offset] before:right-[--offset-terminal]",
|
|
1721
|
+
bottom: "bottom-[--line-offset] before:bottom-[--offset-terminal]",
|
|
1722
|
+
left: "left-[--line-offset] before:left-[--offset-terminal]"
|
|
1723
|
+
};
|
|
1724
|
+
var strokeSize = 2;
|
|
1725
|
+
var terminalSize = 8;
|
|
1726
|
+
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
1727
|
+
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
1728
|
+
const orientation = edgeToOrientationMap[edge];
|
|
1729
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1730
|
+
role: "none",
|
|
1731
|
+
style: {
|
|
1732
|
+
"--line-thickness": `${strokeSize}px`,
|
|
1733
|
+
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
1734
|
+
"--line-inset": `${lineInset}px`,
|
|
1735
|
+
"--terminal-size": `${terminalSize}px`,
|
|
1736
|
+
"--terminal-radius": `${terminalSize / 2}px`,
|
|
1737
|
+
"--terminal-inset": `${terminalInset}px`,
|
|
1738
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine}px`
|
|
1739
|
+
},
|
|
1740
|
+
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]}`
|
|
1741
|
+
});
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
// packages/ui/react-ui/src/components/Lists/List.tsx
|
|
1636
1745
|
var List = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
1637
1746
|
const { tx } = useThemeContext();
|
|
1638
1747
|
const density = useDensityContext(props.density);
|
|
1639
|
-
return /* @__PURE__ */
|
|
1748
|
+
return /* @__PURE__ */ React24.createElement(DensityProvider, {
|
|
1640
1749
|
density
|
|
1641
|
-
}, /* @__PURE__ */
|
|
1750
|
+
}, /* @__PURE__ */ React24.createElement(ListPrimitive, {
|
|
1642
1751
|
...props,
|
|
1643
1752
|
className: tx("list.root", "list", {}, classNames),
|
|
1644
1753
|
ref: forwardedRef
|
|
@@ -1648,7 +1757,7 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChi
|
|
|
1648
1757
|
const Root5 = asChild ? Slot8 : "div";
|
|
1649
1758
|
const density = useDensityContext();
|
|
1650
1759
|
const { tx } = useThemeContext();
|
|
1651
|
-
return /* @__PURE__ */
|
|
1760
|
+
return /* @__PURE__ */ React24.createElement(Root5, {
|
|
1652
1761
|
...!asChild && {
|
|
1653
1762
|
role: "none"
|
|
1654
1763
|
},
|
|
@@ -1662,7 +1771,7 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChi
|
|
|
1662
1771
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
1663
1772
|
const density = useDensityContext();
|
|
1664
1773
|
const { tx } = useThemeContext();
|
|
1665
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
1666
1775
|
role: "none",
|
|
1667
1776
|
...props,
|
|
1668
1777
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger--mock", {
|
|
@@ -1673,7 +1782,7 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
1673
1782
|
var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
1674
1783
|
const { tx } = useThemeContext();
|
|
1675
1784
|
const density = useDensityContext();
|
|
1676
|
-
return /* @__PURE__ */
|
|
1785
|
+
return /* @__PURE__ */ React24.createElement(ListPrimitiveItemHeading, {
|
|
1677
1786
|
...props,
|
|
1678
1787
|
className: tx("list.item.heading", "list__listItem__heading", {
|
|
1679
1788
|
density
|
|
@@ -1686,13 +1795,13 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, class
|
|
|
1686
1795
|
const density = useDensityContext();
|
|
1687
1796
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
1688
1797
|
const Icon3 = open ? CaretDown : CaretRight;
|
|
1689
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ React24.createElement(ListPrimitiveItemOpenTrigger, {
|
|
1690
1799
|
...props,
|
|
1691
1800
|
className: tx("list.item.openTrigger", "list__listItem__openTrigger", {
|
|
1692
1801
|
density
|
|
1693
1802
|
}, classNames),
|
|
1694
1803
|
ref: forwardedRef
|
|
1695
|
-
}, children || /* @__PURE__ */
|
|
1804
|
+
}, children || /* @__PURE__ */ React24.createElement(Icon3, {
|
|
1696
1805
|
weight: "bold",
|
|
1697
1806
|
className: tx("list.item.openTriggerIcon", "list__listItem__openTrigger__icon", {})
|
|
1698
1807
|
}));
|
|
@@ -1700,7 +1809,7 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, class
|
|
|
1700
1809
|
var ListItemRoot = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
1701
1810
|
const { tx } = useThemeContext();
|
|
1702
1811
|
const density = useDensityContext();
|
|
1703
|
-
return /* @__PURE__ */
|
|
1812
|
+
return /* @__PURE__ */ React24.createElement(ListPrimitiveItem, {
|
|
1704
1813
|
...props,
|
|
1705
1814
|
className: tx("list.item.root", "list__listItem", {
|
|
1706
1815
|
density,
|
|
@@ -1715,27 +1824,75 @@ var ListItem = {
|
|
|
1715
1824
|
Heading: ListItemHeading,
|
|
1716
1825
|
OpenTrigger: ListItemOpenTrigger,
|
|
1717
1826
|
CollapsibleContent: ListItemCollapsibleContent,
|
|
1718
|
-
MockOpenTrigger: MockListItemOpenTrigger
|
|
1827
|
+
MockOpenTrigger: MockListItemOpenTrigger,
|
|
1828
|
+
DropIndicator: ListDropIndicator
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1832
|
+
import React26, { forwardRef as forwardRef18 } from "react";
|
|
1833
|
+
|
|
1834
|
+
// packages/ui/react-ui/src/components/Lists/TreeDropIndicator.tsx
|
|
1835
|
+
import React25 from "react";
|
|
1836
|
+
var edgeToOrientationMap2 = {
|
|
1837
|
+
"reorder-above": "sibling",
|
|
1838
|
+
"reorder-below": "sibling",
|
|
1839
|
+
"make-child": "child",
|
|
1840
|
+
reparent: "child"
|
|
1841
|
+
};
|
|
1842
|
+
var orientationStyles2 = {
|
|
1843
|
+
// TODO(wittjosiah): Stop using left/right here.
|
|
1844
|
+
sibling: "bs-[--line-thickness] left-[--horizontal-indent] right-0 bg-accentSurface before:left-[--negative-terminal-size]",
|
|
1845
|
+
child: "is-full block-start-0 block-end-0 border-[length:--line-thickness] before:invisible"
|
|
1846
|
+
};
|
|
1847
|
+
var instructionStyles = {
|
|
1848
|
+
"reorder-above": "block-start-[--line-offset] before:block-start-[--offset-terminal]",
|
|
1849
|
+
"reorder-below": "block-end-[--line-offset] before:block-end-[--offset-terminal]",
|
|
1850
|
+
"make-child": "border-accentSurface",
|
|
1851
|
+
// TODO(wittjosiah): This is not occurring in the current implementation.
|
|
1852
|
+
reparent: ""
|
|
1853
|
+
};
|
|
1854
|
+
var strokeSize2 = 2;
|
|
1855
|
+
var terminalSize2 = 8;
|
|
1856
|
+
var offsetToAlignTerminalWithLine2 = (strokeSize2 - terminalSize2) / 2;
|
|
1857
|
+
var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
1858
|
+
const lineOffset = `calc(-0.5 * (${gap}px + ${strokeSize2}px))`;
|
|
1859
|
+
const isBlocked = instruction.type === "instruction-blocked";
|
|
1860
|
+
const desiredInstruction = isBlocked ? instruction.desired : instruction;
|
|
1861
|
+
const orientation = edgeToOrientationMap2[desiredInstruction.type];
|
|
1862
|
+
if (isBlocked) {
|
|
1863
|
+
return null;
|
|
1864
|
+
}
|
|
1865
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
1866
|
+
style: {
|
|
1867
|
+
"--line-thickness": `${strokeSize2}px`,
|
|
1868
|
+
"--line-offset": `${lineOffset}`,
|
|
1869
|
+
"--terminal-size": `${terminalSize2}px`,
|
|
1870
|
+
"--terminal-radius": `${terminalSize2 / 2}px`,
|
|
1871
|
+
"--negative-terminal-size": `-${terminalSize2}px`,
|
|
1872
|
+
"--offset-terminal": `${offsetToAlignTerminalWithLine2}px`,
|
|
1873
|
+
"--horizontal-indent": `${desiredInstruction.currentLevel * desiredInstruction.indentPerLevel + 4}px`
|
|
1874
|
+
},
|
|
1875
|
+
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]}`
|
|
1876
|
+
});
|
|
1719
1877
|
};
|
|
1720
1878
|
|
|
1721
1879
|
// packages/ui/react-ui/src/components/Lists/Tree.tsx
|
|
1722
|
-
import React24, { forwardRef as forwardRef18 } from "react";
|
|
1723
1880
|
var TreeRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
1724
|
-
return /* @__PURE__ */
|
|
1881
|
+
return /* @__PURE__ */ React26.createElement(List, {
|
|
1725
1882
|
...props,
|
|
1726
1883
|
ref: forwardedRef
|
|
1727
1884
|
});
|
|
1728
1885
|
});
|
|
1729
1886
|
var TreeBranch = /* @__PURE__ */ forwardRef18(({ __listScope, ...props }, forwardedRef) => {
|
|
1730
1887
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
1731
|
-
return /* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ React26.createElement(List, {
|
|
1732
1889
|
...props,
|
|
1733
1890
|
"aria-labelledby": headingId,
|
|
1734
1891
|
ref: forwardedRef
|
|
1735
1892
|
});
|
|
1736
1893
|
});
|
|
1737
1894
|
var TreeItemRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
1738
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ React26.createElement(ListItem.Root, {
|
|
1739
1896
|
role: "treeitem",
|
|
1740
1897
|
...props,
|
|
1741
1898
|
ref: forwardedRef
|
|
@@ -1754,7 +1911,8 @@ var TreeItem = {
|
|
|
1754
1911
|
Heading: TreeItemHeading,
|
|
1755
1912
|
Body: TreeItemBody,
|
|
1756
1913
|
OpenTrigger: TreeItemOpenTrigger,
|
|
1757
|
-
MockOpenTrigger: MockTreeItemOpenTrigger
|
|
1914
|
+
MockOpenTrigger: MockTreeItemOpenTrigger,
|
|
1915
|
+
DropIndicator: TreeDropIndicator
|
|
1758
1916
|
};
|
|
1759
1917
|
|
|
1760
1918
|
// packages/ui/react-ui/src/components/Lists/Treegrid.tsx
|
|
@@ -1763,7 +1921,7 @@ import { createContextScope as createContextScope2 } from "@radix-ui/react-conte
|
|
|
1763
1921
|
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
1764
1922
|
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
1765
1923
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
1766
|
-
import
|
|
1924
|
+
import React27, { forwardRef as forwardRef19 } from "react";
|
|
1767
1925
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
1768
1926
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
1769
1927
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -1777,7 +1935,7 @@ var TreegridRoot = /* @__PURE__ */ forwardRef19(({ asChild, classNames, children
|
|
|
1777
1935
|
tabbable: false,
|
|
1778
1936
|
circular: true
|
|
1779
1937
|
});
|
|
1780
|
-
return /* @__PURE__ */
|
|
1938
|
+
return /* @__PURE__ */ React27.createElement(Root5, {
|
|
1781
1939
|
role: "treegrid",
|
|
1782
1940
|
...arrowNavigationAttrs,
|
|
1783
1941
|
...props,
|
|
@@ -1808,11 +1966,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
1808
1966
|
circular: false,
|
|
1809
1967
|
memorizeCurrent: false
|
|
1810
1968
|
});
|
|
1811
|
-
return /* @__PURE__ */
|
|
1969
|
+
return /* @__PURE__ */ React27.createElement(TreegridRowProvider, {
|
|
1812
1970
|
open,
|
|
1813
1971
|
onOpenChange,
|
|
1814
1972
|
scope: __treegridRowScope
|
|
1815
|
-
}, /* @__PURE__ */
|
|
1973
|
+
}, /* @__PURE__ */ React27.createElement(Root5, {
|
|
1816
1974
|
role: "row",
|
|
1817
1975
|
"aria-level": level,
|
|
1818
1976
|
className: tx("treegrid.row", "treegrid__row", {
|
|
@@ -1827,7 +1985,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
1827
1985
|
...props,
|
|
1828
1986
|
id,
|
|
1829
1987
|
ref: forwardedRef
|
|
1830
|
-
}, /* @__PURE__ */
|
|
1988
|
+
}, /* @__PURE__ */ React27.createElement("div", {
|
|
1831
1989
|
role: "none",
|
|
1832
1990
|
className: "contents",
|
|
1833
1991
|
...arrowGroupAttrs
|
|
@@ -1835,7 +1993,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
1835
1993
|
});
|
|
1836
1994
|
var TreegridCell = /* @__PURE__ */ forwardRef19(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
1837
1995
|
const { tx } = useThemeContext();
|
|
1838
|
-
return /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ React27.createElement("div", {
|
|
1839
1997
|
role: "gridcell",
|
|
1840
1998
|
className: tx("treegrid.cell", "treegrid__cell", {
|
|
1841
1999
|
indent
|
|
@@ -1856,18 +2014,17 @@ var Treegrid = {
|
|
|
1856
2014
|
|
|
1857
2015
|
// packages/ui/react-ui/src/components/Main/Main.tsx
|
|
1858
2016
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
1859
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
1860
2017
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
1861
2018
|
import { Root as DialogRoot2, DialogContent as DialogContent2 } from "@radix-ui/react-dialog";
|
|
1862
2019
|
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
1863
2020
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
1864
2021
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
1865
|
-
import
|
|
2022
|
+
import React28, { forwardRef as forwardRef20, useCallback as useCallback7, useEffect as useEffect5, useRef as useRef2, useState as useState8 } from "react";
|
|
1866
2023
|
import { log } from "@dxos/log";
|
|
1867
2024
|
import { useMediaQuery, useForwardedRef } from "@dxos/react-hooks";
|
|
1868
2025
|
|
|
1869
2026
|
// packages/ui/react-ui/src/components/Main/useSwipeToDismiss.ts
|
|
1870
|
-
import { useCallback as
|
|
2027
|
+
import { useCallback as useCallback6, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1871
2028
|
var MotionState;
|
|
1872
2029
|
(function(MotionState2) {
|
|
1873
2030
|
MotionState2[MotionState2["IDLE"] = 0] = "IDLE";
|
|
@@ -1882,22 +2039,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
1882
2039
|
/* side = 'inline-start' */
|
|
1883
2040
|
}) => {
|
|
1884
2041
|
const $root = ref.current;
|
|
1885
|
-
const [motionState, setMotionState] =
|
|
1886
|
-
const [gestureStartX, setGestureStartX] =
|
|
1887
|
-
const setIdle =
|
|
2042
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2043
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2044
|
+
const setIdle = useCallback6(() => {
|
|
1888
2045
|
setMotionState(0);
|
|
1889
2046
|
$root?.style.removeProperty("inset-inline-start");
|
|
1890
2047
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
1891
2048
|
}, [
|
|
1892
2049
|
$root
|
|
1893
2050
|
]);
|
|
1894
|
-
const setFollowing =
|
|
2051
|
+
const setFollowing = useCallback6(() => {
|
|
1895
2052
|
setMotionState(2);
|
|
1896
2053
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
1897
2054
|
}, [
|
|
1898
2055
|
$root
|
|
1899
2056
|
]);
|
|
1900
|
-
const handlePointerDown =
|
|
2057
|
+
const handlePointerDown = useCallback6(({ screenX }) => {
|
|
1901
2058
|
if (motionState === 0) {
|
|
1902
2059
|
setMotionState(1);
|
|
1903
2060
|
setGestureStartX(screenX);
|
|
@@ -1905,7 +2062,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1905
2062
|
}, [
|
|
1906
2063
|
motionState
|
|
1907
2064
|
]);
|
|
1908
|
-
const handlePointerMove =
|
|
2065
|
+
const handlePointerMove = useCallback6(({ screenX }) => {
|
|
1909
2066
|
if ($root) {
|
|
1910
2067
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
1911
2068
|
switch (motionState) {
|
|
@@ -1929,12 +2086,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
1929
2086
|
motionState,
|
|
1930
2087
|
gestureStartX
|
|
1931
2088
|
]);
|
|
1932
|
-
const handlePointerUp =
|
|
2089
|
+
const handlePointerUp = useCallback6(() => {
|
|
1933
2090
|
setIdle();
|
|
1934
2091
|
}, [
|
|
1935
2092
|
setIdle
|
|
1936
2093
|
]);
|
|
1937
|
-
|
|
2094
|
+
useEffect4(() => {
|
|
1938
2095
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
1939
2096
|
return () => {
|
|
1940
2097
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -1943,7 +2100,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1943
2100
|
$root,
|
|
1944
2101
|
handlePointerDown
|
|
1945
2102
|
]);
|
|
1946
|
-
|
|
2103
|
+
useEffect4(() => {
|
|
1947
2104
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
1948
2105
|
return () => {
|
|
1949
2106
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -1952,7 +2109,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1952
2109
|
$root,
|
|
1953
2110
|
handlePointerMove
|
|
1954
2111
|
]);
|
|
1955
|
-
|
|
2112
|
+
useEffect4(() => {
|
|
1956
2113
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
1957
2114
|
return () => {
|
|
1958
2115
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -1972,7 +2129,7 @@ var MAIN_NAME = "Main";
|
|
|
1972
2129
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
1973
2130
|
var landmarkAttr = "data-main-landmark";
|
|
1974
2131
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
1975
|
-
const handleKeyDown =
|
|
2132
|
+
const handleKeyDown = useCallback7((event) => {
|
|
1976
2133
|
const target = event.target;
|
|
1977
2134
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
1978
2135
|
event.preventDefault();
|
|
@@ -2001,8 +2158,8 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2001
2158
|
};
|
|
2002
2159
|
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2003
2160
|
resizing: false,
|
|
2004
|
-
|
|
2005
|
-
|
|
2161
|
+
navigationSidebarState: "closed",
|
|
2162
|
+
setNavigationSidebarState: (nextState) => {
|
|
2006
2163
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2007
2164
|
F: __dxlog_file,
|
|
2008
2165
|
L: 81,
|
|
@@ -2010,8 +2167,8 @@ var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
|
2010
2167
|
C: (f, a) => f(...a)
|
|
2011
2168
|
});
|
|
2012
2169
|
},
|
|
2013
|
-
|
|
2014
|
-
|
|
2170
|
+
complementarySidebarState: "closed",
|
|
2171
|
+
setComplementarySidebarState: (nextState) => {
|
|
2015
2172
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2016
2173
|
F: __dxlog_file,
|
|
2017
2174
|
L: 86,
|
|
@@ -2021,52 +2178,46 @@ var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
|
2021
2178
|
}
|
|
2022
2179
|
});
|
|
2023
2180
|
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2024
|
-
const {
|
|
2181
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2025
2182
|
return {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
toggleNavigationSidebar:
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
]),
|
|
2032
|
-
openNavigationSidebar: useCallback5(() => setNavigationSidebarOpen(true), [
|
|
2033
|
-
setNavigationSidebarOpen
|
|
2034
|
-
]),
|
|
2035
|
-
closeNavigationSidebar: useCallback5(() => setNavigationSidebarOpen(false), [
|
|
2036
|
-
setNavigationSidebarOpen
|
|
2183
|
+
navigationSidebarState,
|
|
2184
|
+
setNavigationSidebarState,
|
|
2185
|
+
toggleNavigationSidebar: useCallback7(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2186
|
+
navigationSidebarState,
|
|
2187
|
+
setNavigationSidebarState
|
|
2037
2188
|
]),
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2189
|
+
openNavigationSidebar: useCallback7(() => setNavigationSidebarState("expanded"), []),
|
|
2190
|
+
collapseNavigationSidebar: useCallback7(() => setNavigationSidebarState("collapsed"), []),
|
|
2191
|
+
closeNavigationSidebar: useCallback7(() => setNavigationSidebarState("closed"), []),
|
|
2192
|
+
complementarySidebarState,
|
|
2193
|
+
setComplementarySidebarState,
|
|
2194
|
+
toggleComplementarySidebar: useCallback7(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2195
|
+
complementarySidebarState,
|
|
2196
|
+
setComplementarySidebarState
|
|
2043
2197
|
]),
|
|
2044
|
-
openComplementarySidebar:
|
|
2045
|
-
|
|
2046
|
-
])
|
|
2047
|
-
closeComplementarySidebar: useCallback5(() => setComplementarySidebarOpen(false), [
|
|
2048
|
-
setComplementarySidebarOpen
|
|
2049
|
-
])
|
|
2198
|
+
openComplementarySidebar: useCallback7(() => setComplementarySidebarState("expanded"), []),
|
|
2199
|
+
collapseComplementarySidebar: useCallback7(() => setComplementarySidebarState("collapsed"), []),
|
|
2200
|
+
closeComplementarySidebar: useCallback7(() => setComplementarySidebarState("closed"), [])
|
|
2050
2201
|
};
|
|
2051
2202
|
};
|
|
2052
2203
|
var resizeDebounce = 3e3;
|
|
2053
|
-
var MainRoot = ({
|
|
2204
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2054
2205
|
const [isLg] = useMediaQuery("lg", {
|
|
2055
2206
|
ssr: false
|
|
2056
2207
|
});
|
|
2057
|
-
const [
|
|
2058
|
-
prop:
|
|
2059
|
-
defaultProp:
|
|
2060
|
-
onChange:
|
|
2208
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2209
|
+
prop: propsNavigationSidebarState,
|
|
2210
|
+
defaultProp: defaultNavigationSidebarState,
|
|
2211
|
+
onChange: onNavigationSidebarStateChange
|
|
2061
2212
|
});
|
|
2062
|
-
const [
|
|
2063
|
-
prop:
|
|
2064
|
-
defaultProp:
|
|
2065
|
-
onChange:
|
|
2213
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = useControllableState4({
|
|
2214
|
+
prop: propsComplementarySidebarState,
|
|
2215
|
+
defaultProp: defaultComplementarySidebarState,
|
|
2216
|
+
onChange: onComplementarySidebarStateChange
|
|
2066
2217
|
});
|
|
2067
|
-
const [resizing, setResizing] =
|
|
2218
|
+
const [resizing, setResizing] = useState8(false);
|
|
2068
2219
|
const resizeInterval = useRef2(null);
|
|
2069
|
-
const handleResize =
|
|
2220
|
+
const handleResize = useCallback7(() => {
|
|
2070
2221
|
setResizing(true);
|
|
2071
2222
|
if (resizeInterval.current) {
|
|
2072
2223
|
clearTimeout(resizeInterval.current);
|
|
@@ -2076,18 +2227,18 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
2076
2227
|
resizeInterval.current = null;
|
|
2077
2228
|
}, resizeDebounce);
|
|
2078
2229
|
}, []);
|
|
2079
|
-
|
|
2230
|
+
useEffect5(() => {
|
|
2080
2231
|
window.addEventListener("resize", handleResize);
|
|
2081
2232
|
return () => window.removeEventListener("resize", handleResize);
|
|
2082
2233
|
}, [
|
|
2083
2234
|
handleResize
|
|
2084
2235
|
]);
|
|
2085
|
-
return /* @__PURE__ */
|
|
2236
|
+
return /* @__PURE__ */ React28.createElement(MainProvider, {
|
|
2086
2237
|
...props,
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2238
|
+
navigationSidebarState,
|
|
2239
|
+
setNavigationSidebarState,
|
|
2240
|
+
complementarySidebarState,
|
|
2241
|
+
setComplementarySidebarState,
|
|
2091
2242
|
resizing
|
|
2092
2243
|
}, children);
|
|
2093
2244
|
};
|
|
@@ -2095,7 +2246,7 @@ MainRoot.displayName = MAIN_ROOT_NAME;
|
|
|
2095
2246
|
var handleOpenAutoFocus = (event) => {
|
|
2096
2247
|
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2097
2248
|
};
|
|
2098
|
-
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus,
|
|
2249
|
+
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, ...props }, forwardedRef) => {
|
|
2099
2250
|
const [isLg] = useMediaQuery("lg", {
|
|
2100
2251
|
ssr: false
|
|
2101
2252
|
});
|
|
@@ -2103,9 +2254,9 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2103
2254
|
const ref = useForwardedRef(forwardedRef);
|
|
2104
2255
|
const noopRef = useRef2(null);
|
|
2105
2256
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2106
|
-
onDismiss: () =>
|
|
2257
|
+
onDismiss: () => onStateChange?.("closed")
|
|
2107
2258
|
});
|
|
2108
|
-
const handleKeyDown =
|
|
2259
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2109
2260
|
if (event.key === "Escape") {
|
|
2110
2261
|
event.target.closest("[data-tabster]")?.focus();
|
|
2111
2262
|
}
|
|
@@ -2114,10 +2265,10 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2114
2265
|
props.onKeyDown
|
|
2115
2266
|
]);
|
|
2116
2267
|
const Root5 = isLg ? Primitive9.div : DialogContent2;
|
|
2117
|
-
return /* @__PURE__ */
|
|
2118
|
-
open,
|
|
2268
|
+
return /* @__PURE__ */ React28.createElement(DialogRoot2, {
|
|
2269
|
+
open: state !== "closed",
|
|
2119
2270
|
modal: false
|
|
2120
|
-
}, /* @__PURE__ */
|
|
2271
|
+
}, /* @__PURE__ */ React28.createElement(Root5, {
|
|
2121
2272
|
...!isLg && {
|
|
2122
2273
|
forceMount: true,
|
|
2123
2274
|
tabIndex: -1,
|
|
@@ -2125,26 +2276,24 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2125
2276
|
},
|
|
2126
2277
|
...props,
|
|
2127
2278
|
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2128
|
-
"data-state":
|
|
2279
|
+
"data-state": state,
|
|
2129
2280
|
"data-resizing": resizing ? "true" : "false",
|
|
2130
2281
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2131
2282
|
onKeyDown: handleKeyDown,
|
|
2132
|
-
|
|
2283
|
+
...state === "closed" && {
|
|
2133
2284
|
inert: "true"
|
|
2134
2285
|
},
|
|
2135
2286
|
ref
|
|
2136
|
-
},
|
|
2137
|
-
elevation: "group"
|
|
2138
|
-
}, children)));
|
|
2287
|
+
}, children));
|
|
2139
2288
|
});
|
|
2140
2289
|
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2141
|
-
const {
|
|
2290
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2142
2291
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2143
|
-
return /* @__PURE__ */
|
|
2292
|
+
return /* @__PURE__ */ React28.createElement(MainSidebar, {
|
|
2144
2293
|
...mover,
|
|
2145
2294
|
...props,
|
|
2146
|
-
|
|
2147
|
-
|
|
2295
|
+
state: navigationSidebarState,
|
|
2296
|
+
onStateChange: setNavigationSidebarState,
|
|
2148
2297
|
resizing,
|
|
2149
2298
|
side: "inline-start",
|
|
2150
2299
|
ref: forwardedRef
|
|
@@ -2152,13 +2301,13 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) =
|
|
|
2152
2301
|
});
|
|
2153
2302
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2154
2303
|
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2155
|
-
const {
|
|
2304
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2156
2305
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2157
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ React28.createElement(MainSidebar, {
|
|
2158
2307
|
...mover,
|
|
2159
2308
|
...props,
|
|
2160
|
-
|
|
2161
|
-
|
|
2309
|
+
state: complementarySidebarState,
|
|
2310
|
+
onStateChange: setComplementarySidebarState,
|
|
2162
2311
|
resizing,
|
|
2163
2312
|
side: "inline-end",
|
|
2164
2313
|
ref: forwardedRef
|
|
@@ -2166,18 +2315,18 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef
|
|
|
2166
2315
|
});
|
|
2167
2316
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2168
2317
|
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2169
|
-
const {
|
|
2318
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2170
2319
|
const { tx } = useThemeContext();
|
|
2171
2320
|
const Root5 = asChild ? Slot10 : role ? "div" : "main";
|
|
2172
2321
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2173
|
-
return /* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ React28.createElement(Root5, {
|
|
2174
2323
|
role,
|
|
2175
2324
|
...handlesFocus && {
|
|
2176
2325
|
...mover
|
|
2177
2326
|
},
|
|
2178
2327
|
...props,
|
|
2179
|
-
"data-sidebar-inline-start-state":
|
|
2180
|
-
"data-sidebar-inline-end-state":
|
|
2328
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2329
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2181
2330
|
className: tx("main.content", "main", {
|
|
2182
2331
|
bounce,
|
|
2183
2332
|
handlesFocus
|
|
@@ -2190,62 +2339,37 @@ var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwar
|
|
|
2190
2339
|
const [isLg] = useMediaQuery("lg", {
|
|
2191
2340
|
ssr: false
|
|
2192
2341
|
});
|
|
2193
|
-
const {
|
|
2342
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2194
2343
|
const { tx } = useThemeContext();
|
|
2195
|
-
return /* @__PURE__ */
|
|
2344
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
2196
2345
|
onClick: () => {
|
|
2197
|
-
|
|
2198
|
-
|
|
2346
|
+
setNavigationSidebarState("collapsed");
|
|
2347
|
+
setComplementarySidebarState("collapsed");
|
|
2199
2348
|
},
|
|
2200
2349
|
...props,
|
|
2201
2350
|
className: tx("main.overlay", "main__overlay", {
|
|
2202
2351
|
isLg,
|
|
2203
|
-
inlineStartSidebarOpen:
|
|
2204
|
-
inlineEndSidebarOpen:
|
|
2352
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
2353
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
2205
2354
|
}, classNames),
|
|
2206
|
-
"data-state":
|
|
2355
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2207
2356
|
"aria-hidden": "true",
|
|
2208
2357
|
ref: forwardedRef
|
|
2209
2358
|
});
|
|
2210
2359
|
});
|
|
2211
|
-
var MainNotch = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwardedRef) => {
|
|
2212
|
-
const { tx } = useThemeContext();
|
|
2213
|
-
const { navigationSidebarOpen } = useMainContext(MAIN_NAME);
|
|
2214
|
-
const notchElement = useRef2(null);
|
|
2215
|
-
const ref = useComposedRefs(forwardedRef, notchElement);
|
|
2216
|
-
const handleKeyDown = useCallback5((event) => {
|
|
2217
|
-
switch (event.key) {
|
|
2218
|
-
case "Escape":
|
|
2219
|
-
props?.onKeyDown?.(event);
|
|
2220
|
-
notchElement.current?.focus();
|
|
2221
|
-
}
|
|
2222
|
-
}, [
|
|
2223
|
-
props?.onKeyDown
|
|
2224
|
-
]);
|
|
2225
|
-
const mover = useLandmarkMover(handleKeyDown, "3");
|
|
2226
|
-
return /* @__PURE__ */ React26.createElement("div", {
|
|
2227
|
-
role: "toolbar",
|
|
2228
|
-
...mover,
|
|
2229
|
-
...props,
|
|
2230
|
-
"data-nav-sidebar-state": navigationSidebarOpen ? "open" : "closed",
|
|
2231
|
-
className: tx("main.notch", "main__notch", {}, classNames),
|
|
2232
|
-
ref
|
|
2233
|
-
});
|
|
2234
|
-
});
|
|
2235
2360
|
var Main = {
|
|
2236
2361
|
Root: MainRoot,
|
|
2237
2362
|
Content: MainContent,
|
|
2238
2363
|
Overlay: MainOverlay,
|
|
2239
2364
|
NavigationSidebar: MainNavigationSidebar,
|
|
2240
|
-
ComplementarySidebar: MainComplementarySidebar
|
|
2241
|
-
Notch: MainNotch
|
|
2365
|
+
ComplementarySidebar: MainComplementarySidebar
|
|
2242
2366
|
};
|
|
2243
2367
|
|
|
2244
2368
|
// packages/ui/react-ui/src/components/Message/Message.tsx
|
|
2245
2369
|
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
2246
2370
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
2247
2371
|
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
2248
|
-
import
|
|
2372
|
+
import React29, { forwardRef as forwardRef21 } from "react";
|
|
2249
2373
|
import { useId as useId4 } from "@dxos/react-hooks";
|
|
2250
2374
|
var MESSAGE_NAME = "Message";
|
|
2251
2375
|
var [MessageProvider, useMessageContext] = createContext11(MESSAGE_NAME);
|
|
@@ -2255,10 +2379,10 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence, elevation: p
|
|
|
2255
2379
|
const descriptionId = useId4("message__description", propsDescriptionId);
|
|
2256
2380
|
const elevation = useElevationContext(propsElevation);
|
|
2257
2381
|
const Root5 = asChild ? Slot11 : Primitive10.div;
|
|
2258
|
-
return /* @__PURE__ */
|
|
2382
|
+
return /* @__PURE__ */ React29.createElement(MessageProvider, {
|
|
2259
2383
|
titleId,
|
|
2260
2384
|
descriptionId
|
|
2261
|
-
}, /* @__PURE__ */
|
|
2385
|
+
}, /* @__PURE__ */ React29.createElement(Root5, {
|
|
2262
2386
|
...props,
|
|
2263
2387
|
className: tx("message.root", "message", {
|
|
2264
2388
|
valence,
|
|
@@ -2275,7 +2399,7 @@ var MessageTitle = /* @__PURE__ */ forwardRef21(({ asChild, className, children,
|
|
|
2275
2399
|
const { tx } = useThemeContext();
|
|
2276
2400
|
const { titleId } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
2277
2401
|
const Root5 = asChild ? Slot11 : Primitive10.h2;
|
|
2278
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2279
2403
|
...props,
|
|
2280
2404
|
className: tx("message.title", "message__title", {}, className),
|
|
2281
2405
|
id: titleId,
|
|
@@ -2288,7 +2412,7 @@ var MessageBody = /* @__PURE__ */ forwardRef21(({ asChild, className, children,
|
|
|
2288
2412
|
const { tx } = useThemeContext();
|
|
2289
2413
|
const { descriptionId } = useMessageContext(MESSAGE_BODY_NAME);
|
|
2290
2414
|
const Root5 = asChild ? Slot11 : Primitive10.p;
|
|
2291
|
-
return /* @__PURE__ */
|
|
2415
|
+
return /* @__PURE__ */ React29.createElement(Root5, {
|
|
2292
2416
|
...props,
|
|
2293
2417
|
className: tx("message.body", "message__body", {}, className),
|
|
2294
2418
|
id: descriptionId,
|
|
@@ -2304,7 +2428,7 @@ var Message = {
|
|
|
2304
2428
|
|
|
2305
2429
|
// packages/ui/react-ui/src/components/Popover/Popover.tsx
|
|
2306
2430
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
2307
|
-
import { useComposedRefs
|
|
2431
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2308
2432
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
2309
2433
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
2310
2434
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -2318,7 +2442,7 @@ import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
|
2318
2442
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
2319
2443
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2320
2444
|
import { hideOthers } from "aria-hidden";
|
|
2321
|
-
import
|
|
2445
|
+
import React30, { forwardRef as forwardRef22, useRef as useRef3, useCallback as useCallback8, useState as useState9, useEffect as useEffect6 } from "react";
|
|
2322
2446
|
import { RemoveScroll } from "react-remove-scroll";
|
|
2323
2447
|
var POPOVER_NAME = "Popover";
|
|
2324
2448
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -2330,24 +2454,24 @@ var PopoverRoot = (props) => {
|
|
|
2330
2454
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
2331
2455
|
const popperScope = usePopperScope(__scopePopover);
|
|
2332
2456
|
const triggerRef = useRef3(null);
|
|
2333
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
2457
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
2334
2458
|
const [open = false, setOpen] = useControllableState5({
|
|
2335
2459
|
prop: openProp,
|
|
2336
2460
|
defaultProp: defaultOpen,
|
|
2337
2461
|
onChange: onOpenChange
|
|
2338
2462
|
});
|
|
2339
|
-
return /* @__PURE__ */
|
|
2463
|
+
return /* @__PURE__ */ React30.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React30.createElement(PopoverProvider, {
|
|
2340
2464
|
scope: __scopePopover,
|
|
2341
2465
|
contentId: useId5(),
|
|
2342
2466
|
triggerRef,
|
|
2343
2467
|
open,
|
|
2344
2468
|
onOpenChange: setOpen,
|
|
2345
|
-
onOpenToggle:
|
|
2469
|
+
onOpenToggle: useCallback8(() => setOpen((prevOpen) => !prevOpen), [
|
|
2346
2470
|
setOpen
|
|
2347
2471
|
]),
|
|
2348
2472
|
hasCustomAnchor,
|
|
2349
|
-
onCustomAnchorAdd:
|
|
2350
|
-
onCustomAnchorRemove:
|
|
2473
|
+
onCustomAnchorAdd: useCallback8(() => setHasCustomAnchor(true), []),
|
|
2474
|
+
onCustomAnchorRemove: useCallback8(() => setHasCustomAnchor(false), []),
|
|
2351
2475
|
modal
|
|
2352
2476
|
}, children));
|
|
2353
2477
|
};
|
|
@@ -2358,14 +2482,14 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2358
2482
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
2359
2483
|
const popperScope = usePopperScope(__scopePopover);
|
|
2360
2484
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
2361
|
-
|
|
2485
|
+
useEffect6(() => {
|
|
2362
2486
|
onCustomAnchorAdd();
|
|
2363
2487
|
return () => onCustomAnchorRemove();
|
|
2364
2488
|
}, [
|
|
2365
2489
|
onCustomAnchorAdd,
|
|
2366
2490
|
onCustomAnchorRemove
|
|
2367
2491
|
]);
|
|
2368
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ React30.createElement(PopperPrimitive.Anchor, {
|
|
2369
2493
|
...popperScope,
|
|
2370
2494
|
...anchorProps,
|
|
2371
2495
|
ref: forwardedRef
|
|
@@ -2377,8 +2501,8 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2377
2501
|
const { __scopePopover, ...triggerProps } = props;
|
|
2378
2502
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
2379
2503
|
const popperScope = usePopperScope(__scopePopover);
|
|
2380
|
-
const composedTriggerRef =
|
|
2381
|
-
const trigger = /* @__PURE__ */
|
|
2504
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
2505
|
+
const trigger = /* @__PURE__ */ React30.createElement(Primitive11.button, {
|
|
2382
2506
|
type: "button",
|
|
2383
2507
|
"aria-haspopup": "dialog",
|
|
2384
2508
|
"aria-expanded": context.open,
|
|
@@ -2388,7 +2512,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2388
2512
|
ref: composedTriggerRef,
|
|
2389
2513
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
2390
2514
|
});
|
|
2391
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
2515
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React30.createElement(PopperPrimitive.Anchor, {
|
|
2392
2516
|
asChild: true,
|
|
2393
2517
|
...popperScope
|
|
2394
2518
|
}, trigger);
|
|
@@ -2399,12 +2523,12 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
2399
2523
|
const { __scopePopover, virtualRef } = props;
|
|
2400
2524
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
2401
2525
|
const popperScope = usePopperScope(__scopePopover);
|
|
2402
|
-
|
|
2526
|
+
useEffect6(() => {
|
|
2403
2527
|
if (virtualRef.current) {
|
|
2404
2528
|
context.triggerRef.current = virtualRef.current;
|
|
2405
2529
|
}
|
|
2406
2530
|
});
|
|
2407
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ React30.createElement(PopperPrimitive.Anchor, {
|
|
2408
2532
|
...popperScope,
|
|
2409
2533
|
virtualRef
|
|
2410
2534
|
});
|
|
@@ -2417,12 +2541,12 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
2417
2541
|
var PopoverPortal = (props) => {
|
|
2418
2542
|
const { __scopePopover, forceMount, children, container } = props;
|
|
2419
2543
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
2420
|
-
return /* @__PURE__ */
|
|
2544
|
+
return /* @__PURE__ */ React30.createElement(PortalProvider, {
|
|
2421
2545
|
scope: __scopePopover,
|
|
2422
2546
|
forceMount
|
|
2423
|
-
}, /* @__PURE__ */
|
|
2547
|
+
}, /* @__PURE__ */ React30.createElement(Presence, {
|
|
2424
2548
|
present: forceMount || context.open
|
|
2425
|
-
}, /* @__PURE__ */
|
|
2549
|
+
}, /* @__PURE__ */ React30.createElement(PortalPrimitive, {
|
|
2426
2550
|
asChild: true,
|
|
2427
2551
|
container
|
|
2428
2552
|
}, children)));
|
|
@@ -2433,12 +2557,12 @@ var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2433
2557
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
2434
2558
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
2435
2559
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2436
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ React30.createElement(Presence, {
|
|
2437
2561
|
present: forceMount || context.open
|
|
2438
|
-
}, context.modal ? /* @__PURE__ */
|
|
2562
|
+
}, context.modal ? /* @__PURE__ */ React30.createElement(PopoverContentModal, {
|
|
2439
2563
|
...contentProps,
|
|
2440
2564
|
ref: forwardedRef
|
|
2441
|
-
}) : /* @__PURE__ */
|
|
2565
|
+
}) : /* @__PURE__ */ React30.createElement(PopoverContentNonModal, {
|
|
2442
2566
|
...contentProps,
|
|
2443
2567
|
ref: forwardedRef
|
|
2444
2568
|
}));
|
|
@@ -2447,18 +2571,18 @@ PopoverContent.displayName = CONTENT_NAME2;
|
|
|
2447
2571
|
var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
2448
2572
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2449
2573
|
const contentRef = useRef3(null);
|
|
2450
|
-
const composedRefs =
|
|
2574
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
2451
2575
|
const isRightClickOutsideRef = useRef3(false);
|
|
2452
|
-
|
|
2576
|
+
useEffect6(() => {
|
|
2453
2577
|
const content = contentRef.current;
|
|
2454
2578
|
if (content) {
|
|
2455
2579
|
return hideOthers(content);
|
|
2456
2580
|
}
|
|
2457
2581
|
}, []);
|
|
2458
|
-
return /* @__PURE__ */
|
|
2582
|
+
return /* @__PURE__ */ React30.createElement(RemoveScroll, {
|
|
2459
2583
|
as: Slot12,
|
|
2460
2584
|
allowPinchZoom: true
|
|
2461
|
-
}, /* @__PURE__ */
|
|
2585
|
+
}, /* @__PURE__ */ React30.createElement(PopoverContentImpl, {
|
|
2462
2586
|
...props,
|
|
2463
2587
|
ref: composedRefs,
|
|
2464
2588
|
// we make sure we're not trapping once it's been closed
|
|
@@ -2490,7 +2614,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
2490
2614
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2491
2615
|
const hasInteractedOutsideRef = useRef3(false);
|
|
2492
2616
|
const hasPointerDownOutsideRef = useRef3(false);
|
|
2493
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ React30.createElement(PopoverContentImpl, {
|
|
2494
2618
|
...props,
|
|
2495
2619
|
ref: forwardedRef,
|
|
2496
2620
|
trapFocus: false,
|
|
@@ -2526,18 +2650,20 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
2526
2650
|
});
|
|
2527
2651
|
});
|
|
2528
2652
|
var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
2529
|
-
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, classNames, ...contentProps } = props;
|
|
2653
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
2530
2654
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2531
2655
|
const popperScope = usePopperScope(__scopePopover);
|
|
2532
2656
|
const { tx } = useThemeContext();
|
|
2657
|
+
const elevation = useElevationContext();
|
|
2658
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2533
2659
|
useFocusGuards();
|
|
2534
|
-
return /* @__PURE__ */
|
|
2660
|
+
return /* @__PURE__ */ React30.createElement(FocusScope, {
|
|
2535
2661
|
asChild: true,
|
|
2536
2662
|
loop: true,
|
|
2537
2663
|
trapped: trapFocus,
|
|
2538
2664
|
onMountAutoFocus: onOpenAutoFocus,
|
|
2539
2665
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
2540
|
-
}, /* @__PURE__ */
|
|
2666
|
+
}, /* @__PURE__ */ React30.createElement(DismissableLayer, {
|
|
2541
2667
|
asChild: true,
|
|
2542
2668
|
disableOutsidePointerEvents,
|
|
2543
2669
|
onInteractOutside,
|
|
@@ -2545,13 +2671,16 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2545
2671
|
onPointerDownOutside,
|
|
2546
2672
|
onFocusOutside,
|
|
2547
2673
|
onDismiss: () => context.onOpenChange(false)
|
|
2548
|
-
}, /* @__PURE__ */
|
|
2674
|
+
}, /* @__PURE__ */ React30.createElement(PopperPrimitive.Content, {
|
|
2549
2675
|
"data-state": getState(context.open),
|
|
2550
2676
|
role: "dialog",
|
|
2551
2677
|
id: context.contentId,
|
|
2552
2678
|
...popperScope,
|
|
2553
2679
|
...contentProps,
|
|
2554
|
-
|
|
2680
|
+
collisionPadding: safeCollisionPadding,
|
|
2681
|
+
className: tx("popover.content", "popover", {
|
|
2682
|
+
elevation
|
|
2683
|
+
}, classNames),
|
|
2555
2684
|
ref: forwardedRef,
|
|
2556
2685
|
style: {
|
|
2557
2686
|
...contentProps.style,
|
|
@@ -2570,7 +2699,7 @@ var CLOSE_NAME = "PopoverClose";
|
|
|
2570
2699
|
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
2571
2700
|
const { __scopePopover, ...closeProps } = props;
|
|
2572
2701
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
2573
|
-
return /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ React30.createElement(Primitive11.button, {
|
|
2574
2703
|
type: "button",
|
|
2575
2704
|
...closeProps,
|
|
2576
2705
|
ref: forwardedRef,
|
|
@@ -2583,7 +2712,7 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2583
2712
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
2584
2713
|
const popperScope = usePopperScope(__scopePopover);
|
|
2585
2714
|
const { tx } = useThemeContext();
|
|
2586
|
-
return /* @__PURE__ */
|
|
2715
|
+
return /* @__PURE__ */ React30.createElement(PopperPrimitive.Arrow, {
|
|
2587
2716
|
...popperScope,
|
|
2588
2717
|
...arrowProps,
|
|
2589
2718
|
className: tx("popover.arrow", "popover__arrow", {}, classNames),
|
|
@@ -2594,7 +2723,7 @@ PopoverArrow.displayName = ARROW_NAME2;
|
|
|
2594
2723
|
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
2595
2724
|
const { tx } = useThemeContext();
|
|
2596
2725
|
const Root5 = asChild ? Slot12 : Primitive11.div;
|
|
2597
|
-
return /* @__PURE__ */
|
|
2726
|
+
return /* @__PURE__ */ React30.createElement(Root5, {
|
|
2598
2727
|
...props,
|
|
2599
2728
|
className: tx("popover.viewport", "popover__viewport", {
|
|
2600
2729
|
constrainInline,
|
|
@@ -2617,10 +2746,10 @@ var Popover = {
|
|
|
2617
2746
|
};
|
|
2618
2747
|
|
|
2619
2748
|
// packages/ui/react-ui/src/components/Status/Status.tsx
|
|
2620
|
-
import
|
|
2749
|
+
import React31, { forwardRef as forwardRef23 } from "react";
|
|
2621
2750
|
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
2622
2751
|
const { tx } = useThemeContext();
|
|
2623
|
-
return /* @__PURE__ */
|
|
2752
|
+
return /* @__PURE__ */ React31.createElement("span", {
|
|
2624
2753
|
role: "status",
|
|
2625
2754
|
...props,
|
|
2626
2755
|
className: tx("status.root", "status", {
|
|
@@ -2628,7 +2757,7 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
2628
2757
|
variant
|
|
2629
2758
|
}, classNames),
|
|
2630
2759
|
ref: forwardedRef
|
|
2631
|
-
}, /* @__PURE__ */
|
|
2760
|
+
}, /* @__PURE__ */ React31.createElement("span", {
|
|
2632
2761
|
role: "none",
|
|
2633
2762
|
className: tx("status.bar", "status__bar", {
|
|
2634
2763
|
indeterminate,
|
|
@@ -2644,10 +2773,10 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
2644
2773
|
|
|
2645
2774
|
// packages/ui/react-ui/src/components/ScrollArea/ScrollArea.tsx
|
|
2646
2775
|
import { Root as ScrollAreaPrimitiveRoot, Viewport as ScrollAreaPrimitiveViewport, Scrollbar as ScrollAreaPrimitiveScrollbar, Thumb as ScrollAreaPrimitiveThumb, Corner as ScrollAreaPrimitiveCorner } from "@radix-ui/react-scroll-area";
|
|
2647
|
-
import
|
|
2776
|
+
import React32, { forwardRef as forwardRef24 } from "react";
|
|
2648
2777
|
var ScrollAreaRoot = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2649
2778
|
const { tx } = useThemeContext();
|
|
2650
|
-
return /* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ React32.createElement(ScrollAreaPrimitiveRoot, {
|
|
2651
2780
|
...props,
|
|
2652
2781
|
className: tx("scrollArea.root", "scroll-area", {}, classNames),
|
|
2653
2782
|
ref: forwardedRef
|
|
@@ -2655,7 +2784,7 @@ var ScrollAreaRoot = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, for
|
|
|
2655
2784
|
});
|
|
2656
2785
|
var ScrollAreaViewport = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2657
2786
|
const { tx } = useThemeContext();
|
|
2658
|
-
return /* @__PURE__ */
|
|
2787
|
+
return /* @__PURE__ */ React32.createElement(ScrollAreaPrimitiveViewport, {
|
|
2659
2788
|
...props,
|
|
2660
2789
|
className: tx("scrollArea.viewport", "scroll-area", {}, classNames),
|
|
2661
2790
|
ref: forwardedRef
|
|
@@ -2663,7 +2792,7 @@ var ScrollAreaViewport = /* @__PURE__ */ forwardRef24(({ classNames, ...props },
|
|
|
2663
2792
|
});
|
|
2664
2793
|
var ScrollAreaScrollbar = /* @__PURE__ */ forwardRef24(({ classNames, variant = "fine", ...props }, forwardedRef) => {
|
|
2665
2794
|
const { tx } = useThemeContext();
|
|
2666
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ React32.createElement(ScrollAreaPrimitiveScrollbar, {
|
|
2667
2796
|
"data-variant": variant,
|
|
2668
2797
|
...props,
|
|
2669
2798
|
className: tx("scrollArea.scrollbar", "scroll-area__scrollbar", {}, classNames),
|
|
@@ -2672,7 +2801,7 @@ var ScrollAreaScrollbar = /* @__PURE__ */ forwardRef24(({ classNames, variant =
|
|
|
2672
2801
|
});
|
|
2673
2802
|
var ScrollAreaThumb = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2674
2803
|
const { tx } = useThemeContext();
|
|
2675
|
-
return /* @__PURE__ */
|
|
2804
|
+
return /* @__PURE__ */ React32.createElement(ScrollAreaPrimitiveThumb, {
|
|
2676
2805
|
...props,
|
|
2677
2806
|
className: tx("scrollArea.thumb", "scroll-area__thumb", {}, classNames),
|
|
2678
2807
|
ref: forwardedRef
|
|
@@ -2680,7 +2809,7 @@ var ScrollAreaThumb = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, fo
|
|
|
2680
2809
|
});
|
|
2681
2810
|
var ScrollAreaCorner = /* @__PURE__ */ forwardRef24(({ classNames, ...props }, forwardedRef) => {
|
|
2682
2811
|
const { tx } = useThemeContext();
|
|
2683
|
-
return /* @__PURE__ */
|
|
2812
|
+
return /* @__PURE__ */ React32.createElement(ScrollAreaPrimitiveCorner, {
|
|
2684
2813
|
...props,
|
|
2685
2814
|
className: tx("scrollArea.corner", "scroll-area__corner", {}, classNames),
|
|
2686
2815
|
ref: forwardedRef
|
|
@@ -2697,7 +2826,7 @@ var ScrollArea = {
|
|
|
2697
2826
|
// packages/ui/react-ui/src/components/Select/Select.tsx
|
|
2698
2827
|
import { CaretDown as CaretDown2, CaretUp } from "@phosphor-icons/react";
|
|
2699
2828
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
2700
|
-
import
|
|
2829
|
+
import React33, { forwardRef as forwardRef25 } from "react";
|
|
2701
2830
|
var SelectRoot = SelectPrimitive.Root;
|
|
2702
2831
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
2703
2832
|
var SelectValue = SelectPrimitive.Value;
|
|
@@ -2705,52 +2834,57 @@ var SelectIcon = SelectPrimitive.Icon;
|
|
|
2705
2834
|
var SelectPortal = SelectPrimitive.Portal;
|
|
2706
2835
|
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
2707
2836
|
const { tx } = useThemeContext();
|
|
2708
|
-
return /* @__PURE__ */
|
|
2837
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Trigger, {
|
|
2709
2838
|
asChild: true,
|
|
2710
2839
|
ref: forwardedRef
|
|
2711
|
-
}, /* @__PURE__ */
|
|
2840
|
+
}, /* @__PURE__ */ React33.createElement(Button, props, /* @__PURE__ */ React33.createElement(SelectPrimitive.Value, {
|
|
2712
2841
|
placeholder
|
|
2713
|
-
}, children), /* @__PURE__ */
|
|
2842
|
+
}, children), /* @__PURE__ */ React33.createElement("span", {
|
|
2714
2843
|
className: "w-1 flex-1"
|
|
2715
|
-
}), /* @__PURE__ */
|
|
2844
|
+
}), /* @__PURE__ */ React33.createElement(SelectPrimitive.Icon, {
|
|
2716
2845
|
asChild: true
|
|
2717
|
-
}, /* @__PURE__ */
|
|
2846
|
+
}, /* @__PURE__ */ React33.createElement(CaretDown2, {
|
|
2718
2847
|
className: tx("select.triggerIcon", "select__trigger__icon", {}),
|
|
2719
2848
|
weight: "bold"
|
|
2720
2849
|
}))));
|
|
2721
2850
|
});
|
|
2722
|
-
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
2851
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
2723
2852
|
const { tx } = useThemeContext();
|
|
2724
|
-
|
|
2853
|
+
const elevation = useElevationContext();
|
|
2854
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2855
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Content, {
|
|
2725
2856
|
...props,
|
|
2726
|
-
|
|
2857
|
+
collisionPadding: safeCollisionPadding,
|
|
2858
|
+
className: tx("select.content", "select__content", {
|
|
2859
|
+
elevation
|
|
2860
|
+
}, classNames),
|
|
2727
2861
|
position: "popper",
|
|
2728
2862
|
ref: forwardedRef
|
|
2729
2863
|
}, children);
|
|
2730
2864
|
});
|
|
2731
2865
|
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
2732
2866
|
const { tx } = useThemeContext();
|
|
2733
|
-
return /* @__PURE__ */
|
|
2867
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
2734
2868
|
...props,
|
|
2735
2869
|
className: tx("select.scrollButton", "select__scroll-button--up", {}, classNames),
|
|
2736
2870
|
ref: forwardedRef
|
|
2737
|
-
}, children ?? /* @__PURE__ */
|
|
2871
|
+
}, children ?? /* @__PURE__ */ React33.createElement(CaretUp, {
|
|
2738
2872
|
weight: "bold"
|
|
2739
2873
|
}));
|
|
2740
2874
|
});
|
|
2741
2875
|
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
2742
2876
|
const { tx } = useThemeContext();
|
|
2743
|
-
return /* @__PURE__ */
|
|
2877
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
2744
2878
|
...props,
|
|
2745
2879
|
className: tx("select.scrollButton", "select__scroll-button--down", {}, classNames),
|
|
2746
2880
|
ref: forwardedRef
|
|
2747
|
-
}, children ?? /* @__PURE__ */
|
|
2881
|
+
}, children ?? /* @__PURE__ */ React33.createElement(CaretDown2, {
|
|
2748
2882
|
weight: "bold"
|
|
2749
2883
|
}));
|
|
2750
2884
|
});
|
|
2751
2885
|
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
2752
2886
|
const { tx } = useThemeContext();
|
|
2753
|
-
return /* @__PURE__ */
|
|
2887
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.SelectViewport, {
|
|
2754
2888
|
...props,
|
|
2755
2889
|
className: tx("select.viewport", "select__viewport", {}, classNames),
|
|
2756
2890
|
ref: forwardedRef
|
|
@@ -2758,7 +2892,7 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, asChild, child
|
|
|
2758
2892
|
});
|
|
2759
2893
|
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
2760
2894
|
const { tx } = useThemeContext();
|
|
2761
|
-
return /* @__PURE__ */
|
|
2895
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
2762
2896
|
...props,
|
|
2763
2897
|
className: tx("select.item", "option", {}, classNames),
|
|
2764
2898
|
ref: forwardedRef
|
|
@@ -2767,7 +2901,7 @@ var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forward
|
|
|
2767
2901
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
2768
2902
|
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
2769
2903
|
const { tx } = useThemeContext();
|
|
2770
|
-
return /* @__PURE__ */
|
|
2904
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemIndicator, {
|
|
2771
2905
|
...props,
|
|
2772
2906
|
className: tx("select.itemIndicator", "option__indicator", {}, classNames),
|
|
2773
2907
|
ref: forwardedRef
|
|
@@ -2775,13 +2909,13 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children,
|
|
|
2775
2909
|
});
|
|
2776
2910
|
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
2777
2911
|
const { tx } = useThemeContext();
|
|
2778
|
-
return /* @__PURE__ */
|
|
2912
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Item, {
|
|
2779
2913
|
...props,
|
|
2780
2914
|
className: tx("select.item", "option", {}, classNames),
|
|
2781
2915
|
ref: forwardedRef
|
|
2782
|
-
}, /* @__PURE__ */
|
|
2916
|
+
}, /* @__PURE__ */ React33.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React33.createElement("span", {
|
|
2783
2917
|
className: "grow w-1"
|
|
2784
|
-
}), /* @__PURE__ */
|
|
2918
|
+
}), /* @__PURE__ */ React33.createElement(Icon, {
|
|
2785
2919
|
icon: "ph--check--regular"
|
|
2786
2920
|
}));
|
|
2787
2921
|
});
|
|
@@ -2789,7 +2923,7 @@ var SelectGroup = SelectPrimitive.Group;
|
|
|
2789
2923
|
var SelectLabel = SelectPrimitive.Label;
|
|
2790
2924
|
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
2791
2925
|
const { tx } = useThemeContext();
|
|
2792
|
-
return /* @__PURE__ */
|
|
2926
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Separator, {
|
|
2793
2927
|
...props,
|
|
2794
2928
|
className: tx("select.separator", "select__separator", {}, classNames),
|
|
2795
2929
|
ref: forwardedRef
|
|
@@ -2797,7 +2931,7 @@ var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, fo
|
|
|
2797
2931
|
});
|
|
2798
2932
|
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
2799
2933
|
const { tx } = useThemeContext();
|
|
2800
|
-
return /* @__PURE__ */
|
|
2934
|
+
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Arrow, {
|
|
2801
2935
|
...props,
|
|
2802
2936
|
className: tx("select.arrow", "select__arrow", {}, classNames),
|
|
2803
2937
|
ref: forwardedRef
|
|
@@ -2826,30 +2960,32 @@ var Select = {
|
|
|
2826
2960
|
|
|
2827
2961
|
// packages/ui/react-ui/src/components/Separator/Separator.tsx
|
|
2828
2962
|
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
2829
|
-
import
|
|
2830
|
-
var Separator4 = ({ classNames, orientation = "horizontal", ...props }) => {
|
|
2963
|
+
import React34, { forwardRef as forwardRef26 } from "react";
|
|
2964
|
+
var Separator4 = /* @__PURE__ */ forwardRef26(({ classNames, orientation = "horizontal", ...props }, forwardedRef) => {
|
|
2831
2965
|
const { tx } = useThemeContext();
|
|
2832
|
-
return /* @__PURE__ */
|
|
2966
|
+
return /* @__PURE__ */ React34.createElement(SeparatorPrimitive, {
|
|
2833
2967
|
orientation,
|
|
2834
2968
|
...props,
|
|
2835
2969
|
className: tx("separator.root", "separator", {
|
|
2836
2970
|
orientation
|
|
2837
|
-
}, classNames)
|
|
2971
|
+
}, classNames),
|
|
2972
|
+
ref: forwardedRef
|
|
2838
2973
|
});
|
|
2839
|
-
};
|
|
2974
|
+
});
|
|
2840
2975
|
|
|
2841
2976
|
// packages/ui/react-ui/src/components/Tag/Tag.tsx
|
|
2842
2977
|
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
2843
2978
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
2844
|
-
import
|
|
2845
|
-
var Tag = /* @__PURE__ */
|
|
2979
|
+
import React35, { forwardRef as forwardRef27 } from "react";
|
|
2980
|
+
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
2846
2981
|
const { tx } = useThemeContext();
|
|
2847
2982
|
const Root5 = asChild ? Slot13 : Primitive12.span;
|
|
2848
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
2849
2984
|
...props,
|
|
2850
|
-
className: tx("tag.root", "tag", {
|
|
2985
|
+
className: tx("tag.root", "dx-tag", {
|
|
2851
2986
|
palette
|
|
2852
2987
|
}, classNames),
|
|
2988
|
+
"data-hue": palette,
|
|
2853
2989
|
ref: forwardedRef
|
|
2854
2990
|
});
|
|
2855
2991
|
});
|
|
@@ -2858,56 +2994,56 @@ var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette, classNames, ...props
|
|
|
2858
2994
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
2859
2995
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2860
2996
|
import { ToastProvider as ToastProviderPrimitive, ToastViewport as ToastViewportPrimitive, Root as ToastRootPrimitive, ToastTitle as ToastTitlePrimitive, ToastDescription as ToastDescriptionPrimitive, ToastAction as ToastActionPrimitive, ToastClose as ToastClosePrimitive } from "@radix-ui/react-toast";
|
|
2861
|
-
import
|
|
2997
|
+
import React36, { forwardRef as forwardRef28 } from "react";
|
|
2862
2998
|
var ToastProvider = ToastProviderPrimitive;
|
|
2863
|
-
var ToastViewport = /* @__PURE__ */
|
|
2999
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
2864
3000
|
const { tx } = useThemeContext();
|
|
2865
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ React36.createElement(ToastViewportPrimitive, {
|
|
2866
3002
|
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
2867
3003
|
ref: forwardedRef
|
|
2868
3004
|
});
|
|
2869
3005
|
});
|
|
2870
|
-
var ToastRoot = /* @__PURE__ */
|
|
3006
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
2871
3007
|
const { tx } = useThemeContext();
|
|
2872
|
-
return /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ React36.createElement(ToastRootPrimitive, {
|
|
2873
3009
|
...props,
|
|
2874
3010
|
className: tx("toast.root", "toast", {}, classNames),
|
|
2875
3011
|
ref: forwardedRef
|
|
2876
|
-
}, /* @__PURE__ */
|
|
2877
|
-
elevation: "
|
|
3012
|
+
}, /* @__PURE__ */ React36.createElement(ElevationProvider, {
|
|
3013
|
+
elevation: "toast"
|
|
2878
3014
|
}, children));
|
|
2879
3015
|
});
|
|
2880
|
-
var ToastBody = /* @__PURE__ */
|
|
3016
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2881
3017
|
const { tx } = useThemeContext();
|
|
2882
3018
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
2883
|
-
return /* @__PURE__ */
|
|
3019
|
+
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
2884
3020
|
...props,
|
|
2885
3021
|
className: tx("toast.body", "toast__body", {}, classNames),
|
|
2886
3022
|
ref: forwardedRef
|
|
2887
3023
|
});
|
|
2888
3024
|
});
|
|
2889
|
-
var ToastTitle = /* @__PURE__ */
|
|
3025
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2890
3026
|
const { tx } = useThemeContext();
|
|
2891
3027
|
const Root5 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
2892
|
-
return /* @__PURE__ */
|
|
3028
|
+
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
2893
3029
|
...props,
|
|
2894
3030
|
className: tx("toast.title", "toast__title", {}, classNames),
|
|
2895
3031
|
ref: forwardedRef
|
|
2896
3032
|
});
|
|
2897
3033
|
});
|
|
2898
|
-
var ToastDescription = /* @__PURE__ */
|
|
3034
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2899
3035
|
const { tx } = useThemeContext();
|
|
2900
3036
|
const Root5 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
2901
|
-
return /* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
2902
3038
|
...props,
|
|
2903
3039
|
className: tx("toast.description", "toast__description", {}, classNames),
|
|
2904
3040
|
ref: forwardedRef
|
|
2905
3041
|
});
|
|
2906
3042
|
});
|
|
2907
|
-
var ToastActions = /* @__PURE__ */
|
|
3043
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2908
3044
|
const { tx } = useThemeContext();
|
|
2909
3045
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
2910
|
-
return /* @__PURE__ */
|
|
3046
|
+
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
2911
3047
|
...props,
|
|
2912
3048
|
className: tx("toast.actions", "toast__actions", {}, classNames),
|
|
2913
3049
|
ref: forwardedRef
|
|
@@ -2929,55 +3065,63 @@ var Toast = {
|
|
|
2929
3065
|
|
|
2930
3066
|
// packages/ui/react-ui/src/components/Toolbar/Toolbar.tsx
|
|
2931
3067
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
2932
|
-
import
|
|
2933
|
-
var ToolbarRoot = /* @__PURE__ */
|
|
3068
|
+
import React37, { forwardRef as forwardRef29 } from "react";
|
|
3069
|
+
var ToolbarRoot = /* @__PURE__ */ forwardRef29(({ classNames, children, ...props }, forwardedRef) => {
|
|
2934
3070
|
const { tx } = useThemeContext();
|
|
2935
|
-
return /* @__PURE__ */
|
|
3071
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Root, {
|
|
2936
3072
|
...props,
|
|
2937
3073
|
className: tx("toolbar.root", "toolbar", {}, classNames),
|
|
2938
3074
|
ref: forwardedRef
|
|
2939
3075
|
}, children);
|
|
2940
3076
|
});
|
|
2941
|
-
var ToolbarButton = /* @__PURE__ */
|
|
2942
|
-
return /* @__PURE__ */
|
|
3077
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3078
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
2943
3079
|
asChild: true
|
|
2944
|
-
}, /* @__PURE__ */
|
|
3080
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
2945
3081
|
...props,
|
|
2946
3082
|
ref: forwardedRef
|
|
2947
3083
|
}));
|
|
2948
3084
|
});
|
|
2949
|
-
var
|
|
2950
|
-
return /* @__PURE__ */
|
|
3085
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3086
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
2951
3087
|
asChild: true
|
|
2952
|
-
}, /* @__PURE__ */
|
|
3088
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
2953
3089
|
...props,
|
|
2954
3090
|
ref: forwardedRef
|
|
2955
3091
|
}));
|
|
2956
3092
|
});
|
|
2957
|
-
var
|
|
2958
|
-
return /* @__PURE__ */
|
|
3093
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3094
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
2959
3095
|
asChild: true
|
|
2960
|
-
}, /* @__PURE__ */
|
|
3096
|
+
}, /* @__PURE__ */ React37.createElement(Toggle, {
|
|
2961
3097
|
...props,
|
|
2962
3098
|
ref: forwardedRef
|
|
2963
3099
|
}));
|
|
2964
3100
|
});
|
|
2965
|
-
var
|
|
2966
|
-
return /* @__PURE__ */
|
|
3101
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3102
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Link, {
|
|
3103
|
+
asChild: true
|
|
3104
|
+
}, /* @__PURE__ */ React37.createElement(Link, {
|
|
3105
|
+
...props,
|
|
3106
|
+
ref: forwardedRef
|
|
3107
|
+
}));
|
|
3108
|
+
});
|
|
3109
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef29(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
3110
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
2967
3111
|
...props,
|
|
2968
3112
|
asChild: true
|
|
2969
|
-
}, /* @__PURE__ */
|
|
3113
|
+
}, /* @__PURE__ */ React37.createElement(ButtonGroup, {
|
|
2970
3114
|
classNames,
|
|
2971
3115
|
children,
|
|
2972
3116
|
elevation,
|
|
2973
3117
|
ref: forwardedRef
|
|
2974
3118
|
}));
|
|
2975
3119
|
});
|
|
2976
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
2977
|
-
return /* @__PURE__ */
|
|
3120
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
3121
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
2978
3122
|
...props,
|
|
2979
3123
|
asChild: true
|
|
2980
|
-
}, /* @__PURE__ */
|
|
3124
|
+
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
2981
3125
|
variant,
|
|
2982
3126
|
density,
|
|
2983
3127
|
elevation,
|
|
@@ -2986,26 +3130,42 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef28(({ variant, density, e
|
|
|
2986
3130
|
ref: forwardedRef
|
|
2987
3131
|
}));
|
|
2988
3132
|
});
|
|
2989
|
-
var
|
|
2990
|
-
return /* @__PURE__ */
|
|
3133
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
3134
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
3135
|
+
...props,
|
|
2991
3136
|
asChild: true
|
|
2992
|
-
}, /* @__PURE__ */
|
|
2993
|
-
|
|
2994
|
-
|
|
3137
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3138
|
+
variant,
|
|
3139
|
+
density,
|
|
3140
|
+
elevation,
|
|
3141
|
+
classNames,
|
|
3142
|
+
icon,
|
|
3143
|
+
label,
|
|
3144
|
+
iconOnly,
|
|
3145
|
+
ref: forwardedRef
|
|
2995
3146
|
}));
|
|
2996
|
-
};
|
|
2997
|
-
var
|
|
2998
|
-
|
|
3147
|
+
});
|
|
3148
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef29(({ variant = "line", ...props }, forwardedRef) => {
|
|
3149
|
+
return variant === "line" ? /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
3150
|
+
asChild: true
|
|
3151
|
+
}, /* @__PURE__ */ React37.createElement(Separator4, {
|
|
3152
|
+
...props,
|
|
3153
|
+
ref: forwardedRef
|
|
3154
|
+
})) : /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Separator, {
|
|
3155
|
+
className: "grow",
|
|
3156
|
+
ref: forwardedRef
|
|
3157
|
+
});
|
|
2999
3158
|
});
|
|
3000
3159
|
var Toolbar = {
|
|
3001
3160
|
Root: ToolbarRoot,
|
|
3002
3161
|
Button: ToolbarButton,
|
|
3162
|
+
IconButton: ToolbarIconButton,
|
|
3003
3163
|
Link: ToolbarLink,
|
|
3004
3164
|
Toggle: ToolbarToggle,
|
|
3005
3165
|
ToggleGroup: ToolbarToggleGroup2,
|
|
3006
3166
|
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
3007
|
-
|
|
3008
|
-
|
|
3167
|
+
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
3168
|
+
Separator: ToolbarSeparator
|
|
3009
3169
|
};
|
|
3010
3170
|
export {
|
|
3011
3171
|
AlertDialog,
|
|
@@ -3056,6 +3216,7 @@ export {
|
|
|
3056
3216
|
createDropdownMenuScope,
|
|
3057
3217
|
createPopoverScope,
|
|
3058
3218
|
hasIosKeyboard,
|
|
3219
|
+
initialSafeArea,
|
|
3059
3220
|
isLabel,
|
|
3060
3221
|
toLocalizedString,
|
|
3061
3222
|
useAvatarContext,
|
|
@@ -3065,9 +3226,11 @@ export {
|
|
|
3065
3226
|
useDropdownMenuContext,
|
|
3066
3227
|
useDropdownMenuMenuScope,
|
|
3067
3228
|
useElevationContext,
|
|
3229
|
+
useLandmarkMover,
|
|
3068
3230
|
useListContext,
|
|
3069
3231
|
useListItemContext,
|
|
3070
3232
|
useMainContext,
|
|
3233
|
+
useSafeArea,
|
|
3071
3234
|
useSidebars,
|
|
3072
3235
|
useThemeContext,
|
|
3073
3236
|
useTranslation,
|