@dxos/react-ui 0.8.2-main.fbd8ed0 → 0.8.2-staging.42af850
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-5Y5JI6KC.mjs +4355 -0
- package/dist/lib/browser/chunk-5Y5JI6KC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +73 -3519
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +85 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/node/chunk-KMS7RFL7.cjs +4340 -0
- package/dist/lib/node/chunk-KMS7RFL7.cjs.map +7 -0
- package/dist/lib/node/index.cjs +69 -3481
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +114 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-ANVE7WX5.mjs +4357 -0
- package/dist/lib/node-esm/chunk-ANVE7WX5.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +72 -3519
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +86 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/components/Avatars/Avatar.d.ts +2 -2
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +1 -2
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +2 -2
- package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.stories.d.ts +6 -0
- package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +0 -2
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +0 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/index.d.ts +1 -1
- package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
- package/dist/types/src/testing/decorators/{withVariants.d.ts → withSurfaceVariantsLayout.d.ts} +2 -3
- package/dist/types/src/testing/decorators/withSurfaceVariantsLayout.d.ts.map +1 -0
- package/package.json +24 -15
- package/src/components/Avatars/Avatar.tsx +7 -8
- package/src/components/Buttons/Button.stories.tsx +2 -2
- package/src/components/Buttons/IconButton.tsx +4 -8
- package/src/components/Dialogs/AlertDialog.stories.tsx +2 -2
- package/src/components/Dialogs/Dialog.stories.tsx +2 -2
- package/src/components/Input/Input.stories.tsx +2 -2
- package/src/components/Main/Main.tsx +1 -0
- package/src/components/Message/Message.stories.tsx +7 -1
- package/src/components/ScrollArea/ScrollArea.stories.tsx +2 -2
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/Tooltip/Tooltip.tsx +1 -16
- package/src/playground/Controls.stories.tsx +2 -2
- package/src/testing/decorators/index.ts +1 -1
- package/src/testing/decorators/withSurfaceVariantsLayout.tsx +53 -0
- package/dist/types/src/testing/decorators/withVariants.d.ts.map +0 -1
- package/src/testing/decorators/withVariants.tsx +0 -45
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type ButtonProps } from './Button';
|
|
3
3
|
import { type ThemedClassName } from '../../util';
|
|
4
4
|
import { type IconProps } from '../Icon';
|
|
@@ -11,7 +11,6 @@ type IconButtonProps = Omit<ButtonProps, 'children'> & Pick<IconProps, 'icon' |
|
|
|
11
11
|
iconClassNames?: ThemedClassName<any>['classNames'];
|
|
12
12
|
tooltipPortal?: boolean;
|
|
13
13
|
tooltipSide?: TooltipSide;
|
|
14
|
-
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
15
14
|
};
|
|
16
15
|
declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
16
|
export { IconButton };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Buttons/IconButton.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/Buttons/IconButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAEvD,KAAK,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAClD,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AA4BJ,QAAA,MAAM,UAAU,wGAMf,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
type
|
|
3
|
+
type StoryProps = Partial<{
|
|
4
4
|
title: string;
|
|
5
5
|
description: string;
|
|
6
6
|
body: string;
|
|
@@ -21,7 +21,7 @@ declare const _default: {
|
|
|
21
21
|
Cancel: React.FunctionComponent<import("@radix-ui/react-alert-dialog").AlertDialogCancelProps>;
|
|
22
22
|
Action: React.FunctionComponent<import("@radix-ui/react-alert-dialog").AlertDialogActionProps>;
|
|
23
23
|
};
|
|
24
|
-
render: ({ title, openTrigger, description, body, cancelTrigger, actionTrigger }:
|
|
24
|
+
render: ({ title, openTrigger, description, body, cancelTrigger, actionTrigger }: StoryProps) => React.JSX.Element;
|
|
25
25
|
decorators: import("@storybook/react").Decorator[];
|
|
26
26
|
parameters: {
|
|
27
27
|
chromatic: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialogs/AlertDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,
|
|
1
|
+
{"version":3,"file":"AlertDialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialogs/AlertDialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,UAAU,GAAG,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;;;;;;;;;;;;;;sFAE4F,UAAU;;;;;;;;AA0BzG,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;CASnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@dxos-theme';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
type
|
|
3
|
+
type StoryProps = Partial<{
|
|
4
4
|
title: string;
|
|
5
5
|
description: string;
|
|
6
6
|
body: string;
|
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
Description: React.ForwardRefExoticComponent<import("./Dialog").DialogTitleProps>;
|
|
21
21
|
Close: React.FunctionComponent<import("@radix-ui/react-dialog").DialogCloseProps>;
|
|
22
22
|
};
|
|
23
|
-
render: ({ title, openTrigger, description, body, closeTrigger, blockAlign }:
|
|
23
|
+
render: ({ title, openTrigger, description, body, closeTrigger, blockAlign }: StoryProps) => React.JSX.Element;
|
|
24
24
|
decorators: import("@storybook/react").Decorator[];
|
|
25
25
|
parameters: {
|
|
26
26
|
chromatic: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialogs/Dialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,
|
|
1
|
+
{"version":3,"file":"Dialog.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dialogs/Dialog.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,KAAK,UAAU,GAAG,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,QAAQ,GAAG,OAAO,CAAC;CAChC,CAAC,CAAC;;;;;;;;;;;;;kFAEwF,UAAU;;;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-
{"version":3,"file":"Message.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Message/Message.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;;;;;;;;uCAE8C,UAAU
|
|
1
|
+
{"version":3,"file":"Message.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Message/Message.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAK3D,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;;;;;;;;uCAE8C,UAAU;;;;;;;;;;;;;;AAS1D,wBAYE;AAEF,eAAO,MAAM,OAAO;;;;;;CAMnB,CAAC"}
|
|
@@ -50,7 +50,6 @@ type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
|
|
|
50
50
|
type TooltipTriggerProps = PrimitiveButtonProps & Pick<TooltipProps, 'delayDuration'> & {
|
|
51
51
|
content?: string;
|
|
52
52
|
side?: TooltipSide;
|
|
53
|
-
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
54
53
|
onInteract?: (event: SyntheticEvent) => void;
|
|
55
54
|
};
|
|
56
55
|
interface TooltipContentProps extends TooltipContentImplProps {
|
|
@@ -88,7 +87,6 @@ export declare const Tooltip: {
|
|
|
88
87
|
}, "ref"> & Pick<TooltipProps, "delayDuration"> & {
|
|
89
88
|
content?: string;
|
|
90
89
|
side?: TooltipSide;
|
|
91
|
-
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
92
90
|
onInteract?: (event: SyntheticEvent) => void;
|
|
93
91
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
94
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG5D,OAAO,KAAK,EAAE,EACZ,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EAEf,KAAK,cAAc,EAEnB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAIf,KAAK,kBAAkB,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG;IAAE,cAAc,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AACjE,QAAA,MAA6B,kBAAkB,+CAAsD,CAAC;AAWtG,KAAK,mBAAmB,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,cAAc,EAAE,QAAQ,GAAG,cAAc,GAAG,cAAc,CAAC;IAC3D,OAAO,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtC,eAAe,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;IAC7D,cAAc,IAAI,IAAI,CAAC;IACvB,cAAc,IAAI,IAAI,CAAC;IACvB,MAAM,IAAI,IAAI,CAAC;IACf,OAAO,IAAI,IAAI,CAAC;IAChB,wBAAwB,CAAC,SAAS,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default: {
|
|
|
18
18
|
}, "ref"> & Pick<import("@radix-ui/react-tooltip").TooltipProps, "delayDuration"> & {
|
|
19
19
|
content?: string;
|
|
20
20
|
side?: import("./Tooltip").TooltipSide;
|
|
21
|
-
suppressNextTooltip?: React.MutableRefObject<boolean>;
|
|
22
21
|
onInteract?: (event: React.SyntheticEvent) => void;
|
|
23
22
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
24
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC
|
|
1
|
+
{"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AACrB,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,KAAK,UAAU,GAAG;IAChB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;;;;;;;;;;;;;;;wCAE+C,UAAU;;;;;;;;AAY3D,wBAME;AAEF,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYnB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;CAavB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;CActB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,6BAA6B,CAAC"}
|
package/dist/types/src/testing/decorators/{withVariants.d.ts → withSurfaceVariantsLayout.d.ts}
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
1
|
import { type Decorator } from '@storybook/react';
|
|
3
2
|
import { type Density, type Elevation } from '@dxos/react-ui-types';
|
|
4
3
|
type Config = {
|
|
@@ -8,6 +7,6 @@ type Config = {
|
|
|
8
7
|
}[];
|
|
9
8
|
densities?: Density[];
|
|
10
9
|
};
|
|
11
|
-
export declare const
|
|
10
|
+
export declare const withSurfaceVariantsLayout: ({ elevations, densities, }?: Config) => Decorator;
|
|
12
11
|
export {};
|
|
13
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=withSurfaceVariantsLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withSurfaceVariantsLayout.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/withSurfaceVariantsLayout.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEpE,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAyBF,eAAO,MAAM,yBAAyB,GAAI,6BAOvC,MAAW,KAAG,SAOhB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
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",
|
|
@@ -13,11 +13,20 @@
|
|
|
13
13
|
"types": "./dist/types/src/index.d.ts",
|
|
14
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
15
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./testing": {
|
|
18
|
+
"types": "./dist/types/src/testing/index.d.ts",
|
|
19
|
+
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
20
|
+
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
16
21
|
}
|
|
17
22
|
},
|
|
18
23
|
"types": "dist/types/src/index.d.ts",
|
|
19
24
|
"typesVersions": {
|
|
20
|
-
"*": {
|
|
25
|
+
"*": {
|
|
26
|
+
"testing": [
|
|
27
|
+
"./dist/types/src/testing/index.d.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
21
30
|
},
|
|
22
31
|
"files": [
|
|
23
32
|
"dist",
|
|
@@ -26,7 +35,7 @@
|
|
|
26
35
|
"dependencies": {
|
|
27
36
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
28
37
|
"@fluentui/react-tabster": "^9.24.2",
|
|
29
|
-
"@
|
|
38
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
30
39
|
"@radix-ui/primitive": "1.1.1",
|
|
31
40
|
"@radix-ui/react-alert-dialog": "1.1.6",
|
|
32
41
|
"@radix-ui/react-avatar": "1.1.3",
|
|
@@ -63,14 +72,14 @@
|
|
|
63
72
|
"keyborg": "^2.5.0",
|
|
64
73
|
"react-i18next": "^11.18.6",
|
|
65
74
|
"react-remove-scroll": "^2.6.0",
|
|
66
|
-
"@dxos/debug": "0.8.2-
|
|
67
|
-
"@dxos/lit-ui": "0.8.2-
|
|
68
|
-
"@dxos/react-
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-list": "0.8.2-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/react-ui-types": "0.8.2-
|
|
73
|
-
"@dxos/util": "0.8.2-
|
|
75
|
+
"@dxos/debug": "0.8.2-staging.42af850",
|
|
76
|
+
"@dxos/lit-ui": "0.8.2-staging.42af850",
|
|
77
|
+
"@dxos/react-input": "0.8.2-staging.42af850",
|
|
78
|
+
"@dxos/react-hooks": "0.8.2-staging.42af850",
|
|
79
|
+
"@dxos/react-list": "0.8.2-staging.42af850",
|
|
80
|
+
"@dxos/log": "0.8.2-staging.42af850",
|
|
81
|
+
"@dxos/react-ui-types": "0.8.2-staging.42af850",
|
|
82
|
+
"@dxos/util": "0.8.2-staging.42af850"
|
|
74
83
|
},
|
|
75
84
|
"devDependencies": {
|
|
76
85
|
"@dnd-kit/core": "^6.0.5",
|
|
@@ -82,15 +91,15 @@
|
|
|
82
91
|
"react": "~18.2.0",
|
|
83
92
|
"react-dom": "~18.2.0",
|
|
84
93
|
"vite": "5.4.7",
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/util": "0.8.2-
|
|
94
|
+
"@dxos/random": "0.8.2-staging.42af850",
|
|
95
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
96
|
+
"@dxos/util": "0.8.2-staging.42af850"
|
|
88
97
|
},
|
|
89
98
|
"peerDependencies": {
|
|
90
99
|
"@phosphor-icons/react": "^2.1.5",
|
|
91
100
|
"react": "~18.2.0",
|
|
92
101
|
"react-dom": "~18.2.0",
|
|
93
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
102
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850"
|
|
94
103
|
},
|
|
95
104
|
"publishConfig": {
|
|
96
105
|
"access": "public"
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos/lit-ui/dx-avatar.pcss';
|
|
6
6
|
|
|
7
|
-
import { createComponent } from '@lit/react';
|
|
8
7
|
import { createContext } from '@radix-ui/react-context';
|
|
9
8
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
10
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
10
|
import React, { type ComponentProps, type ComponentPropsWithRef, forwardRef, type PropsWithChildren } from 'react';
|
|
12
11
|
|
|
13
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
type AvatarVariant,
|
|
14
|
+
type AvatarStatus,
|
|
15
|
+
type AvatarAnimation,
|
|
16
|
+
type DxAvatar as NaturalDxAvatar,
|
|
17
|
+
} from '@dxos/lit-ui';
|
|
18
|
+
import { DxAvatar } from '@dxos/lit-ui/react';
|
|
14
19
|
import { useId } from '@dxos/react-hooks';
|
|
15
20
|
import { mx } from '@dxos/react-ui-theme';
|
|
16
21
|
|
|
@@ -33,12 +38,6 @@ const AvatarRoot = ({ children, labelId: propsLabelId, descriptionId: propsDescr
|
|
|
33
38
|
return <AvatarProvider {...{ labelId, descriptionId }}>{children}</AvatarProvider>;
|
|
34
39
|
};
|
|
35
40
|
|
|
36
|
-
const DxAvatar = createComponent({
|
|
37
|
-
tagName: 'dx-avatar',
|
|
38
|
-
elementClass: NaturalDxAvatar,
|
|
39
|
-
react: React,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
41
|
type AvatarContentProps = ThemedClassName<Omit<ComponentProps<typeof DxAvatar>, 'children'>>;
|
|
43
42
|
|
|
44
43
|
const AvatarContent = forwardRef<NaturalDxAvatar, AvatarContentProps>(
|
|
@@ -9,7 +9,7 @@ import { type StoryObj, type Meta } from '@storybook/react';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
|
|
11
11
|
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
12
|
-
import {
|
|
12
|
+
import { withSurfaceVariantsLayout, withTheme } from '../../testing';
|
|
13
13
|
|
|
14
14
|
const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
15
15
|
return (
|
|
@@ -36,7 +36,7 @@ const meta: Meta<typeof Button> = {
|
|
|
36
36
|
title: 'ui/react-ui-core/Button',
|
|
37
37
|
component: Button,
|
|
38
38
|
render: DefaultStory,
|
|
39
|
-
decorators: [
|
|
39
|
+
decorators: [withSurfaceVariantsLayout(), withTheme],
|
|
40
40
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
41
41
|
};
|
|
42
42
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { forwardRef
|
|
5
|
+
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Button, type ButtonProps } from './Button';
|
|
8
8
|
import { useThemeContext } from '../../hooks';
|
|
@@ -19,16 +19,15 @@ type IconButtonProps = Omit<ButtonProps, 'children'> &
|
|
|
19
19
|
iconClassNames?: ThemedClassName<any>['classNames'];
|
|
20
20
|
tooltipPortal?: boolean;
|
|
21
21
|
tooltipSide?: TooltipSide;
|
|
22
|
-
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
26
|
-
({ noTooltip, tooltipPortal = true, tooltipSide,
|
|
25
|
+
({ noTooltip, tooltipPortal = true, tooltipSide, ...props }, forwardedRef) => {
|
|
27
26
|
if (noTooltip) {
|
|
28
27
|
return <LabelledIconButton {...props} ref={forwardedRef} />;
|
|
29
28
|
}
|
|
30
29
|
return (
|
|
31
|
-
<Tooltip.Trigger asChild content={props.label} side={tooltipSide}
|
|
30
|
+
<Tooltip.Trigger asChild content={props.label} side={tooltipSide}>
|
|
32
31
|
<LabelledIconButton {...props} ref={forwardedRef} />
|
|
33
32
|
</Tooltip.Trigger>
|
|
34
33
|
);
|
|
@@ -36,10 +35,7 @@ const IconOnlyButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
|
36
35
|
);
|
|
37
36
|
|
|
38
37
|
const LabelledIconButton = forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
39
|
-
(
|
|
40
|
-
{ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, suppressNextTooltip, ...props },
|
|
41
|
-
forwardedRef,
|
|
42
|
-
) => {
|
|
38
|
+
({ icon, size, iconOnly, label, classNames, iconClassNames, caretDown, ...props }, forwardedRef) => {
|
|
43
39
|
const { tx } = useThemeContext();
|
|
44
40
|
return (
|
|
45
41
|
<Button {...props} classNames={tx('iconButton.root', 'iconButton', {}, classNames)} ref={forwardedRef}>
|
|
@@ -11,7 +11,7 @@ import { withTheme } from '../../testing';
|
|
|
11
11
|
import { Button } from '../Buttons';
|
|
12
12
|
import { Toolbar } from '../Toolbar';
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type StoryProps = Partial<{
|
|
15
15
|
title: string;
|
|
16
16
|
description: string;
|
|
17
17
|
body: string;
|
|
@@ -20,7 +20,7 @@ type DefaultStoryProps = Partial<{
|
|
|
20
20
|
openTrigger: string;
|
|
21
21
|
}>;
|
|
22
22
|
|
|
23
|
-
const DefaultStory = ({ title, openTrigger, description, body, cancelTrigger, actionTrigger }:
|
|
23
|
+
const DefaultStory = ({ title, openTrigger, description, body, cancelTrigger, actionTrigger }: StoryProps) => {
|
|
24
24
|
return (
|
|
25
25
|
<AlertDialog.Root defaultOpen>
|
|
26
26
|
<AlertDialog.Trigger asChild>
|
|
@@ -10,7 +10,7 @@ import { Dialog } from './Dialog';
|
|
|
10
10
|
import { withTheme } from '../../testing';
|
|
11
11
|
import { Button } from '../Buttons';
|
|
12
12
|
|
|
13
|
-
type
|
|
13
|
+
type StoryProps = Partial<{
|
|
14
14
|
title: string;
|
|
15
15
|
description: string;
|
|
16
16
|
body: string;
|
|
@@ -19,7 +19,7 @@ type DefaultStoryProps = Partial<{
|
|
|
19
19
|
blockAlign: 'center' | 'start';
|
|
20
20
|
}>;
|
|
21
21
|
|
|
22
|
-
const DefaultStory = ({ title, openTrigger, description, body, closeTrigger, blockAlign }:
|
|
22
|
+
const DefaultStory = ({ title, openTrigger, description, body, closeTrigger, blockAlign }: StoryProps) => {
|
|
23
23
|
return (
|
|
24
24
|
<Dialog.Root defaultOpen>
|
|
25
25
|
<Dialog.Trigger asChild>
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
|
-
import { baseSurface, modalSurface,
|
|
10
|
+
import { baseSurface, modalSurface, activeSurface, mx, surfaceShadow } from '@dxos/react-ui-theme';
|
|
11
11
|
import { type MessageValence } from '@dxos/react-ui-types';
|
|
12
12
|
|
|
13
13
|
import {
|
|
@@ -78,7 +78,7 @@ const DefaultStory = (props: BaseProps) => {
|
|
|
78
78
|
<div className={mx(baseSurface, 'p-4')}>
|
|
79
79
|
<Wrapper {...props} />
|
|
80
80
|
</div>
|
|
81
|
-
<div className={mx(
|
|
81
|
+
<div className={mx(activeSurface, 'p-4 rounded-lg', surfaceShadow({ elevation: 'positioned' }))}>
|
|
82
82
|
<Wrapper {...props} />
|
|
83
83
|
</div>
|
|
84
84
|
<div className={mx(modalSurface, 'p-4 rounded-lg', surfaceShadow({ elevation: 'dialog' }))}>
|
|
@@ -308,6 +308,7 @@ const MainContent = forwardRef<HTMLDivElement, MainProps>(
|
|
|
308
308
|
{...props}
|
|
309
309
|
data-sidebar-inline-start-state={navigationSidebarState}
|
|
310
310
|
data-sidebar-inline-end-state={complementarySidebarState}
|
|
311
|
+
data-handles-focus={handlesFocus}
|
|
311
312
|
className={tx('main.content', 'main', { bounce, handlesFocus }, classNames)}
|
|
312
313
|
ref={forwardedRef}
|
|
313
314
|
>
|
|
@@ -33,11 +33,17 @@ export default {
|
|
|
33
33
|
render: DefaultStory,
|
|
34
34
|
decorators: [withTheme],
|
|
35
35
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
36
|
+
argTypes: {
|
|
37
|
+
valence: {
|
|
38
|
+
control: 'select',
|
|
39
|
+
options: ['success', 'info', 'warning', 'error', 'neutral'],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
36
42
|
};
|
|
37
43
|
|
|
38
44
|
export const Default = {
|
|
39
45
|
args: {
|
|
40
|
-
valence: '
|
|
46
|
+
valence: 'neutral',
|
|
41
47
|
title: 'Alert title',
|
|
42
48
|
body: 'Alert content',
|
|
43
49
|
},
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import React, { type PropsWithChildren } from 'react';
|
|
8
8
|
|
|
9
9
|
import { faker } from '@dxos/random';
|
|
10
|
-
import {
|
|
10
|
+
import { activeSurface, surfaceShadow } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { ScrollArea } from './ScrollArea';
|
|
13
13
|
import { withTheme } from '../../testing';
|
|
@@ -17,7 +17,7 @@ faker.seed(1234);
|
|
|
17
17
|
const DefaultStory = ({ children }: PropsWithChildren<{}>) => {
|
|
18
18
|
return (
|
|
19
19
|
<ScrollArea.Root
|
|
20
|
-
classNames={['is-[300px] bs-[400px] rounded',
|
|
20
|
+
classNames={['is-[300px] bs-[400px] rounded', activeSurface, surfaceShadow({ elevation: 'positioned' })]}
|
|
21
21
|
>
|
|
22
22
|
<ScrollArea.Viewport classNames='rounded p-4'>
|
|
23
23
|
<p>{children}</p>
|
|
@@ -10,7 +10,7 @@ import React, { useState } from 'react';
|
|
|
10
10
|
import { faker } from '@dxos/random';
|
|
11
11
|
|
|
12
12
|
import { Select } from './Select';
|
|
13
|
-
import {
|
|
13
|
+
import { withSurfaceVariantsLayout, withTheme } from '../../testing';
|
|
14
14
|
|
|
15
15
|
faker.seed(1234);
|
|
16
16
|
|
|
@@ -50,6 +50,6 @@ export const Default: StoryObj<StoryProps> = {
|
|
|
50
50
|
export default {
|
|
51
51
|
title: 'ui/react-ui-core/Select',
|
|
52
52
|
render: DefaultStory,
|
|
53
|
-
decorators: [
|
|
53
|
+
decorators: [withSurfaceVariantsLayout(), withTheme],
|
|
54
54
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
55
55
|
};
|
|
@@ -251,7 +251,6 @@ type TooltipTriggerProps = PrimitiveButtonProps &
|
|
|
251
251
|
Pick<TooltipProps, 'delayDuration'> & {
|
|
252
252
|
content?: string;
|
|
253
253
|
side?: TooltipSide;
|
|
254
|
-
suppressNextTooltip?: MutableRefObject<boolean>;
|
|
255
254
|
onInteract?: (event: SyntheticEvent) => void;
|
|
256
255
|
};
|
|
257
256
|
|
|
@@ -262,7 +261,6 @@ const TooltipTrigger = forwardRef<TooltipTriggerElement, TooltipTriggerProps>(
|
|
|
262
261
|
onInteract,
|
|
263
262
|
// TODO(thure): Pass `delayDuration` into the context.
|
|
264
263
|
delayDuration: _delayDuration,
|
|
265
|
-
suppressNextTooltip,
|
|
266
264
|
side,
|
|
267
265
|
content,
|
|
268
266
|
...triggerProps
|
|
@@ -313,20 +311,7 @@ const TooltipTrigger = forwardRef<TooltipTriggerElement, TooltipTriggerProps>(
|
|
|
313
311
|
isPointerDownRef.current = true;
|
|
314
312
|
document.addEventListener('pointerup', handlePointerUp, { once: true });
|
|
315
313
|
})}
|
|
316
|
-
onFocus={
|
|
317
|
-
if (!isPointerDownRef.current) {
|
|
318
|
-
onInteract?.(event);
|
|
319
|
-
if (event.defaultPrevented) {
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
if (suppressNextTooltip?.current) {
|
|
323
|
-
suppressNextTooltip.current = false;
|
|
324
|
-
} else {
|
|
325
|
-
context.onTriggerChange(ref.current);
|
|
326
|
-
context.onOpen();
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
})}
|
|
314
|
+
onFocus={props.onFocus}
|
|
330
315
|
onBlur={composeEventHandlers(props.onBlur, context.onClose)}
|
|
331
316
|
onClick={composeEventHandlers(props.onClick, context.onClose)}
|
|
332
317
|
/>
|
|
@@ -8,7 +8,7 @@ import { FileTs, FileJs, ArrowClockwise, Bug, TextUnderline, TextB, TextItalic }
|
|
|
8
8
|
import React, { useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { Input, Select, Toggle, Toolbar } from '../components';
|
|
11
|
-
import { withTheme,
|
|
11
|
+
import { withTheme, withSurfaceVariantsLayout } from '../testing';
|
|
12
12
|
|
|
13
13
|
const DefaultStory = () => {
|
|
14
14
|
const [checked, setChecked] = useState<boolean>(false);
|
|
@@ -84,7 +84,7 @@ const DefaultStory = () => {
|
|
|
84
84
|
export default {
|
|
85
85
|
title: 'ui/react-ui-core/Playground/Controls',
|
|
86
86
|
render: DefaultStory,
|
|
87
|
-
decorators: [
|
|
87
|
+
decorators: [withSurfaceVariantsLayout(), withTheme],
|
|
88
88
|
parameters: { chromatic: { disableSnapshot: false } },
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Decorator } from '@storybook/react';
|
|
6
|
+
import React, { type ComponentType, type PropsWithChildren } from 'react';
|
|
7
|
+
|
|
8
|
+
import { mx, surfaceShadow } from '@dxos/react-ui-theme';
|
|
9
|
+
import { type Density, type Elevation } from '@dxos/react-ui-types';
|
|
10
|
+
|
|
11
|
+
type Config = {
|
|
12
|
+
elevations?: { elevation: Elevation; surface?: string }[];
|
|
13
|
+
densities?: Density[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const Container = ({ children, elevation, surface }: PropsWithChildren<{ elevation: Elevation; surface?: string }>) => (
|
|
17
|
+
<div className={mx('p-4 mlb-4 rounded-md border border-separator', surface, surfaceShadow({ elevation }))}>
|
|
18
|
+
{children}
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const Panel = ({
|
|
23
|
+
Story,
|
|
24
|
+
elevations,
|
|
25
|
+
densities,
|
|
26
|
+
className,
|
|
27
|
+
}: { Story: ComponentType } & Config & { className?: string }) => (
|
|
28
|
+
<div className={mx('flex flex-col h-full p-4', className)}>
|
|
29
|
+
{elevations?.map(({ elevation, surface }) =>
|
|
30
|
+
densities?.map((density) => (
|
|
31
|
+
<Container key={`${elevation}--${density}`} surface={surface} elevation={elevation}>
|
|
32
|
+
<Story />
|
|
33
|
+
</Container>
|
|
34
|
+
)),
|
|
35
|
+
)}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const withSurfaceVariantsLayout = ({
|
|
40
|
+
elevations = [
|
|
41
|
+
{ elevation: 'base', surface: 'bg-baseSurface' },
|
|
42
|
+
{ elevation: 'positioned', surface: 'bg-cardSurface' },
|
|
43
|
+
{ elevation: 'dialog', surface: 'bg-modalSurface' },
|
|
44
|
+
],
|
|
45
|
+
densities = ['coarse'],
|
|
46
|
+
}: Config = {}): Decorator => {
|
|
47
|
+
return (Story) => (
|
|
48
|
+
<div className='fixed inset-0 grid grid-cols-2 overflow-y-auto'>
|
|
49
|
+
<Panel Story={Story} className='light' elevations={elevations} densities={densities} />
|
|
50
|
+
<Panel Story={Story} className='dark' elevations={elevations} densities={densities} />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withVariants.d.ts","sourceRoot":"","sources":["../../../../../src/testing/decorators/withVariants.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIlD,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIpE,KAAK,MAAM,GAAG;IACZ,UAAU,CAAC,EAAE;QAAE,SAAS,EAAE,SAAS,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1D,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,6BAO1B,MAAW,KAAG,SAkBhB,CAAC"}
|