@brightlocal/ui-components 3.1.0 → 3.3.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.
Files changed (463) hide show
  1. package/AI_USAGE.md +10 -0
  2. package/README.md +8 -1
  3. package/component-meta.json +1591 -123
  4. package/deprecations.json +45 -1
  5. package/dist/_virtual/_rolldown/runtime.cjs +1 -0
  6. package/dist/accordion.cjs +1 -1
  7. package/dist/accordion.js +73 -102
  8. package/dist/alert-dialog.cjs +1 -1
  9. package/dist/alert-dialog.d.ts +36 -5
  10. package/dist/alert-dialog.d.ts.map +1 -1
  11. package/dist/alert-dialog.js +83 -128
  12. package/dist/alert.cjs +1 -1
  13. package/dist/alert.d.ts +4 -4
  14. package/dist/alert.d.ts.map +1 -1
  15. package/dist/alert.js +116 -177
  16. package/dist/aspect-ratio.cjs +1 -1
  17. package/dist/aspect-ratio.js +13 -16
  18. package/dist/avatar.cjs +1 -1
  19. package/dist/avatar.js +30 -45
  20. package/dist/badge.cjs +1 -1
  21. package/dist/badge.d.ts +32 -1
  22. package/dist/badge.d.ts.map +1 -1
  23. package/dist/badge.js +90 -71
  24. package/dist/banner.cjs +1 -0
  25. package/dist/banner.d.ts +81 -0
  26. package/dist/banner.d.ts.map +1 -0
  27. package/dist/banner.js +130 -0
  28. package/dist/blocks/empty-state.cjs +1 -1
  29. package/dist/blocks/empty-state.d.ts +24 -6
  30. package/dist/blocks/empty-state.d.ts.map +1 -1
  31. package/dist/blocks/empty-state.js +74 -140
  32. package/dist/blocks/input-list.cjs +2 -2
  33. package/dist/blocks/input-list.d.ts +2 -2
  34. package/dist/blocks/input-list.d.ts.map +1 -1
  35. package/dist/blocks/input-list.js +136 -176
  36. package/dist/blocks/progress-state.cjs +1 -1
  37. package/dist/blocks/progress-state.d.ts +2 -2
  38. package/dist/blocks/progress-state.js +223 -347
  39. package/dist/blocks/sidebar.cjs +1 -1
  40. package/dist/blocks/sidebar.d.ts +28 -6
  41. package/dist/blocks/sidebar.d.ts.map +1 -1
  42. package/dist/blocks/sidebar.js +763 -1086
  43. package/dist/brand-illustration-motif.cjs +1 -1
  44. package/dist/brand-illustration-motif.d.ts +1 -1
  45. package/dist/brand-illustration-motif.js +40 -61
  46. package/dist/breadcrumb.cjs +1 -1
  47. package/dist/breadcrumb.js +62 -102
  48. package/dist/button-group.cjs +1 -1
  49. package/dist/button-group.js +23 -31
  50. package/dist/button.cjs +1 -1
  51. package/dist/button.d.ts +4 -2
  52. package/dist/button.d.ts.map +1 -1
  53. package/dist/button.js +149 -189
  54. package/dist/calendar.cjs +1 -1
  55. package/dist/calendar.d.ts +87 -3
  56. package/dist/calendar.d.ts.map +1 -1
  57. package/dist/calendar.js +116 -173
  58. package/dist/callout.cjs +1 -1
  59. package/dist/callout.js +73 -96
  60. package/dist/card.cjs +1 -1
  61. package/dist/card.d.ts +92 -6
  62. package/dist/card.d.ts.map +1 -1
  63. package/dist/card.js +240 -234
  64. package/dist/carousel.cjs +1 -1
  65. package/dist/carousel.d.ts +3 -3
  66. package/dist/carousel.d.ts.map +1 -1
  67. package/dist/carousel.js +174 -268
  68. package/dist/centred-layout.cjs +1 -1
  69. package/dist/centred-layout.js +27 -48
  70. package/dist/chart-empty.cjs +1 -1
  71. package/dist/chart-empty.js +18 -27
  72. package/dist/chart.cjs +7 -7
  73. package/dist/chart.d.ts +253 -25
  74. package/dist/chart.d.ts.map +1 -1
  75. package/dist/chart.js +465 -511
  76. package/dist/checkbox.cjs +1 -1
  77. package/dist/checkbox.d.ts +1 -1
  78. package/dist/checkbox.d.ts.map +1 -1
  79. package/dist/checkbox.js +37 -69
  80. package/dist/chip.cjs +1 -1
  81. package/dist/chip.js +116 -173
  82. package/dist/collapsible.cjs +1 -1
  83. package/dist/collapsible.d.ts.map +1 -1
  84. package/dist/collapsible.js +35 -41
  85. package/dist/combobox.cjs +3 -3
  86. package/dist/combobox.d.ts +14 -4
  87. package/dist/combobox.d.ts.map +1 -1
  88. package/dist/combobox.js +440 -639
  89. package/dist/command.cjs +1 -1
  90. package/dist/command.d.ts.map +1 -1
  91. package/dist/command.js +273 -420
  92. package/dist/context-menu.cjs +1 -1
  93. package/dist/context-menu.d.ts +5 -5
  94. package/dist/context-menu.d.ts.map +1 -1
  95. package/dist/context-menu.js +121 -191
  96. package/dist/data-table.cjs +1 -1
  97. package/dist/data-table.d.ts +442 -144
  98. package/dist/data-table.d.ts.map +1 -1
  99. package/dist/data-table.js +708 -835
  100. package/dist/date-picker.cjs +1 -1
  101. package/dist/date-picker.d.ts +15 -4
  102. package/dist/date-picker.d.ts.map +1 -1
  103. package/dist/date-picker.js +156 -231
  104. package/dist/delta.cjs +1 -0
  105. package/dist/delta.d.ts +79 -0
  106. package/dist/delta.d.ts.map +1 -0
  107. package/dist/delta.js +62 -0
  108. package/dist/description.cjs +1 -1
  109. package/dist/description.js +11 -20
  110. package/dist/dialog.cjs +1 -1
  111. package/dist/dialog.d.ts +1 -1
  112. package/dist/dialog.d.ts.map +1 -1
  113. package/dist/dialog.js +76 -116
  114. package/dist/drawer.cjs +1 -1
  115. package/dist/drawer.d.ts +11 -11
  116. package/dist/drawer.d.ts.map +1 -1
  117. package/dist/drawer.js +76 -134
  118. package/dist/dropdown-menu.cjs +1 -1
  119. package/dist/dropdown-menu.d.ts +6 -6
  120. package/dist/dropdown-menu.d.ts.map +1 -1
  121. package/dist/dropdown-menu.js +179 -300
  122. package/dist/field.cjs +1 -1
  123. package/dist/field.d.ts +9 -9
  124. package/dist/field.d.ts.map +1 -1
  125. package/dist/field.js +166 -286
  126. package/dist/global-layout.cjs +1 -1
  127. package/dist/global-layout.js +203 -342
  128. package/dist/grid.cjs +1 -1
  129. package/dist/grid.d.ts +24 -1
  130. package/dist/grid.d.ts.map +1 -1
  131. package/dist/grid.js +16 -29
  132. package/dist/header.cjs +1 -1
  133. package/dist/header.js +21 -38
  134. package/dist/height-transition.cjs +1 -1
  135. package/dist/height-transition.js +38 -55
  136. package/dist/hooks/use-breakpoint.cjs +1 -1
  137. package/dist/hooks/use-breakpoint.d.ts +1 -1
  138. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  139. package/dist/hooks/use-breakpoint.js +10 -9
  140. package/dist/hooks/use-debounce.cjs +1 -1
  141. package/dist/hooks/use-debounce.js +12 -11
  142. package/dist/hooks/use-delayed-pending.cjs +1 -1
  143. package/dist/hooks/use-delayed-pending.js +8 -9
  144. package/dist/hooks/use-filter-search-params.cjs +1 -0
  145. package/dist/hooks/use-filter-search-params.d.ts +93 -0
  146. package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
  147. package/dist/hooks/use-filter-search-params.js +122 -0
  148. package/dist/hooks/use-mobile.cjs +1 -1
  149. package/dist/hooks/use-mobile.js +6 -6
  150. package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
  151. package/dist/hooks/use-overlay-pointer-lock.js +8 -9
  152. package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
  153. package/dist/hooks/use-prefers-reduced-motion.js +5 -8
  154. package/dist/hover-card.cjs +1 -1
  155. package/dist/hover-card.d.ts +1 -1
  156. package/dist/hover-card.d.ts.map +1 -1
  157. package/dist/hover-card.js +30 -62
  158. package/dist/index.cjs +1 -1
  159. package/dist/index.d.ts +11 -0
  160. package/dist/index.d.ts.map +1 -1
  161. package/dist/index.js +636 -582
  162. package/dist/info-tooltip.cjs +1 -0
  163. package/dist/info-tooltip.d.ts +39 -0
  164. package/dist/info-tooltip.d.ts.map +1 -0
  165. package/dist/info-tooltip.js +27 -0
  166. package/dist/input-chip.cjs +1 -1
  167. package/dist/input-chip.d.ts +32 -3
  168. package/dist/input-chip.d.ts.map +1 -1
  169. package/dist/input-chip.js +182 -231
  170. package/dist/input-group.cjs +1 -1
  171. package/dist/input-group.d.ts +33 -2
  172. package/dist/input-group.d.ts.map +1 -1
  173. package/dist/input-group.js +188 -122
  174. package/dist/input-otp.cjs +1 -1
  175. package/dist/input-otp.d.ts +3 -3
  176. package/dist/input-otp.d.ts.map +1 -1
  177. package/dist/input-otp.js +102 -146
  178. package/dist/input-password.cjs +1 -1
  179. package/dist/input-password.d.ts +26 -8
  180. package/dist/input-password.d.ts.map +1 -1
  181. package/dist/input-password.js +139 -171
  182. package/dist/input.cjs +1 -1
  183. package/dist/input.d.ts.map +1 -1
  184. package/dist/input.js +51 -73
  185. package/dist/label.cjs +1 -1
  186. package/dist/label.js +20 -38
  187. package/dist/lib/block-illustration.cjs +1 -1
  188. package/dist/lib/block-illustration.d.ts +5 -2
  189. package/dist/lib/block-illustration.d.ts.map +1 -1
  190. package/dist/lib/block-illustration.js +16 -17
  191. package/dist/lib/compose-event-handlers.cjs +1 -0
  192. package/dist/lib/compose-event-handlers.d.ts +9 -0
  193. package/dist/lib/compose-event-handlers.d.ts.map +1 -0
  194. package/dist/lib/compose-event-handlers.js +8 -0
  195. package/dist/lib/download-file.cjs +1 -0
  196. package/dist/lib/download-file.d.ts +14 -0
  197. package/dist/lib/download-file.d.ts.map +1 -0
  198. package/dist/lib/download-file.js +40 -0
  199. package/dist/lib/empty-canvas.cjs +1 -1
  200. package/dist/lib/empty-canvas.js +28 -56
  201. package/dist/lib/empty-chip.cjs +1 -1
  202. package/dist/lib/empty-chip.d.ts +14 -3
  203. package/dist/lib/empty-chip.d.ts.map +1 -1
  204. package/dist/lib/empty-chip.js +15 -11
  205. package/dist/lib/field-aria.cjs +1 -0
  206. package/dist/lib/field-aria.d.ts +34 -0
  207. package/dist/lib/field-aria.d.ts.map +1 -0
  208. package/dist/lib/field-aria.js +52 -0
  209. package/dist/lib/image-file-info.cjs +1 -0
  210. package/dist/lib/image-file-info.d.ts +25 -0
  211. package/dist/lib/image-file-info.d.ts.map +1 -0
  212. package/dist/lib/image-file-info.js +67 -0
  213. package/dist/lib/media-viewer-content.cjs +1 -0
  214. package/dist/lib/media-viewer-content.d.ts +102 -0
  215. package/dist/lib/media-viewer-content.d.ts.map +1 -0
  216. package/dist/lib/media-viewer-content.js +650 -0
  217. package/dist/lib/media-viewer-internal.cjs +1 -0
  218. package/dist/lib/media-viewer-internal.d.ts +98 -0
  219. package/dist/lib/media-viewer-internal.d.ts.map +1 -0
  220. package/dist/lib/media-viewer-internal.js +61 -0
  221. package/dist/lib/media-viewer-motion.cjs +1 -0
  222. package/dist/lib/media-viewer-motion.d.ts +40 -0
  223. package/dist/lib/media-viewer-motion.d.ts.map +1 -0
  224. package/dist/lib/media-viewer-motion.js +37 -0
  225. package/dist/lib/motion.cjs +1 -1
  226. package/dist/lib/motion.d.ts +8 -0
  227. package/dist/lib/motion.d.ts.map +1 -1
  228. package/dist/lib/motion.js +11 -10
  229. package/dist/lib/optical-center.cjs +1 -1
  230. package/dist/lib/optical-center.d.ts +1 -1
  231. package/dist/lib/optical-center.d.ts.map +1 -1
  232. package/dist/lib/optical-center.js +12 -5
  233. package/dist/lib/spring-settle.cjs +1 -1
  234. package/dist/lib/spring-settle.js +1 -1
  235. package/dist/lib/table-internal.cjs +1 -0
  236. package/dist/lib/table-internal.d.ts +62 -0
  237. package/dist/lib/table-internal.d.ts.map +1 -0
  238. package/dist/lib/table-internal.js +18 -0
  239. package/dist/lib/use-controllable.cjs +1 -0
  240. package/dist/lib/use-controllable.d.ts +12 -0
  241. package/dist/lib/use-controllable.d.ts.map +1 -0
  242. package/dist/lib/use-controllable.js +15 -0
  243. package/dist/lib/use-dev-warning.cjs +1 -1
  244. package/dist/lib/utils.cjs +1 -1
  245. package/dist/lib/utils.d.ts.map +1 -1
  246. package/dist/lib/utils.js +29 -35
  247. package/dist/link.cjs +1 -1
  248. package/dist/link.d.ts +1 -1
  249. package/dist/link.js +78 -124
  250. package/dist/list.cjs +1 -1
  251. package/dist/list.d.ts +8 -0
  252. package/dist/list.d.ts.map +1 -1
  253. package/dist/list.js +94 -156
  254. package/dist/loading.cjs +1 -1
  255. package/dist/loading.js +124 -151
  256. package/dist/logo-mark.cjs +1 -0
  257. package/dist/logo-mark.d.ts +79 -0
  258. package/dist/logo-mark.d.ts.map +1 -0
  259. package/dist/logo-mark.js +219 -0
  260. package/dist/logo.cjs +1 -1
  261. package/dist/logo.d.ts +1 -1
  262. package/dist/logo.d.ts.map +1 -1
  263. package/dist/logo.js +51 -87
  264. package/dist/map.cjs +1 -1
  265. package/dist/map.d.ts.map +1 -1
  266. package/dist/map.js +390 -586
  267. package/dist/media-empty.cjs +1 -1
  268. package/dist/media-empty.js +27 -42
  269. package/dist/media-viewer.cjs +1 -0
  270. package/dist/media-viewer.d.ts +224 -0
  271. package/dist/media-viewer.d.ts.map +1 -0
  272. package/dist/media-viewer.js +295 -0
  273. package/dist/menubar.cjs +1 -1
  274. package/dist/menubar.d.ts +14 -14
  275. package/dist/menubar.d.ts.map +1 -1
  276. package/dist/menubar.js +130 -267
  277. package/dist/multi-select-filter.cjs +1 -0
  278. package/dist/multi-select-filter.d.ts +186 -0
  279. package/dist/multi-select-filter.d.ts.map +1 -0
  280. package/dist/multi-select-filter.js +374 -0
  281. package/dist/navigation-menu.cjs +1 -1
  282. package/dist/navigation-menu.js +108 -172
  283. package/dist/pagination.cjs +1 -1
  284. package/dist/pagination.d.ts +36 -12
  285. package/dist/pagination.d.ts.map +1 -1
  286. package/dist/pagination.js +208 -281
  287. package/dist/popover.cjs +1 -1
  288. package/dist/popover.d.ts +1 -1
  289. package/dist/popover.d.ts.map +1 -1
  290. package/dist/popover.js +34 -45
  291. package/dist/progress.cjs +1 -1
  292. package/dist/progress.d.ts +139 -17
  293. package/dist/progress.d.ts.map +1 -1
  294. package/dist/progress.js +116 -148
  295. package/dist/radio-group.cjs +1 -1
  296. package/dist/radio-group.js +90 -146
  297. package/dist/rating.cjs +1 -1
  298. package/dist/rating.d.ts +80 -13
  299. package/dist/rating.d.ts.map +1 -1
  300. package/dist/rating.js +70 -65
  301. package/dist/relative-date.cjs +1 -0
  302. package/dist/relative-date.d.ts +65 -0
  303. package/dist/relative-date.d.ts.map +1 -0
  304. package/dist/relative-date.js +112 -0
  305. package/dist/resizable.cjs +1 -1
  306. package/dist/resizable.d.ts +39 -23
  307. package/dist/resizable.d.ts.map +1 -1
  308. package/dist/resizable.js +42 -44
  309. package/dist/result-count.cjs +1 -0
  310. package/dist/result-count.d.ts +110 -0
  311. package/dist/result-count.d.ts.map +1 -0
  312. package/dist/result-count.js +49 -0
  313. package/dist/route-progress.cjs +1 -1
  314. package/dist/route-progress.js +58 -102
  315. package/dist/scroll-area.cjs +1 -1
  316. package/dist/scroll-area.d.ts +9 -1
  317. package/dist/scroll-area.d.ts.map +1 -1
  318. package/dist/scroll-area.js +44 -79
  319. package/dist/select.cjs +2 -2
  320. package/dist/select.d.ts +20 -10
  321. package/dist/select.d.ts.map +1 -1
  322. package/dist/select.js +132 -236
  323. package/dist/separator.cjs +1 -1
  324. package/dist/separator.js +90 -78
  325. package/dist/sheet.cjs +1 -1
  326. package/dist/sheet.d.ts +86 -7
  327. package/dist/sheet.d.ts.map +1 -1
  328. package/dist/sheet.js +275 -235
  329. package/dist/single-select-filter.cjs +1 -0
  330. package/dist/single-select-filter.d.ts +113 -0
  331. package/dist/single-select-filter.d.ts.map +1 -0
  332. package/dist/single-select-filter.js +224 -0
  333. package/dist/skeleton.cjs +1 -1
  334. package/dist/skeleton.js +24 -38
  335. package/dist/slider.cjs +1 -1
  336. package/dist/slider.js +51 -81
  337. package/dist/sonner.cjs +1 -1
  338. package/dist/sonner.d.ts +1 -1
  339. package/dist/sonner.d.ts.map +1 -1
  340. package/dist/sonner.js +113 -137
  341. package/dist/spinner.cjs +1 -1
  342. package/dist/spinner.js +22 -31
  343. package/dist/split-layout.cjs +1 -1
  344. package/dist/split-layout.d.ts +1 -1
  345. package/dist/split-layout.js +53 -102
  346. package/dist/status.cjs +1 -0
  347. package/dist/status.d.ts +51 -0
  348. package/dist/status.d.ts.map +1 -0
  349. package/dist/status.js +60 -0
  350. package/dist/stepper.cjs +1 -1
  351. package/dist/stepper.js +184 -316
  352. package/dist/switch.cjs +1 -1
  353. package/dist/switch.js +17 -32
  354. package/dist/table.cjs +1 -1
  355. package/dist/table.d.ts +127 -13
  356. package/dist/table.d.ts.map +1 -1
  357. package/dist/table.js +170 -192
  358. package/dist/tabs.cjs +1 -1
  359. package/dist/tabs.d.ts +12 -1
  360. package/dist/tabs.d.ts.map +1 -1
  361. package/dist/tabs.js +123 -146
  362. package/dist/text-reveal-motion.cjs +1 -1
  363. package/dist/text-reveal-motion.js +307 -363
  364. package/dist/textarea.cjs +1 -1
  365. package/dist/textarea.d.ts.map +1 -1
  366. package/dist/textarea.js +23 -36
  367. package/dist/toggle-group.cjs +1 -1
  368. package/dist/toggle-group.js +43 -62
  369. package/dist/toggle.cjs +1 -1
  370. package/dist/toggle.js +34 -46
  371. package/dist/tooltip.cjs +1 -1
  372. package/dist/tooltip.d.ts +38 -36
  373. package/dist/tooltip.d.ts.map +1 -1
  374. package/dist/tooltip.js +175 -78
  375. package/dist/typography-heading.cjs +1 -1
  376. package/dist/typography-heading.js +25 -61
  377. package/dist/typography-text.cjs +1 -1
  378. package/dist/typography-text.d.ts +1 -2
  379. package/dist/typography-text.d.ts.map +1 -1
  380. package/dist/typography-text.js +27 -57
  381. package/dist/typography.cjs +1 -1
  382. package/dist/typography.d.ts +1 -1
  383. package/dist/typography.js +132 -340
  384. package/package.json +45 -46
  385. package/src/blocks/empty-state.tsx +42 -21
  386. package/src/blocks/progress-state.tsx +2 -2
  387. package/src/blocks/sidebar.tsx +111 -32
  388. package/src/components/accordion.tsx +1 -1
  389. package/src/components/alert-dialog.tsx +52 -5
  390. package/src/components/alert.tsx +16 -8
  391. package/src/components/badge.tsx +152 -3
  392. package/src/components/banner.tsx +288 -0
  393. package/src/components/brand-illustration-motif.tsx +1 -1
  394. package/src/components/breadcrumb.tsx +1 -1
  395. package/src/components/button.tsx +8 -6
  396. package/src/components/calendar.tsx +155 -9
  397. package/src/components/card.tsx +266 -26
  398. package/src/components/carousel.tsx +4 -1
  399. package/src/components/chart.tsx +664 -42
  400. package/src/components/checkbox.tsx +2 -2
  401. package/src/components/collapsible.tsx +4 -1
  402. package/src/components/combobox.tsx +42 -9
  403. package/src/components/command.tsx +10 -11
  404. package/src/components/context-menu.tsx +4 -4
  405. package/src/components/data-table.tsx +1363 -398
  406. package/src/components/date-picker.tsx +31 -4
  407. package/src/components/delta.tsx +217 -0
  408. package/src/components/drawer.tsx +5 -5
  409. package/src/components/dropdown-menu.tsx +4 -4
  410. package/src/components/field.tsx +36 -15
  411. package/src/components/global-layout.tsx +1 -1
  412. package/src/components/grid.tsx +32 -1
  413. package/src/components/info-tooltip.tsx +94 -0
  414. package/src/components/input-chip.tsx +52 -8
  415. package/src/components/input-group.tsx +247 -12
  416. package/src/components/input-otp.tsx +1 -1
  417. package/src/components/input-password.tsx +29 -11
  418. package/src/components/input.tsx +11 -2
  419. package/src/components/list.tsx +15 -3
  420. package/src/components/logo-mark.tsx +345 -0
  421. package/src/components/map.tsx +18 -20
  422. package/src/components/media-viewer.tsx +908 -0
  423. package/src/components/multi-select-filter.tsx +1046 -0
  424. package/src/components/navigation-menu.tsx +2 -2
  425. package/src/components/pagination.tsx +86 -26
  426. package/src/components/progress.tsx +281 -54
  427. package/src/components/rating.tsx +200 -74
  428. package/src/components/relative-date.tsx +238 -0
  429. package/src/components/resizable.tsx +86 -33
  430. package/src/components/result-count.tsx +253 -0
  431. package/src/components/scroll-area.tsx +31 -5
  432. package/src/components/select.tsx +37 -7
  433. package/src/components/sheet.tsx +252 -6
  434. package/src/components/single-select-filter.tsx +538 -0
  435. package/src/components/slider.tsx +2 -2
  436. package/src/components/sonner.tsx +16 -5
  437. package/src/components/split-layout.tsx +2 -2
  438. package/src/components/status.tsx +162 -0
  439. package/src/components/switch.tsx +1 -1
  440. package/src/components/table.tsx +305 -73
  441. package/src/components/tabs.tsx +94 -46
  442. package/src/components/textarea.tsx +21 -3
  443. package/src/components/toggle.tsx +2 -2
  444. package/src/components/tooltip.tsx +431 -68
  445. package/src/components/typography-text.tsx +1 -2
  446. package/src/components/typography.tsx +1 -1
  447. package/src/hooks/use-breakpoint.ts +2 -1
  448. package/src/hooks/use-filter-search-params.ts +302 -0
  449. package/src/index.ts +11 -0
  450. package/src/lib/block-illustration.tsx +5 -1
  451. package/src/lib/compose-event-handlers.ts +14 -0
  452. package/src/lib/download-file.ts +61 -0
  453. package/src/lib/empty-chip.tsx +52 -0
  454. package/src/lib/field-aria.tsx +97 -0
  455. package/src/lib/image-file-info.ts +102 -0
  456. package/src/lib/media-viewer-content.tsx +1587 -0
  457. package/src/lib/media-viewer-internal.tsx +191 -0
  458. package/src/lib/media-viewer-motion.ts +120 -0
  459. package/src/lib/motion.ts +9 -0
  460. package/src/lib/table-internal.ts +74 -0
  461. package/src/lib/use-controllable.ts +43 -0
  462. package/src/lib/utils.ts +1 -0
  463. package/src/lib/empty-chip.ts +0 -24
@@ -3,12 +3,14 @@
3
3
  import * as React from "react";
4
4
  import { ChevronDown, ChevronLeft, ChevronRight } from "@brightlocal/icons";
5
5
  import {
6
+ DateLib,
6
7
  DayButton,
7
8
  DayPicker,
8
9
  getDefaultClassNames,
9
10
  type DayPickerProps,
10
11
  } from "react-day-picker";
11
12
 
13
+ import { Button } from "@brightlocal/ui-components/button";
12
14
  import { cn } from "@brightlocal/ui-components/lib/utils";
13
15
 
14
16
  /**
@@ -20,6 +22,14 @@ export type CalendarProps = DayPickerProps & {
20
22
  * @default 1
21
23
  */
22
24
  numberOfMonths?: 1 | 2 | 3;
25
+ /**
26
+ * Stretch the calendar to fill its container instead of sizing to fit:
27
+ * the month, weekday headings and day cells share the width, and day
28
+ * buttons are at least 36px tall so they stay easy to tap. Use it in
29
+ * drawers, sheets and other narrow containers.
30
+ * @default false
31
+ */
32
+ fullWidth?: boolean;
23
33
  /**
24
34
  * Data hook for testing and analytics
25
35
  */
@@ -35,7 +45,7 @@ export type CalendarProps = DayPickerProps & {
35
45
  };
36
46
 
37
47
  const navButtonStyles = cn(
38
- "inline-flex items-center justify-center rounded-md",
48
+ "inline-flex cursor-pointer items-center justify-center rounded-md",
39
49
  "text-muted-foreground hover:text-foreground",
40
50
  "hover:bg-accent hover:text-accent-foreground",
41
51
  "focus-visible:outline-none focus-visible:shadow-default",
@@ -63,7 +73,9 @@ const CalendarDayButton = ({
63
73
  <button
64
74
  ref={ref}
65
75
  className={cn(
66
- "text-foreground text-label h-8 w-8 rounded-md p-0",
76
+ "text-foreground text-label h-8 w-8 cursor-pointer rounded-md p-0",
77
+ "group-data-[full-width=true]/calendar:h-9 group-data-[full-width=true]/calendar:w-full",
78
+ "disabled:cursor-not-allowed disabled:line-through",
67
79
  "hover:bg-accent hover:text-accent-foreground",
68
80
  "focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none",
69
81
  "group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10",
@@ -104,11 +116,13 @@ function Calendar({
104
116
  numberOfMonths = 1,
105
117
  captionLayout,
106
118
  fixedWeeks = true,
119
+ fullWidth = false,
107
120
  dataHook,
108
121
  trackingEl,
109
122
  trackingLabel,
110
123
  components,
111
124
  formatters,
125
+ labels,
112
126
  ...props
113
127
  }: CalendarProps) {
114
128
  const defaultClassNames = getDefaultClassNames();
@@ -117,12 +131,21 @@ function Calendar({
117
131
  <DayPicker
118
132
  captionLayout={captionLayout}
119
133
  className={cn(
120
- "bg-background border-border group/calendar relative w-fit rounded-lg border p-3 shadow-sm",
134
+ "bg-background border-border group/calendar relative rounded-lg border p-3 shadow-sm",
135
+ fullWidth ? "w-full" : "w-fit",
121
136
  className
122
137
  )}
123
138
  classNames={{
124
- months: cn("flex flex-col sm:flex-row gap-4", defaultClassNames.months),
125
- month: cn("flex flex-col gap-4", defaultClassNames.month),
139
+ months: cn(
140
+ "flex flex-col sm:flex-row gap-4",
141
+ fullWidth && "w-full",
142
+ defaultClassNames.months
143
+ ),
144
+ month: cn(
145
+ "flex flex-col gap-4",
146
+ fullWidth && "w-full flex-1",
147
+ defaultClassNames.month
148
+ ),
126
149
  month_caption: cn(
127
150
  "flex justify-center relative items-center w-full h-8",
128
151
  defaultClassNames.month_caption
@@ -158,13 +181,15 @@ function Calendar({
158
181
  "w-full border-collapse flex flex-col",
159
182
  defaultClassNames.month_grid
160
183
  ),
161
- weekdays: cn("flex", defaultClassNames.weekdays),
184
+ weekdays: cn("flex", fullWidth && "w-full", defaultClassNames.weekdays),
162
185
  weekday: cn(
163
- "text-muted-foreground rounded-md w-8 h-5 flex items-center justify-center text-body-xs",
186
+ "text-muted-foreground rounded-md h-5 flex items-center justify-center text-body-xs",
187
+ fullWidth ? "flex-1" : "w-8",
164
188
  defaultClassNames.weekday
165
189
  ),
166
190
  week: cn(defaultClassNames.week, "flex w-full mt-2"),
167
191
  day: cn(
192
+ fullWidth && "flex-1",
168
193
  "relative w-full h-full p-0 text-center text-label focus-within:relative focus-within:z-20 group/day select-none",
169
194
  "[&:first-child[data-selected=true]_button]:!rounded-l-md",
170
195
  "[&:last-child[data-selected=true]_button]:!rounded-r-md",
@@ -194,7 +219,7 @@ function Calendar({
194
219
  defaultClassNames.outside
195
220
  ),
196
221
  disabled: cn(
197
- "text-foreground opacity-50 cursor-not-allowed",
222
+ "text-foreground opacity-40 cursor-not-allowed",
198
223
  defaultClassNames.disabled
199
224
  ),
200
225
  hidden: cn(defaultClassNames.hidden),
@@ -217,6 +242,7 @@ function Calendar({
217
242
  DayButton: CalendarDayButton,
218
243
  ...components,
219
244
  }}
245
+ data-full-width={fullWidth}
220
246
  data-hook={dataHook}
221
247
  data-slot="calendar"
222
248
  data-tracking-el={trackingEl}
@@ -227,6 +253,19 @@ function Calendar({
227
253
  date.toLocaleString("default", { month: "short" }),
228
254
  ...formatters,
229
255
  }}
256
+ labels={{
257
+ // Lead with the visible day number so the accessible name contains the
258
+ // button text (WCAG 2.5.3 Label in Name); the default label spells the
259
+ // day out as "31st" and fails axe's label-content-name-mismatch.
260
+ labelDayButton: (date, modifiers, options, dateLib) => {
261
+ const lib = dateLib ?? new DateLib(options);
262
+ let label = `${lib.format(date, "d")}, ${lib.format(date, "EEEE, LLLL yyyy")}`;
263
+ if (modifiers.today) label = `Today, ${label}`;
264
+ if (modifiers.selected) label = `${label}, selected`;
265
+ return label;
266
+ },
267
+ ...labels,
268
+ }}
230
269
  numberOfMonths={numberOfMonths}
231
270
  showOutsideDays={showOutsideDays}
232
271
  {...props}
@@ -236,4 +275,111 @@ function Calendar({
236
275
 
237
276
  Calendar.displayName = "Calendar";
238
277
 
239
- export { Calendar, CalendarDayButton };
278
+ /**
279
+ * A quick pick shown under the calendar.
280
+ */
281
+ export type CalendarPreset = {
282
+ /** Visible label, e.g. "Tomorrow" */
283
+ label: string;
284
+ /** The date the preset selects, or a function returning it (resolved on click) */
285
+ date: Date | (() => Date);
286
+ };
287
+
288
+ export type CalendarPresetsProps = Omit<
289
+ React.ComponentPropsWithoutRef<"div">,
290
+ "onSelect"
291
+ > & {
292
+ /**
293
+ * Quick picks to render. The row wraps onto more lines; it never widens the calendar.
294
+ */
295
+ presets: CalendarPreset[];
296
+ /**
297
+ * Called with the preset's date when a preset is clicked
298
+ */
299
+ onSelect: (date: Date) => void;
300
+ /**
301
+ * Currently selected date. The matching preset is marked as pressed.
302
+ */
303
+ selected?: Date;
304
+ /**
305
+ * Accessible name of the presets group
306
+ * @default "Quick picks"
307
+ */
308
+ groupLabel?: string;
309
+ /**
310
+ * Data hook for testing and analytics
311
+ */
312
+ dataHook: string;
313
+ /**
314
+ * Tracking element identifier
315
+ */
316
+ trackingEl?: string;
317
+ /**
318
+ * Tracking label for analytics
319
+ */
320
+ trackingLabel?: string;
321
+ };
322
+
323
+ const resolvePresetDate = (preset: CalendarPreset) =>
324
+ typeof preset.date === "function" ? preset.date() : preset.date;
325
+
326
+ /**
327
+ * Quick picks under the calendar. Pass it to `Calendar` as `footer` — it sits inside
328
+ * the calendar's own frame and owns the rule and spacing. The row takes the calendar's
329
+ * width and wraps, so it never widens the calendar or a popover around it.
330
+ */
331
+ const CalendarPresets = React.forwardRef<HTMLDivElement, CalendarPresetsProps>(
332
+ (
333
+ {
334
+ presets,
335
+ onSelect,
336
+ selected,
337
+ groupLabel,
338
+ dataHook,
339
+ trackingEl,
340
+ trackingLabel,
341
+ className,
342
+ ...props
343
+ },
344
+ ref
345
+ ) => (
346
+ <div
347
+ ref={ref}
348
+ aria-label={groupLabel ?? "Quick picks"}
349
+ className={cn(
350
+ // w-0 + min-w-full: the row follows the calendar's width instead of adding to it
351
+ "border-border mt-3 flex w-0 min-w-full flex-wrap gap-2 border-t pt-3",
352
+ className
353
+ )}
354
+ data-hook={dataHook}
355
+ data-slot="calendar-presets"
356
+ data-tracking-el={trackingEl}
357
+ data-tracking-label={trackingLabel}
358
+ role="group"
359
+ {...props}
360
+ >
361
+ {presets.map((preset) => {
362
+ const date = resolvePresetDate(preset);
363
+ const isSelected =
364
+ selected !== undefined &&
365
+ date.toDateString() === selected.toDateString();
366
+ return (
367
+ <Button
368
+ key={preset.label}
369
+ aria-pressed={isSelected}
370
+ dataHook={`${dataHook}-${preset.label.toLowerCase().replace(/\s+/g, "-")}`}
371
+ size="sm"
372
+ variant="outline"
373
+ onClick={() => onSelect(resolvePresetDate(preset))}
374
+ >
375
+ {preset.label}
376
+ </Button>
377
+ );
378
+ })}
379
+ </div>
380
+ )
381
+ );
382
+
383
+ CalendarPresets.displayName = "CalendarPresets";
384
+
385
+ export { Calendar, CalendarDayButton, CalendarPresets };
@@ -14,7 +14,7 @@ type CardVariant = "filled" | "transparent" | "border" | "transparent-flush";
14
14
  /**
15
15
  * Card density type
16
16
  */
17
- type CardDensity = "default" | "condensed";
17
+ type CardDensity = "default" | "condensed" | "data";
18
18
 
19
19
  /**
20
20
  * Context to pass variant information to sub-components
@@ -22,10 +22,39 @@ type CardDensity = "default" | "condensed";
22
22
  const CardContext = React.createContext<{
23
23
  flush: boolean;
24
24
  density: CardDensity;
25
- }>({ flush: false, density: "default" });
25
+ variant: CardVariant;
26
+ }>({ flush: false, density: "default", variant: "filled" });
27
+
28
+ /**
29
+ * Opaque surface a sticky header paints so content never shows through it:
30
+ * the card's own fill, or the page background for unfilled variants.
31
+ */
32
+ const stickySurface: Record<CardVariant, string> = {
33
+ filled: "bg-muted",
34
+ border: "bg-card",
35
+ transparent: "bg-background",
36
+ "transparent-flush": "bg-background",
37
+ };
38
+
39
+ /**
40
+ * The card's horizontal gutter, published as `--content-inset` for
41
+ * edge-to-edge content (a `Table`/`DataTable` with `frame="container"` inside
42
+ * `CardContent flush`) to align its first/last columns with the title
43
+ * (DS-1103). Mirrors `subPadding`.
44
+ */
45
+ const CONTENT_INSET: Record<CardDensity, string> = {
46
+ default: "[--content-inset:var(--ds-section-padding-x-md)]",
47
+ condensed: "[--content-inset:0.75rem]",
48
+ data: "[--content-inset:var(--ds-content-padding)]",
49
+ };
26
50
 
27
51
  function subPadding(flush: boolean, density: CardDensity): string | false {
28
- return !flush && (density === "condensed" ? "px-3" : "px-section-md");
52
+ if (flush) return false;
53
+ if (density === "condensed") return "px-3";
54
+ // Data cards use the fixed 24px content padding, not the responsive
55
+ // section scale — their content (tables, maps) sets its own rhythm.
56
+ if (density === "data") return "px-content";
57
+ return "px-section-md";
29
58
  }
30
59
 
31
60
  const cardVariants = cva(
@@ -35,29 +64,35 @@ const cardVariants = cva(
35
64
  "rounded-xl",
36
65
  "transition-colors duration-fast ease-out",
37
66
  "w-full",
38
- "max-w-[400px]",
39
67
  ],
40
68
  {
41
69
  variants: {
42
70
  variant: {
71
+ // The tinted fill: the muted surface, a step below the white card.
43
72
  filled: [
44
- "bg-card",
73
+ "bg-muted",
45
74
  "text-card-foreground",
46
75
  "border",
47
76
  "border-card-border",
48
77
  ],
49
78
  transparent: ["bg-transparent", "text-foreground"],
50
- border: [
51
- "bg-transparent",
52
- "text-foreground",
53
- "border",
54
- "border-border",
55
- ],
79
+ // The card surface: solid white on the off-white page, neutral-900 in dark.
80
+ border: ["bg-card", "text-foreground", "border", "border-border"],
56
81
  "transparent-flush": ["bg-transparent", "text-foreground"],
57
82
  },
58
83
  density: {
59
- default: ["gap-8", "py-section-md"],
60
- condensed: ["gap-3", "py-3"],
84
+ // Flush content right after a divider header cancels the root gap so
85
+ // it sits on the line, as it does in the data density.
86
+ default: [
87
+ "gap-8",
88
+ "py-section-md",
89
+ "[&>[data-divider]+[data-flush]]:-mt-8",
90
+ ],
91
+ condensed: ["gap-3", "py-3", "[&>[data-divider]+[data-flush]]:-mt-3"],
92
+ // Data cards space via the sub-components, not a root gap: the header
93
+ // owns the top padding and its divider; content/footer pad below it.
94
+ // This lets flush content sit directly against the header divider.
95
+ data: ["pb-6"],
61
96
  },
62
97
  },
63
98
  defaultVariants: {
@@ -77,7 +112,12 @@ type CardProps = React.ComponentProps<"div"> & {
77
112
  */
78
113
  variant?: CardVariant;
79
114
  /**
80
- * Spacing density of the card
115
+ * Spacing density of the card.
116
+ * - `"default"` — responsive section-scale padding for standalone cards.
117
+ * - `"condensed"` — tight 12px scale for dense sidebars and widgets.
118
+ * - `"data"` — the report-page scale (DS-989): fixed 24px horizontal
119
+ * padding and a tighter header, tuned for cards that carry a filter
120
+ * row and a data view (table, map, chart).
81
121
  * @default "default"
82
122
  */
83
123
  density?: CardDensity;
@@ -140,10 +180,14 @@ const Card = React.forwardRef<HTMLDivElement, CardProps>(
140
180
  : undefined;
141
181
 
142
182
  return (
143
- <CardContext.Provider value={{ flush, density }}>
183
+ <CardContext.Provider value={{ flush, density, variant }}>
144
184
  <div
145
185
  ref={ref}
146
- className={cn(cardVariants({ variant, density }), className)}
186
+ className={cn(
187
+ cardVariants({ variant, density }),
188
+ CONTENT_INSET[density],
189
+ className
190
+ )}
147
191
  data-density={density}
148
192
  data-hook={dataHook}
149
193
  data-slot="card"
@@ -186,7 +230,7 @@ type CardSubComponentProps = React.ComponentProps<"div"> & {
186
230
  type CardHeaderAlign = "left" | "center" | "right";
187
231
 
188
232
  const cardHeaderVariants = cva(
189
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
233
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1 has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-metric]:grid-cols-[1fr_auto]",
190
234
  {
191
235
  variants: {
192
236
  align: {
@@ -211,24 +255,102 @@ type CardHeaderProps = CardSubComponentProps & {
211
255
  * @default "left"
212
256
  */
213
257
  align?: CardHeaderAlign;
258
+ /**
259
+ * Closes the header with a full-width divider — the header's own bottom
260
+ * border, so it travels with a sticky header. Works in every density: the
261
+ * header pads its bottom by the density's section spacing so the line
262
+ * never touches the description, and flush content placed right after the
263
+ * header sits directly against the line (DS-989).
264
+ * @default false
265
+ */
266
+ divider?: boolean;
267
+ /**
268
+ * Keeps the header pinned while the card scrolls past (DS-989) — for tall
269
+ * report cards whose table scrolls under the title and filters. Sticks at
270
+ * the top edge of the nearest scroll container (the page, a Sheet, a
271
+ * Dialog or any scrollable box), so nothing scrolls through a gap above
272
+ * it. Stays within the card and paints the card's surface so rows never
273
+ * show through. Pair with `divider` so the stuck header keeps its edge (DS-1211).
274
+ *
275
+ * A sticky header also publishes its rendered height on the card as
276
+ * `--content-sticky-top`, re-measured whenever it changes (a filter row
277
+ * that wraps), so content can stick directly beneath it — a `DataTable`
278
+ * with `stickyHeader="page"` pins its column headings there (DS-1215).
279
+ * @default false
280
+ */
281
+ sticky?: boolean;
214
282
  };
215
283
 
284
+ /**
285
+ * Publishes a sticky header's rendered height on its card as
286
+ * `--content-sticky-top` (DS-1215), so sticky content inside the card — a
287
+ * `DataTable` with `stickyHeader="page"` — sticks directly beneath it. Set on
288
+ * the DOM rather than through state so a resize never re-renders the card.
289
+ */
290
+ function useStickyTopVar(
291
+ ref: React.RefObject<HTMLDivElement | null>,
292
+ sticky: boolean
293
+ ) {
294
+ React.useLayoutEffect(() => {
295
+ const header = ref.current;
296
+ const card = header?.closest<HTMLElement>('[data-slot="card"]');
297
+ if (!sticky || !header || !card) return;
298
+ // The border box's layout size: padding and the divider count, and an
299
+ // ancestor transform (a Dialog's zoom-in) does not. The observer fires
300
+ // once on observe, so this also publishes the initial height.
301
+ const observer = new ResizeObserver(([entry]) => {
302
+ const height = entry?.borderBoxSize?.[0]?.blockSize;
303
+ if (height !== undefined) {
304
+ card.style.setProperty("--content-sticky-top", `${height}px`);
305
+ }
306
+ });
307
+ observer.observe(header, { box: "border-box" });
308
+ return () => {
309
+ observer.disconnect();
310
+ card.style.removeProperty("--content-sticky-top");
311
+ };
312
+ }, [ref, sticky]);
313
+ }
314
+
216
315
  /**
217
316
  * Header section of the Card containing title and description.
218
317
  */
219
318
  const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(
220
- ({ className, align = "left", dataHook, ...props }, ref) => {
221
- const { flush, density } = React.useContext(CardContext);
319
+ (
320
+ {
321
+ className,
322
+ align = "left",
323
+ divider = false,
324
+ sticky = false,
325
+ dataHook,
326
+ ...props
327
+ },
328
+ ref
329
+ ) => {
330
+ const { flush, density, variant } = React.useContext(CardContext);
331
+ const headerRef = React.useRef<HTMLDivElement>(null);
332
+ React.useImperativeHandle(ref, () => headerRef.current!, []);
333
+ useStickyTopVar(headerRef, sticky);
222
334
  return (
223
335
  <div
224
- ref={ref}
336
+ ref={headerRef}
225
337
  className={cn(
226
338
  cardHeaderVariants({ align }),
227
339
  subPadding(flush, density),
340
+ // Data cards: the header owns the card's top padding (DS-989).
341
+ density === "data" && "pt-4 pb-4",
342
+ // Other densities have no header padding of their own; with a
343
+ // divider the line gets the density's section spacing above it.
344
+ divider && density === "default" && "pb-8",
345
+ divider && density === "condensed" && "pb-3",
346
+ divider && "border-border border-b",
347
+ sticky && ["sticky top-0 z-10 rounded-t-xl", stickySurface[variant]],
228
348
  className
229
349
  )}
350
+ data-divider={divider ? "" : undefined}
230
351
  data-hook={dataHook}
231
352
  data-slot="card-header"
353
+ data-sticky={sticky ? "" : undefined}
232
354
  {...props}
233
355
  />
234
356
  );
@@ -264,7 +386,8 @@ const cardTitleVariants = cva("", {
264
386
  */
265
387
  type CardTitleProps = CardSubComponentProps & {
266
388
  /**
267
- * Title text size.
389
+ * Title text size. Report cards (`density="data"`) use `"small"` —
390
+ * pass it explicitly per the report-card recipe.
268
391
  * @default "default"
269
392
  */
270
393
  size?: CardTitleSize;
@@ -373,7 +496,9 @@ const CardAction = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
373
496
  <div
374
497
  ref={ref}
375
498
  className={cn(
376
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
499
+ // Vertically centered against the title block, per the header spec
500
+ // (DS-989) — Figma's Title Row centers its slot on the cross axis.
501
+ "col-start-2 row-span-2 row-start-1 self-center justify-self-end",
377
502
  className
378
503
  )}
379
504
  data-hook={dataHook}
@@ -393,7 +518,11 @@ const CardMedia = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
393
518
  return (
394
519
  <div
395
520
  ref={ref}
396
- className={cn(subPadding(flush, density), className)}
521
+ className={cn(
522
+ subPadding(flush, density),
523
+ density === "data" && "pt-6",
524
+ className
525
+ )}
397
526
  data-hook={dataHook}
398
527
  data-slot="card-media"
399
528
  {...props}
@@ -407,16 +536,38 @@ const CardMedia = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
407
536
  );
408
537
  CardMedia.displayName = "CardMedia";
409
538
 
539
+ /**
540
+ * Props for the CardContent component.
541
+ */
542
+ type CardContentProps = CardSubComponentProps & {
543
+ /**
544
+ * Runs the content to the card edge (drops the horizontal padding) while
545
+ * the card keeps its surface and border. Use for tables, maps and charts
546
+ * inside a `filled` or `border` card — unlike `variant="transparent-flush"`,
547
+ * only this section goes edge-to-edge; the header and footer keep their
548
+ * padding, and other content sections can stay padded.
549
+ * @default false
550
+ */
551
+ flush?: boolean;
552
+ };
553
+
410
554
  /**
411
555
  * Main content area of the Card.
412
556
  */
413
- const CardContent = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
414
- ({ className, dataHook, ...props }, ref) => {
557
+ const CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(
558
+ ({ className, flush: flushProp = false, dataHook, ...props }, ref) => {
415
559
  const { flush, density } = React.useContext(CardContext);
416
560
  return (
417
561
  <div
418
562
  ref={ref}
419
- className={cn(subPadding(flush, density), className)}
563
+ className={cn(
564
+ flushProp ? false : subPadding(flush, density),
565
+ // Data cards space below the header divider per section; flush
566
+ // content instead sits directly against the divider.
567
+ density === "data" && !flushProp && "pt-6",
568
+ className
569
+ )}
570
+ data-flush={flushProp ? "" : undefined}
420
571
  data-hook={dataHook}
421
572
  data-slot="card-content"
422
573
  {...props}
@@ -426,6 +577,90 @@ const CardContent = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
426
577
  );
427
578
  CardContent.displayName = "CardContent";
428
579
 
580
+ /**
581
+ * Toolbar row within the Card header (DS-989) — search, dimension filters
582
+ * and time/report-run pickers below the title and description (the Card
583
+ * counterpart of DataTableToolbar). Spans the full header width (under any
584
+ * CardAction/CardMetric), lays controls out left-to-right with an 8px gap,
585
+ * caps a search input (Input, InputGroup or DataTableSearch) at 360px so it
586
+ * doesn't dominate a sparse row, and lets select/combobox triggers hug their
587
+ * value. All of that styling reaches direct children only: wrap a control in
588
+ * any element to opt it out. Must be a direct child of CardHeader.
589
+ *
590
+ * Which toolbar: everything that narrows what the card shows, a table's
591
+ * `DataTableSearch` included, goes here in the header. `DataTableToolbar`
592
+ * holds the controls that page through the table (`DataTablePagination`)
593
+ * beside the table, and a table that stands without a card header. A report
594
+ * card uses both.
595
+ *
596
+ * Intentionally no `role="toolbar"`: the ARIA toolbar pattern requires a
597
+ * roving tabindex with arrow-key navigation, which is wrong for a row of
598
+ * inputs and selects. Don't add it.
599
+ */
600
+ const CardToolbar = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
601
+ ({ className, dataHook, ...props }, ref) => (
602
+ <div
603
+ ref={ref}
604
+ className={cn(
605
+ // mt-2 + the header's gap-1 = the 12px title-block → filters gap.
606
+ // justify-self-stretch keeps the full width under align="center".
607
+ "col-span-full mt-2 flex flex-wrap items-center gap-2 justify-self-stretch",
608
+ "[&>[data-slot=data-table-search]]:max-w-90 [&>[data-slot=data-table-search]]:min-w-0 [&>[data-slot=input-group]]:max-w-90 [&>[data-slot=input-group]]:min-w-0 [&>[data-slot=input]]:max-w-90 [&>[data-slot=input]]:min-w-0",
609
+ // Select/combobox triggers are w-full for form layouts; in a filter
610
+ // row they hug their value instead.
611
+ "[&>[data-slot=combobox-trigger]]:w-fit [&>[data-slot=select-trigger]]:w-fit",
612
+ className
613
+ )}
614
+ data-hook={dataHook}
615
+ data-slot="card-toolbar"
616
+ {...props}
617
+ />
618
+ )
619
+ );
620
+ CardToolbar.displayName = "CardToolbar";
621
+
622
+ /**
623
+ * Props for the CardMetric component.
624
+ */
625
+ type CardMetricProps = Omit<CardSubComponentProps, "children"> & {
626
+ /**
627
+ * The metric value shown opposite the title, set in the `text-metric`
628
+ * type role.
629
+ */
630
+ value: React.ReactNode;
631
+ /**
632
+ * Trend indicator rendered after the value — typically a Badge.
633
+ */
634
+ trend?: React.ReactNode;
635
+ };
636
+
637
+ /**
638
+ * A headline metric in the Card header (DS-989) — a value and an optional
639
+ * trend badge sitting opposite the title, for cards whose own filters
640
+ * change the number. Occupies the same header area as CardAction, so use
641
+ * one or the other. Must be a direct child of CardHeader.
642
+ */
643
+ const CardMetric = React.forwardRef<HTMLDivElement, CardMetricProps>(
644
+ ({ className, value, trend, dataHook, ...props }, ref) => (
645
+ <div
646
+ ref={ref}
647
+ className={cn(
648
+ "col-start-2 row-span-2 row-start-1 flex items-baseline gap-2 self-center justify-self-end",
649
+ className
650
+ )}
651
+ data-hook={dataHook}
652
+ data-slot="card-metric"
653
+ {...props}
654
+ >
655
+ <span className="text-metric" data-slot="card-metric-value">
656
+ {value}
657
+ </span>
658
+ {trend}
659
+ </div>
660
+ )
661
+ );
662
+ CardMetric.displayName = "CardMetric";
663
+
429
664
  /**
430
665
  * Footer section of the Card for actions or metadata.
431
666
  */
@@ -438,6 +673,7 @@ const CardFooter = React.forwardRef<HTMLDivElement, CardSubComponentProps>(
438
673
  className={cn(
439
674
  "flex items-center",
440
675
  subPadding(flush, density),
676
+ density === "data" && "pt-6",
441
677
  className
442
678
  )}
443
679
  data-hook={dataHook}
@@ -456,7 +692,9 @@ export {
456
692
  CardTitle,
457
693
  CardAction,
458
694
  CardDescription,
695
+ CardToolbar,
459
696
  CardMedia,
697
+ CardMetric,
460
698
  CardContent,
461
699
  };
462
700
 
@@ -470,6 +708,8 @@ export type {
470
708
  CardTitleProps,
471
709
  CardTitleSize,
472
710
  CardTitleLevel,
711
+ CardContentProps,
712
+ CardMetricProps,
473
713
  CardVariant,
474
714
  CardDensity,
475
715
  };