@festo-ui/react 11.0.0-dev.958 → 11.0.0-dev.962
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.
|
@@ -33,7 +33,7 @@ const AlertModal = /*#__PURE__*/ forwardRef(({ title, subtitle, alertType, stron
|
|
|
33
33
|
type: "button",
|
|
34
34
|
"aria-label": "Cancel",
|
|
35
35
|
className: classnames('fwe-btn fwe-btn-lg', {
|
|
36
|
-
'fwe-btn-
|
|
36
|
+
'fwe-btn-tertiary': strong
|
|
37
37
|
}),
|
|
38
38
|
onClick: onCancel,
|
|
39
39
|
children: cancel
|
package/llm-doc/components.md
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
Collapsible content sections.
|
|
6
6
|
|
|
7
7
|
### Components
|
|
8
|
+
|
|
8
9
|
- `Accordion` — Container
|
|
9
10
|
- `AccordionHeader` — Header of the entire accordion
|
|
10
11
|
- `AccordionItem` — Single collapsible element
|
|
@@ -12,22 +13,25 @@ Collapsible content sections.
|
|
|
12
13
|
- `AccordionItemBody` — Content of an item
|
|
13
14
|
|
|
14
15
|
### Accordion Props
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
16
|
+
|
|
17
|
+
| Prop | Type | Default | Description |
|
|
18
|
+
| --------------- | --------- | ------------- | ----------------------------------------------------------- |
|
|
19
|
+
| `showMore` | `string` | `"Show more"` | Text for "Show more" |
|
|
20
|
+
| `showLess` | `string` | `"Show less"` | Text for "Show less" |
|
|
21
|
+
| `keepItemsOpen` | `boolean` | `true` | Multiple items open simultaneously. `false` = auto-collapse |
|
|
22
|
+
| `transparent` | `boolean` | `false` | Transparent background |
|
|
23
|
+
| `highlighted` | `boolean` | `true` | Highlighted style |
|
|
22
24
|
|
|
23
25
|
### AccordionItem Props
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
|
27
|
-
| `
|
|
28
|
-
| `
|
|
26
|
+
|
|
27
|
+
| Prop | Type | Description |
|
|
28
|
+
| ----------------- | ------------------------------------ | -------------------------------- |
|
|
29
|
+
| `expanded` | `boolean` | Controlled: whether open |
|
|
30
|
+
| `defaultExpanded` | `boolean` | Initial state (default: `false`) |
|
|
31
|
+
| `onChange` | `(expanded: boolean, event) => void` | Callback on state change |
|
|
29
32
|
|
|
30
33
|
### Example — Basic
|
|
34
|
+
|
|
31
35
|
```tsx
|
|
32
36
|
<Accordion>
|
|
33
37
|
<AccordionHeader>Title</AccordionHeader>
|
|
@@ -43,6 +47,7 @@ Collapsible content sections.
|
|
|
43
47
|
```
|
|
44
48
|
|
|
45
49
|
### Example — Auto-Collapse
|
|
50
|
+
|
|
46
51
|
```tsx
|
|
47
52
|
<Accordion keepItemsOpen={false}>
|
|
48
53
|
<AccordionHeader>Title</AccordionHeader>
|
|
@@ -54,9 +59,10 @@ Collapsible content sections.
|
|
|
54
59
|
```
|
|
55
60
|
|
|
56
61
|
### Example — Controlled
|
|
62
|
+
|
|
57
63
|
```tsx
|
|
58
64
|
const [expanded, setExpanded] = useState('item1');
|
|
59
|
-
const handleChange =
|
|
65
|
+
const handleChange = panel => isExpanded => {
|
|
60
66
|
setExpanded(isExpanded ? panel : false);
|
|
61
67
|
};
|
|
62
68
|
|
|
@@ -65,7 +71,7 @@ const handleChange = (panel) => (isExpanded) => {
|
|
|
65
71
|
<AccordionItemHeader>Item 1</AccordionItemHeader>
|
|
66
72
|
<AccordionItemBody>Content 1</AccordionItemBody>
|
|
67
73
|
</AccordionItem>
|
|
68
|
-
</Accordion
|
|
74
|
+
</Accordion>;
|
|
69
75
|
```
|
|
70
76
|
|
|
71
77
|
---
|
|
@@ -75,16 +81,18 @@ const handleChange = (panel) => (isExpanded) => {
|
|
|
75
81
|
Mobile bottom sheet overlay.
|
|
76
82
|
|
|
77
83
|
### Props
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Default | Description |
|
|
86
|
+
| ----------------- | -------------------------- | ---------- | --------------------------- |
|
|
87
|
+
| `open` | `boolean` | — | Controlled: whether visible |
|
|
88
|
+
| `defaultExpanded` | `boolean` | — | Initial state |
|
|
89
|
+
| `expandFrom` | `"center" \| "bottom"` | `"center"` | Expand direction |
|
|
90
|
+
| `hasBackdrop` | `boolean` | `true` | Show backdrop overlay |
|
|
91
|
+
| `hideCloseIcon` | `boolean` | — | Hide close icon |
|
|
92
|
+
| `onOpenChange` | `(value: boolean) => void` | — | Callback on open/close |
|
|
86
93
|
|
|
87
94
|
### Example
|
|
95
|
+
|
|
88
96
|
```tsx
|
|
89
97
|
const [open, setOpen] = useState(false);
|
|
90
98
|
|
|
@@ -101,24 +109,27 @@ const [open, setOpen] = useState(false);
|
|
|
101
109
|
Navigation path display.
|
|
102
110
|
|
|
103
111
|
### Props
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
|
|
113
|
+
| Prop | Type | Description |
|
|
114
|
+
| ----------- | ---------------------- | --------------------------- |
|
|
106
115
|
| `locations` | `BreadcrumbLocation[]` | Array with `{ text, href }` |
|
|
107
|
-
| `onClick`
|
|
116
|
+
| `onClick` | `(event) => void` | Click handler for links |
|
|
108
117
|
|
|
109
118
|
### Example — With locations array
|
|
119
|
+
|
|
110
120
|
```tsx
|
|
111
121
|
<Breadcrumb
|
|
112
122
|
locations={[
|
|
113
123
|
{ text: 'Home', href: '/' },
|
|
114
124
|
{ text: 'Products', href: '/products' },
|
|
115
|
-
{ text: 'Current', href: '/products/current' }
|
|
125
|
+
{ text: 'Current', href: '/products/current' }
|
|
116
126
|
]}
|
|
117
|
-
onClick={
|
|
127
|
+
onClick={e => e.preventDefault()}
|
|
118
128
|
/>
|
|
119
129
|
```
|
|
120
130
|
|
|
121
131
|
### Example — With children
|
|
132
|
+
|
|
122
133
|
```tsx
|
|
123
134
|
<Breadcrumb>
|
|
124
135
|
<a href="/components">Components</a>
|
|
@@ -133,17 +144,19 @@ Navigation path display.
|
|
|
133
144
|
Standard buttons in various variants.
|
|
134
145
|
|
|
135
146
|
### Props
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `
|
|
147
|
+
|
|
148
|
+
| Prop | Type | Default | Description |
|
|
149
|
+
| ---------- | ----------- | ------- | ---------------------------- |
|
|
150
|
+
| `primary` | `boolean` | `false` | Primary/hero button |
|
|
151
|
+
| `tertiary` | `boolean` | `false` | Tertiary button (text style) |
|
|
152
|
+
| `icon` | `ReactNode` | — | Icon element |
|
|
153
|
+
| `iconOnly` | `boolean` | `false` | Icon only, no text |
|
|
154
|
+
| `large` | `boolean` | `false` | Larger variant |
|
|
155
|
+
| `floating` | `boolean` | `false` | Floating action button |
|
|
156
|
+
| `disabled` | `boolean` | `false` | Disabled |
|
|
145
157
|
|
|
146
158
|
### Examples
|
|
159
|
+
|
|
147
160
|
```tsx
|
|
148
161
|
<Button>Default</Button>
|
|
149
162
|
<Button primary>Primary</Button>
|
|
@@ -161,12 +174,14 @@ Standard buttons in various variants.
|
|
|
161
174
|
Card component with header, body, and notifications.
|
|
162
175
|
|
|
163
176
|
### Components
|
|
177
|
+
|
|
164
178
|
- `Card` — Container
|
|
165
179
|
- `CardHeader` — Header with optional image, subtitle, and action
|
|
166
180
|
- `CardBody` — Text content with optional children
|
|
167
181
|
- `CardNotification` — Notification bar
|
|
168
182
|
|
|
169
183
|
### Example
|
|
184
|
+
|
|
170
185
|
```tsx
|
|
171
186
|
<Card>
|
|
172
187
|
<CardHeader
|
|
@@ -189,30 +204,37 @@ Card component with header, body, and notifications.
|
|
|
189
204
|
Chips for filters, categories, selection, and actions.
|
|
190
205
|
|
|
191
206
|
### Chip Props
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
|
195
|
-
| `
|
|
196
|
-
| `
|
|
197
|
-
| `
|
|
198
|
-
| `
|
|
207
|
+
|
|
208
|
+
| Prop | Type | Default | Description |
|
|
209
|
+
| ---------- | ----------- | ----------------- | --------------------------------------------------------------- |
|
|
210
|
+
| `type` | `ChipType` | `ChipType.Choice` | Chip type: `Choice`, `Category`, `Filter`, `Action`, `Readonly` |
|
|
211
|
+
| `icon` | `ReactNode` | — | Icon |
|
|
212
|
+
| `selected` | `boolean` | `false` | Selected |
|
|
213
|
+
| `disabled` | `boolean` | `false` | Disabled |
|
|
214
|
+
| `large` | `boolean` | `false` | Large |
|
|
199
215
|
|
|
200
216
|
### ChipContainer Props
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
|
|
218
|
+
| Prop | Type | Default | Description |
|
|
219
|
+
| ------- | --------- | ------- | ------------------------ |
|
|
203
220
|
| `large` | `boolean` | `false` | Large chips in container |
|
|
204
221
|
|
|
205
222
|
### Example
|
|
223
|
+
|
|
206
224
|
```tsx
|
|
207
225
|
import { Chip, ChipContainer, ChipType } from '@festo-ui/react';
|
|
208
226
|
|
|
209
227
|
<ChipContainer>
|
|
210
228
|
<Chip>Choice</Chip>
|
|
211
229
|
<Chip selected>Selected</Chip>
|
|
212
|
-
<Chip type={ChipType.Filter} selected>
|
|
213
|
-
|
|
230
|
+
<Chip type={ChipType.Filter} selected>
|
|
231
|
+
Filter
|
|
232
|
+
</Chip>
|
|
233
|
+
<Chip type={ChipType.Action} icon={<IconCoreRangeProduct />}>
|
|
234
|
+
Action
|
|
235
|
+
</Chip>
|
|
214
236
|
<Chip type={ChipType.Readonly}>Readonly</Chip>
|
|
215
|
-
</ChipContainer
|
|
237
|
+
</ChipContainer>;
|
|
216
238
|
```
|
|
217
239
|
|
|
218
240
|
---
|
|
@@ -222,11 +244,13 @@ import { Chip, ChipContainer, ChipType } from '@festo-ui/react';
|
|
|
222
244
|
Loading indicator in three sizes.
|
|
223
245
|
|
|
224
246
|
### Props
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
|
247
|
+
|
|
248
|
+
| Prop | Type | Default | Description |
|
|
249
|
+
| ------ | -------------------------------- | --------- | ----------- |
|
|
250
|
+
| `size` | `"large" \| "medium" \| "small"` | `"large"` | Size |
|
|
228
251
|
|
|
229
252
|
### Example
|
|
253
|
+
|
|
230
254
|
```tsx
|
|
231
255
|
<LoadingIndicator />
|
|
232
256
|
<LoadingIndicator size="medium">Loading...</LoadingIndicator>
|
|
@@ -240,32 +264,36 @@ Loading indicator in three sizes.
|
|
|
240
264
|
Mobile navigation with nested pages.
|
|
241
265
|
|
|
242
266
|
### MobileFlyout Props
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
249
|
-
| `
|
|
250
|
-
| `
|
|
251
|
-
| `
|
|
267
|
+
|
|
268
|
+
| Prop | Type | Default | Description |
|
|
269
|
+
| ----------------- | -------------------------- | ---------- | ------------------------- |
|
|
270
|
+
| `open` | `boolean` | — | Controlled: whether open |
|
|
271
|
+
| `defaultOpen` | `boolean` | — | Initial state |
|
|
272
|
+
| `visible` | `string[]` | — | Controlled: visible pages |
|
|
273
|
+
| `defaultVisible` | `string[]` | `['root']` | Initially visible pages |
|
|
274
|
+
| `onOpenChange` | `(value: boolean) => void` | — | Callback |
|
|
275
|
+
| `onVisibleChange` | `(value: string) => void` | — | Callback |
|
|
276
|
+
| `back` | `string` | — | Back text |
|
|
252
277
|
|
|
253
278
|
### MobileFlyoutItem Props
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
|
257
|
-
| `
|
|
258
|
-
| `
|
|
259
|
-
| `
|
|
279
|
+
|
|
280
|
+
| Prop | Type | Description |
|
|
281
|
+
| ----------- | ------------- | --------------------------- |
|
|
282
|
+
| `icon` | `ReactNode` | Icon |
|
|
283
|
+
| `pageLink` | `string` | Links to a MobileFlyoutPage |
|
|
284
|
+
| `active` | `boolean` | Active state |
|
|
285
|
+
| `component` | `ElementType` | Alternative HTML element |
|
|
260
286
|
|
|
261
287
|
### MobileFlyoutPage Props
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
|
288
|
+
|
|
289
|
+
| Prop | Type | Description |
|
|
290
|
+
| ------ | --------- | ----------------------------- |
|
|
291
|
+
| `name` | `string` | Unique page name |
|
|
265
292
|
| `root` | `boolean` | Whether this is the root page |
|
|
266
|
-
| `back` | `string`
|
|
293
|
+
| `back` | `string` | Back text |
|
|
267
294
|
|
|
268
295
|
### Example
|
|
296
|
+
|
|
269
297
|
```tsx
|
|
270
298
|
<MobileFlyout>
|
|
271
299
|
<MobileFlyoutPage root name="root">
|
|
@@ -288,7 +316,9 @@ Mobile navigation with nested pages.
|
|
|
288
316
|
Various dialog types.
|
|
289
317
|
|
|
290
318
|
### AlertModal
|
|
319
|
+
|
|
291
320
|
Displays a warning/info dialog.
|
|
321
|
+
|
|
292
322
|
```tsx
|
|
293
323
|
<AlertModal
|
|
294
324
|
isOpen={open}
|
|
@@ -298,15 +328,17 @@ Displays a warning/info dialog.
|
|
|
298
328
|
title="Title"
|
|
299
329
|
subtitle="Subtitle"
|
|
300
330
|
body="Message"
|
|
301
|
-
alertType="info"
|
|
331
|
+
alertType="info" // or "warning"
|
|
302
332
|
cancel="Cancel"
|
|
303
333
|
ok="OK"
|
|
304
|
-
strong={false}
|
|
334
|
+
strong={false} // true for strong warning
|
|
305
335
|
/>
|
|
306
336
|
```
|
|
307
337
|
|
|
308
338
|
### ConfirmModal
|
|
339
|
+
|
|
309
340
|
Confirmation dialog.
|
|
341
|
+
|
|
310
342
|
```tsx
|
|
311
343
|
<ConfirmModal
|
|
312
344
|
isOpen={open}
|
|
@@ -318,12 +350,14 @@ Confirmation dialog.
|
|
|
318
350
|
body="Do you want to continue?"
|
|
319
351
|
cancel="Cancel"
|
|
320
352
|
ok="OK"
|
|
321
|
-
large={false}
|
|
353
|
+
large={false} // true for large scrollable variant
|
|
322
354
|
/>
|
|
323
355
|
```
|
|
324
356
|
|
|
325
357
|
### Prompt
|
|
358
|
+
|
|
326
359
|
Input dialog.
|
|
360
|
+
|
|
327
361
|
```tsx
|
|
328
362
|
<Prompt
|
|
329
363
|
isOpen={open}
|
|
@@ -340,19 +374,13 @@ Input dialog.
|
|
|
340
374
|
```
|
|
341
375
|
|
|
342
376
|
### CustomModal
|
|
377
|
+
|
|
343
378
|
Freely customizable dialog.
|
|
379
|
+
|
|
344
380
|
```tsx
|
|
345
|
-
<CustomModal
|
|
346
|
-
isOpen={open}
|
|
347
|
-
onClose={() => setOpen(false)}
|
|
348
|
-
title="Title"
|
|
349
|
-
subtitle="Subtitle"
|
|
350
|
-
closeOnBackdrop={false}
|
|
351
|
-
>
|
|
381
|
+
<CustomModal isOpen={open} onClose={() => setOpen(false)} title="Title" subtitle="Subtitle" closeOnBackdrop={false}>
|
|
352
382
|
<form onSubmit={handleSubmit}>
|
|
353
|
-
<div className="fwe-modal-body">
|
|
354
|
-
{/* Form content */}
|
|
355
|
-
</div>
|
|
383
|
+
<div className="fwe-modal-body">{/* Form content */}</div>
|
|
356
384
|
<div className="fwe-modal-footer">
|
|
357
385
|
<div className="fwe-modal-buttons">
|
|
358
386
|
<button type="button" className="fwe-btn fwe-btn-lg" onClick={() => setOpen(false)}>
|
|
@@ -368,13 +396,14 @@ Freely customizable dialog.
|
|
|
368
396
|
```
|
|
369
397
|
|
|
370
398
|
### Common Modal Props
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
|
374
|
-
| `
|
|
375
|
-
| `
|
|
376
|
-
| `
|
|
377
|
-
| `
|
|
399
|
+
|
|
400
|
+
| Prop | Type | Description |
|
|
401
|
+
| ----------------- | ------------ | -------------------------------------------- |
|
|
402
|
+
| `isOpen` | `boolean` | **Required.** Whether the dialog is visible |
|
|
403
|
+
| `isLoading` | `boolean` | Show loading state |
|
|
404
|
+
| `closeOnBackdrop` | `boolean` | Close by clicking backdrop (default: `true`) |
|
|
405
|
+
| `onClose` | `() => void` | Callback on close |
|
|
406
|
+
| `onCloseDone` | `() => void` | Callback after close animation |
|
|
378
407
|
|
|
379
408
|
---
|
|
380
409
|
|
|
@@ -383,19 +412,21 @@ Freely customizable dialog.
|
|
|
383
412
|
Fullscreen image gallery overlay.
|
|
384
413
|
|
|
385
414
|
### Props
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
|
389
|
-
| `
|
|
390
|
-
| `
|
|
391
|
-
| `
|
|
392
|
-
| `
|
|
393
|
-
| `
|
|
394
|
-
| `
|
|
395
|
-
| `
|
|
396
|
-
| `
|
|
415
|
+
|
|
416
|
+
| Prop | Type | Description |
|
|
417
|
+
| -------------------- | ----------------------------------------- | ---------------------------------- |
|
|
418
|
+
| `isOpen` | `boolean` | **Required.** Whether open |
|
|
419
|
+
| `startIndex` | `number` | **Required.** Starting image index |
|
|
420
|
+
| `images` | `ImageGalleryItemData[]` | Array of images |
|
|
421
|
+
| `thumbnailImages` | `ImageGalleryItemData[]` | Thumbnail images |
|
|
422
|
+
| `pagination` | `number \| boolean` | Show pagination |
|
|
423
|
+
| `showScaleButton` | `boolean` | Show zoom button |
|
|
424
|
+
| `descriptiveContent` | `boolean \| (index: number) => ReactNode` | Descriptive text |
|
|
425
|
+
| `onClose` | `() => void` | Callback on close |
|
|
426
|
+
| `onSlideChanged` | `(index: number) => void` | Callback on slide change |
|
|
397
427
|
|
|
398
428
|
### Example
|
|
429
|
+
|
|
399
430
|
```tsx
|
|
400
431
|
const [open, setOpen] = useState(false);
|
|
401
432
|
|
|
@@ -419,39 +450,43 @@ const [open, setOpen] = useState(false);
|
|
|
419
450
|
Page navigation in three styles.
|
|
420
451
|
|
|
421
452
|
### Props
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
427
|
-
| `
|
|
428
|
-
| `
|
|
453
|
+
|
|
454
|
+
| Prop | Type | Default | Description |
|
|
455
|
+
| -------------------- | --------------------------------- | ----------- | -------------------------------- |
|
|
456
|
+
| `type` | `"NUMERIC" \| "SIMPLE" \| "DOTS"` | `"NUMERIC"` | Display style |
|
|
457
|
+
| `pageMax` | `number` | — | **Required.** Maximum page count |
|
|
458
|
+
| `pageCurrent` | `number` | — | Controlled: current page |
|
|
459
|
+
| `defaultPageCurrent` | `number` | `1` | Initial page |
|
|
460
|
+
| `onChange` | `(page: number, event) => void` | — | Callback |
|
|
429
461
|
|
|
430
462
|
### Example
|
|
463
|
+
|
|
431
464
|
```tsx
|
|
432
465
|
<Pagination pageMax={10} defaultPageCurrent={3} />
|
|
433
466
|
<Pagination pageMax={10} defaultPageCurrent={3} type="SIMPLE" />
|
|
434
467
|
<Pagination pageMax={5} defaultPageCurrent={3} type="DOTS" />
|
|
435
468
|
```
|
|
436
469
|
|
|
437
|
-
|
|
470
|
+
## fwe-btn-tertiary
|
|
438
471
|
|
|
439
472
|
## Popover / Tooltip / Legend / PopoverMenu
|
|
440
473
|
|
|
441
474
|
Overlay elements for additional information.
|
|
442
475
|
|
|
443
476
|
### Popover Props
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
|
447
|
-
| `
|
|
448
|
-
| `
|
|
449
|
-
| `
|
|
450
|
-
| `
|
|
451
|
-
| `
|
|
452
|
-
| `
|
|
477
|
+
|
|
478
|
+
| Prop | Type | Description |
|
|
479
|
+
| ---------------- | --------------------------- | ---------------------------------- |
|
|
480
|
+
| `content` | `ReactNode` | Popover content |
|
|
481
|
+
| `position` | `Placement` | Position (e.g. `"right"`, `"top"`) |
|
|
482
|
+
| `isOpen` | `boolean` | Controlled |
|
|
483
|
+
| `onChange` | `(isOpen: boolean) => void` | Callback |
|
|
484
|
+
| `openOnHover` | `boolean` | Open on hover |
|
|
485
|
+
| `openByDefault` | `boolean` | Initially open |
|
|
486
|
+
| `onTriggerClick` | `(event) => void` | Custom trigger handler |
|
|
453
487
|
|
|
454
488
|
### Examples
|
|
489
|
+
|
|
455
490
|
```tsx
|
|
456
491
|
<Popover content="Content">Click me</Popover>
|
|
457
492
|
<Popover position="right" content="Right">Click</Popover>
|
|
@@ -466,7 +501,7 @@ Overlay elements for additional information.
|
|
|
466
501
|
</PopoverMenu>
|
|
467
502
|
|
|
468
503
|
<Legend items={[{ name: 'PN', text: 'Part Number' }]}>
|
|
469
|
-
<button className="fwe-btn fwe-btn-
|
|
504
|
+
<button className="fwe-btn fwe-btn-tertiary fwe-dark"><IconInfo />Legend</button>
|
|
470
505
|
</Legend>
|
|
471
506
|
```
|
|
472
507
|
|
|
@@ -477,13 +512,15 @@ Overlay elements for additional information.
|
|
|
477
512
|
Progress bar.
|
|
478
513
|
|
|
479
514
|
### Props
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
|
483
|
-
| `
|
|
484
|
-
| `
|
|
515
|
+
|
|
516
|
+
| Prop | Type | Default | Description |
|
|
517
|
+
| ------------ | ------------------------------------ | --------- | ---------------------------- |
|
|
518
|
+
| `progress` | `number` | — | **Required.** Progress 0–100 |
|
|
519
|
+
| `background` | `"white" \| "background" \| "black"` | `"white"` | Background color |
|
|
520
|
+
| `error` | `boolean` | `false` | Error state (red) |
|
|
485
521
|
|
|
486
522
|
### Example
|
|
523
|
+
|
|
487
524
|
```tsx
|
|
488
525
|
<Progress progress={50} />
|
|
489
526
|
<Progress progress={50} error />
|
|
@@ -497,16 +534,18 @@ Progress bar.
|
|
|
497
534
|
Search field with autocomplete suggestions.
|
|
498
535
|
|
|
499
536
|
### SearchInput Props
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
|
503
|
-
| `
|
|
504
|
-
| `
|
|
505
|
-
| `
|
|
506
|
-
| `
|
|
507
|
-
| `
|
|
537
|
+
|
|
538
|
+
| Prop | Type | Description |
|
|
539
|
+
| -------------- | ------------------------- | --------------------------- |
|
|
540
|
+
| `label` | `string` | Placeholder text |
|
|
541
|
+
| `value` | `string` | Controlled |
|
|
542
|
+
| `defaultValue` | `string` | Initial value |
|
|
543
|
+
| `debounceTime` | `number` | Debounce in ms (default: 0) |
|
|
544
|
+
| `onChange` | `(value: string) => void` | Callback on input |
|
|
545
|
+
| `onSearch` | `(value: string) => void` | Callback on Enter/selection |
|
|
508
546
|
|
|
509
547
|
### Example
|
|
548
|
+
|
|
510
549
|
```tsx
|
|
511
550
|
const [query, setQuery] = useState('');
|
|
512
551
|
const [results, setResults] = useState([]);
|
|
@@ -522,7 +561,7 @@ function handleChange(value) {
|
|
|
522
561
|
<SearchResult label={item} query={query} />
|
|
523
562
|
</SearchInputOption>
|
|
524
563
|
))}
|
|
525
|
-
</SearchInput
|
|
564
|
+
</SearchInput>;
|
|
526
565
|
```
|
|
527
566
|
|
|
528
567
|
---
|
|
@@ -532,7 +571,9 @@ function handleChange(value) {
|
|
|
532
571
|
Toast notifications.
|
|
533
572
|
|
|
534
573
|
### Setup
|
|
574
|
+
|
|
535
575
|
Wrap with `SnackbarProvider` at the root:
|
|
576
|
+
|
|
536
577
|
```tsx
|
|
537
578
|
<SnackbarProvider>
|
|
538
579
|
<App />
|
|
@@ -540,12 +581,14 @@ Wrap with `SnackbarProvider` at the root:
|
|
|
540
581
|
```
|
|
541
582
|
|
|
542
583
|
### Usage with hook
|
|
584
|
+
|
|
543
585
|
```tsx
|
|
544
586
|
const showSnackbar = useSnackbar();
|
|
545
587
|
showSnackbar({ text: 'Successfully saved!' });
|
|
546
588
|
```
|
|
547
589
|
|
|
548
590
|
### Usage without hook
|
|
591
|
+
|
|
549
592
|
```tsx
|
|
550
593
|
import { addSnackbar } from '@festo-ui/react';
|
|
551
594
|
addSnackbar({ text: 'Saved!' });
|
|
@@ -558,21 +601,25 @@ addSnackbar({ text: 'Saved!' });
|
|
|
558
601
|
Step indicator for multi-step processes.
|
|
559
602
|
|
|
560
603
|
### Example — Vertical
|
|
604
|
+
|
|
561
605
|
```tsx
|
|
562
606
|
const [stepIndex, setStepIndex] = useState(0);
|
|
563
607
|
|
|
564
608
|
<StepperVertical stepIndex={stepIndex} onChange={setStepIndex}>
|
|
565
609
|
<StepVertical title="Step 1">
|
|
566
610
|
<p>Content</p>
|
|
567
|
-
<button className="fwe-btn" onClick={() => setStepIndex(stepIndex + 1)}>
|
|
611
|
+
<button className="fwe-btn" onClick={() => setStepIndex(stepIndex + 1)}>
|
|
612
|
+
Next
|
|
613
|
+
</button>
|
|
568
614
|
</StepVertical>
|
|
569
615
|
<StepVertical title="Step 2">
|
|
570
616
|
<p>Content</p>
|
|
571
617
|
</StepVertical>
|
|
572
|
-
</StepperVertical
|
|
618
|
+
</StepperVertical>;
|
|
573
619
|
```
|
|
574
620
|
|
|
575
621
|
### Example — Horizontal
|
|
622
|
+
|
|
576
623
|
```tsx
|
|
577
624
|
<StepperHorizontal stepIndex={stepIndex} onChange={setStepIndex}>
|
|
578
625
|
<StepHorizontal title="Step 1">Content</StepHorizontal>
|
|
@@ -587,20 +634,23 @@ const [stepIndex, setStepIndex] = useState(0);
|
|
|
587
634
|
Tab navigation with content areas.
|
|
588
635
|
|
|
589
636
|
### Props
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
|
593
|
-
| `
|
|
594
|
-
| `
|
|
595
|
-
| `
|
|
637
|
+
|
|
638
|
+
| Prop | Type | Default | Description |
|
|
639
|
+
| ------------- | --------------------------------- | -------------- | -------------------------------- |
|
|
640
|
+
| `config` | `TabsConfiguration` | — | Configuration (tabBar, tabItems) |
|
|
641
|
+
| `viewType` | `"responsive" \| "legacy"` | `"responsive"` | View type |
|
|
642
|
+
| `showDivider` | `boolean` | `false` | Divider line under tabs |
|
|
643
|
+
| `onChange` | `({ previous, current }) => void` | — | Callback on tab change |
|
|
596
644
|
|
|
597
645
|
### TabPane Props
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
|
601
|
-
| `
|
|
646
|
+
|
|
647
|
+
| Prop | Type | Description |
|
|
648
|
+
| ------ | ----------- | ---------------------------- |
|
|
649
|
+
| `name` | `string` | **Required.** Tab name/label |
|
|
650
|
+
| `icon` | `ReactNode` | Optional: icon in tab |
|
|
602
651
|
|
|
603
652
|
### Example
|
|
653
|
+
|
|
604
654
|
```tsx
|
|
605
655
|
<Tabs>
|
|
606
656
|
<TabPane name="Tab 1">Content 1</TabPane>
|
|
@@ -610,12 +660,13 @@ Tab navigation with content areas.
|
|
|
610
660
|
```
|
|
611
661
|
|
|
612
662
|
### Configuration example
|
|
663
|
+
|
|
613
664
|
```tsx
|
|
614
665
|
<Tabs
|
|
615
666
|
viewType="legacy"
|
|
616
667
|
config={{
|
|
617
668
|
tabBar: { fullWidth: true },
|
|
618
|
-
tabItems: { appearance: 'fill' }
|
|
669
|
+
tabItems: { appearance: 'fill' } // 'equal' | 'fill'
|
|
619
670
|
}}
|
|
620
671
|
>
|
|
621
672
|
<TabPane name="Tab 1">Content</TabPane>
|
|
@@ -629,12 +680,14 @@ Tab navigation with content areas.
|
|
|
629
680
|
Sortable table header cell.
|
|
630
681
|
|
|
631
682
|
### Props
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
|
635
|
-
| `
|
|
683
|
+
|
|
684
|
+
| Prop | Type | Description |
|
|
685
|
+
| ----------- | --------- | -------------------------------------- |
|
|
686
|
+
| `active` | `boolean` | Whether this column is actively sorted |
|
|
687
|
+
| `ascending` | `boolean` | **Required.** Sort direction |
|
|
636
688
|
|
|
637
689
|
### Example
|
|
690
|
+
|
|
638
691
|
```tsx
|
|
639
692
|
const [orderBy, setOrderBy] = useState('name');
|
|
640
693
|
const [ascending, setAscending] = useState(true);
|
|
@@ -655,7 +708,9 @@ const [ascending, setAscending] = useState(true);
|
|
|
655
708
|
</tr>
|
|
656
709
|
</thead>
|
|
657
710
|
<tbody>
|
|
658
|
-
<tr className="fwe-tr-md"
|
|
711
|
+
<tr className="fwe-tr-md">
|
|
712
|
+
<td>Entry</td>
|
|
713
|
+
</tr>
|
|
659
714
|
</tbody>
|
|
660
|
-
</table
|
|
715
|
+
</table>;
|
|
661
716
|
```
|
package/llm-doc/installation.md
CHANGED
|
@@ -25,6 +25,7 @@ import { Button, TextInput, Select, Modal, Accordion } from '@festo-ui/react';
|
|
|
25
25
|
### Complete Export List
|
|
26
26
|
|
|
27
27
|
**Components:**
|
|
28
|
+
|
|
28
29
|
- `Accordion`, `AccordionHeader`, `AccordionItem`, `AccordionItemBody`, `AccordionItemHeader`
|
|
29
30
|
- `BottomSheet`
|
|
30
31
|
- `Breadcrumb`
|
|
@@ -45,6 +46,7 @@ import { Button, TextInput, Select, Modal, Accordion } from '@festo-ui/react';
|
|
|
45
46
|
- `TableHeaderCell`
|
|
46
47
|
|
|
47
48
|
**Forms:**
|
|
49
|
+
|
|
48
50
|
- `Checkbox`
|
|
49
51
|
- `ComboBox`
|
|
50
52
|
- `MultiSelect`
|
|
@@ -67,7 +69,7 @@ The library uses CSS classes with the prefix `fwe-`. Commonly used:
|
|
|
67
69
|
- Layout: `fwe-grid`, `fwe-col-{n}`, `fwe-container`, `fwe-d-flex`
|
|
68
70
|
- Spacing: `fwe-m-{size}`, `fwe-p-{size}`, `fwe-mt-{size}`, `fwe-mb-{size}`, `fwe-mr-{size}`, `fwe-ml-{size}`, `fwe-my-{size}`, `fwe-mx-{size}`
|
|
69
71
|
- Sizes: `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`
|
|
70
|
-
- Buttons: `fwe-btn`, `fwe-btn-hero`, `fwe-btn-icon`, `fwe-btn-
|
|
72
|
+
- Buttons: `fwe-btn`, `fwe-btn-hero`, `fwe-btn-icon`, `fwe-btn-tertiary`, `fwe-btn-lg`, `fwe-btn-block`
|
|
71
73
|
- Colors: `fwe-bg-white`, `fwe-bg-background`, `fwe-bg-black`, `fwe-bg-gray-300`, `fwe-color-red`
|
|
72
74
|
- Flex: `fwe-align-items-center`, `fwe-mr-auto`, `fwe-ml-auto`
|
|
73
75
|
- Table: `fwe-table`, `fwe-tr-sm`, `fwe-tr-md`, `fwe-tr-lg`
|
package/llm-doc/patterns.md
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
All form components support both modes:
|
|
6
6
|
|
|
7
7
|
### Uncontrolled (simpler)
|
|
8
|
+
|
|
8
9
|
State is managed internally. Use `defaultValue` / `defaultChecked`:
|
|
10
|
+
|
|
9
11
|
```tsx
|
|
10
12
|
<TextInput label="Name" defaultValue="Max" />
|
|
11
13
|
<Checkbox defaultChecked>Option</Checkbox>
|
|
@@ -14,13 +16,16 @@ State is managed internally. Use `defaultValue` / `defaultChecked`:
|
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
### Controlled (full control)
|
|
19
|
+
|
|
17
20
|
State is managed externally. Use `value` + `onChange`:
|
|
21
|
+
|
|
18
22
|
```tsx
|
|
19
23
|
const [value, setValue] = useState('');
|
|
20
|
-
<TextInput label="Name" value={value} onChange={setValue}
|
|
24
|
+
<TextInput label="Name" value={value} onChange={setValue} />;
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
**Note:** The `onChange` signature varies by component:
|
|
28
|
+
|
|
24
29
|
- `TextInput`, `TextArea`: `(value: string, event) => void`
|
|
25
30
|
- `Select`, `ComboBox`: `(value: T) => void`
|
|
26
31
|
- `MultiSelect`: `(value: T[]) => void`
|
|
@@ -55,8 +60,10 @@ function handleSubmit(event) {
|
|
|
55
60
|
<MultiSelect name="categories" label="Categories" options={catOptions} />
|
|
56
61
|
<TimePicker name="meetingTime">Time</TimePicker>
|
|
57
62
|
<Slider name="volume" min={0} max={100} value={50} label="Volume" />
|
|
58
|
-
<button className="fwe-btn fwe-btn-hero" type="submit">
|
|
59
|
-
|
|
63
|
+
<button className="fwe-btn fwe-btn-hero" type="submit">
|
|
64
|
+
Submit
|
|
65
|
+
</button>
|
|
66
|
+
</form>;
|
|
60
67
|
```
|
|
61
68
|
|
|
62
69
|
---
|
|
@@ -64,7 +71,9 @@ function handleSubmit(event) {
|
|
|
64
71
|
## Validation
|
|
65
72
|
|
|
66
73
|
### Error display
|
|
74
|
+
|
|
67
75
|
Most form components have an `error` prop:
|
|
76
|
+
|
|
68
77
|
```tsx
|
|
69
78
|
<TextInput label="Email" error="Invalid email address" />
|
|
70
79
|
<Select label="Selection" error="Please select" options={options} />
|
|
@@ -72,12 +81,14 @@ Most form components have an `error` prop:
|
|
|
72
81
|
```
|
|
73
82
|
|
|
74
83
|
### HTML5 validation
|
|
84
|
+
|
|
75
85
|
```tsx
|
|
76
86
|
<TextInput label="Name" required minLength={3} />
|
|
77
87
|
<TextArea label="Text" required maxLength={500} />
|
|
78
88
|
```
|
|
79
89
|
|
|
80
90
|
### Checkbox validation
|
|
91
|
+
|
|
81
92
|
```tsx
|
|
82
93
|
<Checkbox valid={false}>Invalid option</Checkbox>
|
|
83
94
|
```
|
|
@@ -87,6 +98,7 @@ Most form components have an `error` prop:
|
|
|
87
98
|
## Hint Texts
|
|
88
99
|
|
|
89
100
|
Many components support `hint` for help text:
|
|
101
|
+
|
|
90
102
|
```tsx
|
|
91
103
|
<TextInput label="Email" hint="e.g. max@example.com" />
|
|
92
104
|
<Select label="Role" hint="Choose your primary role" options={options} />
|
|
@@ -98,6 +110,7 @@ Many components support `hint` for help text:
|
|
|
98
110
|
## CSS Classes for Layout
|
|
99
111
|
|
|
100
112
|
### Grid System
|
|
113
|
+
|
|
101
114
|
```tsx
|
|
102
115
|
<div className="fwe-grid">
|
|
103
116
|
<div className="fwe-col-4">1/3 width</div>
|
|
@@ -106,22 +119,26 @@ Many components support `hint` for help text:
|
|
|
106
119
|
```
|
|
107
120
|
|
|
108
121
|
### Container
|
|
122
|
+
|
|
109
123
|
```tsx
|
|
110
124
|
<div className="fwe-container">Centered container</div>
|
|
111
125
|
```
|
|
112
126
|
|
|
113
127
|
### Buttons with CSS classes (alternative to Button component)
|
|
128
|
+
|
|
114
129
|
```tsx
|
|
115
130
|
<button className="fwe-btn">Default</button>
|
|
116
131
|
<button className="fwe-btn fwe-btn-hero">Primary</button>
|
|
117
132
|
<button className="fwe-btn fwe-btn-lg">Large</button>
|
|
118
133
|
<button className="fwe-btn fwe-btn-block">Full width</button>
|
|
119
134
|
<button className="fwe-btn fwe-btn-icon"><Icon /></button>
|
|
120
|
-
<button className="fwe-btn fwe-btn-
|
|
135
|
+
<button className="fwe-btn fwe-btn-tertiary fwe-dark">Link</button>
|
|
121
136
|
```
|
|
122
137
|
|
|
123
138
|
### Spacing
|
|
139
|
+
|
|
124
140
|
Prefix `fwe-m-` (margin) and `fwe-p-` (padding), suffixes:
|
|
141
|
+
|
|
125
142
|
- Direction: `t` (top), `b` (bottom), `l` (left), `r` (right), `x` (horizontal), `y` (vertical)
|
|
126
143
|
- Sizes: `xxxs`, `xxs`, `xs`, `s`, `m`, `l`, `xl`, `xxl`
|
|
127
144
|
|
package/package.json
CHANGED