@dloizides/ui-layout 1.49.2 → 1.50.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/CHANGELOG.md +713 -708
- package/dist/index.d.mts +15 -3
- package/dist/index.d.ts +15 -3
- package/dist/index.js +55 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,708 +1,713 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
75
|
-
###
|
|
76
|
-
|
|
77
|
-
- `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
`
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
`
|
|
142
|
-
|
|
143
|
-
`
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- **`
|
|
161
|
-
|
|
162
|
-
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
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
|
-
- **New
|
|
235
|
-
`
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
`
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
`
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
menu
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
it
|
|
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
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
`
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
now
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
- **
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
- `
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
-
|
|
649
|
-
|
|
650
|
-
`
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
- **
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
-
|
|
667
|
-
|
|
668
|
-
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
- **
|
|
672
|
-
|
|
673
|
-
- **
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
(
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.50.0
|
|
4
|
+
|
|
5
|
+
- `SplitPanes` takes `startWidth`: fixes the start pane (a list rail) at that width while side by side, like `endWidth`; stacked it stays full width.
|
|
6
|
+
- `rowSelection(isDesktop, rowKey, { selectedKey, shownKey })`: desktop marks the shown row with `AccentBar`, a phone outlines only the tapped row (`Outline`). From invoice-web (INV-EXTRACT-1 W12).
|
|
7
|
+
|
|
8
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
## 1.49.2
|
|
11
|
+
- Breadcrumb and UnderlineTabs take an optional `accessibilityHint`, passed to the strip element.
|
|
12
|
+
|
|
13
|
+
## 1.49.1
|
|
14
|
+
- IdChip: `value` may be null or empty; the chip then copies nothing, is disabled and hides the copy glyph (was: copied the placeholder).
|
|
15
|
+
|
|
16
|
+
MODC-1 D-MC-641 "One page layout for all pages", UI-ATOMIC-1.
|
|
17
|
+
|
|
18
|
+
- New organism `SectionIndexLayout`: from `SECTION_INDEX_BREAKPOINT` (1024) an "On this page" index (molecule `SectionIndex`) beside every section stacked, a press scrolls to its section; below it a wrapping row of chips (molecule `SectionChips`) shows one section at a time, the first by default, so nothing is removed. Hit boxes >= 44 px; labels are pre-localized props. Options, defaults keep the plain behaviour: `density` (`SectionDensity` comfortable or dense gaps), `stickyIndex` (web, default false), `chipOverflow` (`ChipOverflow` wrap or scroll).
|
|
19
|
+
|
|
20
|
+
## 1.44.0
|
|
21
|
+
|
|
22
|
+
MODC-1 "Module C unified console" (AC-UI-1, AC-UI-7), UI-ATOMIC-1 "Reuse first, extract what is new, layer atom / molecule / organism".
|
|
23
|
+
|
|
24
|
+
- `StatusBadge` takes `tone` (`BadgeTone`: neutral, info, success, warning, danger) with the fill from the theme scale main (or deep) step and the ink from `resolveOnBrand`, so text is >= 4.5:1; `color` / `backgroundColor` are now optional and still win when passed. A tone no theme fill can carry falls back to theme text on the elevated surface. ui-tables `StatusTone` is to map onto `BadgeTone`.
|
|
25
|
+
- New atom `CountBadge`: a count pill capped as `max+` (default 99), hidden at zero unless `showZero`, tone from `BadgeTone`. Plain text, no live region; new i18n key `common.countBadgeLabel` (`{{p1}}` = count).
|
|
26
|
+
- New organism `SplitPanes`: two panes side by side or stacked (`SplitLayout` auto / stack / side); side by side each pane has `minWidth: 0` so its text wraps at 360 (TEXT-FIT-1).
|
|
27
|
+
|
|
28
|
+
## 1.39.0
|
|
29
|
+
|
|
30
|
+
INVOICE-6 "Ready-to-send invoice emails with contacts and a sent log", UI-COMPOSE-1 "Extract shared UI from the start": extracted from invoice-web.
|
|
31
|
+
|
|
32
|
+
- New `SideSheet`: a panel from the bottom on a phone and from the right at the wide breakpoint, with `title`, a scrollable body and a required `footer` slot. Closes on scrim, Escape and hardware back; traps focus, names the initial focus with `initialFocusTestID`, returns focus to the opener and locks page scroll.
|
|
33
|
+
- New `LAYOUT_TEST_IDS.sideSheet`.
|
|
34
|
+
|
|
35
|
+
## 1.38.2
|
|
36
|
+
|
|
37
|
+
DROPDOWN-WIDTH-1 "A menu opened from a compact trigger is wide enough to read".
|
|
38
|
+
|
|
39
|
+
- `ModalDropdown` with `renderTrigger` and no `menuMinWidth`: the inline menu is now at least 160px wide. An explicit `menuMinWidth` still wins; a default-trigger field keeps its trigger width.
|
|
40
|
+
|
|
41
|
+
## 1.37.0
|
|
42
|
+
|
|
43
|
+
INVOICE-FU-9 "INVOICE-5 shared look leftovers", AC-PAGE-1.
|
|
44
|
+
|
|
45
|
+
- New `PageFrame`: lays children out at a fixed page size (`A4_PAGE` 794x1123 by default, `pageSize` configurable) and scales the page down to the container width, never up, so line breaks match the printed page.
|
|
46
|
+
- New `pageScale` / `scaledFrame` helpers for the scale math.
|
|
47
|
+
|
|
48
|
+
## 1.34.0
|
|
49
|
+
|
|
50
|
+
INVOICE-3 "Invoice interface over a user-chosen folder": extracted from invoice-web.
|
|
51
|
+
|
|
52
|
+
- New `AppText` + `TextKind`: text in six fixed sizes.
|
|
53
|
+
- New `ScreenColumn`: the bounded, centred column a screen sits in.
|
|
54
|
+
- New `useIsWideViewport`: the hook form of `isWideWebViewport`.
|
|
55
|
+
- `Section` gains `variant` (`SectionVariant.Card`), `testID`, and `style` widened to `StyleProp<ViewStyle>`. Default look unchanged.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## 1.32.0
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
|
|
62
|
+
- `StatusBadge` `icon`: an optional decorative slot before the label. INVOICE-3 "Invoice interface over a user-chosen folder".
|
|
63
|
+
- `StickyPreview`: sticks to the top of the visible viewport; shows its `full` slot, or its `compact` slot once scrolled past, while the on-screen keyboard is open, or on `forceCompact`.
|
|
64
|
+
- `useVisibleViewport`, `isKeyboardOpen`: read the Visual Viewport offset and keyboard state.
|
|
65
|
+
|
|
66
|
+
## 1.30.0
|
|
67
|
+
|
|
68
|
+
### Added
|
|
69
|
+
|
|
70
|
+
- `ModalDropdown` `menuHeading`: a visible, non-focusable heading (role heading) at the top of the open
|
|
71
|
+
menu or modal; it also becomes the menu's accessible name. KEFI-EDITOR-HEADER-1 "Compact the landing editor header".
|
|
72
|
+
|
|
73
|
+
## 1.29.0
|
|
74
|
+
|
|
75
|
+
### Added
|
|
76
|
+
|
|
77
|
+
- `Modal` `initialFocusTestID`: the testID of the control focused when the dialog opens (web), for
|
|
78
|
+
FOCUS-1 "Every screen names its initial focus". `useFocusTrap` takes it as an optional 3rd argument.
|
|
79
|
+
|
|
80
|
+
### Fixed
|
|
81
|
+
|
|
82
|
+
- `useFocusTrap` no longer steals focus from a child that set `autoFocus`: the first-focusable
|
|
83
|
+
fallback runs only when focus is not already inside the dialog (kefi-web create-attendee modal
|
|
84
|
+
opened on its close button). Focus restore on close skips an element that lives inside the dialog.
|
|
85
|
+
|
|
86
|
+
## 1.26.3
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
|
|
90
|
+
- `ModalDropdown` / `InlineMenu`: a closed-but-still-fading popover was INTERACTIVE for the whole
|
|
91
|
+
120ms exit animation — no `pointerEvents`, no `aria-hidden` — so a fast second click could select
|
|
92
|
+
an option from a menu the user had already dismissed, and screen readers still saw the options.
|
|
93
|
+
The popover now goes inert the instant `isOpen` goes false (`aria-hidden` on the menu node,
|
|
94
|
+
`pointerEvents: 'none'` on the animated wrapper, and the select handler refuses a closed menu).
|
|
95
|
+
The fade is unchanged. Covered by `ModalDropdown.openState.test.tsx` — the fade is held open
|
|
96
|
+
deliberately, since the reduced-motion test harness collapses it to 0ms.
|
|
97
|
+
|
|
98
|
+
## 1.26.2
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
- **`useAnchorTracking` no longer re-renders an open menu whose anchor has not moved.** `readAnchorRect`
|
|
102
|
+
returns a fresh object on every measurement, and the hook wrote it to state unconditionally, so
|
|
103
|
+
`Object.is` never matched and React re-rendered on every scheduled measurement. Because the hook's
|
|
104
|
+
own `ResizeObserver` watches `document.body` — which the menu is portalled into — the re-render
|
|
105
|
+
could re-arm the observer that caused it, giving a self-sustaining loop (`Maximum update depth
|
|
106
|
+
exceeded` under test). In a browser the menu's box never settled, which Playwright reports as
|
|
107
|
+
"element is not stable" and then "element was detached from the DOM"; it broke every click on a
|
|
108
|
+
`navbar-overflow-menu` option. The rect is now compared BY VALUE, so an unmoved anchor writes no
|
|
109
|
+
state. Pinned by `src/ModalDropdown/useAnchorTracking.stability.test.tsx`.
|
|
110
|
+
|
|
111
|
+
## 1.26.1
|
|
112
|
+
|
|
113
|
+
### Fixed
|
|
114
|
+
|
|
115
|
+
- **`ModalDropdown` (popover variant) — a CLOSING menu no longer swallows the next keystroke.**
|
|
116
|
+
`InlineMenu` hard-coded `enabled: true` for `useMenuKeyboard`, so its DOCUMENT-CAPTURE keydown
|
|
117
|
+
listener lived as long as the component was MOUNTED — and `ModalDropdown` deliberately keeps it
|
|
118
|
+
mounted past logical close so the exit fade can play. For that whole window the trigger already
|
|
119
|
+
reported `aria-expanded="false"` while a live handler `preventDefault()`ed and
|
|
120
|
+
`stopPropagation()`ed the user's Enter, so react-native-web's `<button>` never received the
|
|
121
|
+
browser-synthesised click and the menu could not be reopened from the keyboard.
|
|
122
|
+
|
|
123
|
+
The menu's keyboard now follows the owner's LOGICAL open state, threaded down as a new required
|
|
124
|
+
`isOpen` prop on `InlineMenu`, rather than its mount. MOUNTED IS NOT OPEN.
|
|
125
|
+
|
|
126
|
+
Note for anyone extending this: passing `menuAnim.mounted` as `isOpen` reproduces the same bug
|
|
127
|
+
one level up, and there is a test that fails if you do.
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## 1.26.0
|
|
131
|
+
|
|
132
|
+
**New `BuildInfoFooter` — a small, themable "which build am I running?" caption for the portals.**
|
|
133
|
+
|
|
134
|
+
The FE half of the "know what's deployed" work: every RN-web portal can now show a compact,
|
|
135
|
+
unobtrusive footer like `v<buildVersion>` (optionally `· api <sha7>`). `@dloizides/pwa-sw` already
|
|
136
|
+
stamps a per-build `BUILD_VERSION` into the generated service worker, but that value lives only
|
|
137
|
+
inside `service-worker.js` and is not exposed to page runtime — so the component stays dumb and
|
|
138
|
+
takes the build id as a prop (each app inlines it at build time, e.g. `EXPO_PUBLIC_BUILD_VERSION`).
|
|
139
|
+
|
|
140
|
+
- **`BuildInfoFooter`** — props `buildVersion` (required), optional `apiBaseUrl` (best-effort GET
|
|
141
|
+
`${base}/version` → `.commit`, appended as `· api <sha7>`; any failure silently shows the version
|
|
142
|
+
alone), optional `apiCommit` (skip the fetch), `fetchImpl` (test seam), plus the usual `testID` /
|
|
143
|
+
`accessibilityLabel` / `accessibilityHint` / `style`. Muted caption via the theme's
|
|
144
|
+
`textSecondary` — no raw colours.
|
|
145
|
+
- New exports: `formatBuildInfo`, `shortenCommit`, `trimTrailingSlash`, `useApiCommit`,
|
|
146
|
+
`BUILD_INFO_PREFIX`, `API_COMMIT_SEPARATOR`, `VersionResponse`.
|
|
147
|
+
- New kit i18n key `LAYOUT_I18N.buildInfoHint` (`common.buildInfoHint`) and testID
|
|
148
|
+
`LAYOUT_TEST_IDS.buildInfoFooter` (`build-info-footer`).
|
|
149
|
+
|
|
150
|
+
## 1.24.0
|
|
151
|
+
|
|
152
|
+
**The inline dropdown popover now stays inside the viewport — a floored menu can no longer spill off the right edge.**
|
|
153
|
+
|
|
154
|
+
`buildPortalPopoverStyle` positioned the fixed popover at `left: rect.left` with no horizontal
|
|
155
|
+
clamp. That was fine while the menu matched its trigger's width, but a COMPACT trigger with a
|
|
156
|
+
`menuMinWidth` floor (e.g. the `@dloizides/ui-nav` "More ▾" overflow menu, whose trigger sits near
|
|
157
|
+
the right of the bar) opens a menu WIDER than its trigger — which then extended past the right edge
|
|
158
|
+
of the viewport and clipped its lower/right content ("some items get hidden").
|
|
159
|
+
|
|
160
|
+
- **`buildPortalPopoverStyle(rect, minWidth, viewportWidth?)`** takes an optional `viewportWidth`.
|
|
161
|
+
When given, the popover's `left` is clamped so its right edge clears `MENU_VIEWPORT_MARGIN` (8px) —
|
|
162
|
+
sliding it left, right-aligning it to the trigger in the limit — while never crossing the left
|
|
163
|
+
margin. `viewportWidth = 0` (the default, and the native/pure path) keeps the exact prior
|
|
164
|
+
trigger-anchored behaviour, so every existing caller is unchanged.
|
|
165
|
+
- **`InlineMenu`** passes `window.innerWidth` on web (re-read whenever the tracked trigger rect
|
|
166
|
+
re-measures on scroll/resize); native is untouched.
|
|
167
|
+
- New export `MENU_VIEWPORT_MARGIN`.
|
|
168
|
+
|
|
169
|
+
## 1.23.0
|
|
170
|
+
|
|
171
|
+
**Modals, the dropdown popover and the accordion body now ANIMATE on web — adopts `@dloizides/ui-motion`.**
|
|
172
|
+
|
|
173
|
+
On react-native-web, RN's `Modal animationType` and `LayoutAnimation` are effectively no-ops, so
|
|
174
|
+
`Modal`, `ModalShell`, the `ModalDropdown` popover and the `Accordion` body all SNAPPED open/closed
|
|
175
|
+
on the web build (all 7 portals). This wires those surfaces to `@dloizides/ui-motion`, which drives
|
|
176
|
+
enter/exit with RN `Animated` (works on web AND native) and collapses every animation to instant
|
|
177
|
+
under the OS "reduce motion" preference. **No public APIs changed** — every prop, testID and a11y
|
|
178
|
+
attribute is identical; this is a purely visual upgrade.
|
|
179
|
+
|
|
180
|
+
- **`Modal`** — the backdrop now **fades** (opacity) and the panel **fades + scales in** (0.96→1) on
|
|
181
|
+
open, reversing on close, via `useEnterExit`. The RN `Modal` host is kept **mounted through the
|
|
182
|
+
exit** (driven by `useEnterExit`'s `mounted` flag, not `visible`) so the close animation can play
|
|
183
|
+
instead of the host unmounting instantly — the trick that made `animationType` a no-op on web. The
|
|
184
|
+
scrim moved to its own animated layer behind the tap-catcher; close-on-backdrop, Escape, focus
|
|
185
|
+
trap, scroll-lock and every testID are unchanged.
|
|
186
|
+
- **`ModalShell`** — the full-screen sheet **fades + scales in** on open (replacing the native-only
|
|
187
|
+
`animationType="slide"`), mounted through the exit the same way.
|
|
188
|
+
- **`ModalDropdown`** — the popover (the inline anchored menu on web-desktop, the centered modal on
|
|
189
|
+
mobile/native) **fades + scales in** from the anchor on open (`transformOrigin: top`), with a snappy
|
|
190
|
+
~120ms curve so the close reads as near-instant. `useAnchorTracking`, the web portal, keyboard nav
|
|
191
|
+
and outside-click detection are untouched (the fade/scale rides an INNER wrapper so the popover's
|
|
192
|
+
own DOM node — which the outside-click/portal logic depends on — is unchanged).
|
|
193
|
+
- **`Accordion`** — the item body now renders inside ui-motion's **`<Collapse>`** (measured, animated
|
|
194
|
+
height) instead of RN `LayoutAnimation`, so the body animates on web too. The chevron rotation is
|
|
195
|
+
unchanged. Behaviour note: `<Collapse>` keeps the body **mounted at all times** (clipped to height 0
|
|
196
|
+
when closed) so `aria-controls` always resolves and screen readers reach the content — the open
|
|
197
|
+
state is conveyed by the header's `aria-expanded` (the value handed to `<Collapse open>`). The
|
|
198
|
+
internal `accordionAnimation.ts` (`LayoutAnimation` helper) was removed.
|
|
199
|
+
- **New dependency `@dloizides/ui-motion` (`^1.0.1`)** — the shared RN/RN-web motion kit
|
|
200
|
+
(`useEnterExit`, `Collapse`, reduced-motion-aware).
|
|
201
|
+
|
|
202
|
+
Additive and back-compatible for consumers. Covered by the existing `Modal`, `ModalShell`,
|
|
203
|
+
`ModalDropdown` (web + native) and `Accordion` suites; the accordion tests now assert open state via
|
|
204
|
+
`aria-expanded`/the `Collapse` container rather than body-text presence (the body is always mounted).
|
|
205
|
+
The Jest env is pinned to reduced-motion so enter/exit resolve synchronously in tests.
|
|
206
|
+
|
|
207
|
+
## 1.22.0
|
|
208
|
+
|
|
209
|
+
**Two shared modal primitives: a themed centered `Modal` dialog and a `ConfirmDialog` popup.**
|
|
210
|
+
|
|
211
|
+
Until now the kit had no shared centered dialog — only `ModalShell` (a full-screen slide-up sheet)
|
|
212
|
+
and `ModalDropdown` (a selector). Each portal hand-rolled its own edit dialog (e.g. kefi-web's
|
|
213
|
+
`PromoterActionModal`) and confirmed destructive actions with an ugly inline table row. These two
|
|
214
|
+
primitives replace both, so all 7 portals share one accessible, themed implementation.
|
|
215
|
+
|
|
216
|
+
- **New component `Modal`** — a centered dialog overlay for RN + RN-web: a scrim, a rounded themed
|
|
217
|
+
surface, an optional header (`title` + a top-right **✕ close** — a 44dp `IconButton` with a web
|
|
218
|
+
`tooltip`/aria-label "Close"), a scrollable body (`children`), and an optional `footer`. Dismissal
|
|
219
|
+
funnels to `onClose` from four routes: the ✕, a **backdrop** press, **Escape** on web
|
|
220
|
+
(`useEscapeKey`), and the hardware back button on native (RN `Modal`'s `onRequestClose`). It is
|
|
221
|
+
`role="dialog"` + `aria-modal` (`accessibilityViewIsModal`), **focus-trapped** on web
|
|
222
|
+
(`useFocusTrap`, restoring focus to the opener on close) and **scroll-locked** (`useScrollLock`).
|
|
223
|
+
Props: `visible`, `onClose`, `title?`, `children?`, `footer?`, `size?` (`sm`/`md`/`lg`, default
|
|
224
|
+
`md`), `showClose?` (default `true`), `testID?` (default `modal`), `accessibilityLabel?`. testIDs:
|
|
225
|
+
`${testID}-close`, `${testID}-backdrop`. All colours read from `useUi()` — no raw literals.
|
|
226
|
+
- **New component `ConfirmDialog`** — built ON `Modal`, for confirmations. Renders the `message`
|
|
227
|
+
plus a Cancel + Confirm button row (from `@dloizides/ui-buttons`). `destructive` paints the
|
|
228
|
+
Confirm with the `danger` (red) variant for irreversible actions. **Cancel is first in the DOM so
|
|
229
|
+
the focus trap lands on the SAFE action**; the ✕ is hidden (Cancel is the explicit dismiss). While
|
|
230
|
+
`busy`, Confirm shows a spinner and Cancel is disabled. Cancel / backdrop / Escape → `onCancel`.
|
|
231
|
+
Props: `visible`, `title`, `message`, `confirmLabel?`, `cancelLabel?`, `destructive?`, `onConfirm`,
|
|
232
|
+
`onCancel`, `busy?`, `testID?` (default `confirm-dialog`). testIDs: `${testID}-confirm`,
|
|
233
|
+
`${testID}-cancel`, `${testID}-message`.
|
|
234
|
+
- **New exported type `ModalSize`** (`'sm' | 'md' | 'lg'`) — a plain string union (matching the
|
|
235
|
+
kit's `ButtonSize` convention; no `const enum` crosses the package boundary).
|
|
236
|
+
- **New i18n keys** the host must provide: `common.close` (✕ label), plus for `ConfirmDialog`
|
|
237
|
+
defaults `common.confirm` / `common.confirmHint` / `common.cancel` / `common.cancelHint`. Reuses the
|
|
238
|
+
existing `common.closeDialogHint`, `common.dialog`, `common.dismissDropdown(Hint)` keys.
|
|
239
|
+
- **New peer dependency `@dloizides/ui-buttons` (`>=1.8.0`)** — `ConfirmDialog` reuses its `Button`,
|
|
240
|
+
`Modal` reuses its `IconButton` for the ✕, rather than reinventing button chrome.
|
|
241
|
+
|
|
242
|
+
Additive: `ModalShell`, `ModalDropdown` and every existing export/selector are untouched. Covered by
|
|
243
|
+
`Modal.test.tsx`, `ConfirmDialog.test.tsx`, `useEscapeKey.test.ts`, `useScrollLock.test.ts`.
|
|
244
|
+
|
|
245
|
+
> Note: `@dloizides/ui-feedback` also exports a lighter `ConfirmDialog` (no ✕ / Escape / focus-trap,
|
|
246
|
+
> own buttons). This ui-layout one is the richer, `Modal`-based dialog the portals should adopt.
|
|
247
|
+
|
|
248
|
+
## 1.21.0
|
|
249
|
+
|
|
250
|
+
**The collapsed `Tabs` menu can now present as a HAMBURGER (☰) — the universal mobile-nav affordance.**
|
|
251
|
+
|
|
252
|
+
The collapsed organizer nav reads better on a phone as a ☰ hamburger than as a caret field.
|
|
253
|
+
This adds an opt-in so a consumer can choose either presentation; the default is unchanged.
|
|
254
|
+
|
|
255
|
+
- **New opt-in prop `ModalDropdown.showHamburger?: boolean` (default `false`).** When set, the
|
|
256
|
+
DEFAULT trigger renders a ☰ glyph LEADING the active option's label, with the same bordered
|
|
257
|
+
field box, theme tokens and ≥44dp (`MIN_TOUCH_TARGET`) hit target as the caret variant. It
|
|
258
|
+
**takes precedence over `showCaret`** (a hamburger already IS the "this is a menu" cue, so the
|
|
259
|
+
trailing caret would be redundant) and, like `showCaret`, is ignored when a custom `renderTrigger`
|
|
260
|
+
is supplied. The glyph is a font character (U+2630) — no icon package enters this contract-pure
|
|
261
|
+
kit — and its colour comes from `colors.textSecondary` (no raw literals). It is decorative: the
|
|
262
|
+
trigger's `aria-label` still names the control, so screen readers do not announce the glyph.
|
|
263
|
+
- **New exported enum `TabsCollapsedTrigger { Caret, Hamburger }`** + new optional prop
|
|
264
|
+
**`Tabs.collapsedTrigger` / `TabsMenu.collapsedTrigger` (default `Caret`).** Selects how the
|
|
265
|
+
COLLAPSED (mobile) tab menu trigger presents; only affects the collapsed form, the wide pill
|
|
266
|
+
strip is identical either way. Exported as a regular (runtime) enum for the same reason as
|
|
267
|
+
`DropdownVariant` — a `const enum` cannot cross the published-package boundary under
|
|
268
|
+
`isolatedModules`.
|
|
269
|
+
|
|
270
|
+
Backward-compatible: two new optional props + one new enum, all defaulting to the prior behaviour;
|
|
271
|
+
no testID/selector changes. Per-tab E2E selectors (`{idPrefix}-menu` trigger, `{idPrefix}-tab-{key}`
|
|
272
|
+
/ descriptor option testIDs) are untouched. No new i18n keys (the existing `common.tabsMenuHint`
|
|
273
|
+
serves both presentations). Covered by component tests (`ModalDropdown.test.tsx`,
|
|
274
|
+
`Tabs.collapsed.test.tsx`).
|
|
275
|
+
|
|
276
|
+
## 1.20.0
|
|
277
|
+
|
|
278
|
+
**The collapsed `Tabs` menu now READS as a menu — a caret affordance + guaranteed focus.**
|
|
279
|
+
|
|
280
|
+
On the live phone-width organizer nav (`app.kefi.dloizides.com/organizer/passes`) the
|
|
281
|
+
collapsed trigger showed only the active label ("Passes") with no menu cue — styled like a
|
|
282
|
+
static chip/pill — so users could not tell it was a section switcher. This adds a clear
|
|
283
|
+
menu affordance and locks in keyboard focusability.
|
|
284
|
+
|
|
285
|
+
- **New opt-in prop `ModalDropdown.showCaret?: boolean` (default `false`).** When set, the
|
|
286
|
+
DEFAULT trigger renders a ▾ caret pinned to its trailing edge that rotates to point up
|
|
287
|
+
while the menu is open, with a ≥44dp (`MIN_TOUCH_TARGET`) hit target and the existing
|
|
288
|
+
bordered field box + theme tokens. **Every existing field-style dropdown in the kit is
|
|
289
|
+
unchanged** because the caret is off by default, and it is ignored when a custom
|
|
290
|
+
`renderTrigger` is supplied (that caller owns its own visuals). The caret is a font glyph
|
|
291
|
+
(U+25BE), so no icon package enters this contract-pure kit, and its colour comes from
|
|
292
|
+
`colors.textSecondary` (no raw literals). It is decorative — the trigger's `aria-label`
|
|
293
|
+
still names the control, so screen readers do not announce the glyph.
|
|
294
|
+
- **`TabsMenu` opts into `showCaret`**, so the collapsed `Tabs` section switcher now looks
|
|
295
|
+
like a proper control instead of a chip. No change to the public `Tabs` / `TabsMenu` API.
|
|
296
|
+
- **Focusability:** under react-native-web the trigger renders as a native `<button>`
|
|
297
|
+
(role=button, no `tabindex="-1"`), so it is keyboard-reachable and Enter/Space activate
|
|
298
|
+
it. A regression test asserts the collapsed trigger is not `tabindex="-1"`. (The
|
|
299
|
+
`tabindex="-1"` seen on the live DOM came from the older deployed version; it does not
|
|
300
|
+
reproduce on this source — proven by the rendered-DOM assertion, not assumed.)
|
|
301
|
+
|
|
302
|
+
Backward-compatible: one new optional prop, no testID/selector changes. Per-tab E2E
|
|
303
|
+
selectors (`{idPrefix}-menu` trigger, `{idPrefix}-tab-{key}` / descriptor option testIDs)
|
|
304
|
+
are untouched. No new i18n keys.
|
|
305
|
+
|
|
306
|
+
`ui-showcase` does not yet import `Tabs`/`ModalDropdown` (only `SegmentedControl`,
|
|
307
|
+
`CopyableId`, `TruncatedText`), so this is covered by component tests
|
|
308
|
+
(`ModalDropdown.test.tsx`, `Tabs.collapsed.test.tsx`); a showcase specimen is a follow-up.
|
|
309
|
+
|
|
310
|
+
## 1.19.0
|
|
311
|
+
|
|
312
|
+
**`Tabs` collapses to a real mobile menu below a breakpoint.**
|
|
313
|
+
|
|
314
|
+
On a phone the horizontal pill strip "is not a real menu and not mobile friendly" — a
|
|
315
|
+
scrolling chip row is hard to use with 7–8 tabs (the kefi organizer dashboard:
|
|
316
|
+
Overview / Passes / Attendees / Promoters / Door / Ledger / Messaging / Settings). `Tabs`
|
|
317
|
+
now renders responsively:
|
|
318
|
+
|
|
319
|
+
- **Wide (>= `collapseBelow`, default 768, web only):** the existing horizontal
|
|
320
|
+
`role=tablist` / `role=tab` strip — unchanged, fully backward-compatible.
|
|
321
|
+
- **Narrow (< breakpoint) or native:** a genuine menu — a trigger button showing the
|
|
322
|
+
active section that opens a vertical list of all sections. Delegates to the kit's
|
|
323
|
+
existing `ModalDropdown` (menu/listbox semantics, focus trap, dismiss backdrop, dual-
|
|
324
|
+
platform a11y) rather than reimplementing a dropdown.
|
|
325
|
+
|
|
326
|
+
Backward-compatible: the public API is unchanged except one new optional prop,
|
|
327
|
+
`collapseBelow?: number` (default = the shared kit breakpoint, 768; pass `0` to keep the
|
|
328
|
+
row on any web width, or a large number to force the menu). The collapse threshold reuses
|
|
329
|
+
the SAME viewport rule (`MENU_BREAKPOINT`) that `ModalDropdown` uses for its menu-vs-modal
|
|
330
|
+
split, so the whole layout kit changes shape at one consistent breakpoint.
|
|
331
|
+
|
|
332
|
+
**E2E survival:** per-tab selectors keep working in BOTH modes. Each collapsed menu row's
|
|
333
|
+
`testID` is the tab descriptor's own `testID` when supplied, otherwise the same
|
|
334
|
+
`{idPrefix}-tab-{key}` pattern the wide strip uses for its tab element ids (the menu must
|
|
335
|
+
be opened first, as with any select). Requires one new host i18n key,
|
|
336
|
+
`common.tabsMenuHint` (the accessible hint on the collapsed trigger).
|
|
337
|
+
|
|
338
|
+
## 1.17.0
|
|
339
|
+
|
|
340
|
+
**New `Tabs` primitive — a controlled tabbed section shell.**
|
|
341
|
+
|
|
342
|
+
Adds `Tabs`: a wrapping/scrolling pill tab strip plus the active tab's panel, wired
|
|
343
|
+
as a proper `tablist` / `tab` / `tabpanel` (aria-selected, aria-controls,
|
|
344
|
+
aria-labelledby). Controlled (`activeKey` + `onChange`), so the selected tab can be
|
|
345
|
+
driven from a route param or storage. Labels are pre-localized strings; colours read
|
|
346
|
+
from the `@dloizides/ui-feedback` theme (no FM/router/store imports), consistent with
|
|
347
|
+
the rest of the kit.
|
|
348
|
+
|
|
349
|
+
Extracted so the seven portals share ONE tab shell instead of hand-rolling a bar per
|
|
350
|
+
app — first consumer is the kefi-web organizer dashboard, split from one enormous page
|
|
351
|
+
into menu tabs.
|
|
352
|
+
|
|
353
|
+
## 1.16.1
|
|
354
|
+
|
|
355
|
+
**`Heading` supports levels 1-6 instead of `<h1>` only.**
|
|
356
|
+
|
|
357
|
+
`Heading` rendered `<h1>` unconditionally, so any screen needing sub-structure either
|
|
358
|
+
shipped multiple `<h1>`s or avoided the component. The Digital Kin guide editor did the
|
|
359
|
+
latter — styled `<Text>` instead — and shipped **zero headings**: measured on the live
|
|
360
|
+
CMS, `document.querySelectorAll('h1,h2,h3,h4,h5,h6').length === 0` for the entire page.
|
|
361
|
+
|
|
362
|
+
So there was no `<h1>` naming the guide being edited and nothing marking the steps
|
|
363
|
+
section. Screen-reader users could not navigate by heading, and styling was standing in
|
|
364
|
+
for structure.
|
|
365
|
+
|
|
366
|
+
After: `h1` names the guide, `h2` marks the steps section, `h3` per step.
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
## 1.15.1
|
|
370
|
+
|
|
371
|
+
- **Fix (`CopyableId` truncated the value with room to spare).** 1.15.0 gave the value wrapper
|
|
372
|
+
`flexShrink: 1`, which makes it SHRINK-WRAP its content — so the width the component measures to
|
|
373
|
+
decide how much to show was derived from the very string it was computing: truncate → wrapper
|
|
374
|
+
narrows → re-measure smaller → truncate harder. Verified in Chrome via `apps/ui-showcase`: a
|
|
375
|
+
506px-wide container and a 306px one rendered the SAME 196px string, i.e. a 36-character GUID was
|
|
376
|
+
cut to 26 characters with ~300px going unused.
|
|
377
|
+
|
|
378
|
+
The wrapper is now `flex: 1`, so it fills the row's leftover width and its size is independent of
|
|
379
|
+
its content. Re-verified at four widths: 520px and 320px now render the full 36-character GUID
|
|
380
|
+
untruncated; 200px and 120px middle-truncate with both ends intact, and nothing overflows.
|
|
381
|
+
|
|
382
|
+
This is the SAME failure mode `useAvailableWidth` documents for `TruncatedText` (measure the
|
|
383
|
+
parent, never the element, or the output feeds back into the input) — reintroduced one level up
|
|
384
|
+
by the new wrapper. Unit tests cannot catch it: the truncation helpers are pure and passed
|
|
385
|
+
throughout, and jsdom reports zero widths, so only a real browser shows it.
|
|
386
|
+
|
|
387
|
+
- **New: `CopyableId` accepts `style`** for its outer container. Hosts need this to give the
|
|
388
|
+
control a width that does not derive from its own content (a `flexBasis`, a `width`, or
|
|
389
|
+
`flex: 1`) — without one, a shrink-to-fit parent reintroduces the feedback loop above at the
|
|
390
|
+
host level. Documented on the prop.
|
|
391
|
+
|
|
392
|
+
## 1.15.0
|
|
393
|
+
|
|
394
|
+
- **New: `CopyableId`** — show a long machine identifier (a GUID, a reference, a correlation id)
|
|
395
|
+
so a human can both READ enough of it to tell two apart and TAKE it in one action. Composes the
|
|
396
|
+
existing `TruncatedText`, so the middle-truncation work is reused rather than re-derived.
|
|
397
|
+
|
|
398
|
+
Driven by the AML console needing to surface a screening ID an analyst can copy and re-screen
|
|
399
|
+
with, but it is deliberately domain-free: every portal has identifiers it currently either hides
|
|
400
|
+
or dumps raw into a table cell.
|
|
401
|
+
|
|
402
|
+
Three things this gets right that a naive copy button does not:
|
|
403
|
+
|
|
404
|
+
1. **It copies the FULL value, never the display string.** A truncated GUID that a user
|
|
405
|
+
hand-selects yields `3f2a9c81…d4e7`, ellipsis and all, which silently fails wherever it is
|
|
406
|
+
pasted. Showing a truncated identifier with no copy affordance is strictly WORSE than not
|
|
407
|
+
showing it. The full value is always the accessible name and the web tooltip.
|
|
408
|
+
2. **Middle truncation, not tail.** Two GUIDs from one table share a prefix far more often than
|
|
409
|
+
intuition suggests, and `numberOfLines={1}` renders them IDENTICALLY. The tail is what tells
|
|
410
|
+
them apart, so both ends survive.
|
|
411
|
+
3. **A failed copy is SHOWN, not swallowed.** `navigator.clipboard` is not merely unreliable —
|
|
412
|
+
it is `undefined` outside a secure context, which is how every staging box and LAN preview in
|
|
413
|
+
this fleet is served, i.e. exactly where people hand-test. `copyText` therefore falls back to
|
|
414
|
+
`document.execCommand` over an off-screen textarea, and returns a boolean rather than
|
|
415
|
+
assuming. On total failure the control renders a distinct `common.copyFailed` state; a silent
|
|
416
|
+
failure would leave the user believing they hold an identifier they do not.
|
|
417
|
+
|
|
418
|
+
The status is carried in the control's accessible **NAME**, not its hint, because
|
|
419
|
+
`accessibilityHint` is dropped by react-native-web and never reaches the DOM — a screen-reader
|
|
420
|
+
user would otherwise get no confirmation at all.
|
|
421
|
+
|
|
422
|
+
No native clipboard dependency is taken. Hosts on React Native inject a `writer`
|
|
423
|
+
(`Clipboard.setString`); an injected writer that throws falls through to the DOM paths.
|
|
424
|
+
|
|
425
|
+
New `LAYOUT_I18N` keys — hosts binding a missing-key guard to that map (as aml-v2 does) will
|
|
426
|
+
fail their catalog test until these are defined: `common.copy`, `common.copyHint`,
|
|
427
|
+
`common.copied`, `common.copyFailed`, `common.copyableIdHint`.
|
|
428
|
+
|
|
429
|
+
## 1.12.2
|
|
430
|
+
|
|
431
|
+
- **Fix (`TruncatedText` STILL did not middle-truncate; 1.12.1's fix was the wrong mechanism).**
|
|
432
|
+
1.12.1 moved the `onLayout` measurement from the `<Text>` to a wrapping `<View>`. Verified in
|
|
433
|
+
Chrome: that did not fire either, and neither did a `ResizeObserver` on the same node — zero
|
|
434
|
+
callbacks from all three mechanisms under react-native-web 0.21.
|
|
435
|
+
|
|
436
|
+
Width now comes from `useAvailableWidth`, which on web reads the **parent's** inner width
|
|
437
|
+
straight off the DOM in a ref callback, plus a `resize` listener. The parent is measured
|
|
438
|
+
rather than the element because the element shrink-wraps its own text, so measuring it would
|
|
439
|
+
feed the output back into the input and oscillate. Native keeps `onLayout`, where it works.
|
|
440
|
+
|
|
441
|
+
Confirmed in Chrome at four container widths — the same URL renders as
|
|
442
|
+
`timesofindia.indiatimes.com/cit…ties/articleshow/114237788.cms` (520px) down to
|
|
443
|
+
`timeso…88.cms` (120px), with no element exceeding its container at either a 1400px or a
|
|
444
|
+
420px viewport.
|
|
445
|
+
|
|
446
|
+
Note for anyone extending this: unit tests cannot catch this class of bug here. The
|
|
447
|
+
truncation helpers are pure and passed throughout all three versions; what was broken was
|
|
448
|
+
whether the measurement ever ran in a real browser.
|
|
449
|
+
|
|
450
|
+
## 1.12.1
|
|
451
|
+
|
|
452
|
+
- **Fix (`TruncatedText` did not actually middle-truncate).** 1.12.0 measured its available
|
|
453
|
+
width with `onLayout` **on the `<Text>` itself, which never fires under RN-web**. The width
|
|
454
|
+
stayed 0, the character budget stayed 0, and the component silently fell back to rendering
|
|
455
|
+
the full string — i.e. to exactly the tail-only CSS ellipsis it exists to replace. It
|
|
456
|
+
compiled, typechecked and passed all its unit tests throughout, because the truncation
|
|
457
|
+
helpers are pure and were never the broken part; only a browser could see it. Measured in
|
|
458
|
+
Chrome at a 120px container: text rendered `timesofindia.indiatimes.com/city/delhi/delhi-…`
|
|
459
|
+
with **no `…` character present** — CSS clipping, not middle truncation.
|
|
460
|
+
|
|
461
|
+
The width is now measured on a wrapping `<View>`, which does fire `onLayout`. The overflow
|
|
462
|
+
guarantee was never affected (the element stayed inside its parent in both versions); what
|
|
463
|
+
was lost was the informative half of the behaviour.
|
|
464
|
+
|
|
465
|
+
## 1.12.0
|
|
466
|
+
|
|
467
|
+
- **New: `TruncatedText`** — a single-line text/link that middle-truncates to fit its container
|
|
468
|
+
and cannot overflow at any width. Promoted out of the AML console, where a full adverse-media
|
|
469
|
+
article URL rendered as raw `<Text>` and blew out its table row.
|
|
470
|
+
|
|
471
|
+
Three things that look like they would solve this and do not, all verified against
|
|
472
|
+
react-native-web 0.21 rather than assumed:
|
|
473
|
+
|
|
474
|
+
1. `numberOfLines={1}` alone truncates at the **tail** (RN-web compiles it to
|
|
475
|
+
`text-overflow: ellipsis`). Every URL from one publisher then collapses to the same
|
|
476
|
+
`timesofindia.indiatimes.com/city/de…` prefix and the reader cannot tell the articles
|
|
477
|
+
apart. There is no CSS for middle truncation, so it is computed in JS.
|
|
478
|
+
2. `title={full}` is **silently dropped** — RN-web's `<Text>` forwards only `href`, `lang`
|
|
479
|
+
and `pointerEvents` beyond the shared whitelist. The tooltip is set on the host node
|
|
480
|
+
through a ref instead.
|
|
481
|
+
3. JS truncation alone can mis-estimate an unusual glyph mix, so `numberOfLines={1}` is ALSO
|
|
482
|
+
applied as a hard backstop. Overflow is impossible by construction, not by tuning.
|
|
483
|
+
|
|
484
|
+
The full value always stays reachable — as the accessible name and, on web, the native
|
|
485
|
+
tooltip. Also exported: the pure `truncateMiddle` / `formatUrlForDisplay` helpers and
|
|
486
|
+
`ELLIPSIS`.
|
|
487
|
+
|
|
488
|
+
## 1.11.0
|
|
489
|
+
|
|
490
|
+
- **Fix (HIGH — 1.10.0's out-of-view close never fired in the real runtime).** 1.10.0 added
|
|
491
|
+
"close the menu once the trigger leaves the viewport". Repositioning worked, but the close was
|
|
492
|
+
measured **against the viewport**, and **RN-web apps never scroll the document** — every screen
|
|
493
|
+
renders inside a `ScrollView`, so scrolling happens in an inner `<div>` and `window.scrollY`
|
|
494
|
+
stays 0 forever. A trigger scrolled out of that inner scroller is invisible to the user while its
|
|
495
|
+
rect sits comfortably inside the viewport, so the check could not fire on any screen of any
|
|
496
|
+
portal. Measured in Chrome: trigger at `top: -37` (fully above the scroller), menu still rendered.
|
|
497
|
+
Visibility is now measured against the **clip window** — the viewport intersected with every
|
|
498
|
+
clipping ancestor — which is what makes it work inside an inner scroll container.
|
|
499
|
+
- **Fix: "entirely out of view" was also the wrong threshold.** When a scroll container reaches the
|
|
500
|
+
end of its range the trigger stops with a few pixels still showing (4px in the reported case), so
|
|
501
|
+
"fully out" was *unreachable* and the menu never closed however far the user scrolled. There is
|
|
502
|
+
now a minimum-visible-pixel floor (`MIN_VISIBLE_PX`).
|
|
503
|
+
- **Guard: the menu never closes on its FIRST measurement**, so opening a dropdown whose trigger is
|
|
504
|
+
already partly clipped still works; only movement after opening can close it.
|
|
505
|
+
- **The zero-area "not laid out yet" guard is unchanged in intent but now provably size-only** — it
|
|
506
|
+
asks about the element's own box, never its position, so it cannot swallow a genuine hidden case.
|
|
507
|
+
- **New: `LAYOUT_I18N`** — the manifest of every translation key this package resolves, mirroring
|
|
508
|
+
`TABLE_I18N` / `FILTERS_I18N` from `@dloizides/ui-tables` so hosts can bind an existing
|
|
509
|
+
missing-key guard to it with no new pattern. The kit is fallback-free, so a key a host forgets
|
|
510
|
+
reaches users as a raw dotted name; hand-maintained key lists rot (one portal was found missing
|
|
511
|
+
26 kit keys, another had `common.accordionToggleHint` undefined while `Accordion` was mounted).
|
|
512
|
+
Every `t(...)` call in the package now references the map, and the suite fails on a raw key
|
|
513
|
+
literal or a stale entry — so the manifest cannot drift from the code.
|
|
514
|
+
- **Fix: the 1.10.0 CHANGELOG entry was written in cp1252**, leaving the published file invalid
|
|
515
|
+
UTF-8. Re-encoded.
|
|
516
|
+
- **No breaking change.** `LAYOUT_I18N` is additive and the key strings are unchanged, so existing
|
|
517
|
+
translation files keep working untouched.
|
|
518
|
+
|
|
519
|
+
## 1.10.0
|
|
520
|
+
|
|
521
|
+
Two defects found by browser visual QA of the inline dropdown menu against a live app.
|
|
522
|
+
|
|
523
|
+
- **Fix (HIGH, affects every consumer): the open inline menu detached from its trigger.** On web the
|
|
524
|
+
menu is portalled to `document.body` with `position: fixed` at the trigger's measured rect.
|
|
525
|
+
`fixed` is viewport-relative, so that coordinate is only valid until something moves the trigger.
|
|
526
|
+
A `scroll`/`resize` listener on `window` was already in place (since 1.7.0) and does handle plain
|
|
527
|
+
scrolling — but it left three real gaps:
|
|
528
|
+
- **Layout changes that fire no scroll event at all** — an accordion above the trigger expanding,
|
|
529
|
+
a sticky header resizing, a banner appearing, an async list rendering. The trigger moved, nothing
|
|
530
|
+
scrolled, no listener fired, and the menu stayed behind. Now covered by a `ResizeObserver` on the
|
|
531
|
+
anchor and on `document.body`.
|
|
532
|
+
- **The trigger leaving the viewport.** Repositioning cannot help here — the menu just follows its
|
|
533
|
+
trigger off-screen and hangs over unrelated content with nothing on screen explaining it. The
|
|
534
|
+
menu now **closes** once the trigger is fully out of view.
|
|
535
|
+
- **Layout thrash.** The handler ran a synchronous `getBoundingClientRect()` (a forced reflow) plus
|
|
536
|
+
a React state update on *every* scroll event. Work is now coalesced into one
|
|
537
|
+
`requestAnimationFrame` per frame.
|
|
538
|
+
Scroll is now observed in the **capture** phase on `document` rather than `window`, so a scroll in
|
|
539
|
+
any ancestor scroll container counts. Tracking moved into a dedicated `useAnchorTracking` hook.
|
|
540
|
+
Native is unaffected (the popover is in-tree and moves with its anchor).
|
|
541
|
+
- **Fix (a11y): `accessibilityHint` never reached a screen reader.** The prop is part of the public
|
|
542
|
+
API and every caller passes one, but react-native-web does not map it — the trigger carried
|
|
543
|
+
`aria-label` and `aria-expanded` and **no hint of any kind**, so the text was silently thrown away
|
|
544
|
+
(older react-native-web versions additionally leaked it to the DOM, logging
|
|
545
|
+
`React does not recognize the accessibilityHint prop on a DOM element`). On web the hint is now
|
|
546
|
+
rendered into a visually-hidden node referenced by `aria-describedby` — the same wiring
|
|
547
|
+
`@dloizides/ui-forms`' `Field` uses for its error line — and the RN-only prop is no longer passed
|
|
548
|
+
on web at all. Native still receives `accessibilityHint` unchanged.
|
|
549
|
+
- **No API change.** Both fixes are internal; every existing caller benefits without edits.
|
|
550
|
+
|
|
551
|
+
## 1.9.1
|
|
552
|
+
|
|
553
|
+
- **Fix (keyboard a11y, affects every consumer): Enter CLOSED the inline menu instead of SELECTING
|
|
554
|
+
the highlighted option.** The trigger keeps DOM focus while the menu is open, and react-native-web
|
|
555
|
+
maps Enter on a focused Touchable to `onPress`. React dispatches that from its ROOT container
|
|
556
|
+
listener — an ancestor of the trigger, but a *descendant* of `document` — so the menu's BUBBLING
|
|
557
|
+
`document` keydown listener ran second: the trigger toggled the menu shut, React unmounted the
|
|
558
|
+
popover, the effect cleanup removed the very listener the event was still travelling toward, and
|
|
559
|
+
`document` never saw the Enter. Keyboard users could open a dropdown and arrow through it but
|
|
560
|
+
could never CHOOSE with the keyboard (mouse selection was unaffected, which is why it went
|
|
561
|
+
unnoticed).
|
|
562
|
+
- **Fix:** the menu's key handler now runs in the **capture** phase and `stopPropagation`s the keys
|
|
563
|
+
an open menu owns (↑/↓/Home/End/Enter/Escape), so it runs ahead of React's listener and the
|
|
564
|
+
trigger cannot re-toggle behind it. Found while browser-verifying the AML v2 topbar dropdowns.
|
|
565
|
+
|
|
566
|
+
## 1.9.0
|
|
567
|
+
|
|
568
|
+
- **`ModalDropdown`: `menuMinWidth` — a width FLOOR for the open inline menu (additive, optional).**
|
|
569
|
+
The menu matches the TRIGGER's width, which is right for a full-width field but leaves a compact
|
|
570
|
+
anchor (the 1.8.0 `renderTrigger` case: a locale pill, an avatar chip, an icon button) with a menu
|
|
571
|
+
too narrow to read its own option labels — a 52px "EN ▾" pill produced a 52px menu whose rows were
|
|
572
|
+
clipped to a dark strip. `menuMinWidth` floors it; a wider trigger still wins.
|
|
573
|
+
- **Backward-compatible:** omitted, the width is the trigger's, exactly as before.
|
|
574
|
+
|
|
575
|
+
## 1.8.0
|
|
576
|
+
|
|
577
|
+
- **`ModalDropdown`: `renderTrigger` — a custom ANCHOR slot (additive, optional).** The dropdown's
|
|
578
|
+
default trigger is a bordered field box, which is wrong for a *menu* anchored to a compact chip
|
|
579
|
+
(a locale pill, an avatar/user chip, an icon button). Callers can now supply
|
|
580
|
+
`renderTrigger={({ label, isOpen }) => …}` and own the anchor's visuals entirely; the default box
|
|
581
|
+
is then not rendered. The a11y wrapper stays with the dropdown — `role=button`, `aria-expanded`,
|
|
582
|
+
the accessible label + hint, and the `testID` are still applied — so a custom trigger *cannot*
|
|
583
|
+
drop the accessible contract, and the portalled, keyboard-navigable (↑/↓/Home/End/Enter/Escape),
|
|
584
|
+
never-clipped menu comes along for free.
|
|
585
|
+
- **`ModalDropdown`: `optionTestID` — custom per-option testIDs (additive, optional).** Options
|
|
586
|
+
still default to `` `${testID}-option-${value}` ``; a caller turning an existing flat control into
|
|
587
|
+
a dropdown can now keep its established selectors stable
|
|
588
|
+
(`optionTestID={(code) => `lang-${code}`}`).
|
|
589
|
+
- **Backward-compatible:** both props are optional and, when omitted, the render tree is unchanged —
|
|
590
|
+
erevna / katalogos / kefi / agora are unaffected and need no markup changes.
|
|
591
|
+
|
|
592
|
+
## 1.7.1
|
|
593
|
+
|
|
594
|
+
Fix: the modal-variant dismiss backdrop was a pressable WRAPPING the option buttons,
|
|
595
|
+
producing invalid DOM on web ("<button> cannot contain a nested <button>") + a React
|
|
596
|
+
console.error. The backdrop is now an absolute-fill SIBLING behind the dialog — same
|
|
597
|
+
tap-to-dismiss behaviour, no nesting. No API change.
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
## 1.7.0
|
|
601
|
+
|
|
602
|
+
- **`ModalDropdown` inline-menu (`variant={DropdownVariant.Menu}`) z-index / clipping fix.** On
|
|
603
|
+
wide/desktop web the open inline menu painted UNDERNEATH later content (adjacent filter fields,
|
|
604
|
+
the results table, cards) so options were hidden/clipped. Root cause: react-native-web renders
|
|
605
|
+
**every `View`** with `position: relative; z-index: 0`, making each View its own stacking context —
|
|
606
|
+
so the popover's `zIndex: 1000` was trapped inside its anchor / the app's field wrapper and could
|
|
607
|
+
never rise above later-painting siblings.
|
|
608
|
+
- **Fix:** on web the menu is now rendered in a **portal to `document.body`** with `position: fixed`
|
|
609
|
+
at the trigger's measured viewport rect (recomputed on scroll/resize) and a high `zIndex`. A portal
|
|
610
|
+
escapes every ancestor stacking context AND every ancestor `overflow: hidden`, so the menu always
|
|
611
|
+
paints on top and is never clipped — the same "menu above the table" outcome as
|
|
612
|
+
`@dloizides/ui-tables` `SizeDropdown`. The anchor wrapper is also lifted to a raised `zIndex` while
|
|
613
|
+
open (defence-in-depth; the primary lift on native).
|
|
614
|
+
- **Native-safe:** the portal + `document`/`window` listeners are all behind `Platform.OS === 'web'`;
|
|
615
|
+
native keeps the in-tree `position:absolute` popover + `elevation`. `react-dom` is added as an
|
|
616
|
+
**optional** peer (already present in every react-native-web consumer).
|
|
617
|
+
- Outside-click dismissal now consults the portalled popover's own node too, so clicking an option
|
|
618
|
+
still selects (a portalled option is no longer a DOM descendant of the anchor). Keyboard nav
|
|
619
|
+
(↑/↓, Home/End, Enter, Escape), `role="menu"`/`menuitem`, `aria-expanded`/`aria-selected`, and the
|
|
620
|
+
modal variant on narrow/native are all unchanged.
|
|
621
|
+
- **Additive / backward-compatible:** the `ModalDropdown` API is unchanged; erevna / katalogos / kefi
|
|
622
|
+
are unaffected.
|
|
623
|
+
|
|
624
|
+
## 1.6.0
|
|
625
|
+
|
|
626
|
+
- **Accessibility (WCAG 2.1 AA) hardening — additive + backward-compatible.**
|
|
627
|
+
- `AccordionItem`: the rotating chevron (plain) and leading ▸ marker (boxed) are purely
|
|
628
|
+
decorative — the open/closed state is already on the header via `aria-expanded` — so they are
|
|
629
|
+
now `aria-hidden` / `accessibilityElementsHidden` to keep them out of the screen-reader tree.
|
|
630
|
+
- `Accordion`: the expand/collapse `LayoutAnimation` and the chevron rotation now honour
|
|
631
|
+
`prefers-reduced-motion: reduce`, snapping instantly for users who request reduced motion
|
|
632
|
+
(WCAG 2.3.3, web only).
|
|
633
|
+
- `ModalDropdown`: the trigger now also emits `accessibilityState.expanded` (native parity for
|
|
634
|
+
the existing web `aria-expanded`).
|
|
635
|
+
|
|
636
|
+
## 1.5.0
|
|
637
|
+
|
|
638
|
+
- `Accordion` / `AccordionItem` gain a `variant` prop (`'plain' | 'boxed'`, default `'plain'`).
|
|
639
|
+
`plain` is the original borderless look (hairline dividers, right-hand chevron flipping 180° on
|
|
640
|
+
open) — existing consumers render **identically**, no change. `boxed` is the AML v1 console
|
|
641
|
+
`<details>` look: each item is its own bordered, rounded box (spaced by a gap) with a **leading
|
|
642
|
+
▸ marker** that rotates 90° on open and a muted, 600-weight summary. The full API is preserved
|
|
643
|
+
(controlled/uncontrolled, `allowMultiple`, `defaultOpen`, a11y `aria-expanded`/region, the
|
|
644
|
+
open/close LayoutAnimation + chevron rotation). Additive + backward-compatible.
|
|
645
|
+
|
|
646
|
+
## 1.4.0
|
|
647
|
+
|
|
648
|
+
- Add **`SegmentedControl`** — a single rounded pill *track* holding N mutually-exclusive
|
|
649
|
+
segments (the iOS-style segmented / tab toggle). The selected segment lifts onto a raised
|
|
650
|
+
surface (`colors.surface`) with a subtle shadow; the rest stay transparent over the soft
|
|
651
|
+
track (`colors.background`). Promoted from the v1 AML console's `.lf-mode` mode switch so
|
|
652
|
+
erevna/katalogos/kefi share ONE toggle instead of hand-rolling two primary/ghost buttons.
|
|
653
|
+
- **Generic over the value union** (`SegmentedControl<'peps' | 'leaders'>`) for a typed
|
|
654
|
+
`onChange`; each segment carries its own `label` / `value` / optional `testID` +
|
|
655
|
+
`accessibilityLabel` / `accessibilityHint`.
|
|
656
|
+
- **a11y**: the group renders as a `tablist`, each segment as a `tab` with
|
|
657
|
+
`accessibilityState={{ selected }}` (react-native-web forwards `role` + `aria-selected`).
|
|
658
|
+
- **Themed** entirely from the `@dloizides/ui-feedback` theme (surface / background / border /
|
|
659
|
+
text colours); no colour literal except the selected-segment drop shadow.
|
|
660
|
+
- **Additive / backward-compatible**: purely new exports (`SegmentedControl`,
|
|
661
|
+
`SegmentedControlProps`, `SegmentedOption`). Existing consumers are unaffected.
|
|
662
|
+
|
|
663
|
+
## 1.3.0
|
|
664
|
+
|
|
665
|
+
- Add **`Accordion`** + **`AccordionItem`** — a themed expand/collapse disclosure group that
|
|
666
|
+
replaces per-app hand-rolled `<details>` / expanders (AML "More options" + expandable
|
|
667
|
+
matched-candidate rows, Erevna survey groups, Katalogos menu sections…).
|
|
668
|
+
- Compound API: an `Accordion` container owns the open state and shares it with `AccordionItem`
|
|
669
|
+
children via context. Each item = a pressable header (title left, optional `right`
|
|
670
|
+
adornment/badge slot, a rotating chevron) over a collapsible body `region`.
|
|
671
|
+
- **Controlled** (`openIds` + `onOpenChange`) **and uncontrolled** (`defaultOpenIds`, plus
|
|
672
|
+
per-item `defaultOpen`). `allowMultiple` (default `true`) vs single-open. Per-item `disabled`.
|
|
673
|
+
- **a11y**: header is an accessible `button` (`accessibilityRole="button"`,
|
|
674
|
+
`accessibilityState={{ expanded }}`, web `aria-expanded` + `aria-controls`); body is a
|
|
675
|
+
`role="region"`. Renders as a native `<button>`, so **Enter / Space toggle** it.
|
|
676
|
+
- **Themed** entirely from the `@dloizides/ui-feedback` theme (border / surface / text colours),
|
|
677
|
+
no hardcoded palette; renders borderless so it nests inside a `Section` / `Card`.
|
|
678
|
+
- **Animated** open/close via a guarded `LayoutAnimation` (web- and native-safe no-op fallback,
|
|
679
|
+
never throws) + an `Animated` chevron rotation. Hook-safe (lazy `useState`, no ref reads in render).
|
|
680
|
+
- **Additive / backward-compatible**: purely new exports (`Accordion`, `AccordionItem`,
|
|
681
|
+
`AccordionProps`, `AccordionItemProps`). Existing consumers (erevna / katalogos / aml-v2) are
|
|
682
|
+
unaffected.
|
|
683
|
+
|
|
684
|
+
## 1.2.0
|
|
685
|
+
|
|
686
|
+
- `ModalDropdown` can now render as an **inline anchored menu** (native `<select>` feel), not only a
|
|
687
|
+
modal. New `variant?: DropdownVariant` prop (`Menu` | `Modal`) selects the presentation per screen.
|
|
688
|
+
- **Responsive default** (when `variant` is omitted): inline `Menu` on wide/desktop web
|
|
689
|
+
(viewport ≥ 768px), `Modal` on narrow/mobile and on any native platform. An explicit `variant`
|
|
690
|
+
overrides the auto choice.
|
|
691
|
+
- The inline menu anchors under the trigger, is dismissible via click-outside / `Esc`, is
|
|
692
|
+
keyboard-navigable (↑/↓, `Home`/`End`, `Enter`), scrolls when long, and does not push layout.
|
|
693
|
+
The modal path is unchanged. Both variants share the same option-rendering/selection logic
|
|
694
|
+
(`OptionRow`), so nothing is duplicated.
|
|
695
|
+
- **Additive / backward-compatible**: existing `ModalDropdown` callers (erevna / katalogos / aml-v2)
|
|
696
|
+
keep their exact API and now get the inline-on-desktop menu automatically. New export:
|
|
697
|
+
`DropdownVariant` (a runtime enum — deliberately not `const enum`, which cannot cross a published
|
|
698
|
+
package boundary under `isolatedModules`).
|
|
699
|
+
|
|
700
|
+
## 1.1.0
|
|
701
|
+
|
|
702
|
+
- Add `ModalShell` — slide-up full-screen modal with a themed header (title + close) and scrollable body.
|
|
703
|
+
Composes `Heading` (this package) + `SvgIcon` (`@dloizides/ui-icons`). This was the batch-1 deferred
|
|
704
|
+
ModalShell, now landed (ui-icons + Heading both shared). Adds `@dloizides/ui-icons` + `react-native-svg`
|
|
705
|
+
as peers.
|
|
706
|
+
|
|
707
|
+
## 1.0.0
|
|
708
|
+
|
|
709
|
+
Initial release (Capability Wave C1, batch 5 — the ui-layout pivot after full settings-hub proved
|
|
710
|
+
not cleanly extractable). Extracted the proven (erevna+katalogos identical) presentational primitives
|
|
711
|
+
that the settings screens (and others) reuse: `Section`, `Heading`, `StatusBadge`, `UpgradePrompt`,
|
|
712
|
+
`ModalDropdown` + `useFocusTrap`. Share the `@dloizides/ui-feedback` context (`useUi`). `Heading`
|
|
713
|
+
unblocks the deferred ModalShell. `Breadcrumb` deferred (couples to the app's router + breadcrumb map).
|