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