@dxos/react-ui 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-2FKSMWNY.mjs → chunk-BDBC6H6V.mjs} +79 -5
- package/dist/lib/browser/chunk-BDBC6H6V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +949 -758
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +30 -24
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/browser/translations.mjs +18 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZNBLTSHI.mjs → chunk-3JSJK2ZY.mjs} +79 -5
- package/dist/lib/node-esm/chunk-3JSJK2ZY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +949 -758
- 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 +30 -24
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/translations.mjs +20 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts +1 -1
- 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.d.ts +2 -2
- package/dist/types/src/components/Button/Button.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 +3 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Button/Toggle.d.ts +2 -2
- package/dist/types/src/components/Button/Toggle.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 +6 -6
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -1
- 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 +68 -51
- package/dist/types/src/components/Card/Card.d.ts.map +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +2 -2
- package/dist/types/src/components/Card/Card.stories.d.ts.map +1 -1
- 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 +10 -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 +42 -31
- 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 +47 -30
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +3 -2
- 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 +36 -0
- package/dist/types/src/components/Focus/Focus.d.ts.map +1 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts +9 -0
- package/dist/types/src/components/Focus/Focus.stories.d.ts.map +1 -0
- package/dist/types/src/components/Focus/index.d.ts +2 -0
- package/dist/types/src/components/Focus/index.d.ts.map +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts +4 -0
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +11 -3
- 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 +14 -17
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +3 -3
- 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 +5 -3
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +3 -1
- 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 +5 -9
- 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/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 +58 -49
- package/dist/types/src/components/Menu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu/DropdownMenu.stories.d.ts +14 -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 +2 -2
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +38 -22
- 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 +12 -9
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +18 -5
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +42 -13
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +5 -6
- 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 +2 -2
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Separator/Separator.d.ts +3 -3
- package/dist/types/src/components/Separator/Separator.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 +19 -17
- 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.d.ts +3 -4
- package/dist/types/src/components/Status/Status.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 +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.stories.d.ts +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 +16 -16
- 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 +11 -19
- 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 +10 -10
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +2 -2
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/exemplars/generics.stories.d.ts +6 -5
- package/dist/types/src/exemplars/generics.stories.d.ts.map +1 -1
- package/dist/types/src/exemplars/slot.stories.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDensityContext.d.ts +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 +21 -14
- package/dist/types/src/primitives/Column/Column.d.ts.map +1 -1
- package/dist/types/src/primitives/Column/Column.stories.d.ts +19 -0
- package/dist/types/src/primitives/Column/Column.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Container/Container.d.ts +4 -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 +5 -7
- 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 +3 -8
- 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 +24 -15
- 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 +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -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 +28 -25
- package/src/components/Avatars/Avatar.stories.tsx +2 -3
- package/src/components/Avatars/Avatar.tsx +1 -2
- package/src/components/Avatars/AvatarGroup.stories.tsx +0 -1
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -2
- package/src/components/Button/Button.stories.tsx +0 -1
- package/src/components/Button/Button.tsx +5 -13
- package/src/components/Button/IconButton.stories.tsx +6 -4
- package/src/components/Button/IconButton.tsx +3 -4
- package/src/components/Button/Toggle.stories.tsx +0 -1
- package/src/components/Button/Toggle.tsx +4 -4
- package/src/components/Button/ToggleGroup.stories.tsx +0 -1
- package/src/components/Button/ToggleGroup.tsx +12 -16
- package/src/components/Card/Card.stories.tsx +15 -15
- package/src/components/Card/Card.tsx +280 -115
- package/src/components/Clipboard/CopyButton.tsx +5 -6
- package/src/components/Dialog/AlertDialog.stories.tsx +5 -6
- package/src/components/Dialog/AlertDialog.tsx +67 -126
- package/src/components/Dialog/Dialog.stories.tsx +64 -9
- package/src/components/Dialog/Dialog.tsx +84 -88
- package/src/components/ErrorFallback/ErrorFallback.stories.tsx +3 -8
- package/src/components/ErrorFallback/ErrorStack.tsx +36 -2
- package/src/components/Focus/AUDIT.md +43 -0
- package/src/components/Focus/Focus.stories.tsx +230 -0
- package/src/components/Focus/Focus.tsx +201 -0
- package/src/components/Focus/index.ts +5 -0
- package/src/components/Icon/Icon.stories.tsx +43 -13
- package/src/components/Icon/Icon.tsx +14 -3
- package/src/components/Image/Image.stories.tsx +3 -3
- package/src/components/Image/Image.tsx +31 -8
- package/src/components/Input/Input.stories.tsx +3 -4
- package/src/components/Input/Input.tsx +7 -7
- package/src/components/Link/Link.stories.tsx +0 -1
- package/src/components/List/List.stories.tsx +1 -2
- package/src/components/List/List.tsx +7 -6
- package/src/components/List/ListDropIndicator.tsx +0 -1
- package/src/components/List/Tree.stories.tsx +2 -3
- package/src/components/List/Tree.tsx +0 -1
- package/src/components/List/Treegrid.stories.tsx +26 -27
- package/src/components/List/Treegrid.tsx +14 -14
- package/src/components/Main/Main.stories.tsx +0 -1
- package/src/components/Main/Main.tsx +1 -2
- package/src/components/Menu/ContextMenu.stories.tsx +0 -1
- package/src/components/Menu/DropdownMenu.stories.tsx +0 -1
- package/src/components/Menu/DropdownMenu.tsx +48 -42
- package/src/components/Message/Message.stories.tsx +7 -8
- package/src/components/Message/Message.tsx +23 -10
- package/src/components/Popover/Popover.stories.tsx +4 -5
- package/src/components/Popover/Popover.tsx +42 -42
- package/src/components/ScrollArea/ScrollArea.stories.tsx +89 -30
- package/src/components/ScrollArea/ScrollArea.tsx +39 -23
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +20 -18
- package/src/components/ScrollContainer/ScrollContainer.tsx +199 -92
- package/src/components/Select/Select.stories.tsx +5 -6
- package/src/components/Separator/Separator.tsx +4 -7
- package/src/components/Skeleton/Skeleton.stories.tsx +0 -1
- package/src/components/Splitter/Splitter.stories.tsx +29 -29
- package/src/components/Splitter/Splitter.tsx +35 -34
- package/src/components/Status/Status.stories.tsx +0 -1
- package/src/components/Status/Status.tsx +8 -5
- package/src/components/Tag/Tag.stories.tsx +0 -1
- package/src/components/ThemeProvider/ThemeProvider.stories.tsx +0 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +5 -4
- package/src/components/ThemeProvider/index.ts +1 -1
- package/src/components/Toast/Toast.stories.tsx +0 -1
- package/src/components/Toast/Toast.tsx +16 -31
- package/src/components/Toolbar/Toolbar.stories.tsx +0 -1
- package/src/components/Toolbar/Toolbar.tsx +21 -35
- package/src/components/Tooltip/Tooltip.stories.tsx +7 -8
- package/src/components/Tooltip/Tooltip.tsx +15 -16
- package/src/components/index.ts +1 -0
- package/src/exemplars/generics.stories.tsx +7 -15
- package/src/exemplars/slot.stories.tsx +65 -57
- package/src/exemplars/tabster.stories.tsx +1 -1
- package/src/exemplars/virtualizer.stories.tsx +4 -5
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useDensityContext.ts +2 -2
- package/src/playground/Custom.stories.tsx +6 -9
- package/src/primitives/Column/AUDIT.md +148 -0
- package/src/primitives/Column/Column.stories.tsx +122 -19
- package/src/primitives/Column/Column.tsx +73 -42
- package/src/primitives/Container/Container.stories.tsx +0 -1
- package/src/primitives/Container/Container.tsx +5 -8
- package/src/primitives/Flex/Flex.stories.tsx +0 -1
- package/src/primitives/Flex/Flex.tsx +10 -12
- package/src/primitives/Grid/Grid.stories.tsx +0 -1
- package/src/primitives/Grid/Grid.tsx +4 -9
- package/src/primitives/Panel/Panel.stories.tsx +9 -8
- package/src/primitives/Panel/Panel.tsx +64 -63
- package/src/testing/Loading.tsx +25 -4
- package/src/testing/decorators/withLayout.tsx +7 -17
- package/src/testing/decorators/withTheme.tsx +10 -7
- package/src/translations.ts +3 -3
- package/src/util/usePx.ts +1 -0
- package/dist/lib/browser/chunk-2FKSMWNY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZNBLTSHI.mjs.map +0 -7
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
DensityProvider,
|
|
4
4
|
ElevationContext,
|
|
5
5
|
ElevationProvider,
|
|
6
|
+
ErrorStack,
|
|
6
7
|
ThemeContext,
|
|
7
8
|
ThemeProvider,
|
|
8
9
|
Tooltip,
|
|
@@ -10,12 +11,13 @@ import {
|
|
|
10
11
|
createTooltipScope,
|
|
11
12
|
hasIosKeyboard,
|
|
12
13
|
initialSafeArea,
|
|
14
|
+
parseCaptureOwnerStack,
|
|
13
15
|
useElevationContext,
|
|
14
16
|
useSafeArea,
|
|
15
17
|
useThemeContext,
|
|
16
18
|
useTooltipContext,
|
|
17
19
|
useTranslation
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BDBC6H6V.mjs";
|
|
19
21
|
|
|
20
22
|
// src/index.ts
|
|
21
23
|
import { Trans } from "react-i18next";
|
|
@@ -23,13 +25,13 @@ export * from "@dxos/react-hooks";
|
|
|
23
25
|
export * from "@dxos/ui-types";
|
|
24
26
|
|
|
25
27
|
// src/components/ThemeProvider/index.ts
|
|
26
|
-
import { isLabel, toLocalizedString } from "@dxos/ui-types";
|
|
28
|
+
import { isLabel, toLocalizedString } from "@dxos/ui-types/translations";
|
|
27
29
|
|
|
28
30
|
// src/hooks/useDensityContext.ts
|
|
29
31
|
import { useContext } from "react";
|
|
30
|
-
var useDensityContext = (
|
|
32
|
+
var useDensityContext = (densityProp) => {
|
|
31
33
|
const { density } = useContext(DensityContext);
|
|
32
|
-
return
|
|
34
|
+
return densityProp ?? density;
|
|
33
35
|
};
|
|
34
36
|
|
|
35
37
|
// src/hooks/useIconHref.ts
|
|
@@ -40,6 +42,26 @@ var useIconHref = (icon) => {
|
|
|
40
42
|
return icon ? `${url}#${icon}` : void 0;
|
|
41
43
|
};
|
|
42
44
|
|
|
45
|
+
// src/hooks/useSafeCollisionPadding.ts
|
|
46
|
+
import { useMemo } from "react";
|
|
47
|
+
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
48
|
+
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
49
|
+
var safePadding = (propsPadding, safePadding2, side) => {
|
|
50
|
+
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
51
|
+
};
|
|
52
|
+
var useSafeCollisionPadding = (collisionPadding) => {
|
|
53
|
+
const { safeAreaPadding } = useThemeContext();
|
|
54
|
+
return useMemo(() => ({
|
|
55
|
+
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
56
|
+
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
57
|
+
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
58
|
+
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
59
|
+
}), [
|
|
60
|
+
collisionPadding,
|
|
61
|
+
safeAreaPadding
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
|
|
43
65
|
// src/hooks/useTranslationsContext.ts
|
|
44
66
|
import { useContext as useContext2 } from "react";
|
|
45
67
|
var useTranslationsContext = () => useContext2(TranslationsContext);
|
|
@@ -64,7 +86,7 @@ var useVisualViewport = (deps) => {
|
|
|
64
86
|
};
|
|
65
87
|
|
|
66
88
|
// src/util/usePx.ts
|
|
67
|
-
import { useCallback as useCallback2, useEffect, useMemo, useState as useState2 } from "react";
|
|
89
|
+
import { useCallback as useCallback2, useEffect, useMemo as useMemo2, useState as useState2 } from "react";
|
|
68
90
|
var getDocumentElementFontSize = () => parseFloat(getComputedStyle(document.documentElement).fontSize);
|
|
69
91
|
var usePx = (rem) => {
|
|
70
92
|
const [fontSize, setFontSize] = useState2(() => {
|
|
@@ -100,17 +122,17 @@ var usePx = (rem) => {
|
|
|
100
122
|
}
|
|
101
123
|
};
|
|
102
124
|
}, []);
|
|
103
|
-
return
|
|
125
|
+
return useMemo2(() => rem * fontSize, [
|
|
104
126
|
fontSize
|
|
105
127
|
]);
|
|
106
128
|
};
|
|
107
129
|
|
|
108
130
|
// src/components/Avatars/Avatar.tsx
|
|
109
|
-
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
110
131
|
import { createContext } from "@radix-ui/react-context";
|
|
111
132
|
import { Primitive } from "@radix-ui/react-primitive";
|
|
112
133
|
import { Slot } from "@radix-ui/react-slot";
|
|
113
134
|
import React, { forwardRef } from "react";
|
|
135
|
+
import "@dxos/lit-ui/dx-avatar.pcss";
|
|
114
136
|
import { DxAvatar } from "@dxos/lit-ui/react";
|
|
115
137
|
import { useId } from "@dxos/react-hooks";
|
|
116
138
|
import { mx } from "@dxos/ui-theme";
|
|
@@ -175,12 +197,19 @@ import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
|
175
197
|
import React4, { forwardRef as forwardRef4 } from "react";
|
|
176
198
|
|
|
177
199
|
// src/components/Icon/Icon.tsx
|
|
178
|
-
import React2, { forwardRef as forwardRef2, memo } from "react";
|
|
179
|
-
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({
|
|
200
|
+
import React2, { forwardRef as forwardRef2, memo, useMemo as useMemo3 } from "react";
|
|
201
|
+
var Icon = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef2(({ classNames, icon, size, synchronized, style, ...props }, forwardedRef) => {
|
|
180
202
|
const { tx } = useThemeContext();
|
|
203
|
+
const spinDelay = useMemo3(() => synchronized ? `${-(Date.now() % 1e3)}ms` : void 0, [
|
|
204
|
+
synchronized
|
|
205
|
+
]);
|
|
181
206
|
const href = useIconHref(icon);
|
|
182
207
|
return /* @__PURE__ */ React2.createElement("svg", {
|
|
183
208
|
...props,
|
|
209
|
+
style: {
|
|
210
|
+
...style,
|
|
211
|
+
animationDelay: spinDelay
|
|
212
|
+
},
|
|
184
213
|
className: tx("icon.root", {
|
|
185
214
|
size
|
|
186
215
|
}, classNames),
|
|
@@ -284,11 +313,11 @@ var BUTTON_NAME = "Button";
|
|
|
284
313
|
var [ButtonGroupProvider, useButtonGroupContext] = createContext2(BUTTON_GROUP_NAME, {
|
|
285
314
|
inGroup: false
|
|
286
315
|
});
|
|
287
|
-
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef5(({ classNames, children, density:
|
|
316
|
+
var Button = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef5(({ classNames, children, density: densityProp, elevation: elevationProp, variant = "default", asChild, ...props }, ref) => {
|
|
288
317
|
const { inGroup } = useButtonGroupContext(BUTTON_NAME);
|
|
289
318
|
const { tx } = useThemeContext();
|
|
290
|
-
const elevation = useElevationContext(
|
|
291
|
-
const density = useDensityContext(
|
|
319
|
+
const elevation = useElevationContext(elevationProp);
|
|
320
|
+
const density = useDensityContext(densityProp);
|
|
292
321
|
const Comp = asChild ? Slot4 : Primitive4.button;
|
|
293
322
|
return /* @__PURE__ */ React5.createElement(Comp, {
|
|
294
323
|
ref,
|
|
@@ -351,12 +380,13 @@ var IconOnlyButton = /* @__PURE__ */ forwardRef6(({ noTooltip, tooltipSide, ...p
|
|
|
351
380
|
ref: forwardedRef
|
|
352
381
|
}));
|
|
353
382
|
});
|
|
354
|
-
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size
|
|
383
|
+
var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size, icon, iconOnly, square, iconEnd, iconClassNames, label, caretDown, noTooltip: _, classNames, ...props }, forwardedRef) => {
|
|
355
384
|
const { tx } = useThemeContext();
|
|
356
385
|
return /* @__PURE__ */ React6.createElement(Button, {
|
|
357
386
|
...props,
|
|
358
387
|
classNames: tx("iconButton.root", {
|
|
359
|
-
iconOnly
|
|
388
|
+
iconOnly,
|
|
389
|
+
square
|
|
360
390
|
}, classNames),
|
|
361
391
|
ref: forwardedRef
|
|
362
392
|
}, icon && !iconEnd && /* @__PURE__ */ React6.createElement(Icon, {
|
|
@@ -376,10 +406,10 @@ var LabelledIconButton = /* @__PURE__ */ forwardRef6(({ size = 5, icon, iconOnly
|
|
|
376
406
|
});
|
|
377
407
|
|
|
378
408
|
// src/components/Button/Toggle.tsx
|
|
379
|
-
import
|
|
409
|
+
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
380
410
|
import React7, { forwardRef as forwardRef7 } from "react";
|
|
381
411
|
var Toggle = /* @__PURE__ */ forwardRef7(({ defaultPressed, pressed, onPressedChange, ...props }, forwardedRef) => {
|
|
382
|
-
return /* @__PURE__ */ React7.createElement(TogglePrimitive, {
|
|
412
|
+
return /* @__PURE__ */ React7.createElement(TogglePrimitive.Root, {
|
|
383
413
|
defaultPressed,
|
|
384
414
|
pressed,
|
|
385
415
|
onPressedChange,
|
|
@@ -391,10 +421,10 @@ var Toggle = /* @__PURE__ */ forwardRef7(({ defaultPressed, pressed, onPressedCh
|
|
|
391
421
|
});
|
|
392
422
|
|
|
393
423
|
// src/components/Button/ToggleGroup.tsx
|
|
394
|
-
import
|
|
424
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
395
425
|
import React8, { forwardRef as forwardRef8 } from "react";
|
|
396
426
|
var ToggleGroup = /* @__PURE__ */ forwardRef8(({ classNames, children, ...props }, forwardedRef) => {
|
|
397
|
-
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive, {
|
|
427
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Root, {
|
|
398
428
|
...props,
|
|
399
429
|
asChild: true
|
|
400
430
|
}, /* @__PURE__ */ React8.createElement(ButtonGroup, {
|
|
@@ -404,7 +434,7 @@ var ToggleGroup = /* @__PURE__ */ forwardRef8(({ classNames, children, ...props
|
|
|
404
434
|
}));
|
|
405
435
|
});
|
|
406
436
|
var ToggleGroupItem = /* @__PURE__ */ forwardRef8(({ variant, elevation, density, classNames, children, ...props }, forwardedRef) => {
|
|
407
|
-
return /* @__PURE__ */ React8.createElement(
|
|
437
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Item, {
|
|
408
438
|
...props,
|
|
409
439
|
asChild: true
|
|
410
440
|
}, /* @__PURE__ */ React8.createElement(Button, {
|
|
@@ -417,7 +447,7 @@ var ToggleGroupItem = /* @__PURE__ */ forwardRef8(({ variant, elevation, density
|
|
|
417
447
|
}));
|
|
418
448
|
});
|
|
419
449
|
var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, size, elevation, density, classNames, ...props }, forwardedRef) => {
|
|
420
|
-
return /* @__PURE__ */ React8.createElement(
|
|
450
|
+
return /* @__PURE__ */ React8.createElement(ToggleGroupPrimitive.Item, {
|
|
421
451
|
...props,
|
|
422
452
|
asChild: true
|
|
423
453
|
}, /* @__PURE__ */ React8.createElement(IconButton, {
|
|
@@ -433,24 +463,25 @@ var ToggleGroupIconItem = /* @__PURE__ */ forwardRef8(({ variant, label, icon, s
|
|
|
433
463
|
});
|
|
434
464
|
|
|
435
465
|
// src/components/Card/Card.tsx
|
|
436
|
-
import { Primitive as
|
|
437
|
-
import { Slot as
|
|
438
|
-
import
|
|
439
|
-
import {
|
|
466
|
+
import { Primitive as Primitive12 } from "@radix-ui/react-primitive";
|
|
467
|
+
import { Slot as Slot12 } from "@radix-ui/react-slot";
|
|
468
|
+
import DOMPurify from "dompurify";
|
|
469
|
+
import React19, { createContext as createContext3, forwardRef as forwardRef13, useContext as useContext3, useMemo as useMemo5 } from "react";
|
|
470
|
+
import { composable as composable3, composableProps as composableProps7, iconSize, mx as mx6, slottable as slottable6 } from "@dxos/ui-theme";
|
|
440
471
|
|
|
441
472
|
// src/primitives/Column/Column.tsx
|
|
442
473
|
import { Primitive as Primitive5 } from "@radix-ui/react-primitive";
|
|
443
474
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
444
|
-
import React9
|
|
445
|
-
import { composableProps } from "@dxos/ui-theme";
|
|
475
|
+
import React9 from "react";
|
|
476
|
+
import { composableProps, slottable } from "@dxos/ui-theme";
|
|
446
477
|
var COLUMN_ROOT_NAME = "Column.Root";
|
|
447
478
|
var gutterSizes = {
|
|
479
|
+
xs: "var(--dx-gutter-xs)",
|
|
448
480
|
sm: "var(--dx-gutter-sm)",
|
|
449
481
|
md: "var(--dx-gutter-md)",
|
|
450
|
-
lg: "var(--dx-gutter-lg)"
|
|
451
|
-
rail: "var(--dx-rail-item)"
|
|
482
|
+
lg: "var(--dx-gutter-lg)"
|
|
452
483
|
};
|
|
453
|
-
var
|
|
484
|
+
var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }, forwardedRef) => {
|
|
454
485
|
const { className, ...rest } = composableProps(props);
|
|
455
486
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
456
487
|
const { tx } = useThemeContext();
|
|
@@ -460,6 +491,7 @@ var Root = /* @__PURE__ */ forwardRef9(({ children, asChild, role, gutter = "md"
|
|
|
460
491
|
role: role ?? "none",
|
|
461
492
|
style: {
|
|
462
493
|
"--gutter": gutterSize,
|
|
494
|
+
"--dx-col": "2 / span 1",
|
|
463
495
|
gridTemplateColumns: [
|
|
464
496
|
gutterSize,
|
|
465
497
|
"minmax(0,1fr)",
|
|
@@ -472,9 +504,9 @@ var Root = /* @__PURE__ */ forwardRef9(({ children, asChild, role, gutter = "md"
|
|
|
472
504
|
ref: forwardedRef
|
|
473
505
|
}, children);
|
|
474
506
|
});
|
|
475
|
-
|
|
507
|
+
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
476
508
|
var COLUMN_ROW_NAME = "Column.Row";
|
|
477
|
-
var
|
|
509
|
+
var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
478
510
|
const { className, ...rest } = composableProps(props);
|
|
479
511
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
480
512
|
const { tx } = useThemeContext();
|
|
@@ -485,37 +517,45 @@ var Row = /* @__PURE__ */ forwardRef9(({ children, asChild, role, ...props }, fo
|
|
|
485
517
|
ref: forwardedRef
|
|
486
518
|
}, children);
|
|
487
519
|
});
|
|
488
|
-
|
|
489
|
-
var
|
|
490
|
-
var
|
|
520
|
+
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
521
|
+
var COLUMN_BLEED_NAME = "Column.Bleed";
|
|
522
|
+
var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
523
|
+
const { tx } = useThemeContext();
|
|
491
524
|
const { className, ...rest } = composableProps(props);
|
|
492
525
|
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
526
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
527
|
+
...rest,
|
|
528
|
+
className: tx("column.bleed", {}, className),
|
|
529
|
+
ref: forwardedRef
|
|
530
|
+
}, children);
|
|
531
|
+
});
|
|
532
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
533
|
+
var COLUMN_CENTER_NAME = "Column.Center";
|
|
534
|
+
var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
493
535
|
const { tx } = useThemeContext();
|
|
536
|
+
const { className, ...rest } = composableProps(props);
|
|
537
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
494
538
|
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
495
539
|
...rest,
|
|
496
|
-
|
|
497
|
-
className: tx("column.segment", {}, className),
|
|
540
|
+
className: tx("column.center", {}, className),
|
|
498
541
|
ref: forwardedRef
|
|
499
|
-
},
|
|
500
|
-
className: "contents"
|
|
501
|
-
}, children));
|
|
542
|
+
}, children);
|
|
502
543
|
});
|
|
503
|
-
|
|
544
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
504
545
|
var Column = {
|
|
505
|
-
Root,
|
|
506
|
-
Row,
|
|
507
|
-
|
|
546
|
+
Root: ColumnRoot,
|
|
547
|
+
Row: ColumnRow,
|
|
548
|
+
Bleed: ColumnBleed,
|
|
549
|
+
Center: ColumnCenter
|
|
508
550
|
};
|
|
509
551
|
|
|
510
552
|
// src/primitives/Container/Container.tsx
|
|
511
|
-
import React10, { forwardRef as forwardRef10 } from "react";
|
|
512
|
-
import { composableProps as composableProps2, mx as mx2 } from "@dxos/ui-theme";
|
|
513
|
-
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
514
553
|
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
554
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
555
|
+
import React10 from "react";
|
|
556
|
+
import { composableProps as composableProps2, mx as mx2, slottable as slottable2 } from "@dxos/ui-theme";
|
|
557
|
+
var Container = slottable2(({ children, asChild, ...props }, forwardedRef) => {
|
|
558
|
+
const { className, ...rest } = composableProps2(props);
|
|
519
559
|
const Comp = asChild ? Slot6 : Primitive6.div;
|
|
520
560
|
return /* @__PURE__ */ React10.createElement(Comp, {
|
|
521
561
|
...rest,
|
|
@@ -525,22 +565,24 @@ var Container = /* @__PURE__ */ forwardRef10(({ children, asChild, ...props }, f
|
|
|
525
565
|
});
|
|
526
566
|
|
|
527
567
|
// src/primitives/Flex/Flex.tsx
|
|
528
|
-
import
|
|
529
|
-
import {
|
|
530
|
-
|
|
568
|
+
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
569
|
+
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
570
|
+
import React11 from "react";
|
|
571
|
+
import { composableProps as composableProps3, mx as mx3, slottable as slottable3 } from "@dxos/ui-theme";
|
|
572
|
+
var Flex = slottable3(({ children, asChild, column, grow, ...props }, forwardedRef) => {
|
|
531
573
|
const { className, ...rest } = composableProps3(props);
|
|
532
|
-
|
|
574
|
+
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
575
|
+
return /* @__PURE__ */ React11.createElement(Comp, {
|
|
533
576
|
ref: forwardedRef,
|
|
534
577
|
...rest,
|
|
535
|
-
role: role ?? "none",
|
|
536
578
|
className: mx3("flex", column && "flex-col", grow && "flex-1 overflow-hidden", className)
|
|
537
579
|
}, children);
|
|
538
580
|
});
|
|
539
581
|
|
|
540
582
|
// src/primitives/Grid/Grid.tsx
|
|
541
|
-
import React12
|
|
542
|
-
import { composableProps as composableProps4, mx as mx4 } from "@dxos/ui-theme";
|
|
543
|
-
var Grid =
|
|
583
|
+
import React12 from "react";
|
|
584
|
+
import { composable, composableProps as composableProps4, mx as mx4 } from "@dxos/ui-theme";
|
|
585
|
+
var Grid = composable(({ children, style, role, cols, rows, grow = true, ...props }, forwardedRef) => {
|
|
544
586
|
const { className, ...rest } = composableProps4(props);
|
|
545
587
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
546
588
|
ref: forwardedRef,
|
|
@@ -556,15 +598,15 @@ var Grid = /* @__PURE__ */ forwardRef12(({ children, style, role, cols, rows, gr
|
|
|
556
598
|
});
|
|
557
599
|
|
|
558
600
|
// src/primitives/Panel/Panel.tsx
|
|
559
|
-
import { Primitive as
|
|
560
|
-
import { Slot as
|
|
561
|
-
import React13
|
|
562
|
-
import { composableProps as composableProps5 } from "@dxos/ui-theme";
|
|
601
|
+
import { Primitive as Primitive8 } from "@radix-ui/react-primitive";
|
|
602
|
+
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
603
|
+
import React13 from "react";
|
|
604
|
+
import { composableProps as composableProps5, slottable as slottable4 } from "@dxos/ui-theme";
|
|
563
605
|
var GRID_TEMPLATE_ROWS = "auto 1fr auto";
|
|
564
606
|
var GRID_TEMPLATE_AREAS = '"toolbar" "content" "statusbar"';
|
|
565
|
-
var
|
|
607
|
+
var PanelRoot = slottable4(({ children, asChild, role, style, ...props }, forwardedRef) => {
|
|
566
608
|
const { className, ...rest } = composableProps5(props);
|
|
567
|
-
const Comp = asChild ?
|
|
609
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
568
610
|
const { tx } = useThemeContext();
|
|
569
611
|
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
570
612
|
...rest,
|
|
@@ -578,22 +620,24 @@ var Root2 = /* @__PURE__ */ forwardRef13(({ children, asChild, role, style, ...p
|
|
|
578
620
|
ref: forwardedRef
|
|
579
621
|
}, children);
|
|
580
622
|
});
|
|
581
|
-
|
|
582
|
-
var
|
|
623
|
+
PanelRoot.displayName = "Panel.Root";
|
|
624
|
+
var PanelToolbar = slottable4(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
583
625
|
const { className, ...rest } = composableProps5(props);
|
|
584
|
-
const Comp = asChild ?
|
|
626
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
585
627
|
const { tx } = useThemeContext();
|
|
586
628
|
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
587
629
|
...rest,
|
|
588
630
|
"data-slot": "toolbar",
|
|
589
|
-
className: tx("panel.toolbar", {
|
|
631
|
+
className: tx("panel.toolbar", {
|
|
632
|
+
size
|
|
633
|
+
}, className),
|
|
590
634
|
ref: forwardedRef
|
|
591
635
|
}, children);
|
|
592
636
|
});
|
|
593
|
-
|
|
594
|
-
var
|
|
637
|
+
PanelToolbar.displayName = "Panel.Toolbar";
|
|
638
|
+
var PanelContent = slottable4(({ children, asChild, ...props }, forwardedRef) => {
|
|
595
639
|
const { className, ...rest } = composableProps5(props);
|
|
596
|
-
const Comp = asChild ?
|
|
640
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
597
641
|
const { tx } = useThemeContext();
|
|
598
642
|
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
599
643
|
...rest,
|
|
@@ -602,31 +646,33 @@ var Content = /* @__PURE__ */ forwardRef13(({ children, asChild, ...props }, for
|
|
|
602
646
|
ref: forwardedRef
|
|
603
647
|
}, children);
|
|
604
648
|
});
|
|
605
|
-
|
|
606
|
-
var
|
|
649
|
+
PanelContent.displayName = "Panel.Content";
|
|
650
|
+
var PanelStatusbar = slottable4(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
607
651
|
const { className, ...rest } = composableProps5(props);
|
|
608
|
-
const Comp = asChild ?
|
|
652
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
609
653
|
const { tx } = useThemeContext();
|
|
610
654
|
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
611
655
|
...rest,
|
|
612
656
|
"data-slot": "statusbar",
|
|
613
|
-
className: tx("panel.statusbar", {
|
|
657
|
+
className: tx("panel.statusbar", {
|
|
658
|
+
size
|
|
659
|
+
}, className),
|
|
614
660
|
ref: forwardedRef
|
|
615
661
|
}, children);
|
|
616
662
|
});
|
|
617
|
-
|
|
663
|
+
PanelStatusbar.displayName = "Panel.Statusbar";
|
|
618
664
|
var Panel = {
|
|
619
|
-
Root:
|
|
620
|
-
Toolbar,
|
|
621
|
-
Content,
|
|
622
|
-
Statusbar
|
|
665
|
+
Root: PanelRoot,
|
|
666
|
+
Toolbar: PanelToolbar,
|
|
667
|
+
Content: PanelContent,
|
|
668
|
+
Statusbar: PanelStatusbar
|
|
623
669
|
};
|
|
624
670
|
|
|
625
671
|
// src/components/Image/Image.tsx
|
|
626
672
|
import React14, { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
627
673
|
import { mx as mx5 } from "@dxos/ui-theme";
|
|
628
674
|
var cache = /* @__PURE__ */ new Map();
|
|
629
|
-
var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
675
|
+
var Image = ({ classNames, src, alt = "", fit = "contain", crossOrigin = "anonymous", sampleSize = 64, contrast = 0.9 }) => {
|
|
630
676
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
631
677
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
632
678
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
@@ -665,7 +711,13 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
665
711
|
src
|
|
666
712
|
]);
|
|
667
713
|
return /* @__PURE__ */ React14.createElement("div", {
|
|
668
|
-
|
|
714
|
+
// `isolate` (`isolation: isolate`) creates a new stacking context so
|
|
715
|
+
// the inner <img>'s `z-10` stays scoped to this wrapper. Without it
|
|
716
|
+
// the z-10 leaks into the parent's stacking context and elevates the
|
|
717
|
+
// image above any pseudo-element rings (e.g. Focus.Item's
|
|
718
|
+
// `dx-ring-pseudo` `::after`) painted on ancestors — most visibly,
|
|
719
|
+
// the focus ring on a Card containing a Card.Poster.
|
|
720
|
+
className: mx5(`relative flex w-full justify-center overflow-hidden transition-all duration-700 isolate`, classNames),
|
|
669
721
|
style: {
|
|
670
722
|
backgroundColor: dominantColor
|
|
671
723
|
}
|
|
@@ -688,7 +740,7 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
688
740
|
crossOrigin: crossOriginState,
|
|
689
741
|
onError: handleImageError,
|
|
690
742
|
onLoad: handleImageLoad,
|
|
691
|
-
className: "z-10
|
|
743
|
+
className: mx5("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
692
744
|
style: {
|
|
693
745
|
opacity: imageLoaded ? 1 : 0
|
|
694
746
|
}
|
|
@@ -726,7 +778,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
726
778
|
const green = pixels[i + 1];
|
|
727
779
|
const blue = pixels[i + 2];
|
|
728
780
|
const alpha = pixels[i + 3];
|
|
729
|
-
if (alpha === 0)
|
|
781
|
+
if (alpha === 0) {
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
730
784
|
const max = Math.max(red, green, blue);
|
|
731
785
|
const min = Math.min(red, green, blue);
|
|
732
786
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -754,72 +808,45 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
754
808
|
const edgePixels = sampleSize * 4 - 4;
|
|
755
809
|
for (let x = 0; x < sampleSize; x++) {
|
|
756
810
|
const topIndex = x * 4;
|
|
757
|
-
if (pixels[topIndex + 3] === 0)
|
|
811
|
+
if (pixels[topIndex + 3] === 0) {
|
|
812
|
+
edgeTransparentPixels++;
|
|
813
|
+
}
|
|
758
814
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
759
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
815
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
816
|
+
edgeTransparentPixels++;
|
|
817
|
+
}
|
|
760
818
|
}
|
|
761
819
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
762
820
|
const leftIndex = y * sampleSize * 4;
|
|
763
|
-
if (pixels[leftIndex + 3] === 0)
|
|
821
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
822
|
+
edgeTransparentPixels++;
|
|
823
|
+
}
|
|
764
824
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
765
|
-
if (pixels[rightIndex + 3] === 0)
|
|
825
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
826
|
+
edgeTransparentPixels++;
|
|
827
|
+
}
|
|
766
828
|
}
|
|
767
829
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
768
830
|
};
|
|
769
831
|
|
|
770
832
|
// src/components/Toolbar/Toolbar.tsx
|
|
771
|
-
import { Primitive as
|
|
772
|
-
import { Slot as
|
|
833
|
+
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
834
|
+
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
773
835
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
774
|
-
import React18, {
|
|
836
|
+
import React18, { forwardRef as forwardRef12 } from "react";
|
|
775
837
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
776
|
-
import { composableProps as composableProps6 } from "@dxos/ui-theme";
|
|
777
|
-
|
|
778
|
-
// src/translations.ts
|
|
779
|
-
var translationKey = "@dxos/react-ui";
|
|
780
|
-
var translations = [
|
|
781
|
-
{
|
|
782
|
-
"en-US": {
|
|
783
|
-
[translationKey]: {
|
|
784
|
-
"toolbar menu label": "Action menu",
|
|
785
|
-
"toolbar drag handle label": "Drag to rearrange",
|
|
786
|
-
"toolbar close label": "Close"
|
|
787
|
-
}
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
];
|
|
838
|
+
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
839
|
+
import { translationKey } from "#translations";
|
|
791
840
|
|
|
792
841
|
// src/components/Menu/ContextMenu.tsx
|
|
793
842
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
794
|
-
import { Primitive as
|
|
795
|
-
import { Slot as
|
|
796
|
-
import React15, { forwardRef as
|
|
797
|
-
|
|
798
|
-
// src/hooks/useSafeCollisionPadding.ts
|
|
799
|
-
import { useMemo as useMemo2 } from "react";
|
|
800
|
-
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
801
|
-
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
802
|
-
var safePadding = (propsPadding, safePadding2, side) => {
|
|
803
|
-
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
804
|
-
};
|
|
805
|
-
var useSafeCollisionPadding = (collisionPadding) => {
|
|
806
|
-
const { safeAreaPadding } = useThemeContext();
|
|
807
|
-
return useMemo2(() => ({
|
|
808
|
-
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
809
|
-
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
810
|
-
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
811
|
-
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
812
|
-
}), [
|
|
813
|
-
collisionPadding,
|
|
814
|
-
safeAreaPadding
|
|
815
|
-
]);
|
|
816
|
-
};
|
|
817
|
-
|
|
818
|
-
// src/components/Menu/ContextMenu.tsx
|
|
843
|
+
import { Primitive as Primitive9 } from "@radix-ui/react-primitive";
|
|
844
|
+
import { Slot as Slot9 } from "@radix-ui/react-slot";
|
|
845
|
+
import React15, { forwardRef as forwardRef9 } from "react";
|
|
819
846
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
820
847
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
821
848
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
822
|
-
var ContextMenuContent = /* @__PURE__ */
|
|
849
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef9(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
823
850
|
const { tx } = useThemeContext();
|
|
824
851
|
const elevation = useElevationContext();
|
|
825
852
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
@@ -833,16 +860,16 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef14(({ classNames, children, c
|
|
|
833
860
|
ref: forwardedRef
|
|
834
861
|
}, children);
|
|
835
862
|
});
|
|
836
|
-
var ContextMenuViewport = /* @__PURE__ */
|
|
863
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef9(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
837
864
|
const { tx } = useThemeContext();
|
|
838
|
-
const Comp = asChild ?
|
|
865
|
+
const Comp = asChild ? Slot9 : Primitive9.div;
|
|
839
866
|
return /* @__PURE__ */ React15.createElement(Comp, {
|
|
840
867
|
...props,
|
|
841
868
|
className: tx("menu.viewport", {}, classNames),
|
|
842
869
|
ref: forwardedRef
|
|
843
870
|
}, children);
|
|
844
871
|
});
|
|
845
|
-
var ContextMenuArrow = /* @__PURE__ */
|
|
872
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
846
873
|
const { tx } = useThemeContext();
|
|
847
874
|
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Arrow, {
|
|
848
875
|
...props,
|
|
@@ -852,7 +879,7 @@ var ContextMenuArrow = /* @__PURE__ */ forwardRef14(({ classNames, ...props }, f
|
|
|
852
879
|
});
|
|
853
880
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
854
881
|
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
855
|
-
var ContextMenuItem = /* @__PURE__ */
|
|
882
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
856
883
|
const { tx } = useThemeContext();
|
|
857
884
|
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Item, {
|
|
858
885
|
...props,
|
|
@@ -860,7 +887,7 @@ var ContextMenuItem = /* @__PURE__ */ forwardRef14(({ classNames, ...props }, fo
|
|
|
860
887
|
ref: forwardedRef
|
|
861
888
|
});
|
|
862
889
|
});
|
|
863
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */
|
|
890
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
864
891
|
const { tx } = useThemeContext();
|
|
865
892
|
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
866
893
|
...props,
|
|
@@ -868,7 +895,7 @@ var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef14(({ classNames, ...pro
|
|
|
868
895
|
ref: forwardedRef
|
|
869
896
|
});
|
|
870
897
|
});
|
|
871
|
-
var ContextMenuSeparator = /* @__PURE__ */
|
|
898
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
872
899
|
const { tx } = useThemeContext();
|
|
873
900
|
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Separator, {
|
|
874
901
|
...props,
|
|
@@ -876,7 +903,7 @@ var ContextMenuSeparator = /* @__PURE__ */ forwardRef14(({ classNames, ...props
|
|
|
876
903
|
ref: forwardedRef
|
|
877
904
|
});
|
|
878
905
|
});
|
|
879
|
-
var ContextMenuGroupLabel = /* @__PURE__ */
|
|
906
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
880
907
|
const { tx } = useThemeContext();
|
|
881
908
|
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Label, {
|
|
882
909
|
...props,
|
|
@@ -906,18 +933,17 @@ import { createContextScope } from "@radix-ui/react-context";
|
|
|
906
933
|
import { useId as useId2 } from "@radix-ui/react-id";
|
|
907
934
|
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
908
935
|
import { createMenuScope } from "@radix-ui/react-menu";
|
|
909
|
-
import { Primitive as
|
|
910
|
-
import { Slot as
|
|
936
|
+
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
937
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
911
938
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
912
|
-
import React16, { forwardRef as
|
|
939
|
+
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2 } from "react";
|
|
913
940
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
914
941
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
915
942
|
createMenuScope
|
|
916
943
|
]);
|
|
917
944
|
var useMenuScope = createMenuScope();
|
|
918
945
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
919
|
-
var DropdownMenuRoot = (
|
|
920
|
-
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
946
|
+
var DropdownMenuRoot = ({ __scopeDropdownMenu, children, dir, modal = true, open: openProp, defaultOpen, onOpenChange }) => {
|
|
921
947
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
922
948
|
const triggerRef = useRef2(null);
|
|
923
949
|
const [open = false, setOpen] = useControllableState({
|
|
@@ -938,22 +964,22 @@ var DropdownMenuRoot = (props) => {
|
|
|
938
964
|
modal
|
|
939
965
|
}, /* @__PURE__ */ React16.createElement(MenuPrimitive.Root, {
|
|
940
966
|
...menuScope,
|
|
941
|
-
open,
|
|
942
|
-
onOpenChange: setOpen,
|
|
943
967
|
dir,
|
|
944
|
-
modal
|
|
968
|
+
modal,
|
|
969
|
+
open,
|
|
970
|
+
onOpenChange: setOpen
|
|
945
971
|
}, children));
|
|
946
972
|
};
|
|
947
973
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
948
974
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
949
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
975
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
950
976
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
951
977
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
952
978
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
953
979
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Anchor, {
|
|
954
980
|
asChild: true,
|
|
955
981
|
...menuScope
|
|
956
|
-
}, /* @__PURE__ */ React16.createElement(
|
|
982
|
+
}, /* @__PURE__ */ React16.createElement(Primitive10.button, {
|
|
957
983
|
type: "button",
|
|
958
984
|
id: context.triggerId,
|
|
959
985
|
"aria-haspopup": "menu",
|
|
@@ -1023,9 +1049,9 @@ var DropdownMenuPortal = (props) => {
|
|
|
1023
1049
|
});
|
|
1024
1050
|
};
|
|
1025
1051
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1026
|
-
var DropdownMenuViewport = /* @__PURE__ */
|
|
1052
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef10(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1027
1053
|
const { tx } = useThemeContext();
|
|
1028
|
-
const Comp = asChild ?
|
|
1054
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1029
1055
|
return /* @__PURE__ */ React16.createElement(Comp, {
|
|
1030
1056
|
...props,
|
|
1031
1057
|
className: tx("menu.viewport", {}, classNames),
|
|
@@ -1033,7 +1059,7 @@ var DropdownMenuViewport = /* @__PURE__ */ forwardRef15(({ classNames, asChild,
|
|
|
1033
1059
|
}, children);
|
|
1034
1060
|
});
|
|
1035
1061
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1036
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
1062
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1037
1063
|
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
1038
1064
|
const { tx } = useThemeContext();
|
|
1039
1065
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
@@ -1041,7 +1067,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) =>
|
|
|
1041
1067
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1042
1068
|
const hasInteractedOutsideRef = useRef2(false);
|
|
1043
1069
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1044
|
-
const computedCollisionBoundary =
|
|
1070
|
+
const computedCollisionBoundary = useMemo4(() => {
|
|
1045
1071
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
1046
1072
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
1047
1073
|
closestBoundary,
|
|
@@ -1099,7 +1125,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef15((props, forwardedRef) =>
|
|
|
1099
1125
|
});
|
|
1100
1126
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1101
1127
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
1102
|
-
var DropdownMenuGroup = /* @__PURE__ */
|
|
1128
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1103
1129
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1104
1130
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1105
1131
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Group, {
|
|
@@ -1110,7 +1136,7 @@ var DropdownMenuGroup = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
|
1110
1136
|
});
|
|
1111
1137
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1112
1138
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
1113
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */
|
|
1139
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1114
1140
|
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1115
1141
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1116
1142
|
const { tx } = useThemeContext();
|
|
@@ -1123,7 +1149,7 @@ var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1123
1149
|
});
|
|
1124
1150
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1125
1151
|
var ITEM_NAME = "DropdownMenuItem";
|
|
1126
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
1152
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1127
1153
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1128
1154
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1129
1155
|
const { tx } = useThemeContext();
|
|
@@ -1136,7 +1162,7 @@ var DropdownMenuItem = /* @__PURE__ */ forwardRef15((props, forwardedRef) => {
|
|
|
1136
1162
|
});
|
|
1137
1163
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1138
1164
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1139
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
1165
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1140
1166
|
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1141
1167
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1142
1168
|
const { tx } = useThemeContext();
|
|
@@ -1149,7 +1175,7 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef15((props, forwardedRef
|
|
|
1149
1175
|
});
|
|
1150
1176
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1151
1177
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
1152
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */
|
|
1178
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1153
1179
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1154
1180
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1155
1181
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.RadioGroup, {
|
|
@@ -1160,7 +1186,7 @@ var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1160
1186
|
});
|
|
1161
1187
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1162
1188
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
1163
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
1189
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1164
1190
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1165
1191
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1166
1192
|
const { tx } = useThemeContext();
|
|
@@ -1173,7 +1199,7 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef15((props, forwardedRef) =
|
|
|
1173
1199
|
});
|
|
1174
1200
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1175
1201
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1176
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
1202
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1177
1203
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1178
1204
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1179
1205
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.ItemIndicator, {
|
|
@@ -1184,7 +1210,7 @@ var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef15((props, forwardedRe
|
|
|
1184
1210
|
});
|
|
1185
1211
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1186
1212
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1187
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
1213
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1188
1214
|
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1189
1215
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1190
1216
|
const { tx } = useThemeContext();
|
|
@@ -1197,7 +1223,7 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef15((props, forwardedRef) =
|
|
|
1197
1223
|
});
|
|
1198
1224
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1199
1225
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
1200
|
-
var DropdownMenuArrow = /* @__PURE__ */
|
|
1226
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1201
1227
|
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1202
1228
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1203
1229
|
const { tx } = useThemeContext();
|
|
@@ -1224,7 +1250,7 @@ var DropdownMenuSub = (props) => {
|
|
|
1224
1250
|
}, children);
|
|
1225
1251
|
};
|
|
1226
1252
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1227
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
1253
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1228
1254
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1229
1255
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1230
1256
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubTrigger, {
|
|
@@ -1235,7 +1261,7 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef15((props, forwardedRef)
|
|
|
1235
1261
|
});
|
|
1236
1262
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1237
1263
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1238
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
1264
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1239
1265
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1240
1266
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1241
1267
|
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubContent, {
|
|
@@ -1279,13 +1305,13 @@ var DropdownMenu = {
|
|
|
1279
1305
|
var useDropdownMenuMenuScope = useMenuScope;
|
|
1280
1306
|
|
|
1281
1307
|
// src/components/Separator/Separator.tsx
|
|
1282
|
-
import
|
|
1283
|
-
import React17, { forwardRef as
|
|
1284
|
-
var Separator3 = /* @__PURE__ */
|
|
1308
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
1309
|
+
import React17, { forwardRef as forwardRef11 } from "react";
|
|
1310
|
+
var Separator3 = /* @__PURE__ */ forwardRef11(({ classNames, orientation = "horizontal", subdued, ...props }, forwardedRef) => {
|
|
1285
1311
|
const { tx } = useThemeContext();
|
|
1286
|
-
return /* @__PURE__ */ React17.createElement(SeparatorPrimitive, {
|
|
1287
|
-
orientation,
|
|
1312
|
+
return /* @__PURE__ */ React17.createElement(SeparatorPrimitive.Root, {
|
|
1288
1313
|
...props,
|
|
1314
|
+
orientation,
|
|
1289
1315
|
className: tx("separator.root", {
|
|
1290
1316
|
orientation,
|
|
1291
1317
|
subdued
|
|
@@ -1295,18 +1321,14 @@ var Separator3 = /* @__PURE__ */ forwardRef16(({ classNames, orientation = "hori
|
|
|
1295
1321
|
});
|
|
1296
1322
|
|
|
1297
1323
|
// src/components/Toolbar/Toolbar.tsx
|
|
1298
|
-
var ToolbarRoot =
|
|
1299
|
-
const { className,
|
|
1324
|
+
var ToolbarRoot = composable2(({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {
|
|
1325
|
+
const { className, role, ...rest } = composableProps6(props);
|
|
1300
1326
|
const { tx } = useThemeContext();
|
|
1301
|
-
const InnerRoot = textBlockWidthProp ? "div" : Fragment;
|
|
1302
|
-
const innerRootProps = textBlockWidthProp ? {
|
|
1303
|
-
role: "none",
|
|
1304
|
-
className: tx("toolbar.inner", {
|
|
1305
|
-
layoutManaged
|
|
1306
|
-
}, className)
|
|
1307
|
-
} : {};
|
|
1308
1327
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Root, {
|
|
1309
1328
|
...rest,
|
|
1329
|
+
...role !== "none" && {
|
|
1330
|
+
role
|
|
1331
|
+
},
|
|
1310
1332
|
orientation,
|
|
1311
1333
|
"data-arrow-keys": orientation === "vertical" ? "up down" : "left right",
|
|
1312
1334
|
className: tx("toolbar.root", {
|
|
@@ -1315,11 +1337,11 @@ var ToolbarRoot = /* @__PURE__ */ forwardRef17(({ children, density, disabled, l
|
|
|
1315
1337
|
layoutManaged
|
|
1316
1338
|
}, className),
|
|
1317
1339
|
ref: forwardedRef
|
|
1318
|
-
},
|
|
1340
|
+
}, children);
|
|
1319
1341
|
});
|
|
1320
|
-
var ToolbarText =
|
|
1342
|
+
var ToolbarText = slottable5(({ children, asChild, ...props }, forwardedRef) => {
|
|
1321
1343
|
const { className, ...rest } = composableProps6(props);
|
|
1322
|
-
const Comp = asChild ?
|
|
1344
|
+
const Comp = asChild ? Slot11 : Primitive11.div;
|
|
1323
1345
|
const { tx } = useThemeContext();
|
|
1324
1346
|
return /* @__PURE__ */ React18.createElement(Comp, {
|
|
1325
1347
|
...rest,
|
|
@@ -1327,7 +1349,7 @@ var ToolbarText = /* @__PURE__ */ forwardRef17(({ children, asChild, ...props },
|
|
|
1327
1349
|
ref: forwardedRef
|
|
1328
1350
|
}, children);
|
|
1329
1351
|
});
|
|
1330
|
-
var ToolbarButton = /* @__PURE__ */
|
|
1352
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1331
1353
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1332
1354
|
asChild: true
|
|
1333
1355
|
}, /* @__PURE__ */ React18.createElement(Button, {
|
|
@@ -1335,7 +1357,7 @@ var ToolbarButton = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
1335
1357
|
ref: forwardedRef
|
|
1336
1358
|
}));
|
|
1337
1359
|
});
|
|
1338
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
1360
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1339
1361
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1340
1362
|
asChild: true
|
|
1341
1363
|
}, /* @__PURE__ */ React18.createElement(IconButton, {
|
|
@@ -1344,7 +1366,7 @@ var ToolbarIconButton = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
1344
1366
|
ref: forwardedRef
|
|
1345
1367
|
}));
|
|
1346
1368
|
});
|
|
1347
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
1369
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1348
1370
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1349
1371
|
asChild: true
|
|
1350
1372
|
}, /* @__PURE__ */ React18.createElement(Toggle, {
|
|
@@ -1352,7 +1374,7 @@ var ToolbarToggle = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
1352
1374
|
ref: forwardedRef
|
|
1353
1375
|
}));
|
|
1354
1376
|
});
|
|
1355
|
-
var ToolbarLink = /* @__PURE__ */
|
|
1377
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1356
1378
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Link, {
|
|
1357
1379
|
asChild: true
|
|
1358
1380
|
}, /* @__PURE__ */ React18.createElement(Link, {
|
|
@@ -1360,7 +1382,7 @@ var ToolbarLink = /* @__PURE__ */ forwardRef17((props, forwardedRef) => {
|
|
|
1360
1382
|
ref: forwardedRef
|
|
1361
1383
|
}));
|
|
1362
1384
|
});
|
|
1363
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
1385
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef12(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
1364
1386
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
1365
1387
|
...props,
|
|
1366
1388
|
asChild: true
|
|
@@ -1371,7 +1393,7 @@ var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef17(({ classNames, children,
|
|
|
1371
1393
|
ref: forwardedRef
|
|
1372
1394
|
}));
|
|
1373
1395
|
});
|
|
1374
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
1396
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
1375
1397
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1376
1398
|
...props,
|
|
1377
1399
|
asChild: true
|
|
@@ -1384,7 +1406,7 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef17(({ variant, density, e
|
|
|
1384
1406
|
ref: forwardedRef
|
|
1385
1407
|
}));
|
|
1386
1408
|
});
|
|
1387
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
1409
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
1388
1410
|
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1389
1411
|
...props,
|
|
1390
1412
|
asChild: true
|
|
@@ -1399,10 +1421,11 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef17(({ variant, densit
|
|
|
1399
1421
|
ref: forwardedRef
|
|
1400
1422
|
}));
|
|
1401
1423
|
});
|
|
1402
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
1424
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef12(({ variant = "gap", ...props }, forwardedRef) => {
|
|
1403
1425
|
return variant === "line" ? /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
1404
1426
|
asChild: true
|
|
1405
1427
|
}, /* @__PURE__ */ React18.createElement(Separator3, {
|
|
1428
|
+
orientation: "vertical",
|
|
1406
1429
|
...props,
|
|
1407
1430
|
ref: forwardedRef
|
|
1408
1431
|
})) : /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
@@ -1410,30 +1433,29 @@ var ToolbarSeparator = /* @__PURE__ */ forwardRef17(({ variant = "gap", ...props
|
|
|
1410
1433
|
ref: forwardedRef
|
|
1411
1434
|
});
|
|
1412
1435
|
});
|
|
1413
|
-
var ToolbarDragHandle = /* @__PURE__ */
|
|
1436
|
+
var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1414
1437
|
const { t } = useTranslation2(translationKey);
|
|
1415
1438
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1416
1439
|
"data-testid": testId,
|
|
1440
|
+
tabIndex: -1,
|
|
1417
1441
|
noTooltip: true,
|
|
1418
1442
|
iconOnly: true,
|
|
1419
1443
|
icon: "ph--dots-six-vertical--regular",
|
|
1420
1444
|
variant: "ghost",
|
|
1421
|
-
label: label ?? t("toolbar
|
|
1422
|
-
classNames: "cursor-pointer",
|
|
1423
|
-
size: 5,
|
|
1445
|
+
label: label ?? t("toolbar-drag-handle.label"),
|
|
1446
|
+
classNames: "dx-focus-ring-none cursor-pointer",
|
|
1424
1447
|
disabled: !forwardedRef,
|
|
1425
1448
|
ref: forwardedRef
|
|
1426
1449
|
});
|
|
1427
1450
|
});
|
|
1428
|
-
var ToolbarCloseIconButton = /* @__PURE__ */
|
|
1451
|
+
var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, forwardedRef) => {
|
|
1429
1452
|
const { t } = useTranslation2(translationKey);
|
|
1430
1453
|
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1431
1454
|
iconOnly: true,
|
|
1432
1455
|
icon: "ph--x--regular",
|
|
1433
1456
|
variant: "ghost",
|
|
1434
|
-
label: label ?? t("toolbar
|
|
1457
|
+
label: label ?? t("toolbar-close.label"),
|
|
1435
1458
|
classNames: "cursor-pointer",
|
|
1436
|
-
size: 5,
|
|
1437
1459
|
onClick,
|
|
1438
1460
|
ref: forwardedRef
|
|
1439
1461
|
});
|
|
@@ -1447,13 +1469,13 @@ var ToolbarMenu = ({ context, items }) => {
|
|
|
1447
1469
|
iconOnly: true,
|
|
1448
1470
|
variant: "ghost",
|
|
1449
1471
|
icon: "ph--dots-three-vertical--regular",
|
|
1450
|
-
label: t("toolbar
|
|
1472
|
+
label: t("toolbar-menu.label")
|
|
1451
1473
|
})), (items?.length ?? 0) > 0 && /* @__PURE__ */ React18.createElement(DropdownMenu.Portal, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Viewport, null, items?.map(({ label, onClick: onSelect }, index) => /* @__PURE__ */ React18.createElement(DropdownMenu.Item, {
|
|
1452
1474
|
key: index,
|
|
1453
1475
|
onSelect: () => onSelect(context)
|
|
1454
1476
|
}, label))), /* @__PURE__ */ React18.createElement(DropdownMenu.Arrow, null))));
|
|
1455
1477
|
};
|
|
1456
|
-
var
|
|
1478
|
+
var Toolbar = {
|
|
1457
1479
|
Root: ToolbarRoot,
|
|
1458
1480
|
Text: ToolbarText,
|
|
1459
1481
|
Button: ToolbarButton,
|
|
@@ -1471,84 +1493,140 @@ var Toolbar2 = {
|
|
|
1471
1493
|
|
|
1472
1494
|
// src/components/Card/Card.tsx
|
|
1473
1495
|
var CardContext = /* @__PURE__ */ createContext3({});
|
|
1474
|
-
var
|
|
1496
|
+
var CARD_ROOT_NAME = "Card.Root";
|
|
1497
|
+
var CardRoot = composable3(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1475
1498
|
const { className, ...rest } = composableProps7(props);
|
|
1476
|
-
const Comp = asChild ? Slot11 : Primitive11.div;
|
|
1477
1499
|
const { tx } = useThemeContext();
|
|
1478
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1500
|
+
return /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1501
|
+
asChild: true,
|
|
1502
|
+
gutter: density === "coarse" ? "lg" : "md",
|
|
1503
|
+
classNames: tx("card.root", {
|
|
1504
|
+
border,
|
|
1505
|
+
fullWidth
|
|
1506
|
+
}, className),
|
|
1507
|
+
role: role ?? "group"
|
|
1508
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1479
1509
|
...rest,
|
|
1480
1510
|
...id && {
|
|
1481
1511
|
"data-object-id": id
|
|
1482
1512
|
},
|
|
1483
|
-
role: role ?? "group",
|
|
1484
|
-
className: tx("card.root", {
|
|
1485
|
-
border,
|
|
1486
|
-
fullWidth
|
|
1487
|
-
}, className),
|
|
1488
1513
|
ref: forwardedRef
|
|
1489
|
-
}, /* @__PURE__ */ React19.createElement(Column.Root, {
|
|
1490
|
-
gutter: "rail"
|
|
1491
1514
|
}, children));
|
|
1492
1515
|
});
|
|
1493
|
-
|
|
1516
|
+
CardRoot.displayName = CARD_ROOT_NAME;
|
|
1517
|
+
var CARD_TOOLBAR_NAME = "Card.Toolbar";
|
|
1518
|
+
var CardToolbar = composable3(({ children, classNames, ...props }, forwardedRef) => {
|
|
1494
1519
|
const { tx } = useThemeContext();
|
|
1495
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1520
|
+
return /* @__PURE__ */ React19.createElement(Toolbar.Root, {
|
|
1496
1521
|
...props,
|
|
1522
|
+
style: iconSize(5),
|
|
1497
1523
|
classNames: [
|
|
1498
|
-
tx("card.toolbar", {
|
|
1499
|
-
coarse: density !== "fine"
|
|
1500
|
-
}),
|
|
1524
|
+
tx("card.toolbar", {}),
|
|
1501
1525
|
classNames
|
|
1502
1526
|
],
|
|
1503
1527
|
ref: forwardedRef
|
|
1504
1528
|
}, children);
|
|
1505
1529
|
});
|
|
1506
|
-
|
|
1530
|
+
CardToolbar.displayName = CARD_TOOLBAR_NAME;
|
|
1531
|
+
var CARD_DRAG_HANDLE_NAME = "Card.DragHandle";
|
|
1532
|
+
var CardDragHandle = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1533
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1534
|
+
padding: true
|
|
1535
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.DragHandle, {
|
|
1536
|
+
...props,
|
|
1537
|
+
ref: forwardedRef
|
|
1538
|
+
}));
|
|
1539
|
+
});
|
|
1540
|
+
CardDragHandle.displayName = CARD_DRAG_HANDLE_NAME;
|
|
1541
|
+
var CARD_CLOSE_ICON_BUTTON_NAME = "Card.CloseIconButton";
|
|
1542
|
+
var CloseIconButton = /* @__PURE__ */ forwardRef13((props, forwardedRef) => {
|
|
1543
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1544
|
+
padding: true
|
|
1545
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.CloseIconButton, {
|
|
1546
|
+
...props,
|
|
1547
|
+
ref: forwardedRef
|
|
1548
|
+
}));
|
|
1549
|
+
});
|
|
1550
|
+
CloseIconButton.displayName = CARD_CLOSE_ICON_BUTTON_NAME;
|
|
1551
|
+
var CARD_MENU_NAME = "Card.Menu";
|
|
1552
|
+
var CardMenu = ({ context, items, ...props }) => {
|
|
1507
1553
|
const { menuItems } = useContext3(CardContext) ?? {};
|
|
1508
1554
|
const combinedItems = [
|
|
1509
1555
|
...items ?? [],
|
|
1510
1556
|
...menuItems ?? []
|
|
1511
1557
|
];
|
|
1512
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1558
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1559
|
+
padding: true
|
|
1560
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.Menu, {
|
|
1561
|
+
...props,
|
|
1513
1562
|
context,
|
|
1514
1563
|
items: combinedItems
|
|
1515
|
-
});
|
|
1564
|
+
}));
|
|
1516
1565
|
};
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1566
|
+
CardMenu.displayName = CARD_MENU_NAME;
|
|
1567
|
+
var CARD_ICON_NAME = "Card.Icon";
|
|
1568
|
+
var CardIcon = (props) => {
|
|
1569
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, null, /* @__PURE__ */ React19.createElement(Icon, props));
|
|
1570
|
+
};
|
|
1571
|
+
CardIcon.displayName = CARD_ICON_NAME;
|
|
1572
|
+
var CARD_ICON_BLOCK_NAME = "Card.IconBlock";
|
|
1573
|
+
var CardIconBlock = /* @__PURE__ */ forwardRef13(({ classNames, children, padding, ...props }, forwardedRef) => {
|
|
1574
|
+
const { tx } = useThemeContext();
|
|
1575
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1576
|
+
...props,
|
|
1577
|
+
className: tx("card.icon-block", {
|
|
1578
|
+
padding
|
|
1579
|
+
}, classNames),
|
|
1580
|
+
ref: forwardedRef
|
|
1581
|
+
}, children);
|
|
1582
|
+
});
|
|
1583
|
+
CardIconBlock.displayName = CARD_ICON_BLOCK_NAME;
|
|
1584
|
+
var CARD_TITLE_NAME = "Card.Title";
|
|
1585
|
+
var CardTitle = slottable6(({ children, asChild, ...props }, forwardedRef) => {
|
|
1520
1586
|
const { tx } = useThemeContext();
|
|
1587
|
+
const { className, ...rest } = composableProps7(props, {
|
|
1588
|
+
role: "heading"
|
|
1589
|
+
});
|
|
1590
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1521
1591
|
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1522
1592
|
...rest,
|
|
1523
|
-
role: role ?? "heading",
|
|
1524
1593
|
className: tx("card.title", {}, className),
|
|
1525
1594
|
ref: forwardedRef
|
|
1526
1595
|
}, children);
|
|
1527
1596
|
});
|
|
1528
|
-
|
|
1597
|
+
CardTitle.displayName = CARD_TITLE_NAME;
|
|
1598
|
+
var CARD_CONTENT_NAME = "Card.Content";
|
|
1599
|
+
var CardContent = slottable6(({ children, asChild, ...props }, forwardedRef) => {
|
|
1600
|
+
const { className, ...rest } = composableProps7(props);
|
|
1601
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1529
1602
|
const { tx } = useThemeContext();
|
|
1530
|
-
return /* @__PURE__ */ React19.createElement(
|
|
1531
|
-
...
|
|
1532
|
-
|
|
1533
|
-
className: tx("card.content", {}),
|
|
1603
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1604
|
+
...rest,
|
|
1605
|
+
className: tx("card.content", {}, className),
|
|
1534
1606
|
ref: forwardedRef
|
|
1535
1607
|
}, children);
|
|
1536
1608
|
});
|
|
1537
|
-
|
|
1609
|
+
CardContent.displayName = CARD_CONTENT_NAME;
|
|
1610
|
+
var CARD_ROW_NAME = "Card.Row";
|
|
1611
|
+
var CardRow = slottable6(({ children, asChild, icon, ...props }, forwardedRef) => {
|
|
1538
1612
|
const { className, ...rest } = composableProps7(props);
|
|
1539
|
-
|
|
1613
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1614
|
+
const { tx } = useThemeContext();
|
|
1615
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1540
1616
|
...rest,
|
|
1541
|
-
|
|
1542
|
-
classNames: className,
|
|
1617
|
+
className: tx("card.row", {}, className),
|
|
1543
1618
|
ref: forwardedRef
|
|
1544
1619
|
}, icon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1545
1620
|
classNames: "text-subdued",
|
|
1546
|
-
icon
|
|
1547
|
-
|
|
1621
|
+
icon,
|
|
1622
|
+
size: 4
|
|
1623
|
+
}) || /* @__PURE__ */ React19.createElement("div", null), children);
|
|
1548
1624
|
});
|
|
1549
|
-
|
|
1625
|
+
CardRow.displayName = CARD_ROW_NAME;
|
|
1626
|
+
var CARD_SECTION_NAME = "Card.Section";
|
|
1627
|
+
var CardSection = slottable6(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
1550
1628
|
const { className, ...rest } = composableProps7(props);
|
|
1551
|
-
const Comp = asChild ?
|
|
1629
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1552
1630
|
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1553
1631
|
...rest,
|
|
1554
1632
|
role: role ?? "none",
|
|
@@ -1556,9 +1634,11 @@ var CardSection = /* @__PURE__ */ forwardRef18(({ children, asChild, role, ...pr
|
|
|
1556
1634
|
ref: forwardedRef
|
|
1557
1635
|
}, children);
|
|
1558
1636
|
});
|
|
1559
|
-
|
|
1637
|
+
CardSection.displayName = CARD_SECTION_NAME;
|
|
1638
|
+
var CARD_HEADING_NAME = "Card.Heading";
|
|
1639
|
+
var CardHeading = slottable6(({ children, asChild, role, variant = "default", ...props }, forwardedRef) => {
|
|
1560
1640
|
const { className, ...rest } = composableProps7(props);
|
|
1561
|
-
const Comp = asChild ?
|
|
1641
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1562
1642
|
const { tx } = useThemeContext();
|
|
1563
1643
|
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1564
1644
|
...rest,
|
|
@@ -1569,9 +1649,11 @@ var CardHeading = /* @__PURE__ */ forwardRef18(({ children, asChild, role, varia
|
|
|
1569
1649
|
ref: forwardedRef
|
|
1570
1650
|
}, children);
|
|
1571
1651
|
});
|
|
1572
|
-
|
|
1652
|
+
CardHeading.displayName = CARD_HEADING_NAME;
|
|
1653
|
+
var CARD_TEXT_NAME = "Card.Text";
|
|
1654
|
+
var CardText = slottable6(({ children, asChild, role, truncate, variant = "default", ...props }, forwardedRef) => {
|
|
1573
1655
|
const { className, ...rest } = composableProps7(props);
|
|
1574
|
-
const Comp = asChild ?
|
|
1656
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1575
1657
|
const { tx } = useThemeContext();
|
|
1576
1658
|
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1577
1659
|
...rest,
|
|
@@ -1587,13 +1669,32 @@ var CardText = /* @__PURE__ */ forwardRef18(({ children, asChild, role, truncate
|
|
|
1587
1669
|
})
|
|
1588
1670
|
}, children));
|
|
1589
1671
|
});
|
|
1672
|
+
CardText.displayName = CARD_TEXT_NAME;
|
|
1673
|
+
var CARD_HTML_NAME = "Card.Html";
|
|
1674
|
+
var CardHtml = ({ html, variant = "default", ...props }) => {
|
|
1675
|
+
const { tx } = useThemeContext();
|
|
1676
|
+
const sanitized = useMemo5(() => DOMPurify.sanitize(html), [
|
|
1677
|
+
html
|
|
1678
|
+
]);
|
|
1679
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1680
|
+
...props,
|
|
1681
|
+
className: tx("card.text", {
|
|
1682
|
+
variant
|
|
1683
|
+
}),
|
|
1684
|
+
// eslint-disable-next-line react/no-danger
|
|
1685
|
+
dangerouslySetInnerHTML: {
|
|
1686
|
+
__html: sanitized
|
|
1687
|
+
}
|
|
1688
|
+
});
|
|
1689
|
+
};
|
|
1690
|
+
CardHtml.displayName = CARD_HTML_NAME;
|
|
1691
|
+
var CARD_POSTER_NAME = "Card.Poster";
|
|
1590
1692
|
var CardPoster = (props) => {
|
|
1591
1693
|
const { tx } = useThemeContext();
|
|
1592
1694
|
const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
|
|
1593
1695
|
if (props.image) {
|
|
1594
1696
|
return /* @__PURE__ */ React19.createElement("div", {
|
|
1595
|
-
|
|
1596
|
-
className: "col-span-full mb-1"
|
|
1697
|
+
className: "col-span-full"
|
|
1597
1698
|
}, /* @__PURE__ */ React19.createElement(Image, {
|
|
1598
1699
|
classNames: [
|
|
1599
1700
|
tx("card.poster", {}),
|
|
@@ -1601,7 +1702,8 @@ var CardPoster = (props) => {
|
|
|
1601
1702
|
props.classNames
|
|
1602
1703
|
],
|
|
1603
1704
|
src: props.image,
|
|
1604
|
-
alt: props.alt
|
|
1705
|
+
alt: props.alt,
|
|
1706
|
+
fit: props.fit
|
|
1605
1707
|
}));
|
|
1606
1708
|
}
|
|
1607
1709
|
if (props.icon) {
|
|
@@ -1618,6 +1720,8 @@ var CardPoster = (props) => {
|
|
|
1618
1720
|
}));
|
|
1619
1721
|
}
|
|
1620
1722
|
};
|
|
1723
|
+
CardPoster.displayName = CARD_POSTER_NAME;
|
|
1724
|
+
var CARD_ACTION_NAME = "Card.Action";
|
|
1621
1725
|
var CardAction = ({ icon, actionIcon = "ph--arrow-right--regular", label, onClick }) => {
|
|
1622
1726
|
const { tx } = useThemeContext();
|
|
1623
1727
|
return /* @__PURE__ */ React19.createElement(Button, {
|
|
@@ -1626,13 +1730,17 @@ var CardAction = ({ icon, actionIcon = "ph--arrow-right--regular", label, onClic
|
|
|
1626
1730
|
onClick
|
|
1627
1731
|
}, icon ? /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1628
1732
|
classNames: "text-subdued",
|
|
1629
|
-
icon
|
|
1733
|
+
icon,
|
|
1734
|
+
size: 4
|
|
1630
1735
|
}) : /* @__PURE__ */ React19.createElement("div", null), /* @__PURE__ */ React19.createElement("span", {
|
|
1631
1736
|
className: tx("card.action-label", {}, !actionIcon ? "col-span-2" : void 0)
|
|
1632
1737
|
}, label), actionIcon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1633
|
-
icon: actionIcon
|
|
1738
|
+
icon: actionIcon,
|
|
1739
|
+
size: 4
|
|
1634
1740
|
}));
|
|
1635
1741
|
};
|
|
1742
|
+
CardAction.displayName = CARD_ACTION_NAME;
|
|
1743
|
+
var CARD_LINK_NAME = "Card.Link";
|
|
1636
1744
|
var CardLink = ({ label, href }) => {
|
|
1637
1745
|
const { tx } = useThemeContext();
|
|
1638
1746
|
return /* @__PURE__ */ React19.createElement("a", {
|
|
@@ -1651,42 +1759,27 @@ var CardLink = ({ label, href }) => {
|
|
|
1651
1759
|
icon: "ph--arrow-square-out--regular"
|
|
1652
1760
|
}));
|
|
1653
1761
|
};
|
|
1654
|
-
|
|
1655
|
-
return /* @__PURE__ */ React19.createElement(CardIconBlock, null, /* @__PURE__ */ React19.createElement(Icon, {
|
|
1656
|
-
...props,
|
|
1657
|
-
size: toolbar ? 5 : 4
|
|
1658
|
-
}));
|
|
1659
|
-
};
|
|
1660
|
-
var CardIconBlock = ({ classNames, children, role, ...props }) => {
|
|
1661
|
-
const { tx } = useThemeContext();
|
|
1662
|
-
return /* @__PURE__ */ React19.createElement("div", {
|
|
1663
|
-
...props,
|
|
1664
|
-
role: role ?? "none",
|
|
1665
|
-
className: tx("card.icon-block", {}, classNames)
|
|
1666
|
-
}, children);
|
|
1667
|
-
};
|
|
1762
|
+
CardLink.displayName = CARD_LINK_NAME;
|
|
1668
1763
|
var Card = {
|
|
1669
1764
|
Root: CardRoot,
|
|
1670
1765
|
// Toolbar
|
|
1671
1766
|
Toolbar: CardToolbar,
|
|
1672
|
-
ToolbarIconButton:
|
|
1673
|
-
ToolbarSeparator:
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
})),
|
|
1679
|
-
CloseIconButton: Toolbar2.CloseIconButton,
|
|
1680
|
-
Title: CardTitle,
|
|
1767
|
+
ToolbarIconButton: Toolbar.IconButton,
|
|
1768
|
+
ToolbarSeparator: Toolbar.Separator,
|
|
1769
|
+
// Toolbar blocks
|
|
1770
|
+
IconBlock: CardIconBlock,
|
|
1771
|
+
DragHandle: CardDragHandle,
|
|
1772
|
+
CloseIconButton,
|
|
1681
1773
|
Menu: CardMenu,
|
|
1682
1774
|
Icon: CardIcon,
|
|
1683
|
-
|
|
1775
|
+
Title: CardTitle,
|
|
1684
1776
|
// Content
|
|
1685
1777
|
Content: CardContent,
|
|
1686
1778
|
Row: CardRow,
|
|
1687
1779
|
Section: CardSection,
|
|
1688
1780
|
Heading: CardHeading,
|
|
1689
1781
|
Text: CardText,
|
|
1782
|
+
Html: CardHtml,
|
|
1690
1783
|
Poster: CardPoster,
|
|
1691
1784
|
Action: CardAction,
|
|
1692
1785
|
Link: CardLink
|
|
@@ -1731,19 +1824,17 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1731
1824
|
onClick: () => setTextValue(value),
|
|
1732
1825
|
"data-testid": "copy-invitation"
|
|
1733
1826
|
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1734
|
-
role: "none",
|
|
1735
1827
|
className: mx7("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1736
1828
|
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1737
1829
|
className: "px-1"
|
|
1738
|
-
}, t("copy
|
|
1830
|
+
}, t("copy.label")), /* @__PURE__ */ React21.createElement(Icon, {
|
|
1739
1831
|
icon: "ph--copy--regular",
|
|
1740
1832
|
size
|
|
1741
1833
|
})), /* @__PURE__ */ React21.createElement("div", {
|
|
1742
|
-
role: "none",
|
|
1743
1834
|
className: mx7("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1744
1835
|
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1745
1836
|
className: "px-1"
|
|
1746
|
-
}, t("copy
|
|
1837
|
+
}, t("copy-success.label")), /* @__PURE__ */ React21.createElement(Icon, {
|
|
1747
1838
|
icon: "ph--check--regular",
|
|
1748
1839
|
size
|
|
1749
1840
|
})));
|
|
@@ -1752,7 +1843,7 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
1752
1843
|
const { t } = useTranslation(osTranslations);
|
|
1753
1844
|
const { textValue, setTextValue } = useClipboard();
|
|
1754
1845
|
const isCopied = textValue === value;
|
|
1755
|
-
const label = isCopied ? t("copy
|
|
1846
|
+
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
1756
1847
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1757
1848
|
return /* @__PURE__ */ React21.createElement(IconButton, {
|
|
1758
1849
|
iconOnly: true,
|
|
@@ -1778,20 +1869,27 @@ var Clipboard = {
|
|
|
1778
1869
|
|
|
1779
1870
|
// src/components/Dialog/Dialog.tsx
|
|
1780
1871
|
import { createContext as createContext5 } from "@radix-ui/react-context";
|
|
1781
|
-
import
|
|
1782
|
-
import
|
|
1872
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1873
|
+
import { Primitive as Primitive13 } from "@radix-ui/react-primitive";
|
|
1874
|
+
import { Slot as Slot13 } from "@radix-ui/react-slot";
|
|
1875
|
+
import React22, { forwardRef as forwardRef14 } from "react";
|
|
1783
1876
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1784
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
1877
|
+
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
1785
1878
|
var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvider, {
|
|
1786
1879
|
elevation: "dialog"
|
|
1787
|
-
}, /* @__PURE__ */ React22.createElement(
|
|
1788
|
-
|
|
1789
|
-
|
|
1880
|
+
}, /* @__PURE__ */ React22.createElement(DialogPrimitive.Root, {
|
|
1881
|
+
// NOTE: Radix warning unless set to undefined.
|
|
1882
|
+
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1883
|
+
"aria-describedby": void 0,
|
|
1884
|
+
...props
|
|
1885
|
+
}));
|
|
1886
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
1887
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
1790
1888
|
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1791
1889
|
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext5(DIALOG_OVERLAY_NAME, {});
|
|
1792
|
-
var DialogOverlay = /* @__PURE__ */
|
|
1890
|
+
var DialogOverlay = /* @__PURE__ */ forwardRef14(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1793
1891
|
const { tx } = useThemeContext();
|
|
1794
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1892
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Overlay, {
|
|
1795
1893
|
...props,
|
|
1796
1894
|
"data-block-align": blockAlign,
|
|
1797
1895
|
className: tx("dialog.overlay", {}, classNames),
|
|
@@ -1802,64 +1900,60 @@ var DialogOverlay = /* @__PURE__ */ forwardRef19(({ classNames, children, blockA
|
|
|
1802
1900
|
});
|
|
1803
1901
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1804
1902
|
var DIALOG_CONTENT_NAME = "DialogContent";
|
|
1805
|
-
var DialogContent = /* @__PURE__ */
|
|
1903
|
+
var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1806
1904
|
const { tx } = useThemeContext();
|
|
1807
1905
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1808
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1906
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Content, {
|
|
1809
1907
|
...props,
|
|
1810
1908
|
// NOTE: Radix warning unless set to undefined.
|
|
1811
1909
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1812
1910
|
"aria-describedby": void 0,
|
|
1813
1911
|
className: tx("dialog.content", {
|
|
1814
|
-
|
|
1815
|
-
|
|
1912
|
+
size,
|
|
1913
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1816
1914
|
}, classNames),
|
|
1817
1915
|
ref: forwardedRef
|
|
1818
|
-
}, /* @__PURE__ */ React22.createElement(Column.Root,
|
|
1916
|
+
}, /* @__PURE__ */ React22.createElement(Column.Root, {
|
|
1917
|
+
classNames: "dx-expander",
|
|
1918
|
+
gutter: "sm"
|
|
1919
|
+
}, children));
|
|
1819
1920
|
});
|
|
1820
1921
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1821
|
-
var DialogHeader =
|
|
1922
|
+
var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1923
|
+
const { className, ...rest } = composableProps8(props);
|
|
1924
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1822
1925
|
const { tx } = useThemeContext();
|
|
1823
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
role: "heading",
|
|
1827
|
-
...props,
|
|
1828
|
-
className: tx("dialog.header", {
|
|
1829
|
-
srOnly
|
|
1830
|
-
}, [
|
|
1831
|
-
classNames
|
|
1832
|
-
]),
|
|
1926
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1927
|
+
...rest,
|
|
1928
|
+
className: tx("dialog.header", {}, className),
|
|
1833
1929
|
ref: forwardedRef
|
|
1834
|
-
})
|
|
1930
|
+
}, children);
|
|
1835
1931
|
});
|
|
1836
|
-
var DialogCloseIconButton = /* @__PURE__ */
|
|
1932
|
+
var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, forwardedRef) => {
|
|
1837
1933
|
const { t } = useTranslation3(osTranslations2);
|
|
1838
1934
|
return /* @__PURE__ */ React22.createElement(IconButton, {
|
|
1839
1935
|
...props,
|
|
1840
|
-
label: label ?? t("close
|
|
1936
|
+
label: label ?? t("close-dialog.label"),
|
|
1841
1937
|
icon: "ph--x--regular",
|
|
1842
1938
|
iconOnly: true,
|
|
1843
1939
|
size: 4,
|
|
1844
|
-
density: "fine",
|
|
1845
1940
|
variant: "ghost",
|
|
1846
1941
|
ref: forwardedRef
|
|
1847
1942
|
});
|
|
1848
1943
|
});
|
|
1849
|
-
var DialogBody =
|
|
1944
|
+
var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1945
|
+
const { className, ...rest } = composableProps8(props);
|
|
1946
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1850
1947
|
const { tx } = useThemeContext();
|
|
1851
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
role: "none",
|
|
1855
|
-
...props,
|
|
1856
|
-
className: tx("dialog.body"),
|
|
1948
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1949
|
+
...rest,
|
|
1950
|
+
className: tx("dialog.body", {}, className),
|
|
1857
1951
|
ref: forwardedRef
|
|
1858
|
-
}, children)
|
|
1952
|
+
}, children);
|
|
1859
1953
|
});
|
|
1860
|
-
var DialogTitle = /* @__PURE__ */
|
|
1954
|
+
var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1861
1955
|
const { tx } = useThemeContext();
|
|
1862
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1956
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Title, {
|
|
1863
1957
|
...props,
|
|
1864
1958
|
className: tx("dialog.title", {
|
|
1865
1959
|
srOnly
|
|
@@ -1867,9 +1961,9 @@ var DialogTitle = /* @__PURE__ */ forwardRef19(({ classNames, srOnly, ...props }
|
|
|
1867
1961
|
ref: forwardedRef
|
|
1868
1962
|
});
|
|
1869
1963
|
});
|
|
1870
|
-
var DialogDescription = /* @__PURE__ */
|
|
1964
|
+
var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1871
1965
|
const { tx } = useThemeContext();
|
|
1872
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1966
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Description, {
|
|
1873
1967
|
...props,
|
|
1874
1968
|
className: tx("dialog.description", {
|
|
1875
1969
|
srOnly
|
|
@@ -1877,17 +1971,17 @@ var DialogDescription = /* @__PURE__ */ forwardRef19(({ classNames, srOnly, ...p
|
|
|
1877
1971
|
ref: forwardedRef
|
|
1878
1972
|
});
|
|
1879
1973
|
});
|
|
1880
|
-
var DialogActionBar =
|
|
1974
|
+
var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1975
|
+
const { className: classNames, ...rest } = composableProps8(props);
|
|
1976
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1881
1977
|
const { tx } = useThemeContext();
|
|
1882
|
-
return /* @__PURE__ */ React22.createElement(
|
|
1883
|
-
|
|
1884
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1885
|
-
...props,
|
|
1978
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1979
|
+
...rest,
|
|
1886
1980
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1887
1981
|
ref: forwardedRef
|
|
1888
|
-
}, children)
|
|
1982
|
+
}, children);
|
|
1889
1983
|
});
|
|
1890
|
-
var DialogClose =
|
|
1984
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1891
1985
|
var Dialog = {
|
|
1892
1986
|
Root: DialogRoot,
|
|
1893
1987
|
Trigger: DialogTrigger,
|
|
@@ -1904,109 +1998,86 @@ var Dialog = {
|
|
|
1904
1998
|
};
|
|
1905
1999
|
|
|
1906
2000
|
// src/components/Dialog/AlertDialog.tsx
|
|
1907
|
-
import
|
|
2001
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
1908
2002
|
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
1909
|
-
import React23, { forwardRef as
|
|
2003
|
+
import React23, { forwardRef as forwardRef15 } from "react";
|
|
1910
2004
|
var AlertDialogRoot = (props) => /* @__PURE__ */ React23.createElement(ElevationProvider, {
|
|
1911
2005
|
elevation: "dialog"
|
|
1912
|
-
}, /* @__PURE__ */ React23.createElement(
|
|
1913
|
-
var AlertDialogTrigger =
|
|
1914
|
-
var AlertDialogPortal =
|
|
1915
|
-
var AlertDialogCancel =
|
|
1916
|
-
var AlertDialogAction =
|
|
1917
|
-
var AlertDialogTitle = /* @__PURE__ */ forwardRef20(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1918
|
-
const { tx } = useThemeContext();
|
|
1919
|
-
return /* @__PURE__ */ React23.createElement(AlertDialogTitlePrimitive, {
|
|
1920
|
-
...props,
|
|
1921
|
-
className: tx("dialog.title", {
|
|
1922
|
-
srOnly
|
|
1923
|
-
}, classNames),
|
|
1924
|
-
ref: forwardedRef
|
|
1925
|
-
});
|
|
1926
|
-
});
|
|
1927
|
-
var AlertDialogDescription = /* @__PURE__ */ forwardRef20(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1928
|
-
const { tx } = useThemeContext();
|
|
1929
|
-
return /* @__PURE__ */ React23.createElement(AlertDialogDescriptionPrimitive, {
|
|
1930
|
-
...props,
|
|
1931
|
-
className: tx("dialog.description", {
|
|
1932
|
-
srOnly
|
|
1933
|
-
}, classNames),
|
|
1934
|
-
ref: forwardedRef
|
|
1935
|
-
});
|
|
1936
|
-
});
|
|
2006
|
+
}, /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Root, props));
|
|
2007
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
2008
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
2009
|
+
var AlertDialogCancel = AlertDialogPrimitive.Cancel;
|
|
2010
|
+
var AlertDialogAction = AlertDialogPrimitive.Action;
|
|
1937
2011
|
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
1938
2012
|
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
1939
|
-
var ALERT_DIALOG_BODY_NAME = "AlertDialogBody";
|
|
1940
|
-
var ALERT_DIALOG_ACTIONBAR_NAME = "AlertDialogActionBar";
|
|
1941
2013
|
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext6(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1942
2014
|
inOverlayLayout: false
|
|
1943
2015
|
});
|
|
1944
|
-
var AlertDialogOverlay = /* @__PURE__ */
|
|
2016
|
+
var AlertDialogOverlay = /* @__PURE__ */ forwardRef15(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1945
2017
|
const { tx } = useThemeContext();
|
|
1946
|
-
return /* @__PURE__ */ React23.createElement(
|
|
2018
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Overlay, {
|
|
1947
2019
|
...props,
|
|
1948
2020
|
"data-block-align": blockAlign,
|
|
1949
|
-
className: tx(
|
|
1950
|
-
"dialog.overlay",
|
|
1951
|
-
{},
|
|
1952
|
-
classNames,
|
|
1953
|
-
// TODO(burdon): Move to dialog.ts.
|
|
1954
|
-
"data-[h-align=start]:justify-center",
|
|
1955
|
-
"data-[h-align=start]:items-start",
|
|
1956
|
-
"data-[h-align=center]:place-content-center"
|
|
1957
|
-
),
|
|
2021
|
+
className: tx("dialog.overlay", {}, classNames),
|
|
1958
2022
|
ref: forwardedRef
|
|
1959
2023
|
}, /* @__PURE__ */ React23.createElement(OverlayLayoutProvider2, {
|
|
1960
2024
|
inOverlayLayout: true
|
|
1961
2025
|
}, children));
|
|
1962
2026
|
});
|
|
1963
2027
|
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1964
|
-
var AlertDialogContent = /* @__PURE__ */
|
|
2028
|
+
var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
1965
2029
|
const { tx } = useThemeContext();
|
|
1966
2030
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1967
|
-
return /* @__PURE__ */ React23.createElement(
|
|
2031
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Content, {
|
|
1968
2032
|
...props,
|
|
1969
2033
|
className: tx("dialog.content", {
|
|
1970
2034
|
inOverlayLayout,
|
|
1971
2035
|
size
|
|
1972
2036
|
}, classNames),
|
|
2037
|
+
// NOTE: Radix warning unless set to undefined.
|
|
2038
|
+
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
2039
|
+
"aria-describedby": void 0,
|
|
1973
2040
|
ref: forwardedRef
|
|
1974
|
-
}, /* @__PURE__ */ React23.createElement(Column.Root,
|
|
2041
|
+
}, /* @__PURE__ */ React23.createElement(Column.Root, {
|
|
2042
|
+
classNames: "dx-expander",
|
|
2043
|
+
gutter: "sm"
|
|
2044
|
+
}, children));
|
|
1975
2045
|
});
|
|
1976
2046
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
1977
|
-
var
|
|
2047
|
+
var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1978
2048
|
const { tx } = useThemeContext();
|
|
1979
|
-
return /* @__PURE__ */ React23.createElement(
|
|
1980
|
-
asChild: true
|
|
1981
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1982
|
-
role: "none",
|
|
2049
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Title, {
|
|
1983
2050
|
...props,
|
|
1984
|
-
className: tx("dialog.
|
|
2051
|
+
className: tx("dialog.title", {
|
|
2052
|
+
srOnly
|
|
2053
|
+
}, classNames),
|
|
1985
2054
|
ref: forwardedRef
|
|
1986
|
-
}
|
|
2055
|
+
});
|
|
1987
2056
|
});
|
|
1988
|
-
|
|
1989
|
-
var AlertDialogActionBar = /* @__PURE__ */ forwardRef20(({ children, classNames, ...props }, forwardedRef) => {
|
|
2057
|
+
var AlertDialogDescription = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1990
2058
|
const { tx } = useThemeContext();
|
|
1991
|
-
return /* @__PURE__ */ React23.createElement(
|
|
1992
|
-
asChild: true
|
|
1993
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2059
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Description, {
|
|
1994
2060
|
...props,
|
|
1995
|
-
className: tx("dialog.
|
|
2061
|
+
className: tx("dialog.description", {
|
|
2062
|
+
srOnly
|
|
2063
|
+
}, classNames),
|
|
1996
2064
|
ref: forwardedRef
|
|
1997
|
-
}
|
|
2065
|
+
});
|
|
1998
2066
|
});
|
|
1999
|
-
AlertDialogActionBar.displayName = ALERT_DIALOG_ACTIONBAR_NAME;
|
|
2000
2067
|
var AlertDialog = {
|
|
2001
2068
|
Root: AlertDialogRoot,
|
|
2002
2069
|
Trigger: AlertDialogTrigger,
|
|
2003
2070
|
Portal: AlertDialogPortal,
|
|
2004
2071
|
Overlay: AlertDialogOverlay,
|
|
2005
2072
|
Content: AlertDialogContent,
|
|
2006
|
-
|
|
2073
|
+
// Shared with Dialog.
|
|
2074
|
+
Header: Dialog.Header,
|
|
2075
|
+
Body: Dialog.Body,
|
|
2007
2076
|
Title: AlertDialogTitle,
|
|
2008
2077
|
Description: AlertDialogDescription,
|
|
2009
|
-
ActionBar:
|
|
2078
|
+
ActionBar: Dialog.ActionBar,
|
|
2079
|
+
CloseIconButton: Dialog.CloseIconButton,
|
|
2080
|
+
// AlertDialog-specific dismissal.
|
|
2010
2081
|
Cancel: AlertDialogCancel,
|
|
2011
2082
|
Action: AlertDialogAction
|
|
2012
2083
|
};
|
|
@@ -2015,94 +2086,43 @@ var AlertDialog = {
|
|
|
2015
2086
|
import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
2016
2087
|
|
|
2017
2088
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2018
|
-
import React25 from "react";
|
|
2019
|
-
import { safeStringify } from "@dxos/util";
|
|
2020
|
-
|
|
2021
|
-
// src/components/ErrorFallback/ErrorStack.tsx
|
|
2022
|
-
import ErrorStackParser from "error-stack-parser";
|
|
2023
2089
|
import React24 from "react";
|
|
2024
|
-
import {
|
|
2025
|
-
var ErrorStack = ({ error }) => {
|
|
2026
|
-
const frames = ErrorStackParser.parse(error);
|
|
2027
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
2028
|
-
className: "font-mono text-sm"
|
|
2029
|
-
}, frames.map((frame, i) => {
|
|
2030
|
-
const isLast = i === frames.length - 1;
|
|
2031
|
-
const local = frame.fileName ? parseLocalFrame(frame.fileName, frame.lineNumber, frame.columnNumber) : void 0;
|
|
2032
|
-
const name = frame.functionName ?? "<anonymous>";
|
|
2033
|
-
return /* @__PURE__ */ React24.createElement("div", {
|
|
2034
|
-
key: i,
|
|
2035
|
-
className: mx8("grid grid-cols-[16px_1fr_auto_auto] items-stretch gap-x-2", local && "cursor-pointer hover:bg-hover-surface")
|
|
2036
|
-
}, /* @__PURE__ */ React24.createElement("div", {
|
|
2037
|
-
className: "relative"
|
|
2038
|
-
}, /* @__PURE__ */ React24.createElement("div", {
|
|
2039
|
-
className: mx8("absolute left-1/2 -translate-x-1/2 w-px bg-neutral-500", isLast ? "top-0 h-1/2" : "inset-y-0")
|
|
2040
|
-
}), /* @__PURE__ */ React24.createElement("div", {
|
|
2041
|
-
className: "absolute top-1/2 -translate-y-1/2 left-1/2 right-0 h-px bg-neutral-500"
|
|
2042
|
-
})), local ? /* @__PURE__ */ React24.createElement("a", {
|
|
2043
|
-
href: local.href,
|
|
2044
|
-
className: "truncate self-center"
|
|
2045
|
-
}, name) : /* @__PURE__ */ React24.createElement("span", {
|
|
2046
|
-
className: "text-subdued truncate self-center"
|
|
2047
|
-
}, name), /* @__PURE__ */ React24.createElement("span", {
|
|
2048
|
-
className: "text-xs text-subdued truncate self-center"
|
|
2049
|
-
}, local?.fileName ?? ""), /* @__PURE__ */ React24.createElement("span", {
|
|
2050
|
-
className: "text-xs text-subdued text-right self-center"
|
|
2051
|
-
}, local ? `${frame.lineNumber}:${frame.columnNumber}` : ""));
|
|
2052
|
-
}));
|
|
2053
|
-
};
|
|
2054
|
-
var parseLocalFrame = (fileUrl, line, col) => {
|
|
2055
|
-
try {
|
|
2056
|
-
const { pathname } = new URL(fileUrl);
|
|
2057
|
-
if (!pathname.startsWith("/@fs/")) {
|
|
2058
|
-
return void 0;
|
|
2059
|
-
}
|
|
2060
|
-
const localPath = pathname.slice(4);
|
|
2061
|
-
return {
|
|
2062
|
-
href: `vscode://file/${localPath}:${line ?? 1}:${col ?? 1}`,
|
|
2063
|
-
fileName: pathname.split("/").pop() ?? localPath
|
|
2064
|
-
};
|
|
2065
|
-
} catch {
|
|
2066
|
-
return void 0;
|
|
2067
|
-
}
|
|
2068
|
-
};
|
|
2069
|
-
|
|
2070
|
-
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2090
|
+
import { safeStringify } from "@dxos/util";
|
|
2071
2091
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
2072
2092
|
const isDev = true;
|
|
2073
2093
|
const message = error instanceof Error ? error.message : String(error);
|
|
2074
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
2075
2095
|
role: "alert",
|
|
2076
2096
|
"data-testid": "error-boundary-fallback",
|
|
2077
2097
|
className: "flex flex-col p-4 gap-4 overflow-auto"
|
|
2078
|
-
}, /* @__PURE__ */
|
|
2098
|
+
}, /* @__PURE__ */ React24.createElement("h1", {
|
|
2079
2099
|
className: "text-lg text-info-text"
|
|
2080
|
-
}, title ?? "Runtime Error"), /* @__PURE__ */
|
|
2100
|
+
}, title ?? "Runtime Error"), /* @__PURE__ */ React24.createElement("p", null, message), isDev && error instanceof Error && /* @__PURE__ */ React24.createElement(Section, {
|
|
2081
2101
|
title: "Stack",
|
|
2082
2102
|
onClick: () => {
|
|
2083
2103
|
const text = error instanceof Error ? error.stack ?? error.message : String(error);
|
|
2084
2104
|
void navigator.clipboard.writeText(text);
|
|
2085
2105
|
}
|
|
2086
|
-
}, /* @__PURE__ */
|
|
2106
|
+
}, /* @__PURE__ */ React24.createElement(ErrorStack, {
|
|
2087
2107
|
error
|
|
2088
|
-
})), data && /* @__PURE__ */
|
|
2108
|
+
})), data && /* @__PURE__ */ React24.createElement(Section, {
|
|
2089
2109
|
title: "Data",
|
|
2090
2110
|
onClick: () => {
|
|
2091
2111
|
void navigator.clipboard.writeText(JSON.stringify(data, void 0, 2));
|
|
2092
2112
|
}
|
|
2093
|
-
}, /* @__PURE__ */
|
|
2113
|
+
}, /* @__PURE__ */ React24.createElement("pre", {
|
|
2094
2114
|
className: "overflow-x-auto text-xs"
|
|
2095
2115
|
}, safeStringify(data, void 0, 2))), children);
|
|
2096
2116
|
};
|
|
2097
2117
|
var Section = ({ children, title, onClick }) => {
|
|
2098
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ React24.createElement("div", {
|
|
2099
2119
|
className: "flex flex-col gap-1"
|
|
2100
|
-
}, onClick && /* @__PURE__ */
|
|
2120
|
+
}, onClick && /* @__PURE__ */ React24.createElement("button", {
|
|
2101
2121
|
type: "button",
|
|
2102
2122
|
onClick,
|
|
2103
2123
|
className: "flex items-center gap-1 text-xs text-subdued hover:text-primary-500 transition-colors",
|
|
2104
2124
|
title: `Copy ${title}`
|
|
2105
|
-
}, /* @__PURE__ */
|
|
2125
|
+
}, /* @__PURE__ */ React24.createElement("h2", {
|
|
2106
2126
|
className: "text-xs uppercase text-subdued"
|
|
2107
2127
|
}, title)), children);
|
|
2108
2128
|
};
|
|
@@ -2135,13 +2155,122 @@ var generator = ({ error, delay }) => {
|
|
|
2135
2155
|
return error?.() ?? new Error(`Error generated after ${delay}ms`);
|
|
2136
2156
|
};
|
|
2137
2157
|
|
|
2158
|
+
// src/components/Focus/Focus.tsx
|
|
2159
|
+
import { useArrowNavigationGroup, useFocusableGroup, useMergedTabsterAttributes_unstable } from "@fluentui/react-tabster";
|
|
2160
|
+
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
2161
|
+
import { Primitive as Primitive14 } from "@radix-ui/react-primitive";
|
|
2162
|
+
import { Slot as Slot14 } from "@radix-ui/react-slot";
|
|
2163
|
+
import React25, { createContext as createContext7, useCallback as useCallback6, useContext as useContext5, useRef as useRef3, useState as useState6 } from "react";
|
|
2164
|
+
import { composableProps as composableProps9, slottable as slottable8 } from "@dxos/ui-theme";
|
|
2165
|
+
var FOCUS_STATE_ATTR = "focus-state";
|
|
2166
|
+
var FocusContext = /* @__PURE__ */ createContext7({});
|
|
2167
|
+
var useFocus = () => useContext5(FocusContext);
|
|
2168
|
+
var Group3 = slottable8(({ children, asChild, orientation = "vertical", border = false, ...props }, forwardedRef) => {
|
|
2169
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2170
|
+
const { tx } = useThemeContext();
|
|
2171
|
+
const rootRef = useRef3(null);
|
|
2172
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2173
|
+
tabBehavior: "limited-trap-focus"
|
|
2174
|
+
});
|
|
2175
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({
|
|
2176
|
+
axis: orientation,
|
|
2177
|
+
memorizeCurrent: true
|
|
2178
|
+
});
|
|
2179
|
+
const tabsterAttrs = useMergedTabsterAttributes_unstable(focusableGroupAttrs, arrowNavigationAttrs);
|
|
2180
|
+
const [state, setState] = useState6();
|
|
2181
|
+
const [groupHasFocus, setGroupHasFocus] = useState6(false);
|
|
2182
|
+
const handleFocusIn = useCallback6(() => setGroupHasFocus(true), []);
|
|
2183
|
+
const handleFocusOut = useCallback6((event) => {
|
|
2184
|
+
const related = event.relatedTarget;
|
|
2185
|
+
if (!related || !rootRef.current?.contains(related)) {
|
|
2186
|
+
setGroupHasFocus(false);
|
|
2187
|
+
}
|
|
2188
|
+
}, []);
|
|
2189
|
+
const { className, ...rest } = composableProps9(props);
|
|
2190
|
+
return /* @__PURE__ */ React25.createElement(FocusContext.Provider, {
|
|
2191
|
+
value: {
|
|
2192
|
+
setFocus: setState,
|
|
2193
|
+
groupHasFocus
|
|
2194
|
+
}
|
|
2195
|
+
}, /* @__PURE__ */ React25.createElement(Comp, {
|
|
2196
|
+
...rest,
|
|
2197
|
+
tabIndex: 0,
|
|
2198
|
+
className: tx("focus.group", {
|
|
2199
|
+
border
|
|
2200
|
+
}, className),
|
|
2201
|
+
...tabsterAttrs,
|
|
2202
|
+
...state && {
|
|
2203
|
+
[`data-${FOCUS_STATE_ATTR}`]: state
|
|
2204
|
+
},
|
|
2205
|
+
onBlur: handleFocusOut,
|
|
2206
|
+
onFocus: handleFocusIn,
|
|
2207
|
+
ref: useComposedRefs(rootRef, forwardedRef)
|
|
2208
|
+
}, children));
|
|
2209
|
+
});
|
|
2210
|
+
var Item4 = slottable8(({ children, asChild, current, border = false, onCurrentChange, onClick, onFocus, onBlur, ...props }, forwardedRef) => {
|
|
2211
|
+
const Comp = asChild ? Slot14 : Primitive14.div;
|
|
2212
|
+
const { tx } = useThemeContext();
|
|
2213
|
+
const focusableGroupAttrs = useFocusableGroup({
|
|
2214
|
+
ignoreDefaultKeydown: {
|
|
2215
|
+
Enter: true
|
|
2216
|
+
}
|
|
2217
|
+
});
|
|
2218
|
+
const [focused, setFocused] = useState6(false);
|
|
2219
|
+
const handleClick = useCallback6((event) => {
|
|
2220
|
+
onCurrentChange?.();
|
|
2221
|
+
onClick?.(event);
|
|
2222
|
+
}, [
|
|
2223
|
+
onCurrentChange,
|
|
2224
|
+
onClick
|
|
2225
|
+
]);
|
|
2226
|
+
const handleKeyDown = useCallback6((event) => {
|
|
2227
|
+
if (event.key === "Enter") {
|
|
2228
|
+
onCurrentChange?.();
|
|
2229
|
+
}
|
|
2230
|
+
}, [
|
|
2231
|
+
onCurrentChange
|
|
2232
|
+
]);
|
|
2233
|
+
const handleFocus = useCallback6((event) => {
|
|
2234
|
+
setFocused(true);
|
|
2235
|
+
onFocus?.(event);
|
|
2236
|
+
}, [
|
|
2237
|
+
onFocus
|
|
2238
|
+
]);
|
|
2239
|
+
const handleBlur = useCallback6((event) => {
|
|
2240
|
+
setFocused(false);
|
|
2241
|
+
onBlur?.(event);
|
|
2242
|
+
}, [
|
|
2243
|
+
onBlur
|
|
2244
|
+
]);
|
|
2245
|
+
const isCurrent = current ?? focused;
|
|
2246
|
+
const { className, ...rest } = composableProps9(props);
|
|
2247
|
+
return /* @__PURE__ */ React25.createElement(Comp, {
|
|
2248
|
+
...rest,
|
|
2249
|
+
tabIndex: 0,
|
|
2250
|
+
className: tx("focus.item", {
|
|
2251
|
+
border
|
|
2252
|
+
}, className),
|
|
2253
|
+
...focusableGroupAttrs,
|
|
2254
|
+
"aria-current": isCurrent || void 0,
|
|
2255
|
+
onClick: handleClick,
|
|
2256
|
+
onKeyDown: handleKeyDown,
|
|
2257
|
+
onFocus: handleFocus,
|
|
2258
|
+
onBlur: handleBlur,
|
|
2259
|
+
ref: forwardedRef
|
|
2260
|
+
}, children);
|
|
2261
|
+
});
|
|
2262
|
+
var Focus = {
|
|
2263
|
+
Group: Group3,
|
|
2264
|
+
Item: Item4
|
|
2265
|
+
};
|
|
2266
|
+
|
|
2138
2267
|
// src/components/Input/Input.tsx
|
|
2139
|
-
import
|
|
2268
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2140
2269
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
2141
|
-
import React26, { forwardRef as
|
|
2270
|
+
import React26, { forwardRef as forwardRef16 } from "react";
|
|
2142
2271
|
import { DescriptionAndValidation as DescriptionAndValidationPrimitive, Description as DescriptionPrimitive, INPUT_NAME, InputRoot, Label as LabelPrimitive, PinInput as PinInputPrimitive, TextArea as TextAreaPrimitive, TextInput as TextInputPrimitive, Validation as ValidationPrimitive, useInputContext } from "@dxos/react-input";
|
|
2143
|
-
import { mx as
|
|
2144
|
-
var Label3 = /* @__PURE__ */
|
|
2272
|
+
import { mx as mx8 } from "@dxos/ui-theme";
|
|
2273
|
+
var Label3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2145
2274
|
const { tx } = useThemeContext();
|
|
2146
2275
|
return /* @__PURE__ */ React26.createElement(LabelPrimitive, {
|
|
2147
2276
|
...props,
|
|
@@ -2151,7 +2280,7 @@ var Label3 = /* @__PURE__ */ forwardRef21(({ classNames, children, srOnly, ...pr
|
|
|
2151
2280
|
ref: forwardedRef
|
|
2152
2281
|
}, children);
|
|
2153
2282
|
});
|
|
2154
|
-
var
|
|
2283
|
+
var Description3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2155
2284
|
const { tx } = useThemeContext();
|
|
2156
2285
|
return /* @__PURE__ */ React26.createElement(DescriptionPrimitive, {
|
|
2157
2286
|
...props,
|
|
@@ -2161,7 +2290,7 @@ var Description = /* @__PURE__ */ forwardRef21(({ classNames, children, srOnly,
|
|
|
2161
2290
|
ref: forwardedRef
|
|
2162
2291
|
}, children);
|
|
2163
2292
|
});
|
|
2164
|
-
var Validation = /* @__PURE__ */
|
|
2293
|
+
var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2165
2294
|
const { tx } = useThemeContext();
|
|
2166
2295
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2167
2296
|
return /* @__PURE__ */ React26.createElement(ValidationPrimitive, {
|
|
@@ -2173,7 +2302,7 @@ var Validation = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, child
|
|
|
2173
2302
|
ref: forwardedRef
|
|
2174
2303
|
}, children);
|
|
2175
2304
|
});
|
|
2176
|
-
var DescriptionAndValidation = /* @__PURE__ */
|
|
2305
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2177
2306
|
const { tx } = useThemeContext();
|
|
2178
2307
|
return /* @__PURE__ */ React26.createElement(DescriptionAndValidationPrimitive, {
|
|
2179
2308
|
...props,
|
|
@@ -2183,7 +2312,7 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef21(({ classNames, child
|
|
|
2183
2312
|
ref: forwardedRef
|
|
2184
2313
|
}, children);
|
|
2185
2314
|
});
|
|
2186
|
-
var PinInput = /* @__PURE__ */
|
|
2315
|
+
var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity, elevation: propsElevation, ...props }, forwardedRef) => {
|
|
2187
2316
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2188
2317
|
const { tx } = useThemeContext();
|
|
2189
2318
|
const density = useDensityContext(propsDensity);
|
|
@@ -2204,11 +2333,11 @@ var PinInput = /* @__PURE__ */ forwardRef21(({ classNames, density: propsDensity
|
|
|
2204
2333
|
ref: forwardedRef
|
|
2205
2334
|
});
|
|
2206
2335
|
});
|
|
2207
|
-
var TextInput = /* @__PURE__ */
|
|
2336
|
+
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
2208
2337
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2209
2338
|
const { tx } = useThemeContext();
|
|
2210
|
-
const density = useDensityContext(
|
|
2211
|
-
const elevation = useElevationContext(
|
|
2339
|
+
const density = useDensityContext(densityProp);
|
|
2340
|
+
const elevation = useElevationContext(elevationProp);
|
|
2212
2341
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2213
2342
|
return /* @__PURE__ */ React26.createElement(TextInputPrimitive, {
|
|
2214
2343
|
...props,
|
|
@@ -2226,7 +2355,7 @@ var TextInput = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, densit
|
|
|
2226
2355
|
ref: forwardedRef
|
|
2227
2356
|
});
|
|
2228
2357
|
});
|
|
2229
|
-
var TextArea = /* @__PURE__ */
|
|
2358
|
+
var TextArea = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
2230
2359
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2231
2360
|
const { tx } = useThemeContext();
|
|
2232
2361
|
const density = useDensityContext(propsDensity);
|
|
@@ -2247,7 +2376,7 @@ var TextArea = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, density
|
|
|
2247
2376
|
ref: forwardedRef
|
|
2248
2377
|
});
|
|
2249
2378
|
});
|
|
2250
|
-
var Checkbox = /* @__PURE__ */
|
|
2379
|
+
var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, ...props }, forwardedRef) => {
|
|
2251
2380
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2252
2381
|
prop: propsChecked,
|
|
2253
2382
|
defaultProp: propsDefaultChecked,
|
|
@@ -2255,7 +2384,7 @@ var Checkbox = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, checked
|
|
|
2255
2384
|
});
|
|
2256
2385
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2257
2386
|
const { tx } = useThemeContext();
|
|
2258
|
-
return /* @__PURE__ */ React26.createElement(CheckboxPrimitive, {
|
|
2387
|
+
return /* @__PURE__ */ React26.createElement(CheckboxPrimitive.Root, {
|
|
2259
2388
|
...props,
|
|
2260
2389
|
checked,
|
|
2261
2390
|
onCheckedChange,
|
|
@@ -2277,7 +2406,7 @@ var Checkbox = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, checked
|
|
|
2277
2406
|
})
|
|
2278
2407
|
}));
|
|
2279
2408
|
});
|
|
2280
|
-
var Switch = /* @__PURE__ */
|
|
2409
|
+
var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, ...props }, forwardedRef) => {
|
|
2281
2410
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2282
2411
|
prop: propsChecked,
|
|
2283
2412
|
defaultProp: propsDefaultChecked ?? false,
|
|
@@ -2286,7 +2415,7 @@ var Switch = /* @__PURE__ */ forwardRef21(({ __inputScope, classNames, checked:
|
|
|
2286
2415
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2287
2416
|
return /* @__PURE__ */ React26.createElement("input", {
|
|
2288
2417
|
type: "checkbox",
|
|
2289
|
-
className:
|
|
2418
|
+
className: mx8("dx-checkbox--switch dx-focus-ring", classNames),
|
|
2290
2419
|
checked,
|
|
2291
2420
|
onChange: (event) => {
|
|
2292
2421
|
onCheckedChange(event.target.checked);
|
|
@@ -2309,16 +2438,17 @@ var Input = {
|
|
|
2309
2438
|
Checkbox,
|
|
2310
2439
|
Switch,
|
|
2311
2440
|
Label: Label3,
|
|
2312
|
-
Description,
|
|
2441
|
+
Description: Description3,
|
|
2313
2442
|
Validation,
|
|
2314
2443
|
DescriptionAndValidation
|
|
2315
2444
|
};
|
|
2316
2445
|
|
|
2317
2446
|
// src/components/List/List.tsx
|
|
2318
|
-
import { Primitive as
|
|
2319
|
-
import { Slot as
|
|
2320
|
-
import React28, { forwardRef as
|
|
2447
|
+
import { Primitive as Primitive15 } from "@radix-ui/react-primitive";
|
|
2448
|
+
import { Slot as Slot15 } from "@radix-ui/react-slot";
|
|
2449
|
+
import React28, { forwardRef as forwardRef17 } from "react";
|
|
2321
2450
|
import { LIST_ITEM_NAME, LIST_NAME, ListItemCollapsibleContent, List as ListPrimitive, ListItem as ListPrimitiveItem, ListItemHeading as ListPrimitiveItemHeading, ListItemOpenTrigger as ListPrimitiveItemOpenTrigger, useListContext, useListItemContext } from "@dxos/react-list";
|
|
2451
|
+
import { composable as composable4, composableProps as composableProps10 } from "@dxos/ui-theme";
|
|
2322
2452
|
|
|
2323
2453
|
// src/components/List/ListDropIndicator.tsx
|
|
2324
2454
|
import React27 from "react";
|
|
@@ -2344,7 +2474,6 @@ var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
|
2344
2474
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2345
2475
|
const orientation = edgeToOrientationMap[edge];
|
|
2346
2476
|
return /* @__PURE__ */ React27.createElement("div", {
|
|
2347
|
-
role: "none",
|
|
2348
2477
|
style: {
|
|
2349
2478
|
"--line-thickness": `${strokeSize}px`,
|
|
2350
2479
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2359,19 +2488,20 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
2359
2488
|
};
|
|
2360
2489
|
|
|
2361
2490
|
// src/components/List/List.tsx
|
|
2362
|
-
var List =
|
|
2491
|
+
var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
2363
2492
|
const { tx } = useThemeContext();
|
|
2364
2493
|
const density = useDensityContext(props.density);
|
|
2494
|
+
const { className, ...rest } = composableProps10(props);
|
|
2365
2495
|
return /* @__PURE__ */ React28.createElement(DensityProvider, {
|
|
2366
2496
|
density
|
|
2367
2497
|
}, /* @__PURE__ */ React28.createElement(ListPrimitive, {
|
|
2368
|
-
...
|
|
2369
|
-
className: tx("list.root", {},
|
|
2498
|
+
...rest,
|
|
2499
|
+
className: tx("list.root", {}, className),
|
|
2370
2500
|
ref: forwardedRef
|
|
2371
2501
|
}, children));
|
|
2372
2502
|
});
|
|
2373
|
-
var ListItemEndcap = /* @__PURE__ */
|
|
2374
|
-
const Comp = asChild ?
|
|
2503
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2504
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2375
2505
|
const density = useDensityContext();
|
|
2376
2506
|
const { tx } = useThemeContext();
|
|
2377
2507
|
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
@@ -2389,14 +2519,13 @@ var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
|
2389
2519
|
const density = useDensityContext();
|
|
2390
2520
|
const { tx } = useThemeContext();
|
|
2391
2521
|
return /* @__PURE__ */ React28.createElement("div", {
|
|
2392
|
-
role: "none",
|
|
2393
2522
|
...props,
|
|
2394
2523
|
className: tx("list.item.openTrigger", {
|
|
2395
2524
|
density
|
|
2396
2525
|
}, classNames)
|
|
2397
2526
|
});
|
|
2398
2527
|
};
|
|
2399
|
-
var ListItemHeading = /* @__PURE__ */
|
|
2528
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2400
2529
|
const { tx } = useThemeContext();
|
|
2401
2530
|
const density = useDensityContext();
|
|
2402
2531
|
return /* @__PURE__ */ React28.createElement(ListPrimitiveItemHeading, {
|
|
@@ -2405,9 +2534,9 @@ var ListItemHeading = /* @__PURE__ */ forwardRef22(({ children, classNames, ...p
|
|
|
2405
2534
|
density
|
|
2406
2535
|
}, classNames),
|
|
2407
2536
|
ref: forwardedRef
|
|
2408
|
-
}, children);
|
|
2537
|
+
}, /* @__PURE__ */ React28.createElement("span", null, children));
|
|
2409
2538
|
});
|
|
2410
|
-
var ListItemOpenTrigger = /* @__PURE__ */
|
|
2539
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2411
2540
|
const { tx } = useThemeContext();
|
|
2412
2541
|
const density = useDensityContext();
|
|
2413
2542
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
@@ -2423,7 +2552,7 @@ var ListItemOpenTrigger = /* @__PURE__ */ forwardRef22(({ __listItemScope, class
|
|
|
2423
2552
|
classNames: tx("list.item.openTriggerIcon", {})
|
|
2424
2553
|
}));
|
|
2425
2554
|
});
|
|
2426
|
-
var ListItemRoot = /* @__PURE__ */
|
|
2555
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
2427
2556
|
const { tx } = useThemeContext();
|
|
2428
2557
|
const density = useDensityContext();
|
|
2429
2558
|
return /* @__PURE__ */ React28.createElement(ListPrimitiveItem, {
|
|
@@ -2446,7 +2575,7 @@ var ListItem = {
|
|
|
2446
2575
|
};
|
|
2447
2576
|
|
|
2448
2577
|
// src/components/List/Tree.tsx
|
|
2449
|
-
import React30, { forwardRef as
|
|
2578
|
+
import React30, { forwardRef as forwardRef18 } from "react";
|
|
2450
2579
|
|
|
2451
2580
|
// src/components/List/TreeDropIndicator.tsx
|
|
2452
2581
|
import React29 from "react";
|
|
@@ -2494,13 +2623,13 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2494
2623
|
};
|
|
2495
2624
|
|
|
2496
2625
|
// src/components/List/Tree.tsx
|
|
2497
|
-
var TreeRoot = /* @__PURE__ */
|
|
2626
|
+
var TreeRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2498
2627
|
return /* @__PURE__ */ React30.createElement(List, {
|
|
2499
2628
|
...props,
|
|
2500
2629
|
ref: forwardedRef
|
|
2501
2630
|
});
|
|
2502
2631
|
});
|
|
2503
|
-
var TreeBranch = /* @__PURE__ */
|
|
2632
|
+
var TreeBranch = /* @__PURE__ */ forwardRef18(({ __listScope, ...props }, forwardedRef) => {
|
|
2504
2633
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
2505
2634
|
return /* @__PURE__ */ React30.createElement(List, {
|
|
2506
2635
|
...props,
|
|
@@ -2508,7 +2637,7 @@ var TreeBranch = /* @__PURE__ */ forwardRef23(({ __listScope, ...props }, forwar
|
|
|
2508
2637
|
ref: forwardedRef
|
|
2509
2638
|
});
|
|
2510
2639
|
});
|
|
2511
|
-
var TreeItemRoot = /* @__PURE__ */
|
|
2640
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2512
2641
|
return /* @__PURE__ */ React30.createElement(ListItem.Root, {
|
|
2513
2642
|
role: "treeitem",
|
|
2514
2643
|
...props,
|
|
@@ -2535,20 +2664,24 @@ var TreeItem = {
|
|
|
2535
2664
|
// src/components/List/Treegrid.tsx
|
|
2536
2665
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2537
2666
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2538
|
-
import { Primitive as
|
|
2539
|
-
import { Slot as
|
|
2667
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2668
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2540
2669
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2541
|
-
import React31, { forwardRef as
|
|
2670
|
+
import React31, { forwardRef as forwardRef19, useCallback as useCallback7 } from "react";
|
|
2671
|
+
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2542
2672
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2543
2673
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2544
2674
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
2545
|
-
var
|
|
2546
|
-
var
|
|
2547
|
-
var TreegridRoot =
|
|
2675
|
+
var TREEGRID_PATH_SEPARATOR = "~";
|
|
2676
|
+
var TREEGRID_PARENT_OF_SEPARATOR = " ";
|
|
2677
|
+
var TreegridRoot = composable5(({ asChild, classNames, children, style, gridTemplateColumns, onKeyDown: onKeyDownProp, ...props }, forwardedRef) => {
|
|
2548
2678
|
const { tx } = useThemeContext();
|
|
2549
|
-
const
|
|
2679
|
+
const { className, role: _role, ...rest } = composableProps11(props, {
|
|
2680
|
+
classNames
|
|
2681
|
+
});
|
|
2682
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2550
2683
|
const { findFirstFocusable } = useFocusFinders();
|
|
2551
|
-
const handleKeyDown =
|
|
2684
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2552
2685
|
switch (event.key) {
|
|
2553
2686
|
case "ArrowDown":
|
|
2554
2687
|
case "ArrowUp": {
|
|
@@ -2577,14 +2710,15 @@ var TreegridRoot = /* @__PURE__ */ forwardRef24(({ asChild, classNames, children
|
|
|
2577
2710
|
break;
|
|
2578
2711
|
}
|
|
2579
2712
|
}
|
|
2580
|
-
|
|
2713
|
+
onKeyDownProp?.(event);
|
|
2581
2714
|
}, [
|
|
2582
|
-
findFirstFocusable
|
|
2715
|
+
findFirstFocusable,
|
|
2716
|
+
onKeyDownProp
|
|
2583
2717
|
]);
|
|
2584
2718
|
return /* @__PURE__ */ React31.createElement(Comp, {
|
|
2585
2719
|
role: "treegrid",
|
|
2586
|
-
...
|
|
2587
|
-
className: tx("treegrid.root", {},
|
|
2720
|
+
...rest,
|
|
2721
|
+
className: tx("treegrid.root", {}, className),
|
|
2588
2722
|
style: {
|
|
2589
2723
|
...style,
|
|
2590
2724
|
gridTemplateColumns
|
|
@@ -2593,10 +2727,10 @@ var TreegridRoot = /* @__PURE__ */ forwardRef24(({ asChild, classNames, children
|
|
|
2593
2727
|
ref: forwardedRef
|
|
2594
2728
|
}, children);
|
|
2595
2729
|
});
|
|
2596
|
-
var TreegridRow = /* @__PURE__ */
|
|
2730
|
+
var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2597
2731
|
const { tx } = useThemeContext();
|
|
2598
|
-
const Comp = asChild ?
|
|
2599
|
-
const pathParts = id.split(
|
|
2732
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2733
|
+
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
2600
2734
|
const level = pathParts.length - 1;
|
|
2601
2735
|
const [open, onOpenChange] = useControllableState3({
|
|
2602
2736
|
prop: propsOpen,
|
|
@@ -2622,7 +2756,7 @@ var TreegridRow = /* @__PURE__ */ forwardRef24(({ __treegridRowScope, asChild, c
|
|
|
2622
2756
|
ref: forwardedRef
|
|
2623
2757
|
}, children));
|
|
2624
2758
|
});
|
|
2625
|
-
var TreegridCell = /* @__PURE__ */
|
|
2759
|
+
var TreegridCell = /* @__PURE__ */ forwardRef19(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2626
2760
|
const { tx } = useThemeContext();
|
|
2627
2761
|
return /* @__PURE__ */ React31.createElement("div", {
|
|
2628
2762
|
role: "gridcell",
|
|
@@ -2636,28 +2770,24 @@ var TreegridCell = /* @__PURE__ */ forwardRef24(({ classNames, children, indent,
|
|
|
2636
2770
|
var Treegrid = {
|
|
2637
2771
|
Root: TreegridRoot,
|
|
2638
2772
|
Row: TreegridRow,
|
|
2639
|
-
Cell: TreegridCell
|
|
2640
|
-
PARENT_OF_SEPARATOR,
|
|
2641
|
-
PATH_SEPARATOR,
|
|
2642
|
-
createTreegridRowScope,
|
|
2643
|
-
useTreegridRowContext
|
|
2773
|
+
Cell: TreegridCell
|
|
2644
2774
|
};
|
|
2645
2775
|
|
|
2646
2776
|
// src/components/Main/Main.tsx
|
|
2647
|
-
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2648
|
-
import { createContext as
|
|
2777
|
+
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
2778
|
+
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
2649
2779
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2650
|
-
import { Primitive as
|
|
2651
|
-
import { Slot as
|
|
2780
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
2781
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2652
2782
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2653
|
-
import React32, { forwardRef as
|
|
2783
|
+
import React32, { forwardRef as forwardRef20, useCallback as useCallback9, useEffect as useEffect5, useRef as useRef4, useState as useState8 } from "react";
|
|
2654
2784
|
import { addEventListener } from "@dxos/async";
|
|
2655
2785
|
import { log } from "@dxos/log";
|
|
2656
2786
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2657
2787
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
2658
2788
|
|
|
2659
2789
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2660
|
-
import { useCallback as
|
|
2790
|
+
import { useCallback as useCallback8, useEffect as useEffect4, useState as useState7 } from "react";
|
|
2661
2791
|
var useSwipeToDismiss = (ref, {
|
|
2662
2792
|
onDismiss,
|
|
2663
2793
|
dismissThreshold = 64,
|
|
@@ -2666,22 +2796,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2666
2796
|
/* side = 'inline-start' */
|
|
2667
2797
|
}) => {
|
|
2668
2798
|
const $root = ref.current;
|
|
2669
|
-
const [motionState, setMotionState] =
|
|
2670
|
-
const [gestureStartX, setGestureStartX] =
|
|
2671
|
-
const setIdle =
|
|
2799
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2800
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2801
|
+
const setIdle = useCallback8(() => {
|
|
2672
2802
|
setMotionState(0);
|
|
2673
2803
|
$root?.style.removeProperty("inset-inline-start");
|
|
2674
2804
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2675
2805
|
}, [
|
|
2676
2806
|
$root
|
|
2677
2807
|
]);
|
|
2678
|
-
const setFollowing =
|
|
2808
|
+
const setFollowing = useCallback8(() => {
|
|
2679
2809
|
setMotionState(2);
|
|
2680
2810
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2681
2811
|
}, [
|
|
2682
2812
|
$root
|
|
2683
2813
|
]);
|
|
2684
|
-
const handlePointerDown =
|
|
2814
|
+
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2685
2815
|
if (motionState === 0) {
|
|
2686
2816
|
setMotionState(1);
|
|
2687
2817
|
setGestureStartX(screenX);
|
|
@@ -2689,7 +2819,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2689
2819
|
}, [
|
|
2690
2820
|
motionState
|
|
2691
2821
|
]);
|
|
2692
|
-
const handlePointerMove =
|
|
2822
|
+
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2693
2823
|
if ($root) {
|
|
2694
2824
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2695
2825
|
switch (motionState) {
|
|
@@ -2713,7 +2843,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2713
2843
|
motionState,
|
|
2714
2844
|
gestureStartX
|
|
2715
2845
|
]);
|
|
2716
|
-
const handlePointerUp =
|
|
2846
|
+
const handlePointerUp = useCallback8(() => {
|
|
2717
2847
|
setIdle();
|
|
2718
2848
|
}, [
|
|
2719
2849
|
setIdle
|
|
@@ -2759,7 +2889,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2759
2889
|
};
|
|
2760
2890
|
var landmarkAttr = "data-main-landmark";
|
|
2761
2891
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2762
|
-
const handleKeyDown =
|
|
2892
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2763
2893
|
const target = event.target;
|
|
2764
2894
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2765
2895
|
event.preventDefault();
|
|
@@ -2773,7 +2903,7 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2773
2903
|
}, [
|
|
2774
2904
|
propsOnKeyDown
|
|
2775
2905
|
]);
|
|
2776
|
-
const focusableGroupAttrs =
|
|
2906
|
+
const focusableGroupAttrs = useFocusableGroup2({
|
|
2777
2907
|
tabBehavior: "limited",
|
|
2778
2908
|
ignoreDefaultKeydown: {
|
|
2779
2909
|
Tab: true
|
|
@@ -2786,25 +2916,15 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2786
2916
|
...focusableGroupAttrs
|
|
2787
2917
|
};
|
|
2788
2918
|
};
|
|
2789
|
-
var [MainProvider, useMainContext] =
|
|
2919
|
+
var [MainProvider, useMainContext] = createContext8(MAIN_NAME, {
|
|
2790
2920
|
resizing: false,
|
|
2791
2921
|
navigationSidebarState: "closed",
|
|
2792
2922
|
setNavigationSidebarState: (_nextState) => {
|
|
2793
|
-
log.warn("Not initialized", void 0, {
|
|
2794
|
-
F: __dxlog_file,
|
|
2795
|
-
L: 111,
|
|
2796
|
-
S: void 0,
|
|
2797
|
-
C: (f, a) => f(...a)
|
|
2798
|
-
});
|
|
2923
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2799
2924
|
},
|
|
2800
2925
|
complementarySidebarState: "closed",
|
|
2801
2926
|
setComplementarySidebarState: (_nextState) => {
|
|
2802
|
-
log.warn("Not initialized", void 0, {
|
|
2803
|
-
F: __dxlog_file,
|
|
2804
|
-
L: 116,
|
|
2805
|
-
S: void 0,
|
|
2806
|
-
C: (f, a) => f(...a)
|
|
2807
|
-
});
|
|
2927
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2808
2928
|
}
|
|
2809
2929
|
});
|
|
2810
2930
|
var useSidebars = (consumerName) => {
|
|
@@ -2812,22 +2932,22 @@ var useSidebars = (consumerName) => {
|
|
|
2812
2932
|
return {
|
|
2813
2933
|
navigationSidebarState,
|
|
2814
2934
|
setNavigationSidebarState,
|
|
2815
|
-
toggleNavigationSidebar:
|
|
2935
|
+
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2816
2936
|
navigationSidebarState,
|
|
2817
2937
|
setNavigationSidebarState
|
|
2818
2938
|
]),
|
|
2819
|
-
openNavigationSidebar:
|
|
2820
|
-
collapseNavigationSidebar:
|
|
2821
|
-
closeNavigationSidebar:
|
|
2939
|
+
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2940
|
+
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2941
|
+
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2822
2942
|
complementarySidebarState,
|
|
2823
2943
|
setComplementarySidebarState,
|
|
2824
|
-
toggleComplementarySidebar:
|
|
2944
|
+
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2825
2945
|
complementarySidebarState,
|
|
2826
2946
|
setComplementarySidebarState
|
|
2827
2947
|
]),
|
|
2828
|
-
openComplementarySidebar:
|
|
2829
|
-
collapseComplementarySidebar:
|
|
2830
|
-
closeComplementarySidebar:
|
|
2948
|
+
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2949
|
+
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2950
|
+
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2831
2951
|
};
|
|
2832
2952
|
};
|
|
2833
2953
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -2842,8 +2962,8 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2842
2962
|
defaultProp: defaultComplementarySidebarState,
|
|
2843
2963
|
onChange: onComplementarySidebarStateChange
|
|
2844
2964
|
});
|
|
2845
|
-
const [resizing, setResizing] =
|
|
2846
|
-
const resizeInterval =
|
|
2965
|
+
const [resizing, setResizing] = useState8(false);
|
|
2966
|
+
const resizeInterval = useRef4(null);
|
|
2847
2967
|
useEffect5(() => addEventListener(window, "resize", () => {
|
|
2848
2968
|
setResizing(true);
|
|
2849
2969
|
if (resizeInterval.current) {
|
|
@@ -2864,7 +2984,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2864
2984
|
}, children);
|
|
2865
2985
|
};
|
|
2866
2986
|
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2867
|
-
var MainOverlay = /* @__PURE__ */
|
|
2987
|
+
var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwardedRef) => {
|
|
2868
2988
|
const [isLg] = useMediaQuery("lg");
|
|
2869
2989
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_OVERLAY_NAME);
|
|
2870
2990
|
const { tx } = useThemeContext();
|
|
@@ -2885,16 +3005,16 @@ var MainOverlay = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwar
|
|
|
2885
3005
|
});
|
|
2886
3006
|
});
|
|
2887
3007
|
MainOverlay.displayName = MAIN_OVERLAY_NAME;
|
|
2888
|
-
var MainSidebar = /* @__PURE__ */
|
|
3008
|
+
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2889
3009
|
const [isLg] = useMediaQuery("lg");
|
|
2890
3010
|
const { tx } = useThemeContext();
|
|
2891
3011
|
const { t } = useTranslation(osTranslations3);
|
|
2892
3012
|
const ref = useForwardedRef(forwardedRef);
|
|
2893
|
-
const noopRef =
|
|
3013
|
+
const noopRef = useRef4(null);
|
|
2894
3014
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2895
3015
|
onDismiss: () => onStateChange?.("closed")
|
|
2896
3016
|
});
|
|
2897
|
-
const handleKeyDown =
|
|
3017
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2898
3018
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
2899
3019
|
if (event.key === "Escape" && focusGroupParent) {
|
|
2900
3020
|
event.preventDefault();
|
|
@@ -2905,14 +3025,14 @@ var MainSidebar = /* @__PURE__ */ forwardRef25(({ classNames, children, swipeToD
|
|
|
2905
3025
|
}, [
|
|
2906
3026
|
props.onKeyDown
|
|
2907
3027
|
]);
|
|
2908
|
-
const
|
|
3028
|
+
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
2909
3029
|
return /* @__PURE__ */ React32.createElement(DialogRoot2, {
|
|
2910
3030
|
open: state !== "closed",
|
|
2911
3031
|
"aria-label": toLocalizedString(label, t),
|
|
2912
3032
|
modal: false
|
|
2913
3033
|
}, !isLg && /* @__PURE__ */ React32.createElement(DialogTitle2, {
|
|
2914
3034
|
className: "sr-only"
|
|
2915
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */ React32.createElement(
|
|
3035
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React32.createElement(Root14, {
|
|
2916
3036
|
...!isLg && {
|
|
2917
3037
|
forceMount: true,
|
|
2918
3038
|
tabIndex: -1,
|
|
@@ -2930,7 +3050,7 @@ var MainSidebar = /* @__PURE__ */ forwardRef25(({ classNames, children, swipeToD
|
|
|
2930
3050
|
ref
|
|
2931
3051
|
}, children));
|
|
2932
3052
|
});
|
|
2933
|
-
var MainNavigationSidebar = /* @__PURE__ */
|
|
3053
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2934
3054
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2935
3055
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2936
3056
|
return /* @__PURE__ */ React32.createElement(MainSidebar, {
|
|
@@ -2944,7 +3064,7 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef25((props, forwardedRef) =
|
|
|
2944
3064
|
});
|
|
2945
3065
|
});
|
|
2946
3066
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2947
|
-
var MainComplementarySidebar = /* @__PURE__ */
|
|
3067
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2948
3068
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2949
3069
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2950
3070
|
return /* @__PURE__ */ React32.createElement(MainSidebar, {
|
|
@@ -2958,17 +3078,17 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef25((props, forwardedRef
|
|
|
2958
3078
|
});
|
|
2959
3079
|
});
|
|
2960
3080
|
MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
2961
|
-
var MainContent = /* @__PURE__ */
|
|
3081
|
+
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2962
3082
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2963
3083
|
const { tx } = useThemeContext();
|
|
2964
|
-
const Comp = asChild ?
|
|
3084
|
+
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
2965
3085
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2966
3086
|
return /* @__PURE__ */ React32.createElement(Comp, {
|
|
2967
|
-
role,
|
|
2968
3087
|
...handlesFocus && {
|
|
2969
3088
|
...mover
|
|
2970
3089
|
},
|
|
2971
3090
|
...props,
|
|
3091
|
+
role,
|
|
2972
3092
|
"data-sidebar-left-state": navigationSidebarState,
|
|
2973
3093
|
"data-sidebar-right-state": complementarySidebarState,
|
|
2974
3094
|
"data-handles-focus": handlesFocus,
|
|
@@ -2989,11 +3109,13 @@ var Main = {
|
|
|
2989
3109
|
};
|
|
2990
3110
|
|
|
2991
3111
|
// src/components/Message/Message.tsx
|
|
2992
|
-
import { createContext as
|
|
2993
|
-
import { Primitive as
|
|
2994
|
-
import { Slot as
|
|
2995
|
-
import React33, { forwardRef as
|
|
3112
|
+
import { createContext as createContext9 } from "@radix-ui/react-context";
|
|
3113
|
+
import { Primitive as Primitive18 } from "@radix-ui/react-primitive";
|
|
3114
|
+
import { Slot as Slot18 } from "@radix-ui/react-slot";
|
|
3115
|
+
import React33, { forwardRef as forwardRef21 } from "react";
|
|
3116
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
2996
3117
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3118
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
2997
3119
|
var messageIcons = {
|
|
2998
3120
|
success: "ph--check-circle--duotone",
|
|
2999
3121
|
info: "ph--info--duotone",
|
|
@@ -3002,13 +3124,13 @@ var messageIcons = {
|
|
|
3002
3124
|
neutral: "ph--info--duotone"
|
|
3003
3125
|
};
|
|
3004
3126
|
var MESSAGE_NAME = "Message";
|
|
3005
|
-
var [MessageProvider, useMessageContext] =
|
|
3006
|
-
var MessageRoot = /* @__PURE__ */
|
|
3127
|
+
var [MessageProvider, useMessageContext] = createContext9(MESSAGE_NAME);
|
|
3128
|
+
var MessageRoot = /* @__PURE__ */ forwardRef21(({ asChild, valence = "neutral", elevation: propsElevation, classNames, titleId: propsTitleId, descriptionId: propsDescriptionId, children, ...props }, forwardedRef) => {
|
|
3007
3129
|
const { tx } = useThemeContext();
|
|
3008
3130
|
const titleId = useId3("message__title", propsTitleId);
|
|
3009
3131
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3010
3132
|
const elevation = useElevationContext(propsElevation);
|
|
3011
|
-
const Comp = asChild ?
|
|
3133
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3012
3134
|
return /* @__PURE__ */ React33.createElement(MessageProvider, {
|
|
3013
3135
|
titleId,
|
|
3014
3136
|
descriptionId,
|
|
@@ -3027,32 +3149,37 @@ var MessageRoot = /* @__PURE__ */ forwardRef26(({ asChild, valence = "neutral",
|
|
|
3027
3149
|
});
|
|
3028
3150
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3029
3151
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3030
|
-
var MessageTitle = /* @__PURE__ */
|
|
3152
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3153
|
+
const { t } = useTranslation4(translationKey2);
|
|
3031
3154
|
const { tx } = useThemeContext();
|
|
3032
3155
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3033
|
-
const Comp = asChild ? Slot15 : Primitive15.h2;
|
|
3034
3156
|
const icon = iconProp ?? messageIcons[valence];
|
|
3035
|
-
return /* @__PURE__ */ React33.createElement(
|
|
3036
|
-
...props,
|
|
3157
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
3037
3158
|
className: tx("message.header", {}, classNames),
|
|
3038
3159
|
id: titleId,
|
|
3039
3160
|
ref: forwardedRef
|
|
3040
|
-
},
|
|
3041
|
-
|
|
3042
|
-
icon,
|
|
3043
|
-
classNames: tx("message.icon", {
|
|
3161
|
+
}, icon && /* @__PURE__ */ React33.createElement("div", {
|
|
3162
|
+
className: tx("message.icon", {
|
|
3044
3163
|
valence
|
|
3045
3164
|
})
|
|
3046
|
-
}
|
|
3165
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
3166
|
+
icon
|
|
3167
|
+
})), /* @__PURE__ */ React33.createElement("h2", {
|
|
3047
3168
|
className: tx("message.title", {}, classNames)
|
|
3048
|
-
}, children)
|
|
3169
|
+
}, children), onClose && /* @__PURE__ */ React33.createElement(IconButton, {
|
|
3170
|
+
variant: "ghost",
|
|
3171
|
+
icon: "ph--x--regular",
|
|
3172
|
+
iconOnly: true,
|
|
3173
|
+
label: t("toolbar-close.label"),
|
|
3174
|
+
onClick: onClose
|
|
3175
|
+
}));
|
|
3049
3176
|
});
|
|
3050
3177
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3051
3178
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
3052
|
-
var MessageContent = /* @__PURE__ */
|
|
3179
|
+
var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3053
3180
|
const { tx } = useThemeContext();
|
|
3054
3181
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3055
|
-
const Comp = asChild ?
|
|
3182
|
+
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3056
3183
|
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
3057
3184
|
...props,
|
|
3058
3185
|
className: tx("message.content", {}, classNames),
|
|
@@ -3070,7 +3197,7 @@ var Callout = Message;
|
|
|
3070
3197
|
|
|
3071
3198
|
// src/components/Popover/Popover.tsx
|
|
3072
3199
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
3073
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
3200
|
+
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
3074
3201
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
3075
3202
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
3076
3203
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -3080,11 +3207,11 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
3080
3207
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
3081
3208
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
3082
3209
|
import { Presence } from "@radix-ui/react-presence";
|
|
3083
|
-
import { Primitive as
|
|
3084
|
-
import { Slot as
|
|
3210
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
3211
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3085
3212
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3086
3213
|
import { hideOthers } from "aria-hidden";
|
|
3087
|
-
import React34, { forwardRef as
|
|
3214
|
+
import React34, { forwardRef as forwardRef22, useCallback as useCallback10, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef5, useState as useState9 } from "react";
|
|
3088
3215
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3089
3216
|
var POPOVER_NAME = "Popover";
|
|
3090
3217
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3095,8 +3222,8 @@ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
|
3095
3222
|
var PopoverRoot = (props) => {
|
|
3096
3223
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3097
3224
|
const popperScope = usePopperScope(__scopePopover);
|
|
3098
|
-
const triggerRef =
|
|
3099
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3225
|
+
const triggerRef = useRef5(null);
|
|
3226
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3100
3227
|
const [open = false, setOpen] = useControllableState5({
|
|
3101
3228
|
prop: openProp,
|
|
3102
3229
|
defaultProp: defaultOpen,
|
|
@@ -3108,18 +3235,18 @@ var PopoverRoot = (props) => {
|
|
|
3108
3235
|
triggerRef,
|
|
3109
3236
|
open,
|
|
3110
3237
|
onOpenChange: setOpen,
|
|
3111
|
-
onOpenToggle:
|
|
3238
|
+
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
3112
3239
|
setOpen
|
|
3113
3240
|
]),
|
|
3114
3241
|
hasCustomAnchor,
|
|
3115
|
-
onCustomAnchorAdd:
|
|
3116
|
-
onCustomAnchorRemove:
|
|
3242
|
+
onCustomAnchorAdd: useCallback10(() => setHasCustomAnchor(true), []),
|
|
3243
|
+
onCustomAnchorRemove: useCallback10(() => setHasCustomAnchor(false), []),
|
|
3117
3244
|
modal
|
|
3118
3245
|
}, children));
|
|
3119
3246
|
};
|
|
3120
3247
|
PopoverRoot.displayName = POPOVER_NAME;
|
|
3121
3248
|
var ANCHOR_NAME = "PopoverAnchor";
|
|
3122
|
-
var PopoverAnchor = /* @__PURE__ */
|
|
3249
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3123
3250
|
const { __scopePopover, ...anchorProps } = props;
|
|
3124
3251
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3125
3252
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -3139,12 +3266,12 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3139
3266
|
});
|
|
3140
3267
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
3141
3268
|
var TRIGGER_NAME2 = "PopoverTrigger";
|
|
3142
|
-
var PopoverTrigger = /* @__PURE__ */
|
|
3269
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3143
3270
|
const { __scopePopover, asChild, ...triggerProps } = props;
|
|
3144
3271
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
3145
3272
|
const popperScope = usePopperScope(__scopePopover);
|
|
3146
|
-
const composedTriggerRef =
|
|
3147
|
-
const Comp = asChild ?
|
|
3273
|
+
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3274
|
+
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3148
3275
|
const trigger = /* @__PURE__ */ React34.createElement(Comp, {
|
|
3149
3276
|
type: "button",
|
|
3150
3277
|
"aria-haspopup": "dialog",
|
|
@@ -3196,7 +3323,7 @@ var PopoverPortal = (props) => {
|
|
|
3196
3323
|
};
|
|
3197
3324
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
3198
3325
|
var CONTENT_NAME2 = "PopoverContent";
|
|
3199
|
-
var PopoverContent = /* @__PURE__ */
|
|
3326
|
+
var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3200
3327
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
3201
3328
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3202
3329
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
@@ -3211,11 +3338,11 @@ var PopoverContent = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3211
3338
|
}));
|
|
3212
3339
|
});
|
|
3213
3340
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
3214
|
-
var PopoverContentModal = /* @__PURE__ */
|
|
3341
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3215
3342
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3216
|
-
const contentRef =
|
|
3217
|
-
const composedRefs =
|
|
3218
|
-
const isRightClickOutsideRef =
|
|
3343
|
+
const contentRef = useRef5(null);
|
|
3344
|
+
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3345
|
+
const isRightClickOutsideRef = useRef5(false);
|
|
3219
3346
|
useEffect6(() => {
|
|
3220
3347
|
const content = contentRef.current;
|
|
3221
3348
|
if (content) {
|
|
@@ -3223,7 +3350,7 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef27((props, forwardedRef) =>
|
|
|
3223
3350
|
}
|
|
3224
3351
|
}, []);
|
|
3225
3352
|
return /* @__PURE__ */ React34.createElement(RemoveScroll, {
|
|
3226
|
-
as:
|
|
3353
|
+
as: Slot19,
|
|
3227
3354
|
allowPinchZoom: true
|
|
3228
3355
|
}, /* @__PURE__ */ React34.createElement(PopoverContentImpl, {
|
|
3229
3356
|
...props,
|
|
@@ -3252,10 +3379,10 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef27((props, forwardedRef) =>
|
|
|
3252
3379
|
})
|
|
3253
3380
|
}));
|
|
3254
3381
|
});
|
|
3255
|
-
var PopoverContentNonModal = /* @__PURE__ */
|
|
3382
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3256
3383
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3257
|
-
const hasInteractedOutsideRef =
|
|
3258
|
-
const hasPointerDownOutsideRef =
|
|
3384
|
+
const hasInteractedOutsideRef = useRef5(false);
|
|
3385
|
+
const hasPointerDownOutsideRef = useRef5(false);
|
|
3259
3386
|
return /* @__PURE__ */ React34.createElement(PopoverContentImpl, {
|
|
3260
3387
|
...props,
|
|
3261
3388
|
ref: forwardedRef,
|
|
@@ -3291,7 +3418,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef27((props, forwardedRef)
|
|
|
3291
3418
|
}
|
|
3292
3419
|
});
|
|
3293
3420
|
});
|
|
3294
|
-
var PopoverContentImpl = /* @__PURE__ */
|
|
3421
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3295
3422
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3296
3423
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
3297
3424
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -3299,7 +3426,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3299
3426
|
const elevation = useElevationContext();
|
|
3300
3427
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3301
3428
|
useFocusGuards();
|
|
3302
|
-
const computedCollisionBoundary =
|
|
3429
|
+
const computedCollisionBoundary = useMemo6(() => {
|
|
3303
3430
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3304
3431
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3305
3432
|
closestBoundary,
|
|
@@ -3355,10 +3482,10 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3355
3482
|
})));
|
|
3356
3483
|
});
|
|
3357
3484
|
var CLOSE_NAME = "PopoverClose";
|
|
3358
|
-
var PopoverClose = /* @__PURE__ */
|
|
3485
|
+
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3359
3486
|
const { __scopePopover, ...closeProps } = props;
|
|
3360
3487
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3361
|
-
return /* @__PURE__ */ React34.createElement(
|
|
3488
|
+
return /* @__PURE__ */ React34.createElement(Primitive19.button, {
|
|
3362
3489
|
type: "button",
|
|
3363
3490
|
...closeProps,
|
|
3364
3491
|
ref: forwardedRef,
|
|
@@ -3367,7 +3494,7 @@ var PopoverClose = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3367
3494
|
});
|
|
3368
3495
|
PopoverClose.displayName = CLOSE_NAME;
|
|
3369
3496
|
var ARROW_NAME2 = "PopoverArrow";
|
|
3370
|
-
var PopoverArrow = /* @__PURE__ */
|
|
3497
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3371
3498
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3372
3499
|
const popperScope = usePopperScope(__scopePopover);
|
|
3373
3500
|
const { tx } = useThemeContext();
|
|
@@ -3379,9 +3506,9 @@ var PopoverArrow = /* @__PURE__ */ forwardRef27((props, forwardedRef) => {
|
|
|
3379
3506
|
});
|
|
3380
3507
|
});
|
|
3381
3508
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
3382
|
-
var PopoverViewport = /* @__PURE__ */
|
|
3509
|
+
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3383
3510
|
const { tx } = useThemeContext();
|
|
3384
|
-
const Comp = asChild ?
|
|
3511
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3385
3512
|
return /* @__PURE__ */ React34.createElement(Comp, {
|
|
3386
3513
|
...props,
|
|
3387
3514
|
className: tx("popover.viewport", {
|
|
@@ -3405,8 +3532,8 @@ var Popover = {
|
|
|
3405
3532
|
};
|
|
3406
3533
|
|
|
3407
3534
|
// src/components/Status/Status.tsx
|
|
3408
|
-
import React35, { forwardRef as
|
|
3409
|
-
var Status = /* @__PURE__ */
|
|
3535
|
+
import React35, { forwardRef as forwardRef23 } from "react";
|
|
3536
|
+
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3410
3537
|
const { tx } = useThemeContext();
|
|
3411
3538
|
return /* @__PURE__ */ React35.createElement("span", {
|
|
3412
3539
|
role: "status",
|
|
@@ -3431,26 +3558,33 @@ var Status = /* @__PURE__ */ forwardRef28(({ classNames, children, progress = 0,
|
|
|
3431
3558
|
});
|
|
3432
3559
|
|
|
3433
3560
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3434
|
-
import { createContext as
|
|
3435
|
-
import { Primitive as
|
|
3436
|
-
import { Slot as
|
|
3437
|
-
import React36, {
|
|
3438
|
-
import { composableProps as
|
|
3561
|
+
import { createContext as createContext10 } from "@radix-ui/react-context";
|
|
3562
|
+
import { Primitive as Primitive20 } from "@radix-ui/react-primitive";
|
|
3563
|
+
import { Slot as Slot20 } from "@radix-ui/react-slot";
|
|
3564
|
+
import React36, { useMemo as useMemo7 } from "react";
|
|
3565
|
+
import { composableProps as composableProps12, scrollbar, slottable as slottable9 } from "@dxos/ui-theme";
|
|
3439
3566
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3440
|
-
var [ScrollAreaProvider, useScrollAreaContext] =
|
|
3567
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createContext10(SCROLLAREA_NAME);
|
|
3441
3568
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3442
|
-
var ScrollAreaRoot =
|
|
3443
|
-
const { className, ...rest } = composableProps8(props);
|
|
3444
|
-
const Comp = asChild ? Slot17 : Primitive17.div;
|
|
3569
|
+
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3445
3570
|
const { tx } = useThemeContext();
|
|
3446
|
-
const
|
|
3571
|
+
const { className, ...rest } = composableProps12(props);
|
|
3572
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3573
|
+
const options = useMemo7(() => ({
|
|
3447
3574
|
orientation,
|
|
3448
3575
|
autoHide,
|
|
3449
|
-
|
|
3576
|
+
centered,
|
|
3450
3577
|
padding,
|
|
3451
3578
|
thin,
|
|
3452
3579
|
snap
|
|
3453
|
-
}
|
|
3580
|
+
}), [
|
|
3581
|
+
orientation,
|
|
3582
|
+
autoHide,
|
|
3583
|
+
centered,
|
|
3584
|
+
padding,
|
|
3585
|
+
thin,
|
|
3586
|
+
snap
|
|
3587
|
+
]);
|
|
3454
3588
|
return /* @__PURE__ */ React36.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React36.createElement(Comp, {
|
|
3455
3589
|
...rest,
|
|
3456
3590
|
className: tx("scrollArea.root", options, className),
|
|
@@ -3459,12 +3593,21 @@ var ScrollAreaRoot = /* @__PURE__ */ forwardRef29(({ children, asChild, orientat
|
|
|
3459
3593
|
});
|
|
3460
3594
|
ScrollAreaRoot.displayName = SCROLLAREA_ROOT_NAME;
|
|
3461
3595
|
var SCROLLAREA_VIEWPORT_NAME = "ScrollArea.Viewport";
|
|
3462
|
-
var ScrollAreaViewport =
|
|
3596
|
+
var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedRef) => {
|
|
3463
3597
|
const { tx } = useThemeContext();
|
|
3464
3598
|
const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3599
|
+
const density = options.thin ? scrollbar.thin : scrollbar.coarse;
|
|
3600
|
+
const { className, ...rest } = composableProps12(props);
|
|
3601
|
+
const { style, ...restWithoutStyle } = rest;
|
|
3602
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3603
|
+
return /* @__PURE__ */ React36.createElement(Comp, {
|
|
3604
|
+
...restWithoutStyle,
|
|
3605
|
+
style: {
|
|
3606
|
+
"--scroll-width": `${density.size}px`,
|
|
3607
|
+
"--scroll-padding": `${density.padding}px`,
|
|
3608
|
+
...style
|
|
3609
|
+
},
|
|
3610
|
+
className: tx("scrollArea.viewport", options, className),
|
|
3468
3611
|
ref: forwardedRef
|
|
3469
3612
|
}, children);
|
|
3470
3613
|
});
|
|
@@ -3475,161 +3618,202 @@ var ScrollArea = {
|
|
|
3475
3618
|
};
|
|
3476
3619
|
|
|
3477
3620
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3478
|
-
import { createContext as
|
|
3479
|
-
import React37, { forwardRef as
|
|
3621
|
+
import { createContext as createContext11 } from "@radix-ui/react-context";
|
|
3622
|
+
import React37, { forwardRef as forwardRef24, useCallback as useCallback11, useEffect as useEffect7, useImperativeHandle, useMemo as useMemo8, useRef as useRef6, useState as useState10 } from "react";
|
|
3480
3623
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3481
3624
|
import { invariant } from "@dxos/invariant";
|
|
3482
|
-
import {
|
|
3483
|
-
import {
|
|
3625
|
+
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3626
|
+
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3627
|
+
import { mx as mx9 } from "@dxos/ui-theme";
|
|
3484
3628
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3485
3629
|
var isBottom = (el) => {
|
|
3486
3630
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3487
3631
|
};
|
|
3488
|
-
var [ScrollContainerProvider, useScrollContainerContext] =
|
|
3489
|
-
var
|
|
3490
|
-
const scrollerRef =
|
|
3491
|
-
const autoScrollRef =
|
|
3492
|
-
const [
|
|
3493
|
-
const [
|
|
3494
|
-
const timeoutRef =
|
|
3495
|
-
const scrollToBottom =
|
|
3632
|
+
var [ScrollContainerProvider, useScrollContainerContext] = createContext11("ScrollContainer");
|
|
3633
|
+
var Root10 = /* @__PURE__ */ forwardRef24(({ children, pin, behavior: behaviorProp = "smooth" }, forwardedRef) => {
|
|
3634
|
+
const scrollerRef = useRef6(null);
|
|
3635
|
+
const autoScrollRef = useRef6(false);
|
|
3636
|
+
const [pinned, setPinned] = useState10(pin);
|
|
3637
|
+
const [overflow, setOverflow] = useState10(false);
|
|
3638
|
+
const timeoutRef = useRef6(void 0);
|
|
3639
|
+
const scrollToBottom = useCallback11((behavior = behaviorProp) => {
|
|
3496
3640
|
if (scrollerRef.current) {
|
|
3497
|
-
autoScrollRef.current = true;
|
|
3498
|
-
scrollerRef.current.classList.add("scrollbar-none");
|
|
3499
|
-
scrollerRef.current.scrollTo({
|
|
3500
|
-
top: scrollerRef.current.scrollHeight,
|
|
3501
|
-
behavior
|
|
3502
|
-
});
|
|
3503
|
-
clearTimeout(timeoutRef.current);
|
|
3504
3641
|
if (behavior !== "instant") {
|
|
3642
|
+
autoScrollRef.current = true;
|
|
3643
|
+
scrollerRef.current.classList.add("scrollbar-none");
|
|
3644
|
+
clearTimeout(timeoutRef.current);
|
|
3505
3645
|
timeoutRef.current = setTimeout(() => {
|
|
3506
3646
|
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
3507
3647
|
autoScrollRef.current = false;
|
|
3508
3648
|
}, 500);
|
|
3509
3649
|
}
|
|
3650
|
+
scrollerRef.current.scrollTo({
|
|
3651
|
+
top: scrollerRef.current.scrollHeight,
|
|
3652
|
+
behavior
|
|
3653
|
+
});
|
|
3510
3654
|
setPinned(true);
|
|
3511
3655
|
}
|
|
3512
|
-
}, [
|
|
3513
|
-
|
|
3514
|
-
|
|
3656
|
+
}, [
|
|
3657
|
+
behaviorProp
|
|
3658
|
+
]);
|
|
3659
|
+
const controller = useMemo8(() => ({
|
|
3660
|
+
get viewport() {
|
|
3661
|
+
return scrollerRef.current;
|
|
3662
|
+
},
|
|
3515
3663
|
scrollToTop: () => {
|
|
3516
|
-
invariant(scrollerRef.current, void 0, {
|
|
3517
|
-
F: __dxlog_file2,
|
|
3518
|
-
L: 95,
|
|
3519
|
-
S: void 0,
|
|
3520
|
-
A: [
|
|
3521
|
-
"scrollerRef.current",
|
|
3522
|
-
""
|
|
3523
|
-
]
|
|
3524
|
-
});
|
|
3664
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3525
3665
|
scrollerRef.current.scrollTo({
|
|
3526
3666
|
top: 0,
|
|
3527
3667
|
behavior: "smooth"
|
|
3528
3668
|
});
|
|
3529
3669
|
setPinned(false);
|
|
3530
3670
|
},
|
|
3531
|
-
scrollToBottom: () => {
|
|
3532
|
-
scrollToBottom(
|
|
3671
|
+
scrollToBottom: (behavior = "smooth") => {
|
|
3672
|
+
scrollToBottom(behavior);
|
|
3533
3673
|
}
|
|
3534
3674
|
}), [
|
|
3535
|
-
scrollToBottom
|
|
3536
|
-
scrollerRef.current
|
|
3675
|
+
scrollToBottom
|
|
3537
3676
|
]);
|
|
3538
3677
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
3539
3678
|
controller
|
|
3540
3679
|
]);
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
return;
|
|
3544
|
-
}
|
|
3545
|
-
return combine(
|
|
3546
|
-
// Check if user scrolls.
|
|
3547
|
-
addEventListener2(scrollerRef.current, "wheel", () => {
|
|
3548
|
-
setPinned(isBottom(scrollerRef.current));
|
|
3549
|
-
}),
|
|
3550
|
-
// Check if scrolls.
|
|
3551
|
-
addEventListener2(scrollerRef.current, "scroll", () => {
|
|
3552
|
-
setOverflow((scrollerRef.current?.scrollTop ?? 0) > 0);
|
|
3553
|
-
})
|
|
3554
|
-
);
|
|
3680
|
+
const setViewport = useCallback11((el) => {
|
|
3681
|
+
scrollerRef.current = el;
|
|
3555
3682
|
}, []);
|
|
3556
3683
|
return /* @__PURE__ */ React37.createElement(ScrollContainerProvider, {
|
|
3557
3684
|
pinned,
|
|
3685
|
+
overflow,
|
|
3558
3686
|
controller,
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
},
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
},
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
});
|
|
3578
|
-
Root6.displayName = "ScrollContainer.Root";
|
|
3687
|
+
setViewport,
|
|
3688
|
+
setPinned,
|
|
3689
|
+
setOverflow
|
|
3690
|
+
}, children);
|
|
3691
|
+
});
|
|
3692
|
+
Root10.displayName = "ScrollContainer.Root";
|
|
3693
|
+
var Content6 = composable6(({ children, thin, padding, centered, ...props }, forwardedRef) => {
|
|
3694
|
+
return /* @__PURE__ */ React37.createElement(ScrollArea.Root, {
|
|
3695
|
+
...composableProps13(props, {
|
|
3696
|
+
classNames: "relative"
|
|
3697
|
+
}),
|
|
3698
|
+
thin,
|
|
3699
|
+
padding,
|
|
3700
|
+
centered,
|
|
3701
|
+
ref: forwardedRef
|
|
3702
|
+
}, children);
|
|
3703
|
+
});
|
|
3704
|
+
Content6.displayName = "ScrollContainer.Content";
|
|
3579
3705
|
var VIEWPORT_NAME = "ScrollContainer.Viewport";
|
|
3580
|
-
var Viewport =
|
|
3581
|
-
const
|
|
3582
|
-
const
|
|
3706
|
+
var Viewport = slottable10(({ children, asChild, ...props }, forwardedRef) => {
|
|
3707
|
+
const scrollerRef = useRef6(null);
|
|
3708
|
+
const mergedRef = useMergeRefs([
|
|
3709
|
+
forwardedRef,
|
|
3710
|
+
scrollerRef
|
|
3711
|
+
]);
|
|
3712
|
+
const { setViewport, setPinned, setOverflow } = useScrollContainerContext(VIEWPORT_NAME);
|
|
3583
3713
|
useEffect7(() => {
|
|
3584
|
-
|
|
3714
|
+
const el = scrollerRef.current;
|
|
3715
|
+
if (!el) {
|
|
3585
3716
|
return;
|
|
3586
3717
|
}
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
resizeObserver.observe(contentRef.current);
|
|
3590
|
-
return () => resizeObserver.disconnect();
|
|
3718
|
+
setViewport(el);
|
|
3719
|
+
return combine(addEventListener2(el, "wheel", () => setPinned(isBottom(el))), addEventListener2(el, "scroll", () => setOverflow((el.scrollTop ?? 0) > 0)), () => setViewport(null));
|
|
3591
3720
|
}, [
|
|
3592
|
-
|
|
3593
|
-
|
|
3721
|
+
setViewport,
|
|
3722
|
+
setPinned,
|
|
3723
|
+
setOverflow
|
|
3594
3724
|
]);
|
|
3595
|
-
return /* @__PURE__ */ React37.createElement(
|
|
3596
|
-
|
|
3597
|
-
...props,
|
|
3598
|
-
ref:
|
|
3599
|
-
}, children)
|
|
3725
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(ScrollArea.Viewport, {
|
|
3726
|
+
asChild,
|
|
3727
|
+
...composableProps13(props),
|
|
3728
|
+
ref: mergedRef
|
|
3729
|
+
}, children), /* @__PURE__ */ React37.createElement(PinEffect, {
|
|
3730
|
+
scrollerRef
|
|
3731
|
+
}));
|
|
3600
3732
|
});
|
|
3601
3733
|
Viewport.displayName = VIEWPORT_NAME;
|
|
3734
|
+
var PIN_EFFECT_NAME = "ScrollContainer.PinEffect";
|
|
3735
|
+
var PinEffect = ({ scrollerRef }) => {
|
|
3736
|
+
const { pinned, controller } = useScrollContainerContext(PIN_EFFECT_NAME);
|
|
3737
|
+
useEffect7(() => {
|
|
3738
|
+
const viewport = scrollerRef.current;
|
|
3739
|
+
if (!pinned || !viewport) {
|
|
3740
|
+
return;
|
|
3741
|
+
}
|
|
3742
|
+
controller?.scrollToBottom("instant");
|
|
3743
|
+
const resizeObserver = new ResizeObserver(() => controller?.scrollToBottom("smooth"));
|
|
3744
|
+
Array.from(viewport.children).forEach((child) => {
|
|
3745
|
+
resizeObserver.observe(child);
|
|
3746
|
+
});
|
|
3747
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
3748
|
+
mutations.forEach((mutation) => {
|
|
3749
|
+
mutation.addedNodes.forEach((node) => {
|
|
3750
|
+
if (node instanceof Element) {
|
|
3751
|
+
resizeObserver.observe(node);
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
});
|
|
3755
|
+
controller?.scrollToBottom("smooth");
|
|
3756
|
+
});
|
|
3757
|
+
mutationObserver.observe(viewport, {
|
|
3758
|
+
childList: true
|
|
3759
|
+
});
|
|
3760
|
+
return () => {
|
|
3761
|
+
resizeObserver.disconnect();
|
|
3762
|
+
mutationObserver.disconnect();
|
|
3763
|
+
};
|
|
3764
|
+
}, [
|
|
3765
|
+
pinned,
|
|
3766
|
+
controller,
|
|
3767
|
+
scrollerRef
|
|
3768
|
+
]);
|
|
3769
|
+
return null;
|
|
3770
|
+
};
|
|
3771
|
+
var FADE_NAME = "ScrollContainer.Fade";
|
|
3772
|
+
var Fade = () => {
|
|
3773
|
+
const { overflow } = useScrollContainerContext(FADE_NAME);
|
|
3774
|
+
return /* @__PURE__ */ React37.createElement("div", {
|
|
3775
|
+
"data-visible": overflow,
|
|
3776
|
+
className: mx9(
|
|
3777
|
+
// NOTE: Gradients may not be visible with dark reader extensions.
|
|
3778
|
+
"z-10 absolute top-0 inset-x-0 h-24 w-full",
|
|
3779
|
+
'opacity-0 duration-200 transition-opacity data-[visible="true"]:opacity-100',
|
|
3780
|
+
"bg-gradient-to-b from-(--color-base-surface) to-transparent pointer-events-none"
|
|
3781
|
+
)
|
|
3782
|
+
});
|
|
3783
|
+
};
|
|
3784
|
+
Fade.displayName = FADE_NAME;
|
|
3602
3785
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
3603
3786
|
var ScrollDownButton = ({ classNames }) => {
|
|
3604
|
-
const { pinned,
|
|
3787
|
+
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
3605
3788
|
return /* @__PURE__ */ React37.createElement("div", {
|
|
3606
|
-
|
|
3607
|
-
className: mx10("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
3789
|
+
className: mx9("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
3608
3790
|
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3609
3791
|
variant: "primary",
|
|
3610
3792
|
icon: "ph--arrow-down--regular",
|
|
3611
3793
|
iconOnly: true,
|
|
3612
3794
|
size: 4,
|
|
3613
3795
|
label: "Scroll down",
|
|
3614
|
-
onClick: () => scrollToBottom()
|
|
3796
|
+
onClick: () => controller?.scrollToBottom()
|
|
3615
3797
|
}));
|
|
3616
3798
|
};
|
|
3617
3799
|
ScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
3618
3800
|
var ScrollContainer = {
|
|
3619
|
-
Root:
|
|
3801
|
+
Root: Root10,
|
|
3802
|
+
Content: Content6,
|
|
3620
3803
|
Viewport,
|
|
3804
|
+
Fade,
|
|
3621
3805
|
ScrollDownButton
|
|
3622
3806
|
};
|
|
3623
3807
|
|
|
3624
3808
|
// src/components/Select/Select.tsx
|
|
3625
3809
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3626
|
-
import React38, { forwardRef as
|
|
3810
|
+
import React38, { forwardRef as forwardRef25 } from "react";
|
|
3627
3811
|
var SelectRoot = SelectPrimitive.Root;
|
|
3628
3812
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3629
3813
|
var SelectValue = SelectPrimitive.Value;
|
|
3630
3814
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3631
3815
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3632
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
3816
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3633
3817
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Trigger, {
|
|
3634
3818
|
asChild: true,
|
|
3635
3819
|
ref: forwardedRef
|
|
@@ -3644,7 +3828,7 @@ var SelectTriggerButton = /* @__PURE__ */ forwardRef31(({ children, placeholder,
|
|
|
3644
3828
|
icon: "ph--caret-down--bold"
|
|
3645
3829
|
}))));
|
|
3646
3830
|
});
|
|
3647
|
-
var SelectContent = /* @__PURE__ */
|
|
3831
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
3648
3832
|
const { tx } = useThemeContext();
|
|
3649
3833
|
const elevation = useElevationContext();
|
|
3650
3834
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
@@ -3659,7 +3843,7 @@ var SelectContent = /* @__PURE__ */ forwardRef31(({ classNames, children, collis
|
|
|
3659
3843
|
ref: forwardedRef
|
|
3660
3844
|
}, children);
|
|
3661
3845
|
});
|
|
3662
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
3846
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3663
3847
|
const { tx } = useThemeContext();
|
|
3664
3848
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3665
3849
|
...props,
|
|
@@ -3670,7 +3854,7 @@ var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef31(({ classNames, children
|
|
|
3670
3854
|
icon: "ph--caret-up--bold"
|
|
3671
3855
|
}));
|
|
3672
3856
|
});
|
|
3673
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
3857
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3674
3858
|
const { tx } = useThemeContext();
|
|
3675
3859
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3676
3860
|
...props,
|
|
@@ -3681,7 +3865,7 @@ var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef31(({ classNames, childr
|
|
|
3681
3865
|
icon: "ph--caret-down--bold"
|
|
3682
3866
|
}));
|
|
3683
3867
|
});
|
|
3684
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
3868
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3685
3869
|
const { tx } = useThemeContext();
|
|
3686
3870
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectViewport, {
|
|
3687
3871
|
...props,
|
|
@@ -3689,7 +3873,7 @@ var SelectViewport2 = /* @__PURE__ */ forwardRef31(({ classNames, children, ...p
|
|
|
3689
3873
|
ref: forwardedRef
|
|
3690
3874
|
}, children);
|
|
3691
3875
|
});
|
|
3692
|
-
var SelectItem = /* @__PURE__ */
|
|
3876
|
+
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3693
3877
|
const { tx } = useThemeContext();
|
|
3694
3878
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Item, {
|
|
3695
3879
|
...props,
|
|
@@ -3698,7 +3882,7 @@ var SelectItem = /* @__PURE__ */ forwardRef31(({ classNames, ...props }, forward
|
|
|
3698
3882
|
});
|
|
3699
3883
|
});
|
|
3700
3884
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3701
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
3885
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3702
3886
|
const { tx } = useThemeContext();
|
|
3703
3887
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.ItemIndicator, {
|
|
3704
3888
|
...props,
|
|
@@ -3706,7 +3890,7 @@ var SelectItemIndicator = /* @__PURE__ */ forwardRef31(({ classNames, children,
|
|
|
3706
3890
|
ref: forwardedRef
|
|
3707
3891
|
}, children);
|
|
3708
3892
|
});
|
|
3709
|
-
var SelectOption = /* @__PURE__ */
|
|
3893
|
+
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
3710
3894
|
const { tx } = useThemeContext();
|
|
3711
3895
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Item, {
|
|
3712
3896
|
...props,
|
|
@@ -3720,7 +3904,7 @@ var SelectOption = /* @__PURE__ */ forwardRef31(({ children, classNames, ...prop
|
|
|
3720
3904
|
});
|
|
3721
3905
|
var SelectGroup = SelectPrimitive.Group;
|
|
3722
3906
|
var SelectLabel = SelectPrimitive.Label;
|
|
3723
|
-
var SelectSeparator = /* @__PURE__ */
|
|
3907
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3724
3908
|
const { tx } = useThemeContext();
|
|
3725
3909
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Separator, {
|
|
3726
3910
|
...props,
|
|
@@ -3728,7 +3912,7 @@ var SelectSeparator = /* @__PURE__ */ forwardRef31(({ classNames, ...props }, fo
|
|
|
3728
3912
|
ref: forwardedRef
|
|
3729
3913
|
});
|
|
3730
3914
|
});
|
|
3731
|
-
var SelectArrow = /* @__PURE__ */
|
|
3915
|
+
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3732
3916
|
const { tx } = useThemeContext();
|
|
3733
3917
|
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Arrow, {
|
|
3734
3918
|
...props,
|
|
@@ -3758,8 +3942,8 @@ var Select = {
|
|
|
3758
3942
|
};
|
|
3759
3943
|
|
|
3760
3944
|
// src/components/Skeleton/Skeleton.tsx
|
|
3761
|
-
import React39, { forwardRef as
|
|
3762
|
-
var Skeleton = /* @__PURE__ */
|
|
3945
|
+
import React39, { forwardRef as forwardRef26 } from "react";
|
|
3946
|
+
var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
3763
3947
|
const { tx } = useThemeContext();
|
|
3764
3948
|
return /* @__PURE__ */ React39.createElement("div", {
|
|
3765
3949
|
...props,
|
|
@@ -3772,47 +3956,47 @@ var Skeleton = /* @__PURE__ */ forwardRef32(({ classNames, variant = "default",
|
|
|
3772
3956
|
|
|
3773
3957
|
// src/components/Splitter/Splitter.tsx
|
|
3774
3958
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3775
|
-
import { Primitive as
|
|
3776
|
-
import { Slot as
|
|
3777
|
-
import React40
|
|
3778
|
-
import { composableProps as
|
|
3959
|
+
import { Primitive as Primitive21 } from "@radix-ui/react-primitive";
|
|
3960
|
+
import { Slot as Slot21 } from "@radix-ui/react-slot";
|
|
3961
|
+
import React40 from "react";
|
|
3962
|
+
import { composableProps as composableProps14, slottable as slottable11 } from "@dxos/ui-theme";
|
|
3779
3963
|
var SPLITTER_NAME = "Splitter";
|
|
3780
3964
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
3781
3965
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
3782
3966
|
var ROOT_NAME = "Splitter.Root";
|
|
3783
|
-
var
|
|
3784
|
-
const { className, ...rest } = composableProps9(props);
|
|
3785
|
-
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3967
|
+
var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
3786
3968
|
const { tx } = useThemeContext();
|
|
3969
|
+
const { __scopeSplitter, ...rest } = props;
|
|
3970
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
3971
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3787
3972
|
return /* @__PURE__ */ React40.createElement(SplitterProvider, {
|
|
3788
3973
|
scope: __scopeSplitter,
|
|
3789
3974
|
mode,
|
|
3790
3975
|
ratio,
|
|
3791
3976
|
transition
|
|
3792
3977
|
}, /* @__PURE__ */ React40.createElement(Comp, {
|
|
3793
|
-
|
|
3794
|
-
...rest,
|
|
3978
|
+
...restProps,
|
|
3795
3979
|
ref: forwardedRef,
|
|
3796
3980
|
className: tx("splitter.root", {}, className)
|
|
3797
3981
|
}, children));
|
|
3798
3982
|
});
|
|
3799
|
-
|
|
3983
|
+
Root12.displayName = ROOT_NAME;
|
|
3800
3984
|
var PANEL_NAME = "Splitter.Panel";
|
|
3801
|
-
var Panel2 =
|
|
3802
|
-
const { className, ...rest } = composableProps9(props);
|
|
3803
|
-
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3804
|
-
const { mode, ratio, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
3985
|
+
var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
3805
3986
|
const { tx } = useThemeContext();
|
|
3806
|
-
const
|
|
3807
|
-
const
|
|
3808
|
-
const
|
|
3987
|
+
const { __scopeSplitter, ...rest } = props;
|
|
3988
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3989
|
+
const { mode, ratio = 0.5, transition } = useSplitterContext(PANEL_NAME, __scopeSplitter);
|
|
3990
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
3991
|
+
const isTopPanel = position === "top";
|
|
3992
|
+
const topOffset = isTopPanel ? "0%" : mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%`;
|
|
3993
|
+
const height = isTopPanel ? mode === "top" ? "100%" : mode === "bottom" ? "0%" : `${ratio * 100}%` : mode === "bottom" ? "100%" : mode === "top" ? "0%" : `${(1 - ratio) * 100}%`;
|
|
3809
3994
|
return /* @__PURE__ */ React40.createElement(Comp, {
|
|
3810
|
-
|
|
3811
|
-
...rest,
|
|
3995
|
+
...restProps,
|
|
3812
3996
|
ref: forwardedRef,
|
|
3813
3997
|
className: tx("splitter.panel", {}, className),
|
|
3814
3998
|
style: {
|
|
3815
|
-
top,
|
|
3999
|
+
top: topOffset,
|
|
3816
4000
|
height,
|
|
3817
4001
|
transition: `top ${transition}ms, height ${transition}ms ease-out`,
|
|
3818
4002
|
...style
|
|
@@ -3821,17 +4005,17 @@ var Panel2 = /* @__PURE__ */ forwardRef33(({ __scopeSplitter, asChild, children,
|
|
|
3821
4005
|
});
|
|
3822
4006
|
Panel2.displayName = PANEL_NAME;
|
|
3823
4007
|
var Splitter = {
|
|
3824
|
-
Root:
|
|
4008
|
+
Root: Root12,
|
|
3825
4009
|
Panel: Panel2
|
|
3826
4010
|
};
|
|
3827
4011
|
|
|
3828
4012
|
// src/components/Tag/Tag.tsx
|
|
3829
|
-
import { Primitive as
|
|
3830
|
-
import { Slot as
|
|
3831
|
-
import React41, { forwardRef as
|
|
3832
|
-
var Tag = /* @__PURE__ */
|
|
4013
|
+
import { Primitive as Primitive22 } from "@radix-ui/react-primitive";
|
|
4014
|
+
import { Slot as Slot22 } from "@radix-ui/react-slot";
|
|
4015
|
+
import React41, { forwardRef as forwardRef27 } from "react";
|
|
4016
|
+
var Tag = /* @__PURE__ */ forwardRef27(({ asChild, palette = "neutral", classNames, ...props }, forwardedRef) => {
|
|
3833
4017
|
const { tx } = useThemeContext();
|
|
3834
|
-
const Comp = asChild ?
|
|
4018
|
+
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
3835
4019
|
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
3836
4020
|
...props,
|
|
3837
4021
|
className: tx("tag.root", {
|
|
@@ -3843,21 +4027,22 @@ var Tag = /* @__PURE__ */ forwardRef34(({ asChild, palette = "neutral", classNam
|
|
|
3843
4027
|
});
|
|
3844
4028
|
|
|
3845
4029
|
// src/components/Toast/Toast.tsx
|
|
3846
|
-
import { Primitive as
|
|
3847
|
-
import { Slot as
|
|
3848
|
-
import
|
|
3849
|
-
import React42, { forwardRef as
|
|
3850
|
-
var ToastProvider =
|
|
3851
|
-
var ToastViewport = /* @__PURE__ */
|
|
4030
|
+
import { Primitive as Primitive23 } from "@radix-ui/react-primitive";
|
|
4031
|
+
import { Slot as Slot23 } from "@radix-ui/react-slot";
|
|
4032
|
+
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
4033
|
+
import React42, { forwardRef as forwardRef28 } from "react";
|
|
4034
|
+
var ToastProvider = ToastPrimitive.Provider;
|
|
4035
|
+
var ToastViewport = /* @__PURE__ */ forwardRef28(({ classNames, ...props }, forwardedRef) => {
|
|
3852
4036
|
const { tx } = useThemeContext();
|
|
3853
|
-
return /* @__PURE__ */ React42.createElement(
|
|
4037
|
+
return /* @__PURE__ */ React42.createElement(ToastPrimitive.Viewport, {
|
|
4038
|
+
...props,
|
|
3854
4039
|
className: tx("toast.viewport", {}, classNames),
|
|
3855
4040
|
ref: forwardedRef
|
|
3856
4041
|
});
|
|
3857
4042
|
});
|
|
3858
|
-
var ToastRoot = /* @__PURE__ */
|
|
4043
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
3859
4044
|
const { tx } = useThemeContext();
|
|
3860
|
-
return /* @__PURE__ */ React42.createElement(
|
|
4045
|
+
return /* @__PURE__ */ React42.createElement(ToastPrimitive.Root, {
|
|
3861
4046
|
...props,
|
|
3862
4047
|
className: tx("toast.root", {}, classNames),
|
|
3863
4048
|
ref: forwardedRef
|
|
@@ -3865,44 +4050,44 @@ var ToastRoot = /* @__PURE__ */ forwardRef35(({ classNames, children, ...props }
|
|
|
3865
4050
|
elevation: "toast"
|
|
3866
4051
|
}, children));
|
|
3867
4052
|
});
|
|
3868
|
-
var ToastBody = /* @__PURE__ */
|
|
4053
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3869
4054
|
const { tx } = useThemeContext();
|
|
3870
|
-
const Comp = asChild ?
|
|
4055
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
3871
4056
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3872
4057
|
...props,
|
|
3873
4058
|
className: tx("toast.body", {}, classNames),
|
|
3874
4059
|
ref: forwardedRef
|
|
3875
4060
|
});
|
|
3876
4061
|
});
|
|
3877
|
-
var ToastTitle = /* @__PURE__ */
|
|
4062
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3878
4063
|
const { tx } = useThemeContext();
|
|
3879
|
-
const Comp = asChild ?
|
|
4064
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
3880
4065
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3881
4066
|
...props,
|
|
3882
4067
|
className: tx("toast.title", {}, classNames),
|
|
3883
4068
|
ref: forwardedRef
|
|
3884
4069
|
});
|
|
3885
4070
|
});
|
|
3886
|
-
var ToastDescription = /* @__PURE__ */
|
|
4071
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3887
4072
|
const { tx } = useThemeContext();
|
|
3888
|
-
const Comp = asChild ?
|
|
4073
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
3889
4074
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3890
4075
|
...props,
|
|
3891
4076
|
className: tx("toast.description", {}, classNames),
|
|
3892
4077
|
ref: forwardedRef
|
|
3893
4078
|
});
|
|
3894
4079
|
});
|
|
3895
|
-
var ToastActions = /* @__PURE__ */
|
|
4080
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3896
4081
|
const { tx } = useThemeContext();
|
|
3897
|
-
const Comp = asChild ?
|
|
4082
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
3898
4083
|
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3899
4084
|
...props,
|
|
3900
4085
|
className: tx("toast.actions", {}, classNames),
|
|
3901
4086
|
ref: forwardedRef
|
|
3902
4087
|
});
|
|
3903
4088
|
});
|
|
3904
|
-
var ToastAction =
|
|
3905
|
-
var ToastClose =
|
|
4089
|
+
var ToastAction = ToastPrimitive.Action;
|
|
4090
|
+
var ToastClose = ToastPrimitive.Close;
|
|
3906
4091
|
var Toast = {
|
|
3907
4092
|
Provider: ToastProvider,
|
|
3908
4093
|
Viewport: ToastViewport,
|
|
@@ -3937,6 +4122,7 @@ export {
|
|
|
3937
4122
|
ErrorFallback,
|
|
3938
4123
|
ErrorStack,
|
|
3939
4124
|
Flex,
|
|
4125
|
+
Focus,
|
|
3940
4126
|
Grid,
|
|
3941
4127
|
Icon,
|
|
3942
4128
|
IconButton,
|
|
@@ -3958,6 +4144,8 @@ export {
|
|
|
3958
4144
|
Skeleton,
|
|
3959
4145
|
Splitter,
|
|
3960
4146
|
Status,
|
|
4147
|
+
TREEGRID_PARENT_OF_SEPARATOR,
|
|
4148
|
+
TREEGRID_PATH_SEPARATOR,
|
|
3961
4149
|
Tag,
|
|
3962
4150
|
ThemeContext,
|
|
3963
4151
|
ThemeProvider,
|
|
@@ -3967,7 +4155,7 @@ export {
|
|
|
3967
4155
|
ToggleGroup,
|
|
3968
4156
|
ToggleGroupIconItem,
|
|
3969
4157
|
ToggleGroupItem,
|
|
3970
|
-
|
|
4158
|
+
Toolbar,
|
|
3971
4159
|
Tooltip,
|
|
3972
4160
|
Trans,
|
|
3973
4161
|
Tree,
|
|
@@ -3981,6 +4169,7 @@ export {
|
|
|
3981
4169
|
initialSafeArea,
|
|
3982
4170
|
isLabel,
|
|
3983
4171
|
messageIcons,
|
|
4172
|
+
parseCaptureOwnerStack,
|
|
3984
4173
|
toLocalizedString,
|
|
3985
4174
|
useAvatarContext,
|
|
3986
4175
|
useButtonGroupContext,
|
|
@@ -3989,6 +4178,7 @@ export {
|
|
|
3989
4178
|
useDropdownMenuContext,
|
|
3990
4179
|
useDropdownMenuMenuScope,
|
|
3991
4180
|
useElevationContext,
|
|
4181
|
+
useFocus,
|
|
3992
4182
|
useIconHref,
|
|
3993
4183
|
useLandmarkMover,
|
|
3994
4184
|
useListContext,
|
|
@@ -3996,6 +4186,7 @@ export {
|
|
|
3996
4186
|
useMainContext,
|
|
3997
4187
|
usePx,
|
|
3998
4188
|
useSafeArea,
|
|
4189
|
+
useSafeCollisionPadding,
|
|
3999
4190
|
useScrollContainerContext,
|
|
4000
4191
|
useSidebars,
|
|
4001
4192
|
useThemeContext,
|