@agregio-solutions/design-system 1.91.0 β 1.92.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/packages/components/Accordion/doc.md +342 -0
- package/dist/packages/components/Badge/doc.md +192 -0
- package/dist/packages/components/Breadcrumbs/doc.md +332 -0
- package/dist/packages/components/Button/doc.md +425 -0
- package/dist/packages/components/Calendar/doc.md +465 -0
- package/dist/packages/components/ChartLegend/doc.md +151 -0
- package/dist/packages/components/ChartTooltip/doc.md +124 -0
- package/dist/packages/components/Checkbox/doc.md +329 -0
- package/dist/packages/components/CheckboxGroup/doc.md +242 -0
- package/dist/packages/components/Chip/doc.md +99 -0
- package/dist/packages/components/Combobox/doc.md +680 -0
- package/dist/packages/components/DataTable/doc.md +1124 -0
- package/dist/packages/components/DatePicker/doc.md +579 -0
- package/dist/packages/components/DateRangePicker/doc.md +638 -0
- package/dist/packages/components/Drawer/doc.md +338 -0
- package/dist/packages/components/Dropdown/doc.md +205 -0
- package/dist/packages/components/EmptyState/doc.md +101 -0
- package/dist/packages/components/FileUpload/doc.md +449 -0
- package/dist/packages/components/Filter/doc.md +196 -0
- package/dist/packages/components/Header/doc.md +373 -0
- package/dist/packages/components/I18nProvider/doc.md +187 -0
- package/dist/packages/components/Icon/doc.md +63 -0
- package/dist/packages/components/Label/doc.md +60 -0
- package/dist/packages/components/LinearProgressBar/doc.md +148 -0
- package/dist/packages/components/Link/doc.md +206 -0
- package/dist/packages/components/List/doc.md +481 -0
- package/dist/packages/components/Loader/doc.md +53 -0
- package/dist/packages/components/Menu/doc.md +231 -0
- package/dist/packages/components/Message/doc.md +166 -0
- package/dist/packages/components/Modal/doc.md +289 -0
- package/dist/packages/components/Navigation/doc.md +992 -0
- package/dist/packages/components/NavigationItem/doc.md +167 -0
- package/dist/packages/components/NotificationCard/doc.md +206 -0
- package/dist/packages/components/Notifications/doc.md +240 -0
- package/dist/packages/components/NumberField/doc.md +582 -0
- package/dist/packages/components/PageLayout/doc.md +651 -0
- package/dist/packages/components/Pagination/doc.md +227 -0
- package/dist/packages/components/Popover/doc.md +245 -0
- package/dist/packages/components/Radio/doc.md +370 -0
- package/dist/packages/components/RouterProvider/doc.md +64 -0
- package/dist/packages/components/SearchBar/doc.md +504 -0
- package/dist/packages/components/SegmentedControl/doc.md +398 -0
- package/dist/packages/components/Select/doc.md +1133 -0
- package/dist/packages/components/Skeleton/doc.md +129 -0
- package/dist/packages/components/Slider/doc.md +362 -0
- package/dist/packages/components/Stepper/doc.md +104 -0
- package/dist/packages/components/Switch/doc.md +296 -0
- package/dist/packages/components/Tabs/doc.md +295 -0
- package/dist/packages/components/Tag/doc.md +81 -0
- package/dist/packages/components/TextInput/doc.md +490 -0
- package/dist/packages/components/TimeField/doc.md +353 -0
- package/dist/packages/components/Timeline/doc.md +1046 -0
- package/dist/packages/components/Toaster/doc.md +263 -0
- package/dist/packages/components/ToggleButton/doc.md +108 -0
- package/dist/packages/components/ToggleButtonGroup/doc.md +307 -0
- package/dist/packages/components/Tooltip/doc.md +206 -0
- package/dist/packages/components/YearMonthPicker/doc.md +638 -0
- package/dist/public_docs/components.md +68 -0
- package/dist/public_docs/index.md +30 -0
- package/dist/public_docs/tokens.md +121 -0
- package/package.json +3 -2
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
# List
|
|
2
|
+
|
|
3
|
+
## Props
|
|
4
|
+
|
|
5
|
+
The complete Props documentation with JS doc for this component is available at this path:
|
|
6
|
+
|
|
7
|
+
node_modules/@agregio-solutions/design-system/dist/packages/components/List/List.d.ts
|
|
8
|
+
|
|
9
|
+
## Example usage
|
|
10
|
+
|
|
11
|
+
Here are the Storybook Stories.
|
|
12
|
+
|
|
13
|
+
Base stories:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
17
|
+
import { expect, within } from "storybook/test";
|
|
18
|
+
import List from "./List";
|
|
19
|
+
import EmptyState from "../EmptyState/EmptyState";
|
|
20
|
+
import Button from "../Button/Button";
|
|
21
|
+
|
|
22
|
+
const meta: Meta<typeof List> = {
|
|
23
|
+
component: List,
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: "centered",
|
|
26
|
+
},
|
|
27
|
+
globals: {
|
|
28
|
+
backgrounds: { value: "light" },
|
|
29
|
+
},
|
|
30
|
+
decorators: [
|
|
31
|
+
(Story) => (
|
|
32
|
+
<div style={{ width: 523 }}>
|
|
33
|
+
<Story />
|
|
34
|
+
</div>
|
|
35
|
+
),
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const Playground: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
"aria-label": "Batchs and tasks",
|
|
45
|
+
sections: [
|
|
46
|
+
{
|
|
47
|
+
id: "batchs",
|
|
48
|
+
title: "Batchs",
|
|
49
|
+
items: [
|
|
50
|
+
{
|
|
51
|
+
title: "Batch 12345",
|
|
52
|
+
id: "batch-12345",
|
|
53
|
+
icon: "arrow_forward",
|
|
54
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
55
|
+
href: "https://www.google.com?q=batch-12345",
|
|
56
|
+
tagProps: {
|
|
57
|
+
children: "[Insert tag]",
|
|
58
|
+
iconLeft: "help_outline",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
title: "Batch 4567",
|
|
63
|
+
id: "batch-4567",
|
|
64
|
+
icon: "arrow_forward",
|
|
65
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
66
|
+
href: "https://www.google.com?q=batch-4567",
|
|
67
|
+
tagProps: {
|
|
68
|
+
children: "[Insert tag]",
|
|
69
|
+
iconLeft: "help_outline",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "tΓ’ches",
|
|
76
|
+
title: "TΓ’ches",
|
|
77
|
+
items: [
|
|
78
|
+
{
|
|
79
|
+
title: "TΓ’che 1234",
|
|
80
|
+
id: "tΓ’che-1234",
|
|
81
|
+
icon: "arrow_forward",
|
|
82
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
83
|
+
href: "https://www.google.com?q=tΓ’che-1234",
|
|
84
|
+
tagProps: {
|
|
85
|
+
children: "[Insert tag]",
|
|
86
|
+
iconLeft: "help_outline",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: "TΓ’che 4567",
|
|
91
|
+
id: "tΓ’che-4567",
|
|
92
|
+
icon: "arrow_forward",
|
|
93
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
94
|
+
href: "https://www.google.com?q=tΓ’che-4567",
|
|
95
|
+
tagProps: {
|
|
96
|
+
children: "[Insert tag]",
|
|
97
|
+
iconLeft: "help_outline",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
play: async ({ canvasElement }) => {
|
|
105
|
+
const canvas = within(canvasElement);
|
|
106
|
+
await canvas.findByText("Batchs");
|
|
107
|
+
await canvas.findByText("Batch 12345");
|
|
108
|
+
await canvas.findByText("Batch 4567");
|
|
109
|
+
await canvas.findByText("TΓ’ches");
|
|
110
|
+
await canvas.findByText("TΓ’che 1234");
|
|
111
|
+
await canvas.findByText("TΓ’che 4567");
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const PixelPerfect: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
"aria-label": "10 items",
|
|
118
|
+
sections: [
|
|
119
|
+
{
|
|
120
|
+
id: "tΓ’ches",
|
|
121
|
+
title: "[Insert title here]",
|
|
122
|
+
items: new Array(10).fill(0).map((_, index) => ({
|
|
123
|
+
title: `[Insert title ${index}]`,
|
|
124
|
+
id: `id-${index}`,
|
|
125
|
+
icon: "settings",
|
|
126
|
+
subtitle: "[insert subtitle]",
|
|
127
|
+
tagProps: {
|
|
128
|
+
children: "[Insert tag]",
|
|
129
|
+
iconLeft: "help_outline",
|
|
130
|
+
},
|
|
131
|
+
})),
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const WithThreeLists: Story = {
|
|
138
|
+
args: {
|
|
139
|
+
"aria-label": "Recent projects, members, and resources",
|
|
140
|
+
sections: [
|
|
141
|
+
{
|
|
142
|
+
id: "projets",
|
|
143
|
+
title: "Recent Projects",
|
|
144
|
+
items: [
|
|
145
|
+
{
|
|
146
|
+
title: "E-commerce Platform",
|
|
147
|
+
id: "e-commerce-platform",
|
|
148
|
+
icon: "arrow_forward",
|
|
149
|
+
subtitle: "Online store with payment integration",
|
|
150
|
+
tagProps: {
|
|
151
|
+
children: "Active",
|
|
152
|
+
iconLeft: "help_outline",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
title: "Mobile App",
|
|
157
|
+
id: "mobile-app",
|
|
158
|
+
icon: "add_box",
|
|
159
|
+
subtitle: "Cross-platform React Native app",
|
|
160
|
+
tagProps: {
|
|
161
|
+
children: "In Progress",
|
|
162
|
+
iconLeft: "bolt",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "membres",
|
|
169
|
+
items: [
|
|
170
|
+
{
|
|
171
|
+
title: "Alice Johnson",
|
|
172
|
+
id: "alice-johnson",
|
|
173
|
+
icon: "calendar_today",
|
|
174
|
+
subtitle: "Senior Frontend Developer",
|
|
175
|
+
tagProps: {
|
|
176
|
+
children: "Lead",
|
|
177
|
+
iconLeft: "star",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
title: "Bob Smith",
|
|
182
|
+
id: "bob-smith",
|
|
183
|
+
icon: "business",
|
|
184
|
+
subtitle: "Backend Developer",
|
|
185
|
+
tagProps: {
|
|
186
|
+
children: "Member",
|
|
187
|
+
iconLeft: "fiber_new",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
title: "Carol Davis",
|
|
192
|
+
id: "carol-davis",
|
|
193
|
+
icon: "swap_horiz",
|
|
194
|
+
subtitle: "UI/UX Designer",
|
|
195
|
+
tagProps: {
|
|
196
|
+
children: "Contractor",
|
|
197
|
+
iconLeft: "undo",
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: "ressources",
|
|
204
|
+
title: "Resources",
|
|
205
|
+
items: [
|
|
206
|
+
{
|
|
207
|
+
title: "Design System Documentation",
|
|
208
|
+
id: "design-system-documentation",
|
|
209
|
+
subtitle: "Complete guide to our design tokens and components",
|
|
210
|
+
tagProps: {
|
|
211
|
+
children: "Updated",
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
title: "API Documentation",
|
|
216
|
+
id: "api-documentation",
|
|
217
|
+
subtitle: "REST API endpoints and authentication",
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
},
|
|
223
|
+
play: async ({ canvasElement }) => {
|
|
224
|
+
const canvas = within(canvasElement);
|
|
225
|
+
await canvas.findByText("Recent Projects");
|
|
226
|
+
await canvas.findByText("E-commerce Platform");
|
|
227
|
+
await canvas.findByText("Mobile App");
|
|
228
|
+
await canvas.findByText("Alice Johnson");
|
|
229
|
+
await canvas.findByText("Bob Smith");
|
|
230
|
+
await canvas.findByText("Carol Davis");
|
|
231
|
+
await canvas.findByText("Resources");
|
|
232
|
+
await canvas.findByText("Design System Documentation");
|
|
233
|
+
await canvas.findByText("API Documentation");
|
|
234
|
+
},
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export const Empty: Story = {
|
|
238
|
+
args: {
|
|
239
|
+
"aria-label": "Empty list",
|
|
240
|
+
sections: [],
|
|
241
|
+
},
|
|
242
|
+
play: async ({ canvasElement }) => {
|
|
243
|
+
await expect(canvasElement.firstElementChild).toBeEmptyDOMElement();
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export const EmptyWithEmptyState: Story = {
|
|
248
|
+
args: {
|
|
249
|
+
...Empty.args,
|
|
250
|
+
renderEmptyState: () => (
|
|
251
|
+
<EmptyState
|
|
252
|
+
icon="help_outline"
|
|
253
|
+
title="No items"
|
|
254
|
+
description="Sorry! We couldn't find any items."
|
|
255
|
+
>
|
|
256
|
+
<Button mode="primary" text="Action 1" />
|
|
257
|
+
<Button mode="secondary" text="Action 2" />
|
|
258
|
+
</EmptyState>
|
|
259
|
+
),
|
|
260
|
+
},
|
|
261
|
+
play: async ({ canvasElement }) => {
|
|
262
|
+
const canvas = within(canvasElement);
|
|
263
|
+
await canvas.findByText("No items");
|
|
264
|
+
await canvas.findByText("Sorry! We couldn't find any items.");
|
|
265
|
+
await canvas.findByText("Action 1");
|
|
266
|
+
await canvas.findByText("Action 2");
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## How to test this component
|
|
272
|
+
|
|
273
|
+
Here are some more advanced stories with more testing coverage and examples that you can read to understand how to test this component.
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
277
|
+
import { within } from "storybook/test";
|
|
278
|
+
import List from "../List";
|
|
279
|
+
import * as ListStories from "../List.stories";
|
|
280
|
+
|
|
281
|
+
const meta: Meta<typeof List> = {
|
|
282
|
+
...ListStories.default,
|
|
283
|
+
parameters: {
|
|
284
|
+
...ListStories.default.parameters,
|
|
285
|
+
chromatic: { disableSnapshot: true },
|
|
286
|
+
},
|
|
287
|
+
component: List,
|
|
288
|
+
};
|
|
289
|
+
export default meta;
|
|
290
|
+
|
|
291
|
+
type Story = StoryObj<typeof meta>;
|
|
292
|
+
|
|
293
|
+
export const ExampleUsage: Story = {
|
|
294
|
+
render: () => {
|
|
295
|
+
return (
|
|
296
|
+
<List
|
|
297
|
+
aria-label="Liste de batchs et de tΓ’ches"
|
|
298
|
+
sections={[
|
|
299
|
+
{
|
|
300
|
+
id: "batchs",
|
|
301
|
+
title: "Batchs",
|
|
302
|
+
items: [
|
|
303
|
+
{
|
|
304
|
+
title: "Batch 12345",
|
|
305
|
+
id: "batch-12345",
|
|
306
|
+
icon: "arrow_forward",
|
|
307
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
308
|
+
href: "https://www.google.com?q=batch-12345",
|
|
309
|
+
tagProps: {
|
|
310
|
+
children: "[Insert tag]",
|
|
311
|
+
iconLeft: "help_outline",
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
title: "Batch 4567",
|
|
316
|
+
id: "batch-4567",
|
|
317
|
+
icon: "arrow_forward",
|
|
318
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
319
|
+
href: "https://www.google.com?q=batch-4567",
|
|
320
|
+
tagProps: {
|
|
321
|
+
children: "[Insert tag]",
|
|
322
|
+
iconLeft: "help_outline",
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: "tΓ’ches",
|
|
329
|
+
title: "TΓ’ches",
|
|
330
|
+
items: [
|
|
331
|
+
{
|
|
332
|
+
title: "TΓ’che 1234",
|
|
333
|
+
id: "tΓ’che-1234",
|
|
334
|
+
icon: "arrow_forward",
|
|
335
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
336
|
+
href: "https://www.google.com?q=tΓ’che-1234",
|
|
337
|
+
tagProps: {
|
|
338
|
+
children: "[Insert tag]",
|
|
339
|
+
iconLeft: "help_outline",
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
title: "TΓ’che 4567",
|
|
344
|
+
id: "tΓ’che-4567",
|
|
345
|
+
icon: "arrow_forward",
|
|
346
|
+
subtitle: "Lorem Ipsum dolor sit amet",
|
|
347
|
+
href: "https://www.google.com?q=tΓ’che-4567",
|
|
348
|
+
tagProps: {
|
|
349
|
+
children: "[Insert tag]",
|
|
350
|
+
iconLeft: "help_outline",
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
]}
|
|
356
|
+
/>
|
|
357
|
+
);
|
|
358
|
+
},
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export const WithVariations: Story = {
|
|
362
|
+
args: {
|
|
363
|
+
"aria-label": "Mixed content",
|
|
364
|
+
sections: [
|
|
365
|
+
{
|
|
366
|
+
id: "mixed-content",
|
|
367
|
+
title: "Mixed Content Examples",
|
|
368
|
+
items: [
|
|
369
|
+
{
|
|
370
|
+
title: "Item with all properties",
|
|
371
|
+
id: "item-with-all-properties",
|
|
372
|
+
icon: "star",
|
|
373
|
+
subtitle: "This item has an icon, subtitle, and tag",
|
|
374
|
+
tagProps: {
|
|
375
|
+
children: "Complete",
|
|
376
|
+
iconLeft: "check",
|
|
377
|
+
},
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
title:
|
|
381
|
+
"Item without icon but with long subtitle text that might wrap to multiple lines to test the layout behavior",
|
|
382
|
+
id: "item-without-icon-but-with-long-subtitle",
|
|
383
|
+
subtitle:
|
|
384
|
+
"This item has no icon but includes a very long subtitle that demonstrates how the component handles text overflow and wrapping in different scenarios",
|
|
385
|
+
tagProps: {
|
|
386
|
+
children: "No Icon",
|
|
387
|
+
iconLeft: "help_outline",
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
title: "Item without tag",
|
|
392
|
+
id: "item-without-tag",
|
|
393
|
+
icon: "settings",
|
|
394
|
+
subtitle: "This item has an icon and subtitle but no tag",
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
title: "Minimal item with only title",
|
|
398
|
+
id: "minimal-item-with-only-title",
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
title:
|
|
402
|
+
"Item with very long title that might need to be truncated or wrapped depending on the container width",
|
|
403
|
+
id: "item-with-very-long-title",
|
|
404
|
+
subtitle: "Short subtitle",
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
title: "Item with special characters",
|
|
408
|
+
id: "item-with-special-characters",
|
|
409
|
+
icon: "language",
|
|
410
|
+
subtitle: "Test with Γ©mojis π and special chars: & < > \" '",
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: "long-title",
|
|
416
|
+
title:
|
|
417
|
+
"Long section title that might need to be truncated or wrapped depending on the container width",
|
|
418
|
+
items: [
|
|
419
|
+
{
|
|
420
|
+
title:
|
|
421
|
+
"Long title that might need to be truncated or wrapped depending on the container width",
|
|
422
|
+
id: "long-title-item",
|
|
423
|
+
},
|
|
424
|
+
],
|
|
425
|
+
},
|
|
426
|
+
],
|
|
427
|
+
},
|
|
428
|
+
play: async ({ canvasElement }) => {
|
|
429
|
+
const canvas = within(canvasElement);
|
|
430
|
+
await canvas.findByText("Mixed Content Examples");
|
|
431
|
+
await canvas.findByText("Item with all properties");
|
|
432
|
+
await canvas.findByText("Minimal item with only title");
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
## Developer notes
|
|
438
|
+
|
|
439
|
+
Here are the notes available for the developer on the built Storybook, you can read them to understand the component and how to use it.
|
|
440
|
+
|
|
441
|
+
```mdx
|
|
442
|
+
import { Meta, Controls, Source, Canvas } from "@storybook/addon-docs/blocks";
|
|
443
|
+
import * as ListStories from "./List.stories";
|
|
444
|
+
import * as ListItem from "./components/ListItem/ListItem.stories";
|
|
445
|
+
import * as ListStoriesTests from "./tests/List.stories";
|
|
446
|
+
|
|
447
|
+
<Meta of={ListStories} />
|
|
448
|
+
|
|
449
|
+
# List
|
|
450
|
+
|
|
451
|
+
- **Item selection** β Single or multiple selection, disabled rows, and both toggle and replace selection behaviors.
|
|
452
|
+
- **Keyboard navigation** β List items can be navigated using the arrow keys, along with page up/down, home/end, etc. Typeahead, auto scrolling, and selection modifier keys are supported as well.
|
|
453
|
+
- **Touch friendly** β Selection behavior adapts depending on the device. For example, selection occurs on mouse down but on touch up, which is consistent with native conventions.
|
|
454
|
+
- **Accessible** β Follows the ARIA listbox pattern, with support for items and sections, and slots for label and description elements within each item for improved screen reader announcement.
|
|
455
|
+
|
|
456
|
+
<Canvas of={ListStories.Playground} />
|
|
457
|
+
<Controls of={ListStories.Playground} />
|
|
458
|
+
|
|
459
|
+
## ListItemProps
|
|
460
|
+
|
|
461
|
+
<Controls of={ListItem.Playground} />
|
|
462
|
+
|
|
463
|
+
## Example usage
|
|
464
|
+
|
|
465
|
+
The usage is pretty simple, click on **"show code"** in the example above to see the code.
|
|
466
|
+
|
|
467
|
+
## Actions on items / links
|
|
468
|
+
|
|
469
|
+
You can add an action on an item by passing a function to the `onAction` prop.
|
|
470
|
+
|
|
471
|
+
If your item is a link, you can pass a `href` prop to the item (in combination with `target`, `download` and `routerOptions` props).
|
|
472
|
+
|
|
473
|
+
## About icons and descriptions
|
|
474
|
+
|
|
475
|
+
For visual harmony, it is recommended, for all the items in a section, to :
|
|
476
|
+
|
|
477
|
+
- either all items have no icon, or all items have an icon.
|
|
478
|
+
- either all items have no description, or all items have a description.
|
|
479
|
+
|
|
480
|
+
Mixing items with and without icons or descriptions is not recommended (because it looks weird).
|
|
481
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Loader
|
|
2
|
+
|
|
3
|
+
## Props
|
|
4
|
+
|
|
5
|
+
The complete Props documentation with JS doc for this component is available at this path:
|
|
6
|
+
|
|
7
|
+
node_modules/@agregio-solutions/design-system/dist/packages/components/Loader/Loader.d.ts
|
|
8
|
+
|
|
9
|
+
## Example usage
|
|
10
|
+
|
|
11
|
+
Here are the Storybook Stories.
|
|
12
|
+
|
|
13
|
+
Base stories:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Meta, StoryObj } from "@storybook/react-vite";
|
|
17
|
+
import Loader from "./Loader";
|
|
18
|
+
|
|
19
|
+
const meta = {
|
|
20
|
+
component: Loader,
|
|
21
|
+
tags: ["autodocs"],
|
|
22
|
+
parameters: {
|
|
23
|
+
layout: "centered",
|
|
24
|
+
},
|
|
25
|
+
} satisfies Meta<typeof Loader>;
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const Playground: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
size: "medium",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Small: Story = {
|
|
37
|
+
args: {
|
|
38
|
+
size: "small",
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Medium: Story = {
|
|
43
|
+
args: {
|
|
44
|
+
size: "medium",
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const Large: Story = {
|
|
49
|
+
args: {
|
|
50
|
+
size: "large",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
```
|