@dxos/react-ui 0.8.4-main.03d5cd7b56 → 0.8.4-main.05e74ebcff
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/browser/chunk-A5QCIG5R.mjs +24 -0
- package/dist/lib/browser/chunk-A5QCIG5R.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BDBC6H6V.mjs → chunk-LY5XDQR5.mjs} +6 -8
- package/dist/lib/browser/chunk-LY5XDQR5.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +560 -257
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/browser/translations.mjs +4 -13
- package/dist/lib/browser/translations.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-3JSJK2ZY.mjs → chunk-NGKLIKP3.mjs} +6 -8
- package/dist/lib/node-esm/chunk-NGKLIKP3.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCFLA74M.mjs +26 -0
- package/dist/lib/node-esm/chunk-XCFLA74M.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +560 -257
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/lib/node-esm/translations.mjs +4 -14
- package/dist/lib/node-esm/translations.mjs.map +4 -4
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Carousel/Carousel.d.ts +90 -0
- package/dist/types/src/components/Carousel/Carousel.d.ts.map +1 -0
- package/dist/types/src/components/Carousel/index.d.ts +2 -0
- package/dist/types/src/components/Carousel/index.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts +46 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts +16 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/index.d.ts +2 -0
- package/dist/types/src/components/MediaPlayer/index.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +6 -6
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +5 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/Card/Card.tsx +11 -9
- package/src/components/Carousel/Carousel.tsx +337 -0
- package/src/components/Carousel/index.ts +5 -0
- package/src/components/MediaPlayer/MediaPlayer.stories.tsx +50 -0
- package/src/components/MediaPlayer/MediaPlayer.tsx +153 -0
- package/src/components/MediaPlayer/index.ts +5 -0
- package/src/components/Toolbar/Toolbar.tsx +2 -1
- package/src/components/Tooltip/Tooltip.tsx +14 -13
- package/src/components/index.ts +2 -0
- package/src/translations.ts +5 -0
- package/dist/lib/browser/chunk-BDBC6H6V.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3JSJK2ZY.mjs.map +0 -7
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
useThemeContext,
|
|
19
19
|
useTooltipContext,
|
|
20
20
|
useTranslation
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NGKLIKP3.mjs";
|
|
22
|
+
import {
|
|
23
|
+
translationKey
|
|
24
|
+
} from "./chunk-XCFLA74M.mjs";
|
|
22
25
|
|
|
23
26
|
// src/index.ts
|
|
24
27
|
import { Trans } from "react-i18next";
|
|
@@ -837,7 +840,7 @@ import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
|
837
840
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
838
841
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
839
842
|
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
840
|
-
import { translationKey } from "#translations";
|
|
843
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
841
844
|
|
|
842
845
|
// src/components/Menu/ContextMenu.tsx
|
|
843
846
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
@@ -1407,7 +1410,7 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef12(({ variant, density, e
|
|
|
1407
1410
|
ref: forwardedRef
|
|
1408
1411
|
}));
|
|
1409
1412
|
});
|
|
1410
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
1413
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, icon, label, iconOnly, iconClassNames, ...props }, forwardedRef) => {
|
|
1411
1414
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1412
1415
|
...props,
|
|
1413
1416
|
asChild: true
|
|
@@ -1419,6 +1422,7 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, densit
|
|
|
1419
1422
|
icon,
|
|
1420
1423
|
label,
|
|
1421
1424
|
iconOnly,
|
|
1425
|
+
iconClassNames,
|
|
1422
1426
|
ref: forwardedRef
|
|
1423
1427
|
}));
|
|
1424
1428
|
});
|
|
@@ -1435,7 +1439,7 @@ var ToolbarSeparator = /* @__PURE__ */ forwardRef12(({ variant = "gap", ...props
|
|
|
1435
1439
|
});
|
|
1436
1440
|
});
|
|
1437
1441
|
var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1438
|
-
const { t } = useTranslation2(
|
|
1442
|
+
const { t } = useTranslation2(translationKey2);
|
|
1439
1443
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1440
1444
|
"data-testid": testId,
|
|
1441
1445
|
tabIndex: -1,
|
|
@@ -1450,7 +1454,7 @@ var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle",
|
|
|
1450
1454
|
});
|
|
1451
1455
|
});
|
|
1452
1456
|
var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, forwardedRef) => {
|
|
1453
|
-
const { t } = useTranslation2(
|
|
1457
|
+
const { t } = useTranslation2(translationKey2);
|
|
1454
1458
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1455
1459
|
iconOnly: true,
|
|
1456
1460
|
icon: "ph--x--regular",
|
|
@@ -1462,7 +1466,7 @@ var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, f
|
|
|
1462
1466
|
});
|
|
1463
1467
|
});
|
|
1464
1468
|
var ToolbarMenu = ({ context, items }) => {
|
|
1465
|
-
const { t } = useTranslation2(
|
|
1469
|
+
const { t } = useTranslation2(translationKey2);
|
|
1466
1470
|
return /* @__PURE__ */ React18.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Trigger, {
|
|
1467
1471
|
disabled: !items?.length,
|
|
1468
1472
|
asChild: true
|
|
@@ -1786,21 +1790,230 @@ var Card = {
|
|
|
1786
1790
|
Link: CardLink
|
|
1787
1791
|
};
|
|
1788
1792
|
|
|
1793
|
+
// src/components/Carousel/Carousel.tsx
|
|
1794
|
+
import { useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
1795
|
+
import React20, { createContext as createContext4, useCallback as useCallback5, useContext as useContext4, useEffect as useEffect3, useMemo as useMemo6, useState as useState4 } from "react";
|
|
1796
|
+
import { mx as mx7 } from "@dxos/ui-theme";
|
|
1797
|
+
var CarouselContext = /* @__PURE__ */ createContext4(null);
|
|
1798
|
+
var useCarousel = () => {
|
|
1799
|
+
const context = useContext4(CarouselContext);
|
|
1800
|
+
if (!context) {
|
|
1801
|
+
throw new Error("useCarousel must be used within Carousel.Root");
|
|
1802
|
+
}
|
|
1803
|
+
return context;
|
|
1804
|
+
};
|
|
1805
|
+
var CarouselRoot = ({ classNames, children, count, autorun = false, intervalMs = 5e3, defaultIndex = 0 }) => {
|
|
1806
|
+
const [index, setIndexState] = useState4(defaultIndex);
|
|
1807
|
+
const [autoAdvance, setAutoAdvance] = useState4(autorun);
|
|
1808
|
+
useEffect3(() => {
|
|
1809
|
+
if (index >= count) {
|
|
1810
|
+
setIndexState(0);
|
|
1811
|
+
}
|
|
1812
|
+
}, [
|
|
1813
|
+
count,
|
|
1814
|
+
index
|
|
1815
|
+
]);
|
|
1816
|
+
useEffect3(() => {
|
|
1817
|
+
if (!autoAdvance || count <= 1 || intervalMs <= 0) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
const handle = setInterval(() => setIndexState((i) => (i + 1) % count), intervalMs);
|
|
1821
|
+
return () => clearInterval(handle);
|
|
1822
|
+
}, [
|
|
1823
|
+
autoAdvance,
|
|
1824
|
+
count,
|
|
1825
|
+
intervalMs
|
|
1826
|
+
]);
|
|
1827
|
+
const setIndex = useCallback5((next2) => {
|
|
1828
|
+
setAutoAdvance(false);
|
|
1829
|
+
setIndexState(next2);
|
|
1830
|
+
}, []);
|
|
1831
|
+
const next = useCallback5(() => {
|
|
1832
|
+
setAutoAdvance(false);
|
|
1833
|
+
setIndexState((i) => (i + 1) % count);
|
|
1834
|
+
}, [
|
|
1835
|
+
count
|
|
1836
|
+
]);
|
|
1837
|
+
const prev = useCallback5(() => {
|
|
1838
|
+
setAutoAdvance(false);
|
|
1839
|
+
setIndexState((i) => (i - 1 + count) % count);
|
|
1840
|
+
}, [
|
|
1841
|
+
count
|
|
1842
|
+
]);
|
|
1843
|
+
const value = useMemo6(() => ({
|
|
1844
|
+
index,
|
|
1845
|
+
count,
|
|
1846
|
+
setIndex,
|
|
1847
|
+
next,
|
|
1848
|
+
prev
|
|
1849
|
+
}), [
|
|
1850
|
+
index,
|
|
1851
|
+
count,
|
|
1852
|
+
setIndex,
|
|
1853
|
+
next,
|
|
1854
|
+
prev
|
|
1855
|
+
]);
|
|
1856
|
+
if (count === 0) {
|
|
1857
|
+
return null;
|
|
1858
|
+
}
|
|
1859
|
+
return /* @__PURE__ */ React20.createElement(CarouselContext.Provider, {
|
|
1860
|
+
value
|
|
1861
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1862
|
+
className: mx7("w-full grid grid-cols-[min-content_1fr_min-content] grid-rows-[minmax(0,1fr)_auto] gap-4 items-center", classNames)
|
|
1863
|
+
}, children));
|
|
1864
|
+
};
|
|
1865
|
+
CarouselRoot.displayName = "Carousel.Root";
|
|
1866
|
+
var CarouselViewport = ({ children, classNames }) => {
|
|
1867
|
+
const { t } = useTranslation(translationKey);
|
|
1868
|
+
const { count, next, prev } = useCarousel();
|
|
1869
|
+
const handleKeyDown = useCallback5((event) => {
|
|
1870
|
+
if (count <= 1) {
|
|
1871
|
+
return;
|
|
1872
|
+
}
|
|
1873
|
+
if (event.key === "ArrowLeft") {
|
|
1874
|
+
event.preventDefault();
|
|
1875
|
+
prev();
|
|
1876
|
+
} else if (event.key === "ArrowRight") {
|
|
1877
|
+
event.preventDefault();
|
|
1878
|
+
next();
|
|
1879
|
+
}
|
|
1880
|
+
}, [
|
|
1881
|
+
count,
|
|
1882
|
+
next,
|
|
1883
|
+
prev
|
|
1884
|
+
]);
|
|
1885
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1886
|
+
// TODO(burdon): Move to ui-theme.
|
|
1887
|
+
className: mx7("relative w-full aspect-video overflow-hidden", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", classNames),
|
|
1888
|
+
tabIndex: 0,
|
|
1889
|
+
role: "region",
|
|
1890
|
+
"aria-roledescription": "carousel",
|
|
1891
|
+
"aria-label": t("carousel-viewport.label"),
|
|
1892
|
+
onKeyDown: handleKeyDown
|
|
1893
|
+
}, children);
|
|
1894
|
+
};
|
|
1895
|
+
CarouselViewport.displayName = "Carousel.Viewport";
|
|
1896
|
+
var CarouselSlide = ({ children, index, classNames }) => {
|
|
1897
|
+
const { index: active } = useCarousel();
|
|
1898
|
+
if (active !== index) {
|
|
1899
|
+
return null;
|
|
1900
|
+
}
|
|
1901
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1902
|
+
className: mx7("absolute inset-0 w-full h-full bg-baseSurface", classNames)
|
|
1903
|
+
}, children);
|
|
1904
|
+
};
|
|
1905
|
+
CarouselSlide.displayName = "Carousel.Slide";
|
|
1906
|
+
var CarouselPrevious = ({ classNames }) => {
|
|
1907
|
+
const { t } = useTranslation(translationKey);
|
|
1908
|
+
const { count, prev } = useCarousel();
|
|
1909
|
+
if (count <= 1) {
|
|
1910
|
+
return /* @__PURE__ */ React20.createElement("div", null);
|
|
1911
|
+
}
|
|
1912
|
+
return /* @__PURE__ */ React20.createElement(IconButton, {
|
|
1913
|
+
classNames,
|
|
1914
|
+
square: true,
|
|
1915
|
+
variant: "ghost",
|
|
1916
|
+
icon: "ph--caret-left--regular",
|
|
1917
|
+
iconOnly: true,
|
|
1918
|
+
label: t("carousel-prev.label"),
|
|
1919
|
+
onClick: prev
|
|
1920
|
+
});
|
|
1921
|
+
};
|
|
1922
|
+
CarouselPrevious.displayName = "Carousel.Previous";
|
|
1923
|
+
var CarouselNext = ({ classNames }) => {
|
|
1924
|
+
const { t } = useTranslation(translationKey);
|
|
1925
|
+
const { count, next } = useCarousel();
|
|
1926
|
+
if (count <= 1) {
|
|
1927
|
+
return /* @__PURE__ */ React20.createElement("div", null);
|
|
1928
|
+
}
|
|
1929
|
+
return /* @__PURE__ */ React20.createElement(IconButton, {
|
|
1930
|
+
classNames,
|
|
1931
|
+
square: true,
|
|
1932
|
+
variant: "ghost",
|
|
1933
|
+
icon: "ph--caret-right--regular",
|
|
1934
|
+
iconOnly: true,
|
|
1935
|
+
label: t("carousel-next.label"),
|
|
1936
|
+
onClick: next
|
|
1937
|
+
});
|
|
1938
|
+
};
|
|
1939
|
+
CarouselNext.displayName = "Carousel.Next";
|
|
1940
|
+
var CarouselIndicators = ({ classNames }) => {
|
|
1941
|
+
const { t } = useTranslation(translationKey);
|
|
1942
|
+
const { count, index, setIndex } = useCarousel();
|
|
1943
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
1944
|
+
axis: "horizontal",
|
|
1945
|
+
memorizeCurrent: true
|
|
1946
|
+
});
|
|
1947
|
+
if (count <= 1) {
|
|
1948
|
+
return null;
|
|
1949
|
+
}
|
|
1950
|
+
return /* @__PURE__ */ React20.createElement("div", {
|
|
1951
|
+
className: "col-start-2 overflow-hidden"
|
|
1952
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1953
|
+
...arrowNavigationAttrs,
|
|
1954
|
+
className: mx7("flex items-center justify-center", classNames),
|
|
1955
|
+
role: "tablist",
|
|
1956
|
+
"aria-label": t("carousel-indicators.label")
|
|
1957
|
+
}, Array.from({
|
|
1958
|
+
length: count
|
|
1959
|
+
}).map((_, i) => /* @__PURE__ */ React20.createElement(IconButton, {
|
|
1960
|
+
key: i,
|
|
1961
|
+
role: "tab",
|
|
1962
|
+
"aria-selected": i === index,
|
|
1963
|
+
classNames: i === index ? "text-primary-500" : "text-description",
|
|
1964
|
+
icon: i === index ? "ph--circle--fill" : "ph--circle--regular",
|
|
1965
|
+
iconOnly: true,
|
|
1966
|
+
label: t("carousel-go-to.label", {
|
|
1967
|
+
index: i + 1
|
|
1968
|
+
}),
|
|
1969
|
+
onClick: () => setIndex(i),
|
|
1970
|
+
onFocus: () => setIndex(i),
|
|
1971
|
+
size: 3,
|
|
1972
|
+
variant: "ghost"
|
|
1973
|
+
}))));
|
|
1974
|
+
};
|
|
1975
|
+
CarouselIndicators.displayName = "Carousel.Indicators";
|
|
1976
|
+
var CarouselCaption = ({ children, classNames }) => {
|
|
1977
|
+
const { index } = useCarousel();
|
|
1978
|
+
const content = children(index);
|
|
1979
|
+
if (content == null || content === false || content === "") {
|
|
1980
|
+
return null;
|
|
1981
|
+
}
|
|
1982
|
+
return (
|
|
1983
|
+
// TODO(burdon): Move to ui-theme.
|
|
1984
|
+
/* @__PURE__ */ React20.createElement("div", {
|
|
1985
|
+
className: "col-start-2"
|
|
1986
|
+
}, /* @__PURE__ */ React20.createElement("p", {
|
|
1987
|
+
className: mx7("text-center text-description", classNames)
|
|
1988
|
+
}, content))
|
|
1989
|
+
);
|
|
1990
|
+
};
|
|
1991
|
+
CarouselCaption.displayName = "Carousel.Caption";
|
|
1992
|
+
var Carousel = {
|
|
1993
|
+
Root: CarouselRoot,
|
|
1994
|
+
Viewport: CarouselViewport,
|
|
1995
|
+
Slide: CarouselSlide,
|
|
1996
|
+
Previous: CarouselPrevious,
|
|
1997
|
+
Next: CarouselNext,
|
|
1998
|
+
Indicators: CarouselIndicators,
|
|
1999
|
+
Caption: CarouselCaption
|
|
2000
|
+
};
|
|
2001
|
+
|
|
1789
2002
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1790
|
-
import
|
|
1791
|
-
var ClipboardContext = /* @__PURE__ */
|
|
2003
|
+
import React21, { createContext as createContext5, useCallback as useCallback6, useContext as useContext5, useState as useState5 } from "react";
|
|
2004
|
+
var ClipboardContext = /* @__PURE__ */ createContext5({
|
|
1792
2005
|
textValue: "",
|
|
1793
2006
|
setTextValue: async (_) => {
|
|
1794
2007
|
}
|
|
1795
2008
|
});
|
|
1796
|
-
var useClipboard = () =>
|
|
2009
|
+
var useClipboard = () => useContext5(ClipboardContext);
|
|
1797
2010
|
var ClipboardProvider = ({ children }) => {
|
|
1798
|
-
const [textValue, setInternalTextValue] =
|
|
1799
|
-
const setTextValue =
|
|
2011
|
+
const [textValue, setInternalTextValue] = useState5("");
|
|
2012
|
+
const setTextValue = useCallback6(async (nextValue) => {
|
|
1800
2013
|
await navigator.clipboard.writeText(nextValue);
|
|
1801
2014
|
return setInternalTextValue(nextValue);
|
|
1802
2015
|
}, []);
|
|
1803
|
-
return /* @__PURE__ */
|
|
2016
|
+
return /* @__PURE__ */ React21.createElement(ClipboardContext.Provider, {
|
|
1804
2017
|
value: {
|
|
1805
2018
|
textValue,
|
|
1806
2019
|
setTextValue
|
|
@@ -1809,14 +2022,14 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1809
2022
|
};
|
|
1810
2023
|
|
|
1811
2024
|
// src/components/Clipboard/CopyButton.tsx
|
|
1812
|
-
import
|
|
1813
|
-
import { mx as
|
|
2025
|
+
import React22 from "react";
|
|
2026
|
+
import { mx as mx8, osTranslations } from "@dxos/ui-theme";
|
|
1814
2027
|
var inactiveLabelStyles = "invisible h-px -mb-px overflow-hidden";
|
|
1815
2028
|
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
1816
2029
|
const { t } = useTranslation(osTranslations);
|
|
1817
2030
|
const { textValue, setTextValue } = useClipboard();
|
|
1818
2031
|
const isCopied = textValue === value;
|
|
1819
|
-
return /* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ React22.createElement(Button, {
|
|
1820
2033
|
...props,
|
|
1821
2034
|
classNames: [
|
|
1822
2035
|
"inline-flex flex-col justify-center",
|
|
@@ -1824,18 +2037,18 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1824
2037
|
],
|
|
1825
2038
|
onClick: () => setTextValue(value),
|
|
1826
2039
|
"data-testid": "copy-invitation"
|
|
1827
|
-
}, /* @__PURE__ */
|
|
1828
|
-
className:
|
|
1829
|
-
}, /* @__PURE__ */
|
|
2040
|
+
}, /* @__PURE__ */ React22.createElement("div", {
|
|
2041
|
+
className: mx8("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
2042
|
+
}, /* @__PURE__ */ React22.createElement("span", {
|
|
1830
2043
|
className: "px-1"
|
|
1831
|
-
}, t("copy.label")), /* @__PURE__ */
|
|
2044
|
+
}, t("copy.label")), /* @__PURE__ */ React22.createElement(Icon, {
|
|
1832
2045
|
icon: "ph--copy--regular",
|
|
1833
2046
|
size
|
|
1834
|
-
})), /* @__PURE__ */
|
|
1835
|
-
className:
|
|
1836
|
-
}, /* @__PURE__ */
|
|
2047
|
+
})), /* @__PURE__ */ React22.createElement("div", {
|
|
2048
|
+
className: mx8("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
2049
|
+
}, /* @__PURE__ */ React22.createElement("span", {
|
|
1837
2050
|
className: "px-1"
|
|
1838
|
-
}, t("copy-success.label")), /* @__PURE__ */
|
|
2051
|
+
}, t("copy-success.label")), /* @__PURE__ */ React22.createElement(Icon, {
|
|
1839
2052
|
icon: "ph--check--regular",
|
|
1840
2053
|
size
|
|
1841
2054
|
})));
|
|
@@ -1846,7 +2059,7 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
1846
2059
|
const isCopied = textValue === value;
|
|
1847
2060
|
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
1848
2061
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1849
|
-
return /* @__PURE__ */
|
|
2062
|
+
return /* @__PURE__ */ React22.createElement(IconButton, {
|
|
1850
2063
|
iconOnly: true,
|
|
1851
2064
|
label,
|
|
1852
2065
|
icon: "ph--copy--regular",
|
|
@@ -1869,16 +2082,16 @@ var Clipboard = {
|
|
|
1869
2082
|
};
|
|
1870
2083
|
|
|
1871
2084
|
// src/components/Dialog/Dialog.tsx
|
|
1872
|
-
import { createContext as
|
|
2085
|
+
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
1873
2086
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1874
2087
|
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
1875
2088
|
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
1876
|
-
import
|
|
2089
|
+
import React23, { forwardRef as forwardRef14 } from "react";
|
|
1877
2090
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1878
2091
|
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
1879
|
-
var DialogRoot = (props) => /* @__PURE__ */
|
|
2092
|
+
var DialogRoot = (props) => /* @__PURE__ */ React23.createElement(ElevationProvider, {
|
|
1880
2093
|
elevation: "dialog"
|
|
1881
|
-
}, /* @__PURE__ */
|
|
2094
|
+
}, /* @__PURE__ */ React23.createElement(DialogPrimitive.Root, {
|
|
1882
2095
|
// NOTE: Radix warning unless set to undefined.
|
|
1883
2096
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1884
2097
|
"aria-describedby": void 0,
|
|
@@ -1887,15 +2100,15 @@ var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvi
|
|
|
1887
2100
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1888
2101
|
var DialogPortal = DialogPrimitive.Portal;
|
|
1889
2102
|
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1890
|
-
var [OverlayLayoutProvider, useOverlayLayoutContext] =
|
|
2103
|
+
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext6(DIALOG_OVERLAY_NAME, {});
|
|
1891
2104
|
var DialogOverlay = /* @__PURE__ */ forwardRef14(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1892
2105
|
const { tx } = useThemeContext();
|
|
1893
|
-
return /* @__PURE__ */
|
|
2106
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Overlay, {
|
|
1894
2107
|
...props,
|
|
1895
2108
|
"data-block-align": blockAlign,
|
|
1896
2109
|
className: tx("dialog.overlay", {}, classNames),
|
|
1897
2110
|
ref: forwardedRef
|
|
1898
|
-
}, /* @__PURE__ */
|
|
2111
|
+
}, /* @__PURE__ */ React23.createElement(OverlayLayoutProvider, {
|
|
1899
2112
|
inOverlayLayout: true
|
|
1900
2113
|
}, children));
|
|
1901
2114
|
});
|
|
@@ -1904,7 +2117,7 @@ var DIALOG_CONTENT_NAME = "DialogContent";
|
|
|
1904
2117
|
var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1905
2118
|
const { tx } = useThemeContext();
|
|
1906
2119
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1907
|
-
return /* @__PURE__ */
|
|
2120
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Content, {
|
|
1908
2121
|
...props,
|
|
1909
2122
|
// NOTE: Radix warning unless set to undefined.
|
|
1910
2123
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
@@ -1914,7 +2127,7 @@ var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size =
|
|
|
1914
2127
|
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1915
2128
|
}, classNames),
|
|
1916
2129
|
ref: forwardedRef
|
|
1917
|
-
}, /* @__PURE__ */
|
|
2130
|
+
}, /* @__PURE__ */ React23.createElement(Column.Root, {
|
|
1918
2131
|
classNames: "dx-expander",
|
|
1919
2132
|
gutter: "sm"
|
|
1920
2133
|
}, children));
|
|
@@ -1924,7 +2137,7 @@ var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
1924
2137
|
const { className, ...rest } = composableProps8(props);
|
|
1925
2138
|
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1926
2139
|
const { tx } = useThemeContext();
|
|
1927
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
1928
2141
|
...rest,
|
|
1929
2142
|
className: tx("dialog.header", {}, className),
|
|
1930
2143
|
ref: forwardedRef
|
|
@@ -1932,7 +2145,7 @@ var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
1932
2145
|
});
|
|
1933
2146
|
var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, forwardedRef) => {
|
|
1934
2147
|
const { t } = useTranslation3(osTranslations2);
|
|
1935
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ React23.createElement(IconButton, {
|
|
1936
2149
|
...props,
|
|
1937
2150
|
label: label ?? t("close-dialog.label"),
|
|
1938
2151
|
icon: "ph--x--regular",
|
|
@@ -1946,7 +2159,7 @@ var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
1946
2159
|
const { className, ...rest } = composableProps8(props);
|
|
1947
2160
|
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1948
2161
|
const { tx } = useThemeContext();
|
|
1949
|
-
return /* @__PURE__ */
|
|
2162
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
1950
2163
|
...rest,
|
|
1951
2164
|
className: tx("dialog.body", {}, className),
|
|
1952
2165
|
ref: forwardedRef
|
|
@@ -1954,7 +2167,7 @@ var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
1954
2167
|
});
|
|
1955
2168
|
var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1956
2169
|
const { tx } = useThemeContext();
|
|
1957
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Title, {
|
|
1958
2171
|
...props,
|
|
1959
2172
|
className: tx("dialog.title", {
|
|
1960
2173
|
srOnly
|
|
@@ -1964,7 +2177,7 @@ var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }
|
|
|
1964
2177
|
});
|
|
1965
2178
|
var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1966
2179
|
const { tx } = useThemeContext();
|
|
1967
|
-
return /* @__PURE__ */
|
|
2180
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Description, {
|
|
1968
2181
|
...props,
|
|
1969
2182
|
className: tx("dialog.description", {
|
|
1970
2183
|
srOnly
|
|
@@ -1976,7 +2189,7 @@ var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef)
|
|
|
1976
2189
|
const { className: classNames, ...rest } = composableProps8(props);
|
|
1977
2190
|
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1978
2191
|
const { tx } = useThemeContext();
|
|
1979
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
1980
2193
|
...rest,
|
|
1981
2194
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1982
2195
|
ref: forwardedRef
|
|
@@ -2000,28 +2213,28 @@ var Dialog = {
|
|
|
2000
2213
|
|
|
2001
2214
|
// src/components/Dialog/AlertDialog.tsx
|
|
2002
2215
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2003
|
-
import { createContext as
|
|
2004
|
-
import
|
|
2005
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
2216
|
+
import { createContext as createContext7 } from "@radix-ui/react-context";
|
|
2217
|
+
import React24, { forwardRef as forwardRef15 } from "react";
|
|
2218
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React24.createElement(ElevationProvider, {
|
|
2006
2219
|
elevation: "dialog"
|
|
2007
|
-
}, /* @__PURE__ */
|
|
2220
|
+
}, /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Root, props));
|
|
2008
2221
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2009
2222
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2010
2223
|
var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
2011
2224
|
var AlertDialogAction = AlertDialogPrimitive.Action;
|
|
2012
2225
|
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
2013
2226
|
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
2014
|
-
var [OverlayLayoutProvider2, useOverlayLayoutContext2] =
|
|
2227
|
+
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext7(ALERT_DIALOG_OVERLAY_NAME, {
|
|
2015
2228
|
inOverlayLayout: false
|
|
2016
2229
|
});
|
|
2017
2230
|
var AlertDialogOverlay = /* @__PURE__ */ forwardRef15(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
2018
2231
|
const { tx } = useThemeContext();
|
|
2019
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Overlay, {
|
|
2020
2233
|
...props,
|
|
2021
2234
|
"data-block-align": blockAlign,
|
|
2022
2235
|
className: tx("dialog.overlay", {}, classNames),
|
|
2023
2236
|
ref: forwardedRef
|
|
2024
|
-
}, /* @__PURE__ */
|
|
2237
|
+
}, /* @__PURE__ */ React24.createElement(OverlayLayoutProvider2, {
|
|
2025
2238
|
inOverlayLayout: true
|
|
2026
2239
|
}, children));
|
|
2027
2240
|
});
|
|
@@ -2029,7 +2242,7 @@ AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
|
2029
2242
|
var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
2030
2243
|
const { tx } = useThemeContext();
|
|
2031
2244
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
2032
|
-
return /* @__PURE__ */
|
|
2245
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Content, {
|
|
2033
2246
|
...props,
|
|
2034
2247
|
className: tx("dialog.content", {
|
|
2035
2248
|
inOverlayLayout,
|
|
@@ -2039,7 +2252,7 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, s
|
|
|
2039
2252
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2040
2253
|
"aria-describedby": void 0,
|
|
2041
2254
|
ref: forwardedRef
|
|
2042
|
-
}, /* @__PURE__ */
|
|
2255
|
+
}, /* @__PURE__ */ React24.createElement(Column.Root, {
|
|
2043
2256
|
classNames: "dx-expander",
|
|
2044
2257
|
gutter: "sm"
|
|
2045
2258
|
}, children));
|
|
@@ -2047,7 +2260,7 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, s
|
|
|
2047
2260
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
2048
2261
|
var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2049
2262
|
const { tx } = useThemeContext();
|
|
2050
|
-
return /* @__PURE__ */
|
|
2263
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Title, {
|
|
2051
2264
|
...props,
|
|
2052
2265
|
className: tx("dialog.title", {
|
|
2053
2266
|
srOnly
|
|
@@ -2057,7 +2270,7 @@ var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...pr
|
|
|
2057
2270
|
});
|
|
2058
2271
|
var AlertDialogDescription = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2059
2272
|
const { tx } = useThemeContext();
|
|
2060
|
-
return /* @__PURE__ */
|
|
2273
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Description, {
|
|
2061
2274
|
...props,
|
|
2062
2275
|
className: tx("dialog.description", {
|
|
2063
2276
|
srOnly
|
|
@@ -2087,52 +2300,52 @@ var AlertDialog = {
|
|
|
2087
2300
|
import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
2088
2301
|
|
|
2089
2302
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2090
|
-
import
|
|
2303
|
+
import React25 from "react";
|
|
2091
2304
|
import { safeStringify } from "@dxos/util";
|
|
2092
2305
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
2093
2306
|
const isDev = process.env.NODE_ENV === "development";
|
|
2094
2307
|
const message = error instanceof Error ? error.message : String(error);
|
|
2095
|
-
return /* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
2096
2309
|
role: "alert",
|
|
2097
2310
|
"data-testid": "error-boundary-fallback",
|
|
2098
2311
|
className: "flex flex-col p-4 gap-4 overflow-auto"
|
|
2099
|
-
}, /* @__PURE__ */
|
|
2312
|
+
}, /* @__PURE__ */ React25.createElement("h1", {
|
|
2100
2313
|
className: "text-lg text-info-text"
|
|
2101
|
-
}, title ?? "Runtime Error"), /* @__PURE__ */
|
|
2314
|
+
}, title ?? "Runtime Error"), /* @__PURE__ */ React25.createElement("p", null, message), isDev && error instanceof Error && /* @__PURE__ */ React25.createElement(Section, {
|
|
2102
2315
|
title: "Stack",
|
|
2103
2316
|
onClick: () => {
|
|
2104
2317
|
const text = error instanceof Error ? error.stack ?? error.message : String(error);
|
|
2105
2318
|
void navigator.clipboard.writeText(text);
|
|
2106
2319
|
}
|
|
2107
|
-
}, /* @__PURE__ */
|
|
2320
|
+
}, /* @__PURE__ */ React25.createElement(ErrorStack, {
|
|
2108
2321
|
error
|
|
2109
|
-
})), data && /* @__PURE__ */
|
|
2322
|
+
})), data && /* @__PURE__ */ React25.createElement(Section, {
|
|
2110
2323
|
title: "Data",
|
|
2111
2324
|
onClick: () => {
|
|
2112
2325
|
void navigator.clipboard.writeText(JSON.stringify(data, void 0, 2));
|
|
2113
2326
|
}
|
|
2114
|
-
}, /* @__PURE__ */
|
|
2327
|
+
}, /* @__PURE__ */ React25.createElement("pre", {
|
|
2115
2328
|
className: "overflow-x-auto text-xs"
|
|
2116
2329
|
}, safeStringify(data, void 0, 2))), children);
|
|
2117
2330
|
};
|
|
2118
2331
|
var Section = ({ children, title, onClick }) => {
|
|
2119
|
-
return /* @__PURE__ */
|
|
2332
|
+
return /* @__PURE__ */ React25.createElement("div", {
|
|
2120
2333
|
className: "flex flex-col gap-1"
|
|
2121
|
-
}, onClick && /* @__PURE__ */
|
|
2334
|
+
}, onClick && /* @__PURE__ */ React25.createElement("button", {
|
|
2122
2335
|
type: "button",
|
|
2123
2336
|
onClick,
|
|
2124
2337
|
className: "flex items-center gap-1 text-xs text-subdued hover:text-primary-500 transition-colors",
|
|
2125
2338
|
title: `Copy ${title}`
|
|
2126
|
-
}, /* @__PURE__ */
|
|
2339
|
+
}, /* @__PURE__ */ React25.createElement("h2", {
|
|
2127
2340
|
className: "text-xs uppercase text-subdued"
|
|
2128
2341
|
}, title)), children);
|
|
2129
2342
|
};
|
|
2130
2343
|
|
|
2131
2344
|
// src/components/ErrorFallback/ThrowError.tsx
|
|
2132
|
-
import { useEffect as
|
|
2345
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
2133
2346
|
var ThrowError = ({ delay = 1e3, ...props }) => {
|
|
2134
|
-
const [error, setError] =
|
|
2135
|
-
|
|
2347
|
+
const [error, setError] = useState6();
|
|
2348
|
+
useEffect4(() => {
|
|
2136
2349
|
if (delay < 0) {
|
|
2137
2350
|
return;
|
|
2138
2351
|
}
|
|
@@ -2157,15 +2370,15 @@ var generator = ({ error, delay }) => {
|
|
|
2157
2370
|
};
|
|
2158
2371
|
|
|
2159
2372
|
// src/components/Focus/Focus.tsx
|
|
2160
|
-
import { useArrowNavigationGroup, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2373
|
+
import { useArrowNavigationGroup as useArrowNavigationGroup2, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2161
2374
|
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2162
2375
|
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
2163
2376
|
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2164
|
-
import
|
|
2377
|
+
import React26, { createContext as createContext8, useCallback as useCallback7, useContext as useContext6, useRef as useRef3, useState as useState7 } from "react";
|
|
2165
2378
|
import { composableProps as composableProps9, slottable as slottable8 } from "@dxos/ui-theme";
|
|
2166
2379
|
var FOCUS_STATE_ATTR = "focus-state";
|
|
2167
|
-
var FocusContext = /* @__PURE__ */
|
|
2168
|
-
var useFocus = () =>
|
|
2380
|
+
var FocusContext = /* @__PURE__ */ createContext8({});
|
|
2381
|
+
var useFocus = () => useContext6(FocusContext);
|
|
2169
2382
|
var Group3 = slottable8(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
2170
2383
|
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2171
2384
|
const { tx } = useThemeContext();
|
|
@@ -2173,27 +2386,27 @@ var Group3 = slottable8(({ children, asChild, orientation = "vertical", border =
|
|
|
2173
2386
|
const focusableGroupAttrs = useFocusableGroup({
|
|
2174
2387
|
tabBehavior: "limited-trap-focus"
|
|
2175
2388
|
});
|
|
2176
|
-
const arrowNavigationAttrs =
|
|
2389
|
+
const arrowNavigationAttrs = useArrowNavigationGroup2({
|
|
2177
2390
|
axis: orientation,
|
|
2178
2391
|
memorizeCurrent: true
|
|
2179
2392
|
});
|
|
2180
2393
|
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
2181
|
-
const [state, setState] =
|
|
2182
|
-
const [groupHasFocus, setGroupHasFocus] =
|
|
2183
|
-
const handleFocusIn =
|
|
2184
|
-
const handleFocusOut =
|
|
2394
|
+
const [state, setState] = useState7();
|
|
2395
|
+
const [groupHasFocus, setGroupHasFocus] = useState7(false);
|
|
2396
|
+
const handleFocusIn = useCallback7(() => setGroupHasFocus(true), []);
|
|
2397
|
+
const handleFocusOut = useCallback7((event) => {
|
|
2185
2398
|
const related = event.relatedTarget;
|
|
2186
2399
|
if (!related || !rootRef.current?.contains(related)) {
|
|
2187
2400
|
setGroupHasFocus(false);
|
|
2188
2401
|
}
|
|
2189
2402
|
}, []);
|
|
2190
2403
|
const { className, ...rest } = composableProps9(props);
|
|
2191
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */ React26.createElement(FocusContext.Provider, {
|
|
2192
2405
|
value: {
|
|
2193
2406
|
setFocus: setState,
|
|
2194
2407
|
groupHasFocus
|
|
2195
2408
|
}
|
|
2196
|
-
}, /* @__PURE__ */
|
|
2409
|
+
}, /* @__PURE__ */ React26.createElement(Comp, {
|
|
2197
2410
|
...rest,
|
|
2198
2411
|
tabIndex: 0,
|
|
2199
2412
|
className: tx("focus.group", {
|
|
@@ -2216,28 +2429,28 @@ var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentC
|
|
|
2216
2429
|
Enter: true
|
|
2217
2430
|
}
|
|
2218
2431
|
});
|
|
2219
|
-
const [focused, setFocused] =
|
|
2220
|
-
const handleClick =
|
|
2432
|
+
const [focused, setFocused] = useState7(false);
|
|
2433
|
+
const handleClick = useCallback7((event) => {
|
|
2221
2434
|
onCurrentChange?.();
|
|
2222
2435
|
onClick?.(event);
|
|
2223
2436
|
}, [
|
|
2224
2437
|
onCurrentChange,
|
|
2225
2438
|
onClick
|
|
2226
2439
|
]);
|
|
2227
|
-
const handleKeyDown =
|
|
2440
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2228
2441
|
if (event.key === "Enter") {
|
|
2229
2442
|
onCurrentChange?.();
|
|
2230
2443
|
}
|
|
2231
2444
|
}, [
|
|
2232
2445
|
onCurrentChange
|
|
2233
2446
|
]);
|
|
2234
|
-
const handleFocus =
|
|
2447
|
+
const handleFocus = useCallback7((event) => {
|
|
2235
2448
|
setFocused(true);
|
|
2236
2449
|
onFocus?.(event);
|
|
2237
2450
|
}, [
|
|
2238
2451
|
onFocus
|
|
2239
2452
|
]);
|
|
2240
|
-
const handleBlur =
|
|
2453
|
+
const handleBlur = useCallback7((event) => {
|
|
2241
2454
|
setFocused(false);
|
|
2242
2455
|
onBlur?.(event);
|
|
2243
2456
|
}, [
|
|
@@ -2245,7 +2458,7 @@ var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentC
|
|
|
2245
2458
|
]);
|
|
2246
2459
|
const isCurrent = current ?? focused;
|
|
2247
2460
|
const { className, ...rest } = composableProps9(props);
|
|
2248
|
-
return /* @__PURE__ */
|
|
2461
|
+
return /* @__PURE__ */ React26.createElement(Comp, {
|
|
2249
2462
|
...rest,
|
|
2250
2463
|
tabIndex: 0,
|
|
2251
2464
|
className: tx("focus.item", {
|
|
@@ -2268,12 +2481,12 @@ var Focus = {
|
|
|
2268
2481
|
// src/components/Input/Input.tsx
|
|
2269
2482
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2270
2483
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
2271
|
-
import
|
|
2484
|
+
import React27, { forwardRef as forwardRef16 } from "react";
|
|
2272
2485
|
import { DescriptionAndValidation as DescriptionAndValidationPrimitive, Description as DescriptionPrimitive, INPUT_NAME, InputRoot, Label as LabelPrimitive, PinInput as PinInputPrimitive, TextArea as TextAreaPrimitive, TextInput as TextInputPrimitive, Validation as ValidationPrimitive, useInputContext } from "@dxos/react-input";
|
|
2273
|
-
import { mx as
|
|
2486
|
+
import { mx as mx9 } from "@dxos/ui-theme";
|
|
2274
2487
|
var Label3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2275
2488
|
const { tx } = useThemeContext();
|
|
2276
|
-
return /* @__PURE__ */
|
|
2489
|
+
return /* @__PURE__ */ React27.createElement(LabelPrimitive, {
|
|
2277
2490
|
...props,
|
|
2278
2491
|
className: tx("input.label", {
|
|
2279
2492
|
srOnly
|
|
@@ -2283,7 +2496,7 @@ var Label3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...pr
|
|
|
2283
2496
|
});
|
|
2284
2497
|
var Description3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2285
2498
|
const { tx } = useThemeContext();
|
|
2286
|
-
return /* @__PURE__ */
|
|
2499
|
+
return /* @__PURE__ */ React27.createElement(DescriptionPrimitive, {
|
|
2287
2500
|
...props,
|
|
2288
2501
|
className: tx("input.description", {
|
|
2289
2502
|
srOnly
|
|
@@ -2294,7 +2507,7 @@ var Description3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly,
|
|
|
2294
2507
|
var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2295
2508
|
const { tx } = useThemeContext();
|
|
2296
2509
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2297
|
-
return /* @__PURE__ */
|
|
2510
|
+
return /* @__PURE__ */ React27.createElement(ValidationPrimitive, {
|
|
2298
2511
|
...props,
|
|
2299
2512
|
className: tx("input.validation", {
|
|
2300
2513
|
srOnly,
|
|
@@ -2305,7 +2518,7 @@ var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, child
|
|
|
2305
2518
|
});
|
|
2306
2519
|
var DescriptionAndValidation = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2307
2520
|
const { tx } = useThemeContext();
|
|
2308
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ React27.createElement(DescriptionAndValidationPrimitive, {
|
|
2309
2522
|
...props,
|
|
2310
2523
|
className: tx("input.descriptionAndValidation", {
|
|
2311
2524
|
srOnly
|
|
@@ -2318,7 +2531,7 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity
|
|
|
2318
2531
|
const { tx } = useThemeContext();
|
|
2319
2532
|
const density = useDensityContext(propsDensity);
|
|
2320
2533
|
const elevation = useElevationContext(propsElevation);
|
|
2321
|
-
return /* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ React27.createElement(PinInputPrimitive, {
|
|
2322
2535
|
...props,
|
|
2323
2536
|
...props.autoFocus && !hasIosKeyboard2 && {
|
|
2324
2537
|
autoFocus: true
|
|
@@ -2340,7 +2553,7 @@ var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, densit
|
|
|
2340
2553
|
const density = useDensityContext(densityProp);
|
|
2341
2554
|
const elevation = useElevationContext(elevationProp);
|
|
2342
2555
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2343
|
-
return /* @__PURE__ */
|
|
2556
|
+
return /* @__PURE__ */ React27.createElement(TextInputPrimitive, {
|
|
2344
2557
|
...props,
|
|
2345
2558
|
"data-1p-ignore": noAutoFill,
|
|
2346
2559
|
className: tx("input.input", {
|
|
@@ -2362,7 +2575,7 @@ var TextArea = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density
|
|
|
2362
2575
|
const density = useDensityContext(propsDensity);
|
|
2363
2576
|
const elevation = useElevationContext(propsElevation);
|
|
2364
2577
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2365
|
-
return /* @__PURE__ */
|
|
2578
|
+
return /* @__PURE__ */ React27.createElement(TextAreaPrimitive, {
|
|
2366
2579
|
...props,
|
|
2367
2580
|
className: tx("input.textArea", {
|
|
2368
2581
|
variant,
|
|
@@ -2385,7 +2598,7 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked
|
|
|
2385
2598
|
});
|
|
2386
2599
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2387
2600
|
const { tx } = useThemeContext();
|
|
2388
|
-
return /* @__PURE__ */
|
|
2601
|
+
return /* @__PURE__ */ React27.createElement(CheckboxPrimitive.Root, {
|
|
2389
2602
|
...props,
|
|
2390
2603
|
checked,
|
|
2391
2604
|
onCheckedChange,
|
|
@@ -2399,7 +2612,7 @@ var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked
|
|
|
2399
2612
|
size
|
|
2400
2613
|
}, "shrink-0", classNames),
|
|
2401
2614
|
ref: forwardedRef
|
|
2402
|
-
}, /* @__PURE__ */
|
|
2615
|
+
}, /* @__PURE__ */ React27.createElement(Icon, {
|
|
2403
2616
|
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
2404
2617
|
classNames: tx("input.checkboxIndicator", {
|
|
2405
2618
|
size,
|
|
@@ -2414,9 +2627,9 @@ var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked:
|
|
|
2414
2627
|
onChange: propsOnCheckedChange
|
|
2415
2628
|
});
|
|
2416
2629
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2417
|
-
return /* @__PURE__ */
|
|
2630
|
+
return /* @__PURE__ */ React27.createElement("input", {
|
|
2418
2631
|
type: "checkbox",
|
|
2419
|
-
className:
|
|
2632
|
+
className: mx9("dx-checkbox--switch dx-focus-ring", classNames),
|
|
2420
2633
|
checked,
|
|
2421
2634
|
onChange: (event) => {
|
|
2422
2635
|
onCheckedChange(event.target.checked);
|
|
@@ -2447,12 +2660,12 @@ var Input = {
|
|
|
2447
2660
|
// src/components/List/List.tsx
|
|
2448
2661
|
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
2449
2662
|
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
2450
|
-
import
|
|
2663
|
+
import React29, { forwardRef as forwardRef17 } from "react";
|
|
2451
2664
|
import { LIST_ITEM_NAME, LIST_NAME, ListItemCollapsibleContent, List as ListPrimitive, ListItem as ListPrimitiveItem, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, useListContext, useListItemContext } from "@dxos/react-list";
|
|
2452
2665
|
import { composable as composable4, composableProps as composableProps10 } from "@dxos/ui-theme";
|
|
2453
2666
|
|
|
2454
2667
|
// src/components/List/ListDropIndicator.tsx
|
|
2455
|
-
import
|
|
2668
|
+
import React28 from "react";
|
|
2456
2669
|
var edgeToOrientationMap = {
|
|
2457
2670
|
top: "horizontal",
|
|
2458
2671
|
bottom: "horizontal",
|
|
@@ -2474,7 +2687,7 @@ var terminalSize = 8;
|
|
|
2474
2687
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
2475
2688
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2476
2689
|
const orientation = edgeToOrientationMap[edge];
|
|
2477
|
-
return /* @__PURE__ */
|
|
2690
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
2478
2691
|
style: {
|
|
2479
2692
|
"--line-thickness": `${strokeSize}px`,
|
|
2480
2693
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2493,9 +2706,9 @@ var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
|
2493
2706
|
const { tx } = useThemeContext();
|
|
2494
2707
|
const density = useDensityContext(props.density);
|
|
2495
2708
|
const { className, ...rest } = composableProps10(props);
|
|
2496
|
-
return /* @__PURE__ */
|
|
2709
|
+
return /* @__PURE__ */ React29.createElement(DensityProvider, {
|
|
2497
2710
|
density
|
|
2498
|
-
}, /* @__PURE__ */
|
|
2711
|
+
}, /* @__PURE__ */ React29.createElement(ListPrimitive, {
|
|
2499
2712
|
...rest,
|
|
2500
2713
|
className: tx("list.root", {}, className),
|
|
2501
2714
|
ref: forwardedRef
|
|
@@ -2505,7 +2718,7 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChi
|
|
|
2505
2718
|
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2506
2719
|
const density = useDensityContext();
|
|
2507
2720
|
const { tx } = useThemeContext();
|
|
2508
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ React29.createElement(Comp, {
|
|
2509
2722
|
...!asChild && {
|
|
2510
2723
|
role: "none"
|
|
2511
2724
|
},
|
|
@@ -2519,7 +2732,7 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChi
|
|
|
2519
2732
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
2520
2733
|
const density = useDensityContext();
|
|
2521
2734
|
const { tx } = useThemeContext();
|
|
2522
|
-
return /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
2523
2736
|
...props,
|
|
2524
2737
|
className: tx("list.item.openTrigger", {
|
|
2525
2738
|
density
|
|
@@ -2529,25 +2742,25 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
2529
2742
|
var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2530
2743
|
const { tx } = useThemeContext();
|
|
2531
2744
|
const density = useDensityContext();
|
|
2532
|
-
return /* @__PURE__ */
|
|
2745
|
+
return /* @__PURE__ */ React29.createElement(ListPrimitiveItemHeading, {
|
|
2533
2746
|
...props,
|
|
2534
2747
|
className: tx("list.item.heading", {
|
|
2535
2748
|
density
|
|
2536
2749
|
}, classNames),
|
|
2537
2750
|
ref: forwardedRef
|
|
2538
|
-
}, /* @__PURE__ */
|
|
2751
|
+
}, /* @__PURE__ */ React29.createElement("span", null, children));
|
|
2539
2752
|
});
|
|
2540
2753
|
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2541
2754
|
const { tx } = useThemeContext();
|
|
2542
2755
|
const density = useDensityContext();
|
|
2543
2756
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
2544
|
-
return /* @__PURE__ */
|
|
2757
|
+
return /* @__PURE__ */ React29.createElement(ListPrimitiveItemOpenTrigger, {
|
|
2545
2758
|
...props,
|
|
2546
2759
|
className: tx("list.item.openTrigger", {
|
|
2547
2760
|
density
|
|
2548
2761
|
}, classNames),
|
|
2549
2762
|
ref: forwardedRef
|
|
2550
|
-
}, children || /* @__PURE__ */
|
|
2763
|
+
}, children || /* @__PURE__ */ React29.createElement(Icon, {
|
|
2551
2764
|
size: 3,
|
|
2552
2765
|
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
2553
2766
|
classNames: tx("list.item.openTriggerIcon", {})
|
|
@@ -2556,7 +2769,7 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, class
|
|
|
2556
2769
|
var ListItemRoot = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
2557
2770
|
const { tx } = useThemeContext();
|
|
2558
2771
|
const density = useDensityContext();
|
|
2559
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ React29.createElement(ListPrimitiveItem, {
|
|
2560
2773
|
...props,
|
|
2561
2774
|
className: tx("list.item.root", {
|
|
2562
2775
|
density,
|
|
@@ -2576,10 +2789,10 @@ var ListItem = {
|
|
|
2576
2789
|
};
|
|
2577
2790
|
|
|
2578
2791
|
// src/components/List/Tree.tsx
|
|
2579
|
-
import
|
|
2792
|
+
import React31, { forwardRef as forwardRef18 } from "react";
|
|
2580
2793
|
|
|
2581
2794
|
// src/components/List/TreeDropIndicator.tsx
|
|
2582
|
-
import
|
|
2795
|
+
import React30 from "react";
|
|
2583
2796
|
var edgeToOrientationMap2 = {
|
|
2584
2797
|
"reorder-above": "sibling",
|
|
2585
2798
|
"reorder-below": "sibling",
|
|
@@ -2609,7 +2822,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2609
2822
|
if (isBlocked) {
|
|
2610
2823
|
return null;
|
|
2611
2824
|
}
|
|
2612
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ React30.createElement("div", {
|
|
2613
2826
|
style: {
|
|
2614
2827
|
"--line-thickness": `${strokeSize2}px`,
|
|
2615
2828
|
"--line-offset": `${lineOffset}`,
|
|
@@ -2625,21 +2838,21 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2625
2838
|
|
|
2626
2839
|
// src/components/List/Tree.tsx
|
|
2627
2840
|
var TreeRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2628
|
-
return /* @__PURE__ */
|
|
2841
|
+
return /* @__PURE__ */ React31.createElement(List, {
|
|
2629
2842
|
...props,
|
|
2630
2843
|
ref: forwardedRef
|
|
2631
2844
|
});
|
|
2632
2845
|
});
|
|
2633
2846
|
var TreeBranch = /* @__PURE__ */ forwardRef18(({ __listScope, ...props }, forwardedRef) => {
|
|
2634
2847
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
2635
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ React31.createElement(List, {
|
|
2636
2849
|
...props,
|
|
2637
2850
|
"aria-labelledby": headingId,
|
|
2638
2851
|
ref: forwardedRef
|
|
2639
2852
|
});
|
|
2640
2853
|
});
|
|
2641
2854
|
var TreeItemRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2642
|
-
return /* @__PURE__ */
|
|
2855
|
+
return /* @__PURE__ */ React31.createElement(ListItem.Root, {
|
|
2643
2856
|
role: "treeitem",
|
|
2644
2857
|
...props,
|
|
2645
2858
|
ref: forwardedRef
|
|
@@ -2668,7 +2881,7 @@ import { createContextScope as createContextScope2 } from "@radix-ui/react-conte
|
|
|
2668
2881
|
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2669
2882
|
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2670
2883
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2671
|
-
import
|
|
2884
|
+
import React32, { forwardRef as forwardRef19, useCallback as useCallback8 } from "react";
|
|
2672
2885
|
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2673
2886
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2674
2887
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
@@ -2682,7 +2895,7 @@ var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemp
|
|
|
2682
2895
|
});
|
|
2683
2896
|
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2684
2897
|
const { findFirstFocusable } = useFocusFinders();
|
|
2685
|
-
const handleKeyDown =
|
|
2898
|
+
const handleKeyDown = useCallback8((event) => {
|
|
2686
2899
|
switch (event.key) {
|
|
2687
2900
|
case "ArrowDown":
|
|
2688
2901
|
case "ArrowUp": {
|
|
@@ -2716,7 +2929,7 @@ var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemp
|
|
|
2716
2929
|
findFirstFocusable,
|
|
2717
2930
|
onKeyDownProp
|
|
2718
2931
|
]);
|
|
2719
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ React32.createElement(Comp, {
|
|
2720
2933
|
role: "treegrid",
|
|
2721
2934
|
...rest,
|
|
2722
2935
|
className: tx("treegrid.root", {}, className),
|
|
@@ -2738,11 +2951,11 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
2738
2951
|
onChange: propsOnOpenChange,
|
|
2739
2952
|
defaultProp: defaultOpen
|
|
2740
2953
|
});
|
|
2741
|
-
return /* @__PURE__ */
|
|
2954
|
+
return /* @__PURE__ */ React32.createElement(TreegridRowProvider, {
|
|
2742
2955
|
open,
|
|
2743
2956
|
onOpenChange,
|
|
2744
2957
|
scope: __treegridRowScope
|
|
2745
|
-
}, /* @__PURE__ */
|
|
2958
|
+
}, /* @__PURE__ */ React32.createElement(Comp, {
|
|
2746
2959
|
role: "row",
|
|
2747
2960
|
"aria-level": level,
|
|
2748
2961
|
className: tx("treegrid.row", {
|
|
@@ -2759,7 +2972,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, c
|
|
|
2759
2972
|
});
|
|
2760
2973
|
var TreegridCell = /* @__PURE__ */ forwardRef19(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2761
2974
|
const { tx } = useThemeContext();
|
|
2762
|
-
return /* @__PURE__ */
|
|
2975
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
2763
2976
|
role: "gridcell",
|
|
2764
2977
|
className: tx("treegrid.cell", {
|
|
2765
2978
|
indent
|
|
@@ -2776,19 +2989,19 @@ var Treegrid = {
|
|
|
2776
2989
|
|
|
2777
2990
|
// src/components/Main/Main.tsx
|
|
2778
2991
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
2779
|
-
import { createContext as
|
|
2992
|
+
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
2780
2993
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2781
2994
|
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
2782
2995
|
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2783
2996
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2784
|
-
import
|
|
2997
|
+
import React33, { forwardRef as forwardRef20, useCallback as useCallback10, useEffect as useEffect6, useRef as useRef4, useState as useState9 } from "react";
|
|
2785
2998
|
import { addEventListener } from "@dxos/async";
|
|
2786
2999
|
import { log } from "@dxos/log";
|
|
2787
3000
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2788
3001
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
2789
3002
|
|
|
2790
3003
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2791
|
-
import { useCallback as
|
|
3004
|
+
import { useCallback as useCallback9, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2792
3005
|
var useSwipeToDismiss = (ref, {
|
|
2793
3006
|
onDismiss,
|
|
2794
3007
|
dismissThreshold = 64,
|
|
@@ -2797,22 +3010,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2797
3010
|
/* side = 'inline-start' */
|
|
2798
3011
|
}) => {
|
|
2799
3012
|
const $root = ref.current;
|
|
2800
|
-
const [motionState, setMotionState] =
|
|
2801
|
-
const [gestureStartX, setGestureStartX] =
|
|
2802
|
-
const setIdle =
|
|
3013
|
+
const [motionState, setMotionState] = useState8(0);
|
|
3014
|
+
const [gestureStartX, setGestureStartX] = useState8(0);
|
|
3015
|
+
const setIdle = useCallback9(() => {
|
|
2803
3016
|
setMotionState(0);
|
|
2804
3017
|
$root?.style.removeProperty("inset-inline-start");
|
|
2805
3018
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2806
3019
|
}, [
|
|
2807
3020
|
$root
|
|
2808
3021
|
]);
|
|
2809
|
-
const setFollowing =
|
|
3022
|
+
const setFollowing = useCallback9(() => {
|
|
2810
3023
|
setMotionState(2);
|
|
2811
3024
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2812
3025
|
}, [
|
|
2813
3026
|
$root
|
|
2814
3027
|
]);
|
|
2815
|
-
const handlePointerDown =
|
|
3028
|
+
const handlePointerDown = useCallback9(({ screenX }) => {
|
|
2816
3029
|
if (motionState === 0) {
|
|
2817
3030
|
setMotionState(1);
|
|
2818
3031
|
setGestureStartX(screenX);
|
|
@@ -2820,7 +3033,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2820
3033
|
}, [
|
|
2821
3034
|
motionState
|
|
2822
3035
|
]);
|
|
2823
|
-
const handlePointerMove =
|
|
3036
|
+
const handlePointerMove = useCallback9(({ screenX }) => {
|
|
2824
3037
|
if ($root) {
|
|
2825
3038
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2826
3039
|
switch (motionState) {
|
|
@@ -2844,12 +3057,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2844
3057
|
motionState,
|
|
2845
3058
|
gestureStartX
|
|
2846
3059
|
]);
|
|
2847
|
-
const handlePointerUp =
|
|
3060
|
+
const handlePointerUp = useCallback9(() => {
|
|
2848
3061
|
setIdle();
|
|
2849
3062
|
}, [
|
|
2850
3063
|
setIdle
|
|
2851
3064
|
]);
|
|
2852
|
-
|
|
3065
|
+
useEffect5(() => {
|
|
2853
3066
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2854
3067
|
return () => {
|
|
2855
3068
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2858,7 +3071,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2858
3071
|
$root,
|
|
2859
3072
|
handlePointerDown
|
|
2860
3073
|
]);
|
|
2861
|
-
|
|
3074
|
+
useEffect5(() => {
|
|
2862
3075
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2863
3076
|
return () => {
|
|
2864
3077
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2867,7 +3080,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2867
3080
|
$root,
|
|
2868
3081
|
handlePointerMove
|
|
2869
3082
|
]);
|
|
2870
|
-
|
|
3083
|
+
useEffect5(() => {
|
|
2871
3084
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2872
3085
|
return () => {
|
|
2873
3086
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2890,7 +3103,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2890
3103
|
};
|
|
2891
3104
|
var landmarkAttr = "data-main-landmark";
|
|
2892
3105
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2893
|
-
const handleKeyDown =
|
|
3106
|
+
const handleKeyDown = useCallback10((event) => {
|
|
2894
3107
|
const target = event.target;
|
|
2895
3108
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2896
3109
|
event.preventDefault();
|
|
@@ -2917,7 +3130,7 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2917
3130
|
...focusableGroupAttrs
|
|
2918
3131
|
};
|
|
2919
3132
|
};
|
|
2920
|
-
var [MainProvider, useMainContext] =
|
|
3133
|
+
var [MainProvider, useMainContext] = createContext9(MAIN_NAME, {
|
|
2921
3134
|
resizing: false,
|
|
2922
3135
|
navigationSidebarState: "closed",
|
|
2923
3136
|
setNavigationSidebarState: (_nextState) => {
|
|
@@ -2933,22 +3146,22 @@ var useSidebars = (consumerName) => {
|
|
|
2933
3146
|
return {
|
|
2934
3147
|
navigationSidebarState,
|
|
2935
3148
|
setNavigationSidebarState,
|
|
2936
|
-
toggleNavigationSidebar:
|
|
3149
|
+
toggleNavigationSidebar: useCallback10(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2937
3150
|
navigationSidebarState,
|
|
2938
3151
|
setNavigationSidebarState
|
|
2939
3152
|
]),
|
|
2940
|
-
openNavigationSidebar:
|
|
2941
|
-
collapseNavigationSidebar:
|
|
2942
|
-
closeNavigationSidebar:
|
|
3153
|
+
openNavigationSidebar: useCallback10(() => setNavigationSidebarState("expanded"), []),
|
|
3154
|
+
collapseNavigationSidebar: useCallback10(() => setNavigationSidebarState("collapsed"), []),
|
|
3155
|
+
closeNavigationSidebar: useCallback10(() => setNavigationSidebarState("closed"), []),
|
|
2943
3156
|
complementarySidebarState,
|
|
2944
3157
|
setComplementarySidebarState,
|
|
2945
|
-
toggleComplementarySidebar:
|
|
3158
|
+
toggleComplementarySidebar: useCallback10(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2946
3159
|
complementarySidebarState,
|
|
2947
3160
|
setComplementarySidebarState
|
|
2948
3161
|
]),
|
|
2949
|
-
openComplementarySidebar:
|
|
2950
|
-
collapseComplementarySidebar:
|
|
2951
|
-
closeComplementarySidebar:
|
|
3162
|
+
openComplementarySidebar: useCallback10(() => setComplementarySidebarState("expanded"), []),
|
|
3163
|
+
collapseComplementarySidebar: useCallback10(() => setComplementarySidebarState("collapsed"), []),
|
|
3164
|
+
closeComplementarySidebar: useCallback10(() => setComplementarySidebarState("closed"), [])
|
|
2952
3165
|
};
|
|
2953
3166
|
};
|
|
2954
3167
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -2963,9 +3176,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2963
3176
|
defaultProp: defaultComplementarySidebarState,
|
|
2964
3177
|
onChange: onComplementarySidebarStateChange
|
|
2965
3178
|
});
|
|
2966
|
-
const [resizing, setResizing] =
|
|
3179
|
+
const [resizing, setResizing] = useState9(false);
|
|
2967
3180
|
const resizeInterval = useRef4(null);
|
|
2968
|
-
|
|
3181
|
+
useEffect6(() => addEventListener(window, "resize", () => {
|
|
2969
3182
|
setResizing(true);
|
|
2970
3183
|
if (resizeInterval.current) {
|
|
2971
3184
|
clearTimeout(resizeInterval.current);
|
|
@@ -2975,7 +3188,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2975
3188
|
resizeInterval.current = null;
|
|
2976
3189
|
}, 3e3);
|
|
2977
3190
|
}), []);
|
|
2978
|
-
return /* @__PURE__ */
|
|
3191
|
+
return /* @__PURE__ */ React33.createElement(MainProvider, {
|
|
2979
3192
|
...props,
|
|
2980
3193
|
navigationSidebarState,
|
|
2981
3194
|
setNavigationSidebarState,
|
|
@@ -2989,7 +3202,7 @@ var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwar
|
|
|
2989
3202
|
const [isLg] = useMediaQuery("lg");
|
|
2990
3203
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_OVERLAY_NAME);
|
|
2991
3204
|
const { tx } = useThemeContext();
|
|
2992
|
-
return /* @__PURE__ */
|
|
3205
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
2993
3206
|
...props,
|
|
2994
3207
|
onClick: () => {
|
|
2995
3208
|
setNavigationSidebarState("collapsed");
|
|
@@ -3015,7 +3228,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3015
3228
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
3016
3229
|
onDismiss: () => onStateChange?.("closed")
|
|
3017
3230
|
});
|
|
3018
|
-
const handleKeyDown =
|
|
3231
|
+
const handleKeyDown = useCallback10((event) => {
|
|
3019
3232
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
3020
3233
|
if (event.key === "Escape" && focusGroupParent) {
|
|
3021
3234
|
event.preventDefault();
|
|
@@ -3027,13 +3240,13 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3027
3240
|
props.onKeyDown
|
|
3028
3241
|
]);
|
|
3029
3242
|
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
3030
|
-
return /* @__PURE__ */
|
|
3243
|
+
return /* @__PURE__ */ React33.createElement(DialogRoot2, {
|
|
3031
3244
|
open: state !== "closed",
|
|
3032
3245
|
"aria-label": toLocalizedString(label, t),
|
|
3033
3246
|
modal: false
|
|
3034
|
-
}, !isLg && /* @__PURE__ */
|
|
3247
|
+
}, !isLg && /* @__PURE__ */ React33.createElement(DialogTitle2, {
|
|
3035
3248
|
className: "sr-only"
|
|
3036
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */
|
|
3249
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React33.createElement(Root14, {
|
|
3037
3250
|
...!isLg && {
|
|
3038
3251
|
forceMount: true,
|
|
3039
3252
|
tabIndex: -1,
|
|
@@ -3054,7 +3267,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3054
3267
|
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
3055
3268
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
3056
3269
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
3057
|
-
return /* @__PURE__ */
|
|
3270
|
+
return /* @__PURE__ */ React33.createElement(MainSidebar, {
|
|
3058
3271
|
...mover,
|
|
3059
3272
|
...props,
|
|
3060
3273
|
state: navigationSidebarState,
|
|
@@ -3068,7 +3281,7 @@ MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
|
3068
3281
|
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
3069
3282
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
3070
3283
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
3071
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ React33.createElement(MainSidebar, {
|
|
3072
3285
|
...mover,
|
|
3073
3286
|
...props,
|
|
3074
3287
|
state: complementarySidebarState,
|
|
@@ -3084,7 +3297,7 @@ var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, h
|
|
|
3084
3297
|
const { tx } = useThemeContext();
|
|
3085
3298
|
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
3086
3299
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
3087
|
-
return /* @__PURE__ */
|
|
3300
|
+
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
3088
3301
|
...handlesFocus && {
|
|
3089
3302
|
...mover
|
|
3090
3303
|
},
|
|
@@ -3109,14 +3322,99 @@ var Main = {
|
|
|
3109
3322
|
ComplementarySidebar: MainComplementarySidebar
|
|
3110
3323
|
};
|
|
3111
3324
|
|
|
3325
|
+
// src/components/MediaPlayer/MediaPlayer.tsx
|
|
3326
|
+
import React34 from "react";
|
|
3327
|
+
import { mx as mx10 } from "@dxos/ui-theme";
|
|
3328
|
+
var VIDEO_EXTENSIONS = [
|
|
3329
|
+
".mp4",
|
|
3330
|
+
".webm",
|
|
3331
|
+
".ogv",
|
|
3332
|
+
".mov",
|
|
3333
|
+
".m4v"
|
|
3334
|
+
];
|
|
3335
|
+
var AUDIO_EXTENSIONS = [
|
|
3336
|
+
".mp3",
|
|
3337
|
+
".wav",
|
|
3338
|
+
".ogg",
|
|
3339
|
+
".m4a",
|
|
3340
|
+
".aac",
|
|
3341
|
+
".flac"
|
|
3342
|
+
];
|
|
3343
|
+
var DEFAULT_IFRAME_SANDBOX = "allow-scripts allow-same-origin allow-presentation";
|
|
3344
|
+
var detectMediaKind = (src) => {
|
|
3345
|
+
const pathname = src.split(/[?#]/, 1)[0];
|
|
3346
|
+
const lower = pathname.toLowerCase();
|
|
3347
|
+
if (VIDEO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
3348
|
+
return "video";
|
|
3349
|
+
}
|
|
3350
|
+
if (AUDIO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
3351
|
+
return "audio";
|
|
3352
|
+
}
|
|
3353
|
+
return void 0;
|
|
3354
|
+
};
|
|
3355
|
+
var isEmbedUrl = (src) => detectMediaKind(src) !== void 0;
|
|
3356
|
+
var LEGACY_IFRAME_PATH_PATTERN = /\/iframe(?:[/?#]|$)/i;
|
|
3357
|
+
var isLegacyIframeUrl = (src) => {
|
|
3358
|
+
const pathAndQuery = src.split("#", 1)[0];
|
|
3359
|
+
return LEGACY_IFRAME_PATH_PATTERN.test(pathAndQuery);
|
|
3360
|
+
};
|
|
3361
|
+
var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, loop = false, muted = false, alt, crossOrigin = "anonymous", imgClassNames, mediaClassNames }) => {
|
|
3362
|
+
if (isEmbedUrl(src)) {
|
|
3363
|
+
const resolved = kind ?? detectMediaKind(src) ?? "video";
|
|
3364
|
+
if (resolved === "audio") {
|
|
3365
|
+
return /* @__PURE__ */ React34.createElement("audio", {
|
|
3366
|
+
className: mx10("w-full", classNames, mediaClassNames),
|
|
3367
|
+
src,
|
|
3368
|
+
controls,
|
|
3369
|
+
autoPlay,
|
|
3370
|
+
loop,
|
|
3371
|
+
muted,
|
|
3372
|
+
crossOrigin,
|
|
3373
|
+
"aria-label": alt
|
|
3374
|
+
});
|
|
3375
|
+
}
|
|
3376
|
+
return /* @__PURE__ */ React34.createElement("video", {
|
|
3377
|
+
className: mx10("aspect-video max-w-full max-h-full", classNames, mediaClassNames),
|
|
3378
|
+
src,
|
|
3379
|
+
controls,
|
|
3380
|
+
autoPlay,
|
|
3381
|
+
loop,
|
|
3382
|
+
muted,
|
|
3383
|
+
crossOrigin,
|
|
3384
|
+
"aria-label": alt
|
|
3385
|
+
});
|
|
3386
|
+
}
|
|
3387
|
+
if (isLegacyIframeUrl(src)) {
|
|
3388
|
+
return /* @__PURE__ */ React34.createElement("iframe", {
|
|
3389
|
+
src,
|
|
3390
|
+
title: alt ?? "Embedded media",
|
|
3391
|
+
loading: "lazy",
|
|
3392
|
+
className: mx10("border-none", classNames, mediaClassNames),
|
|
3393
|
+
sandbox: DEFAULT_IFRAME_SANDBOX,
|
|
3394
|
+
referrerPolicy: "no-referrer",
|
|
3395
|
+
allow: "accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture;",
|
|
3396
|
+
allowFullScreen: true
|
|
3397
|
+
});
|
|
3398
|
+
}
|
|
3399
|
+
return /* @__PURE__ */ React34.createElement("img", {
|
|
3400
|
+
src,
|
|
3401
|
+
alt: alt ?? "",
|
|
3402
|
+
loading: "lazy",
|
|
3403
|
+
className: mx10(classNames, imgClassNames),
|
|
3404
|
+
onError: (event) => {
|
|
3405
|
+
event.currentTarget.style.display = "none";
|
|
3406
|
+
}
|
|
3407
|
+
});
|
|
3408
|
+
};
|
|
3409
|
+
|
|
3112
3410
|
// src/components/Message/Message.tsx
|
|
3113
|
-
import { createContext as
|
|
3411
|
+
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3114
3412
|
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3115
3413
|
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3116
|
-
import
|
|
3414
|
+
import React35, { forwardRef as forwardRef21 } from "react";
|
|
3117
3415
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3118
3416
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3119
|
-
import { translationKey as
|
|
3417
|
+
import { translationKey as translationKey3 } from "#translations";
|
|
3120
3418
|
var messageIcons = {
|
|
3121
3419
|
success: "ph--check-circle--duotone",
|
|
3122
3420
|
info: "ph--info--duotone",
|
|
@@ -3125,18 +3423,18 @@ var messageIcons = {
|
|
|
3125
3423
|
neutral: "ph--info--duotone"
|
|
3126
3424
|
};
|
|
3127
3425
|
var MESSAGE_NAME = "Message";
|
|
3128
|
-
var [MessageProvider, useMessageContext] =
|
|
3426
|
+
var [MessageProvider, useMessageContext] = createContext10(MESSAGE_NAME);
|
|
3129
3427
|
var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3130
3428
|
const { tx } = useThemeContext();
|
|
3131
3429
|
const titleId = useId3("message__title", propsTitleId);
|
|
3132
3430
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3133
3431
|
const elevation = useElevationContext(propsElevation);
|
|
3134
3432
|
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3135
|
-
return /* @__PURE__ */
|
|
3433
|
+
return /* @__PURE__ */ React35.createElement(MessageProvider, {
|
|
3136
3434
|
titleId,
|
|
3137
3435
|
descriptionId,
|
|
3138
3436
|
valence
|
|
3139
|
-
}, /* @__PURE__ */
|
|
3437
|
+
}, /* @__PURE__ */ React35.createElement(Comp, {
|
|
3140
3438
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3141
3439
|
...props,
|
|
3142
3440
|
className: tx("message.root", {
|
|
@@ -3151,23 +3449,23 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral",
|
|
|
3151
3449
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3152
3450
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3153
3451
|
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3154
|
-
const { t } = useTranslation4(
|
|
3452
|
+
const { t } = useTranslation4(translationKey3);
|
|
3155
3453
|
const { tx } = useThemeContext();
|
|
3156
3454
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3157
3455
|
const icon = iconProp ?? messageIcons[valence];
|
|
3158
|
-
return /* @__PURE__ */
|
|
3456
|
+
return /* @__PURE__ */ React35.createElement("div", {
|
|
3159
3457
|
className: tx("message.header", {}, classNames),
|
|
3160
3458
|
id: titleId,
|
|
3161
3459
|
ref: forwardedRef
|
|
3162
|
-
}, icon && /* @__PURE__ */
|
|
3460
|
+
}, icon && /* @__PURE__ */ React35.createElement("div", {
|
|
3163
3461
|
className: tx("message.icon", {
|
|
3164
3462
|
valence
|
|
3165
3463
|
})
|
|
3166
|
-
}, /* @__PURE__ */
|
|
3464
|
+
}, /* @__PURE__ */ React35.createElement(Icon, {
|
|
3167
3465
|
icon
|
|
3168
|
-
})), /* @__PURE__ */
|
|
3466
|
+
})), /* @__PURE__ */ React35.createElement("h2", {
|
|
3169
3467
|
className: tx("message.title", {}, classNames)
|
|
3170
|
-
}, children), onClose && /* @__PURE__ */
|
|
3468
|
+
}, children), onClose && /* @__PURE__ */ React35.createElement(IconButton, {
|
|
3171
3469
|
variant: "ghost",
|
|
3172
3470
|
icon: "ph--x--regular",
|
|
3173
3471
|
iconOnly: true,
|
|
@@ -3181,7 +3479,7 @@ var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, childr
|
|
|
3181
3479
|
const { tx } = useThemeContext();
|
|
3182
3480
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3183
3481
|
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3184
|
-
return /* @__PURE__ */
|
|
3482
|
+
return /* @__PURE__ */ React35.createElement(Comp, {
|
|
3185
3483
|
...props,
|
|
3186
3484
|
className: tx("message.content", {}, classNames),
|
|
3187
3485
|
id: descriptionId,
|
|
@@ -3212,7 +3510,7 @@ import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
|
3212
3510
|
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3213
3511
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3214
3512
|
import { hideOthers } from "aria-hidden";
|
|
3215
|
-
import
|
|
3513
|
+
import React36, { forwardRef as forwardRef22, useCallback as useCallback11, useEffect as useEffect7, useMemo as useMemo7, useRef as useRef5, useState as useState10 } from "react";
|
|
3216
3514
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3217
3515
|
var POPOVER_NAME = "Popover";
|
|
3218
3516
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3224,24 +3522,24 @@ var PopoverRoot = (props) => {
|
|
|
3224
3522
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3225
3523
|
const popperScope = usePopperScope(__scopePopover);
|
|
3226
3524
|
const triggerRef = useRef5(null);
|
|
3227
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3525
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState10(false);
|
|
3228
3526
|
const [open = false, setOpen] = useControllableState5({
|
|
3229
3527
|
prop: openProp,
|
|
3230
3528
|
defaultProp: defaultOpen,
|
|
3231
3529
|
onChange: onOpenChange
|
|
3232
3530
|
});
|
|
3233
|
-
return /* @__PURE__ */
|
|
3531
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React36.createElement(PopoverProvider, {
|
|
3234
3532
|
scope: __scopePopover,
|
|
3235
3533
|
contentId: useId4(),
|
|
3236
3534
|
triggerRef,
|
|
3237
3535
|
open,
|
|
3238
3536
|
onOpenChange: setOpen,
|
|
3239
|
-
onOpenToggle:
|
|
3537
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3240
3538
|
setOpen
|
|
3241
3539
|
]),
|
|
3242
3540
|
hasCustomAnchor,
|
|
3243
|
-
onCustomAnchorAdd:
|
|
3244
|
-
onCustomAnchorRemove:
|
|
3541
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3542
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3245
3543
|
modal
|
|
3246
3544
|
}, children));
|
|
3247
3545
|
};
|
|
@@ -3252,14 +3550,14 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3252
3550
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3253
3551
|
const popperScope = usePopperScope(__scopePopover);
|
|
3254
3552
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3255
|
-
|
|
3553
|
+
useEffect7(() => {
|
|
3256
3554
|
onCustomAnchorAdd();
|
|
3257
3555
|
return () => onCustomAnchorRemove();
|
|
3258
3556
|
}, [
|
|
3259
3557
|
onCustomAnchorAdd,
|
|
3260
3558
|
onCustomAnchorRemove
|
|
3261
3559
|
]);
|
|
3262
|
-
return /* @__PURE__ */
|
|
3560
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3263
3561
|
...popperScope,
|
|
3264
3562
|
...anchorProps,
|
|
3265
3563
|
ref: forwardedRef
|
|
@@ -3273,7 +3571,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3273
3571
|
const popperScope = usePopperScope(__scopePopover);
|
|
3274
3572
|
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3275
3573
|
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3276
|
-
const trigger = /* @__PURE__ */
|
|
3574
|
+
const trigger = /* @__PURE__ */ React36.createElement(Comp, {
|
|
3277
3575
|
type: "button",
|
|
3278
3576
|
"aria-haspopup": "dialog",
|
|
3279
3577
|
"aria-expanded": context.open,
|
|
@@ -3283,7 +3581,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3283
3581
|
ref: composedTriggerRef,
|
|
3284
3582
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
3285
3583
|
});
|
|
3286
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
3584
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3287
3585
|
asChild: true,
|
|
3288
3586
|
...popperScope
|
|
3289
3587
|
}, trigger);
|
|
@@ -3294,12 +3592,12 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3294
3592
|
const { __scopePopover, virtualRef } = props;
|
|
3295
3593
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3296
3594
|
const popperScope = usePopperScope(__scopePopover);
|
|
3297
|
-
|
|
3595
|
+
useEffect7(() => {
|
|
3298
3596
|
if (virtualRef.current) {
|
|
3299
3597
|
context.triggerRef.current = virtualRef.current;
|
|
3300
3598
|
}
|
|
3301
3599
|
});
|
|
3302
|
-
return /* @__PURE__ */
|
|
3600
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3303
3601
|
...popperScope,
|
|
3304
3602
|
virtualRef
|
|
3305
3603
|
});
|
|
@@ -3312,12 +3610,12 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
3312
3610
|
var PopoverPortal = (props) => {
|
|
3313
3611
|
const { __scopePopover, forceMount, children, container } = props;
|
|
3314
3612
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
3315
|
-
return /* @__PURE__ */
|
|
3613
|
+
return /* @__PURE__ */ React36.createElement(PortalProvider, {
|
|
3316
3614
|
scope: __scopePopover,
|
|
3317
3615
|
forceMount
|
|
3318
|
-
}, /* @__PURE__ */
|
|
3616
|
+
}, /* @__PURE__ */ React36.createElement(Presence, {
|
|
3319
3617
|
present: forceMount || context.open
|
|
3320
|
-
}, /* @__PURE__ */
|
|
3618
|
+
}, /* @__PURE__ */ React36.createElement(PortalPrimitive, {
|
|
3321
3619
|
asChild: true,
|
|
3322
3620
|
container
|
|
3323
3621
|
}, children)));
|
|
@@ -3328,12 +3626,12 @@ var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3328
3626
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
3329
3627
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3330
3628
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3331
|
-
return /* @__PURE__ */
|
|
3629
|
+
return /* @__PURE__ */ React36.createElement(Presence, {
|
|
3332
3630
|
present: forceMount || context.open
|
|
3333
|
-
}, context.modal ? /* @__PURE__ */
|
|
3631
|
+
}, context.modal ? /* @__PURE__ */ React36.createElement(PopoverContentModal, {
|
|
3334
3632
|
...contentProps,
|
|
3335
3633
|
ref: forwardedRef
|
|
3336
|
-
}) : /* @__PURE__ */
|
|
3634
|
+
}) : /* @__PURE__ */ React36.createElement(PopoverContentNonModal, {
|
|
3337
3635
|
...contentProps,
|
|
3338
3636
|
ref: forwardedRef
|
|
3339
3637
|
}));
|
|
@@ -3344,16 +3642,16 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) =>
|
|
|
3344
3642
|
const contentRef = useRef5(null);
|
|
3345
3643
|
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3346
3644
|
const isRightClickOutsideRef = useRef5(false);
|
|
3347
|
-
|
|
3645
|
+
useEffect7(() => {
|
|
3348
3646
|
const content = contentRef.current;
|
|
3349
3647
|
if (content) {
|
|
3350
3648
|
return hideOthers(content);
|
|
3351
3649
|
}
|
|
3352
3650
|
}, []);
|
|
3353
|
-
return /* @__PURE__ */
|
|
3651
|
+
return /* @__PURE__ */ React36.createElement(RemoveScroll, {
|
|
3354
3652
|
as: Slot19,
|
|
3355
3653
|
allowPinchZoom: true
|
|
3356
|
-
}, /* @__PURE__ */
|
|
3654
|
+
}, /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3357
3655
|
...props,
|
|
3358
3656
|
ref: composedRefs,
|
|
3359
3657
|
// Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).
|
|
@@ -3384,7 +3682,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
3384
3682
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3385
3683
|
const hasInteractedOutsideRef = useRef5(false);
|
|
3386
3684
|
const hasPointerDownOutsideRef = useRef5(false);
|
|
3387
|
-
return /* @__PURE__ */
|
|
3685
|
+
return /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3388
3686
|
...props,
|
|
3389
3687
|
ref: forwardedRef,
|
|
3390
3688
|
trapFocus: false,
|
|
@@ -3427,7 +3725,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3427
3725
|
const elevation = useElevationContext();
|
|
3428
3726
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3429
3727
|
useFocusGuards();
|
|
3430
|
-
const computedCollisionBoundary =
|
|
3728
|
+
const computedCollisionBoundary = useMemo7(() => {
|
|
3431
3729
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3432
3730
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3433
3731
|
closestBoundary,
|
|
@@ -3443,13 +3741,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3443
3741
|
collisionBoundary,
|
|
3444
3742
|
context.triggerRef.current
|
|
3445
3743
|
]);
|
|
3446
|
-
return /* @__PURE__ */
|
|
3744
|
+
return /* @__PURE__ */ React36.createElement(FocusScope, {
|
|
3447
3745
|
asChild: true,
|
|
3448
3746
|
loop: true,
|
|
3449
3747
|
trapped: trapFocus,
|
|
3450
3748
|
onMountAutoFocus: onOpenAutoFocus,
|
|
3451
3749
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
3452
|
-
}, /* @__PURE__ */
|
|
3750
|
+
}, /* @__PURE__ */ React36.createElement(DismissableLayer, {
|
|
3453
3751
|
asChild: true,
|
|
3454
3752
|
disableOutsidePointerEvents,
|
|
3455
3753
|
onInteractOutside,
|
|
@@ -3457,7 +3755,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3457
3755
|
onPointerDownOutside,
|
|
3458
3756
|
onFocusOutside,
|
|
3459
3757
|
onDismiss: () => context.onOpenChange(false)
|
|
3460
|
-
}, /* @__PURE__ */
|
|
3758
|
+
}, /* @__PURE__ */ React36.createElement(PopperPrimitive.Content, {
|
|
3461
3759
|
"data-state": getState(context.open),
|
|
3462
3760
|
role: "dialog",
|
|
3463
3761
|
id: context.contentId,
|
|
@@ -3486,7 +3784,7 @@ var CLOSE_NAME = "PopoverClose";
|
|
|
3486
3784
|
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3487
3785
|
const { __scopePopover, ...closeProps } = props;
|
|
3488
3786
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3489
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ React36.createElement(Primitive19.button, {
|
|
3490
3788
|
type: "button",
|
|
3491
3789
|
...closeProps,
|
|
3492
3790
|
ref: forwardedRef,
|
|
@@ -3499,7 +3797,7 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3499
3797
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3500
3798
|
const popperScope = usePopperScope(__scopePopover);
|
|
3501
3799
|
const { tx } = useThemeContext();
|
|
3502
|
-
return /* @__PURE__ */
|
|
3800
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Arrow, {
|
|
3503
3801
|
...popperScope,
|
|
3504
3802
|
...arrowProps,
|
|
3505
3803
|
className: tx("popover.arrow", {}, classNames),
|
|
@@ -3510,7 +3808,7 @@ PopoverArrow.displayName = ARROW_NAME2;
|
|
|
3510
3808
|
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3511
3809
|
const { tx } = useThemeContext();
|
|
3512
3810
|
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3513
|
-
return /* @__PURE__ */
|
|
3811
|
+
return /* @__PURE__ */ React36.createElement(Comp, {
|
|
3514
3812
|
...props,
|
|
3515
3813
|
className: tx("popover.viewport", {
|
|
3516
3814
|
constrainInline,
|
|
@@ -3533,10 +3831,10 @@ var Popover = {
|
|
|
3533
3831
|
};
|
|
3534
3832
|
|
|
3535
3833
|
// src/components/Status/Status.tsx
|
|
3536
|
-
import
|
|
3834
|
+
import React37, { forwardRef as forwardRef23 } from "react";
|
|
3537
3835
|
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3538
3836
|
const { tx } = useThemeContext();
|
|
3539
|
-
return /* @__PURE__ */
|
|
3837
|
+
return /* @__PURE__ */ React37.createElement("span", {
|
|
3540
3838
|
role: "status",
|
|
3541
3839
|
...props,
|
|
3542
3840
|
className: tx("status.root", {
|
|
@@ -3544,7 +3842,7 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3544
3842
|
variant
|
|
3545
3843
|
}, classNames),
|
|
3546
3844
|
ref: forwardedRef
|
|
3547
|
-
}, /* @__PURE__ */
|
|
3845
|
+
}, /* @__PURE__ */ React37.createElement("span", {
|
|
3548
3846
|
role: "none",
|
|
3549
3847
|
className: tx("status.bar", {
|
|
3550
3848
|
indeterminate,
|
|
@@ -3559,19 +3857,19 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3559
3857
|
});
|
|
3560
3858
|
|
|
3561
3859
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3562
|
-
import { createContext as
|
|
3860
|
+
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3563
3861
|
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3564
3862
|
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3565
|
-
import
|
|
3863
|
+
import React38, { useMemo as useMemo8 } from "react";
|
|
3566
3864
|
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3567
3865
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3568
|
-
var [ScrollAreaProvider, useScrollAreaContext] =
|
|
3866
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createContext11(SCROLLAREA_NAME);
|
|
3569
3867
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3570
3868
|
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3571
3869
|
const { tx } = useThemeContext();
|
|
3572
3870
|
const { className, ...rest } = composableProps12(props);
|
|
3573
3871
|
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3574
|
-
const options =
|
|
3872
|
+
const options = useMemo8(() => ({
|
|
3575
3873
|
orientation,
|
|
3576
3874
|
autoHide,
|
|
3577
3875
|
centered,
|
|
@@ -3586,7 +3884,7 @@ var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical",
|
|
|
3586
3884
|
thin,
|
|
3587
3885
|
snap
|
|
3588
3886
|
]);
|
|
3589
|
-
return /* @__PURE__ */
|
|
3887
|
+
return /* @__PURE__ */ React38.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React38.createElement(Comp, {
|
|
3590
3888
|
...rest,
|
|
3591
3889
|
className: tx("scrollArea.root", options, className),
|
|
3592
3890
|
ref: forwardedRef
|
|
@@ -3601,7 +3899,7 @@ var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedR
|
|
|
3601
3899
|
const { className, ...rest } = composableProps12(props);
|
|
3602
3900
|
const { style, ...restWithoutStyle } = rest;
|
|
3603
3901
|
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3604
|
-
return /* @__PURE__ */
|
|
3902
|
+
return /* @__PURE__ */ React38.createElement(Comp, {
|
|
3605
3903
|
...restWithoutStyle,
|
|
3606
3904
|
style: {
|
|
3607
3905
|
"--scroll-width": `${density.size}px`,
|
|
@@ -3619,25 +3917,25 @@ var ScrollArea = {
|
|
|
3619
3917
|
};
|
|
3620
3918
|
|
|
3621
3919
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3622
|
-
import { createContext as
|
|
3623
|
-
import
|
|
3920
|
+
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
3921
|
+
import React39, { forwardRef as forwardRef24, useCallback as useCallback12, useEffect as useEffect8, useImperativeHandle, useMemo as useMemo9, useRef as useRef6, useState as useState11 } from "react";
|
|
3624
3922
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3625
3923
|
import { invariant } from "@dxos/invariant";
|
|
3626
3924
|
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3627
3925
|
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3628
|
-
import { mx as
|
|
3926
|
+
import { mx as mx11 } from "@dxos/ui-theme";
|
|
3629
3927
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3630
3928
|
var isBottom = (el) => {
|
|
3631
3929
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3632
3930
|
};
|
|
3633
|
-
var [ScrollContainerProvider, useScrollContainerContext] =
|
|
3931
|
+
var [ScrollContainerProvider, useScrollContainerContext] = createContext12("ScrollContainer");
|
|
3634
3932
|
var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorProp = "smooth" }, forwardedRef) => {
|
|
3635
3933
|
const scrollerRef = useRef6(null);
|
|
3636
3934
|
const autoScrollRef = useRef6(false);
|
|
3637
|
-
const [pinned, setPinned] =
|
|
3638
|
-
const [overflow, setOverflow] =
|
|
3935
|
+
const [pinned, setPinned] = useState11(pin);
|
|
3936
|
+
const [overflow, setOverflow] = useState11(false);
|
|
3639
3937
|
const timeoutRef = useRef6(void 0);
|
|
3640
|
-
const scrollToBottom =
|
|
3938
|
+
const scrollToBottom = useCallback12((behavior = behaviorProp) => {
|
|
3641
3939
|
if (scrollerRef.current) {
|
|
3642
3940
|
if (behavior !== "instant") {
|
|
3643
3941
|
autoScrollRef.current = true;
|
|
@@ -3657,7 +3955,7 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3657
3955
|
}, [
|
|
3658
3956
|
behaviorProp
|
|
3659
3957
|
]);
|
|
3660
|
-
const controller =
|
|
3958
|
+
const controller = useMemo9(() => ({
|
|
3661
3959
|
get viewport() {
|
|
3662
3960
|
return scrollerRef.current;
|
|
3663
3961
|
},
|
|
@@ -3678,10 +3976,10 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3678
3976
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
3679
3977
|
controller
|
|
3680
3978
|
]);
|
|
3681
|
-
const setViewport =
|
|
3979
|
+
const setViewport = useCallback12((el) => {
|
|
3682
3980
|
scrollerRef.current = el;
|
|
3683
3981
|
}, []);
|
|
3684
|
-
return /* @__PURE__ */
|
|
3982
|
+
return /* @__PURE__ */ React39.createElement(ScrollContainerProvider, {
|
|
3685
3983
|
pinned,
|
|
3686
3984
|
overflow,
|
|
3687
3985
|
controller,
|
|
@@ -3692,7 +3990,7 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3692
3990
|
});
|
|
3693
3991
|
Root10.displayName = "ScrollContainer.Root";
|
|
3694
3992
|
var Content6 = composable6(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
3695
|
-
return /* @__PURE__ */
|
|
3993
|
+
return /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3696
3994
|
...composableProps13(props, {
|
|
3697
3995
|
classNames: "relative"
|
|
3698
3996
|
}),
|
|
@@ -3711,7 +4009,7 @@ var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
3711
4009
|
scrollerRef
|
|
3712
4010
|
]);
|
|
3713
4011
|
const { setViewport, setPinned, setOverflow } = useScrollContainerContext(VIEWPORT_NAME);
|
|
3714
|
-
|
|
4012
|
+
useEffect8(() => {
|
|
3715
4013
|
const el = scrollerRef.current;
|
|
3716
4014
|
if (!el) {
|
|
3717
4015
|
return;
|
|
@@ -3723,11 +4021,11 @@ var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
3723
4021
|
setPinned,
|
|
3724
4022
|
setOverflow
|
|
3725
4023
|
]);
|
|
3726
|
-
return /* @__PURE__ */
|
|
4024
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3727
4025
|
asChild,
|
|
3728
4026
|
...composableProps13(props),
|
|
3729
4027
|
ref: mergedRef
|
|
3730
|
-
}, children), /* @__PURE__ */
|
|
4028
|
+
}, children), /* @__PURE__ */ React39.createElement(PinEffect, {
|
|
3731
4029
|
scrollerRef
|
|
3732
4030
|
}));
|
|
3733
4031
|
});
|
|
@@ -3735,7 +4033,7 @@ Viewport.displayName = VIEWPORT_NAME;
|
|
|
3735
4033
|
var PIN_EFFECT_NAME = "ScrollContainer.PinEffect";
|
|
3736
4034
|
var PinEffect = ({ scrollerRef }) => {
|
|
3737
4035
|
const { pinned, controller } = useScrollContainerContext(PIN_EFFECT_NAME);
|
|
3738
|
-
|
|
4036
|
+
useEffect8(() => {
|
|
3739
4037
|
const viewport = scrollerRef.current;
|
|
3740
4038
|
if (!pinned || !viewport) {
|
|
3741
4039
|
return;
|
|
@@ -3772,9 +4070,9 @@ var PinEffect = ({ scrollerRef }) => {
|
|
|
3772
4070
|
var FADE_NAME = "ScrollContainer.Fade";
|
|
3773
4071
|
var Fade = () => {
|
|
3774
4072
|
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
3775
|
-
return /* @__PURE__ */
|
|
4073
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
3776
4074
|
"data-visible": overflow,
|
|
3777
|
-
className:
|
|
4075
|
+
className: mx11(
|
|
3778
4076
|
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
3779
4077
|
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
3780
4078
|
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
@@ -3786,9 +4084,9 @@ Fade.displayName = FADE_NAME;
|
|
|
3786
4084
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
3787
4085
|
var ScrollDownButton = ({ classNames }) => {
|
|
3788
4086
|
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
3789
|
-
return /* @__PURE__ */
|
|
3790
|
-
className:
|
|
3791
|
-
}, /* @__PURE__ */
|
|
4087
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
4088
|
+
className: mx11("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4089
|
+
}, /* @__PURE__ */ React39.createElement(IconButton, {
|
|
3792
4090
|
variant: "primary",
|
|
3793
4091
|
icon: "ph--arrow-down--regular",
|
|
3794
4092
|
iconOnly: true,
|
|
@@ -3808,23 +4106,23 @@ var ScrollContainer = {
|
|
|
3808
4106
|
|
|
3809
4107
|
// src/components/Select/Select.tsx
|
|
3810
4108
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3811
|
-
import
|
|
4109
|
+
import React40, { forwardRef as forwardRef25 } from "react";
|
|
3812
4110
|
var SelectRoot = SelectPrimitive.Root;
|
|
3813
4111
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3814
4112
|
var SelectValue = SelectPrimitive.Value;
|
|
3815
4113
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3816
4114
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3817
4115
|
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3818
|
-
return /* @__PURE__ */
|
|
4116
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Trigger, {
|
|
3819
4117
|
asChild: true,
|
|
3820
4118
|
ref: forwardedRef
|
|
3821
|
-
}, /* @__PURE__ */
|
|
4119
|
+
}, /* @__PURE__ */ React40.createElement(Button, props, /* @__PURE__ */ React40.createElement(SelectPrimitive.Value, {
|
|
3822
4120
|
placeholder
|
|
3823
|
-
}, children), /* @__PURE__ */
|
|
4121
|
+
}, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3824
4122
|
className: "w-1 flex-1"
|
|
3825
|
-
}), /* @__PURE__ */
|
|
4123
|
+
}), /* @__PURE__ */ React40.createElement(SelectPrimitive.Icon, {
|
|
3826
4124
|
asChild: true
|
|
3827
|
-
}, /* @__PURE__ */
|
|
4125
|
+
}, /* @__PURE__ */ React40.createElement(Icon, {
|
|
3828
4126
|
size: 3,
|
|
3829
4127
|
icon: "ph--caret-down--bold"
|
|
3830
4128
|
}))));
|
|
@@ -3833,7 +4131,7 @@ var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collis
|
|
|
3833
4131
|
const { tx } = useThemeContext();
|
|
3834
4132
|
const elevation = useElevationContext();
|
|
3835
4133
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3836
|
-
return /* @__PURE__ */
|
|
4134
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Content, {
|
|
3837
4135
|
...props,
|
|
3838
4136
|
"data-arrow-keys": "up down",
|
|
3839
4137
|
collisionPadding: safeCollisionPadding,
|
|
@@ -3846,29 +4144,29 @@ var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collis
|
|
|
3846
4144
|
});
|
|
3847
4145
|
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3848
4146
|
const { tx } = useThemeContext();
|
|
3849
|
-
return /* @__PURE__ */
|
|
4147
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3850
4148
|
...props,
|
|
3851
4149
|
className: tx("select.scrollButton", {}, classNames),
|
|
3852
4150
|
ref: forwardedRef
|
|
3853
|
-
}, children ?? /* @__PURE__ */
|
|
4151
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3854
4152
|
size: 3,
|
|
3855
4153
|
icon: "ph--caret-up--bold"
|
|
3856
4154
|
}));
|
|
3857
4155
|
});
|
|
3858
4156
|
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3859
4157
|
const { tx } = useThemeContext();
|
|
3860
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3861
4159
|
...props,
|
|
3862
4160
|
className: tx("select.scrollButton", {}, classNames),
|
|
3863
4161
|
ref: forwardedRef
|
|
3864
|
-
}, children ?? /* @__PURE__ */
|
|
4162
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3865
4163
|
size: 3,
|
|
3866
4164
|
icon: "ph--caret-down--bold"
|
|
3867
4165
|
}));
|
|
3868
4166
|
});
|
|
3869
4167
|
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3870
4168
|
const { tx } = useThemeContext();
|
|
3871
|
-
return /* @__PURE__ */
|
|
4169
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectViewport, {
|
|
3872
4170
|
...props,
|
|
3873
4171
|
className: tx("select.viewport", {}, classNames),
|
|
3874
4172
|
ref: forwardedRef
|
|
@@ -3876,7 +4174,7 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...p
|
|
|
3876
4174
|
});
|
|
3877
4175
|
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3878
4176
|
const { tx } = useThemeContext();
|
|
3879
|
-
return /* @__PURE__ */
|
|
4177
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3880
4178
|
...props,
|
|
3881
4179
|
className: tx("select.item", {}, classNames),
|
|
3882
4180
|
ref: forwardedRef
|
|
@@ -3885,7 +4183,7 @@ var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forward
|
|
|
3885
4183
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3886
4184
|
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3887
4185
|
const { tx } = useThemeContext();
|
|
3888
|
-
return /* @__PURE__ */
|
|
4186
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemIndicator, {
|
|
3889
4187
|
...props,
|
|
3890
4188
|
className: tx("select.itemIndicator", {}, classNames),
|
|
3891
4189
|
ref: forwardedRef
|
|
@@ -3893,13 +4191,13 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children,
|
|
|
3893
4191
|
});
|
|
3894
4192
|
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
3895
4193
|
const { tx } = useThemeContext();
|
|
3896
|
-
return /* @__PURE__ */
|
|
4194
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3897
4195
|
...props,
|
|
3898
4196
|
className: tx("select.item", {}, classNames),
|
|
3899
4197
|
ref: forwardedRef
|
|
3900
|
-
}, /* @__PURE__ */
|
|
4198
|
+
}, /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3901
4199
|
className: "grow w-1"
|
|
3902
|
-
}), /* @__PURE__ */
|
|
4200
|
+
}), /* @__PURE__ */ React40.createElement(Icon, {
|
|
3903
4201
|
icon: "ph--check--regular"
|
|
3904
4202
|
}));
|
|
3905
4203
|
});
|
|
@@ -3907,7 +4205,7 @@ var SelectGroup = SelectPrimitive.Group;
|
|
|
3907
4205
|
var SelectLabel = SelectPrimitive.Label;
|
|
3908
4206
|
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3909
4207
|
const { tx } = useThemeContext();
|
|
3910
|
-
return /* @__PURE__ */
|
|
4208
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Separator, {
|
|
3911
4209
|
...props,
|
|
3912
4210
|
className: tx("select.separator", {}, classNames),
|
|
3913
4211
|
ref: forwardedRef
|
|
@@ -3915,7 +4213,7 @@ var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, fo
|
|
|
3915
4213
|
});
|
|
3916
4214
|
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3917
4215
|
const { tx } = useThemeContext();
|
|
3918
|
-
return /* @__PURE__ */
|
|
4216
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Arrow, {
|
|
3919
4217
|
...props,
|
|
3920
4218
|
className: tx("select.arrow", {}, classNames),
|
|
3921
4219
|
ref: forwardedRef
|
|
@@ -3943,10 +4241,10 @@ var Select = {
|
|
|
3943
4241
|
};
|
|
3944
4242
|
|
|
3945
4243
|
// src/components/Skeleton/Skeleton.tsx
|
|
3946
|
-
import
|
|
4244
|
+
import React41, { forwardRef as forwardRef26 } from "react";
|
|
3947
4245
|
var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
3948
4246
|
const { tx } = useThemeContext();
|
|
3949
|
-
return /* @__PURE__ */
|
|
4247
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
3950
4248
|
...props,
|
|
3951
4249
|
className: tx("skeleton.root", {
|
|
3952
4250
|
variant
|
|
@@ -3959,7 +4257,7 @@ var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default",
|
|
|
3959
4257
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3960
4258
|
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
3961
4259
|
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
3962
|
-
import
|
|
4260
|
+
import React42 from "react";
|
|
3963
4261
|
import { composableProps as composableProps14, slottable as slottable11 } from "@dxos/ui-theme";
|
|
3964
4262
|
var SPLITTER_NAME = "Splitter";
|
|
3965
4263
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
@@ -3970,12 +4268,12 @@ var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250
|
|
|
3970
4268
|
const { __scopeSplitter, ...rest } = props;
|
|
3971
4269
|
const { className, ...restProps } = composableProps14(rest);
|
|
3972
4270
|
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3973
|
-
return /* @__PURE__ */
|
|
4271
|
+
return /* @__PURE__ */ React42.createElement(SplitterProvider, {
|
|
3974
4272
|
scope: __scopeSplitter,
|
|
3975
4273
|
mode,
|
|
3976
4274
|
ratio,
|
|
3977
4275
|
transition
|
|
3978
|
-
}, /* @__PURE__ */
|
|
4276
|
+
}, /* @__PURE__ */ React42.createElement(Comp, {
|
|
3979
4277
|
...restProps,
|
|
3980
4278
|
ref: forwardedRef,
|
|
3981
4279
|
className: tx("splitter.root", {}, className)
|
|
@@ -3992,7 +4290,7 @@ var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...p
|
|
|
3992
4290
|
const isTopPanel = position === "top";
|
|
3993
4291
|
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
3994
4292
|
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
3995
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3996
4294
|
...restProps,
|
|
3997
4295
|
ref: forwardedRef,
|
|
3998
4296
|
className: tx("splitter.panel", {}, className),
|
|
@@ -4013,11 +4311,11 @@ var Splitter = {
|
|
|
4013
4311
|
// src/components/Tag/Tag.tsx
|
|
4014
4312
|
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
4015
4313
|
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
4016
|
-
import
|
|
4314
|
+
import React43, { forwardRef as forwardRef27 } from "react";
|
|
4017
4315
|
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4018
4316
|
const { tx } = useThemeContext();
|
|
4019
4317
|
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
4020
|
-
return /* @__PURE__ */
|
|
4318
|
+
return /* @__PURE__ */ React43.createElement(Comp, {
|
|
4021
4319
|
...props,
|
|
4022
4320
|
className: tx("tag.root", {
|
|
4023
4321
|
palette
|
|
@@ -4031,11 +4329,11 @@ var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNam
|
|
|
4031
4329
|
import { Primitive as Primitive23 } from "@radix-ui/react-primitive";
|
|
4032
4330
|
import { Slot as Slot23 } from "@radix-ui/react-slot";
|
|
4033
4331
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4034
|
-
import
|
|
4332
|
+
import React44, { forwardRef as forwardRef28 } from "react";
|
|
4035
4333
|
var ToastProvider = ToastPrimitive.Provider;
|
|
4036
4334
|
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
4037
4335
|
const { tx } = useThemeContext();
|
|
4038
|
-
return /* @__PURE__ */
|
|
4336
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Viewport, {
|
|
4039
4337
|
...props,
|
|
4040
4338
|
className: tx("toast.viewport", {}, classNames),
|
|
4041
4339
|
ref: forwardedRef
|
|
@@ -4043,18 +4341,18 @@ var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forw
|
|
|
4043
4341
|
});
|
|
4044
4342
|
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
4045
4343
|
const { tx } = useThemeContext();
|
|
4046
|
-
return /* @__PURE__ */
|
|
4344
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Root, {
|
|
4047
4345
|
...props,
|
|
4048
4346
|
className: tx("toast.root", {}, classNames),
|
|
4049
4347
|
ref: forwardedRef
|
|
4050
|
-
}, /* @__PURE__ */
|
|
4348
|
+
}, /* @__PURE__ */ React44.createElement(ElevationProvider, {
|
|
4051
4349
|
elevation: "toast"
|
|
4052
4350
|
}, children));
|
|
4053
4351
|
});
|
|
4054
4352
|
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4055
4353
|
const { tx } = useThemeContext();
|
|
4056
4354
|
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4057
|
-
return /* @__PURE__ */
|
|
4355
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4058
4356
|
...props,
|
|
4059
4357
|
className: tx("toast.body", {}, classNames),
|
|
4060
4358
|
ref: forwardedRef
|
|
@@ -4063,7 +4361,7 @@ var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props },
|
|
|
4063
4361
|
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4064
4362
|
const { tx } = useThemeContext();
|
|
4065
4363
|
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
4066
|
-
return /* @__PURE__ */
|
|
4364
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4067
4365
|
...props,
|
|
4068
4366
|
className: tx("toast.title", {}, classNames),
|
|
4069
4367
|
ref: forwardedRef
|
|
@@ -4072,7 +4370,7 @@ var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }
|
|
|
4072
4370
|
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4073
4371
|
const { tx } = useThemeContext();
|
|
4074
4372
|
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
4075
|
-
return /* @__PURE__ */
|
|
4373
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4076
4374
|
...props,
|
|
4077
4375
|
className: tx("toast.description", {}, classNames),
|
|
4078
4376
|
ref: forwardedRef
|
|
@@ -4081,7 +4379,7 @@ var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...p
|
|
|
4081
4379
|
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4082
4380
|
const { tx } = useThemeContext();
|
|
4083
4381
|
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4084
|
-
return /* @__PURE__ */
|
|
4382
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4085
4383
|
...props,
|
|
4086
4384
|
className: tx("toast.actions", {}, classNames),
|
|
4087
4385
|
ref: forwardedRef
|
|
@@ -4109,6 +4407,7 @@ export {
|
|
|
4109
4407
|
ButtonGroup,
|
|
4110
4408
|
Callout,
|
|
4111
4409
|
Card,
|
|
4410
|
+
Carousel,
|
|
4112
4411
|
Clipboard,
|
|
4113
4412
|
Column,
|
|
4114
4413
|
Container,
|
|
@@ -4135,6 +4434,7 @@ export {
|
|
|
4135
4434
|
List,
|
|
4136
4435
|
ListItem,
|
|
4137
4436
|
Main,
|
|
4437
|
+
MediaPlayer,
|
|
4138
4438
|
Message,
|
|
4139
4439
|
Panel,
|
|
4140
4440
|
Popover,
|
|
@@ -4166,14 +4466,17 @@ export {
|
|
|
4166
4466
|
createPopoverScope,
|
|
4167
4467
|
createSplitterScope,
|
|
4168
4468
|
createTooltipScope,
|
|
4469
|
+
detectMediaKind,
|
|
4169
4470
|
hasIosKeyboard,
|
|
4170
4471
|
initialSafeArea,
|
|
4472
|
+
isEmbedUrl,
|
|
4171
4473
|
isLabel,
|
|
4172
4474
|
messageIcons,
|
|
4173
4475
|
parseCaptureOwnerStack,
|
|
4174
4476
|
toLocalizedString,
|
|
4175
4477
|
useAvatarContext,
|
|
4176
4478
|
useButtonGroupContext,
|
|
4479
|
+
useCarousel,
|
|
4177
4480
|
useClipboard,
|
|
4178
4481
|
useDensityContext,
|
|
4179
4482
|
useDropdownMenuContext,
|