@vibe/core 4.2.5 → 4.3.0-alpha-9bd83.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/dist/metadata/accessibility/Accordion.md +10 -0
- package/dist/metadata/accessibility/AlertBanner.md +9 -0
- package/dist/metadata/accessibility/Avatar.md +12 -0
- package/dist/metadata/accessibility/AvatarGroup.md +6 -0
- package/dist/metadata/accessibility/BreadcrumbsBar.md +10 -0
- package/dist/metadata/accessibility/Button.md +13 -0
- package/dist/metadata/accessibility/ButtonGroup.md +9 -0
- package/dist/metadata/accessibility/Checkbox.md +13 -0
- package/dist/metadata/accessibility/Chips.md +10 -0
- package/dist/metadata/accessibility/Combobox.md +6 -0
- package/dist/metadata/accessibility/DropdownBasicDropdown.md +10 -0
- package/dist/metadata/accessibility/IconButton.md +26 -0
- package/dist/metadata/accessibility/Info.md +12 -0
- package/dist/metadata/accessibility/Link.md +8 -0
- package/dist/metadata/accessibility/List.md +11 -0
- package/dist/metadata/accessibility/Menu.md +10 -0
- package/dist/metadata/accessibility/MenuButton.md +6 -0
- package/dist/metadata/accessibility/MenuItem.md +8 -0
- package/dist/metadata/accessibility/Modal.md +35 -0
- package/dist/metadata/accessibility/NumberField.md +9 -0
- package/dist/metadata/accessibility/RadioButton.md +11 -0
- package/dist/metadata/accessibility/Search.md +10 -0
- package/dist/metadata/accessibility/Tabs.md +10 -0
- package/dist/metadata/accessibility/TextArea.md +17 -0
- package/dist/metadata/accessibility/TextField.md +16 -0
- package/dist/metadata/accessibility/Toast.md +4 -0
- package/dist/metadata/accessibility/Toggle.md +7 -0
- package/dist/metadata/accessibility/Tooltip.md +11 -0
- package/dist/metadata/components.json +20940 -0
- package/dist/metadata/examples/Accordion.md +136 -0
- package/dist/metadata/examples/AlertBanner.md +85 -0
- package/dist/metadata/examples/AttentionBox.md +267 -0
- package/dist/metadata/examples/Avatar.md +118 -0
- package/dist/metadata/examples/AvatarGroup.md +390 -0
- package/dist/metadata/examples/Badge.md +59 -0
- package/dist/metadata/examples/BaseInput.md +2 -0
- package/dist/metadata/examples/BaseList.md +342 -0
- package/dist/metadata/examples/Box.md +208 -0
- package/dist/metadata/examples/BreadcrumbItem.md +54 -0
- package/dist/metadata/examples/BreadcrumbsBar.md +64 -0
- package/dist/metadata/examples/Button.md +174 -0
- package/dist/metadata/examples/ButtonGroup.md +180 -0
- package/dist/metadata/examples/Checkbox.md +24 -0
- package/dist/metadata/examples/Chips.md +192 -0
- package/dist/metadata/examples/Clickable.md +31 -0
- package/dist/metadata/examples/ColorPicker.md +2 -0
- package/dist/metadata/examples/Combobox.md +438 -0
- package/dist/metadata/examples/Counter.md +188 -0
- package/dist/metadata/examples/DatePicker.md +43 -0
- package/dist/metadata/examples/Dialog.md +521 -0
- package/dist/metadata/examples/DialogContentContainer.md +18 -0
- package/dist/metadata/examples/Divider.md +50 -0
- package/dist/metadata/examples/DropdownBasicDropdown.md +479 -0
- package/dist/metadata/examples/DropdownBoxMode.md +218 -0
- package/dist/metadata/examples/EditableHeading.md +33 -0
- package/dist/metadata/examples/EditableText.md +36 -0
- package/dist/metadata/examples/EmptyState.md +192 -0
- package/dist/metadata/examples/ExpandCollapse.md +77 -0
- package/dist/metadata/examples/Flex.md +916 -0
- package/dist/metadata/examples/Heading.md +124 -0
- package/dist/metadata/examples/HiddenText.md +8 -0
- package/dist/metadata/examples/Icon.md +67 -0
- package/dist/metadata/examples/IconButton.md +141 -0
- package/dist/metadata/examples/Info.md +80 -0
- package/dist/metadata/examples/Label.md +109 -0
- package/dist/metadata/examples/Link.md +52 -0
- package/dist/metadata/examples/List.md +125 -0
- package/dist/metadata/examples/ListItem.md +42 -0
- package/dist/metadata/examples/Loader.md +148 -0
- package/dist/metadata/examples/Menu.md +141 -0
- package/dist/metadata/examples/MenuButton.md +127 -0
- package/dist/metadata/examples/MenuDivider.md +35 -0
- package/dist/metadata/examples/MenuGridItem.md +65 -0
- package/dist/metadata/examples/MenuItem.md +98 -0
- package/dist/metadata/examples/MenuItemButton.md +42 -0
- package/dist/metadata/examples/MenuTitle.md +25 -0
- package/dist/metadata/examples/ModalBasicLayout.md +400 -0
- package/dist/metadata/examples/ModalMediaLayout.md +240 -0
- package/dist/metadata/examples/ModalSideBySideLayout.md +313 -0
- package/dist/metadata/examples/MultiStepIndicator.md +189 -0
- package/dist/metadata/examples/NumberField.md +68 -0
- package/dist/metadata/examples/ProgressBar.md +152 -0
- package/dist/metadata/examples/RadioButton.md +41 -0
- package/dist/metadata/examples/Search.md +24 -0
- package/dist/metadata/examples/Skeleton.md +161 -0
- package/dist/metadata/examples/Slider.md +109 -0
- package/dist/metadata/examples/SplitButton.md +120 -0
- package/dist/metadata/examples/Steps.md +106 -0
- package/dist/metadata/examples/Table.md +449 -0
- package/dist/metadata/examples/Tabs.md +241 -0
- package/dist/metadata/examples/Text.md +188 -0
- package/dist/metadata/examples/TextArea.md +28 -0
- package/dist/metadata/examples/TextField.md +119 -0
- package/dist/metadata/examples/TextWithHighlight.md +2 -0
- package/dist/metadata/examples/ThemeProvider.md +47 -0
- package/dist/metadata/examples/Tipseen.md +111 -0
- package/dist/metadata/examples/Toast.md +127 -0
- package/dist/metadata/examples/Toggle.md +38 -0
- package/dist/metadata/examples/Tooltip.md +53 -0
- package/dist/metadata/examples/VirtualizedGrid.md +54 -0
- package/dist/metadata/examples/VirtualizedList.md +50 -0
- package/dist/metadata/examples/useGridKeyboardNavigationContext.md +61 -0
- package/dist/mocked_classnames/scripts/build-all-metadata.d.ts +1 -0
- package/dist/mocked_classnames/scripts/extract-accessibility.d.ts +4 -0
- package/dist/mocked_classnames/scripts/extract-examples.d.ts +3 -0
- package/dist/scripts/build-all-metadata.d.ts +1 -0
- package/dist/scripts/extract-accessibility.d.ts +4 -0
- package/dist/scripts/extract-examples.d.ts +3 -0
- package/package.json +12 -10
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<BaseList {...args} aria-label="Example list" style={{
|
|
7
|
+
width: 300
|
|
8
|
+
}}>
|
|
9
|
+
<BaseItem item={{
|
|
10
|
+
value: "1",
|
|
11
|
+
label: "First item",
|
|
12
|
+
startElement: {
|
|
13
|
+
type: "icon",
|
|
14
|
+
value: Person
|
|
15
|
+
}
|
|
16
|
+
}} />
|
|
17
|
+
<BaseItem item={{
|
|
18
|
+
value: "2",
|
|
19
|
+
label: "Second item",
|
|
20
|
+
startElement: {
|
|
21
|
+
type: "icon",
|
|
22
|
+
value: Email
|
|
23
|
+
}
|
|
24
|
+
}} />
|
|
25
|
+
<BaseItem item={{
|
|
26
|
+
value: "3",
|
|
27
|
+
label: "Third item",
|
|
28
|
+
startElement: {
|
|
29
|
+
type: "icon",
|
|
30
|
+
value: Settings
|
|
31
|
+
}
|
|
32
|
+
}} />
|
|
33
|
+
</BaseList>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## WithSelectedItem
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<BaseList aria-label="List with selection" style={{
|
|
40
|
+
width: 300
|
|
41
|
+
}} size="small">
|
|
42
|
+
<BaseItem item={{
|
|
43
|
+
value: "1",
|
|
44
|
+
label: "Unselected item"
|
|
45
|
+
}} />
|
|
46
|
+
<BaseItem item={{
|
|
47
|
+
value: "2",
|
|
48
|
+
label: "Selected item"
|
|
49
|
+
}} selected />
|
|
50
|
+
<BaseItem item={{
|
|
51
|
+
value: "3",
|
|
52
|
+
label: "Another unselected item"
|
|
53
|
+
}} />
|
|
54
|
+
</BaseList>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## WithDisabledItems
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<BaseList aria-label="List with disabled items" style={{
|
|
61
|
+
width: 300
|
|
62
|
+
}}>
|
|
63
|
+
<BaseItem item={{
|
|
64
|
+
value: "1",
|
|
65
|
+
label: "Enabled item"
|
|
66
|
+
}} />
|
|
67
|
+
<BaseItem item={{
|
|
68
|
+
value: "2",
|
|
69
|
+
label: "Disabled item",
|
|
70
|
+
disabled: true
|
|
71
|
+
}} />
|
|
72
|
+
<BaseItem item={{
|
|
73
|
+
value: "3",
|
|
74
|
+
label: "Another enabled item"
|
|
75
|
+
}} />
|
|
76
|
+
</BaseList>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## ScrollableList
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
<BaseList aria-label="Scrollable list" maxHeight={200} style={{
|
|
83
|
+
width: 300
|
|
84
|
+
}}>
|
|
85
|
+
{Array.from({
|
|
86
|
+
length: 10
|
|
87
|
+
}, (_, i) => <BaseItem key={i} item={{
|
|
88
|
+
value: String(i),
|
|
89
|
+
label: `Item ${i + 1}`
|
|
90
|
+
}} />)}
|
|
91
|
+
</BaseList>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Sizes
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<div style={{
|
|
98
|
+
display: "flex",
|
|
99
|
+
gap: 24
|
|
100
|
+
}}>
|
|
101
|
+
<div>
|
|
102
|
+
<p style={{
|
|
103
|
+
marginBottom: 8
|
|
104
|
+
}}>Small</p>
|
|
105
|
+
<BaseList aria-label="Small list" size="small" style={{
|
|
106
|
+
width: 200
|
|
107
|
+
}}>
|
|
108
|
+
<BaseItem item={{
|
|
109
|
+
value: "1",
|
|
110
|
+
label: "Small item 1"
|
|
111
|
+
}} />
|
|
112
|
+
<BaseItem item={{
|
|
113
|
+
value: "2",
|
|
114
|
+
label: "Small item 2"
|
|
115
|
+
}} />
|
|
116
|
+
</BaseList>
|
|
117
|
+
</div>
|
|
118
|
+
<div>
|
|
119
|
+
<p style={{
|
|
120
|
+
marginBottom: 8
|
|
121
|
+
}}>Medium</p>
|
|
122
|
+
<BaseList aria-label="Medium list" size="medium" style={{
|
|
123
|
+
width: 200
|
|
124
|
+
}}>
|
|
125
|
+
<BaseItem item={{
|
|
126
|
+
value: "1",
|
|
127
|
+
label: "Medium item 1"
|
|
128
|
+
}} />
|
|
129
|
+
<BaseItem item={{
|
|
130
|
+
value: "2",
|
|
131
|
+
label: "Medium item 2"
|
|
132
|
+
}} />
|
|
133
|
+
</BaseList>
|
|
134
|
+
</div>
|
|
135
|
+
<div>
|
|
136
|
+
<p style={{
|
|
137
|
+
marginBottom: 8
|
|
138
|
+
}}>Large</p>
|
|
139
|
+
<BaseList aria-label="Large list" size="large" style={{
|
|
140
|
+
width: 200
|
|
141
|
+
}}>
|
|
142
|
+
<BaseItem item={{
|
|
143
|
+
value: "1",
|
|
144
|
+
label: "Large item 1"
|
|
145
|
+
}} />
|
|
146
|
+
<BaseItem item={{
|
|
147
|
+
value: "2",
|
|
148
|
+
label: "Large item 2"
|
|
149
|
+
}} />
|
|
150
|
+
</BaseList>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## AsMenu
|
|
156
|
+
|
|
157
|
+
```tsx
|
|
158
|
+
<BaseList aria-label="Menu example" role="menu" style={{
|
|
159
|
+
width: 250
|
|
160
|
+
}}>
|
|
161
|
+
<BaseItem item={{
|
|
162
|
+
value: "profile",
|
|
163
|
+
label: "View Profile",
|
|
164
|
+
startElement: {
|
|
165
|
+
type: "icon",
|
|
166
|
+
value: Person
|
|
167
|
+
}
|
|
168
|
+
}} role="menuitem" />
|
|
169
|
+
<BaseItem item={{
|
|
170
|
+
value: "settings",
|
|
171
|
+
label: "Settings",
|
|
172
|
+
startElement: {
|
|
173
|
+
type: "icon",
|
|
174
|
+
value: Settings
|
|
175
|
+
}
|
|
176
|
+
}} role="menuitem" />
|
|
177
|
+
<BaseItem item={{
|
|
178
|
+
value: "favorites",
|
|
179
|
+
label: "Favorites",
|
|
180
|
+
startElement: {
|
|
181
|
+
type: "icon",
|
|
182
|
+
value: Favorite
|
|
183
|
+
}
|
|
184
|
+
}} role="menuitem" />
|
|
185
|
+
</BaseList>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## KeyboardNavigationWithLooping
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
<div>
|
|
192
|
+
<p style={{
|
|
193
|
+
marginBottom: 16
|
|
194
|
+
}}>
|
|
195
|
+
Try using arrow keys to navigate. The focus will wrap from the last item to the first (and vice versa).
|
|
196
|
+
</p>
|
|
197
|
+
<BaseList aria-label="List with keyboard navigation" style={{
|
|
198
|
+
width: 300
|
|
199
|
+
}}>
|
|
200
|
+
<BaseItem item={{
|
|
201
|
+
value: "1",
|
|
202
|
+
label: "First item - Press ↑ to wrap to last"
|
|
203
|
+
}} />
|
|
204
|
+
<BaseItem item={{
|
|
205
|
+
value: "2",
|
|
206
|
+
label: "Second item"
|
|
207
|
+
}} />
|
|
208
|
+
<BaseItem item={{
|
|
209
|
+
value: "3",
|
|
210
|
+
label: "Third item"
|
|
211
|
+
}} />
|
|
212
|
+
<BaseItem item={{
|
|
213
|
+
value: "4",
|
|
214
|
+
label: "Fourth item - Press ↓ to wrap to first"
|
|
215
|
+
}} />
|
|
216
|
+
</BaseList>
|
|
217
|
+
</div>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## HomeEndNavigation
|
|
221
|
+
|
|
222
|
+
```tsx
|
|
223
|
+
<div>
|
|
224
|
+
<p style={{
|
|
225
|
+
marginBottom: 16
|
|
226
|
+
}}>
|
|
227
|
+
Press <strong>Home</strong> to jump to the first item, or <strong>End</strong> to jump to the last item.
|
|
228
|
+
</p>
|
|
229
|
+
<BaseList aria-label="List with Home/End navigation" style={{
|
|
230
|
+
width: 300
|
|
231
|
+
}}>
|
|
232
|
+
{Array.from({
|
|
233
|
+
length: 8
|
|
234
|
+
}, (_, i) => <BaseItem key={i} item={{
|
|
235
|
+
value: String(i),
|
|
236
|
+
label: `Item ${i + 1}`
|
|
237
|
+
}} />)}
|
|
238
|
+
</BaseList>
|
|
239
|
+
</div>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## PageUpDownNavigation
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
<div>
|
|
246
|
+
<p style={{
|
|
247
|
+
marginBottom: 16
|
|
248
|
+
}}>
|
|
249
|
+
Press <strong>Page Up</strong> or <strong>Page Down</strong> to move by 10 items at a time.
|
|
250
|
+
</p>
|
|
251
|
+
<BaseList aria-label="List with PageUp/PageDown navigation" maxHeight={300} style={{
|
|
252
|
+
width: 300
|
|
253
|
+
}}>
|
|
254
|
+
{Array.from({
|
|
255
|
+
length: 25
|
|
256
|
+
}, (_, i) => <BaseItem key={i} item={{
|
|
257
|
+
value: String(i),
|
|
258
|
+
label: `Item ${i + 1}`
|
|
259
|
+
}} />)}
|
|
260
|
+
</BaseList>
|
|
261
|
+
</div>
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## DefaultFocusIndex
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
<div>
|
|
268
|
+
<p style={{
|
|
269
|
+
marginBottom: 16
|
|
270
|
+
}}>This list starts with the third item focused (defaultFocusIndex=2).</p>
|
|
271
|
+
<BaseList aria-label="List with default focus" defaultFocusIndex={2} style={{
|
|
272
|
+
width: 300
|
|
273
|
+
}}>
|
|
274
|
+
<BaseItem item={{
|
|
275
|
+
value: "1",
|
|
276
|
+
label: "First item"
|
|
277
|
+
}} />
|
|
278
|
+
<BaseItem item={{
|
|
279
|
+
value: "2",
|
|
280
|
+
label: "Second item"
|
|
281
|
+
}} />
|
|
282
|
+
<BaseItem item={{
|
|
283
|
+
value: "3",
|
|
284
|
+
label: "Third item (initially focused)"
|
|
285
|
+
}} />
|
|
286
|
+
<BaseItem item={{
|
|
287
|
+
value: "4",
|
|
288
|
+
label: "Fourth item"
|
|
289
|
+
}} />
|
|
290
|
+
</BaseList>
|
|
291
|
+
</div>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## WithAriaControls
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
const detailsId = "list-details";
|
|
298
|
+
return <div>
|
|
299
|
+
<p style={{
|
|
300
|
+
marginBottom: 16
|
|
301
|
+
}}>
|
|
302
|
+
This list controls the details panel below (using <code>aria-controls</code>).
|
|
303
|
+
</p>
|
|
304
|
+
<BaseList aria-label="Navigation list" aria-controls={detailsId} style={{
|
|
305
|
+
width: 300
|
|
306
|
+
}}>
|
|
307
|
+
<BaseItem item={{
|
|
308
|
+
value: "1",
|
|
309
|
+
label: "Settings",
|
|
310
|
+
startElement: {
|
|
311
|
+
type: "icon",
|
|
312
|
+
value: Settings
|
|
313
|
+
}
|
|
314
|
+
}} />
|
|
315
|
+
<BaseItem item={{
|
|
316
|
+
value: "2",
|
|
317
|
+
label: "Profile",
|
|
318
|
+
startElement: {
|
|
319
|
+
type: "icon",
|
|
320
|
+
value: Person
|
|
321
|
+
}
|
|
322
|
+
}} />
|
|
323
|
+
<BaseItem item={{
|
|
324
|
+
value: "3",
|
|
325
|
+
label: "Favorites",
|
|
326
|
+
startElement: {
|
|
327
|
+
type: "icon",
|
|
328
|
+
value: Favorite
|
|
329
|
+
}
|
|
330
|
+
}} />
|
|
331
|
+
</BaseList>
|
|
332
|
+
<div id={detailsId} style={{
|
|
333
|
+
marginTop: 16,
|
|
334
|
+
padding: 16,
|
|
335
|
+
border: "1px solid #ccc",
|
|
336
|
+
borderRadius: 4
|
|
337
|
+
}}>
|
|
338
|
+
<p>Details panel controlled by the list above</p>
|
|
339
|
+
</div>
|
|
340
|
+
</div>;
|
|
341
|
+
```
|
|
342
|
+
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
const boxTemplate = (args: BoxProps) => <Box border rounded="medium" padding="large" marginBottom="medium" {...args} style={{
|
|
7
|
+
width: "100%"
|
|
8
|
+
}}>
|
|
9
|
+
Box composite component
|
|
10
|
+
</Box>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## BackgroundColors
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
<>
|
|
17
|
+
<Box backgroundColor="primaryBackgroundColor" padding="large" marginBottom="medium">
|
|
18
|
+
primaryBackgroundColor
|
|
19
|
+
</Box>
|
|
20
|
+
<Box backgroundColor="secondaryBackgroundColor" padding="large" marginBottom="medium">
|
|
21
|
+
secondaryBackgroundColor
|
|
22
|
+
</Box>
|
|
23
|
+
<Box backgroundColor="greyBackgroundColor" padding="large" marginBottom="medium">
|
|
24
|
+
greyBackgroundColor
|
|
25
|
+
</Box>
|
|
26
|
+
<Box backgroundColor="allgreyBackgroundColor" padding="large" marginBottom="medium">
|
|
27
|
+
allgreyBackgroundColor
|
|
28
|
+
</Box>
|
|
29
|
+
<Box textColor="textColorOnInverted" backgroundColor="invertedColorBackground" padding="large" marginBottom="medium">
|
|
30
|
+
invertedColorBackground
|
|
31
|
+
</Box>
|
|
32
|
+
</>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## TextColors
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
<>
|
|
39
|
+
<Box textColor="primaryTextColor" padding="large" marginBottom="medium">
|
|
40
|
+
textPrimaryTextColor
|
|
41
|
+
</Box>
|
|
42
|
+
<Box backgroundColor="invertedColorBackground" textColor="textColorOnInverted" padding="large" marginBottom="medium">
|
|
43
|
+
textColorOnInverted
|
|
44
|
+
</Box>
|
|
45
|
+
<Box textColor="secondaryTextColor" padding="large" marginBottom="medium">
|
|
46
|
+
secondaryTextColor
|
|
47
|
+
</Box>
|
|
48
|
+
</>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Border
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<>
|
|
55
|
+
<Box border padding="large" marginBottom="medium">
|
|
56
|
+
default
|
|
57
|
+
</Box>
|
|
58
|
+
</>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## BorderColor
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<>
|
|
65
|
+
<Box border borderColor="uiBorderColor" padding="large" marginBottom="medium">
|
|
66
|
+
uiBorderColor
|
|
67
|
+
</Box>
|
|
68
|
+
<Box border borderColor="layoutBorderColor" padding="large" marginBottom="medium">
|
|
69
|
+
layoutBorderColor
|
|
70
|
+
</Box>
|
|
71
|
+
</>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## RoundCorners
|
|
75
|
+
|
|
76
|
+
```tsx
|
|
77
|
+
<>
|
|
78
|
+
<Box border rounded="small" padding="large" marginBottom="medium">
|
|
79
|
+
small
|
|
80
|
+
</Box>
|
|
81
|
+
<Box border rounded="medium" padding="large" marginBottom="medium">
|
|
82
|
+
medium
|
|
83
|
+
</Box>
|
|
84
|
+
<Box border rounded="big" padding="large" marginBottom="medium">
|
|
85
|
+
big
|
|
86
|
+
</Box>
|
|
87
|
+
</>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Shadow
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
<>
|
|
94
|
+
<Box shadow="xs" padding="large" marginBottom="medium">
|
|
95
|
+
xs
|
|
96
|
+
</Box>
|
|
97
|
+
<Box shadow="small" padding="large" marginBottom="medium">
|
|
98
|
+
small
|
|
99
|
+
</Box>
|
|
100
|
+
<Box shadow="medium" padding="large" marginBottom="medium">
|
|
101
|
+
medium
|
|
102
|
+
</Box>
|
|
103
|
+
<Box shadow="large" padding="large" marginBottom="medium">
|
|
104
|
+
large
|
|
105
|
+
</Box>
|
|
106
|
+
</>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Margin
|
|
110
|
+
|
|
111
|
+
```tsx
|
|
112
|
+
<>
|
|
113
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
114
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="xs">
|
|
115
|
+
xs
|
|
116
|
+
</Box>
|
|
117
|
+
</Box>
|
|
118
|
+
<Divider withoutMargin />
|
|
119
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
120
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="small">
|
|
121
|
+
small
|
|
122
|
+
</Box>
|
|
123
|
+
</Box>
|
|
124
|
+
<Divider withoutMargin />
|
|
125
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
126
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="medium">
|
|
127
|
+
medium
|
|
128
|
+
</Box>
|
|
129
|
+
</Box>
|
|
130
|
+
<Divider withoutMargin />
|
|
131
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
132
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="large">
|
|
133
|
+
large
|
|
134
|
+
</Box>
|
|
135
|
+
</Box>
|
|
136
|
+
<Divider withoutMargin />
|
|
137
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
138
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="xl">
|
|
139
|
+
xl
|
|
140
|
+
</Box>
|
|
141
|
+
</Box>
|
|
142
|
+
<Divider withoutMargin />
|
|
143
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
144
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="xxl">
|
|
145
|
+
xxl
|
|
146
|
+
</Box>
|
|
147
|
+
</Box>
|
|
148
|
+
<Divider withoutMargin />
|
|
149
|
+
<Box backgroundColor="allgreyBackgroundColor">
|
|
150
|
+
<Box backgroundColor="primaryBackgroundColor" border margin="xxxl">
|
|
151
|
+
xxxl
|
|
152
|
+
</Box>
|
|
153
|
+
</Box>
|
|
154
|
+
<Divider withoutMargin />
|
|
155
|
+
</>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Padding
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
<>
|
|
162
|
+
<Box style={{
|
|
163
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
164
|
+
}} marginBottom="medium" border padding="xs">
|
|
165
|
+
<Box backgroundColor="primaryBackgroundColor">xs</Box>
|
|
166
|
+
</Box>
|
|
167
|
+
<Box style={{
|
|
168
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
169
|
+
}} marginBottom="medium" border padding="small">
|
|
170
|
+
<Box backgroundColor="primaryBackgroundColor">small</Box>
|
|
171
|
+
</Box>
|
|
172
|
+
<Box style={{
|
|
173
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
174
|
+
}} marginBottom="medium" border padding="medium">
|
|
175
|
+
<Box backgroundColor="primaryBackgroundColor">medium</Box>
|
|
176
|
+
</Box>
|
|
177
|
+
<Box style={{
|
|
178
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
179
|
+
}} marginBottom="medium" border padding="large">
|
|
180
|
+
<Box backgroundColor="primaryBackgroundColor">large</Box>
|
|
181
|
+
</Box>
|
|
182
|
+
<Divider withoutMargin />
|
|
183
|
+
<Box style={{
|
|
184
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
185
|
+
}} marginBottom="medium" border padding="xl">
|
|
186
|
+
<Box backgroundColor="primaryBackgroundColor">xl</Box>
|
|
187
|
+
</Box>
|
|
188
|
+
<Box style={{
|
|
189
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
190
|
+
}} marginBottom="medium" border padding="xxl">
|
|
191
|
+
<Box backgroundColor="primaryBackgroundColor">xxl</Box>
|
|
192
|
+
</Box>
|
|
193
|
+
<Box style={{
|
|
194
|
+
backgroundColor: "var(--color-sky-selected)"
|
|
195
|
+
}} marginBottom="medium" border padding="xxxl">
|
|
196
|
+
<Box backgroundColor="primaryBackgroundColor">xxxl</Box>
|
|
197
|
+
</Box>
|
|
198
|
+
</>
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Disabled
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
<Box backgroundColor="allgreyBackgroundColor" border disabled padding="large" marginBottom="medium">
|
|
205
|
+
disabled
|
|
206
|
+
</Box>
|
|
207
|
+
```
|
|
208
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## States
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<div className="monday-storybook-breadcrumb-item_column-wrapper">
|
|
7
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
8
|
+
<span>Link</span>
|
|
9
|
+
<BreadcrumbsBar type="navigation">
|
|
10
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} link="https://www.google.com" />
|
|
11
|
+
</BreadcrumbsBar>
|
|
12
|
+
</div>
|
|
13
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
14
|
+
<span>Function</span>
|
|
15
|
+
<BreadcrumbsBar type="navigation">
|
|
16
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} onClick={() => {
|
|
17
|
+
alert("Hello");
|
|
18
|
+
}} />
|
|
19
|
+
</BreadcrumbsBar>
|
|
20
|
+
</div>
|
|
21
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
22
|
+
<span>Disabled</span>
|
|
23
|
+
<BreadcrumbsBar type="indication">
|
|
24
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} disabled />
|
|
25
|
+
</BreadcrumbsBar>
|
|
26
|
+
</div>
|
|
27
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
28
|
+
<span>Current</span>
|
|
29
|
+
<BreadcrumbsBar type="indication">
|
|
30
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} isCurrent />
|
|
31
|
+
</BreadcrumbsBar>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## With icon
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
<div className="monday-storybook-breadcrumb-item_column-wrapper">
|
|
40
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
41
|
+
<span>With Icon</span>
|
|
42
|
+
<BreadcrumbsBar type="indication">
|
|
43
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} />
|
|
44
|
+
</BreadcrumbsBar>
|
|
45
|
+
</div>
|
|
46
|
+
<div className="monday-storybook-breadcrumb-item_row-wrapper">
|
|
47
|
+
<span>Without Icon</span>
|
|
48
|
+
<BreadcrumbsBar type="indication">
|
|
49
|
+
<BreadcrumbItem text="Workspace" />
|
|
50
|
+
</BreadcrumbsBar>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
```
|
|
54
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Storybook Code Examples
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
```tsx
|
|
6
|
+
<BreadcrumbsBar {...args}>
|
|
7
|
+
{args.children && (args.children as BreadcrumbItemProps[]).map(item => <BreadcrumbItem key={item.text} text={item.text} icon={item.icon} />)}
|
|
8
|
+
</BreadcrumbsBar>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Text only
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
<BreadcrumbsBar type="indication">
|
|
15
|
+
<BreadcrumbItem text="Workspace" isCurrent />
|
|
16
|
+
<BreadcrumbItem text="Folder" />
|
|
17
|
+
<BreadcrumbItem text="Board" />
|
|
18
|
+
<BreadcrumbItem text="Group" />
|
|
19
|
+
</BreadcrumbsBar>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## With icons
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
<BreadcrumbsBar type="navigation">
|
|
26
|
+
<BreadcrumbItem text="Workspace" icon={Workspace} isCurrent />
|
|
27
|
+
<BreadcrumbItem text="Folder" icon={Folder} />
|
|
28
|
+
<BreadcrumbItem text="Board" icon={Board} />
|
|
29
|
+
<BreadcrumbItem text="Group" icon={Group} />
|
|
30
|
+
</BreadcrumbsBar>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Navigatable breadcrumbs
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
<Flex gap="small">
|
|
37
|
+
<Avatar size="medium" src={person3} type="img" />
|
|
38
|
+
<div className={styles.list}>
|
|
39
|
+
<Text type="text1" weight="medium">
|
|
40
|
+
Rotem Dekel
|
|
41
|
+
</Text>
|
|
42
|
+
<BreadcrumbsBar type="navigation">
|
|
43
|
+
<BreadcrumbItem text="User research" icon={Board} />
|
|
44
|
+
<BreadcrumbItem text="Video sessions" icon={Group} />
|
|
45
|
+
</BreadcrumbsBar>
|
|
46
|
+
</div>
|
|
47
|
+
</Flex>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## WithBreadcrumbMenu
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
<BreadcrumbsBar type="navigation">
|
|
54
|
+
<BreadcrumbItem text="Board" icon={Board} />
|
|
55
|
+
<BreadcrumbItem text="Group" icon={Group} />
|
|
56
|
+
<BreadcrumbMenu>
|
|
57
|
+
<BreadcrumbMenuItem title="Item 1" onClick={() => alert("Item 1 clicked")} />
|
|
58
|
+
<BreadcrumbMenuItem title="Item 2" link="https://www.monday.com" />
|
|
59
|
+
<BreadcrumbMenuItem title="Item 3" link="https://www.monday.com" />
|
|
60
|
+
</BreadcrumbMenu>
|
|
61
|
+
<BreadcrumbItem text="My Item" icon={Item} isCurrent />
|
|
62
|
+
</BreadcrumbsBar>
|
|
63
|
+
```
|
|
64
|
+
|