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