@dxos/react-ui 0.3.5-next.63b0922 → 0.3.5-next.d8a95f3
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 +63 -66
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts +6 -5
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts +2 -0
- package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts +4 -4
- package/dist/types/src/components/Avatars/AvatarGroup.d.ts.map +1 -1
- package/dist/types/src/components/Breadcrumb/Breadcrumb.d.ts +5 -5
- package/dist/types/src/components/Buttons/Button.d.ts +2 -2
- package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -1
- package/dist/types/src/components/Buttons/Toggle.d.ts +1 -1
- package/dist/types/src/components/Buttons/ToggleGroup.d.ts +3 -3
- package/dist/types/src/components/Card/Card.d.ts +1 -1
- package/dist/types/src/components/Card/Card.stories.d.ts +1 -1
- package/dist/types/src/components/DropdownMenu/DropdownMenu.d.ts +9 -3
- package/dist/types/src/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Input/Input.d.ts +7 -7
- package/dist/types/src/components/Link/Link.d.ts +1 -1
- package/dist/types/src/components/List/List.d.ts +1 -1
- package/dist/types/src/components/Main/Main.d.ts +4 -4
- package/dist/types/src/components/Main/Main.d.ts.map +1 -1
- package/dist/types/src/components/Message/Message.d.ts +2 -2
- package/dist/types/src/components/Popover/Popover.d.ts +1 -1
- package/dist/types/src/components/Select/Select.d.ts +1 -1
- package/dist/types/src/components/Tag/Tag.d.ts +1 -1
- package/dist/types/src/components/Toast/Toast.d.ts +2 -2
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +5 -5
- package/dist/types/src/playground/Surfaces.stories.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/Avatars/Avatar.stories.tsx +51 -15
- package/src/components/Avatars/Avatar.tsx +75 -69
- package/src/components/Avatars/AvatarGroup.tsx +2 -1
- package/src/components/DropdownMenu/DropdownMenu.tsx +27 -0
- package/src/components/Main/Main.tsx +1 -0
- package/src/playground/Surfaces.stories.tsx +26 -5
|
@@ -16,6 +16,10 @@ import {
|
|
|
16
16
|
type DropdownMenuGroupProps as DropdownMenuGroupPrimitiveProps,
|
|
17
17
|
DropdownMenuItem as DropdownMenuItemPrimitive,
|
|
18
18
|
type DropdownMenuItemProps as DropdownMenuItemPrimitiveProps,
|
|
19
|
+
DropdownMenuCheckboxItem as DropdownMenuCheckboxItemPrimitive,
|
|
20
|
+
type DropdownMenuCheckboxItemProps as DropdownMenuCheckboxItemPrimitiveProps,
|
|
21
|
+
DropdownMenuItemIndicator as DropdownMenuItemIndicatorPrimitive,
|
|
22
|
+
type DropdownMenuItemIndicatorProps as DropdownMenuItemIndicatorPrimitiveProps,
|
|
19
23
|
DropdownMenuSeparator as DropdownMenuSeparatorPrimitive,
|
|
20
24
|
type DropdownMenuSeparatorProps as DropdownMenuSeparatorPrimitiveProps,
|
|
21
25
|
DropdownMenuLabel as DropdownMenuLabelPrimitive,
|
|
@@ -99,6 +103,10 @@ type DropdownMenuGroupProps = DropdownMenuGroupPrimitiveProps;
|
|
|
99
103
|
|
|
100
104
|
const DropdownMenuGroup = DropdownMenuGroupPrimitive;
|
|
101
105
|
|
|
106
|
+
type DropdownMenuItemIndicatorProps = DropdownMenuItemIndicatorPrimitiveProps;
|
|
107
|
+
|
|
108
|
+
const DropdownMenuItemIndicator = DropdownMenuItemIndicatorPrimitive;
|
|
109
|
+
|
|
102
110
|
type DropdownMenuItemProps = ThemedClassName<DropdownMenuItemPrimitiveProps>;
|
|
103
111
|
|
|
104
112
|
const DropdownMenuItem = forwardRef<HTMLDivElement, DropdownMenuItemProps>(
|
|
@@ -114,6 +122,21 @@ const DropdownMenuItem = forwardRef<HTMLDivElement, DropdownMenuItemProps>(
|
|
|
114
122
|
},
|
|
115
123
|
);
|
|
116
124
|
|
|
125
|
+
type DropdownMenuCheckboxItemProps = ThemedClassName<DropdownMenuCheckboxItemPrimitiveProps>;
|
|
126
|
+
|
|
127
|
+
const DropdownMenuCheckboxItem = forwardRef<HTMLDivElement, DropdownMenuCheckboxItemProps>(
|
|
128
|
+
({ classNames, ...props }: DropdownMenuItemProps, forwardedRef) => {
|
|
129
|
+
const { tx } = useThemeContext();
|
|
130
|
+
return (
|
|
131
|
+
<DropdownMenuCheckboxItemPrimitive
|
|
132
|
+
{...props}
|
|
133
|
+
className={tx('dropdownMenu.item', 'dropdown-menu__item--checkbox', {}, classNames)}
|
|
134
|
+
ref={forwardedRef}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
);
|
|
139
|
+
|
|
117
140
|
type DropdownMenuSeparatorProps = ThemedClassName<DropdownMenuSeparatorPrimitiveProps>;
|
|
118
141
|
|
|
119
142
|
const DropdownMenuSeparator = forwardRef<HTMLDivElement, DropdownMenuSeparatorProps>(
|
|
@@ -153,6 +176,8 @@ export const DropdownMenu = {
|
|
|
153
176
|
Arrow: DropdownMenuArrow,
|
|
154
177
|
Group: DropdownMenuGroup,
|
|
155
178
|
Item: DropdownMenuItem,
|
|
179
|
+
CheckboxItem: DropdownMenuCheckboxItem,
|
|
180
|
+
ItemIndicator: DropdownMenuItemIndicator,
|
|
156
181
|
Separator: DropdownMenuSeparator,
|
|
157
182
|
GroupLabel: DropdownMenuGroupLabel,
|
|
158
183
|
};
|
|
@@ -166,6 +191,8 @@ export type {
|
|
|
166
191
|
DropdownMenuArrowProps,
|
|
167
192
|
DropdownMenuGroupProps,
|
|
168
193
|
DropdownMenuItemProps,
|
|
194
|
+
DropdownMenuCheckboxItemProps,
|
|
195
|
+
DropdownMenuItemIndicatorProps,
|
|
169
196
|
DropdownMenuSeparatorProps,
|
|
170
197
|
DropdownMenuGroupLabelProps,
|
|
171
198
|
};
|
|
@@ -152,6 +152,7 @@ const MainSidebar = forwardRef<HTMLDivElement, MainSidebarProps>(
|
|
|
152
152
|
{ isLg, [side === 'inline-end' ? 'inlineEndSidebarOpen' : 'inlineStartSidebarOpen']: open, side },
|
|
153
153
|
classNames,
|
|
154
154
|
)}
|
|
155
|
+
{...(!open && { inert: 'true' })}
|
|
155
156
|
ref={ref}
|
|
156
157
|
>
|
|
157
158
|
<ElevationProvider elevation='group'>{children}</ElevationProvider>
|
|
@@ -6,18 +6,37 @@ import '@dxosTheme';
|
|
|
6
6
|
|
|
7
7
|
import React, { type PropsWithChildren } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
baseSurface,
|
|
11
|
+
chromeSurface,
|
|
12
|
+
groupSurface,
|
|
13
|
+
mx,
|
|
14
|
+
surfaceElevation,
|
|
15
|
+
fixedSurface,
|
|
16
|
+
fixedBorder,
|
|
17
|
+
inputSurface,
|
|
18
|
+
} from '@dxos/react-ui-theme';
|
|
10
19
|
|
|
11
|
-
const Surface = ({
|
|
20
|
+
const Surface = ({
|
|
21
|
+
children,
|
|
22
|
+
level,
|
|
23
|
+
}: PropsWithChildren & { level: 'base' | 'group' | 'chrome' | 'fixed' | 'input' }) => {
|
|
12
24
|
const surface =
|
|
13
25
|
level === 'chrome'
|
|
14
26
|
? [chromeSurface, surfaceElevation({ elevation: 'chrome' })]
|
|
15
27
|
: level === 'group'
|
|
16
28
|
? [groupSurface, surfaceElevation({ elevation: 'group' })]
|
|
29
|
+
: level === 'input'
|
|
30
|
+
? [inputSurface, surfaceElevation({ elevation: 'group' })]
|
|
31
|
+
: level === 'fixed'
|
|
32
|
+
? [fixedSurface, fixedBorder, 'border', surfaceElevation({ elevation: 'chrome' })]
|
|
17
33
|
: [baseSurface];
|
|
18
34
|
|
|
19
35
|
return (
|
|
20
|
-
<div
|
|
36
|
+
<div
|
|
37
|
+
role='region'
|
|
38
|
+
className={mx('flex justify-center items-center m-8 p-2 w-[320px] h-[160px] rounded-lg', ...surface)}
|
|
39
|
+
>
|
|
21
40
|
<div>{level}</div>
|
|
22
41
|
{children}
|
|
23
42
|
</div>
|
|
@@ -26,11 +45,13 @@ const Surface = ({ children, level }: PropsWithChildren & { level: 'base' | 'gro
|
|
|
26
45
|
|
|
27
46
|
const SurfacesStory = () => {
|
|
28
47
|
return (
|
|
29
|
-
|
|
48
|
+
<div className='bg-cubes p-10 m-0'>
|
|
49
|
+
<Surface level='fixed' />
|
|
30
50
|
<Surface level='base' />
|
|
31
51
|
<Surface level='group' />
|
|
32
52
|
<Surface level='chrome' />
|
|
33
|
-
|
|
53
|
+
<Surface level='input' />
|
|
54
|
+
</div>
|
|
34
55
|
);
|
|
35
56
|
};
|
|
36
57
|
|