@dxos/react-ui 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934
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-KRSEIVRM.mjs → chunk-BDBC6H6V.mjs} +74 -2
- package/dist/lib/browser/{chunk-KRSEIVRM.mjs.map → chunk-BDBC6H6V.mjs.map} +4 -4
- package/dist/lib/browser/index.mjs +653 -422
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +20 -13
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/translations.mjs +9 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ENYC4TYH.mjs → chunk-3JSJK2ZY.mjs} +74 -2
- package/dist/lib/node-esm/{chunk-ENYC4TYH.mjs.map → chunk-3JSJK2ZY.mjs.map} +4 -4
- 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 +653 -422
- 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 +20 -13
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/translations.mjs +10 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.d.ts +1 -0
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/ToggleGroup.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +2 -2
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.d.ts +23 -49
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.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/Clipboard/ClipboardProvider.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/DensityProvider/DensityProvider.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts +21 -23
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +22 -24
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorFallback.stories.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts +14 -3
- package/dist/types/src/components/ErrorFallback/ErrorStack.d.ts.map +1 -1
- package/dist/types/src/components/ErrorFallback/ThrowError.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.d.ts +2 -10
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -1
- package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.d.ts +2 -1
- package/dist/types/src/components/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/Image/Image.stories.d.ts +3 -2
- package/dist/types/src/components/Image/Image.stories.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +12 -15
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts +2 -6
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +2 -6
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.d.ts +2 -2
- package/dist/types/src/components/List/Tree.d.ts.map +1 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.d.ts +1 -5
- package/dist/types/src/components/List/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +7 -3
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/useSwipeToDismiss.d.ts.map +1 -1
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts +30 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.d.ts.map +1 -0
- package/dist/types/src/components/MediaPlayer/MediaPlayer.stories.d.ts +15 -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/Menu/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.d.ts +11 -3
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +1 -1
- package/dist/types/src/components/Message/Message.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +10 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +2 -10
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +2 -10
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +11 -15
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.d.ts +3 -11
- package/dist/types/src/components/Splitter/Splitter.d.ts.map +1 -1
- package/dist/types/src/components/Splitter/Splitter.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +54 -55
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/index.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +4 -4
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -13
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.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/exemplars/generics.stories.d.ts +1 -5
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/slot.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/tabster.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/virtualizer.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useElevationContext.d.ts.map +1 -1
- package/dist/types/src/hooks/useIconHref.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeCollisionPadding.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.d.ts +11 -29
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.stories.d.ts +7 -7
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.d.ts +1 -5
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Flex/Flex.d.ts +1 -5
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -1
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.d.ts +1 -5
- package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.d.ts +4 -20
- package/dist/types/src/primitives/Panel/Panel.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.stories.d.ts.map +1 -1
- package/dist/types/src/testing/Loading.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -25
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/Button/IconButton.stories.tsx +1 -1
- package/src/components/Button/IconButton.tsx +3 -2
- package/src/components/Card/Card.stories.tsx +3 -3
- package/src/components/Card/Card.tsx +42 -20
- package/src/components/Carousel/Carousel.tsx +339 -0
- package/src/components/Carousel/index.ts +5 -0
- package/src/components/Clipboard/CopyButton.tsx +2 -2
- package/src/components/Dialog/Dialog.stories.tsx +2 -2
- package/src/components/Dialog/Dialog.tsx +29 -29
- package/src/components/ErrorFallback/ErrorStack.tsx +36 -2
- package/src/components/Icon/Icon.tsx +10 -3
- package/src/components/Image/Image.tsx +31 -8
- package/src/components/Input/Input.tsx +3 -3
- package/src/components/List/List.stories.tsx +1 -1
- package/src/components/List/List.tsx +1 -1
- package/src/components/List/ListDropIndicator.tsx +0 -1
- package/src/components/List/Tree.stories.tsx +1 -1
- package/src/components/MediaPlayer/MediaPlayer.stories.tsx +42 -0
- package/src/components/MediaPlayer/MediaPlayer.tsx +97 -0
- package/src/components/MediaPlayer/index.ts +5 -0
- package/src/components/Message/Message.stories.tsx +1 -1
- package/src/components/Message/Message.tsx +24 -7
- package/src/components/ScrollArea/ScrollArea.stories.tsx +1 -5
- package/src/components/ScrollContainer/ScrollContainer.tsx +1 -3
- package/src/components/ThemeProvider/index.ts +1 -1
- package/src/components/Toolbar/Toolbar.tsx +4 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/components/index.ts +2 -0
- package/src/exemplars/slot.stories.tsx +2 -4
- package/src/exemplars/virtualizer.stories.tsx +0 -1
- package/src/playground/Custom.stories.tsx +13 -6
- package/src/primitives/Column/AUDIT.md +105 -311
- package/src/primitives/Column/Column.stories.tsx +58 -59
- package/src/primitives/Column/Column.tsx +54 -58
- package/src/testing/Loading.tsx +24 -4
- package/src/testing/decorators/withLayout.tsx +7 -17
- package/src/translations.ts +5 -0
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DensityProvider,
|
|
4
4
|
ElevationContext,
|
|
5
5
|
ElevationProvider,
|
|
6
|
+
ErrorStack,
|
|
6
7
|
ThemeContext,
|
|
7
8
|
ThemeProvider,
|
|
8
9
|
Tooltip,
|
|
@@ -10,12 +11,16 @@ import {
|
|
|
10
11
|
createTooltipScope,
|
|
11
12
|
hasIosKeyboard,
|
|
12
13
|
initialSafeArea,
|
|
14
|
+
parseCaptureOwnerStack,
|
|
13
15
|
useElevationContext,
|
|
14
16
|
useSafeArea,
|
|
15
17
|
useThemeContext,
|
|
16
18
|
useTooltipContext,
|
|
17
19
|
useTranslation
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BDBC6H6V.mjs";
|
|
21
|
+
import {
|
|
22
|
+
translationKey
|
|
23
|
+
} from "./chunk-A5QCIG5R.mjs";
|
|
19
24
|
|
|
20
25
|
// src/index.ts
|
|
21
26
|
import { Trans } from "react-i18next";
|
|
@@ -23,7 +28,7 @@ export * from "@dxos/react-hooks";
|
|
|
23
28
|
export * from "@dxos/ui-types";
|
|
24
29
|
|
|
25
30
|
// src/components/ThemeProvider/index.ts
|
|
26
|
-
import { isLabel, toLocalizedString } from "@dxos/ui-types";
|
|
31
|
+
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
27
32
|
|
|
28
33
|
// src/hooks/useDensityContext.ts
|
|
29
34
|
import { useContext } from "react";
|
|
@@ -195,12 +200,19 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
195
200
|
import React4, { forwardRef as forwardRef4 } from "react";
|
|
196
201
|
|
|
197
202
|
// src/components/Icon/Icon.tsx
|
|
198
|
-
import React2, { forwardRef as forwardRef2, memo } from "react";
|
|
199
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
|
|
203
|
+
import React2, { forwardRef as forwardRef2, memo, useMemo as useMemo3 } from "react";
|
|
204
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ classNames, icon, size, synchronized, style, ...props }, forwardedRef) => {
|
|
200
205
|
const { tx } = useThemeContext();
|
|
206
|
+
const spinDelay = useMemo3(() => synchronized ? `${-(Date.now() % 1e3)}ms` : void 0, [
|
|
207
|
+
synchronized
|
|
208
|
+
]);
|
|
201
209
|
const href = useIconHref(icon);
|
|
202
210
|
return /* @__PURE__ */ React2.createElement("svg", {
|
|
203
211
|
...props,
|
|
212
|
+
style: {
|
|
213
|
+
...style,
|
|
214
|
+
animationDelay: spinDelay
|
|
215
|
+
},
|
|
204
216
|
className: tx("icon.root", {
|
|
205
217
|
size
|
|
206
218
|
}, classNames),
|
|
@@ -371,12 +383,13 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef6(({ noTooltip, tooltipSide, ...p
|
|
|
371
383
|
ref: forwardedRef
|
|
372
384
|
}));
|
|
373
385
|
});
|
|
374
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
386
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
375
387
|
const { tx } = useThemeContext();
|
|
376
388
|
return /* @__PURE__ */ React6.createElement(Button, {
|
|
377
389
|
...props,
|
|
378
390
|
classNames: tx("iconButton.root", {
|
|
379
|
-
iconOnly
|
|
391
|
+
iconOnly,
|
|
392
|
+
square
|
|
380
393
|
}, classNames),
|
|
381
394
|
ref: forwardedRef
|
|
382
395
|
}, icon && !iconEnd && /* @__PURE__ */ React6.createElement(Icon, {
|
|
@@ -456,7 +469,7 @@ var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, s
|
|
|
456
469
|
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
457
470
|
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
458
471
|
import DOMPurify from "dompurify";
|
|
459
|
-
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as
|
|
472
|
+
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as useMemo5 } from "react";
|
|
460
473
|
import { composable as composable3, composableProps as composableProps7, iconSize, mx as mx6, slottable as slottable6 } from "@dxos/ui-theme";
|
|
461
474
|
|
|
462
475
|
// src/primitives/Column/Column.tsx
|
|
@@ -481,6 +494,7 @@ var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }
|
|
|
481
494
|
role: role ?? "none",
|
|
482
495
|
style: {
|
|
483
496
|
"--gutter": gutterSize,
|
|
497
|
+
"--dx-col": "2 / span 1",
|
|
484
498
|
gridTemplateColumns: [
|
|
485
499
|
gutterSize,
|
|
486
500
|
"minmax(0,1fr)",
|
|
@@ -495,51 +509,47 @@ var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }
|
|
|
495
509
|
});
|
|
496
510
|
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
497
511
|
var COLUMN_ROW_NAME = "Column.Row";
|
|
498
|
-
var ColumnRow = slottable(({ children, asChild, role,
|
|
512
|
+
var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
499
513
|
const { className, ...rest } = composableProps(props);
|
|
500
514
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
501
515
|
const { tx } = useThemeContext();
|
|
502
516
|
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
503
517
|
...rest,
|
|
504
518
|
role: role ?? "none",
|
|
505
|
-
className: tx("column.row", {
|
|
506
|
-
fullWidth,
|
|
507
|
-
center
|
|
508
|
-
}, className),
|
|
519
|
+
className: tx("column.row", {}, className),
|
|
509
520
|
ref: forwardedRef
|
|
510
521
|
}, children);
|
|
511
522
|
});
|
|
512
523
|
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
513
|
-
var
|
|
514
|
-
var
|
|
524
|
+
var COLUMN_BLEED_NAME = "Column.Bleed";
|
|
525
|
+
var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
515
526
|
const { tx } = useThemeContext();
|
|
516
527
|
const { className, ...rest } = composableProps(props);
|
|
517
528
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
518
529
|
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
519
530
|
...rest,
|
|
520
|
-
className: tx("column.
|
|
531
|
+
className: tx("column.bleed", {}, className),
|
|
521
532
|
ref: forwardedRef
|
|
522
533
|
}, children);
|
|
523
534
|
});
|
|
524
|
-
|
|
525
|
-
var
|
|
526
|
-
var
|
|
535
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
536
|
+
var COLUMN_CENTER_NAME = "Column.Center";
|
|
537
|
+
var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
527
538
|
const { tx } = useThemeContext();
|
|
528
539
|
const { className, ...rest } = composableProps(props);
|
|
529
|
-
|
|
540
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
541
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
530
542
|
...rest,
|
|
531
|
-
className: tx("column.
|
|
532
|
-
orientation: "vertical",
|
|
533
|
-
padding: true,
|
|
543
|
+
className: tx("column.center", {}, className),
|
|
534
544
|
ref: forwardedRef
|
|
535
|
-
},
|
|
545
|
+
}, children);
|
|
536
546
|
});
|
|
537
|
-
|
|
547
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
538
548
|
var Column = {
|
|
539
549
|
Root: ColumnRoot,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
550
|
+
Row: ColumnRow,
|
|
551
|
+
Bleed: ColumnBleed,
|
|
552
|
+
Center: ColumnCenter
|
|
543
553
|
};
|
|
544
554
|
|
|
545
555
|
// src/primitives/Container/Container.tsx
|
|
@@ -665,7 +675,7 @@ var Panel = {
|
|
|
665
675
|
import React14, { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
666
676
|
import { mx as mx5 } from "@dxos/ui-theme";
|
|
667
677
|
var cache = /* @__PURE__ */ new Map();
|
|
668
|
-
var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
678
|
+
var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
669
679
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
670
680
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
671
681
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
@@ -704,7 +714,13 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
704
714
|
src
|
|
705
715
|
]);
|
|
706
716
|
return /* @__PURE__ */ React14.createElement("div", {
|
|
707
|
-
|
|
717
|
+
// `isolate` (`isolation: isolate`) creates a new stacking context so
|
|
718
|
+
// the inner <img>'s `z-10` stays scoped to this wrapper. Without it
|
|
719
|
+
// the z-10 leaks into the parent's stacking context and elevates the
|
|
720
|
+
// image above any pseudo-element rings (e.g. Focus.Item's
|
|
721
|
+
// `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,
|
|
722
|
+
// the focus ring on a Card containing a Card.Poster.
|
|
723
|
+
className: mx5(`relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`, classNames),
|
|
708
724
|
style: {
|
|
709
725
|
backgroundColor: dominantColor
|
|
710
726
|
}
|
|
@@ -727,7 +743,7 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
727
743
|
crossOrigin: crossOriginState,
|
|
728
744
|
onError: handleImageError,
|
|
729
745
|
onLoad: handleImageLoad,
|
|
730
|
-
className: "z-10
|
|
746
|
+
className: mx5("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
731
747
|
style: {
|
|
732
748
|
opacity: imageLoaded ? 1 : 0
|
|
733
749
|
}
|
|
@@ -765,7 +781,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
765
781
|
const green = pixels[i + 1];
|
|
766
782
|
const blue = pixels[i + 2];
|
|
767
783
|
const alpha = pixels[i + 3];
|
|
768
|
-
if (alpha === 0)
|
|
784
|
+
if (alpha === 0) {
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
769
787
|
const max = Math.max(red, green, blue);
|
|
770
788
|
const min = Math.min(red, green, blue);
|
|
771
789
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -793,15 +811,23 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
793
811
|
const edgePixels = sampleSize * 4 - 4;
|
|
794
812
|
for (let x = 0; x < sampleSize; x++) {
|
|
795
813
|
const topIndex = x * 4;
|
|
796
|
-
if (pixels[topIndex + 3] === 0)
|
|
814
|
+
if (pixels[topIndex + 3] === 0) {
|
|
815
|
+
edgeTransparentPixels++;
|
|
816
|
+
}
|
|
797
817
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
798
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
818
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
819
|
+
edgeTransparentPixels++;
|
|
820
|
+
}
|
|
799
821
|
}
|
|
800
822
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
801
823
|
const leftIndex = y * sampleSize * 4;
|
|
802
|
-
if (pixels[leftIndex + 3] === 0)
|
|
824
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
825
|
+
edgeTransparentPixels++;
|
|
826
|
+
}
|
|
803
827
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
804
|
-
if (pixels[rightIndex + 3] === 0)
|
|
828
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
829
|
+
edgeTransparentPixels++;
|
|
830
|
+
}
|
|
805
831
|
}
|
|
806
832
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
807
833
|
};
|
|
@@ -813,20 +839,7 @@ import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
|
813
839
|
import React18, { forwardRef as forwardRef12 } from "react";
|
|
814
840
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
815
841
|
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
816
|
-
|
|
817
|
-
// src/translations.ts
|
|
818
|
-
var translationKey = "@dxos/react-ui";
|
|
819
|
-
var translations = [
|
|
820
|
-
{
|
|
821
|
-
"en-US": {
|
|
822
|
-
[translationKey]: {
|
|
823
|
-
"toolbar-menu.label": "Action menu",
|
|
824
|
-
"toolbar-drag-handle.label": "Drag to rearrange",
|
|
825
|
-
"toolbar-close.label": "Close"
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}
|
|
829
|
-
];
|
|
842
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
830
843
|
|
|
831
844
|
// src/components/Menu/ContextMenu.tsx
|
|
832
845
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
@@ -926,7 +939,7 @@ import { createMenuScope } from "@radix-ui/react-menu";
|
|
|
926
939
|
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
927
940
|
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
928
941
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
929
|
-
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as
|
|
942
|
+
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2 } from "react";
|
|
930
943
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
931
944
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
932
945
|
createMenuScope
|
|
@@ -1057,7 +1070,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) =>
|
|
|
1057
1070
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1058
1071
|
const hasInteractedOutsideRef = useRef2(false);
|
|
1059
1072
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1060
|
-
const computedCollisionBoundary =
|
|
1073
|
+
const computedCollisionBoundary = useMemo4(() => {
|
|
1061
1074
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
1062
1075
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
1063
1076
|
closestBoundary,
|
|
@@ -1396,7 +1409,7 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef12(({ variant, density, e
|
|
|
1396
1409
|
ref: forwardedRef
|
|
1397
1410
|
}));
|
|
1398
1411
|
});
|
|
1399
|
-
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) => {
|
|
1400
1413
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1401
1414
|
...props,
|
|
1402
1415
|
asChild: true
|
|
@@ -1408,6 +1421,7 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, densit
|
|
|
1408
1421
|
icon,
|
|
1409
1422
|
label,
|
|
1410
1423
|
iconOnly,
|
|
1424
|
+
iconClassNames,
|
|
1411
1425
|
ref: forwardedRef
|
|
1412
1426
|
}));
|
|
1413
1427
|
});
|
|
@@ -1424,7 +1438,7 @@ var ToolbarSeparator = /* @__PURE__ */ forwardRef12(({ variant = "gap", ...props
|
|
|
1424
1438
|
});
|
|
1425
1439
|
});
|
|
1426
1440
|
var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1427
|
-
const { t } = useTranslation2(
|
|
1441
|
+
const { t } = useTranslation2(translationKey2);
|
|
1428
1442
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1429
1443
|
"data-testid": testId,
|
|
1430
1444
|
tabIndex: -1,
|
|
@@ -1439,7 +1453,7 @@ var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle",
|
|
|
1439
1453
|
});
|
|
1440
1454
|
});
|
|
1441
1455
|
var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, forwardedRef) => {
|
|
1442
|
-
const { t } = useTranslation2(
|
|
1456
|
+
const { t } = useTranslation2(translationKey2);
|
|
1443
1457
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1444
1458
|
iconOnly: true,
|
|
1445
1459
|
icon: "ph--x--regular",
|
|
@@ -1451,7 +1465,7 @@ var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, f
|
|
|
1451
1465
|
});
|
|
1452
1466
|
});
|
|
1453
1467
|
var ToolbarMenu = ({ context, items }) => {
|
|
1454
|
-
const { t } = useTranslation2(
|
|
1468
|
+
const { t } = useTranslation2(translationKey2);
|
|
1455
1469
|
return /* @__PURE__ */ React18.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Trigger, {
|
|
1456
1470
|
disabled: !items?.length,
|
|
1457
1471
|
asChild: true
|
|
@@ -1484,23 +1498,23 @@ var Toolbar = {
|
|
|
1484
1498
|
// src/components/Card/Card.tsx
|
|
1485
1499
|
var CardContext = /* @__PURE__ */ createContext3({});
|
|
1486
1500
|
var CARD_ROOT_NAME = "Card.Root";
|
|
1487
|
-
var CardRoot =
|
|
1501
|
+
var CardRoot = composable3(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1488
1502
|
const { className, ...rest } = composableProps7(props);
|
|
1489
|
-
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1490
1503
|
const { tx } = useThemeContext();
|
|
1491
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1504
|
+
return /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1505
|
+
asChild: true,
|
|
1506
|
+
gutter: density === "coarse" ? "lg" : "md",
|
|
1507
|
+
classNames: tx("card.root", {
|
|
1508
|
+
border,
|
|
1509
|
+
fullWidth
|
|
1510
|
+
}, className),
|
|
1511
|
+
role: role ?? "group"
|
|
1512
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1492
1513
|
...rest,
|
|
1493
1514
|
...id && {
|
|
1494
1515
|
"data-object-id": id
|
|
1495
1516
|
},
|
|
1496
|
-
role: role ?? "group",
|
|
1497
|
-
className: tx("card.root", {
|
|
1498
|
-
border,
|
|
1499
|
-
fullWidth
|
|
1500
|
-
}, className),
|
|
1501
1517
|
ref: forwardedRef
|
|
1502
|
-
}, /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1503
|
-
gutter: density === "coarse" ? "lg" : "md"
|
|
1504
1518
|
}, children));
|
|
1505
1519
|
});
|
|
1506
1520
|
CardRoot.displayName = CARD_ROOT_NAME;
|
|
@@ -1564,7 +1578,6 @@ var CardIconBlock = /* @__PURE__ */ forwardRef13(({ classNames, children, paddin
|
|
|
1564
1578
|
const { tx } = useThemeContext();
|
|
1565
1579
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1566
1580
|
...props,
|
|
1567
|
-
role: "none",
|
|
1568
1581
|
className: tx("card.icon-block", {
|
|
1569
1582
|
padding
|
|
1570
1583
|
}, classNames),
|
|
@@ -1599,10 +1612,11 @@ var CardContent = slottable6(({ children, asChild, ...props }, forwardedRef) =>
|
|
|
1599
1612
|
});
|
|
1600
1613
|
CardContent.displayName = CARD_CONTENT_NAME;
|
|
1601
1614
|
var CARD_ROW_NAME = "Card.Row";
|
|
1602
|
-
var CardRow =
|
|
1615
|
+
var CardRow = slottable6(({ children, asChild, icon, ...props }, forwardedRef) => {
|
|
1603
1616
|
const { className, ...rest } = composableProps7(props);
|
|
1617
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1604
1618
|
const { tx } = useThemeContext();
|
|
1605
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1619
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1606
1620
|
...rest,
|
|
1607
1621
|
className: tx("card.row", {}, className),
|
|
1608
1622
|
ref: forwardedRef
|
|
@@ -1663,12 +1677,11 @@ CardText.displayName = CARD_TEXT_NAME;
|
|
|
1663
1677
|
var CARD_HTML_NAME = "Card.Html";
|
|
1664
1678
|
var CardHtml = ({ html, variant = "default", ...props }) => {
|
|
1665
1679
|
const { tx } = useThemeContext();
|
|
1666
|
-
const sanitized =
|
|
1680
|
+
const sanitized = useMemo5(() => DOMPurify.sanitize(html), [
|
|
1667
1681
|
html
|
|
1668
1682
|
]);
|
|
1669
1683
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1670
1684
|
...props,
|
|
1671
|
-
role: "none",
|
|
1672
1685
|
className: tx("card.text", {
|
|
1673
1686
|
variant
|
|
1674
1687
|
}),
|
|
@@ -1685,8 +1698,7 @@ var CardPoster = (props) => {
|
|
|
1685
1698
|
const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
|
|
1686
1699
|
if (props.image) {
|
|
1687
1700
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1688
|
-
|
|
1689
|
-
className: "col-span-full mb-1"
|
|
1701
|
+
className: "col-span-full"
|
|
1690
1702
|
}, /* @__PURE__ */ React19.createElement(Image, {
|
|
1691
1703
|
classNames: [
|
|
1692
1704
|
tx("card.poster", {}),
|
|
@@ -1694,7 +1706,8 @@ var CardPoster = (props) => {
|
|
|
1694
1706
|
props.classNames
|
|
1695
1707
|
],
|
|
1696
1708
|
src: props.image,
|
|
1697
|
-
alt: props.alt
|
|
1709
|
+
alt: props.alt,
|
|
1710
|
+
fit: props.fit
|
|
1698
1711
|
}));
|
|
1699
1712
|
}
|
|
1700
1713
|
if (props.icon) {
|
|
@@ -1776,21 +1789,234 @@ var Card = {
|
|
|
1776
1789
|
Link: CardLink
|
|
1777
1790
|
};
|
|
1778
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 (
|
|
1950
|
+
// TODO(burdon): Move to ui-theme.
|
|
1951
|
+
/* @__PURE__ */ React20.createElement("div", {
|
|
1952
|
+
className: "col-start-2"
|
|
1953
|
+
}, /* @__PURE__ */ React20.createElement("div", {
|
|
1954
|
+
...arrowNavigationAttrs,
|
|
1955
|
+
className: mx7("flex items-center justify-center", classNames),
|
|
1956
|
+
role: "tablist",
|
|
1957
|
+
"aria-label": t("carousel-indicators.label")
|
|
1958
|
+
}, Array.from({
|
|
1959
|
+
length: count
|
|
1960
|
+
}).map((_, i) => /* @__PURE__ */ React20.createElement(IconButton, {
|
|
1961
|
+
key: i,
|
|
1962
|
+
role: "tab",
|
|
1963
|
+
"aria-selected": i === index,
|
|
1964
|
+
// TODO(burdon): Move to ui-theme.
|
|
1965
|
+
classNames: i === index ? "text-primary-500" : "text-description",
|
|
1966
|
+
icon: i === index ? "ph--circle--fill" : "ph--circle--regular",
|
|
1967
|
+
iconOnly: true,
|
|
1968
|
+
label: t("carousel-go-to.label", {
|
|
1969
|
+
index: i + 1
|
|
1970
|
+
}),
|
|
1971
|
+
onClick: () => setIndex(i),
|
|
1972
|
+
onFocus: () => setIndex(i),
|
|
1973
|
+
size: 3,
|
|
1974
|
+
variant: "ghost"
|
|
1975
|
+
}))))
|
|
1976
|
+
);
|
|
1977
|
+
};
|
|
1978
|
+
CarouselIndicators.displayName = "Carousel.Indicators";
|
|
1979
|
+
var CarouselCaption = ({ children, classNames }) => {
|
|
1980
|
+
const { index } = useCarousel();
|
|
1981
|
+
const content = children(index);
|
|
1982
|
+
if (content == null || content === false || content === "") {
|
|
1983
|
+
return null;
|
|
1984
|
+
}
|
|
1985
|
+
return (
|
|
1986
|
+
// TODO(burdon): Move to ui-theme.
|
|
1987
|
+
/* @__PURE__ */ React20.createElement("div", {
|
|
1988
|
+
className: "col-start-2"
|
|
1989
|
+
}, /* @__PURE__ */ React20.createElement("p", {
|
|
1990
|
+
className: mx7("text-center text-description", classNames)
|
|
1991
|
+
}, content))
|
|
1992
|
+
);
|
|
1993
|
+
};
|
|
1994
|
+
CarouselCaption.displayName = "Carousel.Caption";
|
|
1995
|
+
var Carousel = {
|
|
1996
|
+
Root: CarouselRoot,
|
|
1997
|
+
Viewport: CarouselViewport,
|
|
1998
|
+
Slide: CarouselSlide,
|
|
1999
|
+
Previous: CarouselPrevious,
|
|
2000
|
+
Next: CarouselNext,
|
|
2001
|
+
Indicators: CarouselIndicators,
|
|
2002
|
+
Caption: CarouselCaption
|
|
2003
|
+
};
|
|
2004
|
+
|
|
1779
2005
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1780
|
-
import
|
|
1781
|
-
var ClipboardContext = /* @__PURE__ */
|
|
2006
|
+
import React21, { createContext as createContext5, useCallback as useCallback6, useContext as useContext5, useState as useState5 } from "react";
|
|
2007
|
+
var ClipboardContext = /* @__PURE__ */ createContext5({
|
|
1782
2008
|
textValue: "",
|
|
1783
2009
|
setTextValue: async (_) => {
|
|
1784
2010
|
}
|
|
1785
2011
|
});
|
|
1786
|
-
var useClipboard = () =>
|
|
2012
|
+
var useClipboard = () => useContext5(ClipboardContext);
|
|
1787
2013
|
var ClipboardProvider = ({ children }) => {
|
|
1788
|
-
const [textValue, setInternalTextValue] =
|
|
1789
|
-
const setTextValue =
|
|
2014
|
+
const [textValue, setInternalTextValue] = useState5("");
|
|
2015
|
+
const setTextValue = useCallback6(async (nextValue) => {
|
|
1790
2016
|
await navigator.clipboard.writeText(nextValue);
|
|
1791
2017
|
return setInternalTextValue(nextValue);
|
|
1792
2018
|
}, []);
|
|
1793
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ React21.createElement(ClipboardContext.Provider, {
|
|
1794
2020
|
value: {
|
|
1795
2021
|
textValue,
|
|
1796
2022
|
setTextValue
|
|
@@ -1799,14 +2025,14 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1799
2025
|
};
|
|
1800
2026
|
|
|
1801
2027
|
// src/components/Clipboard/CopyButton.tsx
|
|
1802
|
-
import
|
|
1803
|
-
import { mx as
|
|
2028
|
+
import React22 from "react";
|
|
2029
|
+
import { mx as mx8, osTranslations } from "@dxos/ui-theme";
|
|
1804
2030
|
var inactiveLabelStyles = "invisible h-px -mb-px overflow-hidden";
|
|
1805
2031
|
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
1806
2032
|
const { t } = useTranslation(osTranslations);
|
|
1807
2033
|
const { textValue, setTextValue } = useClipboard();
|
|
1808
2034
|
const isCopied = textValue === value;
|
|
1809
|
-
return /* @__PURE__ */
|
|
2035
|
+
return /* @__PURE__ */ React22.createElement(Button, {
|
|
1810
2036
|
...props,
|
|
1811
2037
|
classNames: [
|
|
1812
2038
|
"inline-flex flex-col justify-center",
|
|
@@ -1814,20 +2040,18 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1814
2040
|
],
|
|
1815
2041
|
onClick: () => setTextValue(value),
|
|
1816
2042
|
"data-testid": "copy-invitation"
|
|
1817
|
-
}, /* @__PURE__ */
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
}, /* @__PURE__ */ React21.createElement("span", {
|
|
2043
|
+
}, /* @__PURE__ */ React22.createElement("div", {
|
|
2044
|
+
className: mx8("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
2045
|
+
}, /* @__PURE__ */ React22.createElement("span", {
|
|
1821
2046
|
className: "px-1"
|
|
1822
|
-
}, t("copy.label")), /* @__PURE__ */
|
|
2047
|
+
}, t("copy.label")), /* @__PURE__ */ React22.createElement(Icon, {
|
|
1823
2048
|
icon: "ph--copy--regular",
|
|
1824
2049
|
size
|
|
1825
|
-
})), /* @__PURE__ */
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
}, /* @__PURE__ */ React21.createElement("span", {
|
|
2050
|
+
})), /* @__PURE__ */ React22.createElement("div", {
|
|
2051
|
+
className: mx8("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
2052
|
+
}, /* @__PURE__ */ React22.createElement("span", {
|
|
1829
2053
|
className: "px-1"
|
|
1830
|
-
}, t("copy-success.label")), /* @__PURE__ */
|
|
2054
|
+
}, t("copy-success.label")), /* @__PURE__ */ React22.createElement(Icon, {
|
|
1831
2055
|
icon: "ph--check--regular",
|
|
1832
2056
|
size
|
|
1833
2057
|
})));
|
|
@@ -1838,7 +2062,7 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
1838
2062
|
const isCopied = textValue === value;
|
|
1839
2063
|
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
1840
2064
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1841
|
-
return /* @__PURE__ */
|
|
2065
|
+
return /* @__PURE__ */ React22.createElement(IconButton, {
|
|
1842
2066
|
iconOnly: true,
|
|
1843
2067
|
label,
|
|
1844
2068
|
icon: "ph--copy--regular",
|
|
@@ -1861,15 +2085,16 @@ var Clipboard = {
|
|
|
1861
2085
|
};
|
|
1862
2086
|
|
|
1863
2087
|
// src/components/Dialog/Dialog.tsx
|
|
1864
|
-
import { createContext as
|
|
2088
|
+
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
1865
2089
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1866
|
-
import
|
|
2090
|
+
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
2091
|
+
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
2092
|
+
import React23, { forwardRef as forwardRef14 } from "react";
|
|
1867
2093
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1868
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
1869
|
-
|
|
1870
|
-
var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvider, {
|
|
2094
|
+
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
2095
|
+
var DialogRoot = (props) => /* @__PURE__ */ React23.createElement(ElevationProvider, {
|
|
1871
2096
|
elevation: "dialog"
|
|
1872
|
-
}, /* @__PURE__ */
|
|
2097
|
+
}, /* @__PURE__ */ React23.createElement(DialogPrimitive.Root, {
|
|
1873
2098
|
// NOTE: Radix warning unless set to undefined.
|
|
1874
2099
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1875
2100
|
"aria-describedby": void 0,
|
|
@@ -1878,15 +2103,15 @@ var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvi
|
|
|
1878
2103
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1879
2104
|
var DialogPortal = DialogPrimitive.Portal;
|
|
1880
2105
|
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1881
|
-
var [OverlayLayoutProvider, useOverlayLayoutContext] =
|
|
2106
|
+
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext6(DIALOG_OVERLAY_NAME, {});
|
|
1882
2107
|
var DialogOverlay = /* @__PURE__ */ forwardRef14(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1883
2108
|
const { tx } = useThemeContext();
|
|
1884
|
-
return /* @__PURE__ */
|
|
2109
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Overlay, {
|
|
1885
2110
|
...props,
|
|
1886
2111
|
"data-block-align": blockAlign,
|
|
1887
2112
|
className: tx("dialog.overlay", {}, classNames),
|
|
1888
2113
|
ref: forwardedRef
|
|
1889
|
-
}, /* @__PURE__ */
|
|
2114
|
+
}, /* @__PURE__ */ React23.createElement(OverlayLayoutProvider, {
|
|
1890
2115
|
inOverlayLayout: true
|
|
1891
2116
|
}, children));
|
|
1892
2117
|
});
|
|
@@ -1895,7 +2120,7 @@ var DIALOG_CONTENT_NAME = "DialogContent";
|
|
|
1895
2120
|
var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1896
2121
|
const { tx } = useThemeContext();
|
|
1897
2122
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1898
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Content, {
|
|
1899
2124
|
...props,
|
|
1900
2125
|
// NOTE: Radix warning unless set to undefined.
|
|
1901
2126
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
@@ -1905,23 +2130,25 @@ var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size =
|
|
|
1905
2130
|
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1906
2131
|
}, classNames),
|
|
1907
2132
|
ref: forwardedRef
|
|
1908
|
-
}, /* @__PURE__ */
|
|
2133
|
+
}, /* @__PURE__ */ React23.createElement(Column.Root, {
|
|
1909
2134
|
classNames: "dx-expander",
|
|
1910
2135
|
gutter: "sm"
|
|
1911
2136
|
}, children));
|
|
1912
2137
|
});
|
|
1913
2138
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1914
|
-
var DialogHeader =
|
|
2139
|
+
var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2140
|
+
const { className, ...rest } = composableProps8(props);
|
|
2141
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1915
2142
|
const { tx } = useThemeContext();
|
|
1916
|
-
return /* @__PURE__ */
|
|
1917
|
-
|
|
1918
|
-
|
|
2143
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
2144
|
+
...rest,
|
|
2145
|
+
className: tx("dialog.header", {}, className),
|
|
1919
2146
|
ref: forwardedRef
|
|
1920
2147
|
}, children);
|
|
1921
2148
|
});
|
|
1922
2149
|
var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, forwardedRef) => {
|
|
1923
2150
|
const { t } = useTranslation3(osTranslations2);
|
|
1924
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React23.createElement(IconButton, {
|
|
1925
2152
|
...props,
|
|
1926
2153
|
label: label ?? t("close-dialog.label"),
|
|
1927
2154
|
icon: "ph--x--regular",
|
|
@@ -1932,17 +2159,18 @@ var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, f
|
|
|
1932
2159
|
});
|
|
1933
2160
|
});
|
|
1934
2161
|
var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2162
|
+
const { className, ...rest } = composableProps8(props);
|
|
2163
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1935
2164
|
const { tx } = useThemeContext();
|
|
1936
|
-
return /* @__PURE__ */
|
|
1937
|
-
...
|
|
1938
|
-
|
|
1939
|
-
className: tx("dialog.body", {}),
|
|
2165
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
2166
|
+
...rest,
|
|
2167
|
+
className: tx("dialog.body", {}, className),
|
|
1940
2168
|
ref: forwardedRef
|
|
1941
2169
|
}, children);
|
|
1942
2170
|
});
|
|
1943
2171
|
var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1944
2172
|
const { tx } = useThemeContext();
|
|
1945
|
-
return /* @__PURE__ */
|
|
2173
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Title, {
|
|
1946
2174
|
...props,
|
|
1947
2175
|
className: tx("dialog.title", {
|
|
1948
2176
|
srOnly
|
|
@@ -1952,7 +2180,7 @@ var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }
|
|
|
1952
2180
|
});
|
|
1953
2181
|
var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1954
2182
|
const { tx } = useThemeContext();
|
|
1955
|
-
return /* @__PURE__ */
|
|
2183
|
+
return /* @__PURE__ */ React23.createElement(DialogPrimitive.Description, {
|
|
1956
2184
|
...props,
|
|
1957
2185
|
className: tx("dialog.description", {
|
|
1958
2186
|
srOnly
|
|
@@ -1960,15 +2188,15 @@ var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...p
|
|
|
1960
2188
|
ref: forwardedRef
|
|
1961
2189
|
});
|
|
1962
2190
|
});
|
|
1963
|
-
var DialogActionBar =
|
|
2191
|
+
var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
2192
|
+
const { className: classNames, ...rest } = composableProps8(props);
|
|
2193
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1964
2194
|
const { tx } = useThemeContext();
|
|
1965
|
-
return /* @__PURE__ */
|
|
1966
|
-
|
|
1967
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1968
|
-
...props,
|
|
2195
|
+
return /* @__PURE__ */ React23.createElement(Comp, {
|
|
2196
|
+
...rest,
|
|
1969
2197
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1970
2198
|
ref: forwardedRef
|
|
1971
|
-
}, children)
|
|
2199
|
+
}, children);
|
|
1972
2200
|
});
|
|
1973
2201
|
var DialogClose = DialogPrimitive.Close;
|
|
1974
2202
|
var Dialog = {
|
|
@@ -1988,28 +2216,28 @@ var Dialog = {
|
|
|
1988
2216
|
|
|
1989
2217
|
// src/components/Dialog/AlertDialog.tsx
|
|
1990
2218
|
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
1991
|
-
import { createContext as
|
|
1992
|
-
import
|
|
1993
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
2219
|
+
import { createContext as createContext7 } from "@radix-ui/react-context";
|
|
2220
|
+
import React24, { forwardRef as forwardRef15 } from "react";
|
|
2221
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React24.createElement(ElevationProvider, {
|
|
1994
2222
|
elevation: "dialog"
|
|
1995
|
-
}, /* @__PURE__ */
|
|
2223
|
+
}, /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Root, props));
|
|
1996
2224
|
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
1997
2225
|
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
1998
2226
|
var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
1999
2227
|
var AlertDialogAction = AlertDialogPrimitive.Action;
|
|
2000
2228
|
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
2001
2229
|
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
2002
|
-
var [OverlayLayoutProvider2, useOverlayLayoutContext2] =
|
|
2230
|
+
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext7(ALERT_DIALOG_OVERLAY_NAME, {
|
|
2003
2231
|
inOverlayLayout: false
|
|
2004
2232
|
});
|
|
2005
2233
|
var AlertDialogOverlay = /* @__PURE__ */ forwardRef15(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
2006
2234
|
const { tx } = useThemeContext();
|
|
2007
|
-
return /* @__PURE__ */
|
|
2235
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Overlay, {
|
|
2008
2236
|
...props,
|
|
2009
2237
|
"data-block-align": blockAlign,
|
|
2010
2238
|
className: tx("dialog.overlay", {}, classNames),
|
|
2011
2239
|
ref: forwardedRef
|
|
2012
|
-
}, /* @__PURE__ */
|
|
2240
|
+
}, /* @__PURE__ */ React24.createElement(OverlayLayoutProvider2, {
|
|
2013
2241
|
inOverlayLayout: true
|
|
2014
2242
|
}, children));
|
|
2015
2243
|
});
|
|
@@ -2017,7 +2245,7 @@ AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
|
2017
2245
|
var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
2018
2246
|
const { tx } = useThemeContext();
|
|
2019
2247
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
2020
|
-
return /* @__PURE__ */
|
|
2248
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Content, {
|
|
2021
2249
|
...props,
|
|
2022
2250
|
className: tx("dialog.content", {
|
|
2023
2251
|
inOverlayLayout,
|
|
@@ -2027,7 +2255,7 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, s
|
|
|
2027
2255
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2028
2256
|
"aria-describedby": void 0,
|
|
2029
2257
|
ref: forwardedRef
|
|
2030
|
-
}, /* @__PURE__ */
|
|
2258
|
+
}, /* @__PURE__ */ React24.createElement(Column.Root, {
|
|
2031
2259
|
classNames: "dx-expander",
|
|
2032
2260
|
gutter: "sm"
|
|
2033
2261
|
}, children));
|
|
@@ -2035,7 +2263,7 @@ var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, s
|
|
|
2035
2263
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
2036
2264
|
var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2037
2265
|
const { tx } = useThemeContext();
|
|
2038
|
-
return /* @__PURE__ */
|
|
2266
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Title, {
|
|
2039
2267
|
...props,
|
|
2040
2268
|
className: tx("dialog.title", {
|
|
2041
2269
|
srOnly
|
|
@@ -2045,7 +2273,7 @@ var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...pr
|
|
|
2045
2273
|
});
|
|
2046
2274
|
var AlertDialogDescription = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2047
2275
|
const { tx } = useThemeContext();
|
|
2048
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ React24.createElement(AlertDialogPrimitive.Description, {
|
|
2049
2277
|
...props,
|
|
2050
2278
|
className: tx("dialog.description", {
|
|
2051
2279
|
srOnly
|
|
@@ -2077,57 +2305,6 @@ import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
|
2077
2305
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2078
2306
|
import React25 from "react";
|
|
2079
2307
|
import { safeStringify } from "@dxos/util";
|
|
2080
|
-
|
|
2081
|
-
// src/components/ErrorFallback/ErrorStack.tsx
|
|
2082
|
-
import ErrorStackParser from "error-stack-parser";
|
|
2083
|
-
import React24 from "react";
|
|
2084
|
-
import { mx as mx8 } from "@dxos/ui-theme";
|
|
2085
|
-
var ErrorStack = ({ error }) => {
|
|
2086
|
-
const frames = ErrorStackParser.parse(error);
|
|
2087
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
2088
|
-
className: "font-mono text-sm"
|
|
2089
|
-
}, frames.map((frame, i) => {
|
|
2090
|
-
const isLast = i === frames.length - 1;
|
|
2091
|
-
const local = frame.fileName ? parseLocalFrame(frame.fileName, frame.lineNumber, frame.columnNumber) : void 0;
|
|
2092
|
-
const name = frame.functionName ?? "<anonymous>";
|
|
2093
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
2094
|
-
key: i,
|
|
2095
|
-
className: mx8("grid grid-cols-[16px_1fr_auto_auto] items-stretch gap-x-2", local && "cursor-pointer hover:bg-hover-surface")
|
|
2096
|
-
}, /* @__PURE__ */ React24.createElement("div", {
|
|
2097
|
-
className: "relative"
|
|
2098
|
-
}, /* @__PURE__ */ React24.createElement("div", {
|
|
2099
|
-
className: mx8("absolute left-1/2 -translate-x-1/2 w-px bg-neutral-500", isLast ? "top-0 h-1/2" : "inset-y-0")
|
|
2100
|
-
}), /* @__PURE__ */ React24.createElement("div", {
|
|
2101
|
-
className: "absolute top-1/2 -translate-y-1/2 left-1/2 right-0 h-px bg-neutral-500"
|
|
2102
|
-
})), local ? /* @__PURE__ */ React24.createElement("a", {
|
|
2103
|
-
href: local.href,
|
|
2104
|
-
className: "truncate self-center"
|
|
2105
|
-
}, name) : /* @__PURE__ */ React24.createElement("span", {
|
|
2106
|
-
className: "text-subdued truncate self-center"
|
|
2107
|
-
}, name), /* @__PURE__ */ React24.createElement("span", {
|
|
2108
|
-
className: "text-xs text-subdued truncate self-center"
|
|
2109
|
-
}, local?.fileName ?? ""), /* @__PURE__ */ React24.createElement("span", {
|
|
2110
|
-
className: "text-xs text-subdued text-right self-center"
|
|
2111
|
-
}, local ? `${frame.lineNumber}:${frame.columnNumber}` : ""));
|
|
2112
|
-
}));
|
|
2113
|
-
};
|
|
2114
|
-
var parseLocalFrame = (fileUrl, line, col) => {
|
|
2115
|
-
try {
|
|
2116
|
-
const { pathname } = new URL(fileUrl);
|
|
2117
|
-
if (!pathname.startsWith("/@fs/")) {
|
|
2118
|
-
return void 0;
|
|
2119
|
-
}
|
|
2120
|
-
const localPath = pathname.slice(4);
|
|
2121
|
-
return {
|
|
2122
|
-
href: `vscode://file/${localPath}:${line ?? 1}:${col ?? 1}`,
|
|
2123
|
-
fileName: pathname.split("/").pop() ?? localPath
|
|
2124
|
-
};
|
|
2125
|
-
} catch {
|
|
2126
|
-
return void 0;
|
|
2127
|
-
}
|
|
2128
|
-
};
|
|
2129
|
-
|
|
2130
|
-
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2131
2308
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
2132
2309
|
const isDev = true;
|
|
2133
2310
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -2168,10 +2345,10 @@ var Section = ({ children, title, onClick }) => {
|
|
|
2168
2345
|
};
|
|
2169
2346
|
|
|
2170
2347
|
// src/components/ErrorFallback/ThrowError.tsx
|
|
2171
|
-
import { useEffect as
|
|
2348
|
+
import { useEffect as useEffect4, useState as useState6 } from "react";
|
|
2172
2349
|
var ThrowError = ({ delay = 1e3, ...props }) => {
|
|
2173
|
-
const [error, setError] =
|
|
2174
|
-
|
|
2350
|
+
const [error, setError] = useState6();
|
|
2351
|
+
useEffect4(() => {
|
|
2175
2352
|
if (delay < 0) {
|
|
2176
2353
|
return;
|
|
2177
2354
|
}
|
|
@@ -2196,37 +2373,37 @@ var generator = ({ error, delay }) => {
|
|
|
2196
2373
|
};
|
|
2197
2374
|
|
|
2198
2375
|
// src/components/Focus/Focus.tsx
|
|
2199
|
-
import { useArrowNavigationGroup, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2376
|
+
import { useArrowNavigationGroup as useArrowNavigationGroup2, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2200
2377
|
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2201
|
-
import { Primitive as
|
|
2202
|
-
import { Slot as
|
|
2203
|
-
import React26, { createContext as
|
|
2204
|
-
import { composableProps as
|
|
2378
|
+
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
2379
|
+
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2380
|
+
import React26, { createContext as createContext8, useCallback as useCallback7, useContext as useContext6, useRef as useRef3, useState as useState7 } from "react";
|
|
2381
|
+
import { composableProps as composableProps9, slottable as slottable8 } from "@dxos/ui-theme";
|
|
2205
2382
|
var FOCUS_STATE_ATTR = "focus-state";
|
|
2206
|
-
var FocusContext = /* @__PURE__ */
|
|
2207
|
-
var useFocus = () =>
|
|
2383
|
+
var FocusContext = /* @__PURE__ */ createContext8({});
|
|
2384
|
+
var useFocus = () => useContext6(FocusContext);
|
|
2208
2385
|
var Group3 = slottable8(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
2209
|
-
const Comp = asChild ?
|
|
2386
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2210
2387
|
const { tx } = useThemeContext();
|
|
2211
2388
|
const rootRef = useRef3(null);
|
|
2212
2389
|
const focusableGroupAttrs = useFocusableGroup({
|
|
2213
2390
|
tabBehavior: "limited-trap-focus"
|
|
2214
2391
|
});
|
|
2215
|
-
const arrowNavigationAttrs =
|
|
2392
|
+
const arrowNavigationAttrs = useArrowNavigationGroup2({
|
|
2216
2393
|
axis: orientation,
|
|
2217
2394
|
memorizeCurrent: true
|
|
2218
2395
|
});
|
|
2219
2396
|
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
2220
|
-
const [state, setState] =
|
|
2221
|
-
const [groupHasFocus, setGroupHasFocus] =
|
|
2222
|
-
const handleFocusIn =
|
|
2223
|
-
const handleFocusOut =
|
|
2397
|
+
const [state, setState] = useState7();
|
|
2398
|
+
const [groupHasFocus, setGroupHasFocus] = useState7(false);
|
|
2399
|
+
const handleFocusIn = useCallback7(() => setGroupHasFocus(true), []);
|
|
2400
|
+
const handleFocusOut = useCallback7((event) => {
|
|
2224
2401
|
const related = event.relatedTarget;
|
|
2225
2402
|
if (!related || !rootRef.current?.contains(related)) {
|
|
2226
2403
|
setGroupHasFocus(false);
|
|
2227
2404
|
}
|
|
2228
2405
|
}, []);
|
|
2229
|
-
const { className, ...rest } =
|
|
2406
|
+
const { className, ...rest } = composableProps9(props);
|
|
2230
2407
|
return /* @__PURE__ */ React26.createElement(FocusContext.Provider, {
|
|
2231
2408
|
value: {
|
|
2232
2409
|
setFocus: setState,
|
|
@@ -2248,42 +2425,42 @@ var Group3 = slottable8(({ children, asChild, orientation = "vertical", border =
|
|
|
2248
2425
|
}, children));
|
|
2249
2426
|
});
|
|
2250
2427
|
var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props }, forwardedRef) => {
|
|
2251
|
-
const Comp = asChild ?
|
|
2428
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2252
2429
|
const { tx } = useThemeContext();
|
|
2253
2430
|
const focusableGroupAttrs = useFocusableGroup({
|
|
2254
2431
|
ignoreDefaultKeydown: {
|
|
2255
2432
|
Enter: true
|
|
2256
2433
|
}
|
|
2257
2434
|
});
|
|
2258
|
-
const [focused, setFocused] =
|
|
2259
|
-
const handleClick =
|
|
2435
|
+
const [focused, setFocused] = useState7(false);
|
|
2436
|
+
const handleClick = useCallback7((event) => {
|
|
2260
2437
|
onCurrentChange?.();
|
|
2261
2438
|
onClick?.(event);
|
|
2262
2439
|
}, [
|
|
2263
2440
|
onCurrentChange,
|
|
2264
2441
|
onClick
|
|
2265
2442
|
]);
|
|
2266
|
-
const handleKeyDown =
|
|
2443
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2267
2444
|
if (event.key === "Enter") {
|
|
2268
2445
|
onCurrentChange?.();
|
|
2269
2446
|
}
|
|
2270
2447
|
}, [
|
|
2271
2448
|
onCurrentChange
|
|
2272
2449
|
]);
|
|
2273
|
-
const handleFocus =
|
|
2450
|
+
const handleFocus = useCallback7((event) => {
|
|
2274
2451
|
setFocused(true);
|
|
2275
2452
|
onFocus?.(event);
|
|
2276
2453
|
}, [
|
|
2277
2454
|
onFocus
|
|
2278
2455
|
]);
|
|
2279
|
-
const handleBlur =
|
|
2456
|
+
const handleBlur = useCallback7((event) => {
|
|
2280
2457
|
setFocused(false);
|
|
2281
2458
|
onBlur?.(event);
|
|
2282
2459
|
}, [
|
|
2283
2460
|
onBlur
|
|
2284
2461
|
]);
|
|
2285
2462
|
const isCurrent = current ?? focused;
|
|
2286
|
-
const { className, ...rest } =
|
|
2463
|
+
const { className, ...rest } = composableProps9(props);
|
|
2287
2464
|
return /* @__PURE__ */ React26.createElement(Comp, {
|
|
2288
2465
|
...rest,
|
|
2289
2466
|
tabIndex: 0,
|
|
@@ -2373,11 +2550,11 @@ var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity
|
|
|
2373
2550
|
ref: forwardedRef
|
|
2374
2551
|
});
|
|
2375
2552
|
});
|
|
2376
|
-
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density:
|
|
2553
|
+
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
2377
2554
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2378
2555
|
const { tx } = useThemeContext();
|
|
2379
|
-
const density = useDensityContext(
|
|
2380
|
-
const elevation = useElevationContext(
|
|
2556
|
+
const density = useDensityContext(densityProp);
|
|
2557
|
+
const elevation = useElevationContext(elevationProp);
|
|
2381
2558
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2382
2559
|
return /* @__PURE__ */ React27.createElement(TextInputPrimitive, {
|
|
2383
2560
|
...props,
|
|
@@ -2484,11 +2661,11 @@ var Input = {
|
|
|
2484
2661
|
};
|
|
2485
2662
|
|
|
2486
2663
|
// src/components/List/List.tsx
|
|
2487
|
-
import { Primitive as
|
|
2488
|
-
import { Slot as
|
|
2664
|
+
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
2665
|
+
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
2489
2666
|
import React29, { forwardRef as forwardRef17 } from "react";
|
|
2490
2667
|
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";
|
|
2491
|
-
import { composable as composable4, composableProps as
|
|
2668
|
+
import { composable as composable4, composableProps as composableProps10 } from "@dxos/ui-theme";
|
|
2492
2669
|
|
|
2493
2670
|
// src/components/List/ListDropIndicator.tsx
|
|
2494
2671
|
import React28 from "react";
|
|
@@ -2514,7 +2691,6 @@ var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
|
2514
2691
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2515
2692
|
const orientation = edgeToOrientationMap[edge];
|
|
2516
2693
|
return /* @__PURE__ */ React28.createElement("div", {
|
|
2517
|
-
role: "none",
|
|
2518
2694
|
style: {
|
|
2519
2695
|
"--line-thickness": `${strokeSize}px`,
|
|
2520
2696
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2532,7 +2708,7 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
2532
2708
|
var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
2533
2709
|
const { tx } = useThemeContext();
|
|
2534
2710
|
const density = useDensityContext(props.density);
|
|
2535
|
-
const { className, ...rest } =
|
|
2711
|
+
const { className, ...rest } = composableProps10(props);
|
|
2536
2712
|
return /* @__PURE__ */ React29.createElement(DensityProvider, {
|
|
2537
2713
|
density
|
|
2538
2714
|
}, /* @__PURE__ */ React29.createElement(ListPrimitive, {
|
|
@@ -2542,7 +2718,7 @@ var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
|
2542
2718
|
}, children));
|
|
2543
2719
|
});
|
|
2544
2720
|
var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2545
|
-
const Comp = asChild ?
|
|
2721
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2546
2722
|
const density = useDensityContext();
|
|
2547
2723
|
const { tx } = useThemeContext();
|
|
2548
2724
|
return /* @__PURE__ */ React29.createElement(Comp, {
|
|
@@ -2560,7 +2736,6 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
2560
2736
|
const density = useDensityContext();
|
|
2561
2737
|
const { tx } = useThemeContext();
|
|
2562
2738
|
return /* @__PURE__ */ React29.createElement("div", {
|
|
2563
|
-
role: "none",
|
|
2564
2739
|
...props,
|
|
2565
2740
|
className: tx("list.item.openTrigger", {
|
|
2566
2741
|
density
|
|
@@ -2706,11 +2881,11 @@ var TreeItem = {
|
|
|
2706
2881
|
// src/components/List/Treegrid.tsx
|
|
2707
2882
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2708
2883
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2709
|
-
import { Primitive as
|
|
2710
|
-
import { Slot as
|
|
2884
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2885
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2711
2886
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2712
|
-
import React32, { forwardRef as forwardRef19, useCallback as
|
|
2713
|
-
import { composable as composable5, composableProps as
|
|
2887
|
+
import React32, { forwardRef as forwardRef19, useCallback as useCallback8 } from "react";
|
|
2888
|
+
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2714
2889
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2715
2890
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2716
2891
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
@@ -2718,12 +2893,12 @@ var TREEGRID_PATH_SEPARATOR = "~";
|
|
|
2718
2893
|
var TREEGRID_PARENT_OF_SEPARATOR = " ";
|
|
2719
2894
|
var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {
|
|
2720
2895
|
const { tx } = useThemeContext();
|
|
2721
|
-
const { className, role: _role, ...rest } =
|
|
2896
|
+
const { className, role: _role, ...rest } = composableProps11(props, {
|
|
2722
2897
|
classNames
|
|
2723
2898
|
});
|
|
2724
|
-
const Comp = asChild ?
|
|
2899
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2725
2900
|
const { findFirstFocusable } = useFocusFinders();
|
|
2726
|
-
const handleKeyDown =
|
|
2901
|
+
const handleKeyDown = useCallback8((event) => {
|
|
2727
2902
|
switch (event.key) {
|
|
2728
2903
|
case "ArrowDown":
|
|
2729
2904
|
case "ArrowUp": {
|
|
@@ -2771,7 +2946,7 @@ var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemp
|
|
|
2771
2946
|
});
|
|
2772
2947
|
var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2773
2948
|
const { tx } = useThemeContext();
|
|
2774
|
-
const Comp = asChild ?
|
|
2949
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2775
2950
|
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
2776
2951
|
const level = pathParts.length - 1;
|
|
2777
2952
|
const [open, onOpenChange] = useControllableState3({
|
|
@@ -2817,19 +2992,19 @@ var Treegrid = {
|
|
|
2817
2992
|
|
|
2818
2993
|
// src/components/Main/Main.tsx
|
|
2819
2994
|
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
2820
|
-
import { createContext as
|
|
2995
|
+
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
2821
2996
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2822
|
-
import { Primitive as
|
|
2823
|
-
import { Slot as
|
|
2997
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
2998
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2824
2999
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2825
|
-
import React33, { forwardRef as forwardRef20, useCallback as
|
|
3000
|
+
import React33, { forwardRef as forwardRef20, useCallback as useCallback10, useEffect as useEffect6, useRef as useRef4, useState as useState9 } from "react";
|
|
2826
3001
|
import { addEventListener } from "@dxos/async";
|
|
2827
3002
|
import { log } from "@dxos/log";
|
|
2828
3003
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2829
3004
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
2830
3005
|
|
|
2831
3006
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2832
|
-
import { useCallback as
|
|
3007
|
+
import { useCallback as useCallback9, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2833
3008
|
var useSwipeToDismiss = (ref, {
|
|
2834
3009
|
onDismiss,
|
|
2835
3010
|
dismissThreshold = 64,
|
|
@@ -2838,22 +3013,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2838
3013
|
/* side = 'inline-start' */
|
|
2839
3014
|
}) => {
|
|
2840
3015
|
const $root = ref.current;
|
|
2841
|
-
const [motionState, setMotionState] =
|
|
2842
|
-
const [gestureStartX, setGestureStartX] =
|
|
2843
|
-
const setIdle =
|
|
3016
|
+
const [motionState, setMotionState] = useState8(0);
|
|
3017
|
+
const [gestureStartX, setGestureStartX] = useState8(0);
|
|
3018
|
+
const setIdle = useCallback9(() => {
|
|
2844
3019
|
setMotionState(0);
|
|
2845
3020
|
$root?.style.removeProperty("inset-inline-start");
|
|
2846
3021
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2847
3022
|
}, [
|
|
2848
3023
|
$root
|
|
2849
3024
|
]);
|
|
2850
|
-
const setFollowing =
|
|
3025
|
+
const setFollowing = useCallback9(() => {
|
|
2851
3026
|
setMotionState(2);
|
|
2852
3027
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2853
3028
|
}, [
|
|
2854
3029
|
$root
|
|
2855
3030
|
]);
|
|
2856
|
-
const handlePointerDown =
|
|
3031
|
+
const handlePointerDown = useCallback9(({ screenX }) => {
|
|
2857
3032
|
if (motionState === 0) {
|
|
2858
3033
|
setMotionState(1);
|
|
2859
3034
|
setGestureStartX(screenX);
|
|
@@ -2861,7 +3036,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2861
3036
|
}, [
|
|
2862
3037
|
motionState
|
|
2863
3038
|
]);
|
|
2864
|
-
const handlePointerMove =
|
|
3039
|
+
const handlePointerMove = useCallback9(({ screenX }) => {
|
|
2865
3040
|
if ($root) {
|
|
2866
3041
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2867
3042
|
switch (motionState) {
|
|
@@ -2885,12 +3060,12 @@ var useSwipeToDismiss = (ref, {
|
|
|
2885
3060
|
motionState,
|
|
2886
3061
|
gestureStartX
|
|
2887
3062
|
]);
|
|
2888
|
-
const handlePointerUp =
|
|
3063
|
+
const handlePointerUp = useCallback9(() => {
|
|
2889
3064
|
setIdle();
|
|
2890
3065
|
}, [
|
|
2891
3066
|
setIdle
|
|
2892
3067
|
]);
|
|
2893
|
-
|
|
3068
|
+
useEffect5(() => {
|
|
2894
3069
|
$root?.addEventListener("pointerdown", handlePointerDown);
|
|
2895
3070
|
return () => {
|
|
2896
3071
|
$root?.removeEventListener("pointerdown", handlePointerDown);
|
|
@@ -2899,7 +3074,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2899
3074
|
$root,
|
|
2900
3075
|
handlePointerDown
|
|
2901
3076
|
]);
|
|
2902
|
-
|
|
3077
|
+
useEffect5(() => {
|
|
2903
3078
|
$root && document.documentElement.addEventListener("pointermove", handlePointerMove);
|
|
2904
3079
|
return () => {
|
|
2905
3080
|
document.documentElement.removeEventListener("pointermove", handlePointerMove);
|
|
@@ -2908,7 +3083,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2908
3083
|
$root,
|
|
2909
3084
|
handlePointerMove
|
|
2910
3085
|
]);
|
|
2911
|
-
|
|
3086
|
+
useEffect5(() => {
|
|
2912
3087
|
$root && document.documentElement.addEventListener("pointerup", handlePointerUp);
|
|
2913
3088
|
return () => {
|
|
2914
3089
|
document.documentElement.removeEventListener("pointerup", handlePointerUp);
|
|
@@ -2931,7 +3106,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2931
3106
|
};
|
|
2932
3107
|
var landmarkAttr = "data-main-landmark";
|
|
2933
3108
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2934
|
-
const handleKeyDown =
|
|
3109
|
+
const handleKeyDown = useCallback10((event) => {
|
|
2935
3110
|
const target = event.target;
|
|
2936
3111
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2937
3112
|
event.preventDefault();
|
|
@@ -2958,25 +3133,15 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2958
3133
|
...focusableGroupAttrs
|
|
2959
3134
|
};
|
|
2960
3135
|
};
|
|
2961
|
-
var [MainProvider, useMainContext] =
|
|
3136
|
+
var [MainProvider, useMainContext] = createContext9(MAIN_NAME, {
|
|
2962
3137
|
resizing: false,
|
|
2963
3138
|
navigationSidebarState: "closed",
|
|
2964
3139
|
setNavigationSidebarState: (_nextState) => {
|
|
2965
|
-
log.warn("Not initialized", void 0, {
|
|
2966
|
-
F: __dxlog_file,
|
|
2967
|
-
L: 110,
|
|
2968
|
-
S: void 0,
|
|
2969
|
-
C: (f, a) => f(...a)
|
|
2970
|
-
});
|
|
3140
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2971
3141
|
},
|
|
2972
3142
|
complementarySidebarState: "closed",
|
|
2973
3143
|
setComplementarySidebarState: (_nextState) => {
|
|
2974
|
-
log.warn("Not initialized", void 0, {
|
|
2975
|
-
F: __dxlog_file,
|
|
2976
|
-
L: 115,
|
|
2977
|
-
S: void 0,
|
|
2978
|
-
C: (f, a) => f(...a)
|
|
2979
|
-
});
|
|
3144
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2980
3145
|
}
|
|
2981
3146
|
});
|
|
2982
3147
|
var useSidebars = (consumerName) => {
|
|
@@ -2984,22 +3149,22 @@ var useSidebars = (consumerName) => {
|
|
|
2984
3149
|
return {
|
|
2985
3150
|
navigationSidebarState,
|
|
2986
3151
|
setNavigationSidebarState,
|
|
2987
|
-
toggleNavigationSidebar:
|
|
3152
|
+
toggleNavigationSidebar: useCallback10(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2988
3153
|
navigationSidebarState,
|
|
2989
3154
|
setNavigationSidebarState
|
|
2990
3155
|
]),
|
|
2991
|
-
openNavigationSidebar:
|
|
2992
|
-
collapseNavigationSidebar:
|
|
2993
|
-
closeNavigationSidebar:
|
|
3156
|
+
openNavigationSidebar: useCallback10(() => setNavigationSidebarState("expanded"), []),
|
|
3157
|
+
collapseNavigationSidebar: useCallback10(() => setNavigationSidebarState("collapsed"), []),
|
|
3158
|
+
closeNavigationSidebar: useCallback10(() => setNavigationSidebarState("closed"), []),
|
|
2994
3159
|
complementarySidebarState,
|
|
2995
3160
|
setComplementarySidebarState,
|
|
2996
|
-
toggleComplementarySidebar:
|
|
3161
|
+
toggleComplementarySidebar: useCallback10(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2997
3162
|
complementarySidebarState,
|
|
2998
3163
|
setComplementarySidebarState
|
|
2999
3164
|
]),
|
|
3000
|
-
openComplementarySidebar:
|
|
3001
|
-
collapseComplementarySidebar:
|
|
3002
|
-
closeComplementarySidebar:
|
|
3165
|
+
openComplementarySidebar: useCallback10(() => setComplementarySidebarState("expanded"), []),
|
|
3166
|
+
collapseComplementarySidebar: useCallback10(() => setComplementarySidebarState("collapsed"), []),
|
|
3167
|
+
closeComplementarySidebar: useCallback10(() => setComplementarySidebarState("closed"), [])
|
|
3003
3168
|
};
|
|
3004
3169
|
};
|
|
3005
3170
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -3014,9 +3179,9 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
3014
3179
|
defaultProp: defaultComplementarySidebarState,
|
|
3015
3180
|
onChange: onComplementarySidebarStateChange
|
|
3016
3181
|
});
|
|
3017
|
-
const [resizing, setResizing] =
|
|
3182
|
+
const [resizing, setResizing] = useState9(false);
|
|
3018
3183
|
const resizeInterval = useRef4(null);
|
|
3019
|
-
|
|
3184
|
+
useEffect6(() => addEventListener(window, "resize", () => {
|
|
3020
3185
|
setResizing(true);
|
|
3021
3186
|
if (resizeInterval.current) {
|
|
3022
3187
|
clearTimeout(resizeInterval.current);
|
|
@@ -3066,7 +3231,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3066
3231
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
3067
3232
|
onDismiss: () => onStateChange?.("closed")
|
|
3068
3233
|
});
|
|
3069
|
-
const handleKeyDown =
|
|
3234
|
+
const handleKeyDown = useCallback10((event) => {
|
|
3070
3235
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
3071
3236
|
if (event.key === "Escape" && focusGroupParent) {
|
|
3072
3237
|
event.preventDefault();
|
|
@@ -3077,7 +3242,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToD
|
|
|
3077
3242
|
}, [
|
|
3078
3243
|
props.onKeyDown
|
|
3079
3244
|
]);
|
|
3080
|
-
const Root14 = isLg ?
|
|
3245
|
+
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
3081
3246
|
return /* @__PURE__ */ React33.createElement(DialogRoot2, {
|
|
3082
3247
|
open: state !== "closed",
|
|
3083
3248
|
"aria-label": toLocalizedString(label, t),
|
|
@@ -3133,7 +3298,7 @@ MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
|
3133
3298
|
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
3134
3299
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
3135
3300
|
const { tx } = useThemeContext();
|
|
3136
|
-
const Comp = asChild ?
|
|
3301
|
+
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
3137
3302
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
3138
3303
|
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
3139
3304
|
...handlesFocus && {
|
|
@@ -3160,12 +3325,77 @@ var Main = {
|
|
|
3160
3325
|
ComplementarySidebar: MainComplementarySidebar
|
|
3161
3326
|
};
|
|
3162
3327
|
|
|
3328
|
+
// src/components/MediaPlayer/MediaPlayer.tsx
|
|
3329
|
+
import React34 from "react";
|
|
3330
|
+
import { mx as mx10 } from "@dxos/ui-theme";
|
|
3331
|
+
var VIDEO_EXTENSIONS = [
|
|
3332
|
+
".mp4",
|
|
3333
|
+
".webm",
|
|
3334
|
+
".ogv",
|
|
3335
|
+
".mov",
|
|
3336
|
+
".m4v"
|
|
3337
|
+
];
|
|
3338
|
+
var AUDIO_EXTENSIONS = [
|
|
3339
|
+
".mp3",
|
|
3340
|
+
".wav",
|
|
3341
|
+
".ogg",
|
|
3342
|
+
".m4a",
|
|
3343
|
+
".aac",
|
|
3344
|
+
".flac"
|
|
3345
|
+
];
|
|
3346
|
+
var detectMediaKind = (src) => {
|
|
3347
|
+
const pathname = src.split(/[?#]/, 1)[0];
|
|
3348
|
+
const lower = pathname.toLowerCase();
|
|
3349
|
+
if (VIDEO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
3350
|
+
return "video";
|
|
3351
|
+
}
|
|
3352
|
+
if (AUDIO_EXTENSIONS.some((extension) => lower.endsWith(extension))) {
|
|
3353
|
+
return "audio";
|
|
3354
|
+
}
|
|
3355
|
+
return void 0;
|
|
3356
|
+
};
|
|
3357
|
+
var MediaPlayer = ({ classNames, src, kind, controls = true, autoPlay = false, loop = false, muted = false, alt, crossOrigin = "anonymous" }) => {
|
|
3358
|
+
const resolved = kind ?? detectMediaKind(src) ?? "video";
|
|
3359
|
+
if (resolved === "audio") {
|
|
3360
|
+
return (
|
|
3361
|
+
// TODO(burdon): Move to ui-theme.
|
|
3362
|
+
/* @__PURE__ */ React34.createElement("audio", {
|
|
3363
|
+
className: mx10("w-full", classNames),
|
|
3364
|
+
src,
|
|
3365
|
+
controls,
|
|
3366
|
+
autoPlay,
|
|
3367
|
+
loop,
|
|
3368
|
+
muted,
|
|
3369
|
+
crossOrigin,
|
|
3370
|
+
"aria-label": alt
|
|
3371
|
+
})
|
|
3372
|
+
);
|
|
3373
|
+
}
|
|
3374
|
+
return (
|
|
3375
|
+
// TODO(burdon): Move to ui-theme.
|
|
3376
|
+
/* @__PURE__ */ React34.createElement("div", {
|
|
3377
|
+
className: mx10("dx-container flex items-center justify-center", classNames)
|
|
3378
|
+
}, /* @__PURE__ */ React34.createElement("video", {
|
|
3379
|
+
className: "aspect-video max-w-full max-h-full",
|
|
3380
|
+
src,
|
|
3381
|
+
controls,
|
|
3382
|
+
autoPlay,
|
|
3383
|
+
loop,
|
|
3384
|
+
muted,
|
|
3385
|
+
crossOrigin,
|
|
3386
|
+
"aria-label": alt
|
|
3387
|
+
}))
|
|
3388
|
+
);
|
|
3389
|
+
};
|
|
3390
|
+
|
|
3163
3391
|
// src/components/Message/Message.tsx
|
|
3164
|
-
import { createContext as
|
|
3165
|
-
import { Primitive as
|
|
3166
|
-
import { Slot as
|
|
3167
|
-
import
|
|
3392
|
+
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3393
|
+
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3394
|
+
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3395
|
+
import React35, { forwardRef as forwardRef21 } from "react";
|
|
3396
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
3168
3397
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3398
|
+
import { translationKey as translationKey3 } from "#translations";
|
|
3169
3399
|
var messageIcons = {
|
|
3170
3400
|
success: "ph--check-circle--duotone",
|
|
3171
3401
|
info: "ph--info--duotone",
|
|
@@ -3174,18 +3404,18 @@ var messageIcons = {
|
|
|
3174
3404
|
neutral: "ph--info--duotone"
|
|
3175
3405
|
};
|
|
3176
3406
|
var MESSAGE_NAME = "Message";
|
|
3177
|
-
var [MessageProvider, useMessageContext] =
|
|
3407
|
+
var [MessageProvider, useMessageContext] = createContext10(MESSAGE_NAME);
|
|
3178
3408
|
var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3179
3409
|
const { tx } = useThemeContext();
|
|
3180
3410
|
const titleId = useId3("message__title", propsTitleId);
|
|
3181
3411
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3182
3412
|
const elevation = useElevationContext(propsElevation);
|
|
3183
|
-
const Comp = asChild ?
|
|
3184
|
-
return /* @__PURE__ */
|
|
3413
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3414
|
+
return /* @__PURE__ */ React35.createElement(MessageProvider, {
|
|
3185
3415
|
titleId,
|
|
3186
3416
|
descriptionId,
|
|
3187
3417
|
valence
|
|
3188
|
-
}, /* @__PURE__ */
|
|
3418
|
+
}, /* @__PURE__ */ React35.createElement(Comp, {
|
|
3189
3419
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3190
3420
|
...props,
|
|
3191
3421
|
className: tx("message.root", {
|
|
@@ -3199,32 +3429,38 @@ var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral",
|
|
|
3199
3429
|
});
|
|
3200
3430
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3201
3431
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3202
|
-
var MessageTitle = /* @__PURE__ */ forwardRef21(({
|
|
3432
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3433
|
+
const { t } = useTranslation4(translationKey3);
|
|
3203
3434
|
const { tx } = useThemeContext();
|
|
3204
3435
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3205
|
-
const Comp = asChild ? Slot17 : Primitive17.h2;
|
|
3206
3436
|
const icon = iconProp ?? messageIcons[valence];
|
|
3207
|
-
return /* @__PURE__ */
|
|
3208
|
-
...props,
|
|
3437
|
+
return /* @__PURE__ */ React35.createElement("div", {
|
|
3209
3438
|
className: tx("message.header", {}, classNames),
|
|
3210
3439
|
id: titleId,
|
|
3211
3440
|
ref: forwardedRef
|
|
3212
|
-
},
|
|
3213
|
-
icon,
|
|
3214
|
-
classNames: tx("message.icon", {
|
|
3441
|
+
}, icon && /* @__PURE__ */ React35.createElement("div", {
|
|
3442
|
+
className: tx("message.icon", {
|
|
3215
3443
|
valence
|
|
3216
3444
|
})
|
|
3217
|
-
}
|
|
3445
|
+
}, /* @__PURE__ */ React35.createElement(Icon, {
|
|
3446
|
+
icon
|
|
3447
|
+
})), /* @__PURE__ */ React35.createElement("h2", {
|
|
3218
3448
|
className: tx("message.title", {}, classNames)
|
|
3219
|
-
}, children)
|
|
3449
|
+
}, children), onClose && /* @__PURE__ */ React35.createElement(IconButton, {
|
|
3450
|
+
variant: "ghost",
|
|
3451
|
+
icon: "ph--x--regular",
|
|
3452
|
+
iconOnly: true,
|
|
3453
|
+
label: t("toolbar-close.label"),
|
|
3454
|
+
onClick: onClose
|
|
3455
|
+
}));
|
|
3220
3456
|
});
|
|
3221
3457
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3222
3458
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
3223
3459
|
var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3224
3460
|
const { tx } = useThemeContext();
|
|
3225
3461
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3226
|
-
const Comp = asChild ?
|
|
3227
|
-
return /* @__PURE__ */
|
|
3462
|
+
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3463
|
+
return /* @__PURE__ */ React35.createElement(Comp, {
|
|
3228
3464
|
...props,
|
|
3229
3465
|
className: tx("message.content", {}, classNames),
|
|
3230
3466
|
id: descriptionId,
|
|
@@ -3251,11 +3487,11 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
3251
3487
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
3252
3488
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
3253
3489
|
import { Presence } from "@radix-ui/react-presence";
|
|
3254
|
-
import { Primitive as
|
|
3255
|
-
import { Slot as
|
|
3490
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
3491
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3256
3492
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3257
3493
|
import { hideOthers } from "aria-hidden";
|
|
3258
|
-
import
|
|
3494
|
+
import React36, { forwardRef as forwardRef22, useCallback as useCallback11, useEffect as useEffect7, useMemo as useMemo7, useRef as useRef5, useState as useState10 } from "react";
|
|
3259
3495
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3260
3496
|
var POPOVER_NAME = "Popover";
|
|
3261
3497
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3267,24 +3503,24 @@ var PopoverRoot = (props) => {
|
|
|
3267
3503
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3268
3504
|
const popperScope = usePopperScope(__scopePopover);
|
|
3269
3505
|
const triggerRef = useRef5(null);
|
|
3270
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3506
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState10(false);
|
|
3271
3507
|
const [open = false, setOpen] = useControllableState5({
|
|
3272
3508
|
prop: openProp,
|
|
3273
3509
|
defaultProp: defaultOpen,
|
|
3274
3510
|
onChange: onOpenChange
|
|
3275
3511
|
});
|
|
3276
|
-
return /* @__PURE__ */
|
|
3512
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React36.createElement(PopoverProvider, {
|
|
3277
3513
|
scope: __scopePopover,
|
|
3278
3514
|
contentId: useId4(),
|
|
3279
3515
|
triggerRef,
|
|
3280
3516
|
open,
|
|
3281
3517
|
onOpenChange: setOpen,
|
|
3282
|
-
onOpenToggle:
|
|
3518
|
+
onOpenToggle: useCallback11(() => setOpen((prevOpen) => !prevOpen), [
|
|
3283
3519
|
setOpen
|
|
3284
3520
|
]),
|
|
3285
3521
|
hasCustomAnchor,
|
|
3286
|
-
onCustomAnchorAdd:
|
|
3287
|
-
onCustomAnchorRemove:
|
|
3522
|
+
onCustomAnchorAdd: useCallback11(() => setHasCustomAnchor(true), []),
|
|
3523
|
+
onCustomAnchorRemove: useCallback11(() => setHasCustomAnchor(false), []),
|
|
3288
3524
|
modal
|
|
3289
3525
|
}, children));
|
|
3290
3526
|
};
|
|
@@ -3295,14 +3531,14 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3295
3531
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3296
3532
|
const popperScope = usePopperScope(__scopePopover);
|
|
3297
3533
|
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
3298
|
-
|
|
3534
|
+
useEffect7(() => {
|
|
3299
3535
|
onCustomAnchorAdd();
|
|
3300
3536
|
return () => onCustomAnchorRemove();
|
|
3301
3537
|
}, [
|
|
3302
3538
|
onCustomAnchorAdd,
|
|
3303
3539
|
onCustomAnchorRemove
|
|
3304
3540
|
]);
|
|
3305
|
-
return /* @__PURE__ */
|
|
3541
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3306
3542
|
...popperScope,
|
|
3307
3543
|
...anchorProps,
|
|
3308
3544
|
ref: forwardedRef
|
|
@@ -3315,8 +3551,8 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3315
3551
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
3316
3552
|
const popperScope = usePopperScope(__scopePopover);
|
|
3317
3553
|
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3318
|
-
const Comp = asChild ?
|
|
3319
|
-
const trigger = /* @__PURE__ */
|
|
3554
|
+
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3555
|
+
const trigger = /* @__PURE__ */ React36.createElement(Comp, {
|
|
3320
3556
|
type: "button",
|
|
3321
3557
|
"aria-haspopup": "dialog",
|
|
3322
3558
|
"aria-expanded": context.open,
|
|
@@ -3326,7 +3562,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3326
3562
|
ref: composedTriggerRef,
|
|
3327
3563
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
3328
3564
|
});
|
|
3329
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
3565
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3330
3566
|
asChild: true,
|
|
3331
3567
|
...popperScope
|
|
3332
3568
|
}, trigger);
|
|
@@ -3337,12 +3573,12 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3337
3573
|
const { __scopePopover, virtualRef } = props;
|
|
3338
3574
|
const context = usePopoverContext(VIRTUAL_TRIGGER_NAME2, __scopePopover);
|
|
3339
3575
|
const popperScope = usePopperScope(__scopePopover);
|
|
3340
|
-
|
|
3576
|
+
useEffect7(() => {
|
|
3341
3577
|
if (virtualRef.current) {
|
|
3342
3578
|
context.triggerRef.current = virtualRef.current;
|
|
3343
3579
|
}
|
|
3344
3580
|
});
|
|
3345
|
-
return /* @__PURE__ */
|
|
3581
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Anchor, {
|
|
3346
3582
|
...popperScope,
|
|
3347
3583
|
virtualRef
|
|
3348
3584
|
});
|
|
@@ -3355,12 +3591,12 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
3355
3591
|
var PopoverPortal = (props) => {
|
|
3356
3592
|
const { __scopePopover, forceMount, children, container } = props;
|
|
3357
3593
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
3358
|
-
return /* @__PURE__ */
|
|
3594
|
+
return /* @__PURE__ */ React36.createElement(PortalProvider, {
|
|
3359
3595
|
scope: __scopePopover,
|
|
3360
3596
|
forceMount
|
|
3361
|
-
}, /* @__PURE__ */
|
|
3597
|
+
}, /* @__PURE__ */ React36.createElement(Presence, {
|
|
3362
3598
|
present: forceMount || context.open
|
|
3363
|
-
}, /* @__PURE__ */
|
|
3599
|
+
}, /* @__PURE__ */ React36.createElement(PortalPrimitive, {
|
|
3364
3600
|
asChild: true,
|
|
3365
3601
|
container
|
|
3366
3602
|
}, children)));
|
|
@@ -3371,12 +3607,12 @@ var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3371
3607
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
3372
3608
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3373
3609
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3374
|
-
return /* @__PURE__ */
|
|
3610
|
+
return /* @__PURE__ */ React36.createElement(Presence, {
|
|
3375
3611
|
present: forceMount || context.open
|
|
3376
|
-
}, context.modal ? /* @__PURE__ */
|
|
3612
|
+
}, context.modal ? /* @__PURE__ */ React36.createElement(PopoverContentModal, {
|
|
3377
3613
|
...contentProps,
|
|
3378
3614
|
ref: forwardedRef
|
|
3379
|
-
}) : /* @__PURE__ */
|
|
3615
|
+
}) : /* @__PURE__ */ React36.createElement(PopoverContentNonModal, {
|
|
3380
3616
|
...contentProps,
|
|
3381
3617
|
ref: forwardedRef
|
|
3382
3618
|
}));
|
|
@@ -3387,16 +3623,16 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) =>
|
|
|
3387
3623
|
const contentRef = useRef5(null);
|
|
3388
3624
|
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3389
3625
|
const isRightClickOutsideRef = useRef5(false);
|
|
3390
|
-
|
|
3626
|
+
useEffect7(() => {
|
|
3391
3627
|
const content = contentRef.current;
|
|
3392
3628
|
if (content) {
|
|
3393
3629
|
return hideOthers(content);
|
|
3394
3630
|
}
|
|
3395
3631
|
}, []);
|
|
3396
|
-
return /* @__PURE__ */
|
|
3397
|
-
as:
|
|
3632
|
+
return /* @__PURE__ */ React36.createElement(RemoveScroll, {
|
|
3633
|
+
as: Slot19,
|
|
3398
3634
|
allowPinchZoom: true
|
|
3399
|
-
}, /* @__PURE__ */
|
|
3635
|
+
}, /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3400
3636
|
...props,
|
|
3401
3637
|
ref: composedRefs,
|
|
3402
3638
|
// Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).
|
|
@@ -3427,7 +3663,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef)
|
|
|
3427
3663
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3428
3664
|
const hasInteractedOutsideRef = useRef5(false);
|
|
3429
3665
|
const hasPointerDownOutsideRef = useRef5(false);
|
|
3430
|
-
return /* @__PURE__ */
|
|
3666
|
+
return /* @__PURE__ */ React36.createElement(PopoverContentImpl, {
|
|
3431
3667
|
...props,
|
|
3432
3668
|
ref: forwardedRef,
|
|
3433
3669
|
trapFocus: false,
|
|
@@ -3470,7 +3706,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3470
3706
|
const elevation = useElevationContext();
|
|
3471
3707
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3472
3708
|
useFocusGuards();
|
|
3473
|
-
const computedCollisionBoundary =
|
|
3709
|
+
const computedCollisionBoundary = useMemo7(() => {
|
|
3474
3710
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3475
3711
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3476
3712
|
closestBoundary,
|
|
@@ -3486,13 +3722,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3486
3722
|
collisionBoundary,
|
|
3487
3723
|
context.triggerRef.current
|
|
3488
3724
|
]);
|
|
3489
|
-
return /* @__PURE__ */
|
|
3725
|
+
return /* @__PURE__ */ React36.createElement(FocusScope, {
|
|
3490
3726
|
asChild: true,
|
|
3491
3727
|
loop: true,
|
|
3492
3728
|
trapped: trapFocus,
|
|
3493
3729
|
onMountAutoFocus: onOpenAutoFocus,
|
|
3494
3730
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
3495
|
-
}, /* @__PURE__ */
|
|
3731
|
+
}, /* @__PURE__ */ React36.createElement(DismissableLayer, {
|
|
3496
3732
|
asChild: true,
|
|
3497
3733
|
disableOutsidePointerEvents,
|
|
3498
3734
|
onInteractOutside,
|
|
@@ -3500,7 +3736,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3500
3736
|
onPointerDownOutside,
|
|
3501
3737
|
onFocusOutside,
|
|
3502
3738
|
onDismiss: () => context.onOpenChange(false)
|
|
3503
|
-
}, /* @__PURE__ */
|
|
3739
|
+
}, /* @__PURE__ */ React36.createElement(PopperPrimitive.Content, {
|
|
3504
3740
|
"data-state": getState(context.open),
|
|
3505
3741
|
role: "dialog",
|
|
3506
3742
|
id: context.contentId,
|
|
@@ -3529,7 +3765,7 @@ var CLOSE_NAME = "PopoverClose";
|
|
|
3529
3765
|
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3530
3766
|
const { __scopePopover, ...closeProps } = props;
|
|
3531
3767
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3532
|
-
return /* @__PURE__ */
|
|
3768
|
+
return /* @__PURE__ */ React36.createElement(Primitive19.button, {
|
|
3533
3769
|
type: "button",
|
|
3534
3770
|
...closeProps,
|
|
3535
3771
|
ref: forwardedRef,
|
|
@@ -3542,7 +3778,7 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3542
3778
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3543
3779
|
const popperScope = usePopperScope(__scopePopover);
|
|
3544
3780
|
const { tx } = useThemeContext();
|
|
3545
|
-
return /* @__PURE__ */
|
|
3781
|
+
return /* @__PURE__ */ React36.createElement(PopperPrimitive.Arrow, {
|
|
3546
3782
|
...popperScope,
|
|
3547
3783
|
...arrowProps,
|
|
3548
3784
|
className: tx("popover.arrow", {}, classNames),
|
|
@@ -3552,8 +3788,8 @@ var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
|
3552
3788
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
3553
3789
|
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3554
3790
|
const { tx } = useThemeContext();
|
|
3555
|
-
const Comp = asChild ?
|
|
3556
|
-
return /* @__PURE__ */
|
|
3791
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3792
|
+
return /* @__PURE__ */ React36.createElement(Comp, {
|
|
3557
3793
|
...props,
|
|
3558
3794
|
className: tx("popover.viewport", {
|
|
3559
3795
|
constrainInline,
|
|
@@ -3576,10 +3812,10 @@ var Popover = {
|
|
|
3576
3812
|
};
|
|
3577
3813
|
|
|
3578
3814
|
// src/components/Status/Status.tsx
|
|
3579
|
-
import
|
|
3815
|
+
import React37, { forwardRef as forwardRef23 } from "react";
|
|
3580
3816
|
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3581
3817
|
const { tx } = useThemeContext();
|
|
3582
|
-
return /* @__PURE__ */
|
|
3818
|
+
return /* @__PURE__ */ React37.createElement("span", {
|
|
3583
3819
|
role: "status",
|
|
3584
3820
|
...props,
|
|
3585
3821
|
className: tx("status.root", {
|
|
@@ -3587,7 +3823,7 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3587
3823
|
variant
|
|
3588
3824
|
}, classNames),
|
|
3589
3825
|
ref: forwardedRef
|
|
3590
|
-
}, /* @__PURE__ */
|
|
3826
|
+
}, /* @__PURE__ */ React37.createElement("span", {
|
|
3591
3827
|
role: "none",
|
|
3592
3828
|
className: tx("status.bar", {
|
|
3593
3829
|
indeterminate,
|
|
@@ -3602,19 +3838,19 @@ var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0,
|
|
|
3602
3838
|
});
|
|
3603
3839
|
|
|
3604
3840
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3605
|
-
import { createContext as
|
|
3606
|
-
import { Primitive as
|
|
3607
|
-
import { Slot as
|
|
3608
|
-
import
|
|
3609
|
-
import { composableProps as
|
|
3841
|
+
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3842
|
+
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3843
|
+
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3844
|
+
import React38, { useMemo as useMemo8 } from "react";
|
|
3845
|
+
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3610
3846
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3611
|
-
var [ScrollAreaProvider, useScrollAreaContext] =
|
|
3847
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createContext11(SCROLLAREA_NAME);
|
|
3612
3848
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3613
3849
|
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3614
3850
|
const { tx } = useThemeContext();
|
|
3615
|
-
const { className, ...rest } =
|
|
3616
|
-
const Comp = asChild ?
|
|
3617
|
-
const options =
|
|
3851
|
+
const { className, ...rest } = composableProps12(props);
|
|
3852
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3853
|
+
const options = useMemo8(() => ({
|
|
3618
3854
|
orientation,
|
|
3619
3855
|
autoHide,
|
|
3620
3856
|
centered,
|
|
@@ -3629,7 +3865,7 @@ var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical",
|
|
|
3629
3865
|
thin,
|
|
3630
3866
|
snap
|
|
3631
3867
|
]);
|
|
3632
|
-
return /* @__PURE__ */
|
|
3868
|
+
return /* @__PURE__ */ React38.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React38.createElement(Comp, {
|
|
3633
3869
|
...rest,
|
|
3634
3870
|
className: tx("scrollArea.root", options, className),
|
|
3635
3871
|
ref: forwardedRef
|
|
@@ -3641,10 +3877,10 @@ var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedR
|
|
|
3641
3877
|
const { tx } = useThemeContext();
|
|
3642
3878
|
const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);
|
|
3643
3879
|
const density = options.thin ? scrollbar.thin : scrollbar.coarse;
|
|
3644
|
-
const { className, ...rest } =
|
|
3880
|
+
const { className, ...rest } = composableProps12(props);
|
|
3645
3881
|
const { style, ...restWithoutStyle } = rest;
|
|
3646
|
-
const Comp = asChild ?
|
|
3647
|
-
return /* @__PURE__ */
|
|
3882
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3883
|
+
return /* @__PURE__ */ React38.createElement(Comp, {
|
|
3648
3884
|
...restWithoutStyle,
|
|
3649
3885
|
style: {
|
|
3650
3886
|
"--scroll-width": `${density.size}px`,
|
|
@@ -3662,25 +3898,25 @@ var ScrollArea = {
|
|
|
3662
3898
|
};
|
|
3663
3899
|
|
|
3664
3900
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3665
|
-
import { createContext as
|
|
3666
|
-
import
|
|
3901
|
+
import { createContext as createContext12 } from "@radix-ui/react-context";
|
|
3902
|
+
import React39, { forwardRef as forwardRef24, useCallback as useCallback12, useEffect as useEffect8, useImperativeHandle, useMemo as useMemo9, useRef as useRef6, useState as useState11 } from "react";
|
|
3667
3903
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3668
3904
|
import { invariant } from "@dxos/invariant";
|
|
3669
3905
|
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3670
|
-
import { composable as composable6, composableProps as
|
|
3671
|
-
import { mx as
|
|
3906
|
+
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3907
|
+
import { mx as mx11 } from "@dxos/ui-theme";
|
|
3672
3908
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3673
3909
|
var isBottom = (el) => {
|
|
3674
3910
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3675
3911
|
};
|
|
3676
|
-
var [ScrollContainerProvider, useScrollContainerContext] =
|
|
3912
|
+
var [ScrollContainerProvider, useScrollContainerContext] = createContext12("ScrollContainer");
|
|
3677
3913
|
var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorProp = "smooth" }, forwardedRef) => {
|
|
3678
3914
|
const scrollerRef = useRef6(null);
|
|
3679
3915
|
const autoScrollRef = useRef6(false);
|
|
3680
|
-
const [pinned, setPinned] =
|
|
3681
|
-
const [overflow, setOverflow] =
|
|
3916
|
+
const [pinned, setPinned] = useState11(pin);
|
|
3917
|
+
const [overflow, setOverflow] = useState11(false);
|
|
3682
3918
|
const timeoutRef = useRef6(void 0);
|
|
3683
|
-
const scrollToBottom =
|
|
3919
|
+
const scrollToBottom = useCallback12((behavior = behaviorProp) => {
|
|
3684
3920
|
if (scrollerRef.current) {
|
|
3685
3921
|
if (behavior !== "instant") {
|
|
3686
3922
|
autoScrollRef.current = true;
|
|
@@ -3700,20 +3936,12 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3700
3936
|
}, [
|
|
3701
3937
|
behaviorProp
|
|
3702
3938
|
]);
|
|
3703
|
-
const controller =
|
|
3939
|
+
const controller = useMemo9(() => ({
|
|
3704
3940
|
get viewport() {
|
|
3705
3941
|
return scrollerRef.current;
|
|
3706
3942
|
},
|
|
3707
3943
|
scrollToTop: () => {
|
|
3708
|
-
invariant(scrollerRef.current, void 0, {
|
|
3709
|
-
F: __dxlog_file2,
|
|
3710
|
-
L: 108,
|
|
3711
|
-
S: void 0,
|
|
3712
|
-
A: [
|
|
3713
|
-
"scrollerRef.current",
|
|
3714
|
-
""
|
|
3715
|
-
]
|
|
3716
|
-
});
|
|
3944
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3717
3945
|
scrollerRef.current.scrollTo({
|
|
3718
3946
|
top: 0,
|
|
3719
3947
|
behavior: "smooth"
|
|
@@ -3729,10 +3957,10 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3729
3957
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
3730
3958
|
controller
|
|
3731
3959
|
]);
|
|
3732
|
-
const setViewport =
|
|
3960
|
+
const setViewport = useCallback12((el) => {
|
|
3733
3961
|
scrollerRef.current = el;
|
|
3734
3962
|
}, []);
|
|
3735
|
-
return /* @__PURE__ */
|
|
3963
|
+
return /* @__PURE__ */ React39.createElement(ScrollContainerProvider, {
|
|
3736
3964
|
pinned,
|
|
3737
3965
|
overflow,
|
|
3738
3966
|
controller,
|
|
@@ -3743,8 +3971,8 @@ var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorPr
|
|
|
3743
3971
|
});
|
|
3744
3972
|
Root10.displayName = "ScrollContainer.Root";
|
|
3745
3973
|
var Content6 = composable6(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
3746
|
-
return /* @__PURE__ */
|
|
3747
|
-
...
|
|
3974
|
+
return /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3975
|
+
...composableProps13(props, {
|
|
3748
3976
|
classNames: "relative"
|
|
3749
3977
|
}),
|
|
3750
3978
|
thin,
|
|
@@ -3762,7 +3990,7 @@ var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
3762
3990
|
scrollerRef
|
|
3763
3991
|
]);
|
|
3764
3992
|
const { setViewport, setPinned, setOverflow } = useScrollContainerContext(VIEWPORT_NAME);
|
|
3765
|
-
|
|
3993
|
+
useEffect8(() => {
|
|
3766
3994
|
const el = scrollerRef.current;
|
|
3767
3995
|
if (!el) {
|
|
3768
3996
|
return;
|
|
@@ -3774,11 +4002,11 @@ var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
|
3774
4002
|
setPinned,
|
|
3775
4003
|
setOverflow
|
|
3776
4004
|
]);
|
|
3777
|
-
return /* @__PURE__ */
|
|
4005
|
+
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Viewport, {
|
|
3778
4006
|
asChild,
|
|
3779
|
-
...
|
|
4007
|
+
...composableProps13(props),
|
|
3780
4008
|
ref: mergedRef
|
|
3781
|
-
}, children), /* @__PURE__ */
|
|
4009
|
+
}, children), /* @__PURE__ */ React39.createElement(PinEffect, {
|
|
3782
4010
|
scrollerRef
|
|
3783
4011
|
}));
|
|
3784
4012
|
});
|
|
@@ -3786,7 +4014,7 @@ Viewport.displayName = VIEWPORT_NAME;
|
|
|
3786
4014
|
var PIN_EFFECT_NAME = "ScrollContainer.PinEffect";
|
|
3787
4015
|
var PinEffect = ({ scrollerRef }) => {
|
|
3788
4016
|
const { pinned, controller } = useScrollContainerContext(PIN_EFFECT_NAME);
|
|
3789
|
-
|
|
4017
|
+
useEffect8(() => {
|
|
3790
4018
|
const viewport = scrollerRef.current;
|
|
3791
4019
|
if (!pinned || !viewport) {
|
|
3792
4020
|
return;
|
|
@@ -3823,14 +4051,13 @@ var PinEffect = ({ scrollerRef }) => {
|
|
|
3823
4051
|
var FADE_NAME = "ScrollContainer.Fade";
|
|
3824
4052
|
var Fade = () => {
|
|
3825
4053
|
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
3826
|
-
return /* @__PURE__ */
|
|
3827
|
-
role: "none",
|
|
4054
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
3828
4055
|
"data-visible": overflow,
|
|
3829
|
-
className:
|
|
4056
|
+
className: mx11(
|
|
3830
4057
|
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
3831
4058
|
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
3832
4059
|
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
3833
|
-
"bg-gradient-to-b from-(--surface
|
|
4060
|
+
"bg-gradient-to-b from-(--color-base-surface) to-transparent pointer-events-none"
|
|
3834
4061
|
)
|
|
3835
4062
|
});
|
|
3836
4063
|
};
|
|
@@ -3838,10 +4065,9 @@ Fade.displayName = FADE_NAME;
|
|
|
3838
4065
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
3839
4066
|
var ScrollDownButton = ({ classNames }) => {
|
|
3840
4067
|
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
3841
|
-
return /* @__PURE__ */
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
}, /* @__PURE__ */ React38.createElement(IconButton, {
|
|
4068
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
4069
|
+
className: mx11("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
4070
|
+
}, /* @__PURE__ */ React39.createElement(IconButton, {
|
|
3845
4071
|
variant: "primary",
|
|
3846
4072
|
icon: "ph--arrow-down--regular",
|
|
3847
4073
|
iconOnly: true,
|
|
@@ -3861,23 +4087,23 @@ var ScrollContainer = {
|
|
|
3861
4087
|
|
|
3862
4088
|
// src/components/Select/Select.tsx
|
|
3863
4089
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3864
|
-
import
|
|
4090
|
+
import React40, { forwardRef as forwardRef25 } from "react";
|
|
3865
4091
|
var SelectRoot = SelectPrimitive.Root;
|
|
3866
4092
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3867
4093
|
var SelectValue = SelectPrimitive.Value;
|
|
3868
4094
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3869
4095
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3870
4096
|
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3871
|
-
return /* @__PURE__ */
|
|
4097
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Trigger, {
|
|
3872
4098
|
asChild: true,
|
|
3873
4099
|
ref: forwardedRef
|
|
3874
|
-
}, /* @__PURE__ */
|
|
4100
|
+
}, /* @__PURE__ */ React40.createElement(Button, props, /* @__PURE__ */ React40.createElement(SelectPrimitive.Value, {
|
|
3875
4101
|
placeholder
|
|
3876
|
-
}, children), /* @__PURE__ */
|
|
4102
|
+
}, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3877
4103
|
className: "w-1 flex-1"
|
|
3878
|
-
}), /* @__PURE__ */
|
|
4104
|
+
}), /* @__PURE__ */ React40.createElement(SelectPrimitive.Icon, {
|
|
3879
4105
|
asChild: true
|
|
3880
|
-
}, /* @__PURE__ */
|
|
4106
|
+
}, /* @__PURE__ */ React40.createElement(Icon, {
|
|
3881
4107
|
size: 3,
|
|
3882
4108
|
icon: "ph--caret-down--bold"
|
|
3883
4109
|
}))));
|
|
@@ -3886,7 +4112,7 @@ var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collis
|
|
|
3886
4112
|
const { tx } = useThemeContext();
|
|
3887
4113
|
const elevation = useElevationContext();
|
|
3888
4114
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3889
|
-
return /* @__PURE__ */
|
|
4115
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Content, {
|
|
3890
4116
|
...props,
|
|
3891
4117
|
"data-arrow-keys": "up down",
|
|
3892
4118
|
collisionPadding: safeCollisionPadding,
|
|
@@ -3899,29 +4125,29 @@ var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collis
|
|
|
3899
4125
|
});
|
|
3900
4126
|
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3901
4127
|
const { tx } = useThemeContext();
|
|
3902
|
-
return /* @__PURE__ */
|
|
4128
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3903
4129
|
...props,
|
|
3904
4130
|
className: tx("select.scrollButton", {}, classNames),
|
|
3905
4131
|
ref: forwardedRef
|
|
3906
|
-
}, children ?? /* @__PURE__ */
|
|
4132
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3907
4133
|
size: 3,
|
|
3908
4134
|
icon: "ph--caret-up--bold"
|
|
3909
4135
|
}));
|
|
3910
4136
|
});
|
|
3911
4137
|
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3912
4138
|
const { tx } = useThemeContext();
|
|
3913
|
-
return /* @__PURE__ */
|
|
4139
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3914
4140
|
...props,
|
|
3915
4141
|
className: tx("select.scrollButton", {}, classNames),
|
|
3916
4142
|
ref: forwardedRef
|
|
3917
|
-
}, children ?? /* @__PURE__ */
|
|
4143
|
+
}, children ?? /* @__PURE__ */ React40.createElement(Icon, {
|
|
3918
4144
|
size: 3,
|
|
3919
4145
|
icon: "ph--caret-down--bold"
|
|
3920
4146
|
}));
|
|
3921
4147
|
});
|
|
3922
4148
|
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3923
4149
|
const { tx } = useThemeContext();
|
|
3924
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.SelectViewport, {
|
|
3925
4151
|
...props,
|
|
3926
4152
|
className: tx("select.viewport", {}, classNames),
|
|
3927
4153
|
ref: forwardedRef
|
|
@@ -3929,7 +4155,7 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...p
|
|
|
3929
4155
|
});
|
|
3930
4156
|
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3931
4157
|
const { tx } = useThemeContext();
|
|
3932
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3933
4159
|
...props,
|
|
3934
4160
|
className: tx("select.item", {}, classNames),
|
|
3935
4161
|
ref: forwardedRef
|
|
@@ -3938,7 +4164,7 @@ var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forward
|
|
|
3938
4164
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3939
4165
|
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3940
4166
|
const { tx } = useThemeContext();
|
|
3941
|
-
return /* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemIndicator, {
|
|
3942
4168
|
...props,
|
|
3943
4169
|
className: tx("select.itemIndicator", {}, classNames),
|
|
3944
4170
|
ref: forwardedRef
|
|
@@ -3946,13 +4172,13 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children,
|
|
|
3946
4172
|
});
|
|
3947
4173
|
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
3948
4174
|
const { tx } = useThemeContext();
|
|
3949
|
-
return /* @__PURE__ */
|
|
4175
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Item, {
|
|
3950
4176
|
...props,
|
|
3951
4177
|
className: tx("select.item", {}, classNames),
|
|
3952
4178
|
ref: forwardedRef
|
|
3953
|
-
}, /* @__PURE__ */
|
|
4179
|
+
}, /* @__PURE__ */ React40.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React40.createElement("span", {
|
|
3954
4180
|
className: "grow w-1"
|
|
3955
|
-
}), /* @__PURE__ */
|
|
4181
|
+
}), /* @__PURE__ */ React40.createElement(Icon, {
|
|
3956
4182
|
icon: "ph--check--regular"
|
|
3957
4183
|
}));
|
|
3958
4184
|
});
|
|
@@ -3960,7 +4186,7 @@ var SelectGroup = SelectPrimitive.Group;
|
|
|
3960
4186
|
var SelectLabel = SelectPrimitive.Label;
|
|
3961
4187
|
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3962
4188
|
const { tx } = useThemeContext();
|
|
3963
|
-
return /* @__PURE__ */
|
|
4189
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Separator, {
|
|
3964
4190
|
...props,
|
|
3965
4191
|
className: tx("select.separator", {}, classNames),
|
|
3966
4192
|
ref: forwardedRef
|
|
@@ -3968,7 +4194,7 @@ var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, fo
|
|
|
3968
4194
|
});
|
|
3969
4195
|
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3970
4196
|
const { tx } = useThemeContext();
|
|
3971
|
-
return /* @__PURE__ */
|
|
4197
|
+
return /* @__PURE__ */ React40.createElement(SelectPrimitive.Arrow, {
|
|
3972
4198
|
...props,
|
|
3973
4199
|
className: tx("select.arrow", {}, classNames),
|
|
3974
4200
|
ref: forwardedRef
|
|
@@ -3996,10 +4222,10 @@ var Select = {
|
|
|
3996
4222
|
};
|
|
3997
4223
|
|
|
3998
4224
|
// src/components/Skeleton/Skeleton.tsx
|
|
3999
|
-
import
|
|
4225
|
+
import React41, { forwardRef as forwardRef26 } from "react";
|
|
4000
4226
|
var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
4001
4227
|
const { tx } = useThemeContext();
|
|
4002
|
-
return /* @__PURE__ */
|
|
4228
|
+
return /* @__PURE__ */ React41.createElement("div", {
|
|
4003
4229
|
...props,
|
|
4004
4230
|
className: tx("skeleton.root", {
|
|
4005
4231
|
variant
|
|
@@ -4010,10 +4236,10 @@ var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default",
|
|
|
4010
4236
|
|
|
4011
4237
|
// src/components/Splitter/Splitter.tsx
|
|
4012
4238
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
4013
|
-
import { Primitive as
|
|
4014
|
-
import { Slot as
|
|
4015
|
-
import
|
|
4016
|
-
import { composableProps as
|
|
4239
|
+
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
4240
|
+
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
4241
|
+
import React42 from "react";
|
|
4242
|
+
import { composableProps as composableProps14, slottable as slottable11 } from "@dxos/ui-theme";
|
|
4017
4243
|
var SPLITTER_NAME = "Splitter";
|
|
4018
4244
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
4019
4245
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
@@ -4021,14 +4247,14 @@ var ROOT_NAME = "Splitter.Root";
|
|
|
4021
4247
|
var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
4022
4248
|
const { tx } = useThemeContext();
|
|
4023
4249
|
const { __scopeSplitter, ...rest } = props;
|
|
4024
|
-
const { className, ...restProps } =
|
|
4025
|
-
const Comp = asChild ?
|
|
4026
|
-
return /* @__PURE__ */
|
|
4250
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
4251
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
4252
|
+
return /* @__PURE__ */ React42.createElement(SplitterProvider, {
|
|
4027
4253
|
scope: __scopeSplitter,
|
|
4028
4254
|
mode,
|
|
4029
4255
|
ratio,
|
|
4030
4256
|
transition
|
|
4031
|
-
}, /* @__PURE__ */
|
|
4257
|
+
}, /* @__PURE__ */ React42.createElement(Comp, {
|
|
4032
4258
|
...restProps,
|
|
4033
4259
|
ref: forwardedRef,
|
|
4034
4260
|
className: tx("splitter.root", {}, className)
|
|
@@ -4039,13 +4265,13 @@ var PANEL_NAME = "Splitter.Panel";
|
|
|
4039
4265
|
var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
4040
4266
|
const { tx } = useThemeContext();
|
|
4041
4267
|
const { __scopeSplitter, ...rest } = props;
|
|
4042
|
-
const Comp = asChild ?
|
|
4268
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
4043
4269
|
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
4044
|
-
const { className, ...restProps } =
|
|
4270
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
4045
4271
|
const isTopPanel = position === "top";
|
|
4046
4272
|
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
4047
4273
|
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
4048
|
-
return /* @__PURE__ */
|
|
4274
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
4049
4275
|
...restProps,
|
|
4050
4276
|
ref: forwardedRef,
|
|
4051
4277
|
className: tx("splitter.panel", {}, className),
|
|
@@ -4064,13 +4290,13 @@ var Splitter = {
|
|
|
4064
4290
|
};
|
|
4065
4291
|
|
|
4066
4292
|
// src/components/Tag/Tag.tsx
|
|
4067
|
-
import { Primitive as
|
|
4068
|
-
import { Slot as
|
|
4069
|
-
import
|
|
4293
|
+
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
4294
|
+
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
4295
|
+
import React43, { forwardRef as forwardRef27 } from "react";
|
|
4070
4296
|
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
4071
4297
|
const { tx } = useThemeContext();
|
|
4072
|
-
const Comp = asChild ?
|
|
4073
|
-
return /* @__PURE__ */
|
|
4298
|
+
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
4299
|
+
return /* @__PURE__ */ React43.createElement(Comp, {
|
|
4074
4300
|
...props,
|
|
4075
4301
|
className: tx("tag.root", {
|
|
4076
4302
|
palette
|
|
@@ -4081,14 +4307,14 @@ var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNam
|
|
|
4081
4307
|
});
|
|
4082
4308
|
|
|
4083
4309
|
// src/components/Toast/Toast.tsx
|
|
4084
|
-
import { Primitive as
|
|
4085
|
-
import { Slot as
|
|
4310
|
+
import { Primitive as Primitive23 } from "@radix-ui/react-primitive";
|
|
4311
|
+
import { Slot as Slot23 } from "@radix-ui/react-slot";
|
|
4086
4312
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4087
|
-
import
|
|
4313
|
+
import React44, { forwardRef as forwardRef28 } from "react";
|
|
4088
4314
|
var ToastProvider = ToastPrimitive.Provider;
|
|
4089
4315
|
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
4090
4316
|
const { tx } = useThemeContext();
|
|
4091
|
-
return /* @__PURE__ */
|
|
4317
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Viewport, {
|
|
4092
4318
|
...props,
|
|
4093
4319
|
className: tx("toast.viewport", {}, classNames),
|
|
4094
4320
|
ref: forwardedRef
|
|
@@ -4096,18 +4322,18 @@ var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forw
|
|
|
4096
4322
|
});
|
|
4097
4323
|
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
4098
4324
|
const { tx } = useThemeContext();
|
|
4099
|
-
return /* @__PURE__ */
|
|
4325
|
+
return /* @__PURE__ */ React44.createElement(ToastPrimitive.Root, {
|
|
4100
4326
|
...props,
|
|
4101
4327
|
className: tx("toast.root", {}, classNames),
|
|
4102
4328
|
ref: forwardedRef
|
|
4103
|
-
}, /* @__PURE__ */
|
|
4329
|
+
}, /* @__PURE__ */ React44.createElement(ElevationProvider, {
|
|
4104
4330
|
elevation: "toast"
|
|
4105
4331
|
}, children));
|
|
4106
4332
|
});
|
|
4107
4333
|
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4108
4334
|
const { tx } = useThemeContext();
|
|
4109
|
-
const Comp = asChild ?
|
|
4110
|
-
return /* @__PURE__ */
|
|
4335
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4336
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4111
4337
|
...props,
|
|
4112
4338
|
className: tx("toast.body", {}, classNames),
|
|
4113
4339
|
ref: forwardedRef
|
|
@@ -4115,8 +4341,8 @@ var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props },
|
|
|
4115
4341
|
});
|
|
4116
4342
|
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4117
4343
|
const { tx } = useThemeContext();
|
|
4118
|
-
const Comp = asChild ?
|
|
4119
|
-
return /* @__PURE__ */
|
|
4344
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
4345
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4120
4346
|
...props,
|
|
4121
4347
|
className: tx("toast.title", {}, classNames),
|
|
4122
4348
|
ref: forwardedRef
|
|
@@ -4124,8 +4350,8 @@ var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }
|
|
|
4124
4350
|
});
|
|
4125
4351
|
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4126
4352
|
const { tx } = useThemeContext();
|
|
4127
|
-
const Comp = asChild ?
|
|
4128
|
-
return /* @__PURE__ */
|
|
4353
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
4354
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4129
4355
|
...props,
|
|
4130
4356
|
className: tx("toast.description", {}, classNames),
|
|
4131
4357
|
ref: forwardedRef
|
|
@@ -4133,8 +4359,8 @@ var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...p
|
|
|
4133
4359
|
});
|
|
4134
4360
|
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
4135
4361
|
const { tx } = useThemeContext();
|
|
4136
|
-
const Comp = asChild ?
|
|
4137
|
-
return /* @__PURE__ */
|
|
4362
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4363
|
+
return /* @__PURE__ */ React44.createElement(Comp, {
|
|
4138
4364
|
...props,
|
|
4139
4365
|
className: tx("toast.actions", {}, classNames),
|
|
4140
4366
|
ref: forwardedRef
|
|
@@ -4162,6 +4388,7 @@ export {
|
|
|
4162
4388
|
ButtonGroup,
|
|
4163
4389
|
Callout,
|
|
4164
4390
|
Card,
|
|
4391
|
+
Carousel,
|
|
4165
4392
|
Clipboard,
|
|
4166
4393
|
Column,
|
|
4167
4394
|
Container,
|
|
@@ -4188,6 +4415,7 @@ export {
|
|
|
4188
4415
|
List,
|
|
4189
4416
|
ListItem,
|
|
4190
4417
|
Main,
|
|
4418
|
+
MediaPlayer,
|
|
4191
4419
|
Message,
|
|
4192
4420
|
Panel,
|
|
4193
4421
|
Popover,
|
|
@@ -4219,13 +4447,16 @@ export {
|
|
|
4219
4447
|
createPopoverScope,
|
|
4220
4448
|
createSplitterScope,
|
|
4221
4449
|
createTooltipScope,
|
|
4450
|
+
detectMediaKind,
|
|
4222
4451
|
hasIosKeyboard,
|
|
4223
4452
|
initialSafeArea,
|
|
4224
4453
|
isLabel,
|
|
4225
4454
|
messageIcons,
|
|
4455
|
+
parseCaptureOwnerStack,
|
|
4226
4456
|
toLocalizedString,
|
|
4227
4457
|
useAvatarContext,
|
|
4228
4458
|
useButtonGroupContext,
|
|
4459
|
+
useCarousel,
|
|
4229
4460
|
useClipboard,
|
|
4230
4461
|
useDensityContext,
|
|
4231
4462
|
useDropdownMenuContext,
|