@dxos/react-ui 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b
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 +272 -200
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +646 -577
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +272 -200
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +5 -9
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +1 -2
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +6 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +35 -24
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +2 -6
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -1
- package/dist/types/src/components/Separator/Separator.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -5
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +3 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.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/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/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -42
- package/src/components/Avatars/Avatar.tsx +3 -6
- package/src/components/Buttons/IconButton.tsx +25 -7
- package/src/components/Dialogs/Dialog.tsx +1 -9
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Main/Main.stories.tsx +1 -1
- package/src/components/Main/Main.tsx +78 -108
- package/src/components/Menus/ContextMenu.tsx +4 -2
- package/src/components/Menus/DropdownMenu.tsx +4 -2
- package/src/components/Popover/Popover.tsx +4 -0
- package/src/components/Select/Select.tsx +4 -1
- package/src/components/Separator/Separator.tsx +14 -11
- package/src/components/Tag/Tag.stories.tsx +20 -31
- package/src/components/Tag/Tag.tsx +15 -6
- package/src/components/ThemeProvider/ThemeProvider.tsx +12 -3
- package/src/components/Toolbar/Toolbar.tsx +40 -10
- package/src/components/Tooltip/Tooltip.tsx +17 -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
|
@@ -24,13 +24,36 @@ var useElevationContext = (propsElevation) => {
|
|
|
24
24
|
return propsElevation ?? elevation;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
// packages/ui/react-ui/src/hooks/useSafeArea.ts
|
|
28
|
+
import { useCallback, useState } from "react";
|
|
29
|
+
import { useResize } from "@dxos/react-hooks";
|
|
30
|
+
var initialSafeArea = {
|
|
31
|
+
top: NaN,
|
|
32
|
+
right: NaN,
|
|
33
|
+
bottom: NaN,
|
|
34
|
+
left: NaN
|
|
35
|
+
};
|
|
36
|
+
var useSafeArea = () => {
|
|
37
|
+
const [padding, setPadding] = useState(initialSafeArea);
|
|
38
|
+
const handleResize = useCallback(() => {
|
|
39
|
+
setPadding({
|
|
40
|
+
top: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-top")),
|
|
41
|
+
right: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-right")),
|
|
42
|
+
bottom: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-bottom")),
|
|
43
|
+
left: parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--safe-area-left"))
|
|
44
|
+
});
|
|
45
|
+
}, []);
|
|
46
|
+
useResize(handleResize);
|
|
47
|
+
return padding;
|
|
48
|
+
};
|
|
49
|
+
|
|
27
50
|
// packages/ui/react-ui/src/hooks/useTranslationsContext.ts
|
|
28
51
|
import { useContext as useContext4 } from "react";
|
|
29
52
|
|
|
30
53
|
// packages/ui/react-ui/src/components/ThemeProvider/TranslationsProvider.tsx
|
|
31
54
|
import { enUS as dtLocaleEnUs } from "date-fns/locale";
|
|
32
55
|
import i18Next from "i18next";
|
|
33
|
-
import React, { useEffect, createContext, useState, Suspense, useContext as useContext3 } from "react";
|
|
56
|
+
import React, { useEffect, createContext, useState as useState2, Suspense, useContext as useContext3 } from "react";
|
|
34
57
|
import { initReactI18next, useTranslation as useI18NextTranslation } from "react-i18next";
|
|
35
58
|
var initialLng = "en-US";
|
|
36
59
|
var initialNs = "dxos-common";
|
|
@@ -65,7 +88,7 @@ var useTranslation = (...args) => {
|
|
|
65
88
|
};
|
|
66
89
|
};
|
|
67
90
|
var TranslationsProvider = ({ fallback, resourceExtensions, children, appNs, dtLocale }) => {
|
|
68
|
-
const [loaded, setLoaded] =
|
|
91
|
+
const [loaded, setLoaded] = useState2(false);
|
|
69
92
|
useEffect(() => {
|
|
70
93
|
setLoaded(false);
|
|
71
94
|
if (resourceExtensions && resourceExtensions.length) {
|
|
@@ -100,21 +123,18 @@ import { raise } from "@dxos/debug";
|
|
|
100
123
|
var useThemeContext = () => useContext5(ThemeContext) ?? raise(new Error("Missing ThemeContext"));
|
|
101
124
|
|
|
102
125
|
// packages/ui/react-ui/src/hooks/useVisualViewport.ts
|
|
103
|
-
import {
|
|
126
|
+
import { useCallback as useCallback2, useState as useState3 } from "react";
|
|
127
|
+
import { useResize as useResize2 } from "@dxos/react-hooks";
|
|
104
128
|
var useVisualViewport = (deps) => {
|
|
105
|
-
const [width, setWidth] =
|
|
106
|
-
const [height, setHeight] =
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
window.visualViewport?.addEventListener("resize", handleResize);
|
|
115
|
-
handleResize();
|
|
116
|
-
return () => window.visualViewport?.removeEventListener("resize", handleResize);
|
|
117
|
-
}, deps ?? []);
|
|
129
|
+
const [width, setWidth] = useState3(null);
|
|
130
|
+
const [height, setHeight] = useState3(null);
|
|
131
|
+
const handleResize = useCallback2(() => {
|
|
132
|
+
if (window.visualViewport) {
|
|
133
|
+
setWidth(window.visualViewport.width);
|
|
134
|
+
setHeight(window.visualViewport.height);
|
|
135
|
+
}
|
|
136
|
+
}, []);
|
|
137
|
+
useResize2(handleResize);
|
|
118
138
|
return {
|
|
119
139
|
width,
|
|
120
140
|
height
|
|
@@ -574,11 +594,33 @@ var ButtonGroup = /* @__PURE__ */ forwardRef7(({ children, elevation: propsEleva
|
|
|
574
594
|
ButtonGroup.displayName = BUTTON_GROUP_NAME;
|
|
575
595
|
|
|
576
596
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
577
|
-
import React10, { forwardRef as forwardRef9 } from "react";
|
|
597
|
+
import React10, { forwardRef as forwardRef9, useState as useState4 } from "react";
|
|
578
598
|
|
|
579
599
|
// packages/ui/react-ui/src/components/Tooltip/Tooltip.tsx
|
|
580
600
|
import { Provider as TooltipProviderPrimitive, Root as TooltipRootPrimitive, TooltipContent as TooltipContentPrimitive, TooltipTrigger as TooltipTriggerPrimitive, TooltipPortal as TooltipPortalPrimitive, TooltipArrow as TooltipArrowPrimitive } from "@radix-ui/react-tooltip";
|
|
581
601
|
import React9, { forwardRef as forwardRef8 } from "react";
|
|
602
|
+
|
|
603
|
+
// packages/ui/react-ui/src/hooks/useSafeCollisionPadding.ts
|
|
604
|
+
import { useMemo } from "react";
|
|
605
|
+
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
606
|
+
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
607
|
+
var safePadding = (propsPadding, safePadding2, side) => {
|
|
608
|
+
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
609
|
+
};
|
|
610
|
+
var useSafeCollisionPadding = (collisionPadding) => {
|
|
611
|
+
const { safeAreaPadding } = useThemeContext();
|
|
612
|
+
return useMemo(() => ({
|
|
613
|
+
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
614
|
+
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
615
|
+
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
616
|
+
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
617
|
+
}), [
|
|
618
|
+
collisionPadding,
|
|
619
|
+
safeAreaPadding
|
|
620
|
+
]);
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
// packages/ui/react-ui/src/components/Tooltip/Tooltip.tsx
|
|
582
624
|
var TooltipProvider = TooltipProviderPrimitive;
|
|
583
625
|
var TooltipRoot = TooltipRootPrimitive;
|
|
584
626
|
var TooltipPortal = TooltipPortalPrimitive;
|
|
@@ -591,13 +633,14 @@ var TooltipArrow = /* @__PURE__ */ forwardRef8(({ classNames, ...props }, forwar
|
|
|
591
633
|
ref: forwardedRef
|
|
592
634
|
});
|
|
593
635
|
});
|
|
594
|
-
var TooltipContent = /* @__PURE__ */ forwardRef8(({ classNames, ...props }, forwardedRef) => {
|
|
636
|
+
var TooltipContent = /* @__PURE__ */ forwardRef8(({ classNames, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
595
637
|
const { tx } = useThemeContext();
|
|
596
638
|
const elevation = useElevationContext();
|
|
639
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
597
640
|
return /* @__PURE__ */ React9.createElement(TooltipContentPrimitive, {
|
|
598
641
|
sideOffset: 4,
|
|
599
|
-
collisionPadding: 8,
|
|
600
642
|
...props,
|
|
643
|
+
collisionPadding: safeCollisionPadding,
|
|
601
644
|
className: tx("tooltip.content", "tooltip", {
|
|
602
645
|
elevation
|
|
603
646
|
}, classNames),
|
|
@@ -614,20 +657,34 @@ var Tooltip = {
|
|
|
614
657
|
};
|
|
615
658
|
|
|
616
659
|
// packages/ui/react-ui/src/components/Buttons/IconButton.tsx
|
|
617
|
-
var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ tooltipPortal = true, tooltipZIndex: zIndex, ...props }, forwardedRef) => {
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
660
|
+
var IconOnlyButton = /* @__PURE__ */ forwardRef9(({ tooltipPortal = true, tooltipZIndex: zIndex, tooltipSide, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
661
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState4(false);
|
|
662
|
+
const content = /* @__PURE__ */ React10.createElement(Tooltip.Content, {
|
|
663
|
+
...zIndex && {
|
|
664
|
+
style: {
|
|
665
|
+
zIndex
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
side: tooltipSide
|
|
622
669
|
}, props.label, /* @__PURE__ */ React10.createElement(Tooltip.Arrow, null));
|
|
623
|
-
return /* @__PURE__ */ React10.createElement(Tooltip.Root,
|
|
670
|
+
return /* @__PURE__ */ React10.createElement(Tooltip.Root, {
|
|
671
|
+
open: triggerTooltipOpen,
|
|
672
|
+
onOpenChange: (nextOpen) => {
|
|
673
|
+
if (suppressNextTooltip?.current) {
|
|
674
|
+
setTriggerTooltipOpen(false);
|
|
675
|
+
suppressNextTooltip.current = false;
|
|
676
|
+
} else {
|
|
677
|
+
setTriggerTooltipOpen(nextOpen);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}, /* @__PURE__ */ React10.createElement(Tooltip.Trigger, {
|
|
624
681
|
asChild: true
|
|
625
682
|
}, /* @__PURE__ */ React10.createElement(LabelledIconButton, {
|
|
626
683
|
...props,
|
|
627
684
|
ref: forwardedRef
|
|
628
685
|
})), tooltipPortal ? /* @__PURE__ */ React10.createElement(Tooltip.Portal, null, content) : content);
|
|
629
686
|
});
|
|
630
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, iconClassNames, ...props }, forwardedRef) => {
|
|
687
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, suppressNextTooltip, ...props }, forwardedRef) => {
|
|
631
688
|
const { tx } = useThemeContext();
|
|
632
689
|
return /* @__PURE__ */ React10.createElement(Button, {
|
|
633
690
|
...props,
|
|
@@ -639,7 +696,10 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef9(({ icon, size, iconOnly, la
|
|
|
639
696
|
classNames: iconClassNames
|
|
640
697
|
}), /* @__PURE__ */ React10.createElement("span", {
|
|
641
698
|
className: iconOnly ? "sr-only" : void 0
|
|
642
|
-
}, label)
|
|
699
|
+
}, label), caretDown && /* @__PURE__ */ React10.createElement(Icon, {
|
|
700
|
+
size: 3,
|
|
701
|
+
icon: "ph--caret-down--bold"
|
|
702
|
+
}));
|
|
643
703
|
});
|
|
644
704
|
var IconButton = /* @__PURE__ */ forwardRef9((props, forwardedRef) => props.iconOnly ? /* @__PURE__ */ React10.createElement(IconOnlyButton, {
|
|
645
705
|
...props,
|
|
@@ -692,7 +752,7 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef11(({ variant, elevation, densit
|
|
|
692
752
|
});
|
|
693
753
|
|
|
694
754
|
// packages/ui/react-ui/src/components/Clipboard/ClipboardProvider.tsx
|
|
695
|
-
import React13, { createContext as createContext4, useCallback, useContext as useContext6, useState as
|
|
755
|
+
import React13, { createContext as createContext4, useCallback as useCallback3, useContext as useContext6, useState as useState5 } from "react";
|
|
696
756
|
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
697
757
|
textValue: "",
|
|
698
758
|
setTextValue: async (_) => {
|
|
@@ -700,8 +760,8 @@ var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
|
700
760
|
});
|
|
701
761
|
var useClipboard = () => useContext6(ClipboardContext);
|
|
702
762
|
var ClipboardProvider = ({ children }) => {
|
|
703
|
-
const [textValue, setInternalTextValue] =
|
|
704
|
-
const setTextValue =
|
|
763
|
+
const [textValue, setInternalTextValue] = useState5("");
|
|
764
|
+
const setTextValue = useCallback3(async (nextValue) => {
|
|
705
765
|
await navigator.clipboard.writeText(nextValue);
|
|
706
766
|
return setInternalTextValue(nextValue);
|
|
707
767
|
}, []);
|
|
@@ -714,12 +774,12 @@ var ClipboardProvider = ({ children }) => {
|
|
|
714
774
|
};
|
|
715
775
|
|
|
716
776
|
// packages/ui/react-ui/src/components/Clipboard/CopyButton.tsx
|
|
717
|
-
import React17, { useState as
|
|
777
|
+
import React17, { useState as useState6 } from "react";
|
|
718
778
|
import { mx } from "@dxos/react-ui-theme";
|
|
719
779
|
|
|
720
780
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
721
781
|
import { createKeyborg } from "keyborg";
|
|
722
|
-
import React16, { createContext as createContext7, useEffect as
|
|
782
|
+
import React16, { createContext as createContext7, useEffect as useEffect2, useMemo as useMemo2 } from "react";
|
|
723
783
|
|
|
724
784
|
// packages/ui/react-ui/src/util/hasIosKeyboard.ts
|
|
725
785
|
var hasIosKeyboard = () => {
|
|
@@ -751,20 +811,28 @@ var ElevationProvider = ({ elevation, children }) => /* @__PURE__ */ React15.cre
|
|
|
751
811
|
// packages/ui/react-ui/src/components/ThemeProvider/ThemeProvider.tsx
|
|
752
812
|
var ThemeContext = /* @__PURE__ */ createContext7(void 0);
|
|
753
813
|
var ThemeProvider = ({ children, fallback = null, resourceExtensions, appNs, tx = (_path, defaultClassName, _styleProps, ..._options) => defaultClassName, themeMode = "dark", rootDensity = "fine", ...rest }) => {
|
|
754
|
-
|
|
814
|
+
useEffect2(() => {
|
|
755
815
|
if (document.defaultView) {
|
|
756
816
|
const kb = createKeyborg(document.defaultView);
|
|
757
817
|
kb.subscribe(handleInputModalityChange);
|
|
758
818
|
return () => kb.unsubscribe(handleInputModalityChange);
|
|
759
819
|
}
|
|
760
820
|
}, []);
|
|
821
|
+
const safeAreaPadding = useSafeArea();
|
|
822
|
+
const contextValue = useMemo2(() => ({
|
|
823
|
+
tx,
|
|
824
|
+
themeMode,
|
|
825
|
+
hasIosKeyboard: hasIosKeyboard(),
|
|
826
|
+
safeAreaPadding,
|
|
827
|
+
...rest
|
|
828
|
+
}), [
|
|
829
|
+
tx,
|
|
830
|
+
themeMode,
|
|
831
|
+
safeAreaPadding,
|
|
832
|
+
rest
|
|
833
|
+
]);
|
|
761
834
|
return /* @__PURE__ */ React16.createElement(ThemeContext.Provider, {
|
|
762
|
-
value:
|
|
763
|
-
tx,
|
|
764
|
-
themeMode,
|
|
765
|
-
hasIosKeyboard: hasIosKeyboard(),
|
|
766
|
-
...rest
|
|
767
|
-
}
|
|
835
|
+
value: contextValue
|
|
768
836
|
}, /* @__PURE__ */ React16.createElement(TranslationsProvider, {
|
|
769
837
|
fallback,
|
|
770
838
|
resourceExtensions,
|
|
@@ -822,7 +890,7 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
822
890
|
const { textValue, setTextValue } = useClipboard();
|
|
823
891
|
const isCopied = textValue === value;
|
|
824
892
|
const label = isCopied ? t("copy success label") : t("copy label");
|
|
825
|
-
const [open, setOpen] =
|
|
893
|
+
const [open, setOpen] = useState6(false);
|
|
826
894
|
return /* @__PURE__ */ React17.createElement(Tooltip.Root, {
|
|
827
895
|
delayDuration: 1500,
|
|
828
896
|
open,
|
|
@@ -895,7 +963,7 @@ var DialogOverlay = /* @__PURE__ */ forwardRef12(({ classNames, children, blockA
|
|
|
895
963
|
const { tx } = useThemeContext();
|
|
896
964
|
return /* @__PURE__ */ React18.createElement(DialogOverlayPrimitive, {
|
|
897
965
|
...props,
|
|
898
|
-
className: tx("dialog.overlay", "dialog__overlay", {}, classNames
|
|
966
|
+
className: tx("dialog.overlay", "dialog__overlay", {}, classNames),
|
|
899
967
|
ref: forwardedRef,
|
|
900
968
|
"data-block-align": blockAlign
|
|
901
969
|
}, /* @__PURE__ */ React18.createElement(OverlayLayoutProvider, {
|
|
@@ -1006,12 +1074,13 @@ import React20, { forwardRef as forwardRef14 } from "react";
|
|
|
1006
1074
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
1007
1075
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
1008
1076
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
1009
|
-
var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, ...props }, forwardedRef) => {
|
|
1077
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
1010
1078
|
const { tx } = useThemeContext();
|
|
1011
1079
|
const elevation = useElevationContext();
|
|
1080
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1012
1081
|
return /* @__PURE__ */ React20.createElement(ContextMenuPrimitive.Content, {
|
|
1013
|
-
collisionPadding: 8,
|
|
1014
1082
|
...props,
|
|
1083
|
+
collisionPadding: safeCollisionPadding,
|
|
1015
1084
|
className: tx("menu.content", "menu", {
|
|
1016
1085
|
elevation
|
|
1017
1086
|
}, classNames),
|
|
@@ -1094,7 +1163,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
1094
1163
|
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
1095
1164
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
1096
1165
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
1097
|
-
import React21, { useRef, useCallback as
|
|
1166
|
+
import React21, { useRef, useCallback as useCallback4, forwardRef as forwardRef15, useEffect as useEffect3 } from "react";
|
|
1098
1167
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
1099
1168
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
1100
1169
|
createMenuScope
|
|
@@ -1117,7 +1186,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
1117
1186
|
contentId: useId3(),
|
|
1118
1187
|
open,
|
|
1119
1188
|
onOpenChange: setOpen,
|
|
1120
|
-
onOpenToggle:
|
|
1189
|
+
onOpenToggle: useCallback4(() => setOpen((prevOpen) => !prevOpen), [
|
|
1121
1190
|
setOpen
|
|
1122
1191
|
]),
|
|
1123
1192
|
modal
|
|
@@ -1186,7 +1255,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1186
1255
|
const { __scopeDropdownMenu, virtualRef } = props;
|
|
1187
1256
|
const context = useDropdownMenuContext(VIRTUAL_TRIGGER_NAME, __scopeDropdownMenu);
|
|
1188
1257
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1189
|
-
|
|
1258
|
+
useEffect3(() => {
|
|
1190
1259
|
if (virtualRef.current) {
|
|
1191
1260
|
context.triggerRef.current = virtualRef.current;
|
|
1192
1261
|
}
|
|
@@ -1218,17 +1287,19 @@ var DropdownMenuViewport = /* @__PURE__ */ forwardRef15(({ classNames, asChild,
|
|
|
1218
1287
|
});
|
|
1219
1288
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1220
1289
|
var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
1221
|
-
const { __scopeDropdownMenu, classNames, ...contentProps } = props;
|
|
1290
|
+
const { __scopeDropdownMenu, classNames, collisionPadding = 8, ...contentProps } = props;
|
|
1222
1291
|
const { tx } = useThemeContext();
|
|
1223
1292
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
1224
1293
|
const elevation = useElevationContext();
|
|
1225
1294
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1226
1295
|
const hasInteractedOutsideRef = useRef(false);
|
|
1296
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1227
1297
|
return /* @__PURE__ */ React21.createElement(MenuPrimitive.Content, {
|
|
1228
1298
|
id: context.contentId,
|
|
1229
1299
|
"aria-labelledby": context.triggerId,
|
|
1230
1300
|
...menuScope,
|
|
1231
1301
|
...contentProps,
|
|
1302
|
+
collisionPadding: safeCollisionPadding,
|
|
1232
1303
|
ref: forwardedRef,
|
|
1233
1304
|
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
1234
1305
|
if (!hasInteractedOutsideRef.current) {
|
|
@@ -1443,7 +1514,7 @@ var useDropdownMenuMenuScope = useMenuScope;
|
|
|
1443
1514
|
// packages/ui/react-ui/src/components/Input/Input.tsx
|
|
1444
1515
|
import { Root as CheckboxPrimitive } from "@radix-ui/react-checkbox";
|
|
1445
1516
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
1446
|
-
import React22, { forwardRef as forwardRef16, useCallback as
|
|
1517
|
+
import React22, { forwardRef as forwardRef16, useCallback as useCallback5 } from "react";
|
|
1447
1518
|
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";
|
|
1448
1519
|
var Label3 = /* @__PURE__ */ forwardRef16(({ srOnly, classNames, children, ...props }, forwardedRef) => {
|
|
1449
1520
|
const { tx } = useThemeContext();
|
|
@@ -1492,7 +1563,7 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ density: propsDensity, elevation:
|
|
|
1492
1563
|
const { tx } = useThemeContext();
|
|
1493
1564
|
const density = useDensityContext(propsDensity);
|
|
1494
1565
|
const elevation = useElevationContext(propsElevation);
|
|
1495
|
-
const segmentClassName =
|
|
1566
|
+
const segmentClassName = useCallback5(({ focused, validationValence }) => tx("input.input", "input--pin-segment", {
|
|
1496
1567
|
variant: "static",
|
|
1497
1568
|
focused,
|
|
1498
1569
|
disabled: props.disabled,
|
|
@@ -1600,7 +1671,7 @@ var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, checked: propsChecked
|
|
|
1600
1671
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
1601
1672
|
return /* @__PURE__ */ React22.createElement("input", {
|
|
1602
1673
|
type: "checkbox",
|
|
1603
|
-
className: "
|
|
1674
|
+
className: "dx-checkbox--switch dx-focus-ring",
|
|
1604
1675
|
checked,
|
|
1605
1676
|
onChange: (event) => {
|
|
1606
1677
|
onCheckedChange(event.target.checked);
|
|
@@ -1945,18 +2016,17 @@ var Treegrid = {
|
|
|
1945
2016
|
|
|
1946
2017
|
// packages/ui/react-ui/src/components/Main/Main.tsx
|
|
1947
2018
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
1948
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
1949
2019
|
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
1950
2020
|
import { Root as DialogRoot2, DialogContent as DialogContent2 } from "@radix-ui/react-dialog";
|
|
1951
2021
|
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
1952
2022
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
1953
2023
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
1954
|
-
import React28, { forwardRef as forwardRef20, useCallback as
|
|
2024
|
+
import React28, { forwardRef as forwardRef20, useCallback as useCallback7, useEffect as useEffect5, useRef as useRef2, useState as useState8 } from "react";
|
|
1955
2025
|
import { log } from "@dxos/log";
|
|
1956
2026
|
import { useMediaQuery, useForwardedRef } from "@dxos/react-hooks";
|
|
1957
2027
|
|
|
1958
2028
|
// packages/ui/react-ui/src/components/Main/useSwipeToDismiss.ts
|
|
1959
|
-
import { useCallback as
|
|
2029
|
+
import { useCallback as useCallback6, useEffect as useEffect4, useState as useState7 } from "react";
|
|
1960
2030
|
var MotionState;
|
|
1961
2031
|
(function(MotionState2) {
|
|
1962
2032
|
MotionState2[MotionState2["IDLE"] = 0] = "IDLE";
|
|
@@ -1971,22 +2041,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
1971
2041
|
/* side = 'inline-start' */
|
|
1972
2042
|
}) => {
|
|
1973
2043
|
const $root = ref.current;
|
|
1974
|
-
const [motionState, setMotionState] =
|
|
1975
|
-
const [gestureStartX, setGestureStartX] =
|
|
1976
|
-
const setIdle =
|
|
2044
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2045
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2046
|
+
const setIdle = useCallback6(() => {
|
|
1977
2047
|
setMotionState(0);
|
|
1978
2048
|
$root?.style.removeProperty("inset-inline-start");
|
|
1979
2049
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
1980
2050
|
}, [
|
|
1981
2051
|
$root
|
|
1982
2052
|
]);
|
|
1983
|
-
const setFollowing =
|
|
2053
|
+
const setFollowing = useCallback6(() => {
|
|
1984
2054
|
setMotionState(2);
|
|
1985
2055
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
1986
2056
|
}, [
|
|
1987
2057
|
$root
|
|
1988
2058
|
]);
|
|
1989
|
-
const handlePointerDown =
|
|
2059
|
+
const handlePointerDown = useCallback6(({ screenX }) => {
|
|
1990
2060
|
if (motionState === 0) {
|
|
1991
2061
|
setMotionState(1);
|
|
1992
2062
|
setGestureStartX(screenX);
|
|
@@ -1994,7 +2064,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
1994
2064
|
}, [
|
|
1995
2065
|
motionState
|
|
1996
2066
|
]);
|
|
1997
|
-
const handlePointerMove =
|
|
2067
|
+
const handlePointerMove = useCallback6(({ screenX }) => {
|
|
1998
2068
|
if ($root) {
|
|
1999
2069
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2000
2070
|
switch (motionState) {
|
|
@@ -2018,12 +2088,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2018
2088
|
motionState,
|
|
2019
2089
|
gestureStartX
|
|
2020
2090
|
]);
|
|
2021
|
-
const handlePointerUp =
|
|
2091
|
+
const handlePointerUp = useCallback6(() => {
|
|
2022
2092
|
setIdle();
|
|
2023
2093
|
}, [
|
|
2024
2094
|
setIdle
|
|
2025
2095
|
]);
|
|
2026
|
-
|
|
2096
|
+
useEffect4(() => {
|
|
2027
2097
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2028
2098
|
return () => {
|
|
2029
2099
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2032,7 +2102,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2032
2102
|
$root,
|
|
2033
2103
|
handlePointerDown
|
|
2034
2104
|
]);
|
|
2035
|
-
|
|
2105
|
+
useEffect4(() => {
|
|
2036
2106
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2037
2107
|
return () => {
|
|
2038
2108
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2041,7 +2111,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2041
2111
|
$root,
|
|
2042
2112
|
handlePointerMove
|
|
2043
2113
|
]);
|
|
2044
|
-
|
|
2114
|
+
useEffect4(() => {
|
|
2045
2115
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2046
2116
|
return () => {
|
|
2047
2117
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2061,7 +2131,7 @@ var MAIN_NAME = "Main";
|
|
|
2061
2131
|
var GENERIC_CONSUMER_NAME = "GenericConsumer";
|
|
2062
2132
|
var landmarkAttr = "data-main-landmark";
|
|
2063
2133
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2064
|
-
const handleKeyDown =
|
|
2134
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2065
2135
|
const target = event.target;
|
|
2066
2136
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2067
2137
|
event.preventDefault();
|
|
@@ -2090,72 +2160,66 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2090
2160
|
};
|
|
2091
2161
|
var [MainProvider, useMainContext] = createContext10(MAIN_NAME, {
|
|
2092
2162
|
resizing: false,
|
|
2093
|
-
|
|
2094
|
-
|
|
2163
|
+
navigationSidebarState: "closed",
|
|
2164
|
+
setNavigationSidebarState: (nextState) => {
|
|
2095
2165
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2096
2166
|
F: __dxlog_file,
|
|
2097
|
-
L:
|
|
2167
|
+
L: 81,
|
|
2098
2168
|
S: void 0,
|
|
2099
2169
|
C: (f, a) => f(...a)
|
|
2100
2170
|
});
|
|
2101
2171
|
},
|
|
2102
|
-
|
|
2103
|
-
|
|
2172
|
+
complementarySidebarState: "closed",
|
|
2173
|
+
setComplementarySidebarState: (nextState) => {
|
|
2104
2174
|
log.warn("Attempt to set sidebar state without initializing `MainRoot`", void 0, {
|
|
2105
2175
|
F: __dxlog_file,
|
|
2106
|
-
L:
|
|
2176
|
+
L: 86,
|
|
2107
2177
|
S: void 0,
|
|
2108
2178
|
C: (f, a) => f(...a)
|
|
2109
2179
|
});
|
|
2110
2180
|
}
|
|
2111
2181
|
});
|
|
2112
2182
|
var useSidebars = (consumerName = GENERIC_CONSUMER_NAME) => {
|
|
2113
|
-
const {
|
|
2183
|
+
const { setNavigationSidebarState, navigationSidebarState, setComplementarySidebarState, complementarySidebarState } = useMainContext(consumerName);
|
|
2114
2184
|
return {
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
toggleNavigationSidebar:
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
]),
|
|
2121
|
-
openNavigationSidebar: useCallback5(() => setNavigationSidebarOpen(true), [
|
|
2122
|
-
setNavigationSidebarOpen
|
|
2123
|
-
]),
|
|
2124
|
-
closeNavigationSidebar: useCallback5(() => setNavigationSidebarOpen(false), [
|
|
2125
|
-
setNavigationSidebarOpen
|
|
2185
|
+
navigationSidebarState,
|
|
2186
|
+
setNavigationSidebarState,
|
|
2187
|
+
toggleNavigationSidebar: useCallback7(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2188
|
+
navigationSidebarState,
|
|
2189
|
+
setNavigationSidebarState
|
|
2126
2190
|
]),
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2191
|
+
openNavigationSidebar: useCallback7(() => setNavigationSidebarState("expanded"), []),
|
|
2192
|
+
collapseNavigationSidebar: useCallback7(() => setNavigationSidebarState("collapsed"), []),
|
|
2193
|
+
closeNavigationSidebar: useCallback7(() => setNavigationSidebarState("closed"), []),
|
|
2194
|
+
complementarySidebarState,
|
|
2195
|
+
setComplementarySidebarState,
|
|
2196
|
+
toggleComplementarySidebar: useCallback7(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2197
|
+
complementarySidebarState,
|
|
2198
|
+
setComplementarySidebarState
|
|
2132
2199
|
]),
|
|
2133
|
-
openComplementarySidebar:
|
|
2134
|
-
|
|
2135
|
-
])
|
|
2136
|
-
closeComplementarySidebar: useCallback5(() => setComplementarySidebarOpen(false), [
|
|
2137
|
-
setComplementarySidebarOpen
|
|
2138
|
-
])
|
|
2200
|
+
openComplementarySidebar: useCallback7(() => setComplementarySidebarState("expanded"), []),
|
|
2201
|
+
collapseComplementarySidebar: useCallback7(() => setComplementarySidebarState("collapsed"), []),
|
|
2202
|
+
closeComplementarySidebar: useCallback7(() => setComplementarySidebarState("closed"), [])
|
|
2139
2203
|
};
|
|
2140
2204
|
};
|
|
2141
2205
|
var resizeDebounce = 3e3;
|
|
2142
|
-
var MainRoot = ({
|
|
2206
|
+
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState, onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState, onComplementarySidebarStateChange, children, ...props }) => {
|
|
2143
2207
|
const [isLg] = useMediaQuery("lg", {
|
|
2144
2208
|
ssr: false
|
|
2145
2209
|
});
|
|
2146
|
-
const [
|
|
2147
|
-
prop:
|
|
2148
|
-
defaultProp:
|
|
2149
|
-
onChange:
|
|
2210
|
+
const [navigationSidebarState = isLg ? "expanded" : "collapsed", setNavigationSidebarState] = useControllableState4({
|
|
2211
|
+
prop: propsNavigationSidebarState,
|
|
2212
|
+
defaultProp: defaultNavigationSidebarState,
|
|
2213
|
+
onChange: onNavigationSidebarStateChange
|
|
2150
2214
|
});
|
|
2151
|
-
const [
|
|
2152
|
-
prop:
|
|
2153
|
-
defaultProp:
|
|
2154
|
-
onChange:
|
|
2215
|
+
const [complementarySidebarState = isLg ? "expanded" : "collapsed", setComplementarySidebarState] = useControllableState4({
|
|
2216
|
+
prop: propsComplementarySidebarState,
|
|
2217
|
+
defaultProp: defaultComplementarySidebarState,
|
|
2218
|
+
onChange: onComplementarySidebarStateChange
|
|
2155
2219
|
});
|
|
2156
|
-
const [resizing, setResizing] =
|
|
2220
|
+
const [resizing, setResizing] = useState8(false);
|
|
2157
2221
|
const resizeInterval = useRef2(null);
|
|
2158
|
-
const handleResize =
|
|
2222
|
+
const handleResize = useCallback7(() => {
|
|
2159
2223
|
setResizing(true);
|
|
2160
2224
|
if (resizeInterval.current) {
|
|
2161
2225
|
clearTimeout(resizeInterval.current);
|
|
@@ -2165,7 +2229,7 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
2165
2229
|
resizeInterval.current = null;
|
|
2166
2230
|
}, resizeDebounce);
|
|
2167
2231
|
}, []);
|
|
2168
|
-
|
|
2232
|
+
useEffect5(() => {
|
|
2169
2233
|
window.addEventListener("resize", handleResize);
|
|
2170
2234
|
return () => window.removeEventListener("resize", handleResize);
|
|
2171
2235
|
}, [
|
|
@@ -2173,10 +2237,10 @@ var MainRoot = ({ navigationSidebarOpen: propsNavigationSidebarOpen, defaultNavi
|
|
|
2173
2237
|
]);
|
|
2174
2238
|
return /* @__PURE__ */ React28.createElement(MainProvider, {
|
|
2175
2239
|
...props,
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2240
|
+
navigationSidebarState,
|
|
2241
|
+
setNavigationSidebarState,
|
|
2242
|
+
complementarySidebarState,
|
|
2243
|
+
setComplementarySidebarState,
|
|
2180
2244
|
resizing
|
|
2181
2245
|
}, children);
|
|
2182
2246
|
};
|
|
@@ -2184,7 +2248,7 @@ MainRoot.displayName = MAIN_ROOT_NAME;
|
|
|
2184
2248
|
var handleOpenAutoFocus = (event) => {
|
|
2185
2249
|
!document.body.hasAttribute("data-is-keyboard") && event.preventDefault();
|
|
2186
2250
|
};
|
|
2187
|
-
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus,
|
|
2251
|
+
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, ...props }, forwardedRef) => {
|
|
2188
2252
|
const [isLg] = useMediaQuery("lg", {
|
|
2189
2253
|
ssr: false
|
|
2190
2254
|
});
|
|
@@ -2192,9 +2256,9 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2192
2256
|
const ref = useForwardedRef(forwardedRef);
|
|
2193
2257
|
const noopRef = useRef2(null);
|
|
2194
2258
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2195
|
-
onDismiss: () =>
|
|
2259
|
+
onDismiss: () => onStateChange?.("closed")
|
|
2196
2260
|
});
|
|
2197
|
-
const handleKeyDown =
|
|
2261
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2198
2262
|
if (event.key === "Escape") {
|
|
2199
2263
|
event.target.closest("[data-tabster]")?.focus();
|
|
2200
2264
|
}
|
|
@@ -2204,7 +2268,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2204
2268
|
]);
|
|
2205
2269
|
const Root5 = isLg ? Primitive9.div : DialogContent2;
|
|
2206
2270
|
return /* @__PURE__ */ React28.createElement(DialogRoot2, {
|
|
2207
|
-
open,
|
|
2271
|
+
open: state !== "closed",
|
|
2208
2272
|
modal: false
|
|
2209
2273
|
}, /* @__PURE__ */ React28.createElement(Root5, {
|
|
2210
2274
|
...!isLg && {
|
|
@@ -2214,24 +2278,24 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
2214
2278
|
},
|
|
2215
2279
|
...props,
|
|
2216
2280
|
"data-side": side === "inline-end" ? "ie" : "is",
|
|
2217
|
-
"data-state":
|
|
2281
|
+
"data-state": state,
|
|
2218
2282
|
"data-resizing": resizing ? "true" : "false",
|
|
2219
2283
|
className: tx("main.sidebar", "main__sidebar", {}, classNames),
|
|
2220
2284
|
onKeyDown: handleKeyDown,
|
|
2221
|
-
|
|
2285
|
+
...state === "closed" && {
|
|
2222
2286
|
inert: "true"
|
|
2223
2287
|
},
|
|
2224
2288
|
ref
|
|
2225
2289
|
}, children));
|
|
2226
2290
|
});
|
|
2227
2291
|
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2228
|
-
const {
|
|
2292
|
+
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2229
2293
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2230
2294
|
return /* @__PURE__ */ React28.createElement(MainSidebar, {
|
|
2231
2295
|
...mover,
|
|
2232
2296
|
...props,
|
|
2233
|
-
|
|
2234
|
-
|
|
2297
|
+
state: navigationSidebarState,
|
|
2298
|
+
onStateChange: setNavigationSidebarState,
|
|
2235
2299
|
resizing,
|
|
2236
2300
|
side: "inline-start",
|
|
2237
2301
|
ref: forwardedRef
|
|
@@ -2239,13 +2303,13 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) =
|
|
|
2239
2303
|
});
|
|
2240
2304
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2241
2305
|
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2242
|
-
const {
|
|
2306
|
+
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2243
2307
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2244
2308
|
return /* @__PURE__ */ React28.createElement(MainSidebar, {
|
|
2245
2309
|
...mover,
|
|
2246
2310
|
...props,
|
|
2247
|
-
|
|
2248
|
-
|
|
2311
|
+
state: complementarySidebarState,
|
|
2312
|
+
onStateChange: setComplementarySidebarState,
|
|
2249
2313
|
resizing,
|
|
2250
2314
|
side: "inline-end",
|
|
2251
2315
|
ref: forwardedRef
|
|
@@ -2253,7 +2317,7 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef
|
|
|
2253
2317
|
});
|
|
2254
2318
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2255
2319
|
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2256
|
-
const {
|
|
2320
|
+
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2257
2321
|
const { tx } = useThemeContext();
|
|
2258
2322
|
const Root5 = asChild ? Slot10 : role ? "div" : "main";
|
|
2259
2323
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
@@ -2263,8 +2327,8 @@ var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, h
|
|
|
2263
2327
|
...mover
|
|
2264
2328
|
},
|
|
2265
2329
|
...props,
|
|
2266
|
-
"data-sidebar-inline-start-state":
|
|
2267
|
-
"data-sidebar-inline-end-state":
|
|
2330
|
+
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
2331
|
+
"data-sidebar-inline-end-state": complementarySidebarState,
|
|
2268
2332
|
className: tx("main.content", "main", {
|
|
2269
2333
|
bounce,
|
|
2270
2334
|
handlesFocus
|
|
@@ -2277,55 +2341,30 @@ var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwar
|
|
|
2277
2341
|
const [isLg] = useMediaQuery("lg", {
|
|
2278
2342
|
ssr: false
|
|
2279
2343
|
});
|
|
2280
|
-
const {
|
|
2344
|
+
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2281
2345
|
const { tx } = useThemeContext();
|
|
2282
2346
|
return /* @__PURE__ */ React28.createElement("div", {
|
|
2283
2347
|
onClick: () => {
|
|
2284
|
-
|
|
2285
|
-
|
|
2348
|
+
setNavigationSidebarState("collapsed");
|
|
2349
|
+
setComplementarySidebarState("collapsed");
|
|
2286
2350
|
},
|
|
2287
2351
|
...props,
|
|
2288
2352
|
className: tx("main.overlay", "main__overlay", {
|
|
2289
2353
|
isLg,
|
|
2290
|
-
inlineStartSidebarOpen:
|
|
2291
|
-
inlineEndSidebarOpen:
|
|
2354
|
+
inlineStartSidebarOpen: navigationSidebarState,
|
|
2355
|
+
inlineEndSidebarOpen: complementarySidebarState
|
|
2292
2356
|
}, classNames),
|
|
2293
|
-
"data-state":
|
|
2357
|
+
"data-state": navigationSidebarState === "expanded" || complementarySidebarState === "expanded" ? "open" : "closed",
|
|
2294
2358
|
"aria-hidden": "true",
|
|
2295
2359
|
ref: forwardedRef
|
|
2296
2360
|
});
|
|
2297
2361
|
});
|
|
2298
|
-
var MainNotch = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwardedRef) => {
|
|
2299
|
-
const { tx } = useThemeContext();
|
|
2300
|
-
const { navigationSidebarOpen } = useMainContext(MAIN_NAME);
|
|
2301
|
-
const notchElement = useRef2(null);
|
|
2302
|
-
const ref = useComposedRefs(forwardedRef, notchElement);
|
|
2303
|
-
const handleKeyDown = useCallback5((event) => {
|
|
2304
|
-
switch (event.key) {
|
|
2305
|
-
case "Escape":
|
|
2306
|
-
props?.onKeyDown?.(event);
|
|
2307
|
-
notchElement.current?.focus();
|
|
2308
|
-
}
|
|
2309
|
-
}, [
|
|
2310
|
-
props?.onKeyDown
|
|
2311
|
-
]);
|
|
2312
|
-
const mover = useLandmarkMover(handleKeyDown, "3");
|
|
2313
|
-
return /* @__PURE__ */ React28.createElement("div", {
|
|
2314
|
-
role: "toolbar",
|
|
2315
|
-
...mover,
|
|
2316
|
-
...props,
|
|
2317
|
-
"data-nav-sidebar-state": navigationSidebarOpen ? "open" : "closed",
|
|
2318
|
-
className: tx("main.notch", "main__notch", {}, classNames),
|
|
2319
|
-
ref
|
|
2320
|
-
});
|
|
2321
|
-
});
|
|
2322
2362
|
var Main = {
|
|
2323
2363
|
Root: MainRoot,
|
|
2324
2364
|
Content: MainContent,
|
|
2325
2365
|
Overlay: MainOverlay,
|
|
2326
2366
|
NavigationSidebar: MainNavigationSidebar,
|
|
2327
|
-
ComplementarySidebar: MainComplementarySidebar
|
|
2328
|
-
Notch: MainNotch
|
|
2367
|
+
ComplementarySidebar: MainComplementarySidebar
|
|
2329
2368
|
};
|
|
2330
2369
|
|
|
2331
2370
|
// packages/ui/react-ui/src/components/Message/Message.tsx
|
|
@@ -2391,7 +2430,7 @@ var Message = {
|
|
|
2391
2430
|
|
|
2392
2431
|
// packages/ui/react-ui/src/components/Popover/Popover.tsx
|
|
2393
2432
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
2394
|
-
import { useComposedRefs
|
|
2433
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2395
2434
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
2396
2435
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
2397
2436
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -2405,7 +2444,7 @@ import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
|
2405
2444
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
2406
2445
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
2407
2446
|
import { hideOthers } from "aria-hidden";
|
|
2408
|
-
import React30, { forwardRef as forwardRef22, useRef as useRef3, useCallback as
|
|
2447
|
+
import React30, { forwardRef as forwardRef22, useRef as useRef3, useCallback as useCallback8, useState as useState9, useEffect as useEffect6 } from "react";
|
|
2409
2448
|
import { RemoveScroll } from "react-remove-scroll";
|
|
2410
2449
|
var POPOVER_NAME = "Popover";
|
|
2411
2450
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -2417,7 +2456,7 @@ var PopoverRoot = (props) => {
|
|
|
2417
2456
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
2418
2457
|
const popperScope = usePopperScope(__scopePopover);
|
|
2419
2458
|
const triggerRef = useRef3(null);
|
|
2420
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
2459
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
2421
2460
|
const [open = false, setOpen] = useControllableState5({
|
|
2422
2461
|
prop: openProp,
|
|
2423
2462
|
defaultProp: defaultOpen,
|
|
@@ -2429,12 +2468,12 @@ var PopoverRoot = (props) => {
|
|
|
2429
2468
|
triggerRef,
|
|
2430
2469
|
open,
|
|
2431
2470
|
onOpenChange: setOpen,
|
|
2432
|
-
onOpenToggle:
|
|
2471
|
+
onOpenToggle: useCallback8(() => setOpen((prevOpen) => !prevOpen), [
|
|
2433
2472
|
setOpen
|
|
2434
2473
|
]),
|
|
2435
2474
|
hasCustomAnchor,
|
|
2436
|
-
onCustomAnchorAdd:
|
|
2437
|
-
onCustomAnchorRemove:
|
|
2475
|
+
onCustomAnchorAdd: useCallback8(() => setHasCustomAnchor(true), []),
|
|
2476
|
+
onCustomAnchorRemove: useCallback8(() => setHasCustomAnchor(false), []),
|
|
2438
2477
|
modal
|
|
2439
2478
|
}, children));
|
|
2440
2479
|
};
|
|
@@ -2445,7 +2484,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2445
2484
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
2446
2485
|
const popperScope = usePopperScope(__scopePopover);
|
|
2447
2486
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
2448
|
-
|
|
2487
|
+
useEffect6(() => {
|
|
2449
2488
|
onCustomAnchorAdd();
|
|
2450
2489
|
return () => onCustomAnchorRemove();
|
|
2451
2490
|
}, [
|
|
@@ -2464,7 +2503,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2464
2503
|
const { __scopePopover, ...triggerProps } = props;
|
|
2465
2504
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
2466
2505
|
const popperScope = usePopperScope(__scopePopover);
|
|
2467
|
-
const composedTriggerRef =
|
|
2506
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
2468
2507
|
const trigger = /* @__PURE__ */ React30.createElement(Primitive11.button, {
|
|
2469
2508
|
type: "button",
|
|
2470
2509
|
"aria-haspopup": "dialog",
|
|
@@ -2486,7 +2525,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
2486
2525
|
const { __scopePopover, virtualRef } = props;
|
|
2487
2526
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
2488
2527
|
const popperScope = usePopperScope(__scopePopover);
|
|
2489
|
-
|
|
2528
|
+
useEffect6(() => {
|
|
2490
2529
|
if (virtualRef.current) {
|
|
2491
2530
|
context.triggerRef.current = virtualRef.current;
|
|
2492
2531
|
}
|
|
@@ -2534,9 +2573,9 @@ PopoverContent.displayName = CONTENT_NAME2;
|
|
|
2534
2573
|
var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
2535
2574
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
2536
2575
|
const contentRef = useRef3(null);
|
|
2537
|
-
const composedRefs =
|
|
2576
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
2538
2577
|
const isRightClickOutsideRef = useRef3(false);
|
|
2539
|
-
|
|
2578
|
+
useEffect6(() => {
|
|
2540
2579
|
const content = contentRef.current;
|
|
2541
2580
|
if (content) {
|
|
2542
2581
|
return hideOthers(content);
|
|
@@ -2613,11 +2652,12 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
2613
2652
|
});
|
|
2614
2653
|
});
|
|
2615
2654
|
var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
2616
|
-
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, classNames, ...contentProps } = props;
|
|
2655
|
+
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, classNames, ...contentProps } = props;
|
|
2617
2656
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
2618
2657
|
const popperScope = usePopperScope(__scopePopover);
|
|
2619
2658
|
const { tx } = useThemeContext();
|
|
2620
2659
|
const elevation = useElevationContext();
|
|
2660
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2621
2661
|
useFocusGuards();
|
|
2622
2662
|
return /* @__PURE__ */ React30.createElement(FocusScope, {
|
|
2623
2663
|
asChild: true,
|
|
@@ -2639,6 +2679,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
2639
2679
|
id: context.contentId,
|
|
2640
2680
|
...popperScope,
|
|
2641
2681
|
...contentProps,
|
|
2682
|
+
collisionPadding: safeCollisionPadding,
|
|
2642
2683
|
className: tx("popover.content", "popover", {
|
|
2643
2684
|
elevation
|
|
2644
2685
|
}, classNames),
|
|
@@ -2809,11 +2850,13 @@ var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder,
|
|
|
2809
2850
|
weight: "bold"
|
|
2810
2851
|
}))));
|
|
2811
2852
|
});
|
|
2812
|
-
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
2853
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
2813
2854
|
const { tx } = useThemeContext();
|
|
2814
2855
|
const elevation = useElevationContext();
|
|
2856
|
+
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
2815
2857
|
return /* @__PURE__ */ React33.createElement(SelectPrimitive.Content, {
|
|
2816
2858
|
...props,
|
|
2859
|
+
collisionPadding: safeCollisionPadding,
|
|
2817
2860
|
className: tx("select.content", "select__content", {
|
|
2818
2861
|
elevation
|
|
2819
2862
|
}, classNames),
|
|
@@ -2919,30 +2962,32 @@ var Select = {
|
|
|
2919
2962
|
|
|
2920
2963
|
// packages/ui/react-ui/src/components/Separator/Separator.tsx
|
|
2921
2964
|
import { Separator as SeparatorPrimitive } from "@radix-ui/react-separator";
|
|
2922
|
-
import React34 from "react";
|
|
2923
|
-
var Separator4 = ({ classNames, orientation = "horizontal", ...props }) => {
|
|
2965
|
+
import React34, { forwardRef as forwardRef26 } from "react";
|
|
2966
|
+
var Separator4 = /* @__PURE__ */ forwardRef26(({ classNames, orientation = "horizontal", ...props }, forwardedRef) => {
|
|
2924
2967
|
const { tx } = useThemeContext();
|
|
2925
2968
|
return /* @__PURE__ */ React34.createElement(SeparatorPrimitive, {
|
|
2926
2969
|
orientation,
|
|
2927
2970
|
...props,
|
|
2928
2971
|
className: tx("separator.root", "separator", {
|
|
2929
2972
|
orientation
|
|
2930
|
-
}, classNames)
|
|
2973
|
+
}, classNames),
|
|
2974
|
+
ref: forwardedRef
|
|
2931
2975
|
});
|
|
2932
|
-
};
|
|
2976
|
+
});
|
|
2933
2977
|
|
|
2934
2978
|
// packages/ui/react-ui/src/components/Tag/Tag.tsx
|
|
2935
2979
|
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
2936
2980
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
2937
|
-
import React35, { forwardRef as
|
|
2938
|
-
var Tag = /* @__PURE__ */
|
|
2981
|
+
import React35, { forwardRef as forwardRef27 } from "react";
|
|
2982
|
+
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
2939
2983
|
const { tx } = useThemeContext();
|
|
2940
2984
|
const Root5 = asChild ? Slot13 : Primitive12.span;
|
|
2941
2985
|
return /* @__PURE__ */ React35.createElement(Root5, {
|
|
2942
2986
|
...props,
|
|
2943
|
-
className: tx("tag.root", "tag", {
|
|
2987
|
+
className: tx("tag.root", "dx-tag", {
|
|
2944
2988
|
palette
|
|
2945
2989
|
}, classNames),
|
|
2990
|
+
"data-hue": palette,
|
|
2946
2991
|
ref: forwardedRef
|
|
2947
2992
|
});
|
|
2948
2993
|
});
|
|
@@ -2951,16 +2996,16 @@ var Tag = /* @__PURE__ */ forwardRef26(({ asChild, palette, classNames, ...props
|
|
|
2951
2996
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
2952
2997
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2953
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";
|
|
2954
|
-
import React36, { forwardRef as
|
|
2999
|
+
import React36, { forwardRef as forwardRef28 } from "react";
|
|
2955
3000
|
var ToastProvider = ToastProviderPrimitive;
|
|
2956
|
-
var ToastViewport = /* @__PURE__ */
|
|
3001
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
2957
3002
|
const { tx } = useThemeContext();
|
|
2958
3003
|
return /* @__PURE__ */ React36.createElement(ToastViewportPrimitive, {
|
|
2959
3004
|
className: tx("toast.viewport", "toast-viewport", {}, classNames),
|
|
2960
3005
|
ref: forwardedRef
|
|
2961
3006
|
});
|
|
2962
3007
|
});
|
|
2963
|
-
var ToastRoot = /* @__PURE__ */
|
|
3008
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
2964
3009
|
const { tx } = useThemeContext();
|
|
2965
3010
|
return /* @__PURE__ */ React36.createElement(ToastRootPrimitive, {
|
|
2966
3011
|
...props,
|
|
@@ -2970,7 +3015,7 @@ var ToastRoot = /* @__PURE__ */ forwardRef27(({ classNames, children, ...props }
|
|
|
2970
3015
|
elevation: "toast"
|
|
2971
3016
|
}, children));
|
|
2972
3017
|
});
|
|
2973
|
-
var ToastBody = /* @__PURE__ */
|
|
3018
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2974
3019
|
const { tx } = useThemeContext();
|
|
2975
3020
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
2976
3021
|
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
@@ -2979,7 +3024,7 @@ var ToastBody = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props },
|
|
|
2979
3024
|
ref: forwardedRef
|
|
2980
3025
|
});
|
|
2981
3026
|
});
|
|
2982
|
-
var ToastTitle = /* @__PURE__ */
|
|
3027
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2983
3028
|
const { tx } = useThemeContext();
|
|
2984
3029
|
const Root5 = asChild ? Slot14 : ToastTitlePrimitive;
|
|
2985
3030
|
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
@@ -2988,7 +3033,7 @@ var ToastTitle = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...props }
|
|
|
2988
3033
|
ref: forwardedRef
|
|
2989
3034
|
});
|
|
2990
3035
|
});
|
|
2991
|
-
var ToastDescription = /* @__PURE__ */
|
|
3036
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
2992
3037
|
const { tx } = useThemeContext();
|
|
2993
3038
|
const Root5 = asChild ? Slot14 : ToastDescriptionPrimitive;
|
|
2994
3039
|
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
@@ -2997,7 +3042,7 @@ var ToastDescription = /* @__PURE__ */ forwardRef27(({ asChild, classNames, ...p
|
|
|
2997
3042
|
ref: forwardedRef
|
|
2998
3043
|
});
|
|
2999
3044
|
});
|
|
3000
|
-
var ToastActions = /* @__PURE__ */
|
|
3045
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3001
3046
|
const { tx } = useThemeContext();
|
|
3002
3047
|
const Root5 = asChild ? Slot14 : Primitive13.div;
|
|
3003
3048
|
return /* @__PURE__ */ React36.createElement(Root5, {
|
|
@@ -3022,8 +3067,8 @@ var Toast = {
|
|
|
3022
3067
|
|
|
3023
3068
|
// packages/ui/react-ui/src/components/Toolbar/Toolbar.tsx
|
|
3024
3069
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
3025
|
-
import React37, { forwardRef as
|
|
3026
|
-
var ToolbarRoot = /* @__PURE__ */
|
|
3070
|
+
import React37, { forwardRef as forwardRef29 } from "react";
|
|
3071
|
+
var ToolbarRoot = /* @__PURE__ */ forwardRef29(({ classNames, children, ...props }, forwardedRef) => {
|
|
3027
3072
|
const { tx } = useThemeContext();
|
|
3028
3073
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Root, {
|
|
3029
3074
|
...props,
|
|
@@ -3031,7 +3076,7 @@ var ToolbarRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props
|
|
|
3031
3076
|
ref: forwardedRef
|
|
3032
3077
|
}, children);
|
|
3033
3078
|
});
|
|
3034
|
-
var ToolbarButton = /* @__PURE__ */
|
|
3079
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3035
3080
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
3036
3081
|
asChild: true
|
|
3037
3082
|
}, /* @__PURE__ */ React37.createElement(Button, {
|
|
@@ -3039,7 +3084,15 @@ var ToolbarButton = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
3039
3084
|
ref: forwardedRef
|
|
3040
3085
|
}));
|
|
3041
3086
|
});
|
|
3042
|
-
var
|
|
3087
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3088
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
3089
|
+
asChild: true
|
|
3090
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3091
|
+
...props,
|
|
3092
|
+
ref: forwardedRef
|
|
3093
|
+
}));
|
|
3094
|
+
});
|
|
3095
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3043
3096
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Button, {
|
|
3044
3097
|
asChild: true
|
|
3045
3098
|
}, /* @__PURE__ */ React37.createElement(Toggle, {
|
|
@@ -3047,7 +3100,7 @@ var ToolbarToggle = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
3047
3100
|
ref: forwardedRef
|
|
3048
3101
|
}));
|
|
3049
3102
|
});
|
|
3050
|
-
var ToolbarLink = /* @__PURE__ */
|
|
3103
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef29((props, forwardedRef) => {
|
|
3051
3104
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.Link, {
|
|
3052
3105
|
asChild: true
|
|
3053
3106
|
}, /* @__PURE__ */ React37.createElement(Link, {
|
|
@@ -3055,7 +3108,7 @@ var ToolbarLink = /* @__PURE__ */ forwardRef28((props, forwardedRef) => {
|
|
|
3055
3108
|
ref: forwardedRef
|
|
3056
3109
|
}));
|
|
3057
3110
|
});
|
|
3058
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
3111
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef29(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
3059
3112
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
3060
3113
|
...props,
|
|
3061
3114
|
asChild: true
|
|
@@ -3066,7 +3119,7 @@ var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef28(({ classNames, children,
|
|
|
3066
3119
|
ref: forwardedRef
|
|
3067
3120
|
}));
|
|
3068
3121
|
});
|
|
3069
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
3122
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
3070
3123
|
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
3071
3124
|
...props,
|
|
3072
3125
|
asChild: true
|
|
@@ -3079,26 +3132,42 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef28(({ variant, density, e
|
|
|
3079
3132
|
ref: forwardedRef
|
|
3080
3133
|
}));
|
|
3081
3134
|
});
|
|
3082
|
-
var
|
|
3083
|
-
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.
|
|
3135
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef29(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
3136
|
+
return /* @__PURE__ */ React37.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
3137
|
+
...props,
|
|
3084
3138
|
asChild: true
|
|
3085
|
-
}, /* @__PURE__ */ React37.createElement(
|
|
3086
|
-
|
|
3087
|
-
|
|
3139
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3140
|
+
variant,
|
|
3141
|
+
density,
|
|
3142
|
+
elevation,
|
|
3143
|
+
classNames,
|
|
3144
|
+
icon,
|
|
3145
|
+
label,
|
|
3146
|
+
iconOnly,
|
|
3147
|
+
ref: forwardedRef
|
|
3088
3148
|
}));
|
|
3089
|
-
};
|
|
3090
|
-
var
|
|
3091
|
-
|
|
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
|
+
});
|
|
3092
3160
|
});
|
|
3093
3161
|
var Toolbar = {
|
|
3094
3162
|
Root: ToolbarRoot,
|
|
3095
3163
|
Button: ToolbarButton,
|
|
3164
|
+
IconButton: ToolbarIconButton,
|
|
3096
3165
|
Link: ToolbarLink,
|
|
3097
3166
|
Toggle: ToolbarToggle,
|
|
3098
3167
|
ToggleGroup: ToolbarToggleGroup2,
|
|
3099
3168
|
ToggleGroupItem: ToolbarToggleGroupItem,
|
|
3100
|
-
|
|
3101
|
-
|
|
3169
|
+
ToggleGroupIconItem: ToolbarToggleGroupIconItem,
|
|
3170
|
+
Separator: ToolbarSeparator
|
|
3102
3171
|
};
|
|
3103
3172
|
export {
|
|
3104
3173
|
AlertDialog,
|
|
@@ -3149,6 +3218,7 @@ export {
|
|
|
3149
3218
|
createDropdownMenuScope,
|
|
3150
3219
|
createPopoverScope,
|
|
3151
3220
|
hasIosKeyboard,
|
|
3221
|
+
initialSafeArea,
|
|
3152
3222
|
isLabel,
|
|
3153
3223
|
toLocalizedString,
|
|
3154
3224
|
useAvatarContext,
|
|
@@ -3158,9 +3228,11 @@ export {
|
|
|
3158
3228
|
useDropdownMenuContext,
|
|
3159
3229
|
useDropdownMenuMenuScope,
|
|
3160
3230
|
useElevationContext,
|
|
3231
|
+
useLandmarkMover,
|
|
3161
3232
|
useListContext,
|
|
3162
3233
|
useListItemContext,
|
|
3163
3234
|
useMainContext,
|
|
3235
|
+
useSafeArea,
|
|
3164
3236
|
useSidebars,
|
|
3165
3237
|
useThemeContext,
|
|
3166
3238
|
useTranslation,
|