@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
package/Grid/Grid.mdx
CHANGED
|
@@ -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 GridStories from
|
|
3
|
+
import * as GridStories from "./Grid.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={GridStories} />
|
|
6
6
|
|
|
@@ -13,56 +13,44 @@ import React from "react";
|
|
|
13
13
|
import { Grid } from "@webiny/admin-ui";
|
|
14
14
|
|
|
15
15
|
const GridExample = () => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<Grid.Column span={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
37
|
-
Col 7<br/>Span: 2
|
|
38
|
-
</Grid.Column>
|
|
39
|
-
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
40
|
-
Col 8
|
|
41
|
-
</Grid.Column>
|
|
42
|
-
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
43
|
-
Col 9
|
|
44
|
-
</Grid.Column>
|
|
45
|
-
</Grid>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
16
|
+
return (
|
|
17
|
+
|
|
18
|
+
<Grid gap={"comfortable"} className={"bg-neutral-light p-4"}>
|
|
19
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 1</Grid.Column>
|
|
20
|
+
<Grid.Column span={3} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
21
|
+
Col 2<br />
|
|
22
|
+
Span: 3
|
|
23
|
+
</Grid.Column>
|
|
24
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 3</Grid.Column>
|
|
25
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 4</Grid.Column>
|
|
26
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 5</Grid.Column>
|
|
27
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 6</Grid.Column>
|
|
28
|
+
<Grid.Column span={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
29
|
+
Col 7<br />
|
|
30
|
+
Span: 2
|
|
31
|
+
</Grid.Column>
|
|
32
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 8</Grid.Column>
|
|
33
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 9</Grid.Column>
|
|
34
|
+
</Grid>
|
|
35
|
+
); };
|
|
48
36
|
|
|
49
37
|
export default GridExample;
|
|
50
38
|
|
|
51
39
|
` } }
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
40
|
+
additionalActions={[
|
|
41
|
+
{
|
|
42
|
+
title: 'Open in GitHub',
|
|
43
|
+
onClick: () => {
|
|
44
|
+
window.open(
|
|
45
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/Grid/Grid.tsx',
|
|
46
|
+
'_blank'
|
|
47
|
+
);
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
]}
|
|
63
51
|
/>
|
|
64
52
|
|
|
65
|
-
<Controls of={GridStories.Documentation}/>
|
|
53
|
+
<Controls of={GridStories.Documentation} />
|
|
66
54
|
|
|
67
55
|
## Usage
|
|
68
56
|
|
|
@@ -71,37 +59,39 @@ import React from "react";
|
|
|
71
59
|
import { Grid } from "@webiny/admin-ui";
|
|
72
60
|
|
|
73
61
|
const GridExample = () => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
62
|
+
return (
|
|
63
|
+
<Grid gap={"comfortable"} className={"bg-neutral-light p-4"}>
|
|
64
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
65
|
+
Col 1
|
|
66
|
+
</Grid.Column>
|
|
67
|
+
<Grid.Column span={3} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
68
|
+
Col 2<br />
|
|
69
|
+
Span: 3
|
|
70
|
+
</Grid.Column>
|
|
71
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
72
|
+
Col 3
|
|
73
|
+
</Grid.Column>
|
|
74
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
75
|
+
Col 4
|
|
76
|
+
</Grid.Column>
|
|
77
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
78
|
+
Col 5
|
|
79
|
+
</Grid.Column>
|
|
80
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
81
|
+
Col 6
|
|
82
|
+
</Grid.Column>
|
|
83
|
+
<Grid.Column span={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
84
|
+
Col 7<br />
|
|
85
|
+
Span: 2
|
|
86
|
+
</Grid.Column>
|
|
87
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
88
|
+
Col 8
|
|
89
|
+
</Grid.Column>
|
|
90
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
91
|
+
Col 9
|
|
92
|
+
</Grid.Column>
|
|
93
|
+
</Grid>
|
|
94
|
+
);
|
|
105
95
|
};
|
|
106
96
|
|
|
107
97
|
export default GridExample;
|
|
@@ -110,6 +100,7 @@ export default GridExample;
|
|
|
110
100
|
## Examples
|
|
111
101
|
|
|
112
102
|
### Spacious Gap
|
|
103
|
+
|
|
113
104
|
To have more spacing between grid columns, you can use the `gap` prop and set it to `spacious`.
|
|
114
105
|
|
|
115
106
|
<Canvas of={GridStories.WithGapSpacious} source={ { code: `
|
|
@@ -117,38 +108,26 @@ import React from "react";
|
|
|
117
108
|
import { Grid } from "@webiny/admin-ui";
|
|
118
109
|
|
|
119
110
|
const GridSpaciousExample = () => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<Grid.Column span={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
141
|
-
Col 7<br/>Span: 2
|
|
142
|
-
</Grid.Column>
|
|
143
|
-
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
144
|
-
Col 8
|
|
145
|
-
</Grid.Column>
|
|
146
|
-
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
147
|
-
Col 9
|
|
148
|
-
</Grid.Column>
|
|
149
|
-
</Grid>
|
|
150
|
-
);
|
|
151
|
-
};
|
|
111
|
+
return (
|
|
112
|
+
|
|
113
|
+
<Grid gap={"spacious"} className={"bg-neutral-light p-4"}>
|
|
114
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 1</Grid.Column>
|
|
115
|
+
<Grid.Column span={3} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
116
|
+
Col 2<br />
|
|
117
|
+
Span: 3
|
|
118
|
+
</Grid.Column>
|
|
119
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 3</Grid.Column>
|
|
120
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 4</Grid.Column>
|
|
121
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 5</Grid.Column>
|
|
122
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 6</Grid.Column>
|
|
123
|
+
<Grid.Column span={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
124
|
+
Col 7<br />
|
|
125
|
+
Span: 2
|
|
126
|
+
</Grid.Column>
|
|
127
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 8</Grid.Column>
|
|
128
|
+
<Grid.Column className="bg-primary text-neutral-light p-2 text-md rounded-sm">Col 9</Grid.Column>
|
|
129
|
+
</Grid>
|
|
130
|
+
); };
|
|
152
131
|
|
|
153
132
|
export default GridSpaciousExample;
|
|
154
133
|
|
|
@@ -156,6 +135,7 @@ const GridSpaciousExample = () => {
|
|
|
156
135
|
/>
|
|
157
136
|
|
|
158
137
|
### With Offset
|
|
138
|
+
|
|
159
139
|
With Offset, you can create a grid with a specific offset. The offset is applied to columns, e.g. `<Grid.Column span={8} offset={2}/>`. Please refer to the example - click on **Show code** to see code example.
|
|
160
140
|
|
|
161
141
|
<Canvas of={GridStories.WithOffset} source={ { code: `
|
|
@@ -163,8 +143,9 @@ import React from "react";
|
|
|
163
143
|
import { Grid } from "@webiny/admin-ui";
|
|
164
144
|
|
|
165
145
|
const GridWithOffsetExample = () => {
|
|
166
|
-
|
|
167
|
-
|
|
146
|
+
return (
|
|
147
|
+
|
|
148
|
+
<Grid gap={"spacious"} className={"bg-neutral-light p-4"}>
|
|
168
149
|
|
|
169
150
|
{/* Row 1 */}
|
|
170
151
|
<Grid.Column span={8} offset={2} className="bg-primary text-neutral-light p-2 text-md rounded-sm">
|
|
@@ -204,46 +185,55 @@ const GridWithOffsetExample = () => {
|
|
|
204
185
|
/>
|
|
205
186
|
|
|
206
187
|
## Horizontal Grids
|
|
188
|
+
|
|
207
189
|
The grids within the Webiny Design System behave as fixed and fluid elements relevant to the elements on the page.
|
|
208
190
|
|
|
209
191
|
### Grid types
|
|
192
|
+
|
|
210
193
|
Webiny Design System use two types of grids: fluid and fixed. Both grid types use breakpoints to determine whether the layout needs to change between viewport sizes.
|
|
211
194
|
|
|
212
195
|
### Fluid
|
|
213
|
-
The fluid grid stretches across an area to fill all available space within the screen, part of the screen or within the specific element if needed.
|
|
214
196
|
|
|
215
|
-
|
|
197
|
+
The fluid grid stretches across an area to fill all available space within the screen, part of the screen or within the specific element if needed.
|
|
216
198
|
|
|
217
|
-
<img src="/images/storybook/grid/fluid
|
|
199
|
+
<img src="/images/storybook/grid/fluid.png" alt="Fluid" />
|
|
218
200
|
|
|
201
|
+
<img src="/images/storybook/grid/fluid-dashboard.png" alt="Fluid Dashboard" />
|
|
219
202
|
|
|
220
203
|
### Fixed
|
|
204
|
+
|
|
221
205
|
The fixed grid applies the ideal maximum width to page or page element.
|
|
222
206
|
|
|
223
|
-
<img src="/images/storybook/grid/fixed.png" alt="Fixed"/>
|
|
207
|
+
<img src="/images/storybook/grid/fixed.png" alt="Fixed" />
|
|
224
208
|
|
|
225
|
-
<img src="/images/storybook/grid/fixed-dashboard.png" alt="Fixed Dashboard"/>
|
|
209
|
+
<img src="/images/storybook/grid/fixed-dashboard.png" alt="Fixed Dashboard" />
|
|
226
210
|
|
|
227
211
|
## Grid Gutter Sizes
|
|
212
|
+
|
|
228
213
|
We considered using two main sizes for grid application, to be used dependent on the content type.
|
|
229
214
|
|
|
230
215
|
### Comfortable (Default)
|
|
231
|
-
|
|
216
|
+
|
|
217
|
+
<img src="/images/storybook/grid/grid-gutter-size-comfortable.png" alt="Comfortable (Default)" />
|
|
232
218
|
|
|
233
219
|
### Spacious
|
|
234
|
-
|
|
220
|
+
|
|
221
|
+
<img src="/images/storybook/grid/grid-gutter-size-spacious.png" alt="Spacious" />
|
|
235
222
|
|
|
236
223
|
## Breakpoints
|
|
224
|
+
|
|
237
225
|
A breakpoint marks the point where a website’s layout adapts to provide the best user experience. In responsive design, the range of each breakpoint defines the ideal number of columns for a given viewport size, along with the suggested widths for margins and gutters.
|
|
238
226
|
|
|
239
|
-
<img src="/images/storybook/grid/breakpoints.png" alt="Breakpoints"/>
|
|
227
|
+
<img src="/images/storybook/grid/breakpoints.png" alt="Breakpoints" />
|
|
240
228
|
|
|
241
229
|
## Column Spans
|
|
230
|
+
|
|
242
231
|
Content should be distributed across a minimum of 3 columns, with the option to extend up to 12 columns. To achieve a range of layouts, vary the number of columns used, allowing for flexible design across different breakpoints.
|
|
243
232
|
|
|
244
|
-
<img src="/images/storybook/grid/column-spans.png" alt="Column Spans"/>
|
|
233
|
+
<img src="/images/storybook/grid/column-spans.png" alt="Column Spans" />
|
|
245
234
|
|
|
246
235
|
## Column Offsets
|
|
236
|
+
|
|
247
237
|
Content isn't required to span the full 12 columns. It can cover a smaller number of columns, creating a layout where the content is centered within a 12-column grid.
|
|
248
238
|
|
|
249
|
-
<img src="/images/storybook/grid/column-offsets.png" alt="Column Offsets"/>
|
|
239
|
+
<img src="/images/storybook/grid/column-offsets.png" alt="Column Offsets" />
|
package/HeaderBar/HeaderBar.mdx
CHANGED
|
@@ -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 HeaderBarStories from
|
|
3
|
+
import * as HeaderBarStories from "./HeaderBar.stories";
|
|
4
4
|
|
|
5
5
|
<Meta of={HeaderBarStories} />
|
|
6
6
|
|
|
@@ -16,11 +16,12 @@ import { HeaderBar, Button, IconButton, Avatar, Text } from "@webiny/admin-ui";
|
|
|
16
16
|
import { ReactComponent as KeyboardArrowRightIcon } from "@webiny/icons/keyboard_arrow_down.svg";
|
|
17
17
|
|
|
18
18
|
const HeaderBarExample = () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
const StartContent = () => (
|
|
20
|
+
|
|
21
|
+
<Text size={"sm"} className={"text-neutral-dimmed"}>
|
|
22
|
+
{"Headless CMS / Articles / The best article ever"}
|
|
23
|
+
</Text>
|
|
24
|
+
);
|
|
24
25
|
|
|
25
26
|
const MiddleContent = () => <>Content in the middle</>;
|
|
26
27
|
|
|
@@ -56,22 +57,23 @@ const HeaderBarExample = () => {
|
|
|
56
57
|
end={<EndContent />}
|
|
57
58
|
/>
|
|
58
59
|
);
|
|
60
|
+
|
|
59
61
|
};
|
|
60
62
|
|
|
61
63
|
export default HeaderBarExample;
|
|
62
64
|
|
|
63
65
|
` } }
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
additionalActions={[
|
|
67
|
+
{
|
|
68
|
+
title: 'Open in GitHub',
|
|
69
|
+
onClick: () => {
|
|
70
|
+
window.open(
|
|
71
|
+
'https://github.com/webiny/webiny-js/blob/feat/new-admin-ui/packages/admin-ui/src/HeaderBar/HeaderBar.tsx',
|
|
72
|
+
'_blank'
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
]}
|
|
75
77
|
/>
|
|
76
78
|
|
|
77
79
|
<Controls of={HeaderBarStories.Documentation} />
|
|
@@ -82,47 +84,36 @@ import { HeaderBar, Button, IconButton, Avatar, Text } from "@webiny/admin-ui";
|
|
|
82
84
|
import { ReactComponent as KeyboardArrowRightIcon } from "@webiny/icons/keyboard_arrow_down.svg";
|
|
83
85
|
|
|
84
86
|
const HeaderBarExample = () => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<Avatar
|
|
103
|
-
size={"sm"}
|
|
104
|
-
variant={"strong"}
|
|
105
|
-
image={<Avatar.Image src={"https://i.pravatar.cc/300"} />}
|
|
106
|
-
fallback={<Avatar.Fallback delayMs={0}>W</Avatar.Fallback>}
|
|
107
|
-
/>
|
|
108
|
-
<IconButton
|
|
109
|
-
variant={"ghost"}
|
|
110
|
-
size={"xs"}
|
|
111
|
-
color={"neutral-strong"}
|
|
112
|
-
icon={<KeyboardArrowRightIcon />}
|
|
113
|
-
onClick={() => console.log("clicked")}
|
|
114
|
-
/>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
);
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<HeaderBar
|
|
121
|
-
start={<StartContent />}
|
|
122
|
-
middle={<MiddleContent />}
|
|
123
|
-
end={<EndContent />}
|
|
87
|
+
const StartContent = () => (
|
|
88
|
+
<Text size={"sm"} className={"text-neutral-dimmed"}>
|
|
89
|
+
{"Headless CMS / Articles / The best article ever"}
|
|
90
|
+
</Text>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const MiddleContent = () => <>Content in the middle</>;
|
|
94
|
+
|
|
95
|
+
const EndContent = () => (
|
|
96
|
+
<div className={"flex gap-x-sm"}>
|
|
97
|
+
<Button variant={"ghost"} size={"md"} text={"Root tenant"} />
|
|
98
|
+
<div className={"flex items-center rounded-md " + "gap-xxs py-xs px-xs bg-neutral-light"}>
|
|
99
|
+
<Avatar
|
|
100
|
+
size={"sm"}
|
|
101
|
+
variant={"strong"}
|
|
102
|
+
image={<Avatar.Image src={"https://i.pravatar.cc/300"} />}
|
|
103
|
+
fallback={<Avatar.Fallback delayMs={0}>W</Avatar.Fallback>}
|
|
124
104
|
/>
|
|
125
|
-
|
|
105
|
+
<IconButton
|
|
106
|
+
variant={"ghost"}
|
|
107
|
+
size={"xs"}
|
|
108
|
+
color={"neutral-strong"}
|
|
109
|
+
icon={<KeyboardArrowRightIcon />}
|
|
110
|
+
onClick={() => console.log("clicked")}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
return <HeaderBar start={<StartContent />} middle={<MiddleContent />} end={<EndContent />} />;
|
|
126
117
|
};
|
|
127
118
|
|
|
128
119
|
export default HeaderBarExample;
|
|
@@ -137,13 +128,15 @@ import React from "react";
|
|
|
137
128
|
import { HeaderBar, Text } from "@webiny/admin-ui";
|
|
138
129
|
|
|
139
130
|
const StartContentOnlyExample = () => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
131
|
+
const StartContent = () => (
|
|
132
|
+
|
|
133
|
+
<Text size={"sm"} className={"text-neutral-dimmed"}>
|
|
134
|
+
{"Headless CMS / Articles / The best article ever"}
|
|
135
|
+
</Text>
|
|
136
|
+
);
|
|
145
137
|
|
|
146
138
|
return <HeaderBar start={<StartContent />} />;
|
|
139
|
+
|
|
147
140
|
};
|
|
148
141
|
|
|
149
142
|
export default StartContentOnlyExample;
|
|
@@ -156,9 +149,10 @@ import React from "react";
|
|
|
156
149
|
import { HeaderBar } from "@webiny/admin-ui";
|
|
157
150
|
|
|
158
151
|
const MiddleContentOnlyExample = () => {
|
|
159
|
-
|
|
152
|
+
const MiddleContent = () => <>Content in the middle</>;
|
|
160
153
|
|
|
161
154
|
return <HeaderBar middle={<MiddleContent />} />;
|
|
155
|
+
|
|
162
156
|
};
|
|
163
157
|
|
|
164
158
|
export default MiddleContentOnlyExample;
|
|
@@ -172,33 +166,34 @@ import { HeaderBar, Button, IconButton, Avatar } from "@webiny/admin-ui";
|
|
|
172
166
|
import { ReactComponent as KeyboardArrowRightIcon } from "@webiny/icons/keyboard_arrow_down.svg";
|
|
173
167
|
|
|
174
168
|
const EndContentOnlyExample = () => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
169
|
+
const EndContent = () => (
|
|
170
|
+
|
|
171
|
+
<div className={"flex gap-x-sm"}>
|
|
172
|
+
<Button variant={"ghost"} size={"md"} text={"Root tenant"} />
|
|
173
|
+
<div
|
|
174
|
+
className={
|
|
175
|
+
"flex items-center rounded-md gap-xxs
|
|
176
|
+
py-xs px-xs bg-neutral-light"
|
|
177
|
+
} >
|
|
178
|
+
<Avatar
|
|
179
|
+
size={"sm"}
|
|
180
|
+
variant={"strong"}
|
|
181
|
+
image={<Avatar.Image src={"https://i.pravatar.cc/300"} />}
|
|
182
|
+
fallback={<Avatar.Fallback delayMs={0}>W</Avatar.Fallback>}
|
|
183
|
+
/>
|
|
184
|
+
<IconButton
|
|
185
|
+
variant={"ghost"}
|
|
186
|
+
size={"xs"}
|
|
187
|
+
color={"neutral-strong"}
|
|
188
|
+
icon={<KeyboardArrowRightIcon />}
|
|
189
|
+
onClick={() => console.log("clicked")}
|
|
190
|
+
/>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
);
|
|
200
194
|
|
|
201
195
|
return <HeaderBar end={<EndContent />} />;
|
|
196
|
+
|
|
202
197
|
};
|
|
203
198
|
|
|
204
199
|
export default EndContentOnlyExample;
|
|
@@ -212,11 +207,12 @@ import { HeaderBar, Button, IconButton, Avatar, Text } from "@webiny/admin-ui";
|
|
|
212
207
|
import { ReactComponent as KeyboardArrowRightIcon } from "@webiny/icons/keyboard_arrow_down.svg";
|
|
213
208
|
|
|
214
209
|
const StartEndContentOnlyExample = () => {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
210
|
+
const StartContent = () => (
|
|
211
|
+
|
|
212
|
+
<Text size={"sm"} className={"text-neutral-dimmed"}>
|
|
213
|
+
{"Headless CMS / Articles / The best article ever"}
|
|
214
|
+
</Text>
|
|
215
|
+
);
|
|
220
216
|
|
|
221
217
|
const EndContent = () => (
|
|
222
218
|
<div className={"flex gap-x-sm"}>
|
|
@@ -244,6 +240,7 @@ const StartEndContentOnlyExample = () => {
|
|
|
244
240
|
);
|
|
245
241
|
|
|
246
242
|
return <HeaderBar start={<StartContent />} end={<EndContent />} />;
|
|
243
|
+
|
|
247
244
|
};
|
|
248
245
|
|
|
249
246
|
export default StartEndContentOnlyExample;
|
|
@@ -257,11 +254,12 @@ import { HeaderBar, Button, IconButton, Avatar, Text } from "@webiny/admin-ui";
|
|
|
257
254
|
import { ReactComponent as KeyboardArrowRightIcon } from "@webiny/icons/keyboard_arrow_down.svg";
|
|
258
255
|
|
|
259
256
|
const MoreStartContentExample = () => {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
257
|
+
const StartContent = () => (
|
|
258
|
+
|
|
259
|
+
<Text size={"sm"} className={"text-neutral-dimmed"}>
|
|
260
|
+
{"Headless CMS / Articles / The best article ever"}
|
|
261
|
+
</Text>
|
|
262
|
+
);
|
|
265
263
|
|
|
266
264
|
const MiddleContent = () => <>Content in the middle</>;
|
|
267
265
|
|
|
@@ -303,6 +301,7 @@ const MoreStartContentExample = () => {
|
|
|
303
301
|
end={<EndContent />}
|
|
304
302
|
/>
|
|
305
303
|
);
|
|
304
|
+
|
|
306
305
|
};
|
|
307
306
|
|
|
308
307
|
export default MoreStartContentExample;
|
package/Heading/Heading.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type HeadingTags = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
|
4
4
|
export type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
5
|
declare const headingVariants: (props?: ({
|
|
6
6
|
level?: 1 | 2 | 4 | 3 | 5 | 6 | null | undefined;
|
|
7
|
-
} & import("class-variance-authority/
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement>, VariantProps<typeof headingVariants> {
|
|
9
9
|
as?: HeadingTags;
|
|
10
10
|
}
|
package/Heading/Heading.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","cn","makeDecoratable","cva","TAG_MAP","headingVariants","variants","level","defaultVariants","HeadingBase","children","className","as","props","validatedLevel","Tag","createElement","Object","assign","Heading"],"sources":["Heading.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable, cva, type VariantProps } from \"~/utils.js\";\n\nexport type HeadingTags = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\nexport type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;\n\n// Create a mapping of variant to tag\nconst TAG_MAP: Record<HeadingLevels, HeadingTags> = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\"\n};\n\nconst headingVariants = cva(\"font-sans\", {\n variants: {\n level: {\n 1: \"text-h1\",\n 2: \"text-h2\",\n 3: \"text-h3\",\n 4: \"text-h4\",\n 5: \"text-h5\",\n 6: \"text-h6\"\n }\n },\n defaultVariants: {\n level: 1\n }\n});\n\ninterface HeadingProps\n extends React.HTMLAttributes<HTMLHeadingElement
|
|
1
|
+
{"version":3,"names":["React","cn","makeDecoratable","cva","TAG_MAP","headingVariants","variants","level","defaultVariants","HeadingBase","children","className","as","props","validatedLevel","Tag","createElement","Object","assign","Heading"],"sources":["Heading.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, makeDecoratable, cva, type VariantProps } from \"~/utils.js\";\n\nexport type HeadingTags = \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\nexport type HeadingLevels = 1 | 2 | 3 | 4 | 5 | 6;\n\n// Create a mapping of variant to tag\nconst TAG_MAP: Record<HeadingLevels, HeadingTags> = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\"\n};\n\nconst headingVariants = cva(\"font-sans\", {\n variants: {\n level: {\n 1: \"text-h1\",\n 2: \"text-h2\",\n 3: \"text-h3\",\n 4: \"text-h4\",\n 5: \"text-h5\",\n 6: \"text-h6\"\n }\n },\n defaultVariants: {\n level: 1\n }\n});\n\ninterface HeadingProps\n extends React.HTMLAttributes<HTMLHeadingElement>, VariantProps<typeof headingVariants> {\n as?: HeadingTags;\n}\n\nconst HeadingBase = ({ children, level, className, as, ...props }: HeadingProps) => {\n // Ensure `level` is a valid number, or fallback to a default value 1\n const validatedLevel = level && level in TAG_MAP ? level : 1;\n\n // Choose the tag: prefer `as`, otherwise use `TAG_MAP[validatedLevel]`\n const Tag = as || TAG_MAP[validatedLevel];\n\n return (\n <Tag {...props} className={cn(headingVariants({ level }), className)}>\n {children}\n </Tag>\n );\n};\n\nconst Heading = makeDecoratable(\"Heading\", HeadingBase);\n\nexport { Heading, type HeadingProps };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,EAAE,EAAEC,eAAe,EAAEC,GAAG;AAKjC;AACA,MAAMC,OAA2C,GAAG;EAChD,CAAC,EAAE,IAAI;EACP,CAAC,EAAE,IAAI;EACP,CAAC,EAAE,IAAI;EACP,CAAC,EAAE,IAAI;EACP,CAAC,EAAE,IAAI;EACP,CAAC,EAAE;AACP,CAAC;AAED,MAAMC,eAAe,GAAGF,GAAG,CAAC,WAAW,EAAE;EACrCG,QAAQ,EAAE;IACNC,KAAK,EAAE;MACH,CAAC,EAAE,SAAS;MACZ,CAAC,EAAE,SAAS;MACZ,CAAC,EAAE,SAAS;MACZ,CAAC,EAAE,SAAS;MACZ,CAAC,EAAE,SAAS;MACZ,CAAC,EAAE;IACP;EACJ,CAAC;EACDC,eAAe,EAAE;IACbD,KAAK,EAAE;EACX;AACJ,CAAC,CAAC;AAOF,MAAME,WAAW,GAAGA,CAAC;EAAEC,QAAQ;EAAEH,KAAK;EAAEI,SAAS;EAAEC,EAAE;EAAE,GAAGC;AAAoB,CAAC,KAAK;EAChF;EACA,MAAMC,cAAc,GAAGP,KAAK,IAAIA,KAAK,IAAIH,OAAO,GAAGG,KAAK,GAAG,CAAC;;EAE5D;EACA,MAAMQ,GAAG,GAAGH,EAAE,IAAIR,OAAO,CAACU,cAAc,CAAC;EAEzC,oBACId,KAAA,CAAAgB,aAAA,CAACD,GAAG,EAAAE,MAAA,CAAAC,MAAA,KAAKL,KAAK;IAAEF,SAAS,EAAEV,EAAE,CAACI,eAAe,CAAC;MAAEE;IAAM,CAAC,CAAC,EAAEI,SAAS;EAAE,IAChED,QACA,CAAC;AAEd,CAAC;AAED,MAAMS,OAAO,GAAGjB,eAAe,CAAC,SAAS,EAAEO,WAAW,CAAC;AAEvD,SAASU,OAAO","ignoreList":[]}
|