@dxos/react-ui 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-T6YPS45E.mjs → chunk-BKNGMGOK.mjs} +85 -88
- package/dist/lib/browser/chunk-BKNGMGOK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +1 -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 +3 -4
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node-esm/{chunk-TYVQJ4KW.mjs → chunk-D2HZS6F4.mjs} +85 -88
- package/dist/lib/node-esm/chunk-D2HZS6F4.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +1 -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 +3 -4
- 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 +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts +1 -1
- package/dist/types/src/components/Buttons/IconButton.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +1 -1
- 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.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.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.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 +2 -2
- 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 +2 -2
- package/dist/types/src/components/Lists/List.d.ts.map +1 -1
- 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.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.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.map +1 -1
- package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts +1 -1
- package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts.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.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.map +1 -1
- package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/ThemeProvider.d.ts.map +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.d.ts +1 -1
- package/dist/types/src/components/ThemeProvider/TranslationsProvider.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.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.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.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.map +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts +1 -1
- package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
- package/dist/types/src/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 +16 -14
- package/src/components/Avatars/Avatar.stories.tsx +2 -1
- package/src/components/Avatars/Avatar.tsx +3 -3
- package/src/components/Avatars/AvatarGroup.stories.tsx +2 -1
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +2 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Buttons/Button.stories.tsx +6 -5
- package/src/components/Buttons/IconButton.stories.tsx +2 -1
- package/src/components/Buttons/IconButton.tsx +2 -1
- package/src/components/Buttons/Toggle.stories.tsx +4 -3
- package/src/components/Buttons/ToggleGroup.stories.tsx +5 -4
- package/src/components/Buttons/ToggleGroup.tsx +3 -3
- package/src/components/Clipboard/ClipboardProvider.tsx +1 -1
- package/src/components/Clipboard/CopyButton.tsx +3 -2
- package/src/components/DensityProvider/DensityProvider.tsx +1 -1
- package/src/components/Dialogs/AlertDialog.stories.tsx +2 -1
- package/src/components/Dialogs/AlertDialog.tsx +13 -13
- package/src/components/Dialogs/Dialog.stories.tsx +2 -1
- package/src/components/Dialogs/Dialog.tsx +13 -13
- package/src/components/ElevationProvider/ElevationProvider.tsx +1 -1
- package/src/components/Input/Input.stories.tsx +5 -4
- package/src/components/Input/Input.tsx +13 -13
- package/src/components/Link/Link.stories.tsx +2 -1
- package/src/components/Lists/List.stories.tsx +9 -8
- package/src/components/Lists/List.tsx +14 -18
- package/src/components/Lists/Tree.stories.tsx +2 -1
- package/src/components/Lists/Tree.tsx +4 -3
- package/src/components/Lists/TreeDropIndicator.tsx +1 -1
- package/src/components/Lists/Treegrid.stories.tsx +2 -1
- package/src/components/Lists/Treegrid.tsx +2 -2
- package/src/components/Main/Main.stories.tsx +2 -1
- package/src/components/Main/Main.tsx +7 -6
- package/src/components/Menus/ContextMenu.stories.tsx +2 -1
- package/src/components/Menus/DropdownMenu.stories.tsx +2 -1
- package/src/components/Menus/DropdownMenu.tsx +8 -8
- package/src/components/Message/Message.stories.tsx +2 -1
- package/src/components/Message/Message.tsx +1 -1
- package/src/components/Popover/Popover.stories.tsx +2 -1
- package/src/components/Popover/Popover.tsx +7 -7
- package/src/components/ScrollArea/ScrollArea.stories.tsx +2 -1
- package/src/components/ScrollArea/ScrollArea.tsx +4 -4
- package/src/components/Select/Select.stories.tsx +2 -1
- package/src/components/Select/Select.tsx +3 -4
- package/src/components/Status/Status.stories.tsx +2 -1
- package/src/components/Tag/Tag.stories.tsx +2 -1
- package/src/components/ThemeProvider/ThemeProvider.tsx +3 -2
- package/src/components/ThemeProvider/TranslationsProvider.tsx +3 -3
- package/src/components/Toast/Toast.stories.tsx +2 -1
- package/src/components/Toast/Toast.tsx +9 -9
- package/src/components/Toolbar/Toolbar.stories.tsx +10 -9
- package/src/components/Toolbar/Toolbar.tsx +2 -2
- package/src/components/Tooltip/Tooltip.stories.tsx +2 -1
- 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 +9 -10
- package/src/playground/Custom.stories.tsx +2 -2
- package/src/testing/decorators/withTheme.ts +8 -5
- package/src/util/index.ts +1 -1
- package/dist/lib/browser/chunk-T6YPS45E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TYVQJ4KW.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
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",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
17
18
|
"./testing": {
|
|
19
|
+
"source": "./src/testing/index.ts",
|
|
18
20
|
"types": "./dist/types/src/testing/index.d.ts",
|
|
19
21
|
"browser": "./dist/lib/browser/testing/index.mjs",
|
|
20
22
|
"node": "./dist/lib/node-esm/testing/index.mjs"
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
37
39
|
"@fluentui/react-tabster": "^9.24.2",
|
|
40
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
38
41
|
"@preact-signals/safe-react": "^0.9.0",
|
|
39
42
|
"@radix-ui/primitive": "1.1.1",
|
|
40
43
|
"@radix-ui/react-alert-dialog": "1.1.6",
|
|
@@ -72,34 +75,33 @@
|
|
|
72
75
|
"keyborg": "^2.5.0",
|
|
73
76
|
"react-i18next": "^11.18.6",
|
|
74
77
|
"react-remove-scroll": "^2.6.0",
|
|
75
|
-
"@dxos/debug": "0.8.4-main.
|
|
76
|
-
"@dxos/lit-ui": "0.8.4-main.
|
|
77
|
-
"@dxos/react-hooks": "0.8.4-main.
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-list": "0.8.4-main.
|
|
81
|
-
"@dxos/react-ui-types": "0.8.4-main.
|
|
82
|
-
"@dxos/util": "0.8.4-main.
|
|
78
|
+
"@dxos/debug": "0.8.4-main.fd6878d",
|
|
79
|
+
"@dxos/lit-ui": "0.8.4-main.fd6878d",
|
|
80
|
+
"@dxos/react-hooks": "0.8.4-main.fd6878d",
|
|
81
|
+
"@dxos/react-input": "0.8.4-main.fd6878d",
|
|
82
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
83
|
+
"@dxos/react-list": "0.8.4-main.fd6878d",
|
|
84
|
+
"@dxos/react-ui-types": "0.8.4-main.fd6878d",
|
|
85
|
+
"@dxos/util": "0.8.4-main.fd6878d"
|
|
83
86
|
},
|
|
84
87
|
"devDependencies": {
|
|
85
88
|
"@dnd-kit/core": "^6.0.5",
|
|
86
89
|
"@dnd-kit/sortable": "^7.0.1",
|
|
87
90
|
"@dnd-kit/utilities": "^3.2.0",
|
|
88
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
89
91
|
"@types/react": "~18.2.0",
|
|
90
92
|
"@types/react-dom": "~18.2.0",
|
|
91
93
|
"react": "~18.2.0",
|
|
92
94
|
"react-dom": "~18.2.0",
|
|
93
95
|
"vite": "5.4.7",
|
|
94
|
-
"@dxos/random": "0.8.4-main.
|
|
95
|
-
"@dxos/
|
|
96
|
-
"@dxos/
|
|
96
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
97
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
98
|
+
"@dxos/util": "0.8.4-main.fd6878d"
|
|
97
99
|
},
|
|
98
100
|
"peerDependencies": {
|
|
99
101
|
"@phosphor-icons/react": "^2.1.5",
|
|
100
102
|
"react": "~18.2.0",
|
|
101
103
|
"react-dom": "~18.2.0",
|
|
102
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
104
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
103
105
|
},
|
|
104
106
|
"publishConfig": {
|
|
105
107
|
"access": "public"
|
|
@@ -9,9 +9,10 @@ import { type HuePalette } from '@dxos/react-ui-theme';
|
|
|
9
9
|
import { type Size } from '@dxos/react-ui-types';
|
|
10
10
|
import { hexToFallback } from '@dxos/util';
|
|
11
11
|
|
|
12
|
-
import { Avatar, type AvatarVariant, type AvatarStatus, type AvatarAnimation } from './Avatar';
|
|
13
12
|
import { withTheme } from '../../testing';
|
|
14
13
|
|
|
14
|
+
import { Avatar, type AvatarAnimation, type AvatarStatus, type AvatarVariant } from './Avatar';
|
|
15
|
+
|
|
15
16
|
type StoryProps = {
|
|
16
17
|
id?: string;
|
|
17
18
|
imgSrc?: string;
|
|
@@ -7,12 +7,12 @@ import '@dxos/lit-ui/dx-avatar.pcss';
|
|
|
7
7
|
import { createContext } from '@radix-ui/react-context';
|
|
8
8
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
9
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
|
-
import React, { type ComponentProps, type ComponentPropsWithRef,
|
|
10
|
+
import React, { type ComponentProps, type ComponentPropsWithRef, type PropsWithChildren, forwardRef } from 'react';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
|
-
type AvatarVariant,
|
|
14
|
-
type AvatarStatus,
|
|
15
13
|
type AvatarAnimation,
|
|
14
|
+
type AvatarStatus,
|
|
15
|
+
type AvatarVariant,
|
|
16
16
|
type DxAvatar as NaturalDxAvatar,
|
|
17
17
|
} from '@dxos/lit-ui';
|
|
18
18
|
import { DxAvatar } from '@dxos/lit-ui/react';
|
|
@@ -8,9 +8,10 @@ import React from 'react';
|
|
|
8
8
|
import { useId } from '@dxos/react-hooks';
|
|
9
9
|
import { toEmoji } from '@dxos/util';
|
|
10
10
|
|
|
11
|
-
import { Avatar } from './Avatar';
|
|
12
11
|
import { withTheme } from '../../testing';
|
|
13
12
|
|
|
13
|
+
import { Avatar } from './Avatar';
|
|
14
|
+
|
|
14
15
|
const hues = ['lime', 'teal', 'purple', 'pink'];
|
|
15
16
|
|
|
16
17
|
const AvatarItem = ({ n }: { n: number }) => {
|
|
@@ -6,10 +6,11 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { Breadcrumb } from './Breadcrumb';
|
|
10
9
|
import { withTheme } from '../../testing';
|
|
11
10
|
import { Button } from '../Buttons';
|
|
12
11
|
|
|
12
|
+
import { Breadcrumb } from './Breadcrumb';
|
|
13
|
+
|
|
13
14
|
const DefaultStory = () => {
|
|
14
15
|
return (
|
|
15
16
|
<Breadcrumb.Root aria-label='Breadcrumb'>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Dot } from '@phosphor-icons/react';
|
|
6
5
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
6
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
-
import React, { type
|
|
7
|
+
import React, { type ComponentPropsWithRef, type ComponentPropsWithoutRef, forwardRef } from 'react';
|
|
9
8
|
|
|
10
9
|
import { useThemeContext } from '../../hooks';
|
|
11
10
|
import { type ThemedClassName } from '../../util';
|
|
11
|
+
import { Icon } from '../Icon';
|
|
12
12
|
import { Link, type LinkProps } from '../Link';
|
|
13
13
|
|
|
14
14
|
type BreadcrumbRootProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.div>> & {
|
|
@@ -100,7 +100,7 @@ const BreadcrumbSeparator = ({ children, classNames, ...props }: BreadcrumbSepar
|
|
|
100
100
|
{...props}
|
|
101
101
|
className={tx('breadcrumb.separator', 'breadcrumb__separator', {}, classNames)}
|
|
102
102
|
>
|
|
103
|
-
{children ?? <
|
|
103
|
+
{children ?? <Icon icon='ph--dot--bold' />}
|
|
104
104
|
</Primitive.span>
|
|
105
105
|
);
|
|
106
106
|
};
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import { type StoryObj, type Meta } from '@storybook/react-vite';
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
9
8
|
import React from 'react';
|
|
10
9
|
|
|
11
|
-
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
12
10
|
import { withSurfaceVariantsLayout, withTheme } from '../../testing';
|
|
11
|
+
import { Icon } from '../Icon';
|
|
12
|
+
|
|
13
|
+
import { Button, ButtonGroup, type ButtonProps } from './Button';
|
|
13
14
|
|
|
14
15
|
const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
15
16
|
return (
|
|
@@ -21,10 +22,10 @@ const DefaultStory = ({ children, ...args }: Omit<ButtonProps, 'ref'>) => {
|
|
|
21
22
|
{(args.variant === 'default' || args.variant === 'primary') && (
|
|
22
23
|
<ButtonGroup>
|
|
23
24
|
<Button {...args}>
|
|
24
|
-
<
|
|
25
|
+
<Icon icon='ph--caret-left--regular' />
|
|
25
26
|
</Button>
|
|
26
27
|
<Button {...args}>
|
|
27
|
-
<
|
|
28
|
+
<Icon icon='ph--caret-right--regular' />
|
|
28
29
|
</Button>
|
|
29
30
|
</ButtonGroup>
|
|
30
31
|
)}
|
|
@@ -6,10 +6,11 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { IconButton, type IconButtonProps } from './IconButton';
|
|
10
9
|
import { withTheme } from '../../testing';
|
|
11
10
|
import { Tooltip } from '../Tooltip';
|
|
12
11
|
|
|
12
|
+
import { IconButton, type IconButtonProps } from './IconButton';
|
|
13
|
+
|
|
13
14
|
const DefaultStory = (props: IconButtonProps) => {
|
|
14
15
|
return (
|
|
15
16
|
<Tooltip.Provider>
|
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { Button, type ButtonProps } from './Button';
|
|
8
7
|
import { useThemeContext } from '../../hooks';
|
|
9
8
|
import { type ThemedClassName } from '../../util';
|
|
10
9
|
import { Icon, type IconProps } from '../Icon';
|
|
11
10
|
import { Tooltip, type TooltipSide } from '../Tooltip';
|
|
12
11
|
|
|
12
|
+
import { Button, type ButtonProps } from './Button';
|
|
13
|
+
|
|
13
14
|
type IconButtonProps = Omit<ButtonProps, 'children'> &
|
|
14
15
|
Pick<IconProps, 'icon' | 'size'> & {
|
|
15
16
|
label: string;
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { TextB } from '@phosphor-icons/react';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
|
-
import { Toggle } from './Toggle';
|
|
11
9
|
import { withTheme } from '../../testing';
|
|
10
|
+
import { Icon } from '../Icon';
|
|
11
|
+
|
|
12
|
+
import { Toggle } from './Toggle';
|
|
12
13
|
|
|
13
14
|
type StorybookToggleProps = {};
|
|
14
15
|
|
|
15
16
|
const DefaultStory = (props: StorybookToggleProps) => {
|
|
16
17
|
return (
|
|
17
18
|
<Toggle {...props}>
|
|
18
|
-
<
|
|
19
|
+
<Icon icon='ph--text-b--regular' />
|
|
19
20
|
</Toggle>
|
|
20
21
|
);
|
|
21
22
|
};
|
|
@@ -4,21 +4,22 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { TextB, TextItalic } from '@phosphor-icons/react';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
|
|
10
|
-
import { ToggleGroup, ToggleGroupItem, type ToggleGroupProps } from './ToggleGroup';
|
|
11
9
|
import { withTheme } from '../../testing';
|
|
10
|
+
import { Icon } from '../Icon';
|
|
11
|
+
|
|
12
|
+
import { ToggleGroup, ToggleGroupItem, type ToggleGroupProps } from './ToggleGroup';
|
|
12
13
|
|
|
13
14
|
// TODO(burdon): Create Radix-style Root, Item, etc?
|
|
14
15
|
const DefaultStory = (props: ToggleGroupProps) => {
|
|
15
16
|
return (
|
|
16
17
|
<ToggleGroup {...props}>
|
|
17
18
|
<ToggleGroupItem value='textb'>
|
|
18
|
-
<
|
|
19
|
+
<Icon icon='ph--text-b--regular' />
|
|
19
20
|
</ToggleGroupItem>
|
|
20
21
|
<ToggleGroupItem value='texti'>
|
|
21
|
-
<
|
|
22
|
+
<Icon icon='ph--text-italic--regular' />
|
|
22
23
|
</ToggleGroupItem>
|
|
23
24
|
</ToggleGroup>
|
|
24
25
|
);
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
+
ToggleGroupItem as ToggleGroupItemPrimitive,
|
|
7
|
+
type ToggleGroupItemProps as ToggleGroupItemPrimitiveProps,
|
|
8
|
+
type ToggleGroupMultipleProps,
|
|
6
9
|
ToggleGroup as ToggleGroupPrimitive,
|
|
7
10
|
type ToggleGroupSingleProps,
|
|
8
|
-
type ToggleGroupMultipleProps,
|
|
9
|
-
type ToggleGroupItemProps as ToggleGroupItemPrimitiveProps,
|
|
10
|
-
ToggleGroupItem as ToggleGroupItemPrimitive,
|
|
11
11
|
} from '@radix-ui/react-toggle-group';
|
|
12
12
|
import React, { forwardRef } from 'react';
|
|
13
13
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { type PropsWithChildren, createContext, useCallback, useContext, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
export type ClipboardContextValue = {
|
|
8
8
|
textValue: string;
|
|
@@ -6,12 +6,13 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { mx } from '@dxos/react-ui-theme';
|
|
8
8
|
|
|
9
|
-
import { useClipboard } from './ClipboardProvider';
|
|
10
9
|
import { Button, type ButtonProps, IconButton } from '../Buttons';
|
|
11
10
|
import { Icon, type IconProps } from '../Icon';
|
|
12
11
|
import { useTranslation } from '../ThemeProvider';
|
|
13
12
|
import { type TooltipScopedProps, useTooltipContext } from '../Tooltip';
|
|
14
13
|
|
|
14
|
+
import { useClipboard } from './ClipboardProvider';
|
|
15
|
+
|
|
15
16
|
export type CopyButtonProps = ButtonProps &
|
|
16
17
|
Pick<IconProps, 'size'> & {
|
|
17
18
|
value: string;
|
|
@@ -57,7 +58,7 @@ export const CopyButtonIconOnly = ({
|
|
|
57
58
|
const { t } = useTranslation('os');
|
|
58
59
|
const { textValue, setTextValue } = useClipboard();
|
|
59
60
|
const isCopied = textValue === value;
|
|
60
|
-
const label = isCopied ? t('copy success label') : props.label ?? t('copy label');
|
|
61
|
+
const label = isCopied ? t('copy success label') : (props.label ?? t('copy label'));
|
|
61
62
|
const { onOpen } = useTooltipContext('CopyButton', __scopeTooltip);
|
|
62
63
|
return (
|
|
63
64
|
<IconButton
|
|
@@ -6,11 +6,12 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { AlertDialog } from './AlertDialog';
|
|
10
9
|
import { withTheme } from '../../testing';
|
|
11
10
|
import { Button } from '../Buttons';
|
|
12
11
|
import { Toolbar } from '../Toolbar';
|
|
13
12
|
|
|
13
|
+
import { AlertDialog } from './AlertDialog';
|
|
14
|
+
|
|
14
15
|
type StoryProps = Partial<{
|
|
15
16
|
title: string;
|
|
16
17
|
description: string;
|
|
@@ -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';
|
|
@@ -6,10 +6,11 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
|
|
9
|
-
import { Dialog } from './Dialog';
|
|
10
9
|
import { withTheme } from '../../testing';
|
|
11
10
|
import { Button } from '../Buttons';
|
|
12
11
|
|
|
12
|
+
import { Dialog } from './Dialog';
|
|
13
|
+
|
|
13
14
|
type StoryProps = Partial<{
|
|
14
15
|
title: string;
|
|
15
16
|
description: string;
|
|
@@ -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 { activeSurface, 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;
|
|
@@ -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';
|
|
@@ -5,10 +5,9 @@
|
|
|
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 { DotsSixVertical, PushPin } from '@phosphor-icons/react';
|
|
12
11
|
import React, { type ReactNode, useState } from 'react';
|
|
13
12
|
|
|
14
13
|
import {
|
|
@@ -20,8 +19,10 @@ import {
|
|
|
20
19
|
surfaceShadow,
|
|
21
20
|
} from '@dxos/react-ui-theme';
|
|
22
21
|
|
|
23
|
-
import { List, ListItem, type ListScopedProps } from './List';
|
|
24
22
|
import { withTheme } from '../../testing';
|
|
23
|
+
import { Icon } from '../Icon';
|
|
24
|
+
|
|
25
|
+
import { List, ListItem, type ListScopedProps } from './List';
|
|
25
26
|
|
|
26
27
|
export default {
|
|
27
28
|
title: 'ui/react-ui-core/List',
|
|
@@ -41,11 +42,11 @@ const UniformListItem = ({ id, text }: { id: string; text: string }) => {
|
|
|
41
42
|
style={{ transform: CSS.Transform.toString(transform) }}
|
|
42
43
|
>
|
|
43
44
|
<ListItem.Endcap>
|
|
44
|
-
<
|
|
45
|
+
<Icon icon='ph--dots-six-vertical--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
45
46
|
</ListItem.Endcap>
|
|
46
47
|
<ListItem.Heading classNames='grow pbs-2'>{text}</ListItem.Heading>
|
|
47
48
|
<ListItem.Endcap>
|
|
48
|
-
<
|
|
49
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
49
50
|
</ListItem.Endcap>
|
|
50
51
|
</ListItem.Root>
|
|
51
52
|
);
|
|
@@ -103,13 +104,13 @@ const ManySizesDraggableListItem = ({
|
|
|
103
104
|
style={{ transform: CSS.Translate.toString(transform) }}
|
|
104
105
|
>
|
|
105
106
|
<ListItem.Endcap>
|
|
106
|
-
<
|
|
107
|
+
<Icon icon='ph--dots-six-vertical--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
107
108
|
</ListItem.Endcap>
|
|
108
109
|
<ListItem.Heading classNames='grow pbs-2' asChild>
|
|
109
110
|
{text}
|
|
110
111
|
</ListItem.Heading>
|
|
111
112
|
<ListItem.Endcap>
|
|
112
|
-
<
|
|
113
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
113
114
|
</ListItem.Endcap>
|
|
114
115
|
</ListItem.Root>
|
|
115
116
|
);
|
|
@@ -181,7 +182,7 @@ export const Collapsible = {
|
|
|
181
182
|
{index !== 2 ? <ListItem.OpenTrigger /> : <ListItem.MockOpenTrigger />}
|
|
182
183
|
<ListItem.Heading classNames='grow pbs-2'>{text}</ListItem.Heading>
|
|
183
184
|
<ListItem.Endcap>
|
|
184
|
-
<
|
|
185
|
+
<Icon icon='ph--push-pin--regular' classNames={mx(getSize(5), 'mbs-2.5')} />
|
|
185
186
|
</ListItem.Endcap>
|
|
186
187
|
</div>
|
|
187
188
|
{index !== 2 && <ListItem.CollapsibleContent>{body}</ListItem.CollapsibleContent>}
|