@dxos/react-ui 0.8.4-main.c85a9c8dae → 0.8.4-main.cb12b3f963
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 +1203 -1020
- 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 -14
- 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 +1203 -1020
- 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 -14
- 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 +70 -64
- 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 +3 -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 +12 -12
- package/src/components/Card/Card.tsx +283 -128
- package/src/components/Clipboard/CopyButton.tsx +3 -4
- 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 +5 -1
- 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 +2 -3
- package/src/components/List/List.tsx +6 -5
- package/src/components/List/Tree.stories.tsx +1 -2
- 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 +93 -30
- package/src/components/ScrollArea/ScrollArea.tsx +41 -25
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +20 -18
- package/src/components/ScrollContainer/ScrollContainer.tsx +200 -91
- 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 +6 -7
- 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 +66 -68
- package/src/exemplars/tabster.stories.tsx +1 -1
- package/src/exemplars/virtualizer.stories.tsx +4 -4
- 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 +6 -6
- 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
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import React, { type CSSProperties
|
|
7
|
+
import React, { type CSSProperties } from 'react';
|
|
8
8
|
|
|
9
|
+
import { composableProps, slottable } from '@dxos/ui-theme';
|
|
9
10
|
import { type SlottableProps } from '@dxos/ui-types';
|
|
10
11
|
|
|
11
12
|
import { useThemeContext } from '../../hooks';
|
|
@@ -16,53 +17,61 @@ import { useThemeContext } from '../../hooks';
|
|
|
16
17
|
|
|
17
18
|
const COLUMN_ROOT_NAME = 'Column.Root';
|
|
18
19
|
|
|
19
|
-
type GutterSize = '
|
|
20
|
+
type GutterSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
20
21
|
|
|
21
22
|
const gutterSizes: Record<GutterSize, string> = {
|
|
23
|
+
xs: 'var(--dx-gutter-xs)',
|
|
22
24
|
sm: 'var(--dx-gutter-sm)',
|
|
23
25
|
md: 'var(--dx-gutter-md)',
|
|
24
26
|
lg: 'var(--dx-gutter-lg)',
|
|
25
|
-
rail: 'var(--dx-rail-item)',
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
type ColumnRootProps =
|
|
29
|
+
type ColumnRootProps = { gutter?: GutterSize };
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
|
-
* Creates a
|
|
32
|
-
*
|
|
33
|
-
* Use `gutter='rail'` for icon-slot row layouts (Card); `gutter='md'` for whitespace layouts (Dialog).
|
|
34
|
-
* Direct children must use Column.Row (spans all 3 cols) or Column.Segment (center col only).
|
|
32
|
+
* Creates a 3-column CSS grid with left/right gutter columns and a center content column.
|
|
33
|
+
* Sets `--gutter` and `--dx-col` CSS variables for nested components.
|
|
35
34
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* `--dx-col` defaults to `2 / span 1` (center column),
|
|
36
|
+
* enabling `withColumn` utilities to cascade the correct grid placement to slotted children.
|
|
37
|
+
*
|
|
38
|
+
* Direct children participate in the grid in one of several ways:
|
|
39
|
+
* - **Column.Center** — places element in the center column (col 2). Preferred for plain content.
|
|
40
|
+
* - **Column.Bleed** — spans all 3 columns gutter-to-gutter. Preferred for `ScrollArea` and
|
|
41
|
+
* other content that should ignore the gutters.
|
|
42
|
+
* - **Column.Row** — 3-col subgrid row (icons in gutters, content in center).
|
|
43
|
+
*
|
|
44
|
+
* Use `withColumn.center()` / `withColumn.bleed()` helpers to apply placement on slotted elements.
|
|
45
|
+
*
|
|
46
|
+
* Gutter sizes: `'sm'` for compact layouts (Dialog); `'md'` (default); `'lg'` for wider spacing.
|
|
40
47
|
*/
|
|
41
|
-
const
|
|
42
|
-
({
|
|
48
|
+
const ColumnRoot = slottable<HTMLDivElement, ColumnRootProps>(
|
|
49
|
+
({ children, asChild, role, gutter = 'md', ...props }, forwardedRef) => {
|
|
50
|
+
const { className, ...rest } = composableProps(props);
|
|
51
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
43
52
|
const { tx } = useThemeContext();
|
|
44
|
-
const Component = asChild ? Slot : Primitive.div;
|
|
45
53
|
const gutterSize = gutterSizes[gutter];
|
|
46
54
|
return (
|
|
47
|
-
<
|
|
48
|
-
{...
|
|
55
|
+
<Comp
|
|
56
|
+
{...rest}
|
|
49
57
|
role={role ?? 'none'}
|
|
50
58
|
style={
|
|
51
59
|
{
|
|
52
60
|
'--gutter': gutterSize,
|
|
61
|
+
'--dx-col': '2 / span 1',
|
|
53
62
|
gridTemplateColumns: [gutterSize, 'minmax(0,1fr)', gutterSize].join(' '),
|
|
54
63
|
} as CSSProperties
|
|
55
64
|
}
|
|
56
|
-
className={tx('column.root', { gutter },
|
|
65
|
+
className={tx('column.root', { gutter }, className)}
|
|
57
66
|
ref={forwardedRef}
|
|
58
67
|
>
|
|
59
68
|
{children}
|
|
60
|
-
</
|
|
69
|
+
</Comp>
|
|
61
70
|
);
|
|
62
71
|
},
|
|
63
72
|
);
|
|
64
73
|
|
|
65
|
-
|
|
74
|
+
ColumnRoot.displayName = COLUMN_ROOT_NAME;
|
|
66
75
|
|
|
67
76
|
//
|
|
68
77
|
// Row
|
|
@@ -70,87 +79,87 @@ Root.displayName = COLUMN_ROOT_NAME;
|
|
|
70
79
|
|
|
71
80
|
const COLUMN_ROW_NAME = 'Column.Row';
|
|
72
81
|
|
|
73
|
-
type ColumnRowProps =
|
|
82
|
+
type ColumnRowProps = {};
|
|
74
83
|
|
|
75
84
|
/**
|
|
76
85
|
* Spans all 3 columns of the parent Column.Root and uses CSS subgrid to inherit their sizing.
|
|
77
86
|
* Children map to: [col-1: icon/slot] [col-2: content] [col-3: icon/action].
|
|
78
87
|
* Must be a direct child of Column.Root.
|
|
79
88
|
*/
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
</Component>
|
|
93
|
-
);
|
|
94
|
-
},
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
Row.displayName = COLUMN_ROW_NAME;
|
|
89
|
+
const ColumnRow = slottable<HTMLDivElement, ColumnRowProps>(({ children, asChild, role, ...props }, forwardedRef) => {
|
|
90
|
+
const { className, ...rest } = composableProps(props);
|
|
91
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
92
|
+
const { tx } = useThemeContext();
|
|
93
|
+
return (
|
|
94
|
+
<Comp {...rest} role={role ?? 'none'} className={tx('column.row', {}, className)} ref={forwardedRef}>
|
|
95
|
+
{children}
|
|
96
|
+
</Comp>
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
ColumnRow.displayName = COLUMN_ROW_NAME;
|
|
98
101
|
|
|
99
102
|
//
|
|
100
|
-
//
|
|
103
|
+
// Bleed
|
|
101
104
|
//
|
|
102
105
|
|
|
103
|
-
const
|
|
106
|
+
const COLUMN_BLEED_NAME = 'Column.Bleed';
|
|
104
107
|
|
|
105
|
-
type
|
|
108
|
+
type ColumnBleedProps = SlottableProps;
|
|
106
109
|
|
|
107
110
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
+
* Spans all 3 columns of the parent Column.Root (gutter-to-gutter).
|
|
112
|
+
* Establishes a CSS subgrid so that grandchildren can participate in the parent column tracks.
|
|
113
|
+
* Use for `ScrollArea`, full-width dividers, tables, or any content that should ignore the gutters.
|
|
111
114
|
*/
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
ref={forwardedRef}
|
|
125
|
-
>
|
|
126
|
-
{children}
|
|
127
|
-
</Component>
|
|
128
|
-
);
|
|
129
|
-
}
|
|
115
|
+
const ColumnBleed = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {
|
|
116
|
+
const { tx } = useThemeContext();
|
|
117
|
+
const { className, ...rest } = composableProps(props);
|
|
118
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
119
|
+
return (
|
|
120
|
+
<Comp {...rest} className={tx('column.bleed', {}, className)} ref={forwardedRef}>
|
|
121
|
+
{children}
|
|
122
|
+
</Comp>
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
ColumnBleed.displayName = COLUMN_BLEED_NAME;
|
|
130
127
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
ref={forwardedRef}
|
|
137
|
-
>
|
|
138
|
-
<div className='contents'>{children}</div>
|
|
139
|
-
</Component>
|
|
140
|
-
);
|
|
141
|
-
},
|
|
142
|
-
);
|
|
128
|
+
//
|
|
129
|
+
// Center
|
|
130
|
+
//
|
|
131
|
+
|
|
132
|
+
const COLUMN_CENTER_NAME = 'Column.Center';
|
|
143
133
|
|
|
144
|
-
|
|
134
|
+
type ColumnCenterProps = SlottableProps;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Places its element in column 2 (the center track between gutters) of the parent Column.Root.
|
|
138
|
+
* Does NOT use subgrid — placement is explicit on this element only, so it is safe to nest
|
|
139
|
+
* arbitrary compound components (including ones that render `display: contents` wrappers).
|
|
140
|
+
*/
|
|
141
|
+
const ColumnCenter = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {
|
|
142
|
+
const { tx } = useThemeContext();
|
|
143
|
+
const { className, ...rest } = composableProps(props);
|
|
144
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
145
|
+
return (
|
|
146
|
+
<Comp {...rest} className={tx('column.center', {}, className)} ref={forwardedRef}>
|
|
147
|
+
{children}
|
|
148
|
+
</Comp>
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
ColumnCenter.displayName = COLUMN_CENTER_NAME;
|
|
145
153
|
|
|
146
154
|
//
|
|
147
155
|
// Column
|
|
148
156
|
//
|
|
149
157
|
|
|
150
158
|
export const Column = {
|
|
151
|
-
Root,
|
|
152
|
-
Row,
|
|
153
|
-
|
|
159
|
+
Root: ColumnRoot,
|
|
160
|
+
Row: ColumnRow,
|
|
161
|
+
Bleed: ColumnBleed,
|
|
162
|
+
Center: ColumnCenter,
|
|
154
163
|
};
|
|
155
164
|
|
|
156
|
-
export type { ColumnRootProps, ColumnRowProps,
|
|
165
|
+
export type { ColumnRootProps, ColumnRowProps, ColumnBleedProps, ColumnCenterProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { withLayout, withTheme } from '../../testing';
|
|
9
|
+
import { Container } from './Container';
|
|
10
|
+
|
|
11
|
+
const DefaultStory = () => (
|
|
12
|
+
<Container asChild>
|
|
13
|
+
<div className='grid place-items-center border border-red-500'>Hello</div>
|
|
14
|
+
</Container>
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const meta: Meta = {
|
|
18
|
+
title: 'ui/react-ui-core/primitives/Container',
|
|
19
|
+
component: Container,
|
|
20
|
+
render: DefaultStory,
|
|
21
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
22
|
+
parameters: { layout: 'fullscreen' },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { composableProps, mx, slottable } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
export const Container = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {
|
|
12
|
+
const { className, ...rest } = composableProps<HTMLDivElement>(props);
|
|
13
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
14
|
+
return (
|
|
15
|
+
<Comp {...rest} className={mx('dx-container', className)} ref={forwardedRef}>
|
|
16
|
+
{children}
|
|
17
|
+
</Comp>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
+
import React from 'react';
|
|
6
8
|
|
|
7
|
-
import { mx } from '@dxos/ui-theme';
|
|
8
|
-
import { type ComposableProps } from '@dxos/ui-types';
|
|
9
|
+
import { composableProps, mx, slottable } from '@dxos/ui-theme';
|
|
9
10
|
|
|
10
|
-
export type FlexProps =
|
|
11
|
-
HTMLAttributes<HTMLDivElement> & {
|
|
12
|
-
column?: boolean;
|
|
13
|
-
grow?: boolean;
|
|
14
|
-
}
|
|
15
|
-
>;
|
|
11
|
+
export type FlexProps = { column?: boolean; grow?: boolean };
|
|
16
12
|
|
|
17
|
-
export const Flex =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
13
|
+
export const Flex = slottable<HTMLDivElement, FlexProps>(
|
|
14
|
+
({ children, asChild, column, grow, ...props }, forwardedRef) => {
|
|
15
|
+
const { className, ...rest } = composableProps(props);
|
|
16
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
17
|
+
return (
|
|
18
|
+
<Comp
|
|
19
|
+
ref={forwardedRef}
|
|
20
|
+
{...rest}
|
|
21
|
+
className={mx('flex', column && 'flex-col', grow && 'flex-1 overflow-hidden', className)}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</Comp>
|
|
25
|
+
);
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -2,42 +2,29 @@
|
|
|
2
2
|
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { mx } from '@dxos/ui-theme';
|
|
8
|
-
import { type ComposableProps } from '@dxos/ui-types';
|
|
7
|
+
import { composable, composableProps, mx } from '@dxos/ui-theme';
|
|
9
8
|
|
|
10
|
-
export type GridProps =
|
|
11
|
-
HTMLAttributes<HTMLDivElement> & {
|
|
12
|
-
cols?: number;
|
|
13
|
-
rows?: number;
|
|
14
|
-
grow?: boolean;
|
|
15
|
-
}
|
|
16
|
-
>;
|
|
9
|
+
export type GridProps = { cols?: number; rows?: number; grow?: boolean };
|
|
17
10
|
|
|
18
|
-
export const Grid = (
|
|
19
|
-
children,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
className={mx('grid overflow-hidden', grow && 'dx-container', className, classNames)}
|
|
39
|
-
>
|
|
40
|
-
{children}
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
11
|
+
export const Grid = composable<HTMLDivElement, GridProps>(
|
|
12
|
+
({ children, style, role, cols, rows, grow = true, ...props }, forwardedRef) => {
|
|
13
|
+
const { className, ...rest } = composableProps(props);
|
|
14
|
+
return (
|
|
15
|
+
<div
|
|
16
|
+
ref={forwardedRef}
|
|
17
|
+
{...rest}
|
|
18
|
+
role={role ?? 'none'}
|
|
19
|
+
className={mx('grid overflow-hidden', grow && 'dx-container', className)}
|
|
20
|
+
style={{
|
|
21
|
+
gridTemplateColumns: cols ? `repeat(${cols}, 1fr)` : undefined,
|
|
22
|
+
gridTemplateRows: rows ? `repeat(${rows}, 1fr)` : undefined,
|
|
23
|
+
...style,
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
},
|
|
30
|
+
);
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { withLayout, withTheme } from '../../testing';
|
|
8
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
10
9
|
|
|
10
|
+
import { Input, ScrollArea, ScrollAreaRootProps, Toolbar } from '../../components';
|
|
11
|
+
import { withLayout, withTheme } from '../../testing';
|
|
11
12
|
import { Panel } from './Panel';
|
|
12
13
|
|
|
13
|
-
const List = () => {
|
|
14
|
+
const List = composable<HTMLDivElement, ScrollAreaRootProps>((props, forwardedRef) => {
|
|
14
15
|
return (
|
|
15
|
-
<ScrollArea.Root
|
|
16
|
+
<ScrollArea.Root centered {...composableProps(props, { role: 'list' })} ref={forwardedRef}>
|
|
16
17
|
<ScrollArea.Viewport>
|
|
17
18
|
{Array.from({ length: 100 }).map((_, i) => (
|
|
18
19
|
<div key={i} role='listitem' className='p-1 hover:bg-hover-surface'>
|
|
@@ -22,11 +23,11 @@ const List = () => {
|
|
|
22
23
|
</ScrollArea.Viewport>
|
|
23
24
|
</ScrollArea.Root>
|
|
24
25
|
);
|
|
25
|
-
};
|
|
26
|
+
});
|
|
26
27
|
|
|
27
28
|
const DefaultStory = () => {
|
|
28
29
|
return (
|
|
29
|
-
<Panel.Root className='dx-
|
|
30
|
+
<Panel.Root className='dx-document'>
|
|
30
31
|
<Panel.Toolbar asChild>
|
|
31
32
|
<Toolbar.Root classNames='gap-2'>
|
|
32
33
|
<Toolbar.IconButton icon='ph--plus--regular' variant='primary' label='Add' />
|
|
@@ -43,8 +44,8 @@ const DefaultStory = () => {
|
|
|
43
44
|
|
|
44
45
|
<Panel.Statusbar asChild>
|
|
45
46
|
<Toolbar.Root classNames='justify-between'>
|
|
46
|
-
<Toolbar.IconButton variant='ghost' icon='ph--house--regular' iconOnly label='Add'
|
|
47
|
-
<Toolbar.IconButton variant='ghost' icon='ph--alarm--regular' iconOnly label='Status'
|
|
47
|
+
<Toolbar.IconButton variant='ghost' icon='ph--house--regular' iconOnly label='Add' />
|
|
48
|
+
<Toolbar.IconButton variant='ghost' icon='ph--alarm--regular' iconOnly label='Status' />
|
|
48
49
|
</Toolbar.Root>
|
|
49
50
|
</Panel.Statusbar>
|
|
50
51
|
</Panel.Root>
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { type CSSProperties } from 'react';
|
|
8
8
|
|
|
9
|
+
import { composableProps, PanelStyleProps, slottable } from '@dxos/ui-theme';
|
|
9
10
|
import { type SlottableProps } from '@dxos/ui-types';
|
|
10
11
|
|
|
11
12
|
import { useThemeContext } from '../../hooks';
|
|
@@ -17,23 +18,24 @@ import { useThemeContext } from '../../hooks';
|
|
|
17
18
|
const GRID_TEMPLATE_ROWS = 'auto 1fr auto';
|
|
18
19
|
const GRID_TEMPLATE_AREAS = '"toolbar" "content" "statusbar"';
|
|
19
20
|
|
|
20
|
-
type PanelRootProps = SlottableProps<
|
|
21
|
+
type PanelRootProps = SlottableProps<{ style?: CSSProperties }>;
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
-
({
|
|
24
|
-
const {
|
|
23
|
+
const PanelRoot = slottable<HTMLDivElement, { style?: CSSProperties }>(
|
|
24
|
+
({ children, asChild, role, style, ...props }, forwardedRef) => {
|
|
25
|
+
const { className, ...rest } = composableProps(props);
|
|
25
26
|
const Comp = asChild ? Slot : Primitive.div;
|
|
27
|
+
const { tx } = useThemeContext();
|
|
26
28
|
return (
|
|
27
29
|
<Comp
|
|
28
|
-
|
|
30
|
+
{...rest}
|
|
29
31
|
role={role ?? 'none'}
|
|
30
|
-
{...props}
|
|
31
32
|
style={{
|
|
32
33
|
gridTemplateRows: GRID_TEMPLATE_ROWS,
|
|
33
34
|
gridTemplateAreas: GRID_TEMPLATE_AREAS,
|
|
34
|
-
...
|
|
35
|
+
...style,
|
|
35
36
|
}}
|
|
36
|
-
className={tx('panel.root', {},
|
|
37
|
+
className={tx('panel.root', {}, className)}
|
|
38
|
+
ref={forwardedRef}
|
|
37
39
|
>
|
|
38
40
|
{children}
|
|
39
41
|
</Comp>
|
|
@@ -41,97 +43,78 @@ const Root = forwardRef<HTMLDivElement, PanelRootProps>(
|
|
|
41
43
|
},
|
|
42
44
|
);
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
PanelRoot.displayName = 'Panel.Root';
|
|
45
47
|
|
|
46
48
|
//
|
|
47
49
|
// Toolbar
|
|
48
50
|
//
|
|
49
51
|
|
|
50
|
-
type
|
|
52
|
+
type PanelToolbarProps = SlottableProps & Pick<PanelStyleProps, 'size'>;
|
|
51
53
|
|
|
52
|
-
const
|
|
53
|
-
({
|
|
54
|
-
const {
|
|
54
|
+
const PanelToolbar = slottable<HTMLDivElement, Pick<PanelStyleProps, 'size'>>(
|
|
55
|
+
({ children, asChild, size, ...props }, forwardedRef) => {
|
|
56
|
+
const { className, ...rest } = composableProps(props);
|
|
55
57
|
const Comp = asChild ? Slot : Primitive.div;
|
|
58
|
+
const { tx } = useThemeContext();
|
|
56
59
|
return (
|
|
57
|
-
<Comp
|
|
58
|
-
ref={forwardedRef}
|
|
59
|
-
data-slot='toolbar'
|
|
60
|
-
{...props}
|
|
61
|
-
className={tx('panel.toolbar', {}, [className, classNames])}
|
|
62
|
-
>
|
|
60
|
+
<Comp {...rest} data-slot='toolbar' className={tx('panel.toolbar', { size }, className)} ref={forwardedRef}>
|
|
63
61
|
{children}
|
|
64
62
|
</Comp>
|
|
65
63
|
);
|
|
66
64
|
},
|
|
67
65
|
);
|
|
68
66
|
|
|
69
|
-
|
|
67
|
+
PanelToolbar.displayName = 'Panel.Toolbar';
|
|
70
68
|
|
|
71
69
|
//
|
|
72
70
|
// Content
|
|
73
71
|
//
|
|
74
72
|
|
|
75
|
-
type
|
|
73
|
+
type PanelContentProps = SlottableProps;
|
|
76
74
|
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
>
|
|
88
|
-
{children}
|
|
89
|
-
</Comp>
|
|
90
|
-
);
|
|
91
|
-
},
|
|
92
|
-
);
|
|
75
|
+
const PanelContent = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {
|
|
76
|
+
const { className, ...rest } = composableProps(props);
|
|
77
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
78
|
+
const { tx } = useThemeContext();
|
|
79
|
+
return (
|
|
80
|
+
<Comp {...rest} data-slot='content' className={tx('panel.content', {}, className)} ref={forwardedRef}>
|
|
81
|
+
{children}
|
|
82
|
+
</Comp>
|
|
83
|
+
);
|
|
84
|
+
});
|
|
93
85
|
|
|
94
|
-
|
|
86
|
+
PanelContent.displayName = 'Panel.Content';
|
|
95
87
|
|
|
96
88
|
//
|
|
97
89
|
// Statusbar
|
|
98
90
|
//
|
|
99
91
|
|
|
100
|
-
type
|
|
92
|
+
type PanelStatusbarProps = SlottableProps & Pick<PanelStyleProps, 'size'>;
|
|
101
93
|
|
|
102
|
-
const
|
|
103
|
-
({
|
|
104
|
-
const {
|
|
94
|
+
const PanelStatusbar = slottable<HTMLDivElement, Pick<PanelStyleProps, 'size'>>(
|
|
95
|
+
({ children, asChild, size, ...props }, forwardedRef) => {
|
|
96
|
+
const { className, ...rest } = composableProps(props);
|
|
105
97
|
const Comp = asChild ? Slot : Primitive.div;
|
|
98
|
+
const { tx } = useThemeContext();
|
|
106
99
|
return (
|
|
107
|
-
<Comp
|
|
108
|
-
ref={forwardedRef}
|
|
109
|
-
data-slot='statusbar'
|
|
110
|
-
{...props}
|
|
111
|
-
className={tx('panel.statusbar', {}, [className, classNames])}
|
|
112
|
-
>
|
|
100
|
+
<Comp {...rest} data-slot='statusbar' className={tx('panel.statusbar', { size }, className)} ref={forwardedRef}>
|
|
113
101
|
{children}
|
|
114
102
|
</Comp>
|
|
115
103
|
);
|
|
116
104
|
},
|
|
117
105
|
);
|
|
118
106
|
|
|
119
|
-
|
|
107
|
+
PanelStatusbar.displayName = 'Panel.Statusbar';
|
|
120
108
|
|
|
121
109
|
//
|
|
122
110
|
// Panel
|
|
123
111
|
//
|
|
124
112
|
|
|
125
113
|
export const Panel = {
|
|
126
|
-
Root,
|
|
127
|
-
Toolbar,
|
|
128
|
-
Content,
|
|
129
|
-
Statusbar,
|
|
114
|
+
Root: PanelRoot,
|
|
115
|
+
Toolbar: PanelToolbar,
|
|
116
|
+
Content: PanelContent,
|
|
117
|
+
Statusbar: PanelStatusbar,
|
|
130
118
|
};
|
|
131
119
|
|
|
132
|
-
export type {
|
|
133
|
-
PanelRootProps,
|
|
134
|
-
ToolbarProps as PanelToolbarProps,
|
|
135
|
-
ContentProps as PanelContentProps,
|
|
136
|
-
StatusbarProps as PanelStatusbarProps,
|
|
137
|
-
};
|
|
120
|
+
export type { PanelRootProps, PanelToolbarProps, PanelContentProps, PanelStatusbarProps };
|