@dxos/react-ui 0.3.9-main.60e343d → 0.3.9-main.622f05b
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/index.mjs +270 -385
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/AnchoredOverflow/AnchoredOverflow.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +7 -0
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +7 -0
- 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 +7 -0
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +7 -0
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts +7 -0
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +7 -0
- package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +7 -0
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +7 -0
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/DropdownMenu/DropdownMenu.stories.d.ts +7 -0
- package/dist/types/src/components/DropdownMenu/DropdownMenu.stories.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 +8 -1
- 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/Lists/List.d.ts.map +1 -0
- package/dist/types/src/components/{List → Lists}/List.stories.d.ts +7 -0
- package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lists/Tree.d.ts.map +1 -0
- package/dist/types/src/components/{List → Lists}/Tree.stories.d.ts +7 -0
- package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -0
- package/dist/types/src/components/Lists/index.d.ts.map +1 -0
- package/dist/types/src/components/Main/Main.d.ts +2 -2
- package/dist/types/src/components/Main/Main.stories.d.ts +7 -0
- package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +7 -0
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +7 -0
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +7 -0
- package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
- package/dist/types/src/components/Select/Select.stories.d.ts +7 -0
- package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/types/src/components/Status/Status.d.ts +10 -0
- package/dist/types/src/components/Status/Status.d.ts.map +1 -0
- package/dist/types/src/components/Status/Status.stories.d.ts +19 -0
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -0
- package/dist/types/src/components/Status/index.d.ts +2 -0
- package/dist/types/src/components/Status/index.d.ts.map +1 -0
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +7 -0
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +7 -0
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +7 -0
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/playground/Controls.stories.d.ts +7 -0
- package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
- package/dist/types/src/playground/Surfaces.stories.d.ts +7 -0
- package/dist/types/src/playground/Surfaces.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +2 -0
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -0
- package/dist/types/src/testing/decorators/with-theme.d.ts +3 -0
- package/dist/types/src/testing/decorators/with-theme.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/package.json +8 -14
- package/src/components/AnchoredOverflow/AnchoredOverflow.tsx +12 -2
- package/src/components/Avatars/Avatar.stories.tsx +4 -0
- package/src/components/Avatars/AvatarGroup.stories.tsx +4 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +4 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +9 -1
- package/src/components/Buttons/Button.stories.tsx +4 -0
- package/src/components/Buttons/Toggle.stories.tsx +4 -0
- package/src/components/Buttons/ToggleGroup.stories.tsx +4 -0
- package/src/components/Dialogs/AlertDialog.stories.tsx +4 -0
- package/src/components/Dialogs/Dialog.stories.tsx +4 -0
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +4 -0
- package/src/components/Input/Input.stories.tsx +23 -2
- package/src/components/Input/Input.tsx +3 -1
- package/src/components/Link/Link.stories.tsx +4 -0
- package/src/components/{List → Lists}/List.stories.tsx +4 -0
- package/src/components/{List → Lists}/Tree.stories.tsx +4 -0
- package/src/components/Main/Main.stories.tsx +7 -1
- package/src/components/Message/Message.stories.tsx +4 -0
- package/src/components/Popover/Popover.stories.tsx +4 -0
- package/src/components/ScrollArea/ScrollArea.stories.tsx +4 -0
- package/src/components/Select/Select.stories.tsx +4 -0
- package/src/components/Status/Status.stories.tsx +37 -0
- package/src/components/Status/Status.tsx +38 -0
- package/src/components/{Card → Status}/index.ts +1 -1
- package/src/components/Tag/Tag.stories.tsx +4 -0
- package/src/components/Toast/Toast.stories.tsx +4 -0
- package/src/components/Toolbar/Toolbar.stories.tsx +4 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +4 -0
- package/src/components/index.ts +2 -4
- package/src/playground/Controls.stories.tsx +4 -0
- package/src/playground/Surfaces.stories.tsx +5 -0
- package/src/{components/Center → testing/decorators}/index.ts +1 -1
- package/src/testing/decorators/with-theme.ts +22 -0
- package/src/{components/ProgressBar → testing}/index.ts +1 -1
- package/dist/types/src/components/Card/Card.d.ts +0 -52
- package/dist/types/src/components/Card/Card.d.ts.map +0 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +0 -56
- package/dist/types/src/components/Card/Card.stories.d.ts.map +0 -1
- package/dist/types/src/components/Card/index.d.ts +0 -2
- package/dist/types/src/components/Card/index.d.ts.map +0 -1
- package/dist/types/src/components/Center/Center.d.ts +0 -4
- package/dist/types/src/components/Center/Center.d.ts.map +0 -1
- package/dist/types/src/components/Center/Center.stories.d.ts +0 -11
- package/dist/types/src/components/Center/Center.stories.d.ts.map +0 -1
- package/dist/types/src/components/Center/index.d.ts +0 -2
- package/dist/types/src/components/Center/index.d.ts.map +0 -1
- package/dist/types/src/components/List/List.d.ts.map +0 -1
- package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.d.ts.map +0 -1
- package/dist/types/src/components/List/Tree.stories.d.ts.map +0 -1
- package/dist/types/src/components/List/index.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/ProgressBar.d.ts +0 -7
- package/dist/types/src/components/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/ProgressBar.stories.d.ts +0 -12
- package/dist/types/src/components/ProgressBar/ProgressBar.stories.d.ts.map +0 -1
- package/dist/types/src/components/ProgressBar/index.d.ts +0 -2
- package/dist/types/src/components/ProgressBar/index.d.ts.map +0 -1
- package/src/components/Card/Card.stories.tsx +0 -220
- package/src/components/Card/Card.tsx +0 -147
- package/src/components/Center/Center.stories.tsx +0 -18
- package/src/components/Center/Center.tsx +0 -16
- package/src/components/ProgressBar/ProgressBar.stories.tsx +0 -33
- package/src/components/ProgressBar/ProgressBar.tsx +0 -29
- /package/dist/types/src/components/{List → Lists}/List.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/Tree.d.ts +0 -0
- /package/dist/types/src/components/{List → Lists}/index.d.ts +0 -0
- /package/src/components/{List → Lists}/List.tsx +0 -0
- /package/src/components/{List → Lists}/Tree.tsx +0 -0
- /package/src/components/{List → Lists}/index.ts +0 -0
|
@@ -2,17 +2,15 @@ export * from './AnchoredOverflow';
|
|
|
2
2
|
export * from './Avatars';
|
|
3
3
|
export * from './Breadcrumb';
|
|
4
4
|
export * from './Buttons';
|
|
5
|
-
export * from './Card';
|
|
6
|
-
export * from './Center';
|
|
7
5
|
export * from './Dialogs';
|
|
8
6
|
export * from './DropdownMenu';
|
|
9
7
|
export * from './Input';
|
|
10
8
|
export * from './Link';
|
|
11
|
-
export * from './
|
|
9
|
+
export * from './Lists';
|
|
12
10
|
export * from './Main';
|
|
13
11
|
export * from './Message';
|
|
14
12
|
export * from './Popover';
|
|
15
|
-
export * from './
|
|
13
|
+
export * from './Status';
|
|
16
14
|
export * from './ScrollArea';
|
|
17
15
|
export * from './Select';
|
|
18
16
|
export * from './Separator';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAE1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import '@dxosTheme';
|
|
2
2
|
declare const _default: {
|
|
3
|
+
title: string;
|
|
3
4
|
component: () => JSX.Element;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
6
|
+
parameters: {
|
|
7
|
+
chromatic: {
|
|
8
|
+
disableSnapshot: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
};
|
|
5
12
|
export default _default;
|
|
6
13
|
export declare const Default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Controls.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Controls.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;AAgFpB,wBAKE;AAEF,eAAO,MAAM,OAAO;;;;CAEnB,CAAC"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import '@dxosTheme';
|
|
2
2
|
declare const _default: {
|
|
3
|
+
title: string;
|
|
3
4
|
component: () => JSX.Element;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
6
|
+
parameters: {
|
|
7
|
+
chromatic: {
|
|
8
|
+
disableSnapshot: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
4
11
|
};
|
|
5
12
|
export default _default;
|
|
6
13
|
export declare const Default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Surfaces.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Surfaces.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"Surfaces.stories.d.ts","sourceRoot":"","sources":["../../../../src/playground/Surfaces.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;AAuDpB,wBAKE;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-theme.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/with-theme.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAOlD,eAAO,MAAM,SAAS,EAAE,SAUvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.3.9-main.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.9-main.622f05b",
|
|
4
|
+
"description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
"types": "dist/types/src/index.d.ts",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
-
"src"
|
|
14
|
-
"plugin.js",
|
|
15
|
-
"plugin.d.ts"
|
|
13
|
+
"src"
|
|
16
14
|
],
|
|
17
15
|
"dependencies": {
|
|
18
16
|
"@radix-ui/react-alert-dialog": "^1.0.3",
|
|
@@ -39,10 +37,10 @@
|
|
|
39
37
|
"jdenticon": "^3.2.0",
|
|
40
38
|
"keyborg": "^2.0.0",
|
|
41
39
|
"react-i18next": "^11.18.6",
|
|
42
|
-
"@dxos/react-
|
|
43
|
-
"@dxos/react-list": "0.3.9-main.
|
|
44
|
-
"@dxos/react-ui-types": "0.3.9-main.
|
|
45
|
-
"@dxos/react-
|
|
40
|
+
"@dxos/react-hooks": "0.3.9-main.622f05b",
|
|
41
|
+
"@dxos/react-list": "0.3.9-main.622f05b",
|
|
42
|
+
"@dxos/react-ui-types": "0.3.9-main.622f05b",
|
|
43
|
+
"@dxos/react-input": "0.3.9-main.622f05b"
|
|
46
44
|
},
|
|
47
45
|
"devDependencies": {
|
|
48
46
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -52,12 +50,11 @@
|
|
|
52
50
|
"@phosphor-icons/react": "^2.0.5",
|
|
53
51
|
"@types/react": "^18.0.21",
|
|
54
52
|
"@types/react-dom": "^18.0.6",
|
|
55
|
-
"chromatic": "^7.5.0",
|
|
56
53
|
"react": "^18.2.0",
|
|
57
54
|
"react-dom": "^18.2.0",
|
|
58
55
|
"vite": "^4.3.9",
|
|
59
56
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
60
|
-
"@dxos/react-ui-theme": "0.3.9-main.
|
|
57
|
+
"@dxos/react-ui-theme": "0.3.9-main.622f05b"
|
|
61
58
|
},
|
|
62
59
|
"peerDependencies": {
|
|
63
60
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -66,8 +63,5 @@
|
|
|
66
63
|
},
|
|
67
64
|
"publishConfig": {
|
|
68
65
|
"access": "public"
|
|
69
|
-
},
|
|
70
|
-
"scripts": {
|
|
71
|
-
"chromatic": "chromatic --only-changed --project-token=\"44ade288043a\" --storybook-build-dir out/react-ui --exit-zero-on-changes"
|
|
72
66
|
}
|
|
73
67
|
}
|
|
@@ -18,7 +18,12 @@ const AnchoredOverflowRoot = forwardRef<HTMLDivElement, AnchoredOverflowRootProp
|
|
|
18
18
|
const { tx } = useThemeContext();
|
|
19
19
|
const Root = asChild ? Slot : Primitive.div;
|
|
20
20
|
return (
|
|
21
|
-
<Root
|
|
21
|
+
<Root
|
|
22
|
+
role='none'
|
|
23
|
+
{...props}
|
|
24
|
+
className={tx('anchoredOverflow.root', 'overflow-anchored', {}, classNames)}
|
|
25
|
+
ref={forwardedRef}
|
|
26
|
+
>
|
|
22
27
|
{children}
|
|
23
28
|
</Root>
|
|
24
29
|
);
|
|
@@ -34,7 +39,12 @@ const AnchoredOverflowAnchor = forwardRef<HTMLDivElement, AnchoredOverflowAnchor
|
|
|
34
39
|
const { tx } = useThemeContext();
|
|
35
40
|
const Root = asChild ? Slot : Primitive.div;
|
|
36
41
|
return (
|
|
37
|
-
<Root
|
|
42
|
+
<Root
|
|
43
|
+
role='none'
|
|
44
|
+
{...props}
|
|
45
|
+
className={tx('anchoredOverflow.anchor', 'overflow-anchor', {}, classNames)}
|
|
46
|
+
ref={forwardedRef}
|
|
47
|
+
>
|
|
38
48
|
{children}
|
|
39
49
|
</Root>
|
|
40
50
|
);
|
|
@@ -10,6 +10,7 @@ import { getColorForValue } from '@dxos/react-ui-theme';
|
|
|
10
10
|
import { type Size } from '@dxos/react-ui-types';
|
|
11
11
|
|
|
12
12
|
import { Avatar, useJdenticonHref, type AvatarVariant, type AvatarStatus, type AvatarAnimation } from './Avatar';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
13
14
|
|
|
14
15
|
const randomColor = () => getColorForValue({ value: Math.random().toString(16), type: 'color' });
|
|
15
16
|
|
|
@@ -61,7 +62,10 @@ const StorybookAvatar = (props: PropsWithChildren<StorybookAvatarProps>) => {
|
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
export default {
|
|
65
|
+
title: 'DXOS UI/Avatar',
|
|
64
66
|
component: StorybookAvatar,
|
|
67
|
+
decorators: [withTheme],
|
|
68
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
65
69
|
};
|
|
66
70
|
|
|
67
71
|
const sampleImage =
|
|
@@ -8,6 +8,7 @@ import React from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { Avatar, useJdenticonHref } from './Avatar';
|
|
10
10
|
import { AvatarGroup, AvatarGroupItem } from './AvatarGroup';
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
11
12
|
|
|
12
13
|
const items = [
|
|
13
14
|
'[&_.avatarFrameFill]:fill-lime-500',
|
|
@@ -41,7 +42,10 @@ const StorybookAvatarGroup = () => {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
export default {
|
|
45
|
+
title: 'DXOS UI/Avatar Group',
|
|
44
46
|
component: StorybookAvatarGroup,
|
|
47
|
+
decorators: [withTheme],
|
|
48
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
45
49
|
};
|
|
46
50
|
|
|
47
51
|
export const Default = {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Breadcrumb } from './Breadcrumb';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
import { Button } from '../Buttons';
|
|
11
12
|
|
|
12
13
|
const StorybookBreadcrumb = () => {
|
|
@@ -38,7 +39,10 @@ const StorybookBreadcrumb = () => {
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export default {
|
|
42
|
+
title: 'DXOS UI/Breadcrumb',
|
|
41
43
|
component: StorybookBreadcrumb,
|
|
44
|
+
decorators: [withTheme],
|
|
45
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export const Default = {
|
|
@@ -37,7 +37,14 @@ const BreadcrumbList = forwardRef<HTMLOListElement, BreadcrumbListProps>(
|
|
|
37
37
|
({ asChild, classNames, ...props }, forwardedRef) => {
|
|
38
38
|
const { tx } = useThemeContext();
|
|
39
39
|
const Root = asChild ? Slot : Primitive.ol;
|
|
40
|
-
return
|
|
40
|
+
return (
|
|
41
|
+
<Root
|
|
42
|
+
role='list'
|
|
43
|
+
{...props}
|
|
44
|
+
className={tx('breadcrumb.list', 'breadcrumb__list', {}, classNames)}
|
|
45
|
+
ref={forwardedRef}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
41
48
|
},
|
|
42
49
|
);
|
|
43
50
|
|
|
@@ -49,6 +56,7 @@ const BreadcrumbListItem = forwardRef<HTMLLIElement, BreadcrumbListItemProps>(
|
|
|
49
56
|
const Root = asChild ? Slot : Primitive.li;
|
|
50
57
|
return (
|
|
51
58
|
<Root
|
|
59
|
+
role='listitem'
|
|
52
60
|
{...props}
|
|
53
61
|
className={tx('breadcrumb.listItem', 'breadcrumb__list__item', {}, classNames)}
|
|
54
62
|
ref={forwardedRef}
|
|
@@ -10,11 +10,15 @@ import React, { type PropsWithChildren } from 'react';
|
|
|
10
10
|
import { chromeSurface, groupSurface, mx, surfaceElevation } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
13
14
|
import { DensityProvider } from '../DensityProvider';
|
|
14
15
|
import { ElevationProvider } from '../ElevationProvider';
|
|
15
16
|
|
|
16
17
|
export default {
|
|
18
|
+
title: 'DXOS UI/Button',
|
|
17
19
|
component: Button,
|
|
20
|
+
decorators: [withTheme],
|
|
21
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
const Container = ({ children }: PropsWithChildren<{}>) => (
|
|
@@ -8,6 +8,7 @@ import { TextB } from '@phosphor-icons/react';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { Toggle } from './Toggle';
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
11
12
|
|
|
12
13
|
type StorybookToggleProps = {};
|
|
13
14
|
|
|
@@ -20,7 +21,10 @@ const StorybookToggle = (props: StorybookToggleProps) => {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export default {
|
|
24
|
+
title: 'DXOS UI/Toggle button',
|
|
23
25
|
component: StorybookToggle,
|
|
26
|
+
decorators: [withTheme],
|
|
27
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
export const Default = {
|
|
@@ -8,6 +8,7 @@ import { TextB, TextItalic } from '@phosphor-icons/react';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { ToggleGroup, ToggleGroupItem, type ToggleGroupProps } from './ToggleGroup';
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
11
12
|
|
|
12
13
|
type StorybookToggleGroupProps = {
|
|
13
14
|
type: ToggleGroupProps['type'];
|
|
@@ -28,7 +29,10 @@ const StorybookToggleGroup = (props: StorybookToggleGroupProps) => {
|
|
|
28
29
|
};
|
|
29
30
|
|
|
30
31
|
export default {
|
|
32
|
+
title: 'DXOS UI/Toggle button group',
|
|
31
33
|
component: StorybookToggleGroup,
|
|
34
|
+
decorators: [withTheme],
|
|
35
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
32
36
|
};
|
|
33
37
|
|
|
34
38
|
export const Default = {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { AlertDialog } from './AlertDialog';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
import { Button } from '../Buttons';
|
|
11
12
|
import { Toolbar } from '../Toolbar';
|
|
12
13
|
|
|
@@ -53,7 +54,10 @@ const StorybookAlertDialog = ({
|
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
export default {
|
|
57
|
+
title: 'DXOS UI/Dialog (alert)',
|
|
56
58
|
component: StorybookAlertDialog,
|
|
59
|
+
decorators: [withTheme],
|
|
60
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
57
61
|
};
|
|
58
62
|
|
|
59
63
|
export const Default = {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Dialog } from './Dialog';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
import { Button } from '../Buttons';
|
|
11
12
|
|
|
12
13
|
type StorybookDialogProps = Partial<{
|
|
@@ -38,7 +39,10 @@ const StorybookDialog = ({ title, openTrigger, description, body, closeTrigger }
|
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
export default {
|
|
42
|
+
title: 'DXOS UI/Dialog',
|
|
41
43
|
component: StorybookDialog,
|
|
44
|
+
decorators: [withTheme],
|
|
45
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export const Default = {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { DropdownMenu } from './DropdownMenu';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
import { Button } from '../Buttons';
|
|
11
12
|
|
|
12
13
|
const StorybookDropdownMenu = () => {
|
|
@@ -91,7 +92,10 @@ const StorybookDropdownMenu = () => {
|
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
export default {
|
|
95
|
+
title: 'DXOS UI/Dropdown menu',
|
|
94
96
|
component: StorybookDropdownMenu,
|
|
97
|
+
decorators: [withTheme],
|
|
98
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
95
99
|
};
|
|
96
100
|
|
|
97
101
|
export const Default = {
|
|
@@ -6,9 +6,11 @@ import '@dxosTheme';
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
+
import { baseSurface, chromeSurface, groupSurface, mx, surfaceElevation } from '@dxos/react-ui-theme';
|
|
9
10
|
import { type MessageValence } from '@dxos/react-ui-types';
|
|
10
11
|
|
|
11
12
|
import { Input } from './Input';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
12
14
|
|
|
13
15
|
type StoryInputProps = Partial<{
|
|
14
16
|
label: string;
|
|
@@ -22,7 +24,7 @@ type StoryInputProps = Partial<{
|
|
|
22
24
|
validationValence: MessageValence;
|
|
23
25
|
}>;
|
|
24
26
|
|
|
25
|
-
const
|
|
27
|
+
const StoryInputContent = ({
|
|
26
28
|
type = 'default',
|
|
27
29
|
label,
|
|
28
30
|
description,
|
|
@@ -32,7 +34,6 @@ const StoryInput = ({
|
|
|
32
34
|
validationMessage,
|
|
33
35
|
...props
|
|
34
36
|
}: StoryInputProps) => {
|
|
35
|
-
// TODO(thure): Implement
|
|
36
37
|
return (
|
|
37
38
|
<Input.Root {...{ validationValence }}>
|
|
38
39
|
<Input.Label srOnly={labelVisuallyHidden}>{label}</Input.Label>
|
|
@@ -53,7 +54,25 @@ const StoryInput = ({
|
|
|
53
54
|
);
|
|
54
55
|
};
|
|
55
56
|
|
|
57
|
+
const StoryInput = (props: StoryInputProps) => {
|
|
58
|
+
// TODO(thure): Implement
|
|
59
|
+
return (
|
|
60
|
+
<div className='space-b-4'>
|
|
61
|
+
<div className={mx(baseSurface, 'p-4')}>
|
|
62
|
+
<StoryInputContent {...props} />
|
|
63
|
+
</div>
|
|
64
|
+
<div className={mx(groupSurface, 'p-4 rounded-lg', surfaceElevation({ elevation: 'group' }))}>
|
|
65
|
+
<StoryInputContent {...props} />
|
|
66
|
+
</div>
|
|
67
|
+
<div className={mx(chromeSurface, 'p-4 rounded-lg', surfaceElevation({ elevation: 'chrome' }))}>
|
|
68
|
+
<StoryInputContent {...props} />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
56
74
|
export default {
|
|
75
|
+
title: 'DXOS UI/Input',
|
|
57
76
|
component: StoryInput,
|
|
58
77
|
// TODO(thure): Refactor
|
|
59
78
|
argTypes: {
|
|
@@ -69,6 +88,8 @@ export default {
|
|
|
69
88
|
options: ['default', 'textarea', 'pin'],
|
|
70
89
|
},
|
|
71
90
|
},
|
|
91
|
+
decorators: [withTheme],
|
|
92
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
72
93
|
};
|
|
73
94
|
|
|
74
95
|
export const Default = {
|
|
@@ -175,11 +175,13 @@ type TextInputProps = InputSharedProps & ThemedClassName<TextInputPrimitiveProps
|
|
|
175
175
|
const TextInput = forwardRef<HTMLInputElement, InputScopedProps<TextInputProps>>(
|
|
176
176
|
({ __inputScope, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
|
|
177
177
|
const { hasIosKeyboard } = useThemeContext();
|
|
178
|
-
const
|
|
178
|
+
const themeContextValue = useThemeContext();
|
|
179
179
|
const density = useDensityContext(propsDensity);
|
|
180
180
|
const elevation = useElevationContext(propsElevation);
|
|
181
181
|
const { validationValence } = useInputContext(INPUT_NAME, __inputScope);
|
|
182
182
|
|
|
183
|
+
const { tx } = themeContextValue;
|
|
184
|
+
|
|
183
185
|
return (
|
|
184
186
|
<TextInputPrimitive
|
|
185
187
|
{...props}
|
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
import '@dxosTheme';
|
|
6
6
|
|
|
7
7
|
import { Link } from './Link';
|
|
8
|
+
import { withTheme } from '../../testing';
|
|
8
9
|
|
|
9
10
|
export default {
|
|
11
|
+
title: 'DXOS UI/Link',
|
|
10
12
|
component: Link,
|
|
13
|
+
decorators: [withTheme],
|
|
14
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
11
15
|
} as any;
|
|
12
16
|
|
|
13
17
|
export const Default = { args: { children: 'Hello', href: '#' } };
|
|
@@ -13,9 +13,13 @@ import React, { type FC, type ReactNode, useState } from 'react';
|
|
|
13
13
|
import { getSize, mx, surfaceElevation } from '@dxos/react-ui-theme';
|
|
14
14
|
|
|
15
15
|
import { List, ListItem, type ListProps, type ListScopedProps } from './List';
|
|
16
|
+
import { withTheme } from '../../testing';
|
|
16
17
|
|
|
17
18
|
export default {
|
|
19
|
+
title: 'DXOS UI/List',
|
|
18
20
|
component: List as FC<ListProps>,
|
|
21
|
+
decorators: [withTheme],
|
|
22
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Tree, TreeItem } from './Tree';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
|
|
11
12
|
type StorybookTreeProps = {
|
|
12
13
|
data: any;
|
|
@@ -55,7 +56,10 @@ const StorybookTree = ({ data }: StorybookTreeProps) => {
|
|
|
55
56
|
};
|
|
56
57
|
|
|
57
58
|
export default {
|
|
59
|
+
title: 'DXOS UI/Tree',
|
|
58
60
|
component: StorybookTree,
|
|
61
|
+
decorators: [withTheme],
|
|
62
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
export const Default = {
|
|
@@ -7,6 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
9
|
import { Main, useSidebars } from './Main';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
10
11
|
import { Button } from '../Buttons';
|
|
11
12
|
|
|
12
13
|
type StoryMainArgs = {};
|
|
@@ -44,7 +45,12 @@ const StoryMain = (_args: StoryMainArgs) => {
|
|
|
44
45
|
);
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
export default {
|
|
48
|
+
export default {
|
|
49
|
+
title: 'DXOS UI/Main',
|
|
50
|
+
component: StoryMain,
|
|
51
|
+
decorators: [withTheme],
|
|
52
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
53
|
+
};
|
|
48
54
|
|
|
49
55
|
export const Default = {
|
|
50
56
|
args: {},
|
|
@@ -10,6 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { type MessageValence } from '@dxos/react-ui-types';
|
|
11
11
|
|
|
12
12
|
import { Message } from './Message';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
13
14
|
|
|
14
15
|
type StoryMessageProps = {
|
|
15
16
|
valence: MessageValence;
|
|
@@ -27,7 +28,10 @@ const StoryMessage = ({ valence, title, body }: StoryMessageProps) => (
|
|
|
27
28
|
);
|
|
28
29
|
|
|
29
30
|
export default {
|
|
31
|
+
title: 'DXOS UI/Message',
|
|
30
32
|
component: StoryMessage,
|
|
33
|
+
decorators: [withTheme],
|
|
34
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
export const Default = {
|
|
@@ -8,6 +8,7 @@ import { faker } from '@faker-js/faker';
|
|
|
8
8
|
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Popover } from './Popover';
|
|
11
|
+
import { withTheme } from '../../testing';
|
|
11
12
|
import { Button } from '../Buttons';
|
|
12
13
|
|
|
13
14
|
faker.seed(1234);
|
|
@@ -27,7 +28,10 @@ const StorybookPopover = ({ openTrigger, children }: PropsWithChildren<{ openTri
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
export default {
|
|
31
|
+
title: 'DXOS UI/Popover',
|
|
30
32
|
component: StorybookPopover,
|
|
33
|
+
decorators: [withTheme],
|
|
34
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
export const Default = {
|
|
@@ -10,6 +10,7 @@ import React, { type PropsWithChildren } from 'react';
|
|
|
10
10
|
import { groupSurface, surfaceElevation } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { ScrollArea } from './ScrollArea';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
13
14
|
|
|
14
15
|
faker.seed(1234);
|
|
15
16
|
|
|
@@ -33,7 +34,10 @@ const StorybookScrollArea = ({ children }: PropsWithChildren<{}>) => {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export default {
|
|
37
|
+
title: 'DXOS UI/Scroll area',
|
|
36
38
|
component: StorybookScrollArea,
|
|
39
|
+
decorators: [withTheme],
|
|
40
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
export const Default = {
|
|
@@ -10,6 +10,7 @@ import React, { type FC, type PropsWithChildren, useState } from 'react';
|
|
|
10
10
|
import { type Density } from '@dxos/react-ui-types';
|
|
11
11
|
|
|
12
12
|
import { Select } from './Select';
|
|
13
|
+
import { withTheme } from '../../testing';
|
|
13
14
|
import { DensityProvider } from '../DensityProvider';
|
|
14
15
|
|
|
15
16
|
faker.seed(1234);
|
|
@@ -58,7 +59,10 @@ const StorybookSelect = ({ items = [] }: PropsWithChildren<{ items: ItemProps[]
|
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
export default {
|
|
62
|
+
title: 'DXOS UI/Select',
|
|
61
63
|
component: createDensityTest(StorybookSelect),
|
|
64
|
+
decorators: [withTheme],
|
|
65
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
62
66
|
};
|
|
63
67
|
|
|
64
68
|
export const Default = {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { Status } from './Status';
|
|
10
|
+
import { withTheme } from '../../testing';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'DXOS UI/Status',
|
|
14
|
+
component: Status,
|
|
15
|
+
actions: { argTypesRegex: '^on.*' },
|
|
16
|
+
decorators: [withTheme],
|
|
17
|
+
parameters: { chromatic: { disableSnapshot: false } },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Normal = (props: any) => {
|
|
21
|
+
return (
|
|
22
|
+
<div className='m-5 space-b-5'>
|
|
23
|
+
<Status classNames='block' progress={0} {...props} />
|
|
24
|
+
<Status classNames='block' progress={0.3} {...props} />
|
|
25
|
+
<Status classNames='block' progress={0.7} {...props} />
|
|
26
|
+
<Status classNames='block' progress={1} {...props} />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Indeterminate = (props: any) => {
|
|
32
|
+
return (
|
|
33
|
+
<div className='m-5'>
|
|
34
|
+
<Status classNames='block' indeterminate {...props} />
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|