@dxos/react-ui 0.8.4-main.fd6878d → 0.8.4-main.fffef41
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-BKNGMGOK.mjs → chunk-N5GDJTT2.mjs} +640 -306
- package/dist/lib/browser/chunk-N5GDJTT2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -1
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +57 -29
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node-esm/{chunk-D2HZS6F4.mjs → chunk-SP7VQH72.mjs} +640 -306
- package/dist/lib/node-esm/chunk-SP7VQH72.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -1
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +57 -29
- package/dist/lib/node-esm/testing/index.mjs.map +4 -4
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +5 -31
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -11
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -20
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/{Buttons → Button}/Button.d.ts +1 -1
- package/dist/types/src/components/Button/Button.d.ts.map +1 -0
- package/dist/types/src/components/Button/Button.stories.d.ts +17 -0
- package/dist/types/src/components/Button/Button.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/IconButton.d.ts +1 -2
- package/dist/types/src/components/Button/IconButton.d.ts.map +1 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts +13 -0
- package/dist/types/src/components/Button/IconButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.d.ts.map +1 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts +16 -0
- package/dist/types/src/components/Button/Toggle.stories.d.ts.map +1 -0
- package/dist/types/src/components/{Buttons → Button}/ToggleGroup.d.ts +6 -7
- package/dist/types/src/components/Button/ToggleGroup.d.ts.map +1 -0
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts +27 -0
- package/dist/types/src/components/Button/ToggleGroup.stories.d.ts.map +1 -0
- package/dist/types/src/components/Button/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Dialog/AlertDialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts +11 -0
- package/dist/types/src/components/Dialog/AlertDialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +25 -0
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +1 -0
- package/dist/types/src/components/Dialog/index.d.ts.map +1 -0
- package/dist/types/src/components/Icon/Icon.d.ts +1 -1
- package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
- package/dist/types/src/components/Icon/Icon.stories.d.ts +17 -0
- package/dist/types/src/components/Icon/Icon.stories.d.ts.map +1 -0
- package/dist/types/src/components/Input/Input.d.ts +0 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +9 -10
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts +8 -8
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/List.d.ts.map +1 -0
- package/dist/types/src/components/List/List.stories.d.ts +14 -0
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/ListDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.d.ts.map +1 -0
- package/dist/types/src/components/List/Tree.stories.d.ts +15 -0
- package/dist/types/src/components/List/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/TreeDropIndicator.d.ts.map +1 -0
- package/dist/types/src/components/{Lists → List}/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/List/Treegrid.stories.d.ts +12 -0
- package/dist/types/src/components/List/Treegrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/List/index.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +9 -18
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +6 -7
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +6 -44
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +7 -7
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +6 -41
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +7 -16
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -34
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +6 -32
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts +37 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts +18 -0
- package/dist/types/src/components/ScrollContainer/ScrollContainer.stories.d.ts.map +1 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts +2 -0
- package/dist/types/src/components/ScrollContainer/index.d.ts.map +1 -0
- package/dist/types/src/components/Select/Select.d.ts +1 -1
- package/dist/types/src/components/Select/Select.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +4 -9
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +2 -8
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +12 -12
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +6 -44
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +12 -12
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -50
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +1 -3
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +8 -61
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
- package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
- package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +5 -9
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +12 -4
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +5 -11
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +2 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
- package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/{withSurfaceVariantsLayout.d.ts → withLayoutVariants.d.ts} +2 -2
- package/dist/types/src/testing/decorators/withLayoutVariants.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts +3 -0
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/domino.d.ts +18 -0
- package/dist/types/src/util/domino.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +2 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/usePx.d.ts +8 -0
- package/dist/types/src/util/usePx.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +24 -23
- package/src/components/Avatars/Avatar.stories.tsx +17 -9
- package/src/components/Avatars/AvatarGroup.stories.tsx +8 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +16 -12
- package/src/components/{Buttons → Button}/Button.stories.tsx +5 -7
- package/src/components/{Buttons → Button}/IconButton.stories.tsx +9 -7
- package/src/components/{Buttons → Button}/IconButton.tsx +14 -13
- package/src/components/{Buttons → Button}/Toggle.stories.tsx +13 -10
- package/src/components/{Buttons → Button}/ToggleGroup.stories.tsx +8 -6
- package/src/components/{Buttons → Button}/ToggleGroup.tsx +14 -1
- package/src/components/Clipboard/CopyButton.tsx +1 -1
- package/src/components/{Dialogs → Dialog}/AlertDialog.stories.tsx +13 -11
- package/src/components/{Dialogs → Dialog}/Dialog.stories.tsx +15 -14
- package/src/components/Icon/Icon.stories.tsx +113 -0
- package/src/components/Icon/Icon.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +8 -11
- package/src/components/Input/Input.tsx +3 -3
- package/src/components/Link/Link.stories.tsx +8 -5
- package/src/components/{Lists → List}/List.stories.tsx +13 -12
- package/src/components/{Lists → List}/List.tsx +5 -2
- package/src/components/{Lists → List}/ListDropIndicator.tsx +1 -1
- package/src/components/{Lists → List}/Tree.stories.tsx +9 -7
- package/src/components/{Lists → List}/Treegrid.stories.tsx +10 -5
- package/src/components/{Lists → List}/Treegrid.tsx +57 -16
- package/src/components/Main/Main.stories.tsx +15 -8
- package/src/components/Main/Main.tsx +36 -22
- package/src/components/Menus/ContextMenu.stories.tsx +9 -7
- package/src/components/Menus/ContextMenu.tsx +1 -0
- package/src/components/Menus/DropdownMenu.stories.tsx +10 -8
- package/src/components/Menus/DropdownMenu.tsx +37 -8
- package/src/components/Message/Message.stories.tsx +9 -6
- package/src/components/Popover/Popover.stories.tsx +10 -8
- package/src/components/Popover/Popover.tsx +22 -5
- package/src/components/ScrollArea/ScrollArea.stories.tsx +10 -8
- package/src/components/ScrollContainer/ScrollContainer.stories.tsx +69 -0
- package/src/components/ScrollContainer/ScrollContainer.tsx +231 -0
- package/src/components/ScrollContainer/index.ts +5 -0
- package/src/components/Select/Select.stories.tsx +14 -12
- package/src/components/Select/Select.tsx +9 -8
- package/src/components/Status/Status.stories.tsx +7 -5
- package/src/components/Tag/Tag.stories.tsx +16 -8
- package/src/components/Toast/Toast.stories.tsx +10 -8
- package/src/components/Toolbar/Toolbar.stories.tsx +12 -11
- package/src/components/Toolbar/Toolbar.tsx +18 -6
- package/src/components/Tooltip/Tooltip.stories.tsx +14 -11
- package/src/components/Tooltip/Tooltip.tsx +2 -1
- package/src/components/index.ts +4 -3
- package/src/hooks/useSafeArea.ts +3 -2
- package/src/hooks/useVisualViewport.ts +4 -4
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +12 -8
- package/src/playground/Custom.stories.tsx +11 -22
- package/src/playground/Typography.stories.tsx +8 -6
- package/src/testing/decorators/index.ts +2 -1
- package/src/testing/decorators/withLayout.tsx +56 -0
- package/src/testing/decorators/{withSurfaceVariantsLayout.tsx → withLayoutVariants.tsx} +2 -2
- package/src/testing/decorators/withTheme.tsx +31 -0
- package/src/util/domino.ts +53 -0
- package/src/util/index.ts +2 -0
- package/src/util/usePx.ts +61 -0
- package/dist/lib/browser/chunk-BKNGMGOK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-D2HZS6F4.mjs.map +0 -7
- package/dist/types/src/components/Buttons/Button.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +0 -12
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +0 -22
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -19
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +0 -39
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +0 -1
- package/dist/types/src/components/Buttons/index.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +0 -43
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +0 -48
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialogs/index.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.d.ts.map +0 -1
- package/dist/types/src/components/Lists/List.stories.d.ts +0 -37
- package/dist/types/src/components/Lists/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/ListDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +0 -41
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/TreeDropIndicator.d.ts.map +0 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +0 -10
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +0 -1
- package/dist/types/src/components/Lists/index.d.ts.map +0 -1
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +0 -1
- package/src/testing/decorators/withTheme.ts +0 -25
- /package/dist/types/src/components/{Buttons → Button}/Toggle.d.ts +0 -0
- /package/dist/types/src/components/{Buttons → Button}/index.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/AlertDialog.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/Dialog.d.ts +0 -0
- /package/dist/types/src/components/{Dialogs → Dialog}/index.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/List.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/ListDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Tree.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/TreeDropIndicator.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/Treegrid.d.ts +0 -0
- /package/dist/types/src/components/{Lists → List}/index.d.ts +0 -0
- /package/src/components/{Buttons → Button}/Button.tsx +0 -0
- /package/src/components/{Buttons → Button}/Toggle.tsx +0 -0
- /package/src/components/{Buttons → Button}/index.ts +0 -0
- /package/src/components/{Dialogs → Dialog}/AlertDialog.tsx +0 -0
- /package/src/components/{Dialogs → Dialog}/Dialog.tsx +0 -0
- /package/src/components/{Dialogs → Dialog}/index.ts +0 -0
- /package/src/components/{Lists → List}/Tree.tsx +0 -0
- /package/src/components/{Lists → List}/TreeDropIndicator.tsx +0 -0
- /package/src/components/{Lists → List}/index.ts +0 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { IconBase, type IconProps, type IconWeight } from '@phosphor-icons/react';
|
|
6
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
|
+
import React, { type FC, type ReactElement, type SVGProps, forwardRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
12
|
+
|
|
13
|
+
import { Icon } from './Icon';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Create icon from serializable data.
|
|
17
|
+
* https://github.com/phosphor-icons/react#custom-icons
|
|
18
|
+
* https://github.com/phosphor-icons/core/tree/main/assets
|
|
19
|
+
*/
|
|
20
|
+
const createIcon = ({
|
|
21
|
+
name,
|
|
22
|
+
weights,
|
|
23
|
+
}: {
|
|
24
|
+
name: string;
|
|
25
|
+
weights: Record<string, SVGProps<SVGPathElement>[]>;
|
|
26
|
+
}): FC<IconProps> => {
|
|
27
|
+
const CustomIcon = forwardRef<SVGSVGElement, IconProps>((props, ref) => (
|
|
28
|
+
<IconBase
|
|
29
|
+
ref={ref}
|
|
30
|
+
{...props}
|
|
31
|
+
weights={
|
|
32
|
+
new Map<IconWeight, ReactElement>(
|
|
33
|
+
Object.entries(weights).map(
|
|
34
|
+
([key, paths]) =>
|
|
35
|
+
[
|
|
36
|
+
key,
|
|
37
|
+
<>
|
|
38
|
+
{paths.map((props, i) => (
|
|
39
|
+
<path key={`${key}-${i}`} {...props} />
|
|
40
|
+
))}
|
|
41
|
+
</>,
|
|
42
|
+
] as [IconWeight, ReactElement],
|
|
43
|
+
),
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
47
|
+
));
|
|
48
|
+
|
|
49
|
+
CustomIcon.displayName = name;
|
|
50
|
+
return CustomIcon;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const DefaultStory = ({ CustomIcon }: { CustomIcon: FC<IconProps> }) => {
|
|
54
|
+
return (
|
|
55
|
+
<div className='grid grid-cols-2 gap-8'>
|
|
56
|
+
<CustomIcon weight={'regular'} className={mx(getSize(16))} />
|
|
57
|
+
<Icon icon='ph--github-logo--regular' classNames={mx(getSize(16))} />
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const meta = {
|
|
63
|
+
title: 'ui/react-ui-core/Icon',
|
|
64
|
+
render: DefaultStory,
|
|
65
|
+
decorators: [withTheme],
|
|
66
|
+
parameters: {
|
|
67
|
+
layout: 'centered',
|
|
68
|
+
},
|
|
69
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
70
|
+
|
|
71
|
+
export default meta;
|
|
72
|
+
|
|
73
|
+
type Story = StoryObj<typeof meta>;
|
|
74
|
+
|
|
75
|
+
export const Default: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
CustomIcon: createIcon({
|
|
78
|
+
name: 'GithubLogo',
|
|
79
|
+
weights: {
|
|
80
|
+
// https://github.com/phosphor-icons/core/tree/main/assets
|
|
81
|
+
// <path d="M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
82
|
+
// <path d="M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
83
|
+
// <path d="M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/>
|
|
84
|
+
regular: [
|
|
85
|
+
{
|
|
86
|
+
d: 'M119.83,56A52,52,0,0,0,76,32a51.92,51.92,0,0,0-3.49,44.7A49.28,49.28,0,0,0,64,104v8a48,48,0,0,0,48,48h48a48,48,0,0,0,48-48v-8a49.28,49.28,0,0,0-8.51-27.3A51.92,51.92,0,0,0,196,32a52,52,0,0,0-43.83,24Z',
|
|
87
|
+
fill: 'none',
|
|
88
|
+
stroke: 'currentColor',
|
|
89
|
+
strokeLinecap: 'round',
|
|
90
|
+
strokeLinejoin: 'round',
|
|
91
|
+
strokeWidth: '16',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
d: 'M104,232V192a32,32,0,0,1,32-32h0a32,32,0,0,1,32,32v40',
|
|
95
|
+
fill: 'none',
|
|
96
|
+
stroke: 'currentColor',
|
|
97
|
+
strokeLinecap: 'round',
|
|
98
|
+
strokeLinejoin: 'round',
|
|
99
|
+
strokeWidth: '16',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
d: 'M104,208H72a32,32,0,0,1-32-32A32,32,0,0,0,8,144',
|
|
103
|
+
fill: 'none',
|
|
104
|
+
stroke: 'currentColor',
|
|
105
|
+
strokeLinecap: 'round',
|
|
106
|
+
strokeLinejoin: 'round',
|
|
107
|
+
strokeWidth: '16',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
}),
|
|
112
|
+
},
|
|
113
|
+
};
|
|
@@ -16,7 +16,7 @@ export type IconProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.s
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const Icon = memo(
|
|
19
|
-
forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size, ...props }, forwardedRef) => {
|
|
19
|
+
forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
|
|
20
20
|
const { tx } = useThemeContext();
|
|
21
21
|
const href = useIconHref(icon);
|
|
22
22
|
return (
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
8
|
+
import { baseSurface, modalSurface, mx, surfaceShadow } from '@dxos/react-ui-theme';
|
|
11
9
|
import { type MessageValence } from '@dxos/react-ui-types';
|
|
12
10
|
|
|
13
11
|
import { withTheme } from '../../testing';
|
|
@@ -76,10 +74,10 @@ const Wrapper = ({
|
|
|
76
74
|
const DefaultStory = (props: BaseProps) => {
|
|
77
75
|
return (
|
|
78
76
|
<div className='space-b-4'>
|
|
79
|
-
<div className={mx(baseSurface, 'p-4')}>
|
|
77
|
+
<div className={mx(baseSurface, 'p-4 rounded-md')}>
|
|
80
78
|
<Wrapper {...props} />
|
|
81
79
|
</div>
|
|
82
|
-
<div className={mx(
|
|
80
|
+
<div className={mx('bg-cardSurface', 'p-4 rounded-md', surfaceShadow({ elevation: 'positioned' }))}>
|
|
83
81
|
<Wrapper {...props} />
|
|
84
82
|
</div>
|
|
85
83
|
<div className={mx(modalSurface, 'p-4 rounded-md', surfaceShadow({ elevation: 'dialog' }))}>
|
|
@@ -89,13 +87,12 @@ const DefaultStory = (props: BaseProps) => {
|
|
|
89
87
|
);
|
|
90
88
|
};
|
|
91
89
|
|
|
92
|
-
const meta
|
|
90
|
+
const meta = {
|
|
93
91
|
title: 'ui/react-ui-core/Input',
|
|
94
|
-
component: Input.Root,
|
|
92
|
+
component: Input.Root as any,
|
|
95
93
|
render: DefaultStory,
|
|
96
94
|
decorators: [withTheme],
|
|
97
|
-
|
|
98
|
-
};
|
|
95
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
99
96
|
|
|
100
97
|
export default meta;
|
|
101
98
|
|
|
@@ -222,10 +219,10 @@ export const Checkbox: Story = {
|
|
|
222
219
|
},
|
|
223
220
|
};
|
|
224
221
|
|
|
225
|
-
export const Switch = {
|
|
222
|
+
export const Switch: Story = {
|
|
226
223
|
args: {
|
|
227
224
|
kind: 'switch',
|
|
228
225
|
label: 'This is a switch',
|
|
229
|
-
description: '
|
|
226
|
+
description: "It's either off... or on.",
|
|
230
227
|
},
|
|
231
228
|
};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type IconWeight } from '@phosphor-icons/react';
|
|
6
5
|
import { Root as CheckboxPrimitive, type CheckboxProps as CheckboxPrimitiveProps } from '@radix-ui/react-checkbox';
|
|
7
6
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
7
|
import React, { type ComponentPropsWithRef, type ForwardRefExoticComponent, forwardRef, useCallback } from 'react';
|
|
@@ -230,7 +229,9 @@ const TextArea = forwardRef<HTMLTextAreaElement, InputScopedProps<TextAreaProps>
|
|
|
230
229
|
},
|
|
231
230
|
);
|
|
232
231
|
|
|
233
|
-
type CheckboxProps = ThemedClassName<Omit<CheckboxPrimitiveProps, 'children'>> & {
|
|
232
|
+
type CheckboxProps = ThemedClassName<Omit<CheckboxPrimitiveProps, 'children'>> & {
|
|
233
|
+
size?: Size;
|
|
234
|
+
};
|
|
234
235
|
|
|
235
236
|
const Checkbox: ForwardRefExoticComponent<CheckboxProps> = forwardRef<
|
|
236
237
|
HTMLButtonElement,
|
|
@@ -243,7 +244,6 @@ const Checkbox: ForwardRefExoticComponent<CheckboxProps> = forwardRef<
|
|
|
243
244
|
defaultChecked: propsDefaultChecked,
|
|
244
245
|
onCheckedChange: propsOnCheckedChange,
|
|
245
246
|
size,
|
|
246
|
-
weight = 'bold',
|
|
247
247
|
classNames,
|
|
248
248
|
...props
|
|
249
249
|
},
|
|
@@ -2,17 +2,20 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
|
|
7
7
|
import { withTheme } from '../../testing';
|
|
8
8
|
|
|
9
9
|
import { Link } from './Link';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const meta = {
|
|
12
12
|
title: 'ui/react-ui-core/Link',
|
|
13
13
|
component: Link,
|
|
14
14
|
decorators: [withTheme],
|
|
15
|
-
|
|
16
|
-
} as any;
|
|
15
|
+
} satisfies Meta<typeof Link>;
|
|
17
16
|
|
|
18
|
-
export
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
|
|
21
|
+
export const Default: Story = { args: { children: 'Hello', href: '#' } };
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { DndContext, type DragEndEvent, type DragStartEvent } from '@dnd-kit/core';
|
|
8
6
|
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
9
7
|
import { CSS } from '@dnd-kit/utilities';
|
|
10
8
|
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
9
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
11
10
|
import React, { type ReactNode, useState } from 'react';
|
|
12
11
|
|
|
13
12
|
import {
|
|
@@ -24,12 +23,15 @@ import { Icon } from '../Icon';
|
|
|
24
23
|
|
|
25
24
|
import { List, ListItem, type ListScopedProps } from './List';
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
const meta = {
|
|
28
27
|
title: 'ui/react-ui-core/List',
|
|
29
28
|
component: List,
|
|
30
29
|
decorators: [withTheme],
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
} satisfies Meta<typeof List>;
|
|
31
|
+
|
|
32
|
+
export default meta;
|
|
33
|
+
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
33
35
|
|
|
34
36
|
const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
35
37
|
const { attributes, listeners, setNodeRef, transform } = useSortable({ id });
|
|
@@ -52,7 +54,7 @@ const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
|
52
54
|
);
|
|
53
55
|
};
|
|
54
56
|
|
|
55
|
-
export const UniformSizeDraggable = {
|
|
57
|
+
export const UniformSizeDraggable: Story = {
|
|
56
58
|
render: ({ ...args }) => {
|
|
57
59
|
const [items, setItems] = useState(
|
|
58
60
|
[...Array(12)].map((_, index) => ({
|
|
@@ -116,7 +118,7 @@ const ManySizesDraggableListItem = ({
|
|
|
116
118
|
);
|
|
117
119
|
};
|
|
118
120
|
|
|
119
|
-
export const ManySizesDraggable = {
|
|
121
|
+
export const ManySizesDraggable: Story = {
|
|
120
122
|
render: ({ ...args }) => {
|
|
121
123
|
const [items, setItems] = useState(
|
|
122
124
|
[...Array(12)].map((_, index) => ({
|
|
@@ -164,7 +166,7 @@ export const ManySizesDraggable = {
|
|
|
164
166
|
args: {},
|
|
165
167
|
};
|
|
166
168
|
|
|
167
|
-
export const Collapsible = {
|
|
169
|
+
export const Collapsible: Story = {
|
|
168
170
|
render: ({ ...args }) => {
|
|
169
171
|
const [items, _setItems] = useState(
|
|
170
172
|
[...Array(12)].map((_, index) => ({
|
|
@@ -193,11 +195,10 @@ export const Collapsible = {
|
|
|
193
195
|
},
|
|
194
196
|
args: {
|
|
195
197
|
variant: 'unordered',
|
|
196
|
-
// toggleOpenLabel: 'Open/close storybook list item', // TODO(burdon): ???
|
|
197
198
|
},
|
|
198
199
|
};
|
|
199
200
|
|
|
200
|
-
export const SelectableListbox = {
|
|
201
|
+
export const SelectableListbox: Story = {
|
|
201
202
|
render: () => {
|
|
202
203
|
const [selectedId, setSelectedId] = useState<string>();
|
|
203
204
|
const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'vertical' });
|
|
@@ -224,11 +225,11 @@ export const SelectableListbox = {
|
|
|
224
225
|
key={id}
|
|
225
226
|
tabIndex={0}
|
|
226
227
|
selected={selectedId === id}
|
|
227
|
-
classNames={mx(
|
|
228
|
+
classNames={mx(ghostHover, ghostSelected, ghostSelectedTrackingInterFromNormal)}
|
|
228
229
|
onClick={() => setSelectedId(id)}
|
|
229
230
|
onKeyUp={(event) => handleKeyUp(event, id)}
|
|
230
231
|
>
|
|
231
|
-
<ListItem.Heading classNames='
|
|
232
|
+
<ListItem.Heading classNames='flex pli-1 items-center grow truncate'>{text}</ListItem.Heading>
|
|
232
233
|
</ListItem.Root>
|
|
233
234
|
))}
|
|
234
235
|
</List>
|
|
@@ -107,7 +107,6 @@ const ListItemOpenTrigger = forwardRef<HTMLButtonElement, ListItemOpenTriggerPro
|
|
|
107
107
|
const { tx } = useThemeContext();
|
|
108
108
|
const density = useDensityContext();
|
|
109
109
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
110
|
-
const iconName = open ? 'ph--caret-down--bold' : 'ph--caret-right--bold';
|
|
111
110
|
return (
|
|
112
111
|
<ListPrimitiveItemOpenTrigger
|
|
113
112
|
{...props}
|
|
@@ -115,7 +114,11 @@ const ListItemOpenTrigger = forwardRef<HTMLButtonElement, ListItemOpenTriggerPro
|
|
|
115
114
|
ref={forwardedRef}
|
|
116
115
|
>
|
|
117
116
|
{children || (
|
|
118
|
-
<Icon
|
|
117
|
+
<Icon
|
|
118
|
+
size={3}
|
|
119
|
+
icon={open ? 'ph--caret-down--bold' : 'ph--caret-right--bold'}
|
|
120
|
+
classNames={tx('list.item.openTriggerIcon', 'list__listItem__openTrigger__icon', {})}
|
|
121
|
+
/>
|
|
119
122
|
)}
|
|
120
123
|
</ListPrimitiveItemOpenTrigger>
|
|
121
124
|
);
|
|
@@ -18,7 +18,7 @@ const orientationStyles: Record<Orientation, HTMLAttributes<HTMLElement>['classN
|
|
|
18
18
|
horizontal:
|
|
19
19
|
'h-[--line-thickness] left-[calc(var(--line-inset)+var(--terminal-radius))] right-[--line-inset] before:left-[--terminal-inset]',
|
|
20
20
|
vertical:
|
|
21
|
-
'
|
|
21
|
+
'is-[--line-thickness] top-[calc(var(--line-inset)+var(--terminal-radius))] bottom-[--line-inset] before:top-[--terminal-inset]',
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const edgeStyles: Record<Edge, HTMLAttributes<HTMLElement>['className']> = {
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
9
8
|
import { withTheme } from '../../testing';
|
|
@@ -56,15 +55,18 @@ const DefaultStory = ({ data }: StorybookTreeProps) => {
|
|
|
56
55
|
return <StorybookTreeItem data={data} />;
|
|
57
56
|
};
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
const meta = {
|
|
60
59
|
title: 'ui/react-ui-core/Tree',
|
|
61
|
-
component: Tree,
|
|
60
|
+
component: Tree as any,
|
|
62
61
|
render: DefaultStory,
|
|
63
62
|
decorators: [withTheme],
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
64
|
+
|
|
65
|
+
export default meta;
|
|
66
|
+
|
|
67
|
+
type Story = StoryObj<typeof meta>;
|
|
66
68
|
|
|
67
|
-
export const Default = {
|
|
69
|
+
export const Default: Story = {
|
|
68
70
|
args: {
|
|
69
71
|
data: {
|
|
70
72
|
foo: 100,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
8
|
import { faker } from '@dxos/random';
|
|
@@ -87,7 +88,7 @@ const content = {
|
|
|
87
88
|
icon: 'ph--planet--regular',
|
|
88
89
|
},
|
|
89
90
|
],
|
|
90
|
-
}
|
|
91
|
+
} as StorybookNode;
|
|
91
92
|
|
|
92
93
|
function* visitor(node: StorybookNode, isOpen?: (node: StorybookNode) => boolean): Generator<StorybookIteratorNode> {
|
|
93
94
|
const stack: StorybookIteratorNode[] = [
|
|
@@ -142,11 +143,15 @@ const DefaultStory = () => {
|
|
|
142
143
|
);
|
|
143
144
|
};
|
|
144
145
|
|
|
145
|
-
|
|
146
|
+
const meta = {
|
|
146
147
|
title: 'ui/react-ui-core/Treegrid',
|
|
147
|
-
component: Treegrid.Root,
|
|
148
|
+
component: Treegrid.Root as any,
|
|
148
149
|
render: DefaultStory,
|
|
149
150
|
decorators: [withTheme],
|
|
150
|
-
}
|
|
151
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
152
|
+
|
|
153
|
+
export default meta;
|
|
154
|
+
|
|
155
|
+
type Story = StoryObj<typeof meta>;
|
|
151
156
|
|
|
152
|
-
export const Default = {};
|
|
157
|
+
export const Default: Story = {};
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
6
6
|
import { type Scope, createContextScope } from '@radix-ui/react-context';
|
|
7
7
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
8
8
|
import { Slot } from '@radix-ui/react-slot';
|
|
9
9
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
10
|
-
import React, {
|
|
10
|
+
import React, {
|
|
11
|
+
type CSSProperties,
|
|
12
|
+
type ComponentPropsWithRef,
|
|
13
|
+
type KeyboardEvent,
|
|
14
|
+
forwardRef,
|
|
15
|
+
useCallback,
|
|
16
|
+
} from 'react';
|
|
11
17
|
|
|
12
18
|
import { useThemeContext } from '../../hooks';
|
|
13
19
|
import { type ThemedClassName } from '../../util';
|
|
@@ -40,12 +46,58 @@ const TreegridRoot = forwardRef<HTMLDivElement, TreegridRootProps>(
|
|
|
40
46
|
({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
|
|
41
47
|
const { tx } = useThemeContext();
|
|
42
48
|
const Root = asChild ? Slot : Primitive.div;
|
|
43
|
-
const
|
|
49
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
50
|
+
|
|
51
|
+
const handleKeyDown = useCallback(
|
|
52
|
+
(event: KeyboardEvent<HTMLDivElement>) => {
|
|
53
|
+
switch (event.key) {
|
|
54
|
+
case 'ArrowDown':
|
|
55
|
+
case 'ArrowUp': {
|
|
56
|
+
const direction = event.key === 'ArrowDown' ? 'down' : 'up';
|
|
57
|
+
const target = event.target as HTMLElement;
|
|
58
|
+
|
|
59
|
+
// Find ancestor with data-arrow-keys containing the relevant direction.
|
|
60
|
+
const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*="${direction}"], [data-arrow-keys="all"]`);
|
|
61
|
+
|
|
62
|
+
// If no ancestor with data-arrow-keys found, proceed with row navigation.
|
|
63
|
+
if (!ancestorWithArrowKeys) {
|
|
64
|
+
// Find the closest row
|
|
65
|
+
const currentRow = target.closest('[role="row"]');
|
|
66
|
+
if (currentRow) {
|
|
67
|
+
// Find the treegrid container.
|
|
68
|
+
const treegrid = currentRow.closest('[role="treegrid"]');
|
|
69
|
+
if (treegrid) {
|
|
70
|
+
// Get all rows in the treegrid.
|
|
71
|
+
const rows = Array.from(treegrid.querySelectorAll('[role="row"]'));
|
|
72
|
+
const currentIndex = rows.indexOf(currentRow as Element);
|
|
73
|
+
|
|
74
|
+
// Find next or previous row.
|
|
75
|
+
const nextIndex = direction === 'down' ? currentIndex + 1 : currentIndex - 1;
|
|
76
|
+
const targetRow = rows[nextIndex];
|
|
77
|
+
|
|
78
|
+
if (targetRow) {
|
|
79
|
+
// Focus the first focusable element in the target row.
|
|
80
|
+
const firstFocusable = findFirstFocusable(targetRow as HTMLElement);
|
|
81
|
+
if (firstFocusable) {
|
|
82
|
+
event.preventDefault();
|
|
83
|
+
firstFocusable.focus();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
props.onKeyDown?.(event);
|
|
93
|
+
},
|
|
94
|
+
[findFirstFocusable],
|
|
95
|
+
);
|
|
44
96
|
|
|
45
97
|
return (
|
|
46
98
|
<Root
|
|
47
99
|
role='treegrid'
|
|
48
|
-
{
|
|
100
|
+
onKeyDown={handleKeyDown}
|
|
49
101
|
{...props}
|
|
50
102
|
className={tx('treegrid.root', 'treegrid', {}, classNames)}
|
|
51
103
|
style={{ ...style, gridTemplateColumns }}
|
|
@@ -91,13 +143,6 @@ const TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRo
|
|
|
91
143
|
onChange: propsOnOpenChange,
|
|
92
144
|
defaultProp: defaultOpen,
|
|
93
145
|
});
|
|
94
|
-
const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
|
|
95
|
-
const arrowGroupAttrs = useArrowNavigationGroup({
|
|
96
|
-
axis: 'horizontal',
|
|
97
|
-
tabbable: false,
|
|
98
|
-
circular: false,
|
|
99
|
-
memorizeCurrent: false,
|
|
100
|
-
});
|
|
101
146
|
|
|
102
147
|
return (
|
|
103
148
|
<TreegridRowProvider open={open} onOpenChange={onOpenChange} scope={__treegridRowScope}>
|
|
@@ -106,15 +151,11 @@ const TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRo
|
|
|
106
151
|
aria-level={level}
|
|
107
152
|
className={tx('treegrid.row', 'treegrid__row', { level }, classNames)}
|
|
108
153
|
{...(parentOf && { 'aria-expanded': open, 'aria-owns': parentOf })}
|
|
109
|
-
tabIndex={0}
|
|
110
|
-
{...focusableGroupAttrs}
|
|
111
154
|
{...props}
|
|
112
155
|
id={id}
|
|
113
156
|
ref={forwardedRef}
|
|
114
157
|
>
|
|
115
|
-
|
|
116
|
-
{children}
|
|
117
|
-
</div>
|
|
158
|
+
{children}
|
|
118
159
|
</Root>
|
|
119
160
|
</TreegridRowProvider>
|
|
120
161
|
);
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
|
|
9
8
|
import { withTheme } from '../../testing';
|
|
10
|
-
import { Button } from '../
|
|
9
|
+
import { Button } from '../Button';
|
|
11
10
|
|
|
12
11
|
import { Main, useSidebars } from './Main';
|
|
13
12
|
|
|
@@ -46,15 +45,23 @@ const DefaultStory = (_args: StoryMainArgs) => {
|
|
|
46
45
|
);
|
|
47
46
|
};
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
const meta = {
|
|
50
49
|
title: 'ui/react-ui-core/Main',
|
|
51
50
|
component: Main.Root,
|
|
52
51
|
render: DefaultStory,
|
|
53
52
|
decorators: [withTheme],
|
|
54
|
-
parameters: {
|
|
55
|
-
|
|
53
|
+
parameters: {
|
|
54
|
+
layout: 'fullscreen',
|
|
55
|
+
chromatic: {
|
|
56
|
+
disableSnapshot: false,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
60
|
+
|
|
61
|
+
export default meta;
|
|
62
|
+
|
|
63
|
+
type Story = StoryObj<typeof meta>;
|
|
56
64
|
|
|
57
|
-
export const Default = {
|
|
65
|
+
export const Default: Story = {
|
|
58
66
|
args: {},
|
|
59
|
-
layout: 'fullscreen',
|
|
60
67
|
};
|