@webiny/admin-ui 6.2.0-beta.0 → 6.3.0-beta.0
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/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.mdx +437 -463
- package/Accordion/components/AccordionContent.js.map +1 -1
- package/Alert/Alert.d.ts +1 -1
- package/Alert/Alert.js.map +1 -1
- package/Alert/Alert.mdx +80 -83
- package/AutoComplete/AutoComplete.mdx +63 -55
- package/Avatar/Avatar.d.ts +1 -1
- package/Avatar/Avatar.js.map +1 -1
- package/Avatar/Avatar.mdx +52 -43
- package/Button/Button.d.ts +1 -1
- package/Button/Button.js.map +1 -1
- package/Button/Button.mdx +50 -42
- package/Button/IconButton.d.ts +1 -1
- package/Button/IconButton.js.map +1 -1
- package/Card/components/CardContent.d.ts +1 -1
- package/Card/components/CardTitle.d.ts +1 -1
- package/Checkbox/Checkbox.mdx +51 -49
- package/Checkbox/primitives/CheckboxPrimitive.d.ts +1 -1
- package/CheckboxGroup/CheckboxGroup.mdx +51 -53
- package/CodeEditor/CodeEditor.mdx +44 -43
- package/ColorPicker/ColorPicker.mdx +41 -40
- package/Command/components/Item.d.ts +1 -1
- package/Command/components/Item.js.map +1 -1
- package/DataTable/DataTable.mdx +537 -542
- package/DataTable/components/ColumnSorter.d.ts +1 -1
- package/DataTable/components/ColumnSorter.js.map +1 -1
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/components/DialogContent.d.ts +1 -1
- package/Dialog/components/DialogContent.js +1 -1
- package/Dialog/components/DialogContent.js.map +1 -1
- package/Dialog/components/DialogFooter.d.ts +1 -1
- package/Dialog/components/DialogFooter.js.map +1 -1
- package/Dialog/components/DialogTitle.d.ts +1 -1
- package/Drawer/Drawer.js.map +1 -1
- package/Drawer/Drawer.mdx +73 -64
- package/Drawer/components/DrawerContent.d.ts +1 -1
- package/Drawer/components/DrawerContent.js.map +1 -1
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/DropdownMenu/DropdownMenu.mdx +155 -256
- package/DropdownMenu/components/DropdownMenuCheckboxItem.js.map +1 -1
- package/DropdownMenu/components/DropdownMenuLabel.js.map +1 -1
- package/FilePicker/FilePicker.mdx +69 -69
- package/FilePicker/primitives/FilePickerPrimitive.d.ts +19 -19
- package/FilePicker/primitives/FilePickerPrimitive.js.map +1 -1
- package/FilePicker/primitives/components/Trigger.d.ts +1 -1
- package/FilePicker/primitives/components/previews/TextOnlyPreview/TextOnlyPreview.d.ts +1 -1
- package/FilePicker/primitives/components/previews/variants.d.ts +1 -1
- package/FilePicker/primitives/components/types.js.map +1 -1
- package/FormComponent/Description.d.ts +1 -1
- package/FormComponent/ErrorMessage.d.ts +1 -1
- package/FormComponent/Note.d.ts +1 -1
- package/Grid/Grid.d.ts +2 -2
- package/Grid/Grid.js.map +1 -1
- package/Grid/Grid.mdx +111 -121
- package/HeaderBar/HeaderBar.mdx +98 -99
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js.map +1 -1
- package/Heading/Heading.mdx +63 -58
- package/Icon/Icon.d.ts +1 -1
- package/Icon/Icon.js.map +1 -1
- package/Icon/Icon.mdx +79 -147
- package/IconPicker/IconPicker.mdx +66 -64
- package/IconPicker/primitives/IconPickerPrimitive.d.ts +1 -1
- package/IconPicker/primitives/components/IconPickerTrigger.d.ts +1 -1
- package/Image/Image.js.map +1 -1
- package/Input/Input.mdx +67 -56
- package/Input/InputPrimitive.d.ts +1 -1
- package/Label/Label.d.ts +1 -1
- package/Label/Label.js.map +1 -1
- package/Label/Label.mdx +42 -42
- package/Label/components/LabelDescription.d.ts +1 -1
- package/Label/components/LabelRequired.d.ts +1 -1
- package/Label/components/LabelValue.d.ts +1 -1
- package/Link/Link.d.ts +1 -1
- package/Link/Link.mdx +129 -116
- package/List/List.d.ts +1 -1
- package/List/List.js.map +1 -1
- package/List/List.mdx +317 -329
- package/List/components/ListItem.d.ts +1 -1
- package/List/components/ListItem.js.map +1 -1
- package/Loader/Loader.d.ts +2 -2
- package/Loader/Loader.js.map +1 -1
- package/Loader/Loader.mdx +96 -91
- package/MultiAutoComplete/MultiAutoComplete.mdx +52 -51
- package/MultiAutoComplete/primitives/components/MultiAutoCompleteInput.d.ts +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteListOptionsPresenterWithUniqueValues.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteSelectedOptionsPresenter.js.map +1 -1
- package/MultiAutoComplete/primitives/presenters/MultiAutoCompleteTemporaryOptionPresenter.js.map +1 -1
- package/MultiFilePicker/MultiFilePicker.mdx +84 -80
- package/MultiFilePicker/primitives/MultiFilePickerPrimitive.js.map +1 -1
- package/Popover/Popover.mdx +112 -118
- package/Popover/primitives/components/PopoverArrow.d.ts +1 -1
- package/Popover/primitives/components/PopoverContent.d.ts +1 -1
- package/RadioGroup/RadioGroup.mdx +62 -59
- package/RadioGroup/primitives/RadioGroupPrimitive.js.map +1 -1
- package/RangeSlider/RangeSlider.mdx +48 -47
- package/RangeSlider/primitives/RangeSliderPrimitive.js.map +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.d.ts +1 -1
- package/RangeSlider/primitives/components/RangeSliderValue.js.map +1 -1
- package/ScrollArea/ScrollArea.js.map +1 -1
- package/SegmentedControl/SegmentedControl.mdx +59 -59
- package/SegmentedControl/primitives/SegmentedControlPrimitive.d.ts +1 -1
- package/SegmentedControl/primitives/SegmentedControlPrimitive.js.map +1 -1
- package/Select/Select.mdx +52 -43
- package/Select/primitives/components/SelectTrigger.d.ts +1 -1
- package/Select/primitives/components/SelectTrigger.js.map +1 -1
- package/Select/primitives/presenters/SelectPresenter.d.ts +1 -1
- package/Separator/Separator.d.ts +1 -1
- package/Separator/Separator.mdx +139 -150
- package/Sidebar/Sidebar.js.map +1 -1
- package/Sidebar/Sidebar.mdx +66 -88
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.d.ts +1 -1
- package/Sidebar/components/items/SidebarMenuSubItemIndentation.js.map +1 -1
- package/Skeleton/Skeleton.d.ts +1 -1
- package/Skeleton/Skeleton.js.map +1 -1
- package/Skeleton/Skeleton.mdx +37 -37
- package/Slider/Slider.mdx +48 -47
- package/Slider/primitives/SliderPrimitive.js.map +1 -1
- package/Slider/primitives/components/SliderSideValue.d.ts +1 -1
- package/Slider/primitives/components/SliderSideValue.js.map +1 -1
- package/Slider/primitives/components/SliderTooltip.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIcon.js.map +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.d.ts +1 -1
- package/SteppedProgress/components/SteppedProgressIndicator.js.map +1 -1
- package/Switch/Switch.mdx +44 -42
- package/Switch/primitives/SwitchPrimitive.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js.map +1 -1
- package/Table/components/Direction.d.ts +1 -1
- package/Table/components/Direction.js.map +1 -1
- package/Table/components/Header.d.ts +1 -1
- package/Table/components/Header.js.map +1 -1
- package/Table/components/Resizer.d.ts +1 -1
- package/Table/components/Resizer.js.map +1 -1
- package/Table/components/Row.d.ts +1 -1
- package/Table/components/Row.js.map +1 -1
- package/Tabs/Tabs.mdx +297 -292
- package/Tabs/components/Content.d.ts +1 -1
- package/Tabs/components/List.d.ts +1 -1
- package/Tabs/components/Trigger.d.ts +1 -1
- package/Tag/Tag.d.ts +1 -1
- package/Tag/Tag.js.map +1 -1
- package/Tag/Tag.mdx +68 -64
- package/Tags/primitives/TagsPrimitive.js.map +1 -1
- package/Text/Text.d.ts +1 -1
- package/Text/Text.mdx +54 -48
- package/Textarea/Textarea.mdx +49 -39
- package/Textarea/TextareaPrimitive.d.ts +1 -1
- package/Textarea/TextareaPrimitive.js.map +1 -1
- package/Toast/Toast.mdx +63 -53
- package/Toast/components/ToastRoot.d.ts +1 -1
- package/Tooltip/Tooltip.mdx +197 -198
- package/Tooltip/components/TooltipArrow.d.ts +1 -1
- package/Tooltip/components/TooltipContent.d.ts +1 -1
- package/Tree/components/Item.d.ts +1 -1
- package/Tree/useTree.d.ts +1 -1
- package/Widget/components/WidgetContent.d.ts +1 -1
- package/package.json +15 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Canvas, Meta, Controls } from
|
|
1
|
+
import { Canvas, Meta, Controls } from "@storybook/addon-docs/blocks";
|
|
2
2
|
|
|
3
|
-
import * as DropdownMenuStories from
|
|
3
|
+
import * as DropdownMenuStories from "./DropdownMenu.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={DropdownMenuStories} />
|
|
6
6
|
|
|
@@ -28,86 +28,55 @@ import { ReactComponent as LinkIcon } from "@webiny/icons/link.svg";
|
|
|
28
28
|
const { Label, Separator, Group, Item, Link } = DropdownMenu;
|
|
29
29
|
|
|
30
30
|
const DropdownMenuExample = () => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/>
|
|
66
|
-
<Item
|
|
67
|
-
icon={<Item.Icon label={"API"} element={<Cloud />} />}
|
|
68
|
-
text={"API"}
|
|
69
|
-
disabled
|
|
70
|
-
/>
|
|
71
|
-
<Separator />
|
|
72
|
-
<Item
|
|
73
|
-
icon={<Item.Icon label={"Log out"} element={<LogOut />} />}
|
|
74
|
-
text={"Log out"}
|
|
75
|
-
/>
|
|
76
|
-
<Separator />
|
|
77
|
-
<Label text={"Links"} />
|
|
78
|
-
<Link
|
|
79
|
-
text={"Link 1"}
|
|
80
|
-
to={"#link-1"}
|
|
81
|
-
icon={<Link.Icon label="Link 1" element={<LinkIcon />} />}
|
|
82
|
-
/>
|
|
83
|
-
<Link
|
|
84
|
-
text={"Link 2"}
|
|
85
|
-
to={"#link-2"}
|
|
86
|
-
icon={<Link.Icon label="Link 2" element={<LinkIcon />} />}
|
|
87
|
-
/>
|
|
88
|
-
<Link
|
|
89
|
-
text={"Link 3"}
|
|
90
|
-
to={"#link-3"}
|
|
91
|
-
icon={<Link.Icon label="Link 3" element={<LinkIcon />} />}
|
|
92
|
-
/>
|
|
93
|
-
</DropdownMenu>
|
|
94
|
-
);
|
|
95
|
-
};
|
|
31
|
+
return (
|
|
32
|
+
|
|
33
|
+
<DropdownMenu trigger={<Button variant="primary" text={"Open"} />}>
|
|
34
|
+
<Label text={"My Account"} />
|
|
35
|
+
<Item icon={<Item.Icon label={"Profile"} element={<User />} />} text={"Profile"} />
|
|
36
|
+
<Group>
|
|
37
|
+
<Item icon={<Item.Icon element={<CreditCard />} label={"Billing"} />} text={"Billing"} />
|
|
38
|
+
<Item icon={<Item.Icon element={<Settings />} label={"Settings"} />} text={"Settings"} />
|
|
39
|
+
<Item
|
|
40
|
+
icon={<Item.Icon element={<Keyboard />} label={"Keyboard shortcuts"} />}
|
|
41
|
+
text={"Keyboard shortcuts"}
|
|
42
|
+
/>
|
|
43
|
+
</Group>
|
|
44
|
+
<Separator />
|
|
45
|
+
<Group>
|
|
46
|
+
<Item icon={<Item.Icon element={<Users />} label={"Team"} />} text={"Team"} />
|
|
47
|
+
<Item
|
|
48
|
+
icon={<Item.Icon element={<UserPlus />} label={"Invite users"} />}
|
|
49
|
+
text={"Invite users"}
|
|
50
|
+
/>
|
|
51
|
+
<Item icon={<Item.Icon label={"New Team"} element={<Plus />} />} text={"New Team"} />
|
|
52
|
+
</Group>
|
|
53
|
+
<Separator />
|
|
54
|
+
<Item icon={<Item.Icon label={"Support"} element={<LifeBuoy />} />} text={"Support"} />
|
|
55
|
+
<Item icon={<Item.Icon label={"API"} element={<Cloud />} />} text={"API"} disabled />
|
|
56
|
+
<Separator />
|
|
57
|
+
<Item icon={<Item.Icon label={"Log out"} element={<LogOut />} />} text={"Log out"} />
|
|
58
|
+
<Separator />
|
|
59
|
+
<Label text={"Links"} />
|
|
60
|
+
<Link text={"Link 1"} to={"#link-1"} icon={<Link.Icon label="Link 1" element={<LinkIcon />} />} />
|
|
61
|
+
<Link text={"Link 2"} to={"#link-2"} icon={<Link.Icon label="Link 2" element={<LinkIcon />} />} />
|
|
62
|
+
<Link text={"Link 3"} to={"#link-3"} icon={<Link.Icon label="Link 3" element={<LinkIcon />} />} />
|
|
63
|
+
</DropdownMenu>
|
|
64
|
+
); };
|
|
96
65
|
|
|
97
66
|
export default DropdownMenuExample;
|
|
98
67
|
|
|
99
68
|
` }}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
69
|
+
additionalActions={[
|
|
70
|
+
{
|
|
71
|
+
title: 'Open in GitHub',
|
|
72
|
+
onClick: () => {
|
|
73
|
+
window.open(
|
|
74
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/DropdownMenu/DropdownMenu.tsx',
|
|
75
|
+
'_blank'
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
]}
|
|
111
80
|
/>
|
|
112
81
|
|
|
113
82
|
<Controls of={DropdownMenuStories.Documentation} />
|
|
@@ -135,14 +104,8 @@ const DropdownMenuExample = () => {
|
|
|
135
104
|
<Label text={"My Account"} />
|
|
136
105
|
<Item icon={<Item.Icon label={"Profile"} element={<User />} />} text={"Profile"} />
|
|
137
106
|
<Group>
|
|
138
|
-
<Item
|
|
139
|
-
|
|
140
|
-
text={"Billing"}
|
|
141
|
-
/>
|
|
142
|
-
<Item
|
|
143
|
-
icon={<Item.Icon element={<Settings />} label={"Settings"} />}
|
|
144
|
-
text={"Settings"}
|
|
145
|
-
/>
|
|
107
|
+
<Item icon={<Item.Icon element={<CreditCard />} label={"Billing"} />} text={"Billing"} />
|
|
108
|
+
<Item icon={<Item.Icon element={<Settings />} label={"Settings"} />} text={"Settings"} />
|
|
146
109
|
<Item
|
|
147
110
|
icon={<Item.Icon element={<Keyboard />} label={"Keyboard shortcuts"} />}
|
|
148
111
|
text={"Keyboard shortcuts"}
|
|
@@ -155,26 +118,13 @@ const DropdownMenuExample = () => {
|
|
|
155
118
|
icon={<Item.Icon element={<UserPlus />} label={"Invite users"} />}
|
|
156
119
|
text={"Invite users"}
|
|
157
120
|
/>
|
|
158
|
-
<Item
|
|
159
|
-
icon={<Item.Icon label={"New Team"} element={<Plus />} />}
|
|
160
|
-
text={"New Team"}
|
|
161
|
-
/>
|
|
121
|
+
<Item icon={<Item.Icon label={"New Team"} element={<Plus />} />} text={"New Team"} />
|
|
162
122
|
</Group>
|
|
163
123
|
<Separator />
|
|
164
|
-
<Item
|
|
165
|
-
|
|
166
|
-
text={"Support"}
|
|
167
|
-
/>
|
|
168
|
-
<Item
|
|
169
|
-
icon={<Item.Icon label={"API"} element={<Cloud />} />}
|
|
170
|
-
text={"API"}
|
|
171
|
-
disabled
|
|
172
|
-
/>
|
|
124
|
+
<Item icon={<Item.Icon label={"Support"} element={<LifeBuoy />} />} text={"Support"} />
|
|
125
|
+
<Item icon={<Item.Icon label={"API"} element={<Cloud />} />} text={"API"} disabled />
|
|
173
126
|
<Separator />
|
|
174
|
-
<Item
|
|
175
|
-
icon={<Item.Icon label={"Log out"} element={<LogOut />} />}
|
|
176
|
-
text={"Log out"}
|
|
177
|
-
/>
|
|
127
|
+
<Item icon={<Item.Icon label={"Log out"} element={<LogOut />} />} text={"Log out"} />
|
|
178
128
|
<Separator />
|
|
179
129
|
<Label text={"Links"} />
|
|
180
130
|
<Link
|
|
@@ -213,23 +163,17 @@ import { ReactComponent as Keyboard } from "@webiny/icons/keyboard.svg";
|
|
|
213
163
|
const { Item } = DropdownMenu;
|
|
214
164
|
|
|
215
165
|
const SimpleMenuWithIconsExample = () => {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
icon={<Item.Icon label={"Keyboard shortcuts"} element={<Keyboard />} />}
|
|
228
|
-
text={"Keyboard shortcuts"}
|
|
229
|
-
/>
|
|
230
|
-
</DropdownMenu>
|
|
231
|
-
);
|
|
232
|
-
};
|
|
166
|
+
return (
|
|
167
|
+
|
|
168
|
+
<DropdownMenu trigger={<Button variant="primary" text={"Open"} />}>
|
|
169
|
+
<Item icon={<Item.Icon label={"Billing"} element={<CreditCard />} />} text={"Billing"} />
|
|
170
|
+
<Item icon={<Item.Icon label={"Settings"} element={<Settings />} />} text={"Settings"} />
|
|
171
|
+
<Item
|
|
172
|
+
icon={<Item.Icon label={"Keyboard shortcuts"} element={<Keyboard />} />}
|
|
173
|
+
text={"Keyboard shortcuts"}
|
|
174
|
+
/>
|
|
175
|
+
</DropdownMenu>
|
|
176
|
+
); };
|
|
233
177
|
|
|
234
178
|
export default SimpleMenuWithIconsExample;
|
|
235
179
|
` }} />
|
|
@@ -256,82 +200,42 @@ import { ReactComponent as PlusCircle } from "@webiny/icons/add_circle.svg";
|
|
|
256
200
|
const { Label, Separator, Group, Item } = DropdownMenu;
|
|
257
201
|
|
|
258
202
|
const WithSubMenusExample = () => {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<
|
|
278
|
-
<Group>
|
|
279
|
-
<Item icon={<Item.Icon label={"Team"} element={<Users />} />} text={"Team"} />
|
|
280
|
-
<Item
|
|
281
|
-
icon={<Item.Icon label={"Invite user"} element={<UserPlus />} />}
|
|
282
|
-
text={"Invite users"}
|
|
283
|
-
>
|
|
284
|
-
<Item
|
|
285
|
-
icon={<Item.Icon label={"Email"} element={<Mail />} />}
|
|
286
|
-
text={"Email"}
|
|
287
|
-
/>
|
|
288
|
-
<Item
|
|
289
|
-
icon={<Item.Icon label={"Message"} element={<MessageSquare />} />}
|
|
290
|
-
text={"Message"}
|
|
291
|
-
/>
|
|
292
|
-
<Separator />
|
|
293
|
-
<Item
|
|
294
|
-
icon={<Item.Icon label={"More..."} element={<PlusCircle />} />}
|
|
295
|
-
text={"More..."}
|
|
296
|
-
>
|
|
297
|
-
<Item
|
|
298
|
-
icon={<Item.Icon label={"Email"} element={<Mail />} />}
|
|
299
|
-
text={"Email"}
|
|
300
|
-
/>
|
|
301
|
-
<Item
|
|
302
|
-
icon={<Item.Icon label={"Message"} element={<MessageSquare />} />}
|
|
303
|
-
text={"Message"}
|
|
304
|
-
/>
|
|
305
|
-
<Separator />
|
|
306
|
-
<Item
|
|
307
|
-
icon={<Item.Icon label={"More..."} element={<PlusCircle />} />}
|
|
308
|
-
text={"More..."}
|
|
309
|
-
/>
|
|
310
|
-
</Item>
|
|
311
|
-
</Item>
|
|
312
|
-
<Item
|
|
313
|
-
icon={<Item.Icon label={"New Team"} element={<Plus />} />}
|
|
314
|
-
text={"New Team"}
|
|
315
|
-
/>
|
|
316
|
-
</Group>
|
|
317
|
-
<Separator />
|
|
318
|
-
<Item
|
|
319
|
-
icon={<Item.Icon label={"Support"} element={<LifeBuoy />} />}
|
|
320
|
-
text={"Support"}
|
|
321
|
-
/>
|
|
322
|
-
<Item
|
|
323
|
-
icon={<Item.Icon label={"API"} element={<Cloud />} />}
|
|
324
|
-
text={"API"}
|
|
325
|
-
disabled
|
|
326
|
-
/>
|
|
203
|
+
return (
|
|
204
|
+
|
|
205
|
+
<DropdownMenu trigger={<Button variant="primary" text={"Open"} />}>
|
|
206
|
+
<Label text={"My Account"} />
|
|
207
|
+
<Item icon={<Item.Icon element={<User />} label={"Profile"} />} text={"Profile"} />
|
|
208
|
+
<Group>
|
|
209
|
+
<Item icon={<Item.Icon label={"Billing"} element={<CreditCard />} />} text={"Billing"} />
|
|
210
|
+
<Item icon={<Item.Icon label={"Settings"} element={<Settings />} />} text={"Settings"} />
|
|
211
|
+
<Item
|
|
212
|
+
icon={<Item.Icon label={"Keyboard shortcuts"} element={<Keyboard />} />}
|
|
213
|
+
text={"Keyboard shortcuts"}
|
|
214
|
+
/>
|
|
215
|
+
</Group>
|
|
216
|
+
<Separator />
|
|
217
|
+
<Group>
|
|
218
|
+
<Item icon={<Item.Icon label={"Team"} element={<Users />} />} text={"Team"} />
|
|
219
|
+
<Item icon={<Item.Icon label={"Invite user"} element={<UserPlus />} />} text={"Invite users"}>
|
|
220
|
+
<Item icon={<Item.Icon label={"Email"} element={<Mail />} />} text={"Email"} />
|
|
221
|
+
<Item icon={<Item.Icon label={"Message"} element={<MessageSquare />} />} text={"Message"} />
|
|
327
222
|
<Separator />
|
|
328
|
-
<Item
|
|
329
|
-
icon={<Item.Icon label={"
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
223
|
+
<Item icon={<Item.Icon label={"More..."} element={<PlusCircle />} />} text={"More..."}>
|
|
224
|
+
<Item icon={<Item.Icon label={"Email"} element={<Mail />} />} text={"Email"} />
|
|
225
|
+
<Item icon={<Item.Icon label={"Message"} element={<MessageSquare />} />} text={"Message"} />
|
|
226
|
+
<Separator />
|
|
227
|
+
<Item icon={<Item.Icon label={"More..."} element={<PlusCircle />} />} text={"More..."} />
|
|
228
|
+
</Item>
|
|
229
|
+
</Item>
|
|
230
|
+
<Item icon={<Item.Icon label={"New Team"} element={<Plus />} />} text={"New Team"} />
|
|
231
|
+
</Group>
|
|
232
|
+
<Separator />
|
|
233
|
+
<Item icon={<Item.Icon label={"Support"} element={<LifeBuoy />} />} text={"Support"} />
|
|
234
|
+
<Item icon={<Item.Icon label={"API"} element={<Cloud />} />} text={"API"} disabled />
|
|
235
|
+
<Separator />
|
|
236
|
+
<Item icon={<Item.Icon label={"Log out"} element={<LogOut />} />} text={"Log out"} />
|
|
237
|
+
</DropdownMenu>
|
|
238
|
+
); };
|
|
335
239
|
|
|
336
240
|
export default WithSubMenusExample;
|
|
337
241
|
` }} />
|
|
@@ -343,53 +247,54 @@ import React from "react";
|
|
|
343
247
|
import { DropdownMenu, Button, Text } from "@webiny/admin-ui";
|
|
344
248
|
|
|
345
249
|
const TARGET_LEVELS = [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
250
|
+
{
|
|
251
|
+
id: "viewer",
|
|
252
|
+
label: "Viewer",
|
|
253
|
+
description: "Can view content, but not modify it"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "editor",
|
|
257
|
+
label: "Editor",
|
|
258
|
+
description: "Can view and modify content"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: "owner",
|
|
262
|
+
label: "Owner",
|
|
263
|
+
description: "Can edit and manage content permissions"
|
|
264
|
+
}
|
|
361
265
|
];
|
|
362
266
|
|
|
363
267
|
const WithCheckboxItemsExample = () => {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
};
|
|
268
|
+
return (
|
|
269
|
+
|
|
270
|
+
<DropdownMenu trigger={<Button variant="primary" text={"Open"} />}>
|
|
271
|
+
{TARGET_LEVELS.map(level => (
|
|
272
|
+
<DropdownMenu.CheckboxItem
|
|
273
|
+
key={level.id}
|
|
274
|
+
checked={level.id === "viewer"}
|
|
275
|
+
text={
|
|
276
|
+
<div>
|
|
277
|
+
<Text as={"div"}>{level.label}</Text>
|
|
278
|
+
<Text as={"div"} size={"sm"} className={"text-neutral-strong"}>
|
|
279
|
+
{level.description}
|
|
280
|
+
</Text>
|
|
281
|
+
</div>
|
|
282
|
+
}
|
|
283
|
+
onClick={() => {
|
|
284
|
+
console.log("Selected level:", level.id);
|
|
285
|
+
}}
|
|
286
|
+
/>
|
|
287
|
+
))}
|
|
288
|
+
<DropdownMenu.Separator />
|
|
289
|
+
<DropdownMenu.Item text={"Remove access"} />
|
|
290
|
+
</DropdownMenu>
|
|
291
|
+
); };
|
|
388
292
|
|
|
389
293
|
export default WithCheckboxItemsExample;
|
|
390
294
|
` }} />
|
|
391
295
|
|
|
392
296
|
### With Open Change Handler
|
|
297
|
+
|
|
393
298
|
With Open Change Handler, you can listen to the menu's open state changes.
|
|
394
299
|
For this you can use the `onOpenChange` prop.
|
|
395
300
|
|
|
@@ -403,28 +308,22 @@ import { ReactComponent as Keyboard } from "@webiny/icons/keyboard.svg";
|
|
|
403
308
|
const { Item } = DropdownMenu;
|
|
404
309
|
|
|
405
310
|
const WithOnOpenChangeExample = () => {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
icon={<Item.Icon element={<Keyboard />} label={"Keyboard shortcuts"} />}
|
|
423
|
-
text={"Keyboard shortcuts"}
|
|
424
|
-
/>
|
|
425
|
-
</DropdownMenu>
|
|
426
|
-
);
|
|
427
|
-
};
|
|
311
|
+
return (
|
|
312
|
+
|
|
313
|
+
<DropdownMenu
|
|
314
|
+
trigger={<Button variant="primary" text={"Open"} />}
|
|
315
|
+
onOpenChange={opened => {
|
|
316
|
+
console.log("On Open Change");
|
|
317
|
+
}}
|
|
318
|
+
>
|
|
319
|
+
<Item icon={<Item.Icon element={<CreditCard />} label={"Billing"} />} text={"Billing"} />
|
|
320
|
+
<Item icon={<Item.Icon element={<Settings />} label={"Settings"} />} text={"Settings"} />
|
|
321
|
+
<Item
|
|
322
|
+
icon={<Item.Icon element={<Keyboard />} label={"Keyboard shortcuts"} />}
|
|
323
|
+
text={"Keyboard shortcuts"}
|
|
324
|
+
/>
|
|
325
|
+
</DropdownMenu>
|
|
326
|
+
); };
|
|
428
327
|
|
|
429
328
|
export default WithOnOpenChangeExample;
|
|
430
329
|
` }} />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DropdownMenu","DropdownMenuPrimitive","cn","makeDecoratable","ReactComponent","Check","DropdownMenuCheckboxItemBase","forwardRef","className","text","checked","props","ref","createElement","CheckboxItem","Object","assign","disabled","ItemIndicator","displayName","DropdownMenuCheckboxItem"],"sources":["DropdownMenuCheckboxItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { ReactComponent as Check } from \"@webiny/icons/check.svg\";\n\nexport interface DropdownMenuItemProps
|
|
1
|
+
{"version":3,"names":["React","DropdownMenu","DropdownMenuPrimitive","cn","makeDecoratable","ReactComponent","Check","DropdownMenuCheckboxItemBase","forwardRef","className","text","checked","props","ref","createElement","CheckboxItem","Object","assign","disabled","ItemIndicator","displayName","DropdownMenuCheckboxItem"],"sources":["DropdownMenuCheckboxItem.tsx"],"sourcesContent":["import React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\nimport { ReactComponent as Check } from \"@webiny/icons/check.svg\";\n\nexport interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.CheckboxItem\n> {\n text?: React.ReactNode;\n}\n\nconst DropdownMenuCheckboxItemBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n DropdownMenuItemProps\n>(({ className, text, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n \"group relative cursor-default select-none items-center rounded-sm px-xs-plus outline-none transition-colors\",\n \"[&_svg]:fill-neutral-xstrong [&_svg]:pointer-events-none [&_svg]:size-md [&_svg]:shrink-0\",\n \"data-disabled:pointer-events-none data-disabled:text-neutral-disabled\",\n className\n )}\n checked={checked}\n {...props}\n >\n <div\n className={cn(\n \"flex min-size-md px-sm py-xs-plus gap-sm-extra items-center text-md rounded-sm group-focus:bg-neutral-dimmed transition-colors\",\n { \"[&_svg]:fill-neutral-disabled\": props.disabled }\n )}\n >\n <DropdownMenuPrimitive.ItemIndicator>\n <Check />\n </DropdownMenuPrimitive.ItemIndicator>\n {!checked && <svg aria-hidden=\"true\" />}\n <span>{text}</span>\n </div>\n </DropdownMenuPrimitive.CheckboxItem>\n));\n\nDropdownMenuCheckboxItemBase.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;\n\nexport const DropdownMenuCheckboxItem = makeDecoratable(\n \"DropdownMenuCheckboxItem\",\n DropdownMenuCheckboxItemBase\n);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,IAAIC,qBAAqB,QAAQ,UAAU;AAChE,SAASC,EAAE,EAAEC,eAAe;AAC5B,SAASC,cAAc,IAAIC,KAAK,QAAQ,yBAAyB;AAQjE,MAAMC,4BAA4B,gBAAGP,KAAK,CAACQ,UAAU,CAGnD,CAAC;EAAEC,SAAS;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBAC1Cb,KAAA,CAAAc,aAAA,CAACZ,qBAAqB,CAACa,YAAY,EAAAC,MAAA,CAAAC,MAAA;EAC/BJ,GAAG,EAAEA,GAAI;EACTJ,SAAS,EAAEN,EAAE,CACT,6GAA6G,EAC7G,2FAA2F,EAC3F,uEAAuE,EACvEM,SACJ,CAAE;EACFE,OAAO,EAAEA;AAAQ,GACbC,KAAK,gBAETZ,KAAA,CAAAc,aAAA;EACIL,SAAS,EAAEN,EAAE,CACT,gIAAgI,EAChI;IAAE,+BAA+B,EAAES,KAAK,CAACM;EAAS,CACtD;AAAE,gBAEFlB,KAAA,CAAAc,aAAA,CAACZ,qBAAqB,CAACiB,aAAa,qBAChCnB,KAAA,CAAAc,aAAA,CAACR,KAAK,MAAE,CACyB,CAAC,EACrC,CAACK,OAAO,iBAAIX,KAAA,CAAAc,aAAA;EAAK,eAAY;AAAM,CAAE,CAAC,eACvCd,KAAA,CAAAc,aAAA,eAAOJ,IAAW,CACjB,CAC2B,CACvC,CAAC;AAEFH,4BAA4B,CAACa,WAAW,GAAGlB,qBAAqB,CAACa,YAAY,CAACK,WAAW;AAEzF,OAAO,MAAMC,wBAAwB,GAAGjB,eAAe,CACnD,0BAA0B,EAC1BG,4BACJ,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","DropdownMenu","DropdownMenuPrimitive","cn","makeDecoratable","DropdownMenuLabelBase","forwardRef","className","text","props","ref","createElement","Label","Object","assign","displayName","DropdownMenuLabel"],"sources":["DropdownMenuLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\n\nexport interface DropdownMenuLabelProps
|
|
1
|
+
{"version":3,"names":["React","DropdownMenu","DropdownMenuPrimitive","cn","makeDecoratable","DropdownMenuLabelBase","forwardRef","className","text","props","ref","createElement","Label","Object","assign","displayName","DropdownMenuLabel"],"sources":["DropdownMenuLabel.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nimport { cn, makeDecoratable } from \"~/utils.js\";\n\nexport interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<\n typeof DropdownMenuPrimitive.Label\n> {\n text: React.ReactNode;\n}\n\nconst DropdownMenuLabelBase = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n DropdownMenuLabelProps\n>(({ className, text, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n \"py-sm pl-sm-extra pr-md text-sm uppercase text-neutral-strong font-semibold\",\n className\n )}\n {...props}\n >\n {text}\n </DropdownMenuPrimitive.Label>\n));\nDropdownMenuLabelBase.displayName = DropdownMenuPrimitive.Label.displayName;\n\nexport const DropdownMenuLabel = makeDecoratable(\"DropdownMenuLabel\", DropdownMenuLabelBase);\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,YAAY,IAAIC,qBAAqB,QAAQ,UAAU;AAChE,SAASC,EAAE,EAAEC,eAAe;AAQ5B,MAAMC,qBAAqB,gBAAGL,KAAK,CAACM,UAAU,CAG5C,CAAC;EAAEC,SAAS;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,kBACjCV,KAAA,CAAAW,aAAA,CAACT,qBAAqB,CAACU,KAAK,EAAAC,MAAA,CAAAC,MAAA;EACxBJ,GAAG,EAAEA,GAAI;EACTH,SAAS,EAAEJ,EAAE,CACT,6EAA6E,EAC7EI,SACJ;AAAE,GACEE,KAAK,GAERD,IACwB,CAChC,CAAC;AACFH,qBAAqB,CAACU,WAAW,GAAGb,qBAAqB,CAACU,KAAK,CAACG,WAAW;AAE3E,OAAO,MAAMC,iBAAiB,GAAGZ,eAAe,CAAC,mBAAmB,EAAEC,qBAAqB,CAAC","ignoreList":[]}
|