@whity/ui 0.5.0 → 1.0.1
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/README.md +107 -107
- package/package.json +223 -192
- package/src/access-denied.stories.tsx +179 -179
- package/src/access-denied.tsx +305 -305
- package/src/action-proposal.tsx +338 -302
- package/src/actor-chip.tsx +71 -71
- package/src/agent-activity.tsx +163 -163
- package/src/agent-collaboration.stories.tsx +156 -156
- package/src/agent-run-status.tsx +196 -196
- package/src/alert-dialog.stories.tsx +45 -45
- package/src/alert-dialog.tsx +147 -147
- package/src/alert.stories.tsx +91 -91
- package/src/alert.tsx +89 -89
- package/src/app-sidebar.stories.tsx +195 -195
- package/src/app-sidebar.tsx +604 -500
- package/src/approval-queue.tsx +109 -108
- package/src/audience-group-picker.stories.tsx +198 -198
- package/src/audience-group-picker.tsx +362 -362
- package/src/audience-people-picker.stories.tsx +102 -102
- package/src/audience-people-picker.tsx +279 -279
- package/src/avatar-pattern.ts +138 -0
- package/src/avatar.tsx +125 -83
- package/src/badge.stories.tsx +105 -105
- package/src/badge.tsx +68 -68
- package/src/beta-warning.stories.tsx +79 -79
- package/src/beta-warning.tsx +189 -189
- package/src/bilingual-input.stories.tsx +82 -82
- package/src/bilingual-input.tsx +188 -183
- package/src/board.tsx +216 -0
- package/src/breadcrumb.stories.tsx +51 -51
- package/src/breadcrumb.tsx +90 -90
- package/src/built-on-whity.tsx +52 -0
- package/src/button.stories.tsx +87 -87
- package/src/button.tsx +125 -118
- package/src/card.stories.tsx +423 -423
- package/src/card.tsx +180 -180
- package/src/chart.stories.tsx +66 -66
- package/src/chart.tsx +228 -228
- package/src/checkbox.stories.tsx +62 -62
- package/src/checkbox.tsx +54 -54
- package/src/collapsible.stories.tsx +48 -48
- package/src/collapsible.tsx +34 -34
- package/src/color-card.stories.tsx +61 -61
- package/src/color-card.tsx +270 -270
- package/src/color-picker.stories.tsx +65 -65
- package/src/color-picker.tsx +425 -425
- package/src/column-matcher.tsx +84 -0
- package/src/command-palette.tsx +399 -306
- package/src/confirm-action.tsx +98 -0
- package/src/copy-block.stories.tsx +38 -38
- package/src/copy-block.tsx +85 -85
- package/src/data-table.stories.tsx +200 -200
- package/src/data-table.tsx +1687 -1106
- package/src/date-picker.stories.tsx +61 -61
- package/src/date-picker.tsx +457 -422
- package/src/design-cards.stories.tsx +551 -458
- package/src/dialog.stories.tsx +48 -48
- package/src/dialog.tsx +179 -166
- package/src/display-preferences.tsx +59 -0
- package/src/documents/barcode-svg.stories.tsx +72 -72
- package/src/documents/barcode-svg.tsx +79 -79
- package/src/dropdown-menu.stories.tsx +77 -77
- package/src/dropdown-menu.tsx +271 -271
- package/src/editor/agent-panel.tsx +222 -0
- package/src/editor/agents.stories.tsx +81 -0
- package/src/editor/agents.ts +55 -0
- package/src/editor/behaviour.ts +279 -279
- package/src/editor/block-ids.ts +44 -44
- package/src/editor/block-list.tsx +104 -101
- package/src/editor/block-toolbar.tsx +490 -477
- package/src/editor/bubble.tsx +119 -93
- package/src/editor/catalogue.ts +169 -103
- package/src/editor/collab-rail.tsx +746 -746
- package/src/editor/collab.stories.tsx +207 -207
- package/src/editor/collab.ts +87 -87
- package/src/editor/contract.ts +476 -408
- package/src/editor/convert.ts +414 -362
- package/src/editor/doc-editor.stories.tsx +98 -98
- package/src/editor/doc-editor.tsx +1492 -1287
- package/src/editor/editor.css +636 -536
- package/src/editor/extensions.ts +86 -86
- package/src/editor/field-bar.tsx +154 -0
- package/src/editor/field-picker.tsx +109 -107
- package/src/editor/fields.ts +100 -100
- package/src/editor/gutter.tsx +443 -367
- package/src/editor/index.ts +23 -22
- package/src/editor/label-sheet.tsx +289 -289
- package/src/editor/labels.ts +394 -310
- package/src/editor/link-tools.tsx +141 -141
- package/src/editor/node-views.tsx +461 -450
- package/src/editor/page-view.tsx +372 -353
- package/src/editor/phone.tsx +310 -0
- package/src/editor/plugin-block-view.tsx +230 -0
- package/src/editor/plugin-blocks.stories.tsx +96 -0
- package/src/editor/plugin-blocks.ts +52 -0
- package/src/editor/publish-check.tsx +201 -182
- package/src/editor/rich-blocks.stories.tsx +146 -146
- package/src/editor/sample.ts +40 -40
- package/src/editor/save-block-dialog.tsx +141 -0
- package/src/editor/saved-block-view.tsx +205 -0
- package/src/editor/saved-blocks.stories.tsx +105 -0
- package/src/editor/saved-parts.ts +192 -0
- package/src/editor/schema-rich.ts +156 -150
- package/src/editor/schema.ts +368 -315
- package/src/editor/services.tsx +205 -127
- package/src/editor/slash.ts +64 -64
- package/src/editor/suggesting.ts +372 -372
- package/src/editor/suggestions.ts +763 -763
- package/src/editor/table-keys.ts +66 -66
- package/src/editor/templates.stories.tsx +324 -324
- package/src/editor/toolbar.tsx +364 -358
- package/src/empty-state.stories.tsx +51 -51
- package/src/empty-state.tsx +126 -100
- package/src/empty-state.usage-notes.md +30 -30
- package/src/form.stories.tsx +112 -112
- package/src/form.tsx +176 -176
- package/src/globals.css +20 -20
- package/src/icon-button.tsx +85 -85
- package/src/icon-map.ts +335 -244
- package/src/icon.tsx +41 -41
- package/src/index.ts +92 -67
- package/src/input.stories.tsx +157 -157
- package/src/input.tsx +768 -759
- package/src/kpi-strip.tsx +47 -0
- package/src/localized-text.ts +76 -0
- package/src/locked-screen.stories.tsx +29 -29
- package/src/locked-screen.tsx +75 -61
- package/src/lockup.tsx +42 -0
- package/src/lottie.tsx +441 -0
- package/src/mark.tsx +62 -62
- package/src/math-text.stories.tsx +33 -33
- package/src/math-text.tsx +43 -43
- package/src/menu-bar.stories.tsx +198 -198
- package/src/menu-bar.tsx +373 -373
- package/src/message-thread.tsx +181 -0
- package/src/money/currency.ts +244 -230
- package/src/money/money-input.tsx +131 -0
- package/src/money/money.tsx +33 -0
- package/src/open-on-computer.tsx +150 -0
- package/src/otp-input.tsx +161 -0
- package/src/page-header.stories.tsx +95 -95
- package/src/page-header.tsx +122 -122
- package/src/page-shell.stories.tsx +42 -42
- package/src/page-shell.tsx +32 -32
- package/src/page-states.tsx +277 -0
- package/src/pagination.stories.tsx +45 -45
- package/src/pagination.tsx +98 -98
- package/src/paper-sheet.stories.tsx +88 -0
- package/src/paper-sheet.tsx +85 -0
- package/src/phone-input.tsx +252 -0
- package/src/phone-tab-bar.tsx +152 -0
- package/src/plugin-card.stories.tsx +208 -180
- package/src/plugin-card.tsx +931 -848
- package/src/popover.stories.tsx +48 -48
- package/src/popover.tsx +55 -55
- package/src/radio-group.stories.tsx +26 -26
- package/src/radio-group.tsx +44 -44
- package/src/role-summary.stories.tsx +143 -0
- package/src/role-summary.tsx +120 -0
- package/src/route-flow/editor.tsx +1087 -1014
- package/src/route-flow/model.ts +771 -716
- package/src/save-bar.tsx +94 -0
- package/src/scope-grant.tsx +139 -139
- package/src/screen-too-small.stories.tsx +61 -61
- package/src/screen-too-small.tsx +104 -104
- package/src/search-field.tsx +65 -0
- package/src/select.stories.tsx +44 -44
- package/src/select.tsx +197 -197
- package/src/separator.stories.tsx +34 -34
- package/src/separator.tsx +34 -34
- package/src/sheet.stories.tsx +49 -49
- package/src/sheet.tsx +168 -168
- package/src/skeleton.stories.tsx +28 -28
- package/src/skeleton.tsx +19 -19
- package/src/slider.stories.tsx +78 -78
- package/src/slider.tsx +300 -300
- package/src/spinner.stories.tsx +33 -33
- package/src/spinner.tsx +55 -55
- package/src/stepper.tsx +85 -0
- package/src/switch.stories.tsx +42 -42
- package/src/switch.tsx +41 -41
- package/src/switcher.stories.tsx +111 -111
- package/src/switcher.tsx +131 -131
- package/src/system-state.tsx +55 -0
- package/src/table.stories.tsx +48 -48
- package/src/table.tsx +121 -121
- package/src/tabs.stories.tsx +74 -74
- package/src/tabs.tsx +90 -90
- package/src/tag-input.stories.tsx +67 -67
- package/src/tag-input.tsx +117 -117
- package/src/tenant-logo.tsx +63 -63
- package/src/tenant-switcher.stories.tsx +38 -38
- package/src/tenant-switcher.tsx +185 -164
- package/src/textarea.stories.tsx +27 -27
- package/src/textarea.tsx +18 -18
- package/src/theme-mode.ts +74 -52
- package/src/time-grid.tsx +163 -0
- package/src/time-picker.stories.tsx +62 -62
- package/src/time-picker.tsx +616 -615
- package/src/toggle-group.tsx +139 -138
- package/src/tooltip.stories.tsx +43 -43
- package/src/tooltip.tsx +73 -73
- package/src/top-nav.stories.tsx +58 -58
- package/src/top-nav.tsx +324 -324
- package/src/undo-bar.tsx +107 -107
- package/src/utils.ts +45 -45
- package/src/view-toggle.stories.tsx +84 -84
- package/src/view-toggle.tsx +111 -110
|
@@ -1,458 +1,551 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<Button
|
|
75
|
-
<Button variant="
|
|
76
|
-
|
|
77
|
-
</Button>
|
|
78
|
-
<Button variant="
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</Button>
|
|
82
|
-
<Button size="
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<IconButton icon="
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
<
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
<IconButton icon="
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<DropdownMenuItem>
|
|
152
|
-
<Icon name="
|
|
153
|
-
</DropdownMenuItem>
|
|
154
|
-
<DropdownMenuItem>
|
|
155
|
-
<Icon name="
|
|
156
|
-
</DropdownMenuItem>
|
|
157
|
-
<DropdownMenuItem>
|
|
158
|
-
<Icon name="
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
<DropdownMenuItem
|
|
169
|
-
<Icon name="delete" />
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
</
|
|
203
|
-
<
|
|
204
|
-
<
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<Button size="sm">
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
{ value: "
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
<
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
<
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
<
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
<Badge
|
|
358
|
-
|
|
359
|
-
</Badge>
|
|
360
|
-
<Badge variant="
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
1
|
+
import { ConfirmAction } from "./confirm-action"
|
|
2
|
+
import { AccessDeniedPanel, AreaError, EmptyFiltered, EmptyFirstTime, LoadingRows, ReadOnlyNotice } from "./page-states"
|
|
3
|
+
import { Stepper as StepperComponent } from "./stepper"
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react-vite"
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
|
|
7
|
+
import { ActorChip } from "./actor-chip"
|
|
8
|
+
import { AgentRunStatus } from "./agent-run-status"
|
|
9
|
+
import { Avatar } from "./avatar"
|
|
10
|
+
import { Badge } from "./badge"
|
|
11
|
+
import { Button } from "./button"
|
|
12
|
+
import { Checkbox } from "./checkbox"
|
|
13
|
+
import {
|
|
14
|
+
Dialog,
|
|
15
|
+
DialogContent,
|
|
16
|
+
DialogDescription,
|
|
17
|
+
DialogFooter,
|
|
18
|
+
DialogHeader,
|
|
19
|
+
DialogTitle,
|
|
20
|
+
} from "./dialog"
|
|
21
|
+
import {
|
|
22
|
+
DropdownMenu,
|
|
23
|
+
DropdownMenuContent,
|
|
24
|
+
DropdownMenuItem,
|
|
25
|
+
DropdownMenuSeparator,
|
|
26
|
+
DropdownMenuShortcut,
|
|
27
|
+
DropdownMenuTrigger,
|
|
28
|
+
} from "./dropdown-menu"
|
|
29
|
+
import { Icon, iconNames } from "./icon"
|
|
30
|
+
import { IconButton } from "./icon-button"
|
|
31
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover"
|
|
32
|
+
import { RadioGroup, RadioGroupItem } from "./radio-group"
|
|
33
|
+
import { ToggleGroup } from "./toggle-group"
|
|
34
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip"
|
|
35
|
+
import { DocEditor } from "./editor/doc-editor"
|
|
36
|
+
import { SAMPLE_DOCUMENT } from "./editor/sample"
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One story per design card (docs/design/components/<Name>), with the card's
|
|
40
|
+
* own content, rendered at the card's size from docs/design/cards.html. The
|
|
41
|
+
* screenshot check (scripts/design-cards-compare.mjs) renders these in light
|
|
42
|
+
* and dark and compares them with docs/design/screenshots/<Name>-<theme>.png.
|
|
43
|
+
* `parameters.designCard` names the card and its height; every card is 960 wide.
|
|
44
|
+
*/
|
|
45
|
+
const meta = {
|
|
46
|
+
title: "Design cards",
|
|
47
|
+
parameters: { layout: "fullscreen" },
|
|
48
|
+
} satisfies Meta
|
|
49
|
+
|
|
50
|
+
export default meta
|
|
51
|
+
type Story = StoryObj<typeof meta>
|
|
52
|
+
|
|
53
|
+
const card = (name: string, height: number) => ({ designCard: { name, width: 960, height } })
|
|
54
|
+
|
|
55
|
+
/** `.wy-stage`: a wrapping row, 12px apart, 16px by 24px of padding. */
|
|
56
|
+
function Stage({ className, ...props }: React.ComponentProps<"div">) {
|
|
57
|
+
return <div className={`flex flex-wrap items-center gap-3 px-6 py-4 ${className ?? ""}`} {...props} />
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** The card page's own `#root` padding, for cards that put a stage inside it. */
|
|
61
|
+
function Root({ children }: { children: React.ReactNode }) {
|
|
62
|
+
return <div className="px-6 py-4">{children}</div>
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function Cap({ children }: { children: React.ReactNode }) {
|
|
66
|
+
return <p className="m-0 mb-1.5 text-xs text-muted-foreground">{children}</p>
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const ButtonCard: Story = {
|
|
70
|
+
name: "Button",
|
|
71
|
+
parameters: card("Button", 126),
|
|
72
|
+
render: () => (
|
|
73
|
+
<Stage>
|
|
74
|
+
<Button icon="send">Send invoice</Button>
|
|
75
|
+
<Button variant="outline">Save draft</Button>
|
|
76
|
+
<Button variant="secondary">Duplicate</Button>
|
|
77
|
+
<Button variant="ghost">Cancel</Button>
|
|
78
|
+
<Button variant="destructive" icon="delete">
|
|
79
|
+
Delete tenant
|
|
80
|
+
</Button>
|
|
81
|
+
<Button variant="link">View history</Button>
|
|
82
|
+
<Button size="sm" loading>
|
|
83
|
+
Saving
|
|
84
|
+
</Button>
|
|
85
|
+
<Button size="lg">Create workspace</Button>
|
|
86
|
+
</Stage>
|
|
87
|
+
),
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const IconButtonCard: Story = {
|
|
91
|
+
name: "IconButton",
|
|
92
|
+
parameters: card("IconButton", 72),
|
|
93
|
+
render: () => (
|
|
94
|
+
<Stage>
|
|
95
|
+
<IconButton icon="edit" label="Edit" />
|
|
96
|
+
<IconButton icon="more" label="More actions" variant="outline" />
|
|
97
|
+
<IconButton icon="delete" label="Delete" variant="ghost" />
|
|
98
|
+
<IconButton icon="close" label="Close" />
|
|
99
|
+
</Stage>
|
|
100
|
+
),
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export const TooltipCard: Story = {
|
|
104
|
+
name: "Tooltip",
|
|
105
|
+
parameters: card("Tooltip", 130),
|
|
106
|
+
render: () => (
|
|
107
|
+
<Root>
|
|
108
|
+
<Stage className="gap-5 pt-11">
|
|
109
|
+
<Tooltip open>
|
|
110
|
+
<TooltipTrigger asChild>
|
|
111
|
+
<Button variant="outline" icon="download">
|
|
112
|
+
Download
|
|
113
|
+
</Button>
|
|
114
|
+
</TooltipTrigger>
|
|
115
|
+
<TooltipContent>Download as PDF</TooltipContent>
|
|
116
|
+
</Tooltip>
|
|
117
|
+
<Tooltip open>
|
|
118
|
+
<TooltipTrigger asChild>
|
|
119
|
+
<span className="inline-flex">
|
|
120
|
+
<IconButton icon="search" label="Search" tooltip={false} />
|
|
121
|
+
</span>
|
|
122
|
+
</TooltipTrigger>
|
|
123
|
+
<TooltipContent>
|
|
124
|
+
Search <kbd>⌘K</kbd>
|
|
125
|
+
</TooltipContent>
|
|
126
|
+
</Tooltip>
|
|
127
|
+
<IconButton icon="notification" label="Notifications" />
|
|
128
|
+
<IconButton icon="help" label="Help" />
|
|
129
|
+
<IconButton icon="more" label="More actions" variant="outline" />
|
|
130
|
+
<IconButton icon="edit" label="Edit" size="sm" />
|
|
131
|
+
</Stage>
|
|
132
|
+
</Root>
|
|
133
|
+
),
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export const MenuCard: Story = {
|
|
137
|
+
name: "Menu",
|
|
138
|
+
parameters: card("Menu", 430),
|
|
139
|
+
render: () => (
|
|
140
|
+
<Root>
|
|
141
|
+
<Stage className="min-h-[360px] items-start gap-[220px]">
|
|
142
|
+
<div>
|
|
143
|
+
<Cap>Menu</Cap>
|
|
144
|
+
<DropdownMenu open modal={false}>
|
|
145
|
+
<DropdownMenuTrigger asChild>
|
|
146
|
+
<Button variant="outline" iconEnd="chevron-down" aria-label="Invoice actions">
|
|
147
|
+
Actions
|
|
148
|
+
</Button>
|
|
149
|
+
</DropdownMenuTrigger>
|
|
150
|
+
<DropdownMenuContent align="start">
|
|
151
|
+
<DropdownMenuItem>
|
|
152
|
+
<Icon name="edit" /> Edit <DropdownMenuShortcut>E</DropdownMenuShortcut>
|
|
153
|
+
</DropdownMenuItem>
|
|
154
|
+
<DropdownMenuItem>
|
|
155
|
+
<Icon name="copy" /> Duplicate
|
|
156
|
+
</DropdownMenuItem>
|
|
157
|
+
<DropdownMenuItem>
|
|
158
|
+
<Icon name="download" /> Download PDF <DropdownMenuShortcut>⌘D</DropdownMenuShortcut>
|
|
159
|
+
</DropdownMenuItem>
|
|
160
|
+
<DropdownMenuItem>
|
|
161
|
+
<Icon name="send" />
|
|
162
|
+
<span className="grid gap-px">
|
|
163
|
+
Send a reminder
|
|
164
|
+
<span className="text-xs text-muted-foreground">Last sent 3 days ago</span>
|
|
165
|
+
</span>
|
|
166
|
+
</DropdownMenuItem>
|
|
167
|
+
<DropdownMenuSeparator />
|
|
168
|
+
<DropdownMenuItem variant="destructive">
|
|
169
|
+
<Icon name="delete" /> Void invoice
|
|
170
|
+
</DropdownMenuItem>
|
|
171
|
+
<DropdownMenuItem disabled>
|
|
172
|
+
<Icon name="delete" />
|
|
173
|
+
<span className="grid gap-px">
|
|
174
|
+
Delete
|
|
175
|
+
<span className="text-xs text-muted-foreground">Issued invoices can’t be deleted</span>
|
|
176
|
+
</span>
|
|
177
|
+
</DropdownMenuItem>
|
|
178
|
+
</DropdownMenuContent>
|
|
179
|
+
</DropdownMenu>
|
|
180
|
+
</div>
|
|
181
|
+
<div>
|
|
182
|
+
<Cap>Popover</Cap>
|
|
183
|
+
<Popover open modal={false}>
|
|
184
|
+
<PopoverTrigger asChild>
|
|
185
|
+
<Button variant="outline" icon="filter">
|
|
186
|
+
Filter
|
|
187
|
+
</Button>
|
|
188
|
+
</PopoverTrigger>
|
|
189
|
+
<PopoverContent align="start">
|
|
190
|
+
<div className="font-semibold">Filter invoices</div>
|
|
191
|
+
<div className="font-medium">Payment</div>
|
|
192
|
+
<RadioGroup defaultValue="overdue" aria-label="Payment" className="grid gap-2">
|
|
193
|
+
{[
|
|
194
|
+
["all", "All"],
|
|
195
|
+
["unpaid", "Unpaid"],
|
|
196
|
+
["overdue", "Overdue"],
|
|
197
|
+
].map(([value, label]) => (
|
|
198
|
+
<label key={value} className="flex items-center gap-2">
|
|
199
|
+
<RadioGroupItem value={value} /> {label}
|
|
200
|
+
</label>
|
|
201
|
+
))}
|
|
202
|
+
</RadioGroup>
|
|
203
|
+
<label className="flex items-center gap-2">
|
|
204
|
+
<Checkbox defaultChecked /> Only invoices sent by agents
|
|
205
|
+
</label>
|
|
206
|
+
<div className="flex justify-end gap-2">
|
|
207
|
+
<Button variant="ghost" size="sm">
|
|
208
|
+
Clear
|
|
209
|
+
</Button>
|
|
210
|
+
<Button size="sm">Apply</Button>
|
|
211
|
+
</div>
|
|
212
|
+
</PopoverContent>
|
|
213
|
+
</Popover>
|
|
214
|
+
</div>
|
|
215
|
+
</Stage>
|
|
216
|
+
</Root>
|
|
217
|
+
),
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export const ToggleGroupCard: Story = {
|
|
221
|
+
name: "ToggleGroup",
|
|
222
|
+
parameters: card("ToggleGroup", 230),
|
|
223
|
+
render: () => (
|
|
224
|
+
<div className="grid grid-cols-[repeat(auto-fit,minmax(280px,1fr))] items-start gap-x-8 gap-y-6 px-6 py-4">
|
|
225
|
+
<div className="grid content-start gap-3">
|
|
226
|
+
<Cap>One at a time: the view</Cap>
|
|
227
|
+
<ToggleGroup
|
|
228
|
+
label="View"
|
|
229
|
+
defaultValue="list"
|
|
230
|
+
required
|
|
231
|
+
options={[
|
|
232
|
+
{ value: "list", label: "List", icon: "form" },
|
|
233
|
+
{ value: "board", label: "Board", icon: "dashboard" },
|
|
234
|
+
{ value: "calendar", label: "Calendar", icon: "calendar" },
|
|
235
|
+
]}
|
|
236
|
+
/>
|
|
237
|
+
<Cap>Icons only, with tooltips</Cap>
|
|
238
|
+
<ToggleGroup
|
|
239
|
+
label="Show"
|
|
240
|
+
size="sm"
|
|
241
|
+
defaultValue="list"
|
|
242
|
+
required
|
|
243
|
+
options={[
|
|
244
|
+
{ value: "list", label: "List", icon: "form", iconOnly: true },
|
|
245
|
+
{ value: "board", label: "Board", icon: "dashboard", iconOnly: true },
|
|
246
|
+
{ value: "chart", label: "Chart", icon: "chart", iconOnly: true },
|
|
247
|
+
]}
|
|
248
|
+
/>
|
|
249
|
+
</div>
|
|
250
|
+
<div className="grid content-start gap-3">
|
|
251
|
+
<Cap>Any number: filters</Cap>
|
|
252
|
+
<ToggleGroup
|
|
253
|
+
label="Status"
|
|
254
|
+
type="multiple"
|
|
255
|
+
defaultValue={["unpaid", "overdue"]}
|
|
256
|
+
options={[
|
|
257
|
+
{ value: "paid", label: "Paid" },
|
|
258
|
+
{ value: "unpaid", label: "Unpaid" },
|
|
259
|
+
{ value: "overdue", label: "Overdue" },
|
|
260
|
+
{ value: "draft", label: "Draft", disabled: true },
|
|
261
|
+
]}
|
|
262
|
+
/>
|
|
263
|
+
<Cap>بالعربية</Cap>
|
|
264
|
+
<div dir="rtl" lang="ar" className="font-arabic">
|
|
265
|
+
<ToggleGroup
|
|
266
|
+
label="العرض"
|
|
267
|
+
defaultValue="list"
|
|
268
|
+
required
|
|
269
|
+
options={[
|
|
270
|
+
{ value: "list", label: "قائمة", icon: "form" },
|
|
271
|
+
{ value: "board", label: "لوحة", icon: "dashboard" },
|
|
272
|
+
{ value: "calendar", label: "تقويم", icon: "calendar" },
|
|
273
|
+
]}
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
),
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
export const DialogCard: Story = {
|
|
282
|
+
name: "Dialog",
|
|
283
|
+
parameters: card("Dialog", 384),
|
|
284
|
+
render: () => (
|
|
285
|
+
<Dialog open>
|
|
286
|
+
<DialogContent showCloseButton>
|
|
287
|
+
<DialogHeader>
|
|
288
|
+
<DialogTitle>Revoke this credential?</DialogTitle>
|
|
289
|
+
<DialogDescription>
|
|
290
|
+
Billing assistant will stop working at once. Anything it already did stays in the activity log.
|
|
291
|
+
</DialogDescription>
|
|
292
|
+
</DialogHeader>
|
|
293
|
+
<DialogFooter>
|
|
294
|
+
<Button variant="ghost">Cancel</Button>
|
|
295
|
+
<Button variant="destructive">Revoke credential</Button>
|
|
296
|
+
</DialogFooter>
|
|
297
|
+
</DialogContent>
|
|
298
|
+
</Dialog>
|
|
299
|
+
),
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export const AvatarCard: Story = {
|
|
303
|
+
name: "Avatar",
|
|
304
|
+
parameters: card("Avatar", 140),
|
|
305
|
+
render: () => (
|
|
306
|
+
<Root>
|
|
307
|
+
<Stage className="items-end gap-7">
|
|
308
|
+
<div className="grid justify-items-center gap-1.5">
|
|
309
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
310
|
+
<Avatar name="Rana Haddad" size={40} status="online" />
|
|
311
|
+
<Avatar name="Omar Saleh" size={32} />
|
|
312
|
+
<Avatar name="Lina" size={24} />
|
|
313
|
+
</div>
|
|
314
|
+
<Cap>People: initials</Cap>
|
|
315
|
+
</div>
|
|
316
|
+
<div className="grid justify-items-center gap-1.5">
|
|
317
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
318
|
+
<Avatar name="Billing assistant" kind="agent" size={40} />
|
|
319
|
+
<Avatar name="HR assistant" kind="agent" size={32} />
|
|
320
|
+
<Avatar name="Reports assistant" kind="agent" size={24} />
|
|
321
|
+
</div>
|
|
322
|
+
<Cap>Agents: the robot face, tinted</Cap>
|
|
323
|
+
</div>
|
|
324
|
+
<div className="grid justify-items-center gap-1.5">
|
|
325
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
326
|
+
<Avatar name="Whity" kind="system" size={40} />
|
|
327
|
+
<Avatar name="Whity" kind="system" size={32} />
|
|
328
|
+
</div>
|
|
329
|
+
<Cap>The system: the mark</Cap>
|
|
330
|
+
</div>
|
|
331
|
+
<div className="grid gap-1.5">
|
|
332
|
+
<ActorChip name="Whity" kind="system" />
|
|
333
|
+
<Cap>Actor chip, system</Cap>
|
|
334
|
+
</div>
|
|
335
|
+
</Stage>
|
|
336
|
+
</Root>
|
|
337
|
+
),
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export const ActorChipCard: Story = {
|
|
341
|
+
name: "ActorChip",
|
|
342
|
+
parameters: card("ActorChip", 64),
|
|
343
|
+
render: () => (
|
|
344
|
+
<Stage>
|
|
345
|
+
<ActorChip kind="person" name="Rana Haddad" />
|
|
346
|
+
<ActorChip kind="agent" name="Billing assistant" onBehalfOf="Rana" />
|
|
347
|
+
<ActorChip kind="agent" name="Front desk" />
|
|
348
|
+
</Stage>
|
|
349
|
+
),
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export const BadgeCard: Story = {
|
|
353
|
+
name: "Badge",
|
|
354
|
+
parameters: card("Badge", 64),
|
|
355
|
+
render: () => (
|
|
356
|
+
<Stage>
|
|
357
|
+
<Badge>[plan name]</Badge>
|
|
358
|
+
<Badge variant="secondary">Draft</Badge>
|
|
359
|
+
<Badge variant="outline">12 seats</Badge>
|
|
360
|
+
<Badge variant="success" icon="check">
|
|
361
|
+
Active
|
|
362
|
+
</Badge>
|
|
363
|
+
<Badge variant="info">Syncing</Badge>
|
|
364
|
+
<Badge variant="warning">Trial ends in 3 days</Badge>
|
|
365
|
+
<Badge variant="destructive">Failed</Badge>
|
|
366
|
+
</Stage>
|
|
367
|
+
),
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export const AgentRunStatusCard: Story = {
|
|
371
|
+
name: "AgentRunStatus",
|
|
372
|
+
parameters: card("AgentRunStatus", 520),
|
|
373
|
+
render: () => (
|
|
374
|
+
<div className="grid gap-5 px-6 py-4">
|
|
375
|
+
<div className="grid grid-cols-2 items-start gap-4">
|
|
376
|
+
<AgentRunStatus
|
|
377
|
+
status="running"
|
|
378
|
+
agent="Billing assistant"
|
|
379
|
+
onBehalfOf="Rana"
|
|
380
|
+
title="Reading 48 open invoices"
|
|
381
|
+
progress={{ done: 31, total: 48 }}
|
|
382
|
+
time="Started 1 min ago"
|
|
383
|
+
onStop={() => {}}
|
|
384
|
+
/>
|
|
385
|
+
<AgentRunStatus
|
|
386
|
+
status="waiting"
|
|
387
|
+
agent="Billing assistant"
|
|
388
|
+
onBehalfOf="Rana"
|
|
389
|
+
title="Send payment reminders to 12 customers"
|
|
390
|
+
detail="Waiting since 14:02 · uses invoice:remind"
|
|
391
|
+
time="Asked 3 min ago"
|
|
392
|
+
onReview={() => {}}
|
|
393
|
+
/>
|
|
394
|
+
<AgentRunStatus
|
|
395
|
+
status="done"
|
|
396
|
+
agent="Front desk"
|
|
397
|
+
onBehalfOf="Omar"
|
|
398
|
+
title="Booked 3 deliveries for tomorrow"
|
|
399
|
+
detail="Example Clinic, Example Hotel and Example School"
|
|
400
|
+
time="Finished 14:20 · took 40 s"
|
|
401
|
+
/>
|
|
402
|
+
<AgentRunStatus
|
|
403
|
+
status="failed"
|
|
404
|
+
agent="HR assistant"
|
|
405
|
+
onBehalfOf="Lina"
|
|
406
|
+
title="Couldn’t prepare October payslips"
|
|
407
|
+
next="Two employees have no bank account. Add them in People, then try again."
|
|
408
|
+
time="Stopped 13:55"
|
|
409
|
+
onRetry={() => {}}
|
|
410
|
+
/>
|
|
411
|
+
</div>
|
|
412
|
+
<div className="grid content-start gap-3">
|
|
413
|
+
<Cap>Compact, in the top bar</Cap>
|
|
414
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
415
|
+
<AgentRunStatus compact status="running" agent="Billing assistant" title="Reading 48 invoices" />
|
|
416
|
+
<AgentRunStatus compact status="done" agent="Front desk" title="Booked 3 deliveries" />
|
|
417
|
+
<AgentRunStatus compact status="failed" agent="HR assistant" title="Payslips stopped" />
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
),
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
export const IconCard: Story = {
|
|
425
|
+
name: "Icon",
|
|
426
|
+
parameters: card("Icon", 940),
|
|
427
|
+
render: () => (
|
|
428
|
+
<div className="grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-1 px-5 py-3">
|
|
429
|
+
{iconNames.map((name) => (
|
|
430
|
+
<div key={name} className="grid justify-items-center gap-1.5 rounded-[8px] px-1 py-2.5">
|
|
431
|
+
<Icon name={name} size={20} />
|
|
432
|
+
<span className="font-mono text-xs text-muted-foreground">{name}</span>
|
|
433
|
+
</div>
|
|
434
|
+
))}
|
|
435
|
+
</div>
|
|
436
|
+
),
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/* ------------------------------------------------- Document editor (M2) */
|
|
440
|
+
|
|
441
|
+
function EditorCard() {
|
|
442
|
+
const [doc, setDoc] = React.useState(SAMPLE_DOCUMENT)
|
|
443
|
+
return (
|
|
444
|
+
<div style={{ height: 820 }}>
|
|
445
|
+
<DocEditor
|
|
446
|
+
document={doc}
|
|
447
|
+
onChange={setDoc}
|
|
448
|
+
canEdit
|
|
449
|
+
back={{ label: "Back to notes", onClick: () => {} }}
|
|
450
|
+
path="Notes · Billing"
|
|
451
|
+
save={{ state: "saved", at: "14:02" }}
|
|
452
|
+
/>
|
|
453
|
+
</div>
|
|
454
|
+
)
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export const EditorShellCard: Story = {
|
|
458
|
+
name: "EditorShell",
|
|
459
|
+
parameters: { designCard: { name: "EditorShell", width: 1280, height: 820 } },
|
|
460
|
+
render: () => <EditorCard />,
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/** docs/design/components/PatternStates: the six states, drawn once. */
|
|
464
|
+
function StateCell({ title, children }: { title: string; children: React.ReactNode }) {
|
|
465
|
+
return (
|
|
466
|
+
<div className="grid content-start gap-3">
|
|
467
|
+
<p className="font-mono text-xs tracking-wide uppercase text-muted-foreground">{title}</p>
|
|
468
|
+
<div className="rounded-card border border-border bg-card p-4">{children}</div>
|
|
469
|
+
</div>
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export const PatternStates: Story = {
|
|
474
|
+
name: "PatternStates",
|
|
475
|
+
parameters: { designCard: { name: "PatternStates", width: 1280, height: 723 } },
|
|
476
|
+
render: () => (
|
|
477
|
+
<div className="grid grid-cols-3 gap-4 px-4 py-4">
|
|
478
|
+
<StateCell title="Loading">
|
|
479
|
+
<LoadingRows label="Loading people" headers={["Person", "Role", "Last active"]} />
|
|
480
|
+
</StateCell>
|
|
481
|
+
<StateCell title="Empty, first time">
|
|
482
|
+
<EmptyFirstTime
|
|
483
|
+
icon="users"
|
|
484
|
+
title="No one here yet"
|
|
485
|
+
description="Invite your team. They'll get an email to set a password."
|
|
486
|
+
action={<Button icon="mail">Invite people</Button>}
|
|
487
|
+
/>
|
|
488
|
+
</StateCell>
|
|
489
|
+
<StateCell title="Empty after a filter">
|
|
490
|
+
<EmptyFiltered
|
|
491
|
+
title="No one matches “Khalda”"
|
|
492
|
+
description="Try another name, or clear the filters."
|
|
493
|
+
clearLabel="Clear filters"
|
|
494
|
+
onClear={() => {}}
|
|
495
|
+
/>
|
|
496
|
+
</StateCell>
|
|
497
|
+
<StateCell title="Error">
|
|
498
|
+
<AreaError
|
|
499
|
+
message="People didn't load. Your connection or our server had a problem."
|
|
500
|
+
retryLabel="Try again"
|
|
501
|
+
onRetry={() => {}}
|
|
502
|
+
/>
|
|
503
|
+
</StateCell>
|
|
504
|
+
<StateCell title="Read-only">
|
|
505
|
+
<ReadOnlyNotice
|
|
506
|
+
title="You can view this role but not change it"
|
|
507
|
+
description="Changing roles needs permission to manage roles. Ask an owner or admin."
|
|
508
|
+
/>
|
|
509
|
+
</StateCell>
|
|
510
|
+
<StateCell title="Access denied">
|
|
511
|
+
<AccessDeniedPanel
|
|
512
|
+
title="You don't have access to Users"
|
|
513
|
+
description="Seeing people needs permission to view users. Rana Haddad and 1 other can give it to you."
|
|
514
|
+
askLabel="Ask for access"
|
|
515
|
+
onAsk={() => {}}
|
|
516
|
+
/>
|
|
517
|
+
</StateCell>
|
|
518
|
+
</div>
|
|
519
|
+
),
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/** docs/design/components/PatternConfirm: tier 3, typing the name. */
|
|
523
|
+
export const PatternConfirm: Story = {
|
|
524
|
+
name: "PatternConfirm",
|
|
525
|
+
parameters: { designCard: { name: "PatternConfirm", width: 1280, height: 560 } },
|
|
526
|
+
render: () => (
|
|
527
|
+
<ConfirmAction
|
|
528
|
+
open
|
|
529
|
+
onOpenChange={() => {}}
|
|
530
|
+
title="Clear two-step for Hala Mansour?"
|
|
531
|
+
description="This removes her authenticator and recovery codes and emails her a reset link. Until she sets them up again, her password alone signs her in. It's logged with your name."
|
|
532
|
+
confirmLabel="Clear two-step"
|
|
533
|
+
cancelLabel="Cancel"
|
|
534
|
+
onConfirm={() => {}}
|
|
535
|
+
typeToConfirm={{ value: "hala@examplebakery.jo", label: "Type hala@examplebakery.jo to confirm" }}
|
|
536
|
+
/>
|
|
537
|
+
),
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export const Stepper: Story = {
|
|
541
|
+
parameters: card("Stepper", 200),
|
|
542
|
+
render: () => (
|
|
543
|
+
<Root>
|
|
544
|
+
<StepperComponent
|
|
545
|
+
label="Set up"
|
|
546
|
+
current={1}
|
|
547
|
+
steps={[{ label: "Access" }, { label: "Plan" }, { label: "Set up" }, { label: "Done" }]}
|
|
548
|
+
/>
|
|
549
|
+
</Root>
|
|
550
|
+
),
|
|
551
|
+
}
|