@dxos/react-ui 0.8.4-main.4a85c3132b → 0.8.4-main.4f23b4e393
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 +1209 -1031
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +44 -20
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- 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 +1209 -1031
- 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 +44 -20
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- 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 -65
- 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 -11
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +21 -10
- 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 -21
- 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 +10 -20
- 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 +20 -19
- 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 +7 -0
- package/dist/types/src/primitives/Container/Container.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts +6 -0
- package/dist/types/src/primitives/Container/Container.stories.d.ts.map +1 -0
- package/dist/types/src/primitives/Container/index.d.ts +2 -0
- package/dist/types/src/primitives/Container/index.d.ts.map +1 -0
- package/dist/types/src/primitives/Flex/Flex.d.ts +8 -5
- package/dist/types/src/primitives/Flex/Flex.d.ts.map +1 -1
- package/dist/types/src/primitives/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.d.ts +6 -5
- package/dist/types/src/primitives/Grid/Grid.d.ts.map +1 -1
- package/dist/types/src/primitives/Grid/Grid.stories.d.ts.map +1 -1
- package/dist/types/src/primitives/Panel/Panel.d.ts +23 -22
- 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/primitives/index.d.ts +1 -0
- package/dist/types/src/primitives/index.d.ts.map +1 -1
- package/dist/types/src/testing/Loading.d.ts +9 -0
- package/dist/types/src/testing/Loading.d.ts.map +1 -0
- 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/testing/index.d.ts +1 -0
- package/dist/types/src/testing/index.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 +294 -132
- 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 +3 -4
- 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/TreeDropIndicator.tsx +1 -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 +41 -25
- 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 -46
- 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 +34 -47
- 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 +64 -68
- 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 +128 -19
- package/src/primitives/Column/Column.tsx +89 -80
- package/src/primitives/Container/Container.stories.tsx +29 -0
- package/src/primitives/Container/Container.tsx +19 -0
- package/src/primitives/Container/index.ts +5 -0
- package/src/primitives/Flex/Flex.stories.tsx +0 -1
- package/src/primitives/Flex/Flex.tsx +20 -20
- package/src/primitives/Grid/Grid.stories.tsx +0 -1
- package/src/primitives/Grid/Grid.tsx +23 -36
- package/src/primitives/Panel/Panel.stories.tsx +9 -8
- package/src/primitives/Panel/Panel.tsx +43 -60
- package/src/primitives/index.ts +1 -0
- package/src/testing/Loading.tsx +47 -0
- package/src/testing/decorators/withLayout.tsx +7 -17
- package/src/testing/decorators/withTheme.tsx +10 -7
- package/src/testing/index.ts +2 -0
- 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,31 +463,35 @@ 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
|
|
475
|
+
import React9 from "react";
|
|
476
|
+
import { composableProps, slottable } from "@dxos/ui-theme";
|
|
445
477
|
var COLUMN_ROOT_NAME = "Column.Root";
|
|
446
478
|
var gutterSizes = {
|
|
479
|
+
xs: "var(--dx-gutter-xs)",
|
|
447
480
|
sm: "var(--dx-gutter-sm)",
|
|
448
481
|
md: "var(--dx-gutter-md)",
|
|
449
|
-
lg: "var(--dx-gutter-lg)"
|
|
450
|
-
rail: "var(--dx-rail-item)"
|
|
482
|
+
lg: "var(--dx-gutter-lg)"
|
|
451
483
|
};
|
|
452
|
-
var
|
|
484
|
+
var ColumnRoot = slottable(({ children, asChild, role, gutter = "md", ...props }, forwardedRef) => {
|
|
485
|
+
const { className, ...rest } = composableProps(props);
|
|
486
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
453
487
|
const { tx } = useThemeContext();
|
|
454
|
-
const Component = asChild ? Slot5 : Primitive5.div;
|
|
455
488
|
const gutterSize = gutterSizes[gutter];
|
|
456
|
-
return /* @__PURE__ */ React9.createElement(
|
|
457
|
-
...
|
|
489
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
490
|
+
...rest,
|
|
458
491
|
role: role ?? "none",
|
|
459
492
|
style: {
|
|
460
493
|
"--gutter": gutterSize,
|
|
494
|
+
"--dx-col": "2 / span 1",
|
|
461
495
|
gridTemplateColumns: [
|
|
462
496
|
gutterSize,
|
|
463
497
|
"minmax(0,1fr)",
|
|
@@ -466,169 +500,179 @@ var Root = /* @__PURE__ */ forwardRef9(({ classNames, className, asChild, role,
|
|
|
466
500
|
},
|
|
467
501
|
className: tx("column.root", {
|
|
468
502
|
gutter
|
|
469
|
-
},
|
|
470
|
-
className,
|
|
471
|
-
classNames
|
|
472
|
-
]),
|
|
503
|
+
}, className),
|
|
473
504
|
ref: forwardedRef
|
|
474
505
|
}, children);
|
|
475
506
|
});
|
|
476
|
-
|
|
507
|
+
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
477
508
|
var COLUMN_ROW_NAME = "Column.Row";
|
|
478
|
-
var
|
|
509
|
+
var ColumnRow = slottable(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
510
|
+
const { className, ...rest } = composableProps(props);
|
|
511
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
479
512
|
const { tx } = useThemeContext();
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
...props,
|
|
483
|
-
className: tx("column.row", {}, [
|
|
484
|
-
className,
|
|
485
|
-
classNames
|
|
486
|
-
]),
|
|
513
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
514
|
+
...rest,
|
|
487
515
|
role: role ?? "none",
|
|
516
|
+
className: tx("column.row", {}, className),
|
|
488
517
|
ref: forwardedRef
|
|
489
518
|
}, children);
|
|
490
519
|
});
|
|
491
|
-
|
|
492
|
-
var
|
|
493
|
-
var
|
|
520
|
+
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
521
|
+
var COLUMN_BLEED_NAME = "Column.Bleed";
|
|
522
|
+
var ColumnBleed = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
494
523
|
const { tx } = useThemeContext();
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
className: tx("column.segment", {}, [
|
|
501
|
-
className,
|
|
502
|
-
classNames
|
|
503
|
-
]),
|
|
504
|
-
ref: forwardedRef
|
|
505
|
-
}, children);
|
|
506
|
-
}
|
|
507
|
-
return /* @__PURE__ */ React9.createElement(Component, {
|
|
508
|
-
...props,
|
|
509
|
-
className: tx("column.segment", {}, [
|
|
510
|
-
className,
|
|
511
|
-
classNames
|
|
512
|
-
]),
|
|
513
|
-
role,
|
|
524
|
+
const { className, ...rest } = composableProps(props);
|
|
525
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
526
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
527
|
+
...rest,
|
|
528
|
+
className: tx("column.bleed", {}, className),
|
|
514
529
|
ref: forwardedRef
|
|
515
|
-
},
|
|
516
|
-
|
|
517
|
-
|
|
530
|
+
}, children);
|
|
531
|
+
});
|
|
532
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
533
|
+
var COLUMN_CENTER_NAME = "Column.Center";
|
|
534
|
+
var ColumnCenter = slottable(({ children, asChild, ...props }, forwardedRef) => {
|
|
535
|
+
const { tx } = useThemeContext();
|
|
536
|
+
const { className, ...rest } = composableProps(props);
|
|
537
|
+
const Comp = asChild ? Slot5 : Primitive5.div;
|
|
538
|
+
return /* @__PURE__ */ React9.createElement(Comp, {
|
|
539
|
+
...rest,
|
|
540
|
+
className: tx("column.center", {}, className),
|
|
541
|
+
ref: forwardedRef
|
|
542
|
+
}, children);
|
|
518
543
|
});
|
|
519
|
-
|
|
544
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
520
545
|
var Column = {
|
|
521
|
-
Root,
|
|
522
|
-
Row,
|
|
523
|
-
|
|
546
|
+
Root: ColumnRoot,
|
|
547
|
+
Row: ColumnRow,
|
|
548
|
+
Bleed: ColumnBleed,
|
|
549
|
+
Center: ColumnCenter
|
|
524
550
|
};
|
|
525
551
|
|
|
526
|
-
// src/primitives/
|
|
552
|
+
// src/primitives/Container/Container.tsx
|
|
553
|
+
import { Primitive as Primitive6 } from "@radix-ui/react-primitive";
|
|
554
|
+
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
527
555
|
import React10 from "react";
|
|
528
|
-
import { mx as mx2 } from "@dxos/ui-theme";
|
|
529
|
-
var
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
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);
|
|
559
|
+
const Comp = asChild ? Slot6 : Primitive6.div;
|
|
560
|
+
return /* @__PURE__ */ React10.createElement(Comp, {
|
|
561
|
+
...rest,
|
|
562
|
+
className: mx2("dx-container", className),
|
|
563
|
+
ref: forwardedRef
|
|
534
564
|
}, children);
|
|
535
|
-
};
|
|
565
|
+
});
|
|
536
566
|
|
|
537
|
-
// src/primitives/
|
|
567
|
+
// src/primitives/Flex/Flex.tsx
|
|
568
|
+
import { Primitive as Primitive7 } from "@radix-ui/react-primitive";
|
|
569
|
+
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
538
570
|
import React11 from "react";
|
|
539
|
-
import { mx as mx3 } from "@dxos/ui-theme";
|
|
540
|
-
var
|
|
541
|
-
|
|
542
|
-
|
|
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) => {
|
|
573
|
+
const { className, ...rest } = composableProps3(props);
|
|
574
|
+
const Comp = asChild ? Slot7 : Primitive7.div;
|
|
575
|
+
return /* @__PURE__ */ React11.createElement(Comp, {
|
|
576
|
+
ref: forwardedRef,
|
|
577
|
+
...rest,
|
|
578
|
+
className: mx3("flex", column && "flex-col", grow && "flex-1 overflow-hidden", className)
|
|
579
|
+
}, children);
|
|
580
|
+
});
|
|
581
|
+
|
|
582
|
+
// src/primitives/Grid/Grid.tsx
|
|
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) => {
|
|
586
|
+
const { className, ...rest } = composableProps4(props);
|
|
587
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
588
|
+
ref: forwardedRef,
|
|
589
|
+
...rest,
|
|
543
590
|
role: role ?? "none",
|
|
591
|
+
className: mx4("grid overflow-hidden", grow && "dx-container", className),
|
|
544
592
|
style: {
|
|
545
593
|
gridTemplateColumns: cols ? `repeat(${cols}, 1fr)` : void 0,
|
|
546
594
|
gridTemplateRows: rows ? `repeat(${rows}, 1fr)` : void 0,
|
|
547
595
|
...style
|
|
548
|
-
}
|
|
549
|
-
className: mx3("grid overflow-hidden", grow && "dx-container", className, classNames)
|
|
596
|
+
}
|
|
550
597
|
}, children);
|
|
551
|
-
};
|
|
598
|
+
});
|
|
552
599
|
|
|
553
600
|
// src/primitives/Panel/Panel.tsx
|
|
554
|
-
import { Primitive as
|
|
555
|
-
import { Slot as
|
|
556
|
-
import
|
|
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";
|
|
557
605
|
var GRID_TEMPLATE_ROWS = "auto 1fr auto";
|
|
558
606
|
var GRID_TEMPLATE_AREAS = '"toolbar" "content" "statusbar"';
|
|
559
|
-
var
|
|
607
|
+
var PanelRoot = slottable4(({ children, asChild, role, style, ...props }, forwardedRef) => {
|
|
608
|
+
const { className, ...rest } = composableProps5(props);
|
|
609
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
560
610
|
const { tx } = useThemeContext();
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
ref: forwardedRef,
|
|
611
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
612
|
+
...rest,
|
|
564
613
|
role: role ?? "none",
|
|
565
|
-
...props,
|
|
566
614
|
style: {
|
|
567
615
|
gridTemplateRows: GRID_TEMPLATE_ROWS,
|
|
568
616
|
gridTemplateAreas: GRID_TEMPLATE_AREAS,
|
|
569
|
-
...
|
|
617
|
+
...style
|
|
570
618
|
},
|
|
571
|
-
className: tx("panel.root", {},
|
|
572
|
-
|
|
573
|
-
classNames
|
|
574
|
-
])
|
|
619
|
+
className: tx("panel.root", {}, className),
|
|
620
|
+
ref: forwardedRef
|
|
575
621
|
}, children);
|
|
576
622
|
});
|
|
577
|
-
|
|
578
|
-
var
|
|
623
|
+
PanelRoot.displayName = "Panel.Root";
|
|
624
|
+
var PanelToolbar = slottable4(({ children, asChild, size, ...props }, forwardedRef) => {
|
|
625
|
+
const { className, ...rest } = composableProps5(props);
|
|
626
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
579
627
|
const { tx } = useThemeContext();
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
ref: forwardedRef,
|
|
628
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
629
|
+
...rest,
|
|
583
630
|
"data-slot": "toolbar",
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
])
|
|
631
|
+
className: tx("panel.toolbar", {
|
|
632
|
+
size
|
|
633
|
+
}, className),
|
|
634
|
+
ref: forwardedRef
|
|
589
635
|
}, children);
|
|
590
636
|
});
|
|
591
|
-
|
|
592
|
-
var
|
|
637
|
+
PanelToolbar.displayName = "Panel.Toolbar";
|
|
638
|
+
var PanelContent = slottable4(({ children, asChild, ...props }, forwardedRef) => {
|
|
639
|
+
const { className, ...rest } = composableProps5(props);
|
|
640
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
593
641
|
const { tx } = useThemeContext();
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
ref: forwardedRef,
|
|
642
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
643
|
+
...rest,
|
|
597
644
|
"data-slot": "content",
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
className,
|
|
601
|
-
classNames
|
|
602
|
-
])
|
|
645
|
+
className: tx("panel.content", {}, className),
|
|
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) => {
|
|
651
|
+
const { className, ...rest } = composableProps5(props);
|
|
652
|
+
const Comp = asChild ? Slot8 : Primitive8.div;
|
|
607
653
|
const { tx } = useThemeContext();
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
ref: forwardedRef,
|
|
654
|
+
return /* @__PURE__ */ React13.createElement(Comp, {
|
|
655
|
+
...rest,
|
|
611
656
|
"data-slot": "statusbar",
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
])
|
|
657
|
+
className: tx("panel.statusbar", {
|
|
658
|
+
size
|
|
659
|
+
}, className),
|
|
660
|
+
ref: forwardedRef
|
|
617
661
|
}, children);
|
|
618
662
|
});
|
|
619
|
-
|
|
663
|
+
PanelStatusbar.displayName = "Panel.Statusbar";
|
|
620
664
|
var Panel = {
|
|
621
|
-
Root:
|
|
622
|
-
Toolbar,
|
|
623
|
-
Content,
|
|
624
|
-
Statusbar
|
|
665
|
+
Root: PanelRoot,
|
|
666
|
+
Toolbar: PanelToolbar,
|
|
667
|
+
Content: PanelContent,
|
|
668
|
+
Statusbar: PanelStatusbar
|
|
625
669
|
};
|
|
626
670
|
|
|
627
671
|
// src/components/Image/Image.tsx
|
|
628
|
-
import
|
|
629
|
-
import { mx as
|
|
672
|
+
import React14, { useCallback as useCallback3, useRef, useState as useState3 } from "react";
|
|
673
|
+
import { mx as mx5 } from "@dxos/ui-theme";
|
|
630
674
|
var cache = /* @__PURE__ */ new Map();
|
|
631
|
-
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 }) => {
|
|
632
676
|
const [crossOriginState, setCrossOriginState] = useState3(crossOrigin);
|
|
633
677
|
const [dominantColor, setDominantColor] = useState3(void 0);
|
|
634
678
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
@@ -666,31 +710,37 @@ var Image = ({ classNames, src, alt = "", crossOrigin = "anonymous", sampleSize
|
|
|
666
710
|
contrast,
|
|
667
711
|
src
|
|
668
712
|
]);
|
|
669
|
-
return /* @__PURE__ */
|
|
670
|
-
|
|
713
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
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),
|
|
671
721
|
style: {
|
|
672
722
|
backgroundColor: dominantColor
|
|
673
723
|
}
|
|
674
|
-
}, /* @__PURE__ */
|
|
724
|
+
}, /* @__PURE__ */ React14.createElement("canvas", {
|
|
675
725
|
ref: canvasRef,
|
|
676
726
|
style: {
|
|
677
727
|
display: "none"
|
|
678
728
|
},
|
|
679
729
|
"aria-hidden": "true"
|
|
680
|
-
}), /* @__PURE__ */
|
|
730
|
+
}), /* @__PURE__ */ React14.createElement("div", {
|
|
681
731
|
className: "absolute inset-0 pointer-events-none",
|
|
682
732
|
style: {
|
|
683
733
|
background: dominantColor ? `radial-gradient(circle at center, transparent 30%, ${dominantColor} 100%)` : void 0,
|
|
684
734
|
transition: "opacity 0.7s ease-in-out",
|
|
685
735
|
opacity: 0.5
|
|
686
736
|
}
|
|
687
|
-
}), /* @__PURE__ */
|
|
737
|
+
}), /* @__PURE__ */ React14.createElement("img", {
|
|
688
738
|
src,
|
|
689
739
|
alt,
|
|
690
740
|
crossOrigin: crossOriginState,
|
|
691
741
|
onError: handleImageError,
|
|
692
742
|
onLoad: handleImageLoad,
|
|
693
|
-
className: "z-10
|
|
743
|
+
className: mx5("z-10 transition-opacity duration-500", fit === "cover" ? "w-full h-full object-cover" : "object-contain"),
|
|
694
744
|
style: {
|
|
695
745
|
opacity: imageLoaded ? 1 : 0
|
|
696
746
|
}
|
|
@@ -728,7 +778,9 @@ var extractDominantColor = (canvas, img, { sampleSize = 64, contrast = 0.95 }) =
|
|
|
728
778
|
const green = pixels[i + 1];
|
|
729
779
|
const blue = pixels[i + 2];
|
|
730
780
|
const alpha = pixels[i + 3];
|
|
731
|
-
if (alpha === 0)
|
|
781
|
+
if (alpha === 0) {
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
732
784
|
const max = Math.max(red, green, blue);
|
|
733
785
|
const min = Math.min(red, green, blue);
|
|
734
786
|
const saturation = max === 0 ? 0 : (max - min) / max;
|
|
@@ -756,75 +808,49 @@ var isTransparent = (pixels, sampleSize, threshold = 0.5) => {
|
|
|
756
808
|
const edgePixels = sampleSize * 4 - 4;
|
|
757
809
|
for (let x = 0; x < sampleSize; x++) {
|
|
758
810
|
const topIndex = x * 4;
|
|
759
|
-
if (pixels[topIndex + 3] === 0)
|
|
811
|
+
if (pixels[topIndex + 3] === 0) {
|
|
812
|
+
edgeTransparentPixels++;
|
|
813
|
+
}
|
|
760
814
|
const bottomIndex = ((sampleSize - 1) * sampleSize + x) * 4;
|
|
761
|
-
if (pixels[bottomIndex + 3] === 0)
|
|
815
|
+
if (pixels[bottomIndex + 3] === 0) {
|
|
816
|
+
edgeTransparentPixels++;
|
|
817
|
+
}
|
|
762
818
|
}
|
|
763
819
|
for (let y = 1; y < sampleSize - 1; y++) {
|
|
764
820
|
const leftIndex = y * sampleSize * 4;
|
|
765
|
-
if (pixels[leftIndex + 3] === 0)
|
|
821
|
+
if (pixels[leftIndex + 3] === 0) {
|
|
822
|
+
edgeTransparentPixels++;
|
|
823
|
+
}
|
|
766
824
|
const rightIndex = (y * sampleSize + sampleSize - 1) * 4;
|
|
767
|
-
if (pixels[rightIndex + 3] === 0)
|
|
825
|
+
if (pixels[rightIndex + 3] === 0) {
|
|
826
|
+
edgeTransparentPixels++;
|
|
827
|
+
}
|
|
768
828
|
}
|
|
769
829
|
return edgeTransparentPixels / edgePixels > threshold;
|
|
770
830
|
};
|
|
771
831
|
|
|
772
832
|
// src/components/Toolbar/Toolbar.tsx
|
|
773
|
-
import { Primitive as
|
|
774
|
-
import { Slot as
|
|
833
|
+
import { Primitive as Primitive11 } from "@radix-ui/react-primitive";
|
|
834
|
+
import { Slot as Slot11 } from "@radix-ui/react-slot";
|
|
775
835
|
import * as ToolbarPrimitive from "@radix-ui/react-toolbar";
|
|
776
|
-
import
|
|
836
|
+
import React18, { forwardRef as forwardRef12 } from "react";
|
|
777
837
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
var translationKey = "@dxos/react-ui";
|
|
781
|
-
var translations = [
|
|
782
|
-
{
|
|
783
|
-
"en-US": {
|
|
784
|
-
[translationKey]: {
|
|
785
|
-
"toolbar menu label": "Action menu",
|
|
786
|
-
"toolbar drag handle label": "Drag to rearrange",
|
|
787
|
-
"toolbar close label": "Close"
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
];
|
|
838
|
+
import { composable as composable2, composableProps as composableProps6, slottable as slottable5 } from "@dxos/ui-theme";
|
|
839
|
+
import { translationKey } from "#translations";
|
|
792
840
|
|
|
793
841
|
// src/components/Menu/ContextMenu.tsx
|
|
794
842
|
import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
|
|
795
|
-
import { Primitive as
|
|
796
|
-
import { Slot as
|
|
797
|
-
import
|
|
798
|
-
|
|
799
|
-
// src/hooks/useSafeCollisionPadding.ts
|
|
800
|
-
import { useMemo as useMemo2 } from "react";
|
|
801
|
-
var propIsNumber = (prop) => Number.isFinite(prop);
|
|
802
|
-
var propsIsRecord = (prop) => !!(prop && typeof prop === "object");
|
|
803
|
-
var safePadding = (propsPadding, safePadding2, side) => {
|
|
804
|
-
return (propIsNumber(safePadding2[side]) ? safePadding2[side] : 0) + (propIsNumber(propsPadding) ? propsPadding : propsIsRecord(propsPadding) ? propsPadding[side] ?? 0 : 0);
|
|
805
|
-
};
|
|
806
|
-
var useSafeCollisionPadding = (collisionPadding) => {
|
|
807
|
-
const { safeAreaPadding } = useThemeContext();
|
|
808
|
-
return useMemo2(() => ({
|
|
809
|
-
top: safePadding(collisionPadding, safeAreaPadding, "top"),
|
|
810
|
-
right: safePadding(collisionPadding, safeAreaPadding, "right"),
|
|
811
|
-
bottom: safePadding(collisionPadding, safeAreaPadding, "bottom"),
|
|
812
|
-
left: safePadding(collisionPadding, safeAreaPadding, "left")
|
|
813
|
-
}), [
|
|
814
|
-
collisionPadding,
|
|
815
|
-
safeAreaPadding
|
|
816
|
-
]);
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
// 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";
|
|
820
846
|
var ContextMenuRoot = ContextMenuPrimitive.ContextMenu;
|
|
821
847
|
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
822
848
|
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
823
|
-
var ContextMenuContent = /* @__PURE__ */
|
|
849
|
+
var ContextMenuContent = /* @__PURE__ */ forwardRef9(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
824
850
|
const { tx } = useThemeContext();
|
|
825
851
|
const elevation = useElevationContext();
|
|
826
852
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
827
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Content, {
|
|
828
854
|
...props,
|
|
829
855
|
"data-arrow-keys": "up down",
|
|
830
856
|
collisionPadding: safeCollisionPadding,
|
|
@@ -834,18 +860,18 @@ var ContextMenuContent = /* @__PURE__ */ forwardRef11(({ classNames, children, c
|
|
|
834
860
|
ref: forwardedRef
|
|
835
861
|
}, children);
|
|
836
862
|
});
|
|
837
|
-
var ContextMenuViewport = /* @__PURE__ */
|
|
863
|
+
var ContextMenuViewport = /* @__PURE__ */ forwardRef9(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
838
864
|
const { tx } = useThemeContext();
|
|
839
|
-
const Comp = asChild ?
|
|
840
|
-
return /* @__PURE__ */
|
|
865
|
+
const Comp = asChild ? Slot9 : Primitive9.div;
|
|
866
|
+
return /* @__PURE__ */ React15.createElement(Comp, {
|
|
841
867
|
...props,
|
|
842
868
|
className: tx("menu.viewport", {}, classNames),
|
|
843
869
|
ref: forwardedRef
|
|
844
870
|
}, children);
|
|
845
871
|
});
|
|
846
|
-
var ContextMenuArrow = /* @__PURE__ */
|
|
872
|
+
var ContextMenuArrow = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
847
873
|
const { tx } = useThemeContext();
|
|
848
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Arrow, {
|
|
849
875
|
...props,
|
|
850
876
|
className: tx("menu.arrow", {}, classNames),
|
|
851
877
|
ref: forwardedRef
|
|
@@ -853,33 +879,33 @@ var ContextMenuArrow = /* @__PURE__ */ forwardRef11(({ classNames, ...props }, f
|
|
|
853
879
|
});
|
|
854
880
|
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
855
881
|
var ContextMenuItemIndicator = ContextMenuPrimitive.ItemIndicator;
|
|
856
|
-
var ContextMenuItem = /* @__PURE__ */
|
|
882
|
+
var ContextMenuItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
857
883
|
const { tx } = useThemeContext();
|
|
858
|
-
return /* @__PURE__ */
|
|
884
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Item, {
|
|
859
885
|
...props,
|
|
860
886
|
className: tx("menu.item", {}, classNames),
|
|
861
887
|
ref: forwardedRef
|
|
862
888
|
});
|
|
863
889
|
});
|
|
864
|
-
var ContextMenuCheckboxItem = /* @__PURE__ */
|
|
890
|
+
var ContextMenuCheckboxItem = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
865
891
|
const { tx } = useThemeContext();
|
|
866
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.CheckboxItem, {
|
|
867
893
|
...props,
|
|
868
894
|
className: tx("menu.item", {}, classNames),
|
|
869
895
|
ref: forwardedRef
|
|
870
896
|
});
|
|
871
897
|
});
|
|
872
|
-
var ContextMenuSeparator = /* @__PURE__ */
|
|
898
|
+
var ContextMenuSeparator = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
873
899
|
const { tx } = useThemeContext();
|
|
874
|
-
return /* @__PURE__ */
|
|
900
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Separator, {
|
|
875
901
|
...props,
|
|
876
902
|
className: tx("menu.separator", {}, classNames),
|
|
877
903
|
ref: forwardedRef
|
|
878
904
|
});
|
|
879
905
|
});
|
|
880
|
-
var ContextMenuGroupLabel = /* @__PURE__ */
|
|
906
|
+
var ContextMenuGroupLabel = /* @__PURE__ */ forwardRef9(({ classNames, ...props }, forwardedRef) => {
|
|
881
907
|
const { tx } = useThemeContext();
|
|
882
|
-
return /* @__PURE__ */
|
|
908
|
+
return /* @__PURE__ */ React15.createElement(ContextMenuPrimitive.Label, {
|
|
883
909
|
...props,
|
|
884
910
|
className: tx("menu.groupLabel", {}, classNames),
|
|
885
911
|
ref: forwardedRef
|
|
@@ -907,18 +933,17 @@ import { createContextScope } from "@radix-ui/react-context";
|
|
|
907
933
|
import { useId as useId2 } from "@radix-ui/react-id";
|
|
908
934
|
import * as MenuPrimitive from "@radix-ui/react-menu";
|
|
909
935
|
import { createMenuScope } from "@radix-ui/react-menu";
|
|
910
|
-
import { Primitive as
|
|
911
|
-
import { Slot as
|
|
936
|
+
import { Primitive as Primitive10 } from "@radix-ui/react-primitive";
|
|
937
|
+
import { Slot as Slot10 } from "@radix-ui/react-slot";
|
|
912
938
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
913
|
-
import
|
|
939
|
+
import React16, { forwardRef as forwardRef10, useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useRef as useRef2 } from "react";
|
|
914
940
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
915
941
|
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope(DROPDOWN_MENU_NAME, [
|
|
916
942
|
createMenuScope
|
|
917
943
|
]);
|
|
918
944
|
var useMenuScope = createMenuScope();
|
|
919
945
|
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
920
|
-
var DropdownMenuRoot = (
|
|
921
|
-
const { __scopeDropdownMenu, children, dir, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
946
|
+
var DropdownMenuRoot = ({ __scopeDropdownMenu, children, dir, modal = true, open: openProp, defaultOpen, onOpenChange }) => {
|
|
922
947
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
923
948
|
const triggerRef = useRef2(null);
|
|
924
949
|
const [open = false, setOpen] = useControllableState({
|
|
@@ -926,7 +951,7 @@ var DropdownMenuRoot = (props) => {
|
|
|
926
951
|
defaultProp: defaultOpen,
|
|
927
952
|
onChange: onOpenChange
|
|
928
953
|
});
|
|
929
|
-
return /* @__PURE__ */
|
|
954
|
+
return /* @__PURE__ */ React16.createElement(DropdownMenuProvider, {
|
|
930
955
|
scope: __scopeDropdownMenu,
|
|
931
956
|
triggerId: useId2(),
|
|
932
957
|
triggerRef,
|
|
@@ -937,24 +962,24 @@ var DropdownMenuRoot = (props) => {
|
|
|
937
962
|
setOpen
|
|
938
963
|
]),
|
|
939
964
|
modal
|
|
940
|
-
}, /* @__PURE__ */
|
|
965
|
+
}, /* @__PURE__ */ React16.createElement(MenuPrimitive.Root, {
|
|
941
966
|
...menuScope,
|
|
942
|
-
open,
|
|
943
|
-
onOpenChange: setOpen,
|
|
944
967
|
dir,
|
|
945
|
-
modal
|
|
968
|
+
modal,
|
|
969
|
+
open,
|
|
970
|
+
onOpenChange: setOpen
|
|
946
971
|
}, children));
|
|
947
972
|
};
|
|
948
973
|
DropdownMenuRoot.displayName = DROPDOWN_MENU_NAME;
|
|
949
974
|
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
950
|
-
var DropdownMenuTrigger = /* @__PURE__ */
|
|
975
|
+
var DropdownMenuTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
951
976
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
952
977
|
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
953
978
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
954
|
-
return /* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Anchor, {
|
|
955
980
|
asChild: true,
|
|
956
981
|
...menuScope
|
|
957
|
-
}, /* @__PURE__ */
|
|
982
|
+
}, /* @__PURE__ */ React16.createElement(Primitive10.button, {
|
|
958
983
|
type: "button",
|
|
959
984
|
id: context.triggerId,
|
|
960
985
|
"aria-haspopup": "menu",
|
|
@@ -1008,7 +1033,7 @@ var DropdownMenuVirtualTrigger = (props) => {
|
|
|
1008
1033
|
context.triggerRef.current = virtualRef.current;
|
|
1009
1034
|
}
|
|
1010
1035
|
});
|
|
1011
|
-
return /* @__PURE__ */
|
|
1036
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Anchor, {
|
|
1012
1037
|
...menuScope,
|
|
1013
1038
|
virtualRef
|
|
1014
1039
|
});
|
|
@@ -1018,23 +1043,23 @@ var PORTAL_NAME = "DropdownMenuPortal";
|
|
|
1018
1043
|
var DropdownMenuPortal = (props) => {
|
|
1019
1044
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
1020
1045
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1021
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Portal, {
|
|
1022
1047
|
...menuScope,
|
|
1023
1048
|
...portalProps
|
|
1024
1049
|
});
|
|
1025
1050
|
};
|
|
1026
1051
|
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
1027
|
-
var DropdownMenuViewport = /* @__PURE__ */
|
|
1052
|
+
var DropdownMenuViewport = /* @__PURE__ */ forwardRef10(({ classNames, asChild, children, ...props }, forwardedRef) => {
|
|
1028
1053
|
const { tx } = useThemeContext();
|
|
1029
|
-
const Comp = asChild ?
|
|
1030
|
-
return /* @__PURE__ */
|
|
1054
|
+
const Comp = asChild ? Slot10 : Primitive10.div;
|
|
1055
|
+
return /* @__PURE__ */ React16.createElement(Comp, {
|
|
1031
1056
|
...props,
|
|
1032
1057
|
className: tx("menu.viewport", {}, classNames),
|
|
1033
1058
|
ref: forwardedRef
|
|
1034
1059
|
}, children);
|
|
1035
1060
|
});
|
|
1036
1061
|
var CONTENT_NAME = "DropdownMenuContent";
|
|
1037
|
-
var DropdownMenuContent = /* @__PURE__ */
|
|
1062
|
+
var DropdownMenuContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1038
1063
|
const { __scopeDropdownMenu, classNames, collisionPadding = 8, collisionBoundary, ...contentProps } = props;
|
|
1039
1064
|
const { tx } = useThemeContext();
|
|
1040
1065
|
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
@@ -1042,7 +1067,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1042
1067
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1043
1068
|
const hasInteractedOutsideRef = useRef2(false);
|
|
1044
1069
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
1045
|
-
const computedCollisionBoundary =
|
|
1070
|
+
const computedCollisionBoundary = useMemo4(() => {
|
|
1046
1071
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
1047
1072
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
1048
1073
|
closestBoundary,
|
|
@@ -1058,7 +1083,7 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1058
1083
|
collisionBoundary,
|
|
1059
1084
|
context.triggerRef.current
|
|
1060
1085
|
]);
|
|
1061
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Content, {
|
|
1062
1087
|
id: context.contentId,
|
|
1063
1088
|
"aria-labelledby": context.triggerId,
|
|
1064
1089
|
...menuScope,
|
|
@@ -1100,10 +1125,10 @@ var DropdownMenuContent = /* @__PURE__ */ forwardRef12((props, forwardedRef) =>
|
|
|
1100
1125
|
});
|
|
1101
1126
|
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
1102
1127
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
1103
|
-
var DropdownMenuGroup = /* @__PURE__ */
|
|
1128
|
+
var DropdownMenuGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1104
1129
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
1105
1130
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1106
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Group, {
|
|
1107
1132
|
...menuScope,
|
|
1108
1133
|
...groupProps,
|
|
1109
1134
|
ref: forwardedRef
|
|
@@ -1111,11 +1136,11 @@ var DropdownMenuGroup = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
|
1111
1136
|
});
|
|
1112
1137
|
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
1113
1138
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
1114
|
-
var DropdownMenuGroupLabel = /* @__PURE__ */
|
|
1139
|
+
var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1115
1140
|
const { __scopeDropdownMenu, classNames, ...labelProps } = props;
|
|
1116
1141
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1117
1142
|
const { tx } = useThemeContext();
|
|
1118
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Label, {
|
|
1119
1144
|
...menuScope,
|
|
1120
1145
|
...labelProps,
|
|
1121
1146
|
className: tx("menu.groupLabel", {}, classNames),
|
|
@@ -1124,11 +1149,11 @@ var DropdownMenuGroupLabel = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1124
1149
|
});
|
|
1125
1150
|
DropdownMenuGroupLabel.displayName = LABEL_NAME;
|
|
1126
1151
|
var ITEM_NAME = "DropdownMenuItem";
|
|
1127
|
-
var DropdownMenuItem = /* @__PURE__ */
|
|
1152
|
+
var DropdownMenuItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1128
1153
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1129
1154
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1130
1155
|
const { tx } = useThemeContext();
|
|
1131
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Item, {
|
|
1132
1157
|
...menuScope,
|
|
1133
1158
|
...itemProps,
|
|
1134
1159
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1137,11 +1162,11 @@ var DropdownMenuItem = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
|
1137
1162
|
});
|
|
1138
1163
|
DropdownMenuItem.displayName = ITEM_NAME;
|
|
1139
1164
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
1140
|
-
var DropdownMenuCheckboxItem = /* @__PURE__ */
|
|
1165
|
+
var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1141
1166
|
const { __scopeDropdownMenu, classNames, ...checkboxItemProps } = props;
|
|
1142
1167
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1143
1168
|
const { tx } = useThemeContext();
|
|
1144
|
-
return /* @__PURE__ */
|
|
1169
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.CheckboxItem, {
|
|
1145
1170
|
...menuScope,
|
|
1146
1171
|
...checkboxItemProps,
|
|
1147
1172
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1150,10 +1175,10 @@ var DropdownMenuCheckboxItem = /* @__PURE__ */ forwardRef12((props, forwardedRef
|
|
|
1150
1175
|
});
|
|
1151
1176
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
1152
1177
|
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
1153
|
-
var DropdownMenuRadioGroup = /* @__PURE__ */
|
|
1178
|
+
var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1154
1179
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
1155
1180
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1156
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.RadioGroup, {
|
|
1157
1182
|
...menuScope,
|
|
1158
1183
|
...radioGroupProps,
|
|
1159
1184
|
ref: forwardedRef
|
|
@@ -1161,11 +1186,11 @@ var DropdownMenuRadioGroup = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1161
1186
|
});
|
|
1162
1187
|
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
1163
1188
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
1164
|
-
var DropdownMenuRadioItem = /* @__PURE__ */
|
|
1189
|
+
var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1165
1190
|
const { __scopeDropdownMenu, classNames, ...itemProps } = props;
|
|
1166
1191
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1167
1192
|
const { tx } = useThemeContext();
|
|
1168
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Item, {
|
|
1169
1194
|
...menuScope,
|
|
1170
1195
|
...itemProps,
|
|
1171
1196
|
className: tx("menu.item", {}, classNames),
|
|
@@ -1174,10 +1199,10 @@ var DropdownMenuRadioItem = /* @__PURE__ */ forwardRef12((props, forwardedRef) =
|
|
|
1174
1199
|
});
|
|
1175
1200
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
1176
1201
|
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
1177
|
-
var DropdownMenuItemIndicator = /* @__PURE__ */
|
|
1202
|
+
var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1178
1203
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
1179
1204
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1180
|
-
return /* @__PURE__ */
|
|
1205
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.ItemIndicator, {
|
|
1181
1206
|
...menuScope,
|
|
1182
1207
|
...itemIndicatorProps,
|
|
1183
1208
|
ref: forwardedRef
|
|
@@ -1185,11 +1210,11 @@ var DropdownMenuItemIndicator = /* @__PURE__ */ forwardRef12((props, forwardedRe
|
|
|
1185
1210
|
});
|
|
1186
1211
|
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
1187
1212
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
1188
|
-
var DropdownMenuSeparator = /* @__PURE__ */
|
|
1213
|
+
var DropdownMenuSeparator = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1189
1214
|
const { __scopeDropdownMenu, classNames, ...separatorProps } = props;
|
|
1190
1215
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1191
1216
|
const { tx } = useThemeContext();
|
|
1192
|
-
return /* @__PURE__ */
|
|
1217
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Separator, {
|
|
1193
1218
|
...menuScope,
|
|
1194
1219
|
...separatorProps,
|
|
1195
1220
|
className: tx("menu.separator", {}, classNames),
|
|
@@ -1198,11 +1223,11 @@ var DropdownMenuSeparator = /* @__PURE__ */ forwardRef12((props, forwardedRef) =
|
|
|
1198
1223
|
});
|
|
1199
1224
|
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
1200
1225
|
var ARROW_NAME = "DropdownMenuArrow";
|
|
1201
|
-
var DropdownMenuArrow = /* @__PURE__ */
|
|
1226
|
+
var DropdownMenuArrow = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1202
1227
|
const { __scopeDropdownMenu, classNames, ...arrowProps } = props;
|
|
1203
1228
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1204
1229
|
const { tx } = useThemeContext();
|
|
1205
|
-
return /* @__PURE__ */
|
|
1230
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Arrow, {
|
|
1206
1231
|
...menuScope,
|
|
1207
1232
|
...arrowProps,
|
|
1208
1233
|
className: tx("menu.arrow", {}, classNames),
|
|
@@ -1218,17 +1243,17 @@ var DropdownMenuSub = (props) => {
|
|
|
1218
1243
|
defaultProp: defaultOpen,
|
|
1219
1244
|
onChange: onOpenChange
|
|
1220
1245
|
});
|
|
1221
|
-
return /* @__PURE__ */
|
|
1246
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.Sub, {
|
|
1222
1247
|
...menuScope,
|
|
1223
1248
|
open,
|
|
1224
1249
|
onOpenChange: setOpen
|
|
1225
1250
|
}, children);
|
|
1226
1251
|
};
|
|
1227
1252
|
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
1228
|
-
var DropdownMenuSubTrigger = /* @__PURE__ */
|
|
1253
|
+
var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1229
1254
|
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
1230
1255
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1231
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubTrigger, {
|
|
1232
1257
|
...menuScope,
|
|
1233
1258
|
...subTriggerProps,
|
|
1234
1259
|
ref: forwardedRef
|
|
@@ -1236,10 +1261,10 @@ var DropdownMenuSubTrigger = /* @__PURE__ */ forwardRef12((props, forwardedRef)
|
|
|
1236
1261
|
});
|
|
1237
1262
|
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
1238
1263
|
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
1239
|
-
var DropdownMenuSubContent = /* @__PURE__ */
|
|
1264
|
+
var DropdownMenuSubContent = /* @__PURE__ */ forwardRef10((props, forwardedRef) => {
|
|
1240
1265
|
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
1241
1266
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
1242
|
-
return /* @__PURE__ */
|
|
1267
|
+
return /* @__PURE__ */ React16.createElement(MenuPrimitive.SubContent, {
|
|
1243
1268
|
...menuScope,
|
|
1244
1269
|
...subContentProps,
|
|
1245
1270
|
ref: forwardedRef,
|
|
@@ -1280,13 +1305,13 @@ var DropdownMenu = {
|
|
|
1280
1305
|
var useDropdownMenuMenuScope = useMenuScope;
|
|
1281
1306
|
|
|
1282
1307
|
// src/components/Separator/Separator.tsx
|
|
1283
|
-
import
|
|
1284
|
-
import
|
|
1285
|
-
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) => {
|
|
1286
1311
|
const { tx } = useThemeContext();
|
|
1287
|
-
return /* @__PURE__ */
|
|
1288
|
-
orientation,
|
|
1312
|
+
return /* @__PURE__ */ React17.createElement(SeparatorPrimitive.Root, {
|
|
1289
1313
|
...props,
|
|
1314
|
+
orientation,
|
|
1290
1315
|
className: tx("separator.root", {
|
|
1291
1316
|
orientation,
|
|
1292
1317
|
subdued
|
|
@@ -1296,87 +1321,83 @@ var Separator3 = /* @__PURE__ */ forwardRef13(({ classNames, orientation = "hori
|
|
|
1296
1321
|
});
|
|
1297
1322
|
|
|
1298
1323
|
// src/components/Toolbar/Toolbar.tsx
|
|
1299
|
-
var ToolbarRoot =
|
|
1324
|
+
var ToolbarRoot = composable2(({ children, density, disabled, layoutManaged, orientation, ...props }, forwardedRef) => {
|
|
1325
|
+
const { className, role, ...rest } = composableProps6(props);
|
|
1300
1326
|
const { tx } = useThemeContext();
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
role
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
return /* @__PURE__ */ React17.createElement(ToolbarPrimitive.Root, {
|
|
1309
|
-
...props,
|
|
1310
|
-
"data-arrow-keys": props.orientation === "vertical" ? "up down" : "left right",
|
|
1327
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Root, {
|
|
1328
|
+
...rest,
|
|
1329
|
+
...role !== "none" && {
|
|
1330
|
+
role
|
|
1331
|
+
},
|
|
1332
|
+
orientation,
|
|
1333
|
+
"data-arrow-keys": orientation === "vertical" ? "up down" : "left right",
|
|
1311
1334
|
className: tx("toolbar.root", {
|
|
1312
1335
|
density,
|
|
1313
1336
|
disabled,
|
|
1314
1337
|
layoutManaged
|
|
1315
|
-
},
|
|
1338
|
+
}, className),
|
|
1316
1339
|
ref: forwardedRef
|
|
1317
|
-
},
|
|
1340
|
+
}, children);
|
|
1318
1341
|
});
|
|
1319
|
-
var ToolbarText =
|
|
1342
|
+
var ToolbarText = slottable5(({ children, asChild, ...props }, forwardedRef) => {
|
|
1343
|
+
const { className, ...rest } = composableProps6(props);
|
|
1344
|
+
const Comp = asChild ? Slot11 : Primitive11.div;
|
|
1320
1345
|
const { tx } = useThemeContext();
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
className: tx("toolbar.text", {}, [
|
|
1325
|
-
className,
|
|
1326
|
-
classNames
|
|
1327
|
-
]),
|
|
1346
|
+
return /* @__PURE__ */ React18.createElement(Comp, {
|
|
1347
|
+
...rest,
|
|
1348
|
+
className: tx("toolbar.text", {}, className),
|
|
1328
1349
|
ref: forwardedRef
|
|
1329
1350
|
}, children);
|
|
1330
1351
|
});
|
|
1331
|
-
var ToolbarButton = /* @__PURE__ */
|
|
1332
|
-
return /* @__PURE__ */
|
|
1352
|
+
var ToolbarButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1353
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1333
1354
|
asChild: true
|
|
1334
|
-
}, /* @__PURE__ */
|
|
1355
|
+
}, /* @__PURE__ */ React18.createElement(Button, {
|
|
1335
1356
|
...props,
|
|
1336
1357
|
ref: forwardedRef
|
|
1337
1358
|
}));
|
|
1338
1359
|
});
|
|
1339
|
-
var ToolbarIconButton = /* @__PURE__ */
|
|
1340
|
-
return /* @__PURE__ */
|
|
1360
|
+
var ToolbarIconButton = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1361
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1341
1362
|
asChild: true
|
|
1342
|
-
}, /* @__PURE__ */
|
|
1363
|
+
}, /* @__PURE__ */ React18.createElement(IconButton, {
|
|
1343
1364
|
...props,
|
|
1344
1365
|
noTooltip: true,
|
|
1345
1366
|
ref: forwardedRef
|
|
1346
1367
|
}));
|
|
1347
1368
|
});
|
|
1348
|
-
var ToolbarToggle = /* @__PURE__ */
|
|
1349
|
-
return /* @__PURE__ */
|
|
1369
|
+
var ToolbarToggle = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1370
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Button, {
|
|
1350
1371
|
asChild: true
|
|
1351
|
-
}, /* @__PURE__ */
|
|
1372
|
+
}, /* @__PURE__ */ React18.createElement(Toggle, {
|
|
1352
1373
|
...props,
|
|
1353
1374
|
ref: forwardedRef
|
|
1354
1375
|
}));
|
|
1355
1376
|
});
|
|
1356
|
-
var ToolbarLink = /* @__PURE__ */
|
|
1357
|
-
return /* @__PURE__ */
|
|
1377
|
+
var ToolbarLink = /* @__PURE__ */ forwardRef12((props, forwardedRef) => {
|
|
1378
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Link, {
|
|
1358
1379
|
asChild: true
|
|
1359
|
-
}, /* @__PURE__ */
|
|
1380
|
+
}, /* @__PURE__ */ React18.createElement(Link, {
|
|
1360
1381
|
...props,
|
|
1361
1382
|
ref: forwardedRef
|
|
1362
1383
|
}));
|
|
1363
1384
|
});
|
|
1364
|
-
var ToolbarToggleGroup2 = /* @__PURE__ */
|
|
1365
|
-
return /* @__PURE__ */
|
|
1385
|
+
var ToolbarToggleGroup2 = /* @__PURE__ */ forwardRef12(({ classNames, children, elevation, ...props }, forwardedRef) => {
|
|
1386
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleGroup, {
|
|
1366
1387
|
...props,
|
|
1367
1388
|
asChild: true
|
|
1368
|
-
}, /* @__PURE__ */
|
|
1389
|
+
}, /* @__PURE__ */ React18.createElement(ButtonGroup, {
|
|
1369
1390
|
classNames,
|
|
1370
1391
|
children,
|
|
1371
1392
|
elevation,
|
|
1372
1393
|
ref: forwardedRef
|
|
1373
1394
|
}));
|
|
1374
1395
|
});
|
|
1375
|
-
var ToolbarToggleGroupItem = /* @__PURE__ */
|
|
1376
|
-
return /* @__PURE__ */
|
|
1396
|
+
var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, children, ...props }, forwardedRef) => {
|
|
1397
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1377
1398
|
...props,
|
|
1378
1399
|
asChild: true
|
|
1379
|
-
}, /* @__PURE__ */
|
|
1400
|
+
}, /* @__PURE__ */ React18.createElement(Button, {
|
|
1380
1401
|
variant,
|
|
1381
1402
|
density,
|
|
1382
1403
|
elevation,
|
|
@@ -1385,11 +1406,11 @@ var ToolbarToggleGroupItem = /* @__PURE__ */ forwardRef14(({ variant, density, e
|
|
|
1385
1406
|
ref: forwardedRef
|
|
1386
1407
|
}));
|
|
1387
1408
|
});
|
|
1388
|
-
var ToolbarToggleGroupIconItem = /* @__PURE__ */
|
|
1389
|
-
return /* @__PURE__ */
|
|
1409
|
+
var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef12(({ variant, density, elevation, classNames, icon, label, iconOnly, ...props }, forwardedRef) => {
|
|
1410
|
+
return /* @__PURE__ */ React18.createElement(ToolbarPrimitive.ToolbarToggleItem, {
|
|
1390
1411
|
...props,
|
|
1391
1412
|
asChild: true
|
|
1392
|
-
}, /* @__PURE__ */
|
|
1413
|
+
}, /* @__PURE__ */ React18.createElement(IconButton, {
|
|
1393
1414
|
variant,
|
|
1394
1415
|
density,
|
|
1395
1416
|
elevation,
|
|
@@ -1400,61 +1421,61 @@ var ToolbarToggleGroupIconItem = /* @__PURE__ */ forwardRef14(({ variant, densit
|
|
|
1400
1421
|
ref: forwardedRef
|
|
1401
1422
|
}));
|
|
1402
1423
|
});
|
|
1403
|
-
var ToolbarSeparator = /* @__PURE__ */
|
|
1404
|
-
return variant === "line" ? /* @__PURE__ */
|
|
1424
|
+
var ToolbarSeparator = /* @__PURE__ */ forwardRef12(({ variant = "gap", ...props }, forwardedRef) => {
|
|
1425
|
+
return variant === "line" ? /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
1405
1426
|
asChild: true
|
|
1406
|
-
}, /* @__PURE__ */
|
|
1427
|
+
}, /* @__PURE__ */ React18.createElement(Separator3, {
|
|
1428
|
+
orientation: "vertical",
|
|
1407
1429
|
...props,
|
|
1408
1430
|
ref: forwardedRef
|
|
1409
|
-
})) : /* @__PURE__ */
|
|
1431
|
+
})) : /* @__PURE__ */ React18.createElement(ToolbarPrimitive.Separator, {
|
|
1410
1432
|
className: "grow",
|
|
1411
1433
|
ref: forwardedRef
|
|
1412
1434
|
});
|
|
1413
1435
|
});
|
|
1414
|
-
var ToolbarDragHandle = /* @__PURE__ */
|
|
1436
|
+
var ToolbarDragHandle = /* @__PURE__ */ forwardRef12(({ testId = "drag-handle", label }, forwardedRef) => {
|
|
1415
1437
|
const { t } = useTranslation2(translationKey);
|
|
1416
|
-
return /* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1417
1439
|
"data-testid": testId,
|
|
1440
|
+
tabIndex: -1,
|
|
1418
1441
|
noTooltip: true,
|
|
1419
1442
|
iconOnly: true,
|
|
1420
1443
|
icon: "ph--dots-six-vertical--regular",
|
|
1421
1444
|
variant: "ghost",
|
|
1422
|
-
label: label ?? t("toolbar
|
|
1423
|
-
classNames: "cursor-pointer",
|
|
1424
|
-
size: 5,
|
|
1445
|
+
label: label ?? t("toolbar-drag-handle.label"),
|
|
1446
|
+
classNames: "dx-focus-ring-none cursor-pointer",
|
|
1425
1447
|
disabled: !forwardedRef,
|
|
1426
1448
|
ref: forwardedRef
|
|
1427
1449
|
});
|
|
1428
1450
|
});
|
|
1429
|
-
var ToolbarCloseIconButton = /* @__PURE__ */
|
|
1451
|
+
var ToolbarCloseIconButton = /* @__PURE__ */ forwardRef12(({ onClick, label }, forwardedRef) => {
|
|
1430
1452
|
const { t } = useTranslation2(translationKey);
|
|
1431
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1432
1454
|
iconOnly: true,
|
|
1433
1455
|
icon: "ph--x--regular",
|
|
1434
1456
|
variant: "ghost",
|
|
1435
|
-
label: label ?? t("toolbar
|
|
1457
|
+
label: label ?? t("toolbar-close.label"),
|
|
1436
1458
|
classNames: "cursor-pointer",
|
|
1437
|
-
size: 5,
|
|
1438
1459
|
onClick,
|
|
1439
1460
|
ref: forwardedRef
|
|
1440
1461
|
});
|
|
1441
1462
|
});
|
|
1442
1463
|
var ToolbarMenu = ({ context, items }) => {
|
|
1443
1464
|
const { t } = useTranslation2(translationKey);
|
|
1444
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ React18.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React18.createElement(DropdownMenu.Trigger, {
|
|
1445
1466
|
disabled: !items?.length,
|
|
1446
1467
|
asChild: true
|
|
1447
|
-
}, /* @__PURE__ */
|
|
1468
|
+
}, /* @__PURE__ */ React18.createElement(ToolbarIconButton, {
|
|
1448
1469
|
iconOnly: true,
|
|
1449
1470
|
variant: "ghost",
|
|
1450
1471
|
icon: "ph--dots-three-vertical--regular",
|
|
1451
|
-
label: t("toolbar
|
|
1452
|
-
})), (items?.length ?? 0) > 0 && /* @__PURE__ */
|
|
1472
|
+
label: t("toolbar-menu.label")
|
|
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, {
|
|
1453
1474
|
key: index,
|
|
1454
1475
|
onSelect: () => onSelect(context)
|
|
1455
|
-
}, label))), /* @__PURE__ */
|
|
1476
|
+
}, label))), /* @__PURE__ */ React18.createElement(DropdownMenu.Arrow, null))));
|
|
1456
1477
|
};
|
|
1457
|
-
var
|
|
1478
|
+
var Toolbar = {
|
|
1458
1479
|
Root: ToolbarRoot,
|
|
1459
1480
|
Text: ToolbarText,
|
|
1460
1481
|
Button: ToolbarButton,
|
|
@@ -1472,238 +1493,300 @@ var Toolbar2 = {
|
|
|
1472
1493
|
|
|
1473
1494
|
// src/components/Card/Card.tsx
|
|
1474
1495
|
var CardContext = /* @__PURE__ */ createContext3({});
|
|
1475
|
-
var
|
|
1496
|
+
var CARD_ROOT_NAME = "Card.Root";
|
|
1497
|
+
var CardRoot = composable3(({ children, id, role, border = true, fullWidth, density, ...props }, forwardedRef) => {
|
|
1498
|
+
const { className, ...rest } = composableProps7(props);
|
|
1476
1499
|
const { tx } = useThemeContext();
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
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", {
|
|
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
|
-
}, [
|
|
1488
|
-
className,
|
|
1489
|
-
classNames
|
|
1490
|
-
]),
|
|
1491
1513
|
ref: forwardedRef
|
|
1492
|
-
}, /* @__PURE__ */ React18.createElement(Column.Root, {
|
|
1493
|
-
gutter: "rail"
|
|
1494
1514
|
}, children));
|
|
1495
1515
|
});
|
|
1496
|
-
|
|
1516
|
+
CardRoot.displayName = CARD_ROOT_NAME;
|
|
1517
|
+
var CARD_TOOLBAR_NAME = "Card.Toolbar";
|
|
1518
|
+
var CardToolbar = composable3(({ children, classNames, ...props }, forwardedRef) => {
|
|
1497
1519
|
const { tx } = useThemeContext();
|
|
1498
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ React19.createElement(Toolbar.Root, {
|
|
1499
1521
|
...props,
|
|
1522
|
+
style: iconSize(5),
|
|
1500
1523
|
classNames: [
|
|
1501
|
-
tx("card.toolbar", {
|
|
1502
|
-
coarse: density !== "fine"
|
|
1503
|
-
}),
|
|
1524
|
+
tx("card.toolbar", {}),
|
|
1504
1525
|
classNames
|
|
1505
1526
|
],
|
|
1506
1527
|
ref: forwardedRef
|
|
1507
1528
|
}, children);
|
|
1508
1529
|
});
|
|
1509
|
-
|
|
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 }) => {
|
|
1510
1553
|
const { menuItems } = useContext3(CardContext) ?? {};
|
|
1511
1554
|
const combinedItems = [
|
|
1512
1555
|
...items ?? [],
|
|
1513
1556
|
...menuItems ?? []
|
|
1514
1557
|
];
|
|
1515
|
-
return /* @__PURE__ */
|
|
1558
|
+
return /* @__PURE__ */ React19.createElement(CardIconBlock, {
|
|
1559
|
+
padding: true
|
|
1560
|
+
}, /* @__PURE__ */ React19.createElement(Toolbar.Menu, {
|
|
1561
|
+
...props,
|
|
1516
1562
|
context,
|
|
1517
1563
|
items: combinedItems
|
|
1518
|
-
});
|
|
1564
|
+
}));
|
|
1519
1565
|
};
|
|
1520
|
-
|
|
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) => {
|
|
1521
1574
|
const { tx } = useThemeContext();
|
|
1522
|
-
|
|
1523
|
-
return /* @__PURE__ */ React18.createElement(Comp, {
|
|
1575
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1524
1576
|
...props,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
classNames
|
|
1529
|
-
]),
|
|
1577
|
+
className: tx("card.icon-block", {
|
|
1578
|
+
padding
|
|
1579
|
+
}, classNames),
|
|
1530
1580
|
ref: forwardedRef
|
|
1531
1581
|
}, children);
|
|
1532
1582
|
});
|
|
1533
|
-
|
|
1583
|
+
CardIconBlock.displayName = CARD_ICON_BLOCK_NAME;
|
|
1584
|
+
var CARD_TITLE_NAME = "Card.Title";
|
|
1585
|
+
var CardTitle = slottable6(({ children, asChild, ...props }, forwardedRef) => {
|
|
1534
1586
|
const { tx } = useThemeContext();
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1587
|
+
const { className, ...rest } = composableProps7(props, {
|
|
1588
|
+
role: "heading"
|
|
1589
|
+
});
|
|
1590
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1591
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1592
|
+
...rest,
|
|
1593
|
+
className: tx("card.title", {}, className),
|
|
1539
1594
|
ref: forwardedRef
|
|
1540
1595
|
}, children);
|
|
1541
1596
|
});
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
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;
|
|
1602
|
+
const { tx } = useThemeContext();
|
|
1603
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1604
|
+
...rest,
|
|
1605
|
+
className: tx("card.content", {}, className),
|
|
1550
1606
|
ref: forwardedRef
|
|
1551
|
-
},
|
|
1607
|
+
}, children);
|
|
1608
|
+
});
|
|
1609
|
+
CardContent.displayName = CARD_CONTENT_NAME;
|
|
1610
|
+
var CARD_ROW_NAME = "Card.Row";
|
|
1611
|
+
var CardRow = slottable6(({ children, asChild, icon, ...props }, forwardedRef) => {
|
|
1612
|
+
const { className, ...rest } = composableProps7(props);
|
|
1613
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1614
|
+
const { tx } = useThemeContext();
|
|
1615
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1616
|
+
...rest,
|
|
1617
|
+
className: tx("card.row", {}, className),
|
|
1618
|
+
ref: forwardedRef
|
|
1619
|
+
}, icon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1552
1620
|
classNames: "text-subdued",
|
|
1553
|
-
icon
|
|
1554
|
-
|
|
1621
|
+
icon,
|
|
1622
|
+
size: 4
|
|
1623
|
+
}) || /* @__PURE__ */ React19.createElement("div", null), children);
|
|
1555
1624
|
});
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1625
|
+
CardRow.displayName = CARD_ROW_NAME;
|
|
1626
|
+
var CARD_SECTION_NAME = "Card.Section";
|
|
1627
|
+
var CardSection = slottable6(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
1628
|
+
const { className, ...rest } = composableProps7(props);
|
|
1629
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1630
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1631
|
+
...rest,
|
|
1560
1632
|
role: role ?? "none",
|
|
1561
|
-
className:
|
|
1633
|
+
className: mx6("col-span-full", className),
|
|
1562
1634
|
ref: forwardedRef
|
|
1563
1635
|
}, children);
|
|
1564
1636
|
});
|
|
1565
|
-
|
|
1637
|
+
CardSection.displayName = CARD_SECTION_NAME;
|
|
1638
|
+
var CARD_HEADING_NAME = "Card.Heading";
|
|
1639
|
+
var CardHeading = slottable6(({ children, asChild, role, variant = "default", ...props }, forwardedRef) => {
|
|
1640
|
+
const { className, ...rest } = composableProps7(props);
|
|
1641
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1566
1642
|
const { tx } = useThemeContext();
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
...props,
|
|
1643
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1644
|
+
...rest,
|
|
1570
1645
|
role: role ?? "heading",
|
|
1571
1646
|
className: tx("card.heading", {
|
|
1572
1647
|
variant
|
|
1573
|
-
},
|
|
1574
|
-
classNames,
|
|
1575
|
-
className
|
|
1576
|
-
]),
|
|
1648
|
+
}, className),
|
|
1577
1649
|
ref: forwardedRef
|
|
1578
1650
|
}, children);
|
|
1579
1651
|
});
|
|
1580
|
-
|
|
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) => {
|
|
1655
|
+
const { className, ...rest } = composableProps7(props);
|
|
1656
|
+
const Comp = asChild ? Slot12 : Primitive12.div;
|
|
1581
1657
|
const { tx } = useThemeContext();
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
...props,
|
|
1658
|
+
return /* @__PURE__ */ React19.createElement(Comp, {
|
|
1659
|
+
...rest,
|
|
1585
1660
|
role: role ?? "none",
|
|
1586
1661
|
className: tx("card.text", {
|
|
1587
1662
|
variant
|
|
1588
|
-
},
|
|
1589
|
-
classNames,
|
|
1590
|
-
className
|
|
1591
|
-
]),
|
|
1663
|
+
}, className),
|
|
1592
1664
|
ref: forwardedRef
|
|
1593
|
-
}, /* @__PURE__ */
|
|
1665
|
+
}, /* @__PURE__ */ React19.createElement("span", {
|
|
1594
1666
|
className: tx("card.text-span", {
|
|
1595
1667
|
variant,
|
|
1596
1668
|
truncate
|
|
1597
1669
|
})
|
|
1598
1670
|
}, children));
|
|
1599
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";
|
|
1600
1692
|
var CardPoster = (props) => {
|
|
1601
1693
|
const { tx } = useThemeContext();
|
|
1602
1694
|
const aspect = props.aspect === "auto" ? "aspect-auto" : "aspect-video";
|
|
1603
1695
|
if (props.image) {
|
|
1604
|
-
return /* @__PURE__ */
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
}, /* @__PURE__ */ React18.createElement(Image, {
|
|
1696
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1697
|
+
className: "col-span-full"
|
|
1698
|
+
}, /* @__PURE__ */ React19.createElement(Image, {
|
|
1608
1699
|
classNames: [
|
|
1609
1700
|
tx("card.poster", {}),
|
|
1610
1701
|
aspect,
|
|
1611
1702
|
props.classNames
|
|
1612
1703
|
],
|
|
1613
1704
|
src: props.image,
|
|
1614
|
-
alt: props.alt
|
|
1705
|
+
alt: props.alt,
|
|
1706
|
+
fit: props.fit
|
|
1615
1707
|
}));
|
|
1616
1708
|
}
|
|
1617
1709
|
if (props.icon) {
|
|
1618
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1619
1711
|
role: "image",
|
|
1620
1712
|
className: tx("card.poster-icon", {}, [
|
|
1621
1713
|
aspect,
|
|
1622
1714
|
props.classNames
|
|
1623
1715
|
]),
|
|
1624
1716
|
"aria-label": props.alt
|
|
1625
|
-
}, /* @__PURE__ */
|
|
1717
|
+
}, /* @__PURE__ */ React19.createElement(Icon, {
|
|
1626
1718
|
icon: props.icon,
|
|
1627
1719
|
size: 10
|
|
1628
1720
|
}));
|
|
1629
1721
|
}
|
|
1630
1722
|
};
|
|
1723
|
+
CardPoster.displayName = CARD_POSTER_NAME;
|
|
1724
|
+
var CARD_ACTION_NAME = "Card.Action";
|
|
1631
1725
|
var CardAction = ({ icon, actionIcon = "ph--arrow-right--regular", label, onClick }) => {
|
|
1632
1726
|
const { tx } = useThemeContext();
|
|
1633
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ React19.createElement(Button, {
|
|
1634
1728
|
variant: "ghost",
|
|
1635
1729
|
classNames: tx("card.action", {}),
|
|
1636
1730
|
onClick
|
|
1637
|
-
}, icon ? /* @__PURE__ */
|
|
1731
|
+
}, icon ? /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1638
1732
|
classNames: "text-subdued",
|
|
1639
|
-
icon
|
|
1640
|
-
|
|
1733
|
+
icon,
|
|
1734
|
+
size: 4
|
|
1735
|
+
}) : /* @__PURE__ */ React19.createElement("div", null), /* @__PURE__ */ React19.createElement("span", {
|
|
1641
1736
|
className: tx("card.action-label", {}, !actionIcon ? "col-span-2" : void 0)
|
|
1642
|
-
}, label), actionIcon && /* @__PURE__ */
|
|
1643
|
-
icon: actionIcon
|
|
1737
|
+
}, label), actionIcon && /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1738
|
+
icon: actionIcon,
|
|
1739
|
+
size: 4
|
|
1644
1740
|
}));
|
|
1645
1741
|
};
|
|
1742
|
+
CardAction.displayName = CARD_ACTION_NAME;
|
|
1743
|
+
var CARD_LINK_NAME = "Card.Link";
|
|
1646
1744
|
var CardLink = ({ label, href }) => {
|
|
1647
1745
|
const { tx } = useThemeContext();
|
|
1648
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ React19.createElement("a", {
|
|
1649
1747
|
className: tx("card.link", {}),
|
|
1650
1748
|
"data-variant": "ghost",
|
|
1651
1749
|
href,
|
|
1652
1750
|
target: "_blank",
|
|
1653
1751
|
rel: "noreferrer"
|
|
1654
|
-
}, /* @__PURE__ */
|
|
1752
|
+
}, /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1655
1753
|
classNames: "text-subdued",
|
|
1656
1754
|
icon: "ph--link--regular"
|
|
1657
|
-
}), /* @__PURE__ */
|
|
1755
|
+
}), /* @__PURE__ */ React19.createElement("span", {
|
|
1658
1756
|
className: tx("card.link-label", {})
|
|
1659
|
-
}, label), /* @__PURE__ */
|
|
1757
|
+
}, label), /* @__PURE__ */ React19.createElement(CardIcon, {
|
|
1660
1758
|
classNames: "invisible group-hover:visible",
|
|
1661
1759
|
icon: "ph--arrow-square-out--regular"
|
|
1662
1760
|
}));
|
|
1663
1761
|
};
|
|
1664
|
-
|
|
1665
|
-
return /* @__PURE__ */ React18.createElement(CardIconBlock, null, /* @__PURE__ */ React18.createElement(Icon, {
|
|
1666
|
-
...props,
|
|
1667
|
-
size: toolbar ? 5 : 4
|
|
1668
|
-
}));
|
|
1669
|
-
};
|
|
1670
|
-
var CardIconBlock = ({ classNames, children, role, ...props }) => {
|
|
1671
|
-
const { tx } = useThemeContext();
|
|
1672
|
-
return /* @__PURE__ */ React18.createElement("div", {
|
|
1673
|
-
...props,
|
|
1674
|
-
role: role ?? "none",
|
|
1675
|
-
className: tx("card.icon-block", {}, classNames)
|
|
1676
|
-
}, children);
|
|
1677
|
-
};
|
|
1762
|
+
CardLink.displayName = CARD_LINK_NAME;
|
|
1678
1763
|
var Card = {
|
|
1679
1764
|
Root: CardRoot,
|
|
1680
1765
|
// Toolbar
|
|
1681
1766
|
Toolbar: CardToolbar,
|
|
1682
|
-
ToolbarIconButton:
|
|
1683
|
-
ToolbarSeparator:
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
})),
|
|
1689
|
-
CloseIconButton: Toolbar2.CloseIconButton,
|
|
1690
|
-
Title: CardTitle,
|
|
1767
|
+
ToolbarIconButton: Toolbar.IconButton,
|
|
1768
|
+
ToolbarSeparator: Toolbar.Separator,
|
|
1769
|
+
// Toolbar blocks
|
|
1770
|
+
IconBlock: CardIconBlock,
|
|
1771
|
+
DragHandle: CardDragHandle,
|
|
1772
|
+
CloseIconButton,
|
|
1691
1773
|
Menu: CardMenu,
|
|
1692
1774
|
Icon: CardIcon,
|
|
1693
|
-
|
|
1775
|
+
Title: CardTitle,
|
|
1694
1776
|
// Content
|
|
1695
1777
|
Content: CardContent,
|
|
1696
1778
|
Row: CardRow,
|
|
1697
1779
|
Section: CardSection,
|
|
1698
1780
|
Heading: CardHeading,
|
|
1699
1781
|
Text: CardText,
|
|
1782
|
+
Html: CardHtml,
|
|
1700
1783
|
Poster: CardPoster,
|
|
1701
1784
|
Action: CardAction,
|
|
1702
1785
|
Link: CardLink
|
|
1703
1786
|
};
|
|
1704
1787
|
|
|
1705
1788
|
// src/components/Clipboard/ClipboardProvider.tsx
|
|
1706
|
-
import
|
|
1789
|
+
import React20, { createContext as createContext4, useCallback as useCallback5, useContext as useContext4, useState as useState4 } from "react";
|
|
1707
1790
|
var ClipboardContext = /* @__PURE__ */ createContext4({
|
|
1708
1791
|
textValue: "",
|
|
1709
1792
|
setTextValue: async (_) => {
|
|
@@ -1716,7 +1799,7 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1716
1799
|
await navigator.clipboard.writeText(nextValue);
|
|
1717
1800
|
return setInternalTextValue(nextValue);
|
|
1718
1801
|
}, []);
|
|
1719
|
-
return /* @__PURE__ */
|
|
1802
|
+
return /* @__PURE__ */ React20.createElement(ClipboardContext.Provider, {
|
|
1720
1803
|
value: {
|
|
1721
1804
|
textValue,
|
|
1722
1805
|
setTextValue
|
|
@@ -1725,14 +1808,14 @@ var ClipboardProvider = ({ children }) => {
|
|
|
1725
1808
|
};
|
|
1726
1809
|
|
|
1727
1810
|
// src/components/Clipboard/CopyButton.tsx
|
|
1728
|
-
import
|
|
1729
|
-
import { mx as
|
|
1811
|
+
import React21 from "react";
|
|
1812
|
+
import { mx as mx7, osTranslations } from "@dxos/ui-theme";
|
|
1730
1813
|
var inactiveLabelStyles = "invisible h-px -mb-px overflow-hidden";
|
|
1731
1814
|
var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
1732
1815
|
const { t } = useTranslation(osTranslations);
|
|
1733
1816
|
const { textValue, setTextValue } = useClipboard();
|
|
1734
1817
|
const isCopied = textValue === value;
|
|
1735
|
-
return /* @__PURE__ */
|
|
1818
|
+
return /* @__PURE__ */ React21.createElement(Button, {
|
|
1736
1819
|
...props,
|
|
1737
1820
|
classNames: [
|
|
1738
1821
|
"inline-flex flex-col justify-center",
|
|
@@ -1740,20 +1823,18 @@ var CopyButton = ({ classNames, value, size = 5, ...props }) => {
|
|
|
1740
1823
|
],
|
|
1741
1824
|
onClick: () => setTextValue(value),
|
|
1742
1825
|
"data-testid": "copy-invitation"
|
|
1743
|
-
}, /* @__PURE__ */
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}, /* @__PURE__ */ React20.createElement("span", {
|
|
1826
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1827
|
+
className: mx7("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
1828
|
+
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1747
1829
|
className: "px-1"
|
|
1748
|
-
}, t("copy
|
|
1830
|
+
}, t("copy.label")), /* @__PURE__ */ React21.createElement(Icon, {
|
|
1749
1831
|
icon: "ph--copy--regular",
|
|
1750
1832
|
size
|
|
1751
|
-
})), /* @__PURE__ */
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
}, /* @__PURE__ */ React20.createElement("span", {
|
|
1833
|
+
})), /* @__PURE__ */ React21.createElement("div", {
|
|
1834
|
+
className: mx7("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
1835
|
+
}, /* @__PURE__ */ React21.createElement("span", {
|
|
1755
1836
|
className: "px-1"
|
|
1756
|
-
}, t("copy
|
|
1837
|
+
}, t("copy-success.label")), /* @__PURE__ */ React21.createElement(Icon, {
|
|
1757
1838
|
icon: "ph--check--regular",
|
|
1758
1839
|
size
|
|
1759
1840
|
})));
|
|
@@ -1762,9 +1843,9 @@ var CopyButtonIconOnly = ({ __scopeTooltip, value, classNames, size, variant, ..
|
|
|
1762
1843
|
const { t } = useTranslation(osTranslations);
|
|
1763
1844
|
const { textValue, setTextValue } = useClipboard();
|
|
1764
1845
|
const isCopied = textValue === value;
|
|
1765
|
-
const label = isCopied ? t("copy
|
|
1846
|
+
const label = isCopied ? t("copy-success.label") : props.label ?? t("copy.label");
|
|
1766
1847
|
const { onOpen } = useTooltipContext("CopyButton", __scopeTooltip);
|
|
1767
|
-
return /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ React21.createElement(IconButton, {
|
|
1768
1849
|
iconOnly: true,
|
|
1769
1850
|
label,
|
|
1770
1851
|
icon: "ph--copy--regular",
|
|
@@ -1788,88 +1869,91 @@ var Clipboard = {
|
|
|
1788
1869
|
|
|
1789
1870
|
// src/components/Dialog/Dialog.tsx
|
|
1790
1871
|
import { createContext as createContext5 } from "@radix-ui/react-context";
|
|
1791
|
-
import
|
|
1792
|
-
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";
|
|
1793
1876
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
1794
|
-
import { osTranslations as osTranslations2 } from "@dxos/ui-theme";
|
|
1795
|
-
var DialogRoot = (props) => /* @__PURE__ */
|
|
1877
|
+
import { composableProps as composableProps8, osTranslations as osTranslations2, slottable as slottable7 } from "@dxos/ui-theme";
|
|
1878
|
+
var DialogRoot = (props) => /* @__PURE__ */ React22.createElement(ElevationProvider, {
|
|
1796
1879
|
elevation: "dialog"
|
|
1797
|
-
}, /* @__PURE__ */
|
|
1798
|
-
|
|
1799
|
-
|
|
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;
|
|
1800
1888
|
var DIALOG_OVERLAY_NAME = "DialogOverlay";
|
|
1801
1889
|
var [OverlayLayoutProvider, useOverlayLayoutContext] = createContext5(DIALOG_OVERLAY_NAME, {});
|
|
1802
|
-
var DialogOverlay = /* @__PURE__ */
|
|
1890
|
+
var DialogOverlay = /* @__PURE__ */ forwardRef14(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1803
1891
|
const { tx } = useThemeContext();
|
|
1804
|
-
return /* @__PURE__ */
|
|
1892
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Overlay, {
|
|
1805
1893
|
...props,
|
|
1806
1894
|
"data-block-align": blockAlign,
|
|
1807
1895
|
className: tx("dialog.overlay", {}, classNames),
|
|
1808
1896
|
ref: forwardedRef
|
|
1809
|
-
}, /* @__PURE__ */
|
|
1897
|
+
}, /* @__PURE__ */ React22.createElement(OverlayLayoutProvider, {
|
|
1810
1898
|
inOverlayLayout: true
|
|
1811
1899
|
}, children));
|
|
1812
1900
|
});
|
|
1813
1901
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
1814
1902
|
var DIALOG_CONTENT_NAME = "DialogContent";
|
|
1815
|
-
var DialogContent = /* @__PURE__ */
|
|
1903
|
+
var DialogContent = /* @__PURE__ */ forwardRef14(({ classNames, children, size = "md", inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
1816
1904
|
const { tx } = useThemeContext();
|
|
1817
1905
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
1818
|
-
return /* @__PURE__ */
|
|
1906
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Content, {
|
|
1819
1907
|
...props,
|
|
1820
1908
|
// NOTE: Radix warning unless set to undefined.
|
|
1821
1909
|
// https://www.radix-ui.com/primitives/docs/components/dialog#description
|
|
1822
1910
|
"aria-describedby": void 0,
|
|
1823
1911
|
className: tx("dialog.content", {
|
|
1824
|
-
|
|
1825
|
-
|
|
1912
|
+
size,
|
|
1913
|
+
inOverlayLayout: propsInOverlayLayout || inOverlayLayout
|
|
1826
1914
|
}, classNames),
|
|
1827
1915
|
ref: forwardedRef
|
|
1828
|
-
}, /* @__PURE__ */
|
|
1916
|
+
}, /* @__PURE__ */ React22.createElement(Column.Root, {
|
|
1917
|
+
classNames: "dx-expander",
|
|
1918
|
+
gutter: "sm"
|
|
1919
|
+
}, children));
|
|
1829
1920
|
});
|
|
1830
1921
|
DialogContent.displayName = DIALOG_CONTENT_NAME;
|
|
1831
|
-
var DialogHeader =
|
|
1922
|
+
var DialogHeader = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1923
|
+
const { className, ...rest } = composableProps8(props);
|
|
1924
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1832
1925
|
const { tx } = useThemeContext();
|
|
1833
|
-
return /* @__PURE__ */
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
role: "heading",
|
|
1837
|
-
...props,
|
|
1838
|
-
className: tx("dialog.header", {
|
|
1839
|
-
srOnly
|
|
1840
|
-
}, [
|
|
1841
|
-
classNames
|
|
1842
|
-
]),
|
|
1926
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1927
|
+
...rest,
|
|
1928
|
+
className: tx("dialog.header", {}, className),
|
|
1843
1929
|
ref: forwardedRef
|
|
1844
|
-
})
|
|
1930
|
+
}, children);
|
|
1845
1931
|
});
|
|
1846
|
-
var DialogCloseIconButton = /* @__PURE__ */
|
|
1932
|
+
var DialogCloseIconButton = /* @__PURE__ */ forwardRef14(({ label, ...props }, forwardedRef) => {
|
|
1847
1933
|
const { t } = useTranslation3(osTranslations2);
|
|
1848
|
-
return /* @__PURE__ */
|
|
1934
|
+
return /* @__PURE__ */ React22.createElement(IconButton, {
|
|
1849
1935
|
...props,
|
|
1850
|
-
label: label ?? t("close
|
|
1936
|
+
label: label ?? t("close-dialog.label"),
|
|
1851
1937
|
icon: "ph--x--regular",
|
|
1852
1938
|
iconOnly: true,
|
|
1853
1939
|
size: 4,
|
|
1854
|
-
density: "fine",
|
|
1855
1940
|
variant: "ghost",
|
|
1856
1941
|
ref: forwardedRef
|
|
1857
1942
|
});
|
|
1858
1943
|
});
|
|
1859
|
-
var DialogBody =
|
|
1944
|
+
var DialogBody = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1945
|
+
const { className, ...rest } = composableProps8(props);
|
|
1946
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1860
1947
|
const { tx } = useThemeContext();
|
|
1861
|
-
return /* @__PURE__ */
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
role: "none",
|
|
1865
|
-
...props,
|
|
1866
|
-
className: tx("dialog.body"),
|
|
1948
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1949
|
+
...rest,
|
|
1950
|
+
className: tx("dialog.body", {}, className),
|
|
1867
1951
|
ref: forwardedRef
|
|
1868
|
-
}, children)
|
|
1952
|
+
}, children);
|
|
1869
1953
|
});
|
|
1870
|
-
var DialogTitle = /* @__PURE__ */
|
|
1954
|
+
var DialogTitle = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1871
1955
|
const { tx } = useThemeContext();
|
|
1872
|
-
return /* @__PURE__ */
|
|
1956
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Title, {
|
|
1873
1957
|
...props,
|
|
1874
1958
|
className: tx("dialog.title", {
|
|
1875
1959
|
srOnly
|
|
@@ -1877,9 +1961,9 @@ var DialogTitle = /* @__PURE__ */ forwardRef16(({ classNames, srOnly, ...props }
|
|
|
1877
1961
|
ref: forwardedRef
|
|
1878
1962
|
});
|
|
1879
1963
|
});
|
|
1880
|
-
var DialogDescription = /* @__PURE__ */
|
|
1964
|
+
var DialogDescription = /* @__PURE__ */ forwardRef14(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1881
1965
|
const { tx } = useThemeContext();
|
|
1882
|
-
return /* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ React22.createElement(DialogPrimitive.Description, {
|
|
1883
1967
|
...props,
|
|
1884
1968
|
className: tx("dialog.description", {
|
|
1885
1969
|
srOnly
|
|
@@ -1887,17 +1971,17 @@ var DialogDescription = /* @__PURE__ */ forwardRef16(({ classNames, srOnly, ...p
|
|
|
1887
1971
|
ref: forwardedRef
|
|
1888
1972
|
});
|
|
1889
1973
|
});
|
|
1890
|
-
var DialogActionBar =
|
|
1974
|
+
var DialogActionBar = slottable7(({ children, asChild, ...props }, forwardedRef) => {
|
|
1975
|
+
const { className: classNames, ...rest } = composableProps8(props);
|
|
1976
|
+
const Comp = asChild ? Slot13 : Primitive13.div;
|
|
1891
1977
|
const { tx } = useThemeContext();
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
|
|
1894
|
-
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1895
|
-
...props,
|
|
1978
|
+
return /* @__PURE__ */ React22.createElement(Comp, {
|
|
1979
|
+
...rest,
|
|
1896
1980
|
className: tx("dialog.actionbar", {}, classNames),
|
|
1897
1981
|
ref: forwardedRef
|
|
1898
|
-
}, children)
|
|
1982
|
+
}, children);
|
|
1899
1983
|
});
|
|
1900
|
-
var DialogClose =
|
|
1984
|
+
var DialogClose = DialogPrimitive.Close;
|
|
1901
1985
|
var Dialog = {
|
|
1902
1986
|
Root: DialogRoot,
|
|
1903
1987
|
Trigger: DialogTrigger,
|
|
@@ -1909,114 +1993,91 @@ var Dialog = {
|
|
|
1909
1993
|
Title: DialogTitle,
|
|
1910
1994
|
Description: DialogDescription,
|
|
1911
1995
|
ActionBar: DialogActionBar,
|
|
1912
|
-
Close: DialogClose,
|
|
1913
|
-
CloseIconButton: DialogCloseIconButton
|
|
1914
|
-
};
|
|
1915
|
-
|
|
1916
|
-
// src/components/Dialog/AlertDialog.tsx
|
|
1917
|
-
import
|
|
1918
|
-
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
1919
|
-
import
|
|
1920
|
-
var AlertDialogRoot = (props) => /* @__PURE__ */
|
|
1921
|
-
elevation: "dialog"
|
|
1922
|
-
}, /* @__PURE__ */
|
|
1923
|
-
var AlertDialogTrigger =
|
|
1924
|
-
var AlertDialogPortal =
|
|
1925
|
-
var AlertDialogCancel =
|
|
1926
|
-
var AlertDialogAction =
|
|
1927
|
-
var AlertDialogTitle = /* @__PURE__ */ forwardRef17(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1928
|
-
const { tx } = useThemeContext();
|
|
1929
|
-
return /* @__PURE__ */ React22.createElement(AlertDialogTitlePrimitive, {
|
|
1930
|
-
...props,
|
|
1931
|
-
className: tx("dialog.title", {
|
|
1932
|
-
srOnly
|
|
1933
|
-
}, classNames),
|
|
1934
|
-
ref: forwardedRef
|
|
1935
|
-
});
|
|
1936
|
-
});
|
|
1937
|
-
var AlertDialogDescription = /* @__PURE__ */ forwardRef17(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1938
|
-
const { tx } = useThemeContext();
|
|
1939
|
-
return /* @__PURE__ */ React22.createElement(AlertDialogDescriptionPrimitive, {
|
|
1940
|
-
...props,
|
|
1941
|
-
className: tx("dialog.description", {
|
|
1942
|
-
srOnly
|
|
1943
|
-
}, classNames),
|
|
1944
|
-
ref: forwardedRef
|
|
1945
|
-
});
|
|
1946
|
-
});
|
|
1996
|
+
Close: DialogClose,
|
|
1997
|
+
CloseIconButton: DialogCloseIconButton
|
|
1998
|
+
};
|
|
1999
|
+
|
|
2000
|
+
// src/components/Dialog/AlertDialog.tsx
|
|
2001
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
2002
|
+
import { createContext as createContext6 } from "@radix-ui/react-context";
|
|
2003
|
+
import React23, { forwardRef as forwardRef15 } from "react";
|
|
2004
|
+
var AlertDialogRoot = (props) => /* @__PURE__ */ React23.createElement(ElevationProvider, {
|
|
2005
|
+
elevation: "dialog"
|
|
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;
|
|
1947
2011
|
var ALERT_DIALOG_OVERLAY_NAME = "AlertDialogOverlay";
|
|
1948
2012
|
var ALERT_DIALOG_CONTENT_NAME = "AlertDialogContent";
|
|
1949
|
-
var ALERT_DIALOG_BODY_NAME = "AlertDialogBody";
|
|
1950
|
-
var ALERT_DIALOG_ACTIONBAR_NAME = "AlertDialogActionBar";
|
|
1951
2013
|
var [OverlayLayoutProvider2, useOverlayLayoutContext2] = createContext6(ALERT_DIALOG_OVERLAY_NAME, {
|
|
1952
2014
|
inOverlayLayout: false
|
|
1953
2015
|
});
|
|
1954
|
-
var AlertDialogOverlay = /* @__PURE__ */
|
|
2016
|
+
var AlertDialogOverlay = /* @__PURE__ */ forwardRef15(({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
1955
2017
|
const { tx } = useThemeContext();
|
|
1956
|
-
return /* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Overlay, {
|
|
1957
2019
|
...props,
|
|
1958
2020
|
"data-block-align": blockAlign,
|
|
1959
|
-
className: tx(
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
classNames,
|
|
1963
|
-
// TODO(burdon): Move to dialog.ts.
|
|
1964
|
-
"data-[h-align=start]:justify-center",
|
|
1965
|
-
"data-[h-align=start]:items-start",
|
|
1966
|
-
"data-[h-align=center]:place-content-center"
|
|
1967
|
-
),
|
|
1968
|
-
ref: forwardedRef
|
|
1969
|
-
}, /* @__PURE__ */ React22.createElement(OverlayLayoutProvider2, {
|
|
2021
|
+
className: tx("dialog.overlay", {}, classNames),
|
|
2022
|
+
ref: forwardedRef
|
|
2023
|
+
}, /* @__PURE__ */ React23.createElement(OverlayLayoutProvider2, {
|
|
1970
2024
|
inOverlayLayout: true
|
|
1971
2025
|
}, children));
|
|
1972
2026
|
});
|
|
1973
2027
|
AlertDialogOverlay.displayName = ALERT_DIALOG_OVERLAY_NAME;
|
|
1974
|
-
var AlertDialogContent = /* @__PURE__ */
|
|
2028
|
+
var AlertDialogContent = /* @__PURE__ */ forwardRef15(({ classNames, children, size = "md", ...props }, forwardedRef) => {
|
|
1975
2029
|
const { tx } = useThemeContext();
|
|
1976
2030
|
const { inOverlayLayout } = useOverlayLayoutContext2(ALERT_DIALOG_CONTENT_NAME);
|
|
1977
|
-
return /* @__PURE__ */
|
|
2031
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Content, {
|
|
1978
2032
|
...props,
|
|
1979
2033
|
className: tx("dialog.content", {
|
|
1980
2034
|
inOverlayLayout,
|
|
1981
2035
|
size
|
|
1982
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,
|
|
1983
2040
|
ref: forwardedRef
|
|
1984
|
-
}, /* @__PURE__ */
|
|
2041
|
+
}, /* @__PURE__ */ React23.createElement(Column.Root, {
|
|
2042
|
+
classNames: "dx-expander",
|
|
2043
|
+
gutter: "sm"
|
|
2044
|
+
}, children));
|
|
1985
2045
|
});
|
|
1986
2046
|
AlertDialogContent.displayName = ALERT_DIALOG_CONTENT_NAME;
|
|
1987
|
-
var
|
|
2047
|
+
var AlertDialogTitle = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
1988
2048
|
const { tx } = useThemeContext();
|
|
1989
|
-
return /* @__PURE__ */
|
|
1990
|
-
asChild: true
|
|
1991
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
1992
|
-
role: "none",
|
|
2049
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Title, {
|
|
1993
2050
|
...props,
|
|
1994
|
-
className: tx("dialog.
|
|
2051
|
+
className: tx("dialog.title", {
|
|
2052
|
+
srOnly
|
|
2053
|
+
}, classNames),
|
|
1995
2054
|
ref: forwardedRef
|
|
1996
|
-
}
|
|
2055
|
+
});
|
|
1997
2056
|
});
|
|
1998
|
-
|
|
1999
|
-
var AlertDialogActionBar = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2057
|
+
var AlertDialogDescription = /* @__PURE__ */ forwardRef15(({ classNames, srOnly, ...props }, forwardedRef) => {
|
|
2000
2058
|
const { tx } = useThemeContext();
|
|
2001
|
-
return /* @__PURE__ */
|
|
2002
|
-
asChild: true
|
|
2003
|
-
}, /* @__PURE__ */ React22.createElement("div", {
|
|
2059
|
+
return /* @__PURE__ */ React23.createElement(AlertDialogPrimitive.Description, {
|
|
2004
2060
|
...props,
|
|
2005
|
-
className: tx("dialog.
|
|
2061
|
+
className: tx("dialog.description", {
|
|
2062
|
+
srOnly
|
|
2063
|
+
}, classNames),
|
|
2006
2064
|
ref: forwardedRef
|
|
2007
|
-
}
|
|
2065
|
+
});
|
|
2008
2066
|
});
|
|
2009
|
-
AlertDialogActionBar.displayName = ALERT_DIALOG_ACTIONBAR_NAME;
|
|
2010
2067
|
var AlertDialog = {
|
|
2011
2068
|
Root: AlertDialogRoot,
|
|
2012
2069
|
Trigger: AlertDialogTrigger,
|
|
2013
2070
|
Portal: AlertDialogPortal,
|
|
2014
2071
|
Overlay: AlertDialogOverlay,
|
|
2015
2072
|
Content: AlertDialogContent,
|
|
2016
|
-
|
|
2073
|
+
// Shared with Dialog.
|
|
2074
|
+
Header: Dialog.Header,
|
|
2075
|
+
Body: Dialog.Body,
|
|
2017
2076
|
Title: AlertDialogTitle,
|
|
2018
2077
|
Description: AlertDialogDescription,
|
|
2019
|
-
ActionBar:
|
|
2078
|
+
ActionBar: Dialog.ActionBar,
|
|
2079
|
+
CloseIconButton: Dialog.CloseIconButton,
|
|
2080
|
+
// AlertDialog-specific dismissal.
|
|
2020
2081
|
Cancel: AlertDialogCancel,
|
|
2021
2082
|
Action: AlertDialogAction
|
|
2022
2083
|
};
|
|
@@ -2027,57 +2088,6 @@ import { ErrorBoundary } from "@dxos/react-error-boundary";
|
|
|
2027
2088
|
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2028
2089
|
import React24 from "react";
|
|
2029
2090
|
import { safeStringify } from "@dxos/util";
|
|
2030
|
-
|
|
2031
|
-
// src/components/ErrorFallback/ErrorStack.tsx
|
|
2032
|
-
import ErrorStackParser from "error-stack-parser";
|
|
2033
|
-
import React23 from "react";
|
|
2034
|
-
import { mx as mx7 } from "@dxos/ui-theme";
|
|
2035
|
-
var ErrorStack = ({ error }) => {
|
|
2036
|
-
const frames = ErrorStackParser.parse(error);
|
|
2037
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
2038
|
-
className: "font-mono text-sm"
|
|
2039
|
-
}, frames.map((frame, i) => {
|
|
2040
|
-
const isLast = i === frames.length - 1;
|
|
2041
|
-
const local = frame.fileName ? parseLocalFrame(frame.fileName, frame.lineNumber, frame.columnNumber) : void 0;
|
|
2042
|
-
const name = frame.functionName ?? "<anonymous>";
|
|
2043
|
-
return /* @__PURE__ */ React23.createElement("div", {
|
|
2044
|
-
key: i,
|
|
2045
|
-
className: mx7("grid grid-cols-[16px_1fr_auto_auto] items-stretch gap-x-2", local && "cursor-pointer hover:bg-hover-surface")
|
|
2046
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2047
|
-
className: "relative"
|
|
2048
|
-
}, /* @__PURE__ */ React23.createElement("div", {
|
|
2049
|
-
className: mx7("absolute left-1/2 -translate-x-1/2 w-px bg-neutral-500", isLast ? "top-0 h-1/2" : "inset-y-0")
|
|
2050
|
-
}), /* @__PURE__ */ React23.createElement("div", {
|
|
2051
|
-
className: "absolute top-1/2 -translate-y-1/2 left-1/2 right-0 h-px bg-neutral-500"
|
|
2052
|
-
})), local ? /* @__PURE__ */ React23.createElement("a", {
|
|
2053
|
-
href: local.href,
|
|
2054
|
-
className: "truncate self-center"
|
|
2055
|
-
}, name) : /* @__PURE__ */ React23.createElement("span", {
|
|
2056
|
-
className: "text-subdued truncate self-center"
|
|
2057
|
-
}, name), /* @__PURE__ */ React23.createElement("span", {
|
|
2058
|
-
className: "text-xs text-subdued truncate self-center"
|
|
2059
|
-
}, local?.fileName ?? ""), /* @__PURE__ */ React23.createElement("span", {
|
|
2060
|
-
className: "text-xs text-subdued text-right self-center"
|
|
2061
|
-
}, local ? `${frame.lineNumber}:${frame.columnNumber}` : ""));
|
|
2062
|
-
}));
|
|
2063
|
-
};
|
|
2064
|
-
var parseLocalFrame = (fileUrl, line, col) => {
|
|
2065
|
-
try {
|
|
2066
|
-
const { pathname } = new URL(fileUrl);
|
|
2067
|
-
if (!pathname.startsWith("/@fs/")) {
|
|
2068
|
-
return void 0;
|
|
2069
|
-
}
|
|
2070
|
-
const localPath = pathname.slice(4);
|
|
2071
|
-
return {
|
|
2072
|
-
href: `vscode://file/${localPath}:${line ?? 1}:${col ?? 1}`,
|
|
2073
|
-
fileName: pathname.split("/").pop() ?? localPath
|
|
2074
|
-
};
|
|
2075
|
-
} catch {
|
|
2076
|
-
return void 0;
|
|
2077
|
-
}
|
|
2078
|
-
};
|
|
2079
|
-
|
|
2080
|
-
// src/components/ErrorFallback/ErrorFallback.tsx
|
|
2081
2091
|
var ErrorFallback = ({ children, error, title, data }) => {
|
|
2082
2092
|
const isDev = true;
|
|
2083
2093
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -2145,15 +2155,124 @@ var generator = ({ error, delay }) => {
|
|
|
2145
2155
|
return error?.() ?? new Error(`Error generated after ${delay}ms`);
|
|
2146
2156
|
};
|
|
2147
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
|
+
|
|
2148
2267
|
// src/components/Input/Input.tsx
|
|
2149
|
-
import
|
|
2268
|
+
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
2150
2269
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
2151
|
-
import
|
|
2270
|
+
import React26, { forwardRef as forwardRef16 } from "react";
|
|
2152
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";
|
|
2153
2272
|
import { mx as mx8 } from "@dxos/ui-theme";
|
|
2154
|
-
var Label3 = /* @__PURE__ */
|
|
2273
|
+
var Label3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2155
2274
|
const { tx } = useThemeContext();
|
|
2156
|
-
return /* @__PURE__ */
|
|
2275
|
+
return /* @__PURE__ */ React26.createElement(LabelPrimitive, {
|
|
2157
2276
|
...props,
|
|
2158
2277
|
className: tx("input.label", {
|
|
2159
2278
|
srOnly
|
|
@@ -2161,9 +2280,9 @@ var Label3 = /* @__PURE__ */ forwardRef18(({ classNames, children, srOnly, ...pr
|
|
|
2161
2280
|
ref: forwardedRef
|
|
2162
2281
|
}, children);
|
|
2163
2282
|
});
|
|
2164
|
-
var
|
|
2283
|
+
var Description3 = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2165
2284
|
const { tx } = useThemeContext();
|
|
2166
|
-
return /* @__PURE__ */
|
|
2285
|
+
return /* @__PURE__ */ React26.createElement(DescriptionPrimitive, {
|
|
2167
2286
|
...props,
|
|
2168
2287
|
className: tx("input.description", {
|
|
2169
2288
|
srOnly
|
|
@@ -2171,10 +2290,10 @@ var Description = /* @__PURE__ */ forwardRef18(({ classNames, children, srOnly,
|
|
|
2171
2290
|
ref: forwardedRef
|
|
2172
2291
|
}, children);
|
|
2173
2292
|
});
|
|
2174
|
-
var Validation = /* @__PURE__ */
|
|
2293
|
+
var Validation = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2175
2294
|
const { tx } = useThemeContext();
|
|
2176
2295
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2177
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ React26.createElement(ValidationPrimitive, {
|
|
2178
2297
|
...props,
|
|
2179
2298
|
className: tx("input.validation", {
|
|
2180
2299
|
srOnly,
|
|
@@ -2183,9 +2302,9 @@ var Validation = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, child
|
|
|
2183
2302
|
ref: forwardedRef
|
|
2184
2303
|
}, children);
|
|
2185
2304
|
});
|
|
2186
|
-
var DescriptionAndValidation = /* @__PURE__ */
|
|
2305
|
+
var DescriptionAndValidation = /* @__PURE__ */ forwardRef16(({ classNames, children, srOnly, ...props }, forwardedRef) => {
|
|
2187
2306
|
const { tx } = useThemeContext();
|
|
2188
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ React26.createElement(DescriptionAndValidationPrimitive, {
|
|
2189
2308
|
...props,
|
|
2190
2309
|
className: tx("input.descriptionAndValidation", {
|
|
2191
2310
|
srOnly
|
|
@@ -2193,12 +2312,12 @@ var DescriptionAndValidation = /* @__PURE__ */ forwardRef18(({ classNames, child
|
|
|
2193
2312
|
ref: forwardedRef
|
|
2194
2313
|
}, children);
|
|
2195
2314
|
});
|
|
2196
|
-
var PinInput = /* @__PURE__ */
|
|
2315
|
+
var PinInput = /* @__PURE__ */ forwardRef16(({ classNames, density: propsDensity, elevation: propsElevation, ...props }, forwardedRef) => {
|
|
2197
2316
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2198
2317
|
const { tx } = useThemeContext();
|
|
2199
2318
|
const density = useDensityContext(propsDensity);
|
|
2200
2319
|
const elevation = useElevationContext(propsElevation);
|
|
2201
|
-
return /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ React26.createElement(PinInputPrimitive, {
|
|
2202
2321
|
...props,
|
|
2203
2322
|
...props.autoFocus && !hasIosKeyboard2 && {
|
|
2204
2323
|
autoFocus: true
|
|
@@ -2214,13 +2333,13 @@ var PinInput = /* @__PURE__ */ forwardRef18(({ classNames, density: propsDensity
|
|
|
2214
2333
|
ref: forwardedRef
|
|
2215
2334
|
});
|
|
2216
2335
|
});
|
|
2217
|
-
var TextInput = /* @__PURE__ */
|
|
2336
|
+
var TextInput = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: densityProp, elevation: elevationProp, variant, noAutoFill, ...props }, forwardedRef) => {
|
|
2218
2337
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2219
2338
|
const { tx } = useThemeContext();
|
|
2220
|
-
const density = useDensityContext(
|
|
2221
|
-
const elevation = useElevationContext(
|
|
2339
|
+
const density = useDensityContext(densityProp);
|
|
2340
|
+
const elevation = useElevationContext(elevationProp);
|
|
2222
2341
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2223
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ React26.createElement(TextInputPrimitive, {
|
|
2224
2343
|
...props,
|
|
2225
2344
|
"data-1p-ignore": noAutoFill,
|
|
2226
2345
|
className: tx("input.input", {
|
|
@@ -2236,13 +2355,13 @@ var TextInput = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, densit
|
|
|
2236
2355
|
ref: forwardedRef
|
|
2237
2356
|
});
|
|
2238
2357
|
});
|
|
2239
|
-
var TextArea = /* @__PURE__ */
|
|
2358
|
+
var TextArea = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
2240
2359
|
const { hasIosKeyboard: hasIosKeyboard2 } = useThemeContext();
|
|
2241
2360
|
const { tx } = useThemeContext();
|
|
2242
2361
|
const density = useDensityContext(propsDensity);
|
|
2243
2362
|
const elevation = useElevationContext(propsElevation);
|
|
2244
2363
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
2245
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ React26.createElement(TextAreaPrimitive, {
|
|
2246
2365
|
...props,
|
|
2247
2366
|
className: tx("input.textArea", {
|
|
2248
2367
|
variant,
|
|
@@ -2257,7 +2376,7 @@ var TextArea = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, density
|
|
|
2257
2376
|
ref: forwardedRef
|
|
2258
2377
|
});
|
|
2259
2378
|
});
|
|
2260
|
-
var Checkbox = /* @__PURE__ */
|
|
2379
|
+
var Checkbox = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, size, ...props }, forwardedRef) => {
|
|
2261
2380
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2262
2381
|
prop: propsChecked,
|
|
2263
2382
|
defaultProp: propsDefaultChecked,
|
|
@@ -2265,7 +2384,7 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2265
2384
|
});
|
|
2266
2385
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2267
2386
|
const { tx } = useThemeContext();
|
|
2268
|
-
return /* @__PURE__ */
|
|
2387
|
+
return /* @__PURE__ */ React26.createElement(CheckboxPrimitive.Root, {
|
|
2269
2388
|
...props,
|
|
2270
2389
|
checked,
|
|
2271
2390
|
onCheckedChange,
|
|
@@ -2279,7 +2398,7 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2279
2398
|
size
|
|
2280
2399
|
}, "shrink-0", classNames),
|
|
2281
2400
|
ref: forwardedRef
|
|
2282
|
-
}, /* @__PURE__ */
|
|
2401
|
+
}, /* @__PURE__ */ React26.createElement(Icon, {
|
|
2283
2402
|
icon: checked === "indeterminate" ? "ph--minus--regular" : "ph--check--regular",
|
|
2284
2403
|
classNames: tx("input.checkboxIndicator", {
|
|
2285
2404
|
size,
|
|
@@ -2287,14 +2406,14 @@ var Checkbox = /* @__PURE__ */ forwardRef18(({ __inputScope, classNames, checked
|
|
|
2287
2406
|
})
|
|
2288
2407
|
}));
|
|
2289
2408
|
});
|
|
2290
|
-
var Switch = /* @__PURE__ */
|
|
2409
|
+
var Switch = /* @__PURE__ */ forwardRef16(({ __inputScope, classNames, checked: propsChecked, defaultChecked: propsDefaultChecked, onCheckedChange: propsOnCheckedChange, ...props }, forwardedRef) => {
|
|
2291
2410
|
const [checked, onCheckedChange] = useControllableState2({
|
|
2292
2411
|
prop: propsChecked,
|
|
2293
2412
|
defaultProp: propsDefaultChecked ?? false,
|
|
2294
2413
|
onChange: propsOnCheckedChange
|
|
2295
2414
|
});
|
|
2296
2415
|
const { id, validationValence, descriptionId, errorMessageId } = useInputContext(INPUT_NAME, __inputScope);
|
|
2297
|
-
return /* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ React26.createElement("input", {
|
|
2298
2417
|
type: "checkbox",
|
|
2299
2418
|
className: mx8("dx-checkbox--switch dx-focus-ring", classNames),
|
|
2300
2419
|
checked,
|
|
@@ -2319,19 +2438,20 @@ var Input = {
|
|
|
2319
2438
|
Checkbox,
|
|
2320
2439
|
Switch,
|
|
2321
2440
|
Label: Label3,
|
|
2322
|
-
Description,
|
|
2441
|
+
Description: Description3,
|
|
2323
2442
|
Validation,
|
|
2324
2443
|
DescriptionAndValidation
|
|
2325
2444
|
};
|
|
2326
2445
|
|
|
2327
2446
|
// src/components/List/List.tsx
|
|
2328
|
-
import { Primitive as
|
|
2329
|
-
import { Slot as
|
|
2330
|
-
import
|
|
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";
|
|
2331
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";
|
|
2332
2452
|
|
|
2333
2453
|
// src/components/List/ListDropIndicator.tsx
|
|
2334
|
-
import
|
|
2454
|
+
import React27 from "react";
|
|
2335
2455
|
var edgeToOrientationMap = {
|
|
2336
2456
|
top: "horizontal",
|
|
2337
2457
|
bottom: "horizontal",
|
|
@@ -2353,8 +2473,7 @@ var terminalSize = 8;
|
|
|
2353
2473
|
var offsetToAlignTerminalWithLine = (strokeSize - terminalSize) / 2;
|
|
2354
2474
|
var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineInset - terminalSize }) => {
|
|
2355
2475
|
const orientation = edgeToOrientationMap[edge];
|
|
2356
|
-
return /* @__PURE__ */
|
|
2357
|
-
role: "none",
|
|
2476
|
+
return /* @__PURE__ */ React27.createElement("div", {
|
|
2358
2477
|
style: {
|
|
2359
2478
|
"--line-thickness": `${strokeSize}px`,
|
|
2360
2479
|
"--line-offset": `calc(-0.5 * (${gap}px + ${strokeSize}px))`,
|
|
@@ -2369,22 +2488,23 @@ var ListDropIndicator = ({ edge, gap = 0, lineInset = 0, terminalInset = lineIns
|
|
|
2369
2488
|
};
|
|
2370
2489
|
|
|
2371
2490
|
// src/components/List/List.tsx
|
|
2372
|
-
var List =
|
|
2491
|
+
var List = composable4(({ children, ...props }, forwardedRef) => {
|
|
2373
2492
|
const { tx } = useThemeContext();
|
|
2374
2493
|
const density = useDensityContext(props.density);
|
|
2375
|
-
|
|
2494
|
+
const { className, ...rest } = composableProps10(props);
|
|
2495
|
+
return /* @__PURE__ */ React28.createElement(DensityProvider, {
|
|
2376
2496
|
density
|
|
2377
|
-
}, /* @__PURE__ */
|
|
2378
|
-
...
|
|
2379
|
-
className: tx("list.root", {},
|
|
2497
|
+
}, /* @__PURE__ */ React28.createElement(ListPrimitive, {
|
|
2498
|
+
...rest,
|
|
2499
|
+
className: tx("list.root", {}, className),
|
|
2380
2500
|
ref: forwardedRef
|
|
2381
2501
|
}, children));
|
|
2382
2502
|
});
|
|
2383
|
-
var ListItemEndcap = /* @__PURE__ */
|
|
2384
|
-
const Comp = asChild ?
|
|
2503
|
+
var ListItemEndcap = /* @__PURE__ */ forwardRef17(({ children, classNames, asChild, ...props }, forwardedRef) => {
|
|
2504
|
+
const Comp = asChild ? Slot15 : Primitive15.div;
|
|
2385
2505
|
const density = useDensityContext();
|
|
2386
2506
|
const { tx } = useThemeContext();
|
|
2387
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ React28.createElement(Comp, {
|
|
2388
2508
|
...!asChild && {
|
|
2389
2509
|
role: "none"
|
|
2390
2510
|
},
|
|
@@ -2398,45 +2518,44 @@ var ListItemEndcap = /* @__PURE__ */ forwardRef19(({ children, classNames, asChi
|
|
|
2398
2518
|
var MockListItemOpenTrigger = ({ classNames, ...props }) => {
|
|
2399
2519
|
const density = useDensityContext();
|
|
2400
2520
|
const { tx } = useThemeContext();
|
|
2401
|
-
return /* @__PURE__ */
|
|
2402
|
-
role: "none",
|
|
2521
|
+
return /* @__PURE__ */ React28.createElement("div", {
|
|
2403
2522
|
...props,
|
|
2404
2523
|
className: tx("list.item.openTrigger", {
|
|
2405
2524
|
density
|
|
2406
2525
|
}, classNames)
|
|
2407
2526
|
});
|
|
2408
2527
|
};
|
|
2409
|
-
var ListItemHeading = /* @__PURE__ */
|
|
2528
|
+
var ListItemHeading = /* @__PURE__ */ forwardRef17(({ children, classNames, ...props }, forwardedRef) => {
|
|
2410
2529
|
const { tx } = useThemeContext();
|
|
2411
2530
|
const density = useDensityContext();
|
|
2412
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ React28.createElement(ListPrimitiveItemHeading, {
|
|
2413
2532
|
...props,
|
|
2414
2533
|
className: tx("list.item.heading", {
|
|
2415
2534
|
density
|
|
2416
2535
|
}, classNames),
|
|
2417
2536
|
ref: forwardedRef
|
|
2418
|
-
}, children);
|
|
2537
|
+
}, /* @__PURE__ */ React28.createElement("span", null, children));
|
|
2419
2538
|
});
|
|
2420
|
-
var ListItemOpenTrigger = /* @__PURE__ */
|
|
2539
|
+
var ListItemOpenTrigger = /* @__PURE__ */ forwardRef17(({ __listItemScope, classNames, children, ...props }, forwardedRef) => {
|
|
2421
2540
|
const { tx } = useThemeContext();
|
|
2422
2541
|
const density = useDensityContext();
|
|
2423
2542
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
2424
|
-
return /* @__PURE__ */
|
|
2543
|
+
return /* @__PURE__ */ React28.createElement(ListPrimitiveItemOpenTrigger, {
|
|
2425
2544
|
...props,
|
|
2426
2545
|
className: tx("list.item.openTrigger", {
|
|
2427
2546
|
density
|
|
2428
2547
|
}, classNames),
|
|
2429
2548
|
ref: forwardedRef
|
|
2430
|
-
}, children || /* @__PURE__ */
|
|
2549
|
+
}, children || /* @__PURE__ */ React28.createElement(Icon, {
|
|
2431
2550
|
size: 3,
|
|
2432
2551
|
icon: open ? "ph--caret-down--bold" : "ph--caret-right--bold",
|
|
2433
2552
|
classNames: tx("list.item.openTriggerIcon", {})
|
|
2434
2553
|
}));
|
|
2435
2554
|
});
|
|
2436
|
-
var ListItemRoot = /* @__PURE__ */
|
|
2555
|
+
var ListItemRoot = /* @__PURE__ */ forwardRef17(({ classNames, children, ...props }, forwardedRef) => {
|
|
2437
2556
|
const { tx } = useThemeContext();
|
|
2438
2557
|
const density = useDensityContext();
|
|
2439
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ React28.createElement(ListPrimitiveItem, {
|
|
2440
2559
|
...props,
|
|
2441
2560
|
className: tx("list.item.root", {
|
|
2442
2561
|
density,
|
|
@@ -2456,10 +2575,10 @@ var ListItem = {
|
|
|
2456
2575
|
};
|
|
2457
2576
|
|
|
2458
2577
|
// src/components/List/Tree.tsx
|
|
2459
|
-
import
|
|
2578
|
+
import React30, { forwardRef as forwardRef18 } from "react";
|
|
2460
2579
|
|
|
2461
2580
|
// src/components/List/TreeDropIndicator.tsx
|
|
2462
|
-
import
|
|
2581
|
+
import React29 from "react";
|
|
2463
2582
|
var edgeToOrientationMap2 = {
|
|
2464
2583
|
"reorder-above": "sibling",
|
|
2465
2584
|
"reorder-below": "sibling",
|
|
@@ -2469,7 +2588,7 @@ var edgeToOrientationMap2 = {
|
|
|
2469
2588
|
var orientationStyles2 = {
|
|
2470
2589
|
// TODO(wittjosiah): Stop using left/right here.
|
|
2471
2590
|
sibling: "h-(--line-thickness) left-(--horizontal-indent) right-0 bg-accent-surface before:left-(--negative-terminal-size)",
|
|
2472
|
-
child: "
|
|
2591
|
+
child: "inset-0 border-[length:var(--line-thickness)] before:invisible"
|
|
2473
2592
|
};
|
|
2474
2593
|
var instructionStyles = {
|
|
2475
2594
|
"reorder-above": "top-(--line-offset) before:top-(--offset-terminal)",
|
|
@@ -2489,7 +2608,7 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2489
2608
|
if (isBlocked) {
|
|
2490
2609
|
return null;
|
|
2491
2610
|
}
|
|
2492
|
-
return /* @__PURE__ */
|
|
2611
|
+
return /* @__PURE__ */ React29.createElement("div", {
|
|
2493
2612
|
style: {
|
|
2494
2613
|
"--line-thickness": `${strokeSize2}px`,
|
|
2495
2614
|
"--line-offset": `${lineOffset}`,
|
|
@@ -2504,22 +2623,22 @@ var TreeDropIndicator = ({ instruction, gap = 0 }) => {
|
|
|
2504
2623
|
};
|
|
2505
2624
|
|
|
2506
2625
|
// src/components/List/Tree.tsx
|
|
2507
|
-
var TreeRoot = /* @__PURE__ */
|
|
2508
|
-
return /* @__PURE__ */
|
|
2626
|
+
var TreeRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2627
|
+
return /* @__PURE__ */ React30.createElement(List, {
|
|
2509
2628
|
...props,
|
|
2510
2629
|
ref: forwardedRef
|
|
2511
2630
|
});
|
|
2512
2631
|
});
|
|
2513
|
-
var TreeBranch = /* @__PURE__ */
|
|
2632
|
+
var TreeBranch = /* @__PURE__ */ forwardRef18(({ __listScope, ...props }, forwardedRef) => {
|
|
2514
2633
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listScope);
|
|
2515
|
-
return /* @__PURE__ */
|
|
2634
|
+
return /* @__PURE__ */ React30.createElement(List, {
|
|
2516
2635
|
...props,
|
|
2517
2636
|
"aria-labelledby": headingId,
|
|
2518
2637
|
ref: forwardedRef
|
|
2519
2638
|
});
|
|
2520
2639
|
});
|
|
2521
|
-
var TreeItemRoot = /* @__PURE__ */
|
|
2522
|
-
return /* @__PURE__ */
|
|
2640
|
+
var TreeItemRoot = /* @__PURE__ */ forwardRef18((props, forwardedRef) => {
|
|
2641
|
+
return /* @__PURE__ */ React30.createElement(ListItem.Root, {
|
|
2523
2642
|
role: "treeitem",
|
|
2524
2643
|
...props,
|
|
2525
2644
|
ref: forwardedRef
|
|
@@ -2545,20 +2664,24 @@ var TreeItem = {
|
|
|
2545
2664
|
// src/components/List/Treegrid.tsx
|
|
2546
2665
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
2547
2666
|
import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
|
|
2548
|
-
import { Primitive as
|
|
2549
|
-
import { Slot as
|
|
2667
|
+
import { Primitive as Primitive16 } from "@radix-ui/react-primitive";
|
|
2668
|
+
import { Slot as Slot16 } from "@radix-ui/react-slot";
|
|
2550
2669
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
2551
|
-
import
|
|
2670
|
+
import React31, { forwardRef as forwardRef19, useCallback as useCallback7 } from "react";
|
|
2671
|
+
import { composable as composable5, composableProps as composableProps11 } from "@dxos/ui-theme";
|
|
2552
2672
|
var TREEGRID_ROW_NAME = "TreegridRow";
|
|
2553
2673
|
var [createTreegridRowContext, createTreegridRowScope] = createContextScope2(TREEGRID_ROW_NAME, []);
|
|
2554
2674
|
var [TreegridRowProvider, useTreegridRowContext] = createTreegridRowContext(TREEGRID_ROW_NAME);
|
|
2555
|
-
var
|
|
2556
|
-
var
|
|
2557
|
-
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) => {
|
|
2558
2678
|
const { tx } = useThemeContext();
|
|
2559
|
-
const
|
|
2679
|
+
const { className, role: _role, ...rest } = composableProps11(props, {
|
|
2680
|
+
classNames
|
|
2681
|
+
});
|
|
2682
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2560
2683
|
const { findFirstFocusable } = useFocusFinders();
|
|
2561
|
-
const handleKeyDown =
|
|
2684
|
+
const handleKeyDown = useCallback7((event) => {
|
|
2562
2685
|
switch (event.key) {
|
|
2563
2686
|
case "ArrowDown":
|
|
2564
2687
|
case "ArrowUp": {
|
|
@@ -2587,14 +2710,15 @@ var TreegridRoot = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children
|
|
|
2587
2710
|
break;
|
|
2588
2711
|
}
|
|
2589
2712
|
}
|
|
2590
|
-
|
|
2713
|
+
onKeyDownProp?.(event);
|
|
2591
2714
|
}, [
|
|
2592
|
-
findFirstFocusable
|
|
2715
|
+
findFirstFocusable,
|
|
2716
|
+
onKeyDownProp
|
|
2593
2717
|
]);
|
|
2594
|
-
return /* @__PURE__ */
|
|
2718
|
+
return /* @__PURE__ */ React31.createElement(Comp, {
|
|
2595
2719
|
role: "treegrid",
|
|
2596
|
-
...
|
|
2597
|
-
className: tx("treegrid.root", {},
|
|
2720
|
+
...rest,
|
|
2721
|
+
className: tx("treegrid.root", {}, className),
|
|
2598
2722
|
style: {
|
|
2599
2723
|
...style,
|
|
2600
2724
|
gridTemplateColumns
|
|
@@ -2603,21 +2727,21 @@ var TreegridRoot = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children
|
|
|
2603
2727
|
ref: forwardedRef
|
|
2604
2728
|
}, children);
|
|
2605
2729
|
});
|
|
2606
|
-
var TreegridRow = /* @__PURE__ */
|
|
2730
|
+
var TreegridRow = /* @__PURE__ */ forwardRef19(({ __treegridRowScope, asChild, classNames, children, id, parentOf, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, ...props }, forwardedRef) => {
|
|
2607
2731
|
const { tx } = useThemeContext();
|
|
2608
|
-
const Comp = asChild ?
|
|
2609
|
-
const pathParts = id.split(
|
|
2732
|
+
const Comp = asChild ? Slot16 : Primitive16.div;
|
|
2733
|
+
const pathParts = id.split(TREEGRID_PATH_SEPARATOR);
|
|
2610
2734
|
const level = pathParts.length - 1;
|
|
2611
2735
|
const [open, onOpenChange] = useControllableState3({
|
|
2612
2736
|
prop: propsOpen,
|
|
2613
2737
|
onChange: propsOnOpenChange,
|
|
2614
2738
|
defaultProp: defaultOpen
|
|
2615
2739
|
});
|
|
2616
|
-
return /* @__PURE__ */
|
|
2740
|
+
return /* @__PURE__ */ React31.createElement(TreegridRowProvider, {
|
|
2617
2741
|
open,
|
|
2618
2742
|
onOpenChange,
|
|
2619
2743
|
scope: __treegridRowScope
|
|
2620
|
-
}, /* @__PURE__ */
|
|
2744
|
+
}, /* @__PURE__ */ React31.createElement(Comp, {
|
|
2621
2745
|
role: "row",
|
|
2622
2746
|
"aria-level": level,
|
|
2623
2747
|
className: tx("treegrid.row", {
|
|
@@ -2632,9 +2756,9 @@ var TreegridRow = /* @__PURE__ */ forwardRef21(({ __treegridRowScope, asChild, c
|
|
|
2632
2756
|
ref: forwardedRef
|
|
2633
2757
|
}, children));
|
|
2634
2758
|
});
|
|
2635
|
-
var TreegridCell = /* @__PURE__ */
|
|
2759
|
+
var TreegridCell = /* @__PURE__ */ forwardRef19(({ classNames, children, indent, ...props }, forwardedRef) => {
|
|
2636
2760
|
const { tx } = useThemeContext();
|
|
2637
|
-
return /* @__PURE__ */
|
|
2761
|
+
return /* @__PURE__ */ React31.createElement("div", {
|
|
2638
2762
|
role: "gridcell",
|
|
2639
2763
|
className: tx("treegrid.cell", {
|
|
2640
2764
|
indent
|
|
@@ -2646,28 +2770,24 @@ var TreegridCell = /* @__PURE__ */ forwardRef21(({ classNames, children, indent,
|
|
|
2646
2770
|
var Treegrid = {
|
|
2647
2771
|
Root: TreegridRoot,
|
|
2648
2772
|
Row: TreegridRow,
|
|
2649
|
-
Cell: TreegridCell
|
|
2650
|
-
PARENT_OF_SEPARATOR,
|
|
2651
|
-
PATH_SEPARATOR,
|
|
2652
|
-
createTreegridRowScope,
|
|
2653
|
-
useTreegridRowContext
|
|
2773
|
+
Cell: TreegridCell
|
|
2654
2774
|
};
|
|
2655
2775
|
|
|
2656
2776
|
// src/components/Main/Main.tsx
|
|
2657
|
-
import { useFocusableGroup } from "@fluentui/react-tabster";
|
|
2658
|
-
import { createContext as
|
|
2777
|
+
import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster";
|
|
2778
|
+
import { createContext as createContext8 } from "@radix-ui/react-context";
|
|
2659
2779
|
import { DialogContent as DialogContent2, Root as DialogRoot2, DialogTitle as DialogTitle2 } from "@radix-ui/react-dialog";
|
|
2660
|
-
import { Primitive as
|
|
2661
|
-
import { Slot as
|
|
2780
|
+
import { Primitive as Primitive17 } from "@radix-ui/react-primitive";
|
|
2781
|
+
import { Slot as Slot17 } from "@radix-ui/react-slot";
|
|
2662
2782
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
2663
|
-
import
|
|
2783
|
+
import React32, { forwardRef as forwardRef20, useCallback as useCallback9, useEffect as useEffect5, useRef as useRef4, useState as useState8 } from "react";
|
|
2664
2784
|
import { addEventListener } from "@dxos/async";
|
|
2665
2785
|
import { log } from "@dxos/log";
|
|
2666
2786
|
import { useForwardedRef, useMediaQuery } from "@dxos/react-hooks";
|
|
2667
2787
|
import { osTranslations as osTranslations3 } from "@dxos/ui-theme";
|
|
2668
2788
|
|
|
2669
2789
|
// src/components/Main/useSwipeToDismiss.ts
|
|
2670
|
-
import { useCallback as
|
|
2790
|
+
import { useCallback as useCallback8, useEffect as useEffect4, useState as useState7 } from "react";
|
|
2671
2791
|
var useSwipeToDismiss = (ref, {
|
|
2672
2792
|
onDismiss,
|
|
2673
2793
|
dismissThreshold = 64,
|
|
@@ -2676,22 +2796,22 @@ var useSwipeToDismiss = (ref, {
|
|
|
2676
2796
|
/* side = 'inline-start' */
|
|
2677
2797
|
}) => {
|
|
2678
2798
|
const $root = ref.current;
|
|
2679
|
-
const [motionState, setMotionState] =
|
|
2680
|
-
const [gestureStartX, setGestureStartX] =
|
|
2681
|
-
const setIdle =
|
|
2799
|
+
const [motionState, setMotionState] = useState7(0);
|
|
2800
|
+
const [gestureStartX, setGestureStartX] = useState7(0);
|
|
2801
|
+
const setIdle = useCallback8(() => {
|
|
2682
2802
|
setMotionState(0);
|
|
2683
2803
|
$root?.style.removeProperty("inset-inline-start");
|
|
2684
2804
|
$root?.style.setProperty("transition-duration", "200ms");
|
|
2685
2805
|
}, [
|
|
2686
2806
|
$root
|
|
2687
2807
|
]);
|
|
2688
|
-
const setFollowing =
|
|
2808
|
+
const setFollowing = useCallback8(() => {
|
|
2689
2809
|
setMotionState(2);
|
|
2690
2810
|
$root?.style.setProperty("transition-duration", "0ms");
|
|
2691
2811
|
}, [
|
|
2692
2812
|
$root
|
|
2693
2813
|
]);
|
|
2694
|
-
const handlePointerDown =
|
|
2814
|
+
const handlePointerDown = useCallback8(({ screenX }) => {
|
|
2695
2815
|
if (motionState === 0) {
|
|
2696
2816
|
setMotionState(1);
|
|
2697
2817
|
setGestureStartX(screenX);
|
|
@@ -2699,7 +2819,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2699
2819
|
}, [
|
|
2700
2820
|
motionState
|
|
2701
2821
|
]);
|
|
2702
|
-
const handlePointerMove =
|
|
2822
|
+
const handlePointerMove = useCallback8(({ screenX }) => {
|
|
2703
2823
|
if ($root) {
|
|
2704
2824
|
const delta = Math.min(screenX - gestureStartX, 0);
|
|
2705
2825
|
switch (motionState) {
|
|
@@ -2723,7 +2843,7 @@ var useSwipeToDismiss = (ref, {
|
|
|
2723
2843
|
motionState,
|
|
2724
2844
|
gestureStartX
|
|
2725
2845
|
]);
|
|
2726
|
-
const handlePointerUp =
|
|
2846
|
+
const handlePointerUp = useCallback8(() => {
|
|
2727
2847
|
setIdle();
|
|
2728
2848
|
}, [
|
|
2729
2849
|
setIdle
|
|
@@ -2769,7 +2889,7 @@ var handleOpenAutoFocus = (event) => {
|
|
|
2769
2889
|
};
|
|
2770
2890
|
var landmarkAttr = "data-main-landmark";
|
|
2771
2891
|
var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
2772
|
-
const handleKeyDown =
|
|
2892
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2773
2893
|
const target = event.target;
|
|
2774
2894
|
if (event.target === event.currentTarget && event.key === "Tab" && target.hasAttribute(landmarkAttr)) {
|
|
2775
2895
|
event.preventDefault();
|
|
@@ -2783,7 +2903,7 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2783
2903
|
}, [
|
|
2784
2904
|
propsOnKeyDown
|
|
2785
2905
|
]);
|
|
2786
|
-
const focusableGroupAttrs =
|
|
2906
|
+
const focusableGroupAttrs = useFocusableGroup2({
|
|
2787
2907
|
tabBehavior: "limited",
|
|
2788
2908
|
ignoreDefaultKeydown: {
|
|
2789
2909
|
Tab: true
|
|
@@ -2796,25 +2916,15 @@ var useLandmarkMover = (propsOnKeyDown, landmark) => {
|
|
|
2796
2916
|
...focusableGroupAttrs
|
|
2797
2917
|
};
|
|
2798
2918
|
};
|
|
2799
|
-
var [MainProvider, useMainContext] =
|
|
2919
|
+
var [MainProvider, useMainContext] = createContext8(MAIN_NAME, {
|
|
2800
2920
|
resizing: false,
|
|
2801
2921
|
navigationSidebarState: "closed",
|
|
2802
2922
|
setNavigationSidebarState: (_nextState) => {
|
|
2803
|
-
log.warn("Not initialized", void 0, {
|
|
2804
|
-
F: __dxlog_file,
|
|
2805
|
-
L: 111,
|
|
2806
|
-
S: void 0,
|
|
2807
|
-
C: (f, a) => f(...a)
|
|
2808
|
-
});
|
|
2923
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 67, S: void 0 });
|
|
2809
2924
|
},
|
|
2810
2925
|
complementarySidebarState: "closed",
|
|
2811
2926
|
setComplementarySidebarState: (_nextState) => {
|
|
2812
|
-
log.warn("Not initialized", void 0, {
|
|
2813
|
-
F: __dxlog_file,
|
|
2814
|
-
L: 116,
|
|
2815
|
-
S: void 0,
|
|
2816
|
-
C: (f, a) => f(...a)
|
|
2817
|
-
});
|
|
2927
|
+
log.warn("Not initialized", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 71, S: void 0 });
|
|
2818
2928
|
}
|
|
2819
2929
|
});
|
|
2820
2930
|
var useSidebars = (consumerName) => {
|
|
@@ -2822,22 +2932,22 @@ var useSidebars = (consumerName) => {
|
|
|
2822
2932
|
return {
|
|
2823
2933
|
navigationSidebarState,
|
|
2824
2934
|
setNavigationSidebarState,
|
|
2825
|
-
toggleNavigationSidebar:
|
|
2935
|
+
toggleNavigationSidebar: useCallback9(() => setNavigationSidebarState(navigationSidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2826
2936
|
navigationSidebarState,
|
|
2827
2937
|
setNavigationSidebarState
|
|
2828
2938
|
]),
|
|
2829
|
-
openNavigationSidebar:
|
|
2830
|
-
collapseNavigationSidebar:
|
|
2831
|
-
closeNavigationSidebar:
|
|
2939
|
+
openNavigationSidebar: useCallback9(() => setNavigationSidebarState("expanded"), []),
|
|
2940
|
+
collapseNavigationSidebar: useCallback9(() => setNavigationSidebarState("collapsed"), []),
|
|
2941
|
+
closeNavigationSidebar: useCallback9(() => setNavigationSidebarState("closed"), []),
|
|
2832
2942
|
complementarySidebarState,
|
|
2833
2943
|
setComplementarySidebarState,
|
|
2834
|
-
toggleComplementarySidebar:
|
|
2944
|
+
toggleComplementarySidebar: useCallback9(() => setComplementarySidebarState(complementarySidebarState === "expanded" ? "closed" : "expanded"), [
|
|
2835
2945
|
complementarySidebarState,
|
|
2836
2946
|
setComplementarySidebarState
|
|
2837
2947
|
]),
|
|
2838
|
-
openComplementarySidebar:
|
|
2839
|
-
collapseComplementarySidebar:
|
|
2840
|
-
closeComplementarySidebar:
|
|
2948
|
+
openComplementarySidebar: useCallback9(() => setComplementarySidebarState("expanded"), []),
|
|
2949
|
+
collapseComplementarySidebar: useCallback9(() => setComplementarySidebarState("collapsed"), []),
|
|
2950
|
+
closeComplementarySidebar: useCallback9(() => setComplementarySidebarState("closed"), [])
|
|
2841
2951
|
};
|
|
2842
2952
|
};
|
|
2843
2953
|
var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNavigationSidebarState = "closed", onNavigationSidebarStateChange, complementarySidebarState: propsComplementarySidebarState, defaultComplementarySidebarState = "closed", onComplementarySidebarStateChange, children, ...props }) => {
|
|
@@ -2852,8 +2962,8 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2852
2962
|
defaultProp: defaultComplementarySidebarState,
|
|
2853
2963
|
onChange: onComplementarySidebarStateChange
|
|
2854
2964
|
});
|
|
2855
|
-
const [resizing, setResizing] =
|
|
2856
|
-
const resizeInterval =
|
|
2965
|
+
const [resizing, setResizing] = useState8(false);
|
|
2966
|
+
const resizeInterval = useRef4(null);
|
|
2857
2967
|
useEffect5(() => addEventListener(window, "resize", () => {
|
|
2858
2968
|
setResizing(true);
|
|
2859
2969
|
if (resizeInterval.current) {
|
|
@@ -2864,7 +2974,7 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2864
2974
|
resizeInterval.current = null;
|
|
2865
2975
|
}, 3e3);
|
|
2866
2976
|
}), []);
|
|
2867
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ React32.createElement(MainProvider, {
|
|
2868
2978
|
...props,
|
|
2869
2979
|
navigationSidebarState,
|
|
2870
2980
|
setNavigationSidebarState,
|
|
@@ -2874,11 +2984,11 @@ var MainRoot = ({ navigationSidebarState: propsNavigationSidebarState, defaultNa
|
|
|
2874
2984
|
}, children);
|
|
2875
2985
|
};
|
|
2876
2986
|
MainRoot.displayName = MAIN_ROOT_NAME;
|
|
2877
|
-
var MainOverlay = /* @__PURE__ */
|
|
2987
|
+
var MainOverlay = /* @__PURE__ */ forwardRef20(({ classNames, ...props }, forwardedRef) => {
|
|
2878
2988
|
const [isLg] = useMediaQuery("lg");
|
|
2879
2989
|
const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } = useMainContext(MAIN_OVERLAY_NAME);
|
|
2880
2990
|
const { tx } = useThemeContext();
|
|
2881
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ React32.createElement("div", {
|
|
2882
2992
|
...props,
|
|
2883
2993
|
onClick: () => {
|
|
2884
2994
|
setNavigationSidebarState("collapsed");
|
|
@@ -2895,16 +3005,16 @@ var MainOverlay = /* @__PURE__ */ forwardRef22(({ classNames, ...props }, forwar
|
|
|
2895
3005
|
});
|
|
2896
3006
|
});
|
|
2897
3007
|
MainOverlay.displayName = MAIN_OVERLAY_NAME;
|
|
2898
|
-
var MainSidebar = /* @__PURE__ */
|
|
3008
|
+
var MainSidebar = /* @__PURE__ */ forwardRef20(({ classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props }, forwardedRef) => {
|
|
2899
3009
|
const [isLg] = useMediaQuery("lg");
|
|
2900
3010
|
const { tx } = useThemeContext();
|
|
2901
3011
|
const { t } = useTranslation(osTranslations3);
|
|
2902
3012
|
const ref = useForwardedRef(forwardedRef);
|
|
2903
|
-
const noopRef =
|
|
3013
|
+
const noopRef = useRef4(null);
|
|
2904
3014
|
useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
|
|
2905
3015
|
onDismiss: () => onStateChange?.("closed")
|
|
2906
3016
|
});
|
|
2907
|
-
const handleKeyDown =
|
|
3017
|
+
const handleKeyDown = useCallback9((event) => {
|
|
2908
3018
|
const focusGroupParent = event.target.closest("[data-tabster]");
|
|
2909
3019
|
if (event.key === "Escape" && focusGroupParent) {
|
|
2910
3020
|
event.preventDefault();
|
|
@@ -2915,14 +3025,14 @@ var MainSidebar = /* @__PURE__ */ forwardRef22(({ classNames, children, swipeToD
|
|
|
2915
3025
|
}, [
|
|
2916
3026
|
props.onKeyDown
|
|
2917
3027
|
]);
|
|
2918
|
-
const
|
|
2919
|
-
return /* @__PURE__ */
|
|
3028
|
+
const Root14 = isLg ? Primitive17.div : DialogContent2;
|
|
3029
|
+
return /* @__PURE__ */ React32.createElement(DialogRoot2, {
|
|
2920
3030
|
open: state !== "closed",
|
|
2921
3031
|
"aria-label": toLocalizedString(label, t),
|
|
2922
3032
|
modal: false
|
|
2923
|
-
}, !isLg && /* @__PURE__ */
|
|
3033
|
+
}, !isLg && /* @__PURE__ */ React32.createElement(DialogTitle2, {
|
|
2924
3034
|
className: "sr-only"
|
|
2925
|
-
}, toLocalizedString(label, t)), /* @__PURE__ */
|
|
3035
|
+
}, toLocalizedString(label, t)), /* @__PURE__ */ React32.createElement(Root14, {
|
|
2926
3036
|
...!isLg && {
|
|
2927
3037
|
forceMount: true,
|
|
2928
3038
|
tabIndex: -1,
|
|
@@ -2940,10 +3050,10 @@ var MainSidebar = /* @__PURE__ */ forwardRef22(({ classNames, children, swipeToD
|
|
|
2940
3050
|
ref
|
|
2941
3051
|
}, children));
|
|
2942
3052
|
});
|
|
2943
|
-
var MainNavigationSidebar = /* @__PURE__ */
|
|
3053
|
+
var MainNavigationSidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2944
3054
|
const { navigationSidebarState, setNavigationSidebarState, resizing } = useMainContext(NAVIGATION_SIDEBAR_NAME);
|
|
2945
3055
|
const mover = useLandmarkMover(props.onKeyDown, "0");
|
|
2946
|
-
return /* @__PURE__ */
|
|
3056
|
+
return /* @__PURE__ */ React32.createElement(MainSidebar, {
|
|
2947
3057
|
...mover,
|
|
2948
3058
|
...props,
|
|
2949
3059
|
state: navigationSidebarState,
|
|
@@ -2954,10 +3064,10 @@ var MainNavigationSidebar = /* @__PURE__ */ forwardRef22((props, forwardedRef) =
|
|
|
2954
3064
|
});
|
|
2955
3065
|
});
|
|
2956
3066
|
MainNavigationSidebar.displayName = NAVIGATION_SIDEBAR_NAME;
|
|
2957
|
-
var MainComplementarySidebar = /* @__PURE__ */
|
|
3067
|
+
var MainComplementarySidebar = /* @__PURE__ */ forwardRef20((props, forwardedRef) => {
|
|
2958
3068
|
const { complementarySidebarState, setComplementarySidebarState, resizing } = useMainContext(COMPLEMENTARY_SIDEBAR_NAME);
|
|
2959
3069
|
const mover = useLandmarkMover(props.onKeyDown, "2");
|
|
2960
|
-
return /* @__PURE__ */
|
|
3070
|
+
return /* @__PURE__ */ React32.createElement(MainSidebar, {
|
|
2961
3071
|
...mover,
|
|
2962
3072
|
...props,
|
|
2963
3073
|
state: complementarySidebarState,
|
|
@@ -2968,17 +3078,17 @@ var MainComplementarySidebar = /* @__PURE__ */ forwardRef22((props, forwardedRef
|
|
|
2968
3078
|
});
|
|
2969
3079
|
});
|
|
2970
3080
|
MainComplementarySidebar.displayName = COMPLEMENTARY_SIDEBAR_NAME;
|
|
2971
|
-
var MainContent = /* @__PURE__ */
|
|
3081
|
+
var MainContent = /* @__PURE__ */ forwardRef20(({ asChild, classNames, bounce, handlesFocus, children, role, ...props }, forwardedRef) => {
|
|
2972
3082
|
const { navigationSidebarState, complementarySidebarState } = useMainContext(MAIN_NAME);
|
|
2973
3083
|
const { tx } = useThemeContext();
|
|
2974
|
-
const Comp = asChild ?
|
|
3084
|
+
const Comp = asChild ? Slot17 : role ? Primitive17.div : "main";
|
|
2975
3085
|
const mover = useLandmarkMover(props.onKeyDown, "1");
|
|
2976
|
-
return /* @__PURE__ */
|
|
2977
|
-
role,
|
|
3086
|
+
return /* @__PURE__ */ React32.createElement(Comp, {
|
|
2978
3087
|
...handlesFocus && {
|
|
2979
3088
|
...mover
|
|
2980
3089
|
},
|
|
2981
3090
|
...props,
|
|
3091
|
+
role,
|
|
2982
3092
|
"data-sidebar-left-state": navigationSidebarState,
|
|
2983
3093
|
"data-sidebar-right-state": complementarySidebarState,
|
|
2984
3094
|
"data-handles-focus": handlesFocus,
|
|
@@ -2999,11 +3109,13 @@ var Main = {
|
|
|
2999
3109
|
};
|
|
3000
3110
|
|
|
3001
3111
|
// src/components/Message/Message.tsx
|
|
3002
|
-
import { createContext as
|
|
3003
|
-
import { Primitive as
|
|
3004
|
-
import { Slot as
|
|
3005
|
-
import
|
|
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";
|
|
3006
3117
|
import { useId as useId3 } from "@dxos/react-hooks";
|
|
3118
|
+
import { translationKey as translationKey2 } from "#translations";
|
|
3007
3119
|
var messageIcons = {
|
|
3008
3120
|
success: "ph--check-circle--duotone",
|
|
3009
3121
|
info: "ph--info--duotone",
|
|
@@ -3012,18 +3124,18 @@ var messageIcons = {
|
|
|
3012
3124
|
neutral: "ph--info--duotone"
|
|
3013
3125
|
};
|
|
3014
3126
|
var MESSAGE_NAME = "Message";
|
|
3015
|
-
var [MessageProvider, useMessageContext] =
|
|
3016
|
-
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) => {
|
|
3017
3129
|
const { tx } = useThemeContext();
|
|
3018
3130
|
const titleId = useId3("message__title", propsTitleId);
|
|
3019
3131
|
const descriptionId = useId3("message__description", propsDescriptionId);
|
|
3020
3132
|
const elevation = useElevationContext(propsElevation);
|
|
3021
|
-
const Comp = asChild ?
|
|
3022
|
-
return /* @__PURE__ */
|
|
3133
|
+
const Comp = asChild ? Slot18 : Primitive18.div;
|
|
3134
|
+
return /* @__PURE__ */ React33.createElement(MessageProvider, {
|
|
3023
3135
|
titleId,
|
|
3024
3136
|
descriptionId,
|
|
3025
3137
|
valence
|
|
3026
|
-
}, /* @__PURE__ */
|
|
3138
|
+
}, /* @__PURE__ */ React33.createElement(Comp, {
|
|
3027
3139
|
role: valence === "neutral" ? "paragraph" : "alert",
|
|
3028
3140
|
...props,
|
|
3029
3141
|
className: tx("message.root", {
|
|
@@ -3037,33 +3149,38 @@ var MessageRoot = /* @__PURE__ */ forwardRef23(({ asChild, valence = "neutral",
|
|
|
3037
3149
|
});
|
|
3038
3150
|
MessageRoot.displayName = MESSAGE_NAME;
|
|
3039
3151
|
var MESSAGE_TITLE_NAME = "MessageTitle";
|
|
3040
|
-
var MessageTitle = /* @__PURE__ */
|
|
3152
|
+
var MessageTitle = /* @__PURE__ */ forwardRef21(({ classNames, children, icon: iconProp, onClose }, forwardedRef) => {
|
|
3153
|
+
const { t } = useTranslation4(translationKey2);
|
|
3041
3154
|
const { tx } = useThemeContext();
|
|
3042
3155
|
const { titleId, valence } = useMessageContext(MESSAGE_TITLE_NAME);
|
|
3043
|
-
const Comp = asChild ? Slot14 : Primitive14.h2;
|
|
3044
3156
|
const icon = iconProp ?? messageIcons[valence];
|
|
3045
|
-
return /* @__PURE__ */
|
|
3046
|
-
...props,
|
|
3157
|
+
return /* @__PURE__ */ React33.createElement("div", {
|
|
3047
3158
|
className: tx("message.header", {}, classNames),
|
|
3048
3159
|
id: titleId,
|
|
3049
3160
|
ref: forwardedRef
|
|
3050
|
-
},
|
|
3051
|
-
|
|
3052
|
-
icon,
|
|
3053
|
-
classNames: tx("message.icon", {
|
|
3161
|
+
}, icon && /* @__PURE__ */ React33.createElement("div", {
|
|
3162
|
+
className: tx("message.icon", {
|
|
3054
3163
|
valence
|
|
3055
3164
|
})
|
|
3056
|
-
}
|
|
3165
|
+
}, /* @__PURE__ */ React33.createElement(Icon, {
|
|
3166
|
+
icon
|
|
3167
|
+
})), /* @__PURE__ */ React33.createElement("h2", {
|
|
3057
3168
|
className: tx("message.title", {}, classNames)
|
|
3058
|
-
}, 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
|
+
}));
|
|
3059
3176
|
});
|
|
3060
3177
|
MessageTitle.displayName = MESSAGE_TITLE_NAME;
|
|
3061
3178
|
var MESSAGE_CONTENT_NAME = "MessageContent";
|
|
3062
|
-
var MessageContent = /* @__PURE__ */
|
|
3179
|
+
var MessageContent = /* @__PURE__ */ forwardRef21(({ asChild, classNames, children, ...props }, forwardedRef) => {
|
|
3063
3180
|
const { tx } = useThemeContext();
|
|
3064
3181
|
const { descriptionId } = useMessageContext(MESSAGE_CONTENT_NAME);
|
|
3065
|
-
const Comp = asChild ?
|
|
3066
|
-
return /* @__PURE__ */
|
|
3182
|
+
const Comp = asChild ? Slot18 : Primitive18.p;
|
|
3183
|
+
return /* @__PURE__ */ React33.createElement(Comp, {
|
|
3067
3184
|
...props,
|
|
3068
3185
|
className: tx("message.content", {}, classNames),
|
|
3069
3186
|
id: descriptionId,
|
|
@@ -3080,7 +3197,7 @@ var Callout = Message;
|
|
|
3080
3197
|
|
|
3081
3198
|
// src/components/Popover/Popover.tsx
|
|
3082
3199
|
import { composeEventHandlers as composeEventHandlers2 } from "@radix-ui/primitive";
|
|
3083
|
-
import { useComposedRefs } from "@radix-ui/react-compose-refs";
|
|
3200
|
+
import { useComposedRefs as useComposedRefs2 } from "@radix-ui/react-compose-refs";
|
|
3084
3201
|
import { createContextScope as createContextScope3 } from "@radix-ui/react-context";
|
|
3085
3202
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
3086
3203
|
import { useFocusGuards } from "@radix-ui/react-focus-guards";
|
|
@@ -3090,11 +3207,11 @@ import * as PopperPrimitive from "@radix-ui/react-popper";
|
|
|
3090
3207
|
import { createPopperScope } from "@radix-ui/react-popper";
|
|
3091
3208
|
import { Portal as PortalPrimitive } from "@radix-ui/react-portal";
|
|
3092
3209
|
import { Presence } from "@radix-ui/react-presence";
|
|
3093
|
-
import { Primitive as
|
|
3094
|
-
import { Slot as
|
|
3210
|
+
import { Primitive as Primitive19 } from "@radix-ui/react-primitive";
|
|
3211
|
+
import { Slot as Slot19 } from "@radix-ui/react-slot";
|
|
3095
3212
|
import { useControllableState as useControllableState5 } from "@radix-ui/react-use-controllable-state";
|
|
3096
3213
|
import { hideOthers } from "aria-hidden";
|
|
3097
|
-
import
|
|
3214
|
+
import React34, { forwardRef as forwardRef22, useCallback as useCallback10, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef5, useState as useState9 } from "react";
|
|
3098
3215
|
import { RemoveScroll } from "react-remove-scroll";
|
|
3099
3216
|
var POPOVER_NAME = "Popover";
|
|
3100
3217
|
var [createPopoverContext, createPopoverScope] = createContextScope3(POPOVER_NAME, [
|
|
@@ -3105,31 +3222,31 @@ var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
|
3105
3222
|
var PopoverRoot = (props) => {
|
|
3106
3223
|
const { __scopePopover, children, open: openProp, defaultOpen, onOpenChange, modal = false } = props;
|
|
3107
3224
|
const popperScope = usePopperScope(__scopePopover);
|
|
3108
|
-
const triggerRef =
|
|
3109
|
-
const [hasCustomAnchor, setHasCustomAnchor] =
|
|
3225
|
+
const triggerRef = useRef5(null);
|
|
3226
|
+
const [hasCustomAnchor, setHasCustomAnchor] = useState9(false);
|
|
3110
3227
|
const [open = false, setOpen] = useControllableState5({
|
|
3111
3228
|
prop: openProp,
|
|
3112
3229
|
defaultProp: defaultOpen,
|
|
3113
3230
|
onChange: onOpenChange
|
|
3114
3231
|
});
|
|
3115
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ React34.createElement(PopperPrimitive.Root, popperScope, /* @__PURE__ */ React34.createElement(PopoverProvider, {
|
|
3116
3233
|
scope: __scopePopover,
|
|
3117
3234
|
contentId: useId4(),
|
|
3118
3235
|
triggerRef,
|
|
3119
3236
|
open,
|
|
3120
3237
|
onOpenChange: setOpen,
|
|
3121
|
-
onOpenToggle:
|
|
3238
|
+
onOpenToggle: useCallback10(() => setOpen((prevOpen) => !prevOpen), [
|
|
3122
3239
|
setOpen
|
|
3123
3240
|
]),
|
|
3124
3241
|
hasCustomAnchor,
|
|
3125
|
-
onCustomAnchorAdd:
|
|
3126
|
-
onCustomAnchorRemove:
|
|
3242
|
+
onCustomAnchorAdd: useCallback10(() => setHasCustomAnchor(true), []),
|
|
3243
|
+
onCustomAnchorRemove: useCallback10(() => setHasCustomAnchor(false), []),
|
|
3127
3244
|
modal
|
|
3128
3245
|
}, children));
|
|
3129
3246
|
};
|
|
3130
3247
|
PopoverRoot.displayName = POPOVER_NAME;
|
|
3131
3248
|
var ANCHOR_NAME = "PopoverAnchor";
|
|
3132
|
-
var PopoverAnchor = /* @__PURE__ */
|
|
3249
|
+
var PopoverAnchor = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3133
3250
|
const { __scopePopover, ...anchorProps } = props;
|
|
3134
3251
|
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
3135
3252
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -3141,7 +3258,7 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3141
3258
|
onCustomAnchorAdd,
|
|
3142
3259
|
onCustomAnchorRemove
|
|
3143
3260
|
]);
|
|
3144
|
-
return /* @__PURE__ */
|
|
3261
|
+
return /* @__PURE__ */ React34.createElement(PopperPrimitive.Anchor, {
|
|
3145
3262
|
...popperScope,
|
|
3146
3263
|
...anchorProps,
|
|
3147
3264
|
ref: forwardedRef
|
|
@@ -3149,13 +3266,13 @@ var PopoverAnchor = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3149
3266
|
});
|
|
3150
3267
|
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
3151
3268
|
var TRIGGER_NAME2 = "PopoverTrigger";
|
|
3152
|
-
var PopoverTrigger = /* @__PURE__ */
|
|
3269
|
+
var PopoverTrigger = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3153
3270
|
const { __scopePopover, asChild, ...triggerProps } = props;
|
|
3154
3271
|
const context = usePopoverContext(TRIGGER_NAME2, __scopePopover);
|
|
3155
3272
|
const popperScope = usePopperScope(__scopePopover);
|
|
3156
|
-
const composedTriggerRef =
|
|
3157
|
-
const Comp = asChild ?
|
|
3158
|
-
const trigger = /* @__PURE__ */
|
|
3273
|
+
const composedTriggerRef = useComposedRefs2(forwardedRef, context.triggerRef);
|
|
3274
|
+
const Comp = asChild ? Slot19 : Primitive19.button;
|
|
3275
|
+
const trigger = /* @__PURE__ */ React34.createElement(Comp, {
|
|
3159
3276
|
type: "button",
|
|
3160
3277
|
"aria-haspopup": "dialog",
|
|
3161
3278
|
"aria-expanded": context.open,
|
|
@@ -3165,7 +3282,7 @@ var PopoverTrigger = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3165
3282
|
ref: composedTriggerRef,
|
|
3166
3283
|
onClick: composeEventHandlers2(props.onClick, context.onOpenToggle)
|
|
3167
3284
|
});
|
|
3168
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */
|
|
3285
|
+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ React34.createElement(PopperPrimitive.Anchor, {
|
|
3169
3286
|
asChild: true,
|
|
3170
3287
|
...popperScope
|
|
3171
3288
|
}, trigger);
|
|
@@ -3181,7 +3298,7 @@ var PopoverVirtualTrigger = (props) => {
|
|
|
3181
3298
|
context.triggerRef.current = virtualRef.current;
|
|
3182
3299
|
}
|
|
3183
3300
|
});
|
|
3184
|
-
return /* @__PURE__ */
|
|
3301
|
+
return /* @__PURE__ */ React34.createElement(PopperPrimitive.Anchor, {
|
|
3185
3302
|
...popperScope,
|
|
3186
3303
|
virtualRef
|
|
3187
3304
|
});
|
|
@@ -3194,48 +3311,48 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME2, {
|
|
|
3194
3311
|
var PopoverPortal = (props) => {
|
|
3195
3312
|
const { __scopePopover, forceMount, children, container } = props;
|
|
3196
3313
|
const context = usePopoverContext(PORTAL_NAME2, __scopePopover);
|
|
3197
|
-
return /* @__PURE__ */
|
|
3314
|
+
return /* @__PURE__ */ React34.createElement(PortalProvider, {
|
|
3198
3315
|
scope: __scopePopover,
|
|
3199
3316
|
forceMount
|
|
3200
|
-
}, /* @__PURE__ */
|
|
3317
|
+
}, /* @__PURE__ */ React34.createElement(Presence, {
|
|
3201
3318
|
present: forceMount || context.open
|
|
3202
|
-
}, /* @__PURE__ */
|
|
3319
|
+
}, /* @__PURE__ */ React34.createElement(PortalPrimitive, {
|
|
3203
3320
|
asChild: true,
|
|
3204
3321
|
container
|
|
3205
3322
|
}, children)));
|
|
3206
3323
|
};
|
|
3207
3324
|
PopoverPortal.displayName = PORTAL_NAME2;
|
|
3208
3325
|
var CONTENT_NAME2 = "PopoverContent";
|
|
3209
|
-
var PopoverContent = /* @__PURE__ */
|
|
3326
|
+
var PopoverContent = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3210
3327
|
const portalContext = usePortalContext(CONTENT_NAME2, props.__scopePopover);
|
|
3211
3328
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
3212
3329
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3213
|
-
return /* @__PURE__ */
|
|
3330
|
+
return /* @__PURE__ */ React34.createElement(Presence, {
|
|
3214
3331
|
present: forceMount || context.open
|
|
3215
|
-
}, context.modal ? /* @__PURE__ */
|
|
3332
|
+
}, context.modal ? /* @__PURE__ */ React34.createElement(PopoverContentModal, {
|
|
3216
3333
|
...contentProps,
|
|
3217
3334
|
ref: forwardedRef
|
|
3218
|
-
}) : /* @__PURE__ */
|
|
3335
|
+
}) : /* @__PURE__ */ React34.createElement(PopoverContentNonModal, {
|
|
3219
3336
|
...contentProps,
|
|
3220
3337
|
ref: forwardedRef
|
|
3221
3338
|
}));
|
|
3222
3339
|
});
|
|
3223
3340
|
PopoverContent.displayName = CONTENT_NAME2;
|
|
3224
|
-
var PopoverContentModal = /* @__PURE__ */
|
|
3341
|
+
var PopoverContentModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3225
3342
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3226
|
-
const contentRef =
|
|
3227
|
-
const composedRefs =
|
|
3228
|
-
const isRightClickOutsideRef =
|
|
3343
|
+
const contentRef = useRef5(null);
|
|
3344
|
+
const composedRefs = useComposedRefs2(forwardedRef, contentRef);
|
|
3345
|
+
const isRightClickOutsideRef = useRef5(false);
|
|
3229
3346
|
useEffect6(() => {
|
|
3230
3347
|
const content = contentRef.current;
|
|
3231
3348
|
if (content) {
|
|
3232
3349
|
return hideOthers(content);
|
|
3233
3350
|
}
|
|
3234
3351
|
}, []);
|
|
3235
|
-
return /* @__PURE__ */
|
|
3236
|
-
as:
|
|
3352
|
+
return /* @__PURE__ */ React34.createElement(RemoveScroll, {
|
|
3353
|
+
as: Slot19,
|
|
3237
3354
|
allowPinchZoom: true
|
|
3238
|
-
}, /* @__PURE__ */
|
|
3355
|
+
}, /* @__PURE__ */ React34.createElement(PopoverContentImpl, {
|
|
3239
3356
|
...props,
|
|
3240
3357
|
ref: composedRefs,
|
|
3241
3358
|
// Make sure we're not trapping once it's been closed (closed !== unmounted when animating out).
|
|
@@ -3262,11 +3379,11 @@ var PopoverContentModal = /* @__PURE__ */ forwardRef24((props, forwardedRef) =>
|
|
|
3262
3379
|
})
|
|
3263
3380
|
}));
|
|
3264
3381
|
});
|
|
3265
|
-
var PopoverContentNonModal = /* @__PURE__ */
|
|
3382
|
+
var PopoverContentNonModal = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3266
3383
|
const context = usePopoverContext(CONTENT_NAME2, props.__scopePopover);
|
|
3267
|
-
const hasInteractedOutsideRef =
|
|
3268
|
-
const hasPointerDownOutsideRef =
|
|
3269
|
-
return /* @__PURE__ */
|
|
3384
|
+
const hasInteractedOutsideRef = useRef5(false);
|
|
3385
|
+
const hasPointerDownOutsideRef = useRef5(false);
|
|
3386
|
+
return /* @__PURE__ */ React34.createElement(PopoverContentImpl, {
|
|
3270
3387
|
...props,
|
|
3271
3388
|
ref: forwardedRef,
|
|
3272
3389
|
trapFocus: false,
|
|
@@ -3301,7 +3418,7 @@ var PopoverContentNonModal = /* @__PURE__ */ forwardRef24((props, forwardedRef)
|
|
|
3301
3418
|
}
|
|
3302
3419
|
});
|
|
3303
3420
|
});
|
|
3304
|
-
var PopoverContentImpl = /* @__PURE__ */
|
|
3421
|
+
var PopoverContentImpl = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3305
3422
|
const { __scopePopover, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, collisionPadding = 8, collisionBoundary, classNames, ...contentProps } = props;
|
|
3306
3423
|
const context = usePopoverContext(CONTENT_NAME2, __scopePopover);
|
|
3307
3424
|
const popperScope = usePopperScope(__scopePopover);
|
|
@@ -3309,7 +3426,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3309
3426
|
const elevation = useElevationContext();
|
|
3310
3427
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3311
3428
|
useFocusGuards();
|
|
3312
|
-
const computedCollisionBoundary =
|
|
3429
|
+
const computedCollisionBoundary = useMemo6(() => {
|
|
3313
3430
|
const closestBoundary = context.triggerRef.current?.closest("[data-popover-collision-boundary]");
|
|
3314
3431
|
return closestBoundary ? Array.isArray(collisionBoundary) ? [
|
|
3315
3432
|
closestBoundary,
|
|
@@ -3325,13 +3442,13 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3325
3442
|
collisionBoundary,
|
|
3326
3443
|
context.triggerRef.current
|
|
3327
3444
|
]);
|
|
3328
|
-
return /* @__PURE__ */
|
|
3445
|
+
return /* @__PURE__ */ React34.createElement(FocusScope, {
|
|
3329
3446
|
asChild: true,
|
|
3330
3447
|
loop: true,
|
|
3331
3448
|
trapped: trapFocus,
|
|
3332
3449
|
onMountAutoFocus: onOpenAutoFocus,
|
|
3333
3450
|
onUnmountAutoFocus: onCloseAutoFocus
|
|
3334
|
-
}, /* @__PURE__ */
|
|
3451
|
+
}, /* @__PURE__ */ React34.createElement(DismissableLayer, {
|
|
3335
3452
|
asChild: true,
|
|
3336
3453
|
disableOutsidePointerEvents,
|
|
3337
3454
|
onInteractOutside,
|
|
@@ -3339,7 +3456,7 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3339
3456
|
onPointerDownOutside,
|
|
3340
3457
|
onFocusOutside,
|
|
3341
3458
|
onDismiss: () => context.onOpenChange(false)
|
|
3342
|
-
}, /* @__PURE__ */
|
|
3459
|
+
}, /* @__PURE__ */ React34.createElement(PopperPrimitive.Content, {
|
|
3343
3460
|
"data-state": getState(context.open),
|
|
3344
3461
|
role: "dialog",
|
|
3345
3462
|
id: context.contentId,
|
|
@@ -3365,10 +3482,10 @@ var PopoverContentImpl = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3365
3482
|
})));
|
|
3366
3483
|
});
|
|
3367
3484
|
var CLOSE_NAME = "PopoverClose";
|
|
3368
|
-
var PopoverClose = /* @__PURE__ */
|
|
3485
|
+
var PopoverClose = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3369
3486
|
const { __scopePopover, ...closeProps } = props;
|
|
3370
3487
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
3371
|
-
return /* @__PURE__ */
|
|
3488
|
+
return /* @__PURE__ */ React34.createElement(Primitive19.button, {
|
|
3372
3489
|
type: "button",
|
|
3373
3490
|
...closeProps,
|
|
3374
3491
|
ref: forwardedRef,
|
|
@@ -3377,11 +3494,11 @@ var PopoverClose = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3377
3494
|
});
|
|
3378
3495
|
PopoverClose.displayName = CLOSE_NAME;
|
|
3379
3496
|
var ARROW_NAME2 = "PopoverArrow";
|
|
3380
|
-
var PopoverArrow = /* @__PURE__ */
|
|
3497
|
+
var PopoverArrow = /* @__PURE__ */ forwardRef22((props, forwardedRef) => {
|
|
3381
3498
|
const { __scopePopover, classNames, ...arrowProps } = props;
|
|
3382
3499
|
const popperScope = usePopperScope(__scopePopover);
|
|
3383
3500
|
const { tx } = useThemeContext();
|
|
3384
|
-
return /* @__PURE__ */
|
|
3501
|
+
return /* @__PURE__ */ React34.createElement(PopperPrimitive.Arrow, {
|
|
3385
3502
|
...popperScope,
|
|
3386
3503
|
...arrowProps,
|
|
3387
3504
|
className: tx("popover.arrow", {}, classNames),
|
|
@@ -3389,10 +3506,10 @@ var PopoverArrow = /* @__PURE__ */ forwardRef24((props, forwardedRef) => {
|
|
|
3389
3506
|
});
|
|
3390
3507
|
});
|
|
3391
3508
|
PopoverArrow.displayName = ARROW_NAME2;
|
|
3392
|
-
var PopoverViewport = /* @__PURE__ */
|
|
3509
|
+
var PopoverViewport = /* @__PURE__ */ forwardRef22(({ classNames, asChild, constrainInline = true, constrainBlock = true, children, ...props }, forwardedRef) => {
|
|
3393
3510
|
const { tx } = useThemeContext();
|
|
3394
|
-
const Comp = asChild ?
|
|
3395
|
-
return /* @__PURE__ */
|
|
3511
|
+
const Comp = asChild ? Slot19 : Primitive19.div;
|
|
3512
|
+
return /* @__PURE__ */ React34.createElement(Comp, {
|
|
3396
3513
|
...props,
|
|
3397
3514
|
className: tx("popover.viewport", {
|
|
3398
3515
|
constrainInline,
|
|
@@ -3415,10 +3532,10 @@ var Popover = {
|
|
|
3415
3532
|
};
|
|
3416
3533
|
|
|
3417
3534
|
// src/components/Status/Status.tsx
|
|
3418
|
-
import
|
|
3419
|
-
var Status = /* @__PURE__ */
|
|
3535
|
+
import React35, { forwardRef as forwardRef23 } from "react";
|
|
3536
|
+
var Status = /* @__PURE__ */ forwardRef23(({ classNames, children, progress = 0, indeterminate, variant, ...props }, forwardedRef) => {
|
|
3420
3537
|
const { tx } = useThemeContext();
|
|
3421
|
-
return /* @__PURE__ */
|
|
3538
|
+
return /* @__PURE__ */ React35.createElement("span", {
|
|
3422
3539
|
role: "status",
|
|
3423
3540
|
...props,
|
|
3424
3541
|
className: tx("status.root", {
|
|
@@ -3426,7 +3543,7 @@ var Status = /* @__PURE__ */ forwardRef25(({ classNames, children, progress = 0,
|
|
|
3426
3543
|
variant
|
|
3427
3544
|
}, classNames),
|
|
3428
3545
|
ref: forwardedRef
|
|
3429
|
-
}, /* @__PURE__ */
|
|
3546
|
+
}, /* @__PURE__ */ React35.createElement("span", {
|
|
3430
3547
|
role: "none",
|
|
3431
3548
|
className: tx("status.bar", {
|
|
3432
3549
|
indeterminate,
|
|
@@ -3441,41 +3558,56 @@ var Status = /* @__PURE__ */ forwardRef25(({ classNames, children, progress = 0,
|
|
|
3441
3558
|
});
|
|
3442
3559
|
|
|
3443
3560
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
3444
|
-
import { createContext as
|
|
3445
|
-
import { Primitive as
|
|
3446
|
-
import { Slot as
|
|
3447
|
-
import
|
|
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";
|
|
3448
3566
|
var SCROLLAREA_NAME = "ScrollArea";
|
|
3449
|
-
var [ScrollAreaProvider, useScrollAreaContext] =
|
|
3567
|
+
var [ScrollAreaProvider, useScrollAreaContext] = createContext10(SCROLLAREA_NAME);
|
|
3450
3568
|
var SCROLLAREA_ROOT_NAME = "ScrollArea.Root";
|
|
3451
|
-
var ScrollAreaRoot =
|
|
3569
|
+
var ScrollAreaRoot = slottable9(({ children, asChild, orientation = "vertical", autoHide = true, centered = false, padding = false, thin = false, snap = false, ...props }, forwardedRef) => {
|
|
3452
3570
|
const { tx } = useThemeContext();
|
|
3453
|
-
const
|
|
3454
|
-
const
|
|
3571
|
+
const { className, ...rest } = composableProps12(props);
|
|
3572
|
+
const Comp = asChild ? Slot20 : Primitive20.div;
|
|
3573
|
+
const options = useMemo7(() => ({
|
|
3455
3574
|
orientation,
|
|
3456
3575
|
autoHide,
|
|
3457
|
-
|
|
3576
|
+
centered,
|
|
3458
3577
|
padding,
|
|
3459
3578
|
thin,
|
|
3460
3579
|
snap
|
|
3461
|
-
}
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3580
|
+
}), [
|
|
3581
|
+
orientation,
|
|
3582
|
+
autoHide,
|
|
3583
|
+
centered,
|
|
3584
|
+
padding,
|
|
3585
|
+
thin,
|
|
3586
|
+
snap
|
|
3587
|
+
]);
|
|
3588
|
+
return /* @__PURE__ */ React36.createElement(ScrollAreaProvider, options, /* @__PURE__ */ React36.createElement(Comp, {
|
|
3589
|
+
...rest,
|
|
3590
|
+
className: tx("scrollArea.root", options, className),
|
|
3468
3591
|
ref: forwardedRef
|
|
3469
3592
|
}, children));
|
|
3470
3593
|
});
|
|
3471
3594
|
ScrollAreaRoot.displayName = SCROLLAREA_ROOT_NAME;
|
|
3472
3595
|
var SCROLLAREA_VIEWPORT_NAME = "ScrollArea.Viewport";
|
|
3473
|
-
var ScrollAreaViewport =
|
|
3596
|
+
var ScrollAreaViewport = slottable9(({ children, asChild, ...props }, forwardedRef) => {
|
|
3474
3597
|
const { tx } = useThemeContext();
|
|
3475
3598
|
const options = useScrollAreaContext(SCROLLAREA_VIEWPORT_NAME);
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
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),
|
|
3479
3611
|
ref: forwardedRef
|
|
3480
3612
|
}, children);
|
|
3481
3613
|
});
|
|
@@ -3486,180 +3618,221 @@ var ScrollArea = {
|
|
|
3486
3618
|
};
|
|
3487
3619
|
|
|
3488
3620
|
// src/components/ScrollContainer/ScrollContainer.tsx
|
|
3489
|
-
import { createContext as
|
|
3490
|
-
import
|
|
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";
|
|
3491
3623
|
import { addEventListener as addEventListener2, combine } from "@dxos/async";
|
|
3492
3624
|
import { invariant } from "@dxos/invariant";
|
|
3493
|
-
import {
|
|
3625
|
+
import { useMergeRefs } from "@dxos/react-hooks";
|
|
3626
|
+
import { composable as composable6, composableProps as composableProps13, slottable as slottable10 } from "@dxos/ui-theme";
|
|
3494
3627
|
import { mx as mx9 } from "@dxos/ui-theme";
|
|
3495
3628
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/ui/react-ui/src/components/ScrollContainer/ScrollContainer.tsx";
|
|
3496
3629
|
var isBottom = (el) => {
|
|
3497
3630
|
return !!(el && el.scrollHeight - el.scrollTop === el.clientHeight);
|
|
3498
3631
|
};
|
|
3499
|
-
var [ScrollContainerProvider, useScrollContainerContext] =
|
|
3500
|
-
var
|
|
3501
|
-
const scrollerRef =
|
|
3502
|
-
const autoScrollRef =
|
|
3503
|
-
const [
|
|
3504
|
-
const [
|
|
3505
|
-
const timeoutRef =
|
|
3506
|
-
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) => {
|
|
3507
3640
|
if (scrollerRef.current) {
|
|
3508
|
-
autoScrollRef.current = true;
|
|
3509
|
-
scrollerRef.current.classList.add("scrollbar-none");
|
|
3510
|
-
scrollerRef.current.scrollTo({
|
|
3511
|
-
top: scrollerRef.current.scrollHeight,
|
|
3512
|
-
behavior
|
|
3513
|
-
});
|
|
3514
|
-
clearTimeout(timeoutRef.current);
|
|
3515
3641
|
if (behavior !== "instant") {
|
|
3642
|
+
autoScrollRef.current = true;
|
|
3643
|
+
scrollerRef.current.classList.add("scrollbar-none");
|
|
3644
|
+
clearTimeout(timeoutRef.current);
|
|
3516
3645
|
timeoutRef.current = setTimeout(() => {
|
|
3517
3646
|
scrollerRef.current?.classList.remove("scrollbar-none");
|
|
3518
3647
|
autoScrollRef.current = false;
|
|
3519
3648
|
}, 500);
|
|
3520
3649
|
}
|
|
3650
|
+
scrollerRef.current.scrollTo({
|
|
3651
|
+
top: scrollerRef.current.scrollHeight,
|
|
3652
|
+
behavior
|
|
3653
|
+
});
|
|
3521
3654
|
setPinned(true);
|
|
3522
3655
|
}
|
|
3523
|
-
}, [
|
|
3524
|
-
|
|
3525
|
-
|
|
3656
|
+
}, [
|
|
3657
|
+
behaviorProp
|
|
3658
|
+
]);
|
|
3659
|
+
const controller = useMemo8(() => ({
|
|
3660
|
+
get viewport() {
|
|
3661
|
+
return scrollerRef.current;
|
|
3662
|
+
},
|
|
3526
3663
|
scrollToTop: () => {
|
|
3527
|
-
invariant(scrollerRef.current, void 0, {
|
|
3528
|
-
F: __dxlog_file2,
|
|
3529
|
-
L: 95,
|
|
3530
|
-
S: void 0,
|
|
3531
|
-
A: [
|
|
3532
|
-
"scrollerRef.current",
|
|
3533
|
-
""
|
|
3534
|
-
]
|
|
3535
|
-
});
|
|
3664
|
+
invariant(scrollerRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: void 0, A: ["scrollerRef.current", ""] });
|
|
3536
3665
|
scrollerRef.current.scrollTo({
|
|
3537
3666
|
top: 0,
|
|
3538
3667
|
behavior: "smooth"
|
|
3539
3668
|
});
|
|
3540
3669
|
setPinned(false);
|
|
3541
3670
|
},
|
|
3542
|
-
scrollToBottom: () => {
|
|
3543
|
-
scrollToBottom(
|
|
3671
|
+
scrollToBottom: (behavior = "smooth") => {
|
|
3672
|
+
scrollToBottom(behavior);
|
|
3544
3673
|
}
|
|
3545
3674
|
}), [
|
|
3546
|
-
scrollToBottom
|
|
3547
|
-
scrollerRef.current
|
|
3675
|
+
scrollToBottom
|
|
3548
3676
|
]);
|
|
3549
3677
|
useImperativeHandle(forwardedRef, () => controller, [
|
|
3550
3678
|
controller
|
|
3551
3679
|
]);
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
return;
|
|
3555
|
-
}
|
|
3556
|
-
return combine(
|
|
3557
|
-
// Check if user scrolls.
|
|
3558
|
-
addEventListener2(scrollerRef.current, "wheel", () => {
|
|
3559
|
-
setPinned(isBottom(scrollerRef.current));
|
|
3560
|
-
}),
|
|
3561
|
-
// Check if scrolls.
|
|
3562
|
-
addEventListener2(scrollerRef.current, "scroll", () => {
|
|
3563
|
-
setOverflow((scrollerRef.current?.scrollTop ?? 0) > 0);
|
|
3564
|
-
})
|
|
3565
|
-
);
|
|
3680
|
+
const setViewport = useCallback11((el) => {
|
|
3681
|
+
scrollerRef.current = el;
|
|
3566
3682
|
}, []);
|
|
3567
|
-
return /* @__PURE__ */
|
|
3683
|
+
return /* @__PURE__ */ React37.createElement(ScrollContainerProvider, {
|
|
3568
3684
|
pinned,
|
|
3685
|
+
overflow,
|
|
3569
3686
|
controller,
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
},
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
},
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
});
|
|
3589
|
-
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";
|
|
3590
3705
|
var VIEWPORT_NAME = "ScrollContainer.Viewport";
|
|
3591
|
-
var Viewport =
|
|
3592
|
-
const
|
|
3593
|
-
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);
|
|
3594
3713
|
useEffect7(() => {
|
|
3595
|
-
|
|
3714
|
+
const el = scrollerRef.current;
|
|
3715
|
+
if (!el) {
|
|
3596
3716
|
return;
|
|
3597
3717
|
}
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
resizeObserver.observe(contentRef.current);
|
|
3601
|
-
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));
|
|
3602
3720
|
}, [
|
|
3603
|
-
|
|
3604
|
-
|
|
3721
|
+
setViewport,
|
|
3722
|
+
setPinned,
|
|
3723
|
+
setOverflow
|
|
3605
3724
|
]);
|
|
3606
|
-
return /* @__PURE__ */
|
|
3607
|
-
|
|
3608
|
-
...props,
|
|
3609
|
-
ref:
|
|
3610
|
-
}, 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
|
+
}));
|
|
3611
3732
|
});
|
|
3612
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;
|
|
3613
3785
|
var SCROLL_DOWN_BUTTON_NAME = "ScrollContainer.ScrollDownButton";
|
|
3614
3786
|
var ScrollDownButton = ({ classNames }) => {
|
|
3615
|
-
const { pinned,
|
|
3616
|
-
return /* @__PURE__ */
|
|
3617
|
-
role: "none",
|
|
3787
|
+
const { pinned, controller } = useScrollContainerContext(SCROLL_DOWN_BUTTON_NAME);
|
|
3788
|
+
return /* @__PURE__ */ React37.createElement("div", {
|
|
3618
3789
|
className: mx9("absolute bottom-2 right-4 opacity-100 transition-opacity duration-300", pinned && "opacity-0", classNames)
|
|
3619
|
-
}, /* @__PURE__ */
|
|
3790
|
+
}, /* @__PURE__ */ React37.createElement(IconButton, {
|
|
3620
3791
|
variant: "primary",
|
|
3621
3792
|
icon: "ph--arrow-down--regular",
|
|
3622
3793
|
iconOnly: true,
|
|
3623
3794
|
size: 4,
|
|
3624
3795
|
label: "Scroll down",
|
|
3625
|
-
onClick: () => scrollToBottom()
|
|
3796
|
+
onClick: () => controller?.scrollToBottom()
|
|
3626
3797
|
}));
|
|
3627
3798
|
};
|
|
3628
3799
|
ScrollDownButton.displayName = SCROLL_DOWN_BUTTON_NAME;
|
|
3629
3800
|
var ScrollContainer = {
|
|
3630
|
-
Root:
|
|
3801
|
+
Root: Root10,
|
|
3802
|
+
Content: Content6,
|
|
3631
3803
|
Viewport,
|
|
3804
|
+
Fade,
|
|
3632
3805
|
ScrollDownButton
|
|
3633
3806
|
};
|
|
3634
3807
|
|
|
3635
3808
|
// src/components/Select/Select.tsx
|
|
3636
3809
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
3637
|
-
import
|
|
3810
|
+
import React38, { forwardRef as forwardRef25 } from "react";
|
|
3638
3811
|
var SelectRoot = SelectPrimitive.Root;
|
|
3639
3812
|
var SelectTrigger = SelectPrimitive.Trigger;
|
|
3640
3813
|
var SelectValue = SelectPrimitive.Value;
|
|
3641
3814
|
var SelectIcon = SelectPrimitive.Icon;
|
|
3642
3815
|
var SelectPortal = SelectPrimitive.Portal;
|
|
3643
|
-
var SelectTriggerButton = /* @__PURE__ */
|
|
3644
|
-
return /* @__PURE__ */
|
|
3816
|
+
var SelectTriggerButton = /* @__PURE__ */ forwardRef25(({ children, placeholder, ...props }, forwardedRef) => {
|
|
3817
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Trigger, {
|
|
3645
3818
|
asChild: true,
|
|
3646
3819
|
ref: forwardedRef
|
|
3647
|
-
}, /* @__PURE__ */
|
|
3820
|
+
}, /* @__PURE__ */ React38.createElement(Button, props, /* @__PURE__ */ React38.createElement(SelectPrimitive.Value, {
|
|
3648
3821
|
placeholder
|
|
3649
|
-
}, children), /* @__PURE__ */
|
|
3822
|
+
}, children), /* @__PURE__ */ React38.createElement("span", {
|
|
3650
3823
|
className: "w-1 flex-1"
|
|
3651
|
-
}), /* @__PURE__ */
|
|
3824
|
+
}), /* @__PURE__ */ React38.createElement(SelectPrimitive.Icon, {
|
|
3652
3825
|
asChild: true
|
|
3653
|
-
}, /* @__PURE__ */
|
|
3826
|
+
}, /* @__PURE__ */ React38.createElement(Icon, {
|
|
3654
3827
|
size: 3,
|
|
3655
3828
|
icon: "ph--caret-down--bold"
|
|
3656
3829
|
}))));
|
|
3657
3830
|
});
|
|
3658
|
-
var SelectContent = /* @__PURE__ */
|
|
3831
|
+
var SelectContent = /* @__PURE__ */ forwardRef25(({ classNames, children, collisionPadding = 8, ...props }, forwardedRef) => {
|
|
3659
3832
|
const { tx } = useThemeContext();
|
|
3660
3833
|
const elevation = useElevationContext();
|
|
3661
3834
|
const safeCollisionPadding = useSafeCollisionPadding(collisionPadding);
|
|
3662
|
-
return /* @__PURE__ */
|
|
3835
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Content, {
|
|
3663
3836
|
...props,
|
|
3664
3837
|
"data-arrow-keys": "up down",
|
|
3665
3838
|
collisionPadding: safeCollisionPadding,
|
|
@@ -3670,78 +3843,78 @@ var SelectContent = /* @__PURE__ */ forwardRef28(({ classNames, children, collis
|
|
|
3670
3843
|
ref: forwardedRef
|
|
3671
3844
|
}, children);
|
|
3672
3845
|
});
|
|
3673
|
-
var SelectScrollUpButton2 = /* @__PURE__ */
|
|
3846
|
+
var SelectScrollUpButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3674
3847
|
const { tx } = useThemeContext();
|
|
3675
|
-
return /* @__PURE__ */
|
|
3848
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectScrollUpButton, {
|
|
3676
3849
|
...props,
|
|
3677
3850
|
className: tx("select.scrollButton", {}, classNames),
|
|
3678
3851
|
ref: forwardedRef
|
|
3679
|
-
}, children ?? /* @__PURE__ */
|
|
3852
|
+
}, children ?? /* @__PURE__ */ React38.createElement(Icon, {
|
|
3680
3853
|
size: 3,
|
|
3681
3854
|
icon: "ph--caret-up--bold"
|
|
3682
3855
|
}));
|
|
3683
3856
|
});
|
|
3684
|
-
var SelectScrollDownButton2 = /* @__PURE__ */
|
|
3857
|
+
var SelectScrollDownButton2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3685
3858
|
const { tx } = useThemeContext();
|
|
3686
|
-
return /* @__PURE__ */
|
|
3859
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectScrollDownButton, {
|
|
3687
3860
|
...props,
|
|
3688
3861
|
className: tx("select.scrollButton", {}, classNames),
|
|
3689
3862
|
ref: forwardedRef
|
|
3690
|
-
}, children ?? /* @__PURE__ */
|
|
3863
|
+
}, children ?? /* @__PURE__ */ React38.createElement(Icon, {
|
|
3691
3864
|
size: 3,
|
|
3692
3865
|
icon: "ph--caret-down--bold"
|
|
3693
3866
|
}));
|
|
3694
3867
|
});
|
|
3695
|
-
var SelectViewport2 = /* @__PURE__ */
|
|
3868
|
+
var SelectViewport2 = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3696
3869
|
const { tx } = useThemeContext();
|
|
3697
|
-
return /* @__PURE__ */
|
|
3870
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.SelectViewport, {
|
|
3698
3871
|
...props,
|
|
3699
3872
|
className: tx("select.viewport", {}, classNames),
|
|
3700
3873
|
ref: forwardedRef
|
|
3701
3874
|
}, children);
|
|
3702
3875
|
});
|
|
3703
|
-
var SelectItem = /* @__PURE__ */
|
|
3876
|
+
var SelectItem = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3704
3877
|
const { tx } = useThemeContext();
|
|
3705
|
-
return /* @__PURE__ */
|
|
3878
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Item, {
|
|
3706
3879
|
...props,
|
|
3707
3880
|
className: tx("select.item", {}, classNames),
|
|
3708
3881
|
ref: forwardedRef
|
|
3709
3882
|
});
|
|
3710
3883
|
});
|
|
3711
3884
|
var SelectItemText = SelectPrimitive.ItemText;
|
|
3712
|
-
var SelectItemIndicator = /* @__PURE__ */
|
|
3885
|
+
var SelectItemIndicator = /* @__PURE__ */ forwardRef25(({ classNames, children, ...props }, forwardedRef) => {
|
|
3713
3886
|
const { tx } = useThemeContext();
|
|
3714
|
-
return /* @__PURE__ */
|
|
3887
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.ItemIndicator, {
|
|
3715
3888
|
...props,
|
|
3716
3889
|
className: tx("select.itemIndicator", {}, classNames),
|
|
3717
3890
|
ref: forwardedRef
|
|
3718
3891
|
}, children);
|
|
3719
3892
|
});
|
|
3720
|
-
var SelectOption = /* @__PURE__ */
|
|
3893
|
+
var SelectOption = /* @__PURE__ */ forwardRef25(({ children, classNames, ...props }, forwardedRef) => {
|
|
3721
3894
|
const { tx } = useThemeContext();
|
|
3722
|
-
return /* @__PURE__ */
|
|
3895
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Item, {
|
|
3723
3896
|
...props,
|
|
3724
3897
|
className: tx("select.item", {}, classNames),
|
|
3725
3898
|
ref: forwardedRef
|
|
3726
|
-
}, /* @__PURE__ */
|
|
3899
|
+
}, /* @__PURE__ */ React38.createElement(SelectPrimitive.ItemText, null, children), /* @__PURE__ */ React38.createElement("span", {
|
|
3727
3900
|
className: "grow w-1"
|
|
3728
|
-
}), /* @__PURE__ */
|
|
3901
|
+
}), /* @__PURE__ */ React38.createElement(Icon, {
|
|
3729
3902
|
icon: "ph--check--regular"
|
|
3730
3903
|
}));
|
|
3731
3904
|
});
|
|
3732
3905
|
var SelectGroup = SelectPrimitive.Group;
|
|
3733
3906
|
var SelectLabel = SelectPrimitive.Label;
|
|
3734
|
-
var SelectSeparator = /* @__PURE__ */
|
|
3907
|
+
var SelectSeparator = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3735
3908
|
const { tx } = useThemeContext();
|
|
3736
|
-
return /* @__PURE__ */
|
|
3909
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Separator, {
|
|
3737
3910
|
...props,
|
|
3738
3911
|
className: tx("select.separator", {}, classNames),
|
|
3739
3912
|
ref: forwardedRef
|
|
3740
3913
|
});
|
|
3741
3914
|
});
|
|
3742
|
-
var SelectArrow = /* @__PURE__ */
|
|
3915
|
+
var SelectArrow = /* @__PURE__ */ forwardRef25(({ classNames, ...props }, forwardedRef) => {
|
|
3743
3916
|
const { tx } = useThemeContext();
|
|
3744
|
-
return /* @__PURE__ */
|
|
3917
|
+
return /* @__PURE__ */ React38.createElement(SelectPrimitive.Arrow, {
|
|
3745
3918
|
...props,
|
|
3746
3919
|
className: tx("select.arrow", {}, classNames),
|
|
3747
3920
|
ref: forwardedRef
|
|
@@ -3769,10 +3942,10 @@ var Select = {
|
|
|
3769
3942
|
};
|
|
3770
3943
|
|
|
3771
3944
|
// src/components/Skeleton/Skeleton.tsx
|
|
3772
|
-
import
|
|
3773
|
-
var Skeleton = /* @__PURE__ */
|
|
3945
|
+
import React39, { forwardRef as forwardRef26 } from "react";
|
|
3946
|
+
var Skeleton = /* @__PURE__ */ forwardRef26(({ classNames, variant = "default", ...props }, forwardedRef) => {
|
|
3774
3947
|
const { tx } = useThemeContext();
|
|
3775
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
3776
3949
|
...props,
|
|
3777
3950
|
className: tx("skeleton.root", {
|
|
3778
3951
|
variant
|
|
@@ -3783,50 +3956,47 @@ var Skeleton = /* @__PURE__ */ forwardRef29(({ classNames, variant = "default",
|
|
|
3783
3956
|
|
|
3784
3957
|
// src/components/Splitter/Splitter.tsx
|
|
3785
3958
|
import { createContextScope as createContextScope4 } from "@radix-ui/react-context";
|
|
3786
|
-
import { Primitive as
|
|
3787
|
-
import { Slot as
|
|
3788
|
-
import
|
|
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";
|
|
3789
3963
|
var SPLITTER_NAME = "Splitter";
|
|
3790
3964
|
var [createSplitterContext, createSplitterScope] = createContextScope4(SPLITTER_NAME);
|
|
3791
3965
|
var [SplitterProvider, useSplitterContext] = createSplitterContext(SPLITTER_NAME);
|
|
3792
3966
|
var ROOT_NAME = "Splitter.Root";
|
|
3793
|
-
var
|
|
3967
|
+
var Root12 = slottable11(({ asChild, mode = "top", ratio = 0.5, transition = 250, children, ...props }, forwardedRef) => {
|
|
3794
3968
|
const { tx } = useThemeContext();
|
|
3795
|
-
const
|
|
3796
|
-
|
|
3969
|
+
const { __scopeSplitter, ...rest } = props;
|
|
3970
|
+
const { className, ...restProps } = composableProps14(rest);
|
|
3971
|
+
const Comp = asChild ? Slot21 : Primitive21.div;
|
|
3972
|
+
return /* @__PURE__ */ React40.createElement(SplitterProvider, {
|
|
3797
3973
|
scope: __scopeSplitter,
|
|
3798
3974
|
mode,
|
|
3799
3975
|
ratio,
|
|
3800
3976
|
transition
|
|
3801
|
-
}, /* @__PURE__ */
|
|
3802
|
-
|
|
3803
|
-
...rootProps,
|
|
3977
|
+
}, /* @__PURE__ */ React40.createElement(Comp, {
|
|
3978
|
+
...restProps,
|
|
3804
3979
|
ref: forwardedRef,
|
|
3805
|
-
className: tx("splitter.root", {},
|
|
3806
|
-
className,
|
|
3807
|
-
classNames
|
|
3808
|
-
])
|
|
3980
|
+
className: tx("splitter.root", {}, className)
|
|
3809
3981
|
}, children));
|
|
3810
3982
|
});
|
|
3811
|
-
|
|
3983
|
+
Root12.displayName = ROOT_NAME;
|
|
3812
3984
|
var PANEL_NAME = "Splitter.Panel";
|
|
3813
|
-
var Panel2 =
|
|
3814
|
-
const {
|
|
3815
|
-
const {
|
|
3816
|
-
const Comp = asChild ?
|
|
3817
|
-
const
|
|
3818
|
-
const
|
|
3819
|
-
const
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3985
|
+
var Panel2 = slottable11(({ classNames, asChild, children, position, style, ...props }, forwardedRef) => {
|
|
3986
|
+
const { tx } = useThemeContext();
|
|
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}%`;
|
|
3994
|
+
return /* @__PURE__ */ React40.createElement(Comp, {
|
|
3995
|
+
...restProps,
|
|
3823
3996
|
ref: forwardedRef,
|
|
3824
|
-
className: tx("splitter.panel", {},
|
|
3825
|
-
className,
|
|
3826
|
-
classNames
|
|
3827
|
-
]),
|
|
3997
|
+
className: tx("splitter.panel", {}, className),
|
|
3828
3998
|
style: {
|
|
3829
|
-
top,
|
|
3999
|
+
top: topOffset,
|
|
3830
4000
|
height,
|
|
3831
4001
|
transition: `top ${transition}ms, height ${transition}ms ease-out`,
|
|
3832
4002
|
...style
|
|
@@ -3835,18 +4005,18 @@ var Panel2 = /* @__PURE__ */ forwardRef30(({ __scopeSplitter, classNames, classN
|
|
|
3835
4005
|
});
|
|
3836
4006
|
Panel2.displayName = PANEL_NAME;
|
|
3837
4007
|
var Splitter = {
|
|
3838
|
-
Root:
|
|
4008
|
+
Root: Root12,
|
|
3839
4009
|
Panel: Panel2
|
|
3840
4010
|
};
|
|
3841
4011
|
|
|
3842
4012
|
// src/components/Tag/Tag.tsx
|
|
3843
|
-
import { Primitive as
|
|
3844
|
-
import { Slot as
|
|
3845
|
-
import
|
|
3846
|
-
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) => {
|
|
3847
4017
|
const { tx } = useThemeContext();
|
|
3848
|
-
const Comp = asChild ?
|
|
3849
|
-
return /* @__PURE__ */
|
|
4018
|
+
const Comp = asChild ? Slot22 : Primitive22.span;
|
|
4019
|
+
return /* @__PURE__ */ React41.createElement(Comp, {
|
|
3850
4020
|
...props,
|
|
3851
4021
|
className: tx("tag.root", {
|
|
3852
4022
|
palette
|
|
@@ -3857,66 +4027,67 @@ var Tag = /* @__PURE__ */ forwardRef31(({ asChild, palette = "neutral", classNam
|
|
|
3857
4027
|
});
|
|
3858
4028
|
|
|
3859
4029
|
// src/components/Toast/Toast.tsx
|
|
3860
|
-
import { Primitive as
|
|
3861
|
-
import { Slot as
|
|
3862
|
-
import
|
|
3863
|
-
import
|
|
3864
|
-
var ToastProvider =
|
|
3865
|
-
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) => {
|
|
3866
4036
|
const { tx } = useThemeContext();
|
|
3867
|
-
return /* @__PURE__ */
|
|
4037
|
+
return /* @__PURE__ */ React42.createElement(ToastPrimitive.Viewport, {
|
|
4038
|
+
...props,
|
|
3868
4039
|
className: tx("toast.viewport", {}, classNames),
|
|
3869
4040
|
ref: forwardedRef
|
|
3870
4041
|
});
|
|
3871
4042
|
});
|
|
3872
|
-
var ToastRoot = /* @__PURE__ */
|
|
4043
|
+
var ToastRoot = /* @__PURE__ */ forwardRef28(({ classNames, children, ...props }, forwardedRef) => {
|
|
3873
4044
|
const { tx } = useThemeContext();
|
|
3874
|
-
return /* @__PURE__ */
|
|
4045
|
+
return /* @__PURE__ */ React42.createElement(ToastPrimitive.Root, {
|
|
3875
4046
|
...props,
|
|
3876
4047
|
className: tx("toast.root", {}, classNames),
|
|
3877
4048
|
ref: forwardedRef
|
|
3878
|
-
}, /* @__PURE__ */
|
|
4049
|
+
}, /* @__PURE__ */ React42.createElement(ElevationProvider, {
|
|
3879
4050
|
elevation: "toast"
|
|
3880
4051
|
}, children));
|
|
3881
4052
|
});
|
|
3882
|
-
var ToastBody = /* @__PURE__ */
|
|
4053
|
+
var ToastBody = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3883
4054
|
const { tx } = useThemeContext();
|
|
3884
|
-
const Comp = asChild ?
|
|
3885
|
-
return /* @__PURE__ */
|
|
4055
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4056
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3886
4057
|
...props,
|
|
3887
4058
|
className: tx("toast.body", {}, classNames),
|
|
3888
4059
|
ref: forwardedRef
|
|
3889
4060
|
});
|
|
3890
4061
|
});
|
|
3891
|
-
var ToastTitle = /* @__PURE__ */
|
|
4062
|
+
var ToastTitle = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3892
4063
|
const { tx } = useThemeContext();
|
|
3893
|
-
const Comp = asChild ?
|
|
3894
|
-
return /* @__PURE__ */
|
|
4064
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Title;
|
|
4065
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3895
4066
|
...props,
|
|
3896
4067
|
className: tx("toast.title", {}, classNames),
|
|
3897
4068
|
ref: forwardedRef
|
|
3898
4069
|
});
|
|
3899
4070
|
});
|
|
3900
|
-
var ToastDescription = /* @__PURE__ */
|
|
4071
|
+
var ToastDescription = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3901
4072
|
const { tx } = useThemeContext();
|
|
3902
|
-
const Comp = asChild ?
|
|
3903
|
-
return /* @__PURE__ */
|
|
4073
|
+
const Comp = asChild ? Slot23 : ToastPrimitive.Description;
|
|
4074
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3904
4075
|
...props,
|
|
3905
4076
|
className: tx("toast.description", {}, classNames),
|
|
3906
4077
|
ref: forwardedRef
|
|
3907
4078
|
});
|
|
3908
4079
|
});
|
|
3909
|
-
var ToastActions = /* @__PURE__ */
|
|
4080
|
+
var ToastActions = /* @__PURE__ */ forwardRef28(({ asChild, classNames, ...props }, forwardedRef) => {
|
|
3910
4081
|
const { tx } = useThemeContext();
|
|
3911
|
-
const Comp = asChild ?
|
|
3912
|
-
return /* @__PURE__ */
|
|
4082
|
+
const Comp = asChild ? Slot23 : Primitive23.div;
|
|
4083
|
+
return /* @__PURE__ */ React42.createElement(Comp, {
|
|
3913
4084
|
...props,
|
|
3914
4085
|
className: tx("toast.actions", {}, classNames),
|
|
3915
4086
|
ref: forwardedRef
|
|
3916
4087
|
});
|
|
3917
4088
|
});
|
|
3918
|
-
var ToastAction =
|
|
3919
|
-
var ToastClose =
|
|
4089
|
+
var ToastAction = ToastPrimitive.Action;
|
|
4090
|
+
var ToastClose = ToastPrimitive.Close;
|
|
3920
4091
|
var Toast = {
|
|
3921
4092
|
Provider: ToastProvider,
|
|
3922
4093
|
Viewport: ToastViewport,
|
|
@@ -3939,6 +4110,7 @@ export {
|
|
|
3939
4110
|
Card,
|
|
3940
4111
|
Clipboard,
|
|
3941
4112
|
Column,
|
|
4113
|
+
Container,
|
|
3942
4114
|
ContextMenu2 as ContextMenu,
|
|
3943
4115
|
DensityContext,
|
|
3944
4116
|
DensityProvider,
|
|
@@ -3950,6 +4122,7 @@ export {
|
|
|
3950
4122
|
ErrorFallback,
|
|
3951
4123
|
ErrorStack,
|
|
3952
4124
|
Flex,
|
|
4125
|
+
Focus,
|
|
3953
4126
|
Grid,
|
|
3954
4127
|
Icon,
|
|
3955
4128
|
IconButton,
|
|
@@ -3971,6 +4144,8 @@ export {
|
|
|
3971
4144
|
Skeleton,
|
|
3972
4145
|
Splitter,
|
|
3973
4146
|
Status,
|
|
4147
|
+
TREEGRID_PARENT_OF_SEPARATOR,
|
|
4148
|
+
TREEGRID_PATH_SEPARATOR,
|
|
3974
4149
|
Tag,
|
|
3975
4150
|
ThemeContext,
|
|
3976
4151
|
ThemeProvider,
|
|
@@ -3980,7 +4155,7 @@ export {
|
|
|
3980
4155
|
ToggleGroup,
|
|
3981
4156
|
ToggleGroupIconItem,
|
|
3982
4157
|
ToggleGroupItem,
|
|
3983
|
-
|
|
4158
|
+
Toolbar,
|
|
3984
4159
|
Tooltip,
|
|
3985
4160
|
Trans,
|
|
3986
4161
|
Tree,
|
|
@@ -3994,6 +4169,7 @@ export {
|
|
|
3994
4169
|
initialSafeArea,
|
|
3995
4170
|
isLabel,
|
|
3996
4171
|
messageIcons,
|
|
4172
|
+
parseCaptureOwnerStack,
|
|
3997
4173
|
toLocalizedString,
|
|
3998
4174
|
useAvatarContext,
|
|
3999
4175
|
useButtonGroupContext,
|
|
@@ -4002,6 +4178,7 @@ export {
|
|
|
4002
4178
|
useDropdownMenuContext,
|
|
4003
4179
|
useDropdownMenuMenuScope,
|
|
4004
4180
|
useElevationContext,
|
|
4181
|
+
useFocus,
|
|
4005
4182
|
useIconHref,
|
|
4006
4183
|
useLandmarkMover,
|
|
4007
4184
|
useListContext,
|
|
@@ -4009,6 +4186,7 @@ export {
|
|
|
4009
4186
|
useMainContext,
|
|
4010
4187
|
usePx,
|
|
4011
4188
|
useSafeArea,
|
|
4189
|
+
useSafeCollisionPadding,
|
|
4012
4190
|
useScrollContainerContext,
|
|
4013
4191
|
useSidebars,
|
|
4014
4192
|
useThemeContext,
|