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