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