@brightlocal/ui-components 2.3.0 → 2.5.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/AI_USAGE.md CHANGED
@@ -63,7 +63,7 @@ import { Input } from "@brightlocal/ui-components/input";
63
63
  import { Dialog, DialogContent, DialogTrigger, DialogTitle } from "@brightlocal/ui-components/dialog";
64
64
  import { Card, CardHeader, CardContent } from "@brightlocal/ui-components/card";
65
65
  import { cn } from "@brightlocal/ui-components/lib/utils";
66
- import { DataTable, useDataTable } from "@brightlocal/ui-components/blocks/data-table";
66
+ import { DataTable, useDataTable } from "@brightlocal/ui-components/data-table";
67
67
  ```
68
68
 
69
69
  ### Wrong — Barrel imports
package/README.md CHANGED
@@ -333,15 +333,16 @@ Components are exported per-file (not barrel imports). Use the component name in
333
333
  ```tsx
334
334
  import { Button } from "@brightlocal/ui-components/button";
335
335
  import { Dialog, DialogContent, DialogTrigger } from "@brightlocal/ui-components/dialog";
336
- import { DataTable } from "@brightlocal/ui-components/blocks/data-table";
336
+ import { DataTable } from "@brightlocal/ui-components/data-table";
337
337
  import { useIsMobile } from "@brightlocal/ui-components/hooks/use-mobile";
338
338
  import { cn } from "@brightlocal/ui-components/lib/utils";
339
339
  ```
340
340
 
341
+ > **Avoid** barrel imports like `import { Button } from "@brightlocal/ui-components"` — this loads all ui-components and hurts bundle size. Always use the direct path.
342
+
341
343
  | Path pattern | Example |
342
344
  |---|---|
343
- | `@brightlocal/ui-components/{component}` | `/button`, `/input`, `/dialog`, `/select` |
344
- | `@brightlocal/ui-components/blocks/{block}` | `/blocks/data-table`, `/blocks/sidebar`, `/blocks/input-list` |
345
+ | `@brightlocal/ui-components/{component}` | `/button`, `/input`, `/dialog`, `/select`, `/data-table`, `/sidebar`, `/input-list` |
345
346
  | `@brightlocal/ui-components/hooks/{hook}` | `/hooks/use-mobile` |
346
347
  | `@brightlocal/ui-components/lib/{util}` | `/lib/utils` |
347
348
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "description": "Machine-readable registry of all components in the BrightLocal Design System",
5
5
  "components": [
6
6
  {
@@ -57,7 +57,28 @@
57
57
  "description",
58
58
  "action"
59
59
  ],
60
- "description": "Status alert messages with semantic variants"
60
+ "description": "Status alert messages with semantic variants",
61
+ "aliases": [
62
+ "notification",
63
+ "banner",
64
+ "message",
65
+ "status message"
66
+ ],
67
+ "doNotUseFor": [
68
+ "toast notifications (use Sonner)",
69
+ "inline validation (use FieldError)"
70
+ ],
71
+ "replaces": [],
72
+ "states": [
73
+ "default"
74
+ ],
75
+ "a11yContract": {
76
+ "role": "alert",
77
+ "requiresLabel": false,
78
+ "keyboardInteraction": [
79
+ "Tab"
80
+ ]
81
+ }
61
82
  },
62
83
  {
63
84
  "name": "AlertDialog",
@@ -81,7 +102,29 @@
81
102
  "open",
82
103
  "onOpenChange"
83
104
  ],
84
- "description": "Modal confirmation dialogs"
105
+ "description": "Modal confirmation dialogs",
106
+ "aliases": [
107
+ "confirmation dialog",
108
+ "confirm modal",
109
+ "destructive action dialog"
110
+ ],
111
+ "doNotUseFor": [
112
+ "informational dialogs (use Dialog)",
113
+ "toast messages (use Sonner)"
114
+ ],
115
+ "replaces": [],
116
+ "states": [
117
+ "open",
118
+ "closed"
119
+ ],
120
+ "a11yContract": {
121
+ "role": "alertdialog",
122
+ "requiresLabel": true,
123
+ "keyboardInteraction": [
124
+ "Escape",
125
+ "Tab"
126
+ ]
127
+ }
85
128
  },
86
129
  {
87
130
  "name": "AspectRatio",
@@ -136,7 +179,27 @@
136
179
  "props": [
137
180
  "asChild"
138
181
  ],
139
- "description": "Status badges and labels"
182
+ "description": "Status badges and labels",
183
+ "aliases": [
184
+ "tag",
185
+ "chip",
186
+ "pill",
187
+ "label",
188
+ "status indicator"
189
+ ],
190
+ "doNotUseFor": [
191
+ "removable tags (use Chip)",
192
+ "interactive elements (use Button)"
193
+ ],
194
+ "replaces": [],
195
+ "states": [
196
+ "default"
197
+ ],
198
+ "a11yContract": {
199
+ "role": "status",
200
+ "requiresLabel": false,
201
+ "keyboardInteraction": []
202
+ }
140
203
  },
141
204
  {
142
205
  "name": "Breadcrumb",
@@ -189,7 +252,36 @@
189
252
  "type",
190
253
  "ariaLabel"
191
254
  ],
192
- "description": "Primary interactive button with variants"
255
+ "description": "Primary interactive button with variants",
256
+ "aliases": [
257
+ "btn",
258
+ "cta",
259
+ "action button",
260
+ "submit button",
261
+ "confirm button"
262
+ ],
263
+ "doNotUseFor": [
264
+ "navigation links (use Link)",
265
+ "toggle state (use Toggle or Switch)"
266
+ ],
267
+ "replaces": [
268
+ "native <button>"
269
+ ],
270
+ "states": [
271
+ "default",
272
+ "hover",
273
+ "focus",
274
+ "disabled",
275
+ "loading"
276
+ ],
277
+ "a11yContract": {
278
+ "role": "button",
279
+ "requiresLabel": false,
280
+ "keyboardInteraction": [
281
+ "Enter",
282
+ "Space"
283
+ ]
284
+ }
193
285
  },
194
286
  {
195
287
  "name": "Calendar",
@@ -265,7 +357,29 @@
265
357
  "props": [
266
358
  "maxWidth"
267
359
  ],
268
- "description": "Content container with consistent styling"
360
+ "description": "Content container with consistent styling",
361
+ "aliases": [
362
+ "container",
363
+ "panel",
364
+ "box",
365
+ "wrapper",
366
+ "content card"
367
+ ],
368
+ "doNotUseFor": [
369
+ "clickable list items (use List)",
370
+ "modal content (use Dialog)"
371
+ ],
372
+ "replaces": [
373
+ "raw div containers"
374
+ ],
375
+ "states": [
376
+ "default"
377
+ ],
378
+ "a11yContract": {
379
+ "role": "region",
380
+ "requiresLabel": false,
381
+ "keyboardInteraction": []
382
+ }
269
383
  },
270
384
  {
271
385
  "name": "Carousel",
@@ -349,7 +463,32 @@
349
463
  "checked",
350
464
  "onCheckedChange"
351
465
  ],
352
- "description": "Checkbox input"
466
+ "description": "Checkbox input",
467
+ "aliases": [
468
+ "check",
469
+ "checkmark",
470
+ "tick box"
471
+ ],
472
+ "doNotUseFor": [
473
+ "on/off toggle (use Switch)",
474
+ "radio selection (use RadioGroup)"
475
+ ],
476
+ "replaces": [
477
+ "native <input type='checkbox'>"
478
+ ],
479
+ "states": [
480
+ "checked",
481
+ "unchecked",
482
+ "indeterminate",
483
+ "disabled"
484
+ ],
485
+ "a11yContract": {
486
+ "role": "checkbox",
487
+ "requiresLabel": true,
488
+ "keyboardInteraction": [
489
+ "Space"
490
+ ]
491
+ }
353
492
  },
354
493
  {
355
494
  "name": "Chip",
@@ -425,7 +564,33 @@
425
564
  "sideOffset",
426
565
  "avoidCollisions"
427
566
  ],
428
- "description": "Searchable select dropdown with filtering"
567
+ "description": "Searchable select dropdown with filtering",
568
+ "aliases": [
569
+ "autocomplete",
570
+ "searchable select",
571
+ "typeahead",
572
+ "filterable dropdown"
573
+ ],
574
+ "doNotUseFor": [
575
+ "simple select without search (use Select)",
576
+ "command palette (use Command)"
577
+ ],
578
+ "replaces": [],
579
+ "states": [
580
+ "open",
581
+ "closed",
582
+ "loading",
583
+ "disabled"
584
+ ],
585
+ "a11yContract": {
586
+ "role": "combobox",
587
+ "requiresLabel": true,
588
+ "keyboardInteraction": [
589
+ "Arrow keys",
590
+ "Enter",
591
+ "Escape"
592
+ ]
593
+ }
429
594
  },
430
595
  {
431
596
  "name": "Command",
@@ -543,7 +708,31 @@
543
708
  "onOpenChange",
544
709
  "modal"
545
710
  ],
546
- "description": "Modal dialog overlay"
711
+ "description": "Modal dialog overlay",
712
+ "aliases": [
713
+ "modal",
714
+ "popup",
715
+ "lightbox"
716
+ ],
717
+ "doNotUseFor": [
718
+ "confirmation actions (use AlertDialog)",
719
+ "side panels (use Sheet or Drawer)"
720
+ ],
721
+ "replaces": [
722
+ "native <dialog>"
723
+ ],
724
+ "states": [
725
+ "open",
726
+ "closed"
727
+ ],
728
+ "a11yContract": {
729
+ "role": "dialog",
730
+ "requiresLabel": true,
731
+ "keyboardInteraction": [
732
+ "Escape",
733
+ "Tab"
734
+ ]
735
+ }
547
736
  },
548
737
  {
549
738
  "name": "Drawer",
@@ -594,7 +783,32 @@
594
783
  "dataHookRequired": false,
595
784
  "variants": {},
596
785
  "props": [],
597
- "description": "Dropdown menu triggered by a button"
786
+ "description": "Dropdown menu triggered by a button",
787
+ "aliases": [
788
+ "context menu",
789
+ "action menu",
790
+ "kebab menu",
791
+ "more menu",
792
+ "three-dot menu"
793
+ ],
794
+ "doNotUseFor": [
795
+ "navigation (use NavigationMenu)",
796
+ "form selection (use Select)"
797
+ ],
798
+ "replaces": [],
799
+ "states": [
800
+ "open",
801
+ "closed"
802
+ ],
803
+ "a11yContract": {
804
+ "role": "menu",
805
+ "requiresLabel": false,
806
+ "keyboardInteraction": [
807
+ "Arrow keys",
808
+ "Enter",
809
+ "Escape"
810
+ ]
811
+ }
598
812
  },
599
813
  {
600
814
  "name": "Field",
@@ -627,7 +841,26 @@
627
841
  "props": [
628
842
  "align"
629
843
  ],
630
- "description": "Form field wrapper with label, description, and error handling"
844
+ "description": "Form field wrapper with label, description, and error handling",
845
+ "aliases": [
846
+ "form field",
847
+ "input group",
848
+ "field wrapper"
849
+ ],
850
+ "doNotUseFor": [
851
+ "standalone labels (use Label)",
852
+ "inline text (use Typography)"
853
+ ],
854
+ "replaces": [],
855
+ "states": [
856
+ "default",
857
+ "invalid"
858
+ ],
859
+ "a11yContract": {
860
+ "role": "group",
861
+ "requiresLabel": false,
862
+ "keyboardInteraction": []
863
+ }
631
864
  },
632
865
  {
633
866
  "name": "GlobalLayout",
@@ -708,7 +941,32 @@
708
941
  "hasIcon",
709
942
  "hasSecondaryIcon"
710
943
  ],
711
- "description": "Text input field"
944
+ "description": "Text input field",
945
+ "aliases": [
946
+ "text field",
947
+ "textbox",
948
+ "text input"
949
+ ],
950
+ "doNotUseFor": [
951
+ "multi-line text (use Textarea)",
952
+ "search with dropdown (use Combobox)"
953
+ ],
954
+ "replaces": [
955
+ "native <input>"
956
+ ],
957
+ "states": [
958
+ "default",
959
+ "focus",
960
+ "disabled",
961
+ "invalid"
962
+ ],
963
+ "a11yContract": {
964
+ "role": "textbox",
965
+ "requiresLabel": true,
966
+ "keyboardInteraction": [
967
+ "Tab"
968
+ ]
969
+ }
712
970
  },
713
971
  {
714
972
  "name": "InputChip",
@@ -807,7 +1065,25 @@
807
1065
  "optional",
808
1066
  "htmlFor"
809
1067
  ],
810
- "description": "Form label element"
1068
+ "description": "Form label element",
1069
+ "aliases": [
1070
+ "form label",
1071
+ "input label"
1072
+ ],
1073
+ "doNotUseFor": [
1074
+ "standalone text (use Typography)"
1075
+ ],
1076
+ "replaces": [
1077
+ "native <label>"
1078
+ ],
1079
+ "states": [
1080
+ "default"
1081
+ ],
1082
+ "a11yContract": {
1083
+ "role": "none",
1084
+ "requiresLabel": false,
1085
+ "keyboardInteraction": []
1086
+ }
811
1087
  },
812
1088
  {
813
1089
  "name": "Link",
@@ -959,7 +1235,29 @@
959
1235
  "side",
960
1236
  "sideOffset"
961
1237
  ],
962
- "description": "Floating popover panel"
1238
+ "description": "Floating popover panel",
1239
+ "aliases": [
1240
+ "floating panel",
1241
+ "popup panel",
1242
+ "info popup"
1243
+ ],
1244
+ "doNotUseFor": [
1245
+ "tooltips (use Tooltip)",
1246
+ "menus (use DropdownMenu)"
1247
+ ],
1248
+ "replaces": [],
1249
+ "states": [
1250
+ "open",
1251
+ "closed"
1252
+ ],
1253
+ "a11yContract": {
1254
+ "role": "dialog",
1255
+ "requiresLabel": false,
1256
+ "keyboardInteraction": [
1257
+ "Escape",
1258
+ "Tab"
1259
+ ]
1260
+ }
963
1261
  },
964
1262
  {
965
1263
  "name": "Progress",
@@ -1090,7 +1388,33 @@
1090
1388
  "onOpenChange",
1091
1389
  "disabled"
1092
1390
  ],
1093
- "description": "Dropdown select input"
1391
+ "description": "Dropdown select input",
1392
+ "aliases": [
1393
+ "dropdown",
1394
+ "picker",
1395
+ "select menu"
1396
+ ],
1397
+ "doNotUseFor": [
1398
+ "searchable lists (use Combobox)",
1399
+ "multi-select (use Combobox)"
1400
+ ],
1401
+ "replaces": [
1402
+ "native <select>"
1403
+ ],
1404
+ "states": [
1405
+ "default",
1406
+ "open",
1407
+ "disabled"
1408
+ ],
1409
+ "a11yContract": {
1410
+ "role": "listbox",
1411
+ "requiresLabel": true,
1412
+ "keyboardInteraction": [
1413
+ "Space",
1414
+ "Enter",
1415
+ "Arrow keys"
1416
+ ]
1417
+ }
1094
1418
  },
1095
1419
  {
1096
1420
  "name": "Separator",
@@ -1143,7 +1467,31 @@
1143
1467
  "open",
1144
1468
  "onOpenChange"
1145
1469
  ],
1146
- "description": "Side panel overlay"
1470
+ "description": "Side panel overlay",
1471
+ "aliases": [
1472
+ "side panel",
1473
+ "drawer",
1474
+ "flyout",
1475
+ "tray",
1476
+ "slide-out"
1477
+ ],
1478
+ "doNotUseFor": [
1479
+ "centered dialogs (use Dialog)",
1480
+ "confirmations (use AlertDialog)"
1481
+ ],
1482
+ "replaces": [],
1483
+ "states": [
1484
+ "open",
1485
+ "closed"
1486
+ ],
1487
+ "a11yContract": {
1488
+ "role": "dialog",
1489
+ "requiresLabel": true,
1490
+ "keyboardInteraction": [
1491
+ "Escape",
1492
+ "Tab"
1493
+ ]
1494
+ }
1147
1495
  },
1148
1496
  {
1149
1497
  "name": "Skeleton",
@@ -1203,7 +1551,27 @@
1203
1551
  "button",
1204
1552
  "duration"
1205
1553
  ],
1206
- "description": "Toast notification system. Accepts a `duration` option (ms) to control auto-dismiss timing. Set to `Infinity` to keep the toast visible until the user closes it or you call `sonner.dismiss(id)`."
1554
+ "description": "Toast notification system. Accepts a `duration` option (ms) to control auto-dismiss timing. Set to `Infinity` to keep the toast visible until the user closes it or you call `sonner.dismiss(id)`.",
1555
+ "aliases": [
1556
+ "toast",
1557
+ "notification",
1558
+ "snackbar",
1559
+ "flash message"
1560
+ ],
1561
+ "doNotUseFor": [
1562
+ "persistent alerts (use Alert)",
1563
+ "confirmation dialogs (use AlertDialog)"
1564
+ ],
1565
+ "replaces": [],
1566
+ "states": [
1567
+ "visible",
1568
+ "dismissed"
1569
+ ],
1570
+ "a11yContract": {
1571
+ "role": "status",
1572
+ "requiresLabel": false,
1573
+ "keyboardInteraction": []
1574
+ }
1207
1575
  },
1208
1576
  {
1209
1577
  "name": "SplitLayout",
@@ -1239,7 +1607,28 @@
1239
1607
  "checked",
1240
1608
  "onCheckedChange"
1241
1609
  ],
1242
- "description": "Toggle switch input"
1610
+ "description": "Toggle switch input",
1611
+ "aliases": [
1612
+ "toggle switch",
1613
+ "on/off toggle"
1614
+ ],
1615
+ "doNotUseFor": [
1616
+ "multi-option selection (use Checkbox or RadioGroup)",
1617
+ "button toggle (use Toggle)"
1618
+ ],
1619
+ "replaces": [],
1620
+ "states": [
1621
+ "checked",
1622
+ "unchecked",
1623
+ "disabled"
1624
+ ],
1625
+ "a11yContract": {
1626
+ "role": "switch",
1627
+ "requiresLabel": true,
1628
+ "keyboardInteraction": [
1629
+ "Space"
1630
+ ]
1631
+ }
1243
1632
  },
1244
1633
  {
1245
1634
  "name": "Table",
@@ -1252,7 +1641,8 @@
1252
1641
  "TableFooter",
1253
1642
  "TableHead",
1254
1643
  "TableRow",
1255
- "TableCell"
1644
+ "TableCell",
1645
+ "TableCaption"
1256
1646
  ],
1257
1647
  "compound": true,
1258
1648
  "dataHookRequired": true,
@@ -1264,11 +1654,34 @@
1264
1654
  ],
1265
1655
  "align": [
1266
1656
  "left",
1267
- "right"
1657
+ "right",
1658
+ "center"
1268
1659
  ]
1269
1660
  },
1270
1661
  "props": [],
1271
- "description": "Styled HTML table"
1662
+ "description": "Semantic HTML table with accessibility features and logical alignment",
1663
+ "aliases": [
1664
+ "data grid",
1665
+ "grid",
1666
+ "list table"
1667
+ ],
1668
+ "doNotUseFor": [
1669
+ "complex filtering and sorting (use DataTable block)",
1670
+ "layout grids (use CSS grid)"
1671
+ ],
1672
+ "replaces": [
1673
+ "native <table>"
1674
+ ],
1675
+ "states": [
1676
+ "default"
1677
+ ],
1678
+ "a11yContract": {
1679
+ "role": "table",
1680
+ "requiresLabel": false,
1681
+ "keyboardInteraction": [
1682
+ "Tab"
1683
+ ]
1684
+ }
1272
1685
  },
1273
1686
  {
1274
1687
  "name": "Tabs",
@@ -1288,7 +1701,28 @@
1288
1701
  "defaultValue",
1289
1702
  "onValueChange"
1290
1703
  ],
1291
- "description": "Tabbed interface for switching between views"
1704
+ "description": "Tabbed interface for switching between views",
1705
+ "aliases": [
1706
+ "tab bar",
1707
+ "tab group",
1708
+ "tabbed interface"
1709
+ ],
1710
+ "doNotUseFor": [
1711
+ "page navigation (use NavigationMenu)",
1712
+ "step-by-step wizards"
1713
+ ],
1714
+ "replaces": [],
1715
+ "states": [
1716
+ "default"
1717
+ ],
1718
+ "a11yContract": {
1719
+ "role": "tablist",
1720
+ "requiresLabel": false,
1721
+ "keyboardInteraction": [
1722
+ "Arrow keys",
1723
+ "Tab"
1724
+ ]
1725
+ }
1292
1726
  },
1293
1727
  {
1294
1728
  "name": "Textarea",
@@ -1402,7 +1836,30 @@
1402
1836
  "align",
1403
1837
  "sideOffset"
1404
1838
  ],
1405
- "description": "Hover tooltip with configurable positioning"
1839
+ "description": "Hover tooltip with configurable positioning",
1840
+ "aliases": [
1841
+ "hover tip",
1842
+ "info tip",
1843
+ "help text"
1844
+ ],
1845
+ "doNotUseFor": [
1846
+ "interactive content (use Popover)",
1847
+ "complex content (use HoverCard)"
1848
+ ],
1849
+ "replaces": [
1850
+ "title attribute"
1851
+ ],
1852
+ "states": [
1853
+ "visible",
1854
+ "hidden"
1855
+ ],
1856
+ "a11yContract": {
1857
+ "role": "tooltip",
1858
+ "requiresLabel": false,
1859
+ "keyboardInteraction": [
1860
+ "Escape"
1861
+ ]
1862
+ }
1406
1863
  },
1407
1864
  {
1408
1865
  "name": "Typography",
@@ -1434,7 +1891,7 @@
1434
1891
  "blocks": [
1435
1892
  {
1436
1893
  "name": "DataTable",
1437
- "import": "@brightlocal/ui-components/blocks/data-table",
1894
+ "import": "@brightlocal/ui-components/data-table",
1438
1895
  "category": "block",
1439
1896
  "exports": [
1440
1897
  "DataTable",
@@ -1468,7 +1925,7 @@
1468
1925
  },
1469
1926
  {
1470
1927
  "name": "InputList",
1471
- "import": "@brightlocal/ui-components/blocks/input-list",
1928
+ "import": "@brightlocal/ui-components/input-list",
1472
1929
  "category": "block",
1473
1930
  "exports": [
1474
1931
  "InputList",
@@ -1490,7 +1947,7 @@
1490
1947
  },
1491
1948
  {
1492
1949
  "name": "Sidebar",
1493
- "import": "@brightlocal/ui-components/blocks/sidebar",
1950
+ "import": "@brightlocal/ui-components/sidebar",
1494
1951
  "category": "block",
1495
1952
  "exports": [
1496
1953
  "Sidebar",