@dxos/react-ui 0.8.3 → 0.8.4-main.1da679c
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-WXW6KSRL.mjs → chunk-Y4PW3CX2.mjs} +186 -160
- package/dist/lib/browser/chunk-Y4PW3CX2.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -2
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +6 -7
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-EQ7EG74H.mjs → chunk-L6LIOSFT.mjs} +186 -160
- package/dist/lib/node-esm/chunk-L6LIOSFT.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4 -2
- 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 +6 -7
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- 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 +5 -25
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +5 -5
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +8 -14
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +14 -3
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +2 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts +6 -9
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +5 -5
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +5 -2
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +5 -7
- package/dist/types/src/components/Buttons/ToggleGroup.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 +4 -5
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +2 -3
- 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/Dialogs/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +7 -33
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +6 -28
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/ElevationProvider/ElevationProvider.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +2 -2
- package/dist/types/src/components/Input/Input.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +15 -10
- package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/types/src/components/Link/Link.stories.d.ts +12 -6
- package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.d.ts +2 -2
- package/dist/types/src/components/Lists/List.d.ts.map +1 -1
- package/dist/types/src/components/Lists/List.stories.d.ts +8 -25
- package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.d.ts +1 -1
- package/dist/types/src/components/Lists/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Tree.stories.d.ts +6 -26
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts +1 -1
- package/dist/types/src/components/Lists/Treegrid.d.ts.map +1 -1
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts +6 -4
- package/dist/types/src/components/Lists/Treegrid.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts +1 -1
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.stories.d.ts +6 -6
- 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 -38
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +5 -4
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +6 -35
- package/dist/types/src/components/Menus/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 +7 -15
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +6 -28
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +6 -26
- package/dist/types/src/components/ScrollArea/ScrollArea.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 +5 -4
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts +2 -2
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +6 -6
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +2 -2
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- 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 +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +6 -38
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +6 -44
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +8 -55
- package/dist/types/src/components/Tooltip/Tooltip.stories.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 -3
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +12 -3
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Typography.stories.d.ts +5 -5
- package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -15
- package/src/components/Avatars/Avatar.stories.tsx +19 -8
- package/src/components/Avatars/Avatar.tsx +3 -3
- package/src/components/Avatars/AvatarGroup.stories.tsx +11 -4
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +16 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Buttons/Button.stories.tsx +8 -7
- package/src/components/Buttons/Button.tsx +1 -0
- package/src/components/Buttons/IconButton.stories.tsx +11 -5
- package/src/components/Buttons/IconButton.tsx +5 -4
- package/src/components/Buttons/Toggle.stories.tsx +12 -6
- package/src/components/Buttons/ToggleGroup.stories.tsx +13 -7
- package/src/components/Buttons/ToggleGroup.tsx +17 -4
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +13 -14
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/Dialogs/AlertDialog.stories.tsx +14 -8
- package/src/components/Dialogs/AlertDialog.tsx +13 -13
- package/src/components/Dialogs/Dialog.stories.tsx +11 -11
- package/src/components/Dialogs/Dialog.tsx +13 -13
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +12 -11
- package/src/components/Input/Input.tsx +13 -13
- package/src/components/Link/Link.stories.tsx +11 -4
- package/src/components/Lists/List.stories.tsx +20 -14
- package/src/components/Lists/List.tsx +15 -16
- package/src/components/Lists/Tree.stories.tsx +11 -5
- package/src/components/Lists/Tree.tsx +4 -3
- package/src/components/Lists/TreeDropIndicator.tsx +1 -1
- package/src/components/Lists/Treegrid.stories.tsx +12 -6
- package/src/components/Lists/Treegrid.tsx +2 -2
- package/src/components/Main/Main.stories.tsx +14 -6
- package/src/components/Main/Main.tsx +15 -9
- package/src/components/Menus/ContextMenu.stories.tsx +11 -5
- package/src/components/Menus/ContextMenu.tsx +1 -0
- package/src/components/Menus/DropdownMenu.stories.tsx +11 -5
- package/src/components/Menus/DropdownMenu.tsx +21 -11
- package/src/components/Message/Message.stories.tsx +11 -5
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +11 -5
- package/src/components/Popover/Popover.tsx +8 -8
- package/src/components/ScrollArea/ScrollArea.stories.tsx +11 -5
- package/src/components/ScrollArea/ScrollArea.tsx +4 -4
- package/src/components/Select/Select.stories.tsx +14 -9
- package/src/components/Select/Select.tsx +5 -5
- package/src/components/Status/Status.stories.tsx +9 -3
- package/src/components/Tag/Tag.stories.tsx +13 -5
- package/src/components/ThemeProvider/ThemeProvider.tsx +4 -4
- package/src/components/ThemeProvider/TranslationsProvider.tsx +4 -4
- package/src/components/ThemeProvider/index.ts +3 -1
- package/src/components/Toast/Toast.stories.tsx +11 -5
- package/src/components/Toast/Toast.tsx +9 -9
- package/src/components/Toolbar/Toolbar.stories.tsx +20 -13
- package/src/components/Toolbar/Toolbar.tsx +3 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +16 -9
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/hooks/useSafeCollisionPadding.ts +1 -1
- package/src/index.ts +1 -1
- package/src/playground/Controls.stories.tsx +18 -13
- package/src/playground/Custom.stories.tsx +4 -4
- package/src/playground/Typography.stories.tsx +8 -3
- package/src/testing/decorators/withSurfaceVariantsLayout.tsx +1 -1
- package/src/testing/decorators/withTheme.ts +8 -5
- package/src/util/index.ts +1 -1
- package/README.yml +0 -1
- package/dist/lib/browser/chunk-WXW6KSRL.mjs.map +0 -7
- package/dist/lib/node/chunk-3E3QKWX4.cjs +0 -4363
- package/dist/lib/node/chunk-3E3QKWX4.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -175
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/testing/index.cjs +0 -114
- package/dist/lib/node/testing/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-EQ7EG74H.mjs.map +0 -7
|
@@ -4,23 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
|
|
9
|
-
import { AlertDialog } from './AlertDialog';
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
import { Button } from '../Buttons';
|
|
12
12
|
import { Toolbar } from '../Toolbar';
|
|
13
13
|
|
|
14
|
+
import { AlertDialog } from './AlertDialog';
|
|
15
|
+
|
|
14
16
|
type StoryProps = Partial<{
|
|
15
17
|
title: string;
|
|
16
18
|
description: string;
|
|
17
19
|
body: string;
|
|
20
|
+
openTrigger: string;
|
|
18
21
|
cancelTrigger: string;
|
|
19
22
|
actionTrigger: string;
|
|
20
|
-
openTrigger: string;
|
|
21
23
|
}>;
|
|
22
24
|
|
|
23
|
-
const DefaultStory = ({ title,
|
|
25
|
+
const DefaultStory = ({ title, description, body, openTrigger, cancelTrigger, actionTrigger }: StoryProps) => {
|
|
24
26
|
return (
|
|
25
27
|
<AlertDialog.Root defaultOpen>
|
|
26
28
|
<AlertDialog.Trigger asChild>
|
|
@@ -46,15 +48,19 @@ const DefaultStory = ({ title, openTrigger, description, body, cancelTrigger, ac
|
|
|
46
48
|
);
|
|
47
49
|
};
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
const meta = {
|
|
50
52
|
title: 'ui/react-ui-core/AlertDialog',
|
|
51
|
-
component: AlertDialog,
|
|
52
|
-
render: DefaultStory,
|
|
53
|
+
component: AlertDialog.Root as any,
|
|
54
|
+
render: DefaultStory as any,
|
|
53
55
|
decorators: [withTheme],
|
|
54
56
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
55
|
-
}
|
|
57
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
type Story = StoryObj<typeof meta>;
|
|
56
62
|
|
|
57
|
-
export const Default = {
|
|
63
|
+
export const Default: Story = {
|
|
58
64
|
args: {
|
|
59
65
|
title: 'AlertDialog title',
|
|
60
66
|
openTrigger: 'Open AlertDialog',
|
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
type AlertDialogProps as AlertDialogRootPrimitiveProps,
|
|
7
|
-
Root as AlertDialogRootPrimitive,
|
|
8
|
-
AlertDialogTrigger as AlertDialogTriggerPrimitive,
|
|
9
|
-
type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,
|
|
10
|
-
AlertDialogPortal as AlertDialogPortalPrimitive,
|
|
11
|
-
type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,
|
|
12
|
-
AlertDialogOverlay as AlertDialogOverlayPrimitive,
|
|
13
|
-
type AlertDialogOverlayProps as AlertDialogOverlayPrimitiveProps,
|
|
14
|
-
AlertDialogTitle as AlertDialogTitlePrimitive,
|
|
15
|
-
type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,
|
|
16
|
-
AlertDialogDescription as AlertDialogDescriptionPrimitive,
|
|
17
|
-
type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,
|
|
18
6
|
AlertDialogAction as AlertDialogActionPrimitive,
|
|
19
7
|
type AlertDialogActionProps as AlertDialogActionPrimitiveProps,
|
|
20
8
|
AlertDialogCancel as AlertDialogCancelPrimitive,
|
|
21
9
|
type AlertDialogCancelProps as AlertDialogCancelPrimitiveProps,
|
|
22
10
|
AlertDialogContent as AlertDialogContentPrimitive,
|
|
23
11
|
type AlertDialogContentProps as AlertDialogContentPrimitiveProps,
|
|
12
|
+
AlertDialogDescription as AlertDialogDescriptionPrimitive,
|
|
13
|
+
type AlertDialogDescriptionProps as AlertDialogDescriptionPrimitiveProps,
|
|
14
|
+
AlertDialogOverlay as AlertDialogOverlayPrimitive,
|
|
15
|
+
type AlertDialogOverlayProps as AlertDialogOverlayPrimitiveProps,
|
|
16
|
+
AlertDialogPortal as AlertDialogPortalPrimitive,
|
|
17
|
+
type AlertDialogPortalProps as AlertDialogPortalPrimitiveProps,
|
|
18
|
+
Root as AlertDialogRootPrimitive,
|
|
19
|
+
type AlertDialogProps as AlertDialogRootPrimitiveProps,
|
|
20
|
+
AlertDialogTitle as AlertDialogTitlePrimitive,
|
|
21
|
+
type AlertDialogTitleProps as AlertDialogTitlePrimitiveProps,
|
|
22
|
+
AlertDialogTrigger as AlertDialogTriggerPrimitive,
|
|
23
|
+
type AlertDialogTriggerProps as AlertDialogTriggerPrimitiveProps,
|
|
24
24
|
} from '@radix-ui/react-alert-dialog';
|
|
25
25
|
import { createContext } from '@radix-ui/react-context';
|
|
26
|
-
import React, {
|
|
26
|
+
import React, { type ForwardRefExoticComponent, type FunctionComponent, forwardRef } from 'react';
|
|
27
27
|
|
|
28
28
|
import { useThemeContext } from '../../hooks';
|
|
29
29
|
import { type ThemedClassName } from '../../util';
|
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
|
|
9
|
-
import { Dialog } from './Dialog';
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
import { Button } from '../Buttons';
|
|
12
12
|
|
|
13
|
+
import { Dialog } from './Dialog';
|
|
14
|
+
|
|
13
15
|
type StoryProps = Partial<{
|
|
14
16
|
title: string;
|
|
15
17
|
description: string;
|
|
@@ -39,15 +41,19 @@ const DefaultStory = ({ title, openTrigger, description, body, closeTrigger, blo
|
|
|
39
41
|
);
|
|
40
42
|
};
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
const meta = {
|
|
43
45
|
title: 'ui/react-ui-core/Dialog',
|
|
44
|
-
component: Dialog,
|
|
46
|
+
component: Dialog as any,
|
|
45
47
|
render: DefaultStory,
|
|
46
48
|
decorators: [withTheme],
|
|
47
49
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
48
|
-
}
|
|
50
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
49
51
|
|
|
50
|
-
export
|
|
52
|
+
export default meta;
|
|
53
|
+
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {
|
|
51
57
|
args: {
|
|
52
58
|
title: 'Dialog title',
|
|
53
59
|
openTrigger: 'Open Dialog',
|
|
@@ -56,10 +62,4 @@ export const Default = {
|
|
|
56
62
|
closeTrigger: 'Close trigger',
|
|
57
63
|
blockAlign: 'center',
|
|
58
64
|
},
|
|
59
|
-
argTypes: {
|
|
60
|
-
blockAlign: {
|
|
61
|
-
type: 'select',
|
|
62
|
-
options: ['center', 'start', 'end'],
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
65
|
};
|
|
@@ -4,24 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
import { createContext } from '@radix-ui/react-context';
|
|
6
6
|
import {
|
|
7
|
-
type DialogProps as DialogRootPrimitiveProps,
|
|
8
|
-
Root as DialogRootPrimitive,
|
|
9
|
-
DialogTrigger as DialogTriggerPrimitive,
|
|
10
|
-
type DialogTriggerProps as DialogTriggerPrimitiveProps,
|
|
11
|
-
DialogPortal as DialogPortalPrimitive,
|
|
12
|
-
type DialogPortalProps as DialogPortalPrimitiveProps,
|
|
13
|
-
DialogOverlay as DialogOverlayPrimitive,
|
|
14
|
-
type DialogOverlayProps as DialogOverlayPrimitiveProps,
|
|
15
|
-
DialogTitle as DialogTitlePrimitive,
|
|
16
|
-
type DialogTitleProps as DialogTitlePrimitiveProps,
|
|
17
|
-
DialogDescription as DialogDescriptionPrimitive,
|
|
18
|
-
type DialogDescriptionProps as DialogDescriptionPrimitiveProps,
|
|
19
7
|
DialogClose as DialogClosePrimitive,
|
|
20
8
|
type DialogCloseProps as DialogClosePrimitiveProps,
|
|
21
9
|
DialogContent as DialogContentPrimitive,
|
|
22
10
|
type DialogContentProps as DialogContentPrimitiveProps,
|
|
11
|
+
DialogDescription as DialogDescriptionPrimitive,
|
|
12
|
+
type DialogDescriptionProps as DialogDescriptionPrimitiveProps,
|
|
13
|
+
DialogOverlay as DialogOverlayPrimitive,
|
|
14
|
+
type DialogOverlayProps as DialogOverlayPrimitiveProps,
|
|
15
|
+
DialogPortal as DialogPortalPrimitive,
|
|
16
|
+
type DialogPortalProps as DialogPortalPrimitiveProps,
|
|
17
|
+
Root as DialogRootPrimitive,
|
|
18
|
+
type DialogProps as DialogRootPrimitiveProps,
|
|
19
|
+
DialogTitle as DialogTitlePrimitive,
|
|
20
|
+
type DialogTitleProps as DialogTitlePrimitiveProps,
|
|
21
|
+
DialogTrigger as DialogTriggerPrimitive,
|
|
22
|
+
type DialogTriggerProps as DialogTriggerPrimitiveProps,
|
|
23
23
|
} from '@radix-ui/react-dialog';
|
|
24
|
-
import React, {
|
|
24
|
+
import React, { type ForwardRefExoticComponent, type FunctionComponent, forwardRef } from 'react';
|
|
25
25
|
|
|
26
26
|
import { useThemeContext } from '../../hooks';
|
|
27
27
|
import { type ThemedClassName } from '../../util';
|
|
@@ -4,21 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { baseSurface, modalSurface,
|
|
10
|
+
import { baseSurface, modalSurface, mx, surfaceShadow } from '@dxos/react-ui-theme';
|
|
11
11
|
import { type MessageValence } from '@dxos/react-ui-types';
|
|
12
12
|
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
14
|
+
|
|
13
15
|
import {
|
|
14
16
|
type CheckboxProps,
|
|
15
17
|
Input,
|
|
16
18
|
type PinInputProps,
|
|
17
19
|
type SwitchProps,
|
|
18
|
-
type TextInputProps,
|
|
19
20
|
type TextAreaProps,
|
|
21
|
+
type TextInputProps,
|
|
20
22
|
} from './Input';
|
|
21
|
-
import { withTheme } from '../../testing';
|
|
22
23
|
|
|
23
24
|
type VariantMap = {
|
|
24
25
|
text: TextInputProps;
|
|
@@ -75,10 +76,10 @@ const Wrapper = ({
|
|
|
75
76
|
const DefaultStory = (props: BaseProps) => {
|
|
76
77
|
return (
|
|
77
78
|
<div className='space-b-4'>
|
|
78
|
-
<div className={mx(baseSurface, 'p-4')}>
|
|
79
|
+
<div className={mx(baseSurface, 'p-4 rounded-md')}>
|
|
79
80
|
<Wrapper {...props} />
|
|
80
81
|
</div>
|
|
81
|
-
<div className={mx(
|
|
82
|
+
<div className={mx('bg-cardSurface', 'p-4 rounded-md', surfaceShadow({ elevation: 'positioned' }))}>
|
|
82
83
|
<Wrapper {...props} />
|
|
83
84
|
</div>
|
|
84
85
|
<div className={mx(modalSurface, 'p-4 rounded-md', surfaceShadow({ elevation: 'dialog' }))}>
|
|
@@ -88,13 +89,13 @@ const DefaultStory = (props: BaseProps) => {
|
|
|
88
89
|
);
|
|
89
90
|
};
|
|
90
91
|
|
|
91
|
-
const meta
|
|
92
|
+
const meta = {
|
|
92
93
|
title: 'ui/react-ui-core/Input',
|
|
93
|
-
component: Input.Root,
|
|
94
|
+
component: Input.Root as any,
|
|
94
95
|
render: DefaultStory,
|
|
95
96
|
decorators: [withTheme],
|
|
96
97
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
97
|
-
}
|
|
98
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
98
99
|
|
|
99
100
|
export default meta;
|
|
100
101
|
|
|
@@ -221,10 +222,10 @@ export const Checkbox: Story = {
|
|
|
221
222
|
},
|
|
222
223
|
};
|
|
223
224
|
|
|
224
|
-
export const Switch = {
|
|
225
|
+
export const Switch: Story = {
|
|
225
226
|
args: {
|
|
226
227
|
kind: 'switch',
|
|
227
228
|
label: 'This is a switch',
|
|
228
|
-
description: '
|
|
229
|
+
description: "It's either off... or on.",
|
|
229
230
|
},
|
|
230
231
|
};
|
|
@@ -5,31 +5,31 @@
|
|
|
5
5
|
import { type IconWeight } from '@phosphor-icons/react';
|
|
6
6
|
import { Root as CheckboxPrimitive, type CheckboxProps as CheckboxPrimitiveProps } from '@radix-ui/react-checkbox';
|
|
7
7
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
|
-
import React, { type ComponentPropsWithRef,
|
|
8
|
+
import React, { type ComponentPropsWithRef, type ForwardRefExoticComponent, forwardRef, useCallback } from 'react';
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
|
+
DescriptionAndValidation as DescriptionAndValidationPrimitive,
|
|
12
|
+
type DescriptionAndValidationProps as DescriptionAndValidationPrimitiveProps,
|
|
13
|
+
Description as DescriptionPrimitive,
|
|
14
|
+
type DescriptionProps as DescriptionPrimitiveProps,
|
|
15
|
+
INPUT_NAME,
|
|
11
16
|
InputRoot,
|
|
12
17
|
type InputRootProps,
|
|
18
|
+
type InputScopedProps,
|
|
19
|
+
Label as LabelPrimitive,
|
|
20
|
+
type LabelProps as LabelPrimitiveProps,
|
|
13
21
|
PinInput as PinInputPrimitive,
|
|
14
22
|
type PinInputProps as PinInputPrimitiveProps,
|
|
15
|
-
TextInput as TextInputPrimitive,
|
|
16
|
-
type TextInputProps as TextInputPrimitiveProps,
|
|
17
23
|
TextArea as TextAreaPrimitive,
|
|
18
24
|
type TextAreaProps as TextAreaPrimitiveProps,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type InputScopedProps,
|
|
22
|
-
Description as DescriptionPrimitive,
|
|
23
|
-
DescriptionAndValidation as DescriptionAndValidationPrimitive,
|
|
24
|
-
type DescriptionAndValidationProps as DescriptionAndValidationPrimitiveProps,
|
|
25
|
-
type DescriptionProps as DescriptionPrimitiveProps,
|
|
26
|
-
Label as LabelPrimitive,
|
|
27
|
-
type LabelProps as LabelPrimitiveProps,
|
|
25
|
+
TextInput as TextInputPrimitive,
|
|
26
|
+
type TextInputProps as TextInputPrimitiveProps,
|
|
28
27
|
Validation as ValidationPrimitive,
|
|
29
28
|
type ValidationProps as ValidationPrimitiveProps,
|
|
29
|
+
useInputContext,
|
|
30
30
|
} from '@dxos/react-input';
|
|
31
31
|
import { mx } from '@dxos/react-ui-theme';
|
|
32
|
-
import { type
|
|
32
|
+
import { type ClassNameValue, type Density, type Elevation, type Size } from '@dxos/react-ui-types';
|
|
33
33
|
|
|
34
34
|
import { useDensityContext, useElevationContext, useThemeContext } from '../../hooks';
|
|
35
35
|
import { type ThemedClassName } from '../../util';
|
|
@@ -4,14 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
|
+
|
|
8
9
|
import { withTheme } from '../../testing';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
import { Link } from './Link';
|
|
12
|
+
|
|
13
|
+
const meta = {
|
|
11
14
|
title: 'ui/react-ui-core/Link',
|
|
12
15
|
component: Link,
|
|
13
16
|
decorators: [withTheme],
|
|
14
17
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
15
|
-
}
|
|
18
|
+
} satisfies Meta<typeof Link>;
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
16
23
|
|
|
17
|
-
export const Default = { args: { children: 'Hello', href: '#' } };
|
|
24
|
+
export const Default: Story = { args: { children: 'Hello', href: '#' } };
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
7
|
import { DndContext, type DragEndEvent, type DragStartEvent } from '@dnd-kit/core';
|
|
8
|
-
import {
|
|
8
|
+
import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
9
9
|
import { CSS } from '@dnd-kit/utilities';
|
|
10
10
|
import { useArrowNavigationGroup } from '@fluentui/react-tabster';
|
|
11
|
-
import {
|
|
11
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
12
12
|
import React, { type ReactNode, useState } from 'react';
|
|
13
13
|
|
|
14
14
|
import {
|
|
@@ -20,15 +20,21 @@ import {
|
|
|
20
20
|
surfaceShadow,
|
|
21
21
|
} from '@dxos/react-ui-theme';
|
|
22
22
|
|
|
23
|
-
import { List, ListItem, type ListScopedProps } from './List';
|
|
24
23
|
import { withTheme } from '../../testing';
|
|
24
|
+
import { Icon } from '../Icon';
|
|
25
|
+
|
|
26
|
+
import { List, ListItem, type ListScopedProps } from './List';
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
const meta = {
|
|
27
29
|
title: 'ui/react-ui-core/List',
|
|
28
30
|
component: List,
|
|
29
31
|
decorators: [withTheme],
|
|
30
32
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
31
|
-
}
|
|
33
|
+
} satisfies Meta<typeof List>;
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
32
38
|
|
|
33
39
|
const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
34
40
|
const { attributes, listeners, setNodeRef, transform } = useSortable({ id });
|
|
@@ -41,17 +47,17 @@ const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
|
41
47
|
style={{ transform: CSS.Transform.toString(transform) }}
|
|
42
48
|
>
|
|
43
49
|
<ListItem.Endcap>
|
|
44
|
-
<
|
|
50
|
+
<Icon icon='ph--dots-six-vertical--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
45
51
|
</ListItem.Endcap>
|
|
46
52
|
<ListItem.Heading classNames='grow pbs-2'>{text}</ListItem.Heading>
|
|
47
53
|
<ListItem.Endcap>
|
|
48
|
-
<
|
|
54
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
49
55
|
</ListItem.Endcap>
|
|
50
56
|
</ListItem.Root>
|
|
51
57
|
);
|
|
52
58
|
};
|
|
53
59
|
|
|
54
|
-
export const UniformSizeDraggable = {
|
|
60
|
+
export const UniformSizeDraggable: Story = {
|
|
55
61
|
render: ({ ...args }) => {
|
|
56
62
|
const [items, setItems] = useState(
|
|
57
63
|
[...Array(12)].map((_, index) => ({
|
|
@@ -103,19 +109,19 @@ const ManySizesDraggableListItem = ({
|
|
|
103
109
|
style={{ transform: CSS.Translate.toString(transform) }}
|
|
104
110
|
>
|
|
105
111
|
<ListItem.Endcap>
|
|
106
|
-
<
|
|
112
|
+
<Icon icon='ph--dots-six-vertical--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
107
113
|
</ListItem.Endcap>
|
|
108
114
|
<ListItem.Heading classNames='grow pbs-2' asChild>
|
|
109
115
|
{text}
|
|
110
116
|
</ListItem.Heading>
|
|
111
117
|
<ListItem.Endcap>
|
|
112
|
-
<
|
|
118
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
113
119
|
</ListItem.Endcap>
|
|
114
120
|
</ListItem.Root>
|
|
115
121
|
);
|
|
116
122
|
};
|
|
117
123
|
|
|
118
|
-
export const ManySizesDraggable = {
|
|
124
|
+
export const ManySizesDraggable: Story = {
|
|
119
125
|
render: ({ ...args }) => {
|
|
120
126
|
const [items, setItems] = useState(
|
|
121
127
|
[...Array(12)].map((_, index) => ({
|
|
@@ -163,7 +169,7 @@ export const ManySizesDraggable = {
|
|
|
163
169
|
args: {},
|
|
164
170
|
};
|
|
165
171
|
|
|
166
|
-
export const Collapsible = {
|
|
172
|
+
export const Collapsible: Story = {
|
|
167
173
|
render: ({ ...args }) => {
|
|
168
174
|
const [items, _setItems] = useState(
|
|
169
175
|
[...Array(12)].map((_, index) => ({
|
|
@@ -181,7 +187,7 @@ export const Collapsible = {
|
|
|
181
187
|
{index !== 2 ? <ListItem.OpenTrigger /> : <ListItem.MockOpenTrigger />}
|
|
182
188
|
<ListItem.Heading classNames='grow pbs-2'>{text}</ListItem.Heading>
|
|
183
189
|
<ListItem.Endcap>
|
|
184
|
-
<
|
|
190
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
185
191
|
</ListItem.Endcap>
|
|
186
192
|
</div>
|
|
187
193
|
{index !== 2 && <ListItem.CollapsibleContent>{body}</ListItem.CollapsibleContent>}
|
|
@@ -196,7 +202,7 @@ export const Collapsible = {
|
|
|
196
202
|
},
|
|
197
203
|
};
|
|
198
204
|
|
|
199
|
-
export const SelectableListbox = {
|
|
205
|
+
export const SelectableListbox: Story = {
|
|
200
206
|
render: () => {
|
|
201
207
|
const [selectedId, setSelectedId] = useState<string>();
|
|
202
208
|
const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'vertical' });
|
|
@@ -2,34 +2,35 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CaretDown, CaretRight } from '@phosphor-icons/react';
|
|
6
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import React, { type ComponentPropsWithoutRef, type FC,
|
|
6
|
+
import React, { type ComponentPropsWithoutRef, type FC, type ForwardRefExoticComponent, forwardRef } from 'react';
|
|
8
7
|
|
|
9
8
|
import {
|
|
9
|
+
LIST_ITEM_NAME,
|
|
10
|
+
LIST_NAME,
|
|
11
|
+
ListItemCollapsibleContent,
|
|
12
|
+
type ListItemCollapsibleContentProps,
|
|
13
|
+
type ListItemScopedProps,
|
|
10
14
|
List as ListPrimitive,
|
|
11
|
-
|
|
12
|
-
type ListScopedProps,
|
|
15
|
+
ListItem as ListPrimitiveItem,
|
|
13
16
|
ListItemHeading as ListPrimitiveItemHeading,
|
|
14
17
|
type ListItemHeadingProps as ListPrimitiveItemHeadingProps,
|
|
15
18
|
ListItemOpenTrigger as ListPrimitiveItemOpenTrigger,
|
|
16
19
|
type ListItemOpenTriggerProps as ListPrimitiveItemOpenTriggerProps,
|
|
17
|
-
ListItemCollapsibleContent,
|
|
18
|
-
type ListItemCollapsibleContentProps,
|
|
19
|
-
ListItem as ListPrimitiveItem,
|
|
20
20
|
type ListItemProps as ListPrimitiveItemProps,
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
LIST_ITEM_NAME,
|
|
21
|
+
type ListProps as ListPrimitiveProps,
|
|
22
|
+
type ListScopedProps,
|
|
24
23
|
useListContext,
|
|
25
24
|
useListItemContext,
|
|
26
25
|
} from '@dxos/react-list';
|
|
27
26
|
import { type Density } from '@dxos/react-ui-types';
|
|
28
27
|
|
|
29
|
-
import { ListDropIndicator } from './ListDropIndicator';
|
|
30
28
|
import { useDensityContext, useThemeContext } from '../../hooks';
|
|
31
29
|
import { type ThemedClassName } from '../../util';
|
|
32
30
|
import { DensityProvider } from '../DensityProvider';
|
|
31
|
+
import { Icon } from '../Icon';
|
|
32
|
+
|
|
33
|
+
import { ListDropIndicator } from './ListDropIndicator';
|
|
33
34
|
|
|
34
35
|
type ListProps = ThemedClassName<ListPrimitiveProps> & { density?: Density };
|
|
35
36
|
|
|
@@ -106,7 +107,6 @@ const ListItemOpenTrigger = forwardRef<HTMLButtonElement, ListItemOpenTriggerPro
|
|
|
106
107
|
const { tx } = useThemeContext();
|
|
107
108
|
const density = useDensityContext();
|
|
108
109
|
const { open } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
109
|
-
const Icon = open ? CaretDown : CaretRight;
|
|
110
110
|
return (
|
|
111
111
|
<ListPrimitiveItemOpenTrigger
|
|
112
112
|
{...props}
|
|
@@ -115,10 +115,9 @@ const ListItemOpenTrigger = forwardRef<HTMLButtonElement, ListItemOpenTriggerPro
|
|
|
115
115
|
>
|
|
116
116
|
{children || (
|
|
117
117
|
<Icon
|
|
118
|
-
{
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}}
|
|
118
|
+
size={3}
|
|
119
|
+
icon={open ? 'ph--caret-down--bold' : 'ph--caret-right--bold'}
|
|
120
|
+
classNames={tx('list.item.openTriggerIcon', 'list__listItem__openTrigger__icon', {})}
|
|
122
121
|
/>
|
|
123
122
|
)}
|
|
124
123
|
</ListPrimitiveItemOpenTrigger>
|
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
|
|
9
|
-
import { Tree, TreeItem } from './Tree';
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
|
|
12
|
+
import { Tree, TreeItem } from './Tree';
|
|
13
|
+
|
|
12
14
|
type StorybookTreeProps = {
|
|
13
15
|
data: any;
|
|
14
16
|
};
|
|
@@ -55,15 +57,19 @@ const DefaultStory = ({ data }: StorybookTreeProps) => {
|
|
|
55
57
|
return <StorybookTreeItem data={data} />;
|
|
56
58
|
};
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
const meta = {
|
|
59
61
|
title: 'ui/react-ui-core/Tree',
|
|
60
|
-
component: Tree,
|
|
62
|
+
component: Tree as any,
|
|
61
63
|
render: DefaultStory,
|
|
62
64
|
decorators: [withTheme],
|
|
63
65
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
64
|
-
}
|
|
66
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
67
|
+
|
|
68
|
+
export default meta;
|
|
69
|
+
|
|
70
|
+
type Story = StoryObj<typeof meta>;
|
|
65
71
|
|
|
66
|
-
export const Default = {
|
|
72
|
+
export const Default: Story = {
|
|
67
73
|
args: {
|
|
68
74
|
data: {
|
|
69
75
|
foo: 100,
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { type ComponentPropsWithoutRef, type FC,
|
|
5
|
+
import React, { type ComponentPropsWithoutRef, type FC, type ForwardRefExoticComponent, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName } from '../../util';
|
|
6
8
|
|
|
7
9
|
import {
|
|
10
|
+
LIST_ITEM_NAME,
|
|
8
11
|
List,
|
|
9
12
|
ListItem,
|
|
10
13
|
type ListItemCollapsibleContentProps,
|
|
@@ -13,11 +16,9 @@ import {
|
|
|
13
16
|
type ListItemRootProps,
|
|
14
17
|
type ListProps,
|
|
15
18
|
type ListScopedProps,
|
|
16
|
-
LIST_ITEM_NAME,
|
|
17
19
|
useListItemContext,
|
|
18
20
|
} from './List';
|
|
19
21
|
import { TreeDropIndicator } from './TreeDropIndicator';
|
|
20
|
-
import { type ThemedClassName } from '../../util';
|
|
21
22
|
|
|
22
23
|
type TreeRootProps = ListProps;
|
|
23
24
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
6
|
-
import React, { type
|
|
6
|
+
import React, { type CSSProperties, type HTMLAttributes } from 'react';
|
|
7
7
|
|
|
8
8
|
// Tree item hitbox
|
|
9
9
|
// https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx#tree-item
|
|
@@ -2,14 +2,16 @@
|
|
|
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';
|
|
8
9
|
|
|
9
|
-
import { Treegrid } from './Treegrid';
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
import { Icon } from '../Icon';
|
|
12
12
|
|
|
13
|
+
import { Treegrid } from './Treegrid';
|
|
14
|
+
|
|
13
15
|
faker.seed(1234);
|
|
14
16
|
|
|
15
17
|
type StorybookNode = {
|
|
@@ -86,7 +88,7 @@ const content = {
|
|
|
86
88
|
icon: 'ph--planet--regular',
|
|
87
89
|
},
|
|
88
90
|
],
|
|
89
|
-
}
|
|
91
|
+
} as StorybookNode;
|
|
90
92
|
|
|
91
93
|
function* visitor(node: StorybookNode, isOpen?: (node: StorybookNode) => boolean): Generator<StorybookIteratorNode> {
|
|
92
94
|
const stack: StorybookIteratorNode[] = [
|
|
@@ -141,11 +143,15 @@ const DefaultStory = () => {
|
|
|
141
143
|
);
|
|
142
144
|
};
|
|
143
145
|
|
|
144
|
-
|
|
146
|
+
const meta = {
|
|
145
147
|
title: 'ui/react-ui-core/Treegrid',
|
|
146
|
-
component: Treegrid.Root,
|
|
148
|
+
component: Treegrid.Root as any,
|
|
147
149
|
render: DefaultStory,
|
|
148
150
|
decorators: [withTheme],
|
|
149
|
-
}
|
|
151
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
152
|
+
|
|
153
|
+
export default meta;
|
|
154
|
+
|
|
155
|
+
type Story = StoryObj<typeof meta>;
|
|
150
156
|
|
|
151
|
-
export const Default = {};
|
|
157
|
+
export const Default: Story = {};
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { useArrowNavigationGroup, useFocusableGroup } from '@fluentui/react-tabster';
|
|
6
|
-
import {
|
|
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, { type
|
|
10
|
+
import React, { type CSSProperties, type ComponentPropsWithRef, forwardRef } from 'react';
|
|
11
11
|
|
|
12
12
|
import { useThemeContext } from '../../hooks';
|
|
13
13
|
import { type ThemedClassName } from '../../util';
|