@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
package/dist/card.d.ts CHANGED
@@ -6,7 +6,7 @@ type CardVariant = "filled" | "transparent" | "border" | "transparent-flush";
6
6
  /**
7
7
  * Card density type
8
8
  */
9
- type CardDensity = "default" | "condensed";
9
+ type CardDensity = "default" | "condensed" | "data";
10
10
  /**
11
11
  * Props for the Card component
12
12
  */
@@ -17,7 +17,12 @@ type CardProps = React.ComponentProps<"div"> & {
17
17
  */
18
18
  variant?: CardVariant;
19
19
  /**
20
- * Spacing density of the card
20
+ * Spacing density of the card.
21
+ * - `"default"` — responsive section-scale padding for standalone cards.
22
+ * - `"condensed"` — tight 12px scale for dense sidebars and widgets.
23
+ * - `"data"` — the report-page scale (DS-989): fixed 24px horizontal
24
+ * padding and a tighter header, tuned for cards that carry a filter
25
+ * row and a data view (table, map, chart).
21
26
  * @default "default"
22
27
  */
23
28
  density?: CardDensity;
@@ -78,6 +83,30 @@ type CardHeaderProps = CardSubComponentProps & {
78
83
  * @default "left"
79
84
  */
80
85
  align?: CardHeaderAlign;
86
+ /**
87
+ * Closes the header with a full-width divider — the header's own bottom
88
+ * border, so it travels with a sticky header. Works in every density: the
89
+ * header pads its bottom by the density's section spacing so the line
90
+ * never touches the description, and flush content placed right after the
91
+ * header sits directly against the line (DS-989).
92
+ * @default false
93
+ */
94
+ divider?: boolean;
95
+ /**
96
+ * Keeps the header pinned while the card scrolls past (DS-989) — for tall
97
+ * report cards whose table scrolls under the title and filters. Sticks at
98
+ * the top edge of the nearest scroll container (the page, a Sheet, a
99
+ * Dialog or any scrollable box), so nothing scrolls through a gap above
100
+ * it. Stays within the card and paints the card's surface so rows never
101
+ * show through. Pair with `divider` so the stuck header keeps its edge (DS-1211).
102
+ *
103
+ * A sticky header also publishes its rendered height on the card as
104
+ * `--content-sticky-top`, re-measured whenever it changes (a filter row
105
+ * that wraps), so content can stick directly beneath it — a `DataTable`
106
+ * with `stickyHeader="page"` pins its column headings there (DS-1215).
107
+ * @default false
108
+ */
109
+ sticky?: boolean;
81
110
  };
82
111
  /**
83
112
  * Header section of the Card containing title and description.
@@ -97,7 +126,8 @@ type CardTitleLevel = 2 | 3 | 4 | 5 | 6;
97
126
  */
98
127
  type CardTitleProps = CardSubComponentProps & {
99
128
  /**
100
- * Title text size.
129
+ * Title text size. Report cards (`density="data"`) use `"small"` —
130
+ * pass it explicitly per the report-card recipe.
101
131
  * @default "default"
102
132
  */
103
133
  size?: CardTitleSize;
@@ -152,14 +182,70 @@ declare const CardAction: React.ForwardRefExoticComponent<Omit<CardSubComponentP
152
182
  * Media container for images, videos, or other visual content within the Card.
153
183
  */
154
184
  declare const CardMedia: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
185
+ /**
186
+ * Props for the CardContent component.
187
+ */
188
+ type CardContentProps = CardSubComponentProps & {
189
+ /**
190
+ * Runs the content to the card edge (drops the horizontal padding) while
191
+ * the card keeps its surface and border. Use for tables, maps and charts
192
+ * inside a `filled` or `border` card — unlike `variant="transparent-flush"`,
193
+ * only this section goes edge-to-edge; the header and footer keep their
194
+ * padding, and other content sections can stay padded.
195
+ * @default false
196
+ */
197
+ flush?: boolean;
198
+ };
155
199
  /**
156
200
  * Main content area of the Card.
157
201
  */
158
- declare const CardContent: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
202
+ declare const CardContent: React.ForwardRefExoticComponent<Omit<CardContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
203
+ /**
204
+ * Toolbar row within the Card header (DS-989) — search, dimension filters
205
+ * and time/report-run pickers below the title and description (the Card
206
+ * counterpart of DataTableToolbar). Spans the full header width (under any
207
+ * CardAction/CardMetric), lays controls out left-to-right with an 8px gap,
208
+ * caps a search input (Input, InputGroup or DataTableSearch) at 360px so it
209
+ * doesn't dominate a sparse row, and lets select/combobox triggers hug their
210
+ * value. All of that styling reaches direct children only: wrap a control in
211
+ * any element to opt it out. Must be a direct child of CardHeader.
212
+ *
213
+ * Which toolbar: everything that narrows what the card shows, a table's
214
+ * `DataTableSearch` included, goes here in the header. `DataTableToolbar`
215
+ * holds the controls that page through the table (`DataTablePagination`)
216
+ * beside the table, and a table that stands without a card header. A report
217
+ * card uses both.
218
+ *
219
+ * Intentionally no `role="toolbar"`: the ARIA toolbar pattern requires a
220
+ * roving tabindex with arrow-key navigation, which is wrong for a row of
221
+ * inputs and selects. Don't add it.
222
+ */
223
+ declare const CardToolbar: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
224
+ /**
225
+ * Props for the CardMetric component.
226
+ */
227
+ type CardMetricProps = Omit<CardSubComponentProps, "children"> & {
228
+ /**
229
+ * The metric value shown opposite the title, set in the `text-metric`
230
+ * type role.
231
+ */
232
+ value: React.ReactNode;
233
+ /**
234
+ * Trend indicator rendered after the value — typically a Badge.
235
+ */
236
+ trend?: React.ReactNode;
237
+ };
238
+ /**
239
+ * A headline metric in the Card header (DS-989) — a value and an optional
240
+ * trend badge sitting opposite the title, for cards whose own filters
241
+ * change the number. Occupies the same header area as CardAction, so use
242
+ * one or the other. Must be a direct child of CardHeader.
243
+ */
244
+ declare const CardMetric: React.ForwardRefExoticComponent<Omit<CardMetricProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
159
245
  /**
160
246
  * Footer section of the Card for actions or metadata.
161
247
  */
162
248
  declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
163
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardMedia, CardContent, };
164
- export type { CardProps, CardSubComponentProps, CardHeaderProps, CardHeaderAlign, CardDescriptionProps, CardDescriptionAlign, CardTitleProps, CardTitleSize, CardTitleLevel, CardVariant, CardDensity, };
249
+ export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardToolbar, CardMedia, CardMetric, CardContent, };
250
+ export type { CardProps, CardSubComponentProps, CardHeaderProps, CardHeaderAlign, CardDescriptionProps, CardDescriptionAlign, CardTitleProps, CardTitleSize, CardTitleLevel, CardContentProps, CardMetricProps, CardVariant, CardDensity, };
165
251
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,mBAAmB,CAAC;AAE7E;;GAEG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAqD3C;;GAEG;AACH,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,M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;;GAEG;AACH,QAAA,MAAM,eAAe,0GAUpB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAef,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GAqBd,CAAC;AAGF;;GAEG;AACH,KAAK,gBAAgB,GAAG,qBAAqB,GAAG;IAC9C;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,WAAW,sGAoBhB,CAAC;AAGF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,WAAW,2GAmBhB,CAAC;AAGF;;GAEG;AACH,KAAK,eAAe,GAAG,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,GAAG;IAC/D;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,UAAU,qGAkBf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAkBf,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,EACX,SAAS,EACT,UAAU,EACV,WAAW,GACZ,CAAC;AAEF,YAAY,EACV,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,cAAc,EACd,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,GACZ,CAAC"}
package/dist/card.js CHANGED
@@ -1,248 +1,254 @@
1
- import { jsx as n } from "react/jsx-runtime";
1
+ "use client";
2
2
  import * as s from "react";
3
- import { Slot as y } from "@radix-ui/react-slot";
4
- import { cva as u } from "class-variance-authority";
5
3
  import { cn as l } from "@brightlocal/ui-components/lib/utils";
6
- const f = s.createContext({ flush: !1, density: "default" });
7
- function m(e, t) {
8
- return !e && (t === "condensed" ? "px-3" : "px-section-md");
4
+ import { jsx as i, jsxs as x } from "react/jsx-runtime";
5
+ import { Slot as w } from "@radix-ui/react-slot";
6
+ import { cva as m } from "class-variance-authority";
7
+ var p = s.createContext({
8
+ flush: !1,
9
+ density: "default",
10
+ variant: "filled"
11
+ }), y = {
12
+ filled: "bg-muted",
13
+ border: "bg-card",
14
+ transparent: "bg-background",
15
+ "transparent-flush": "bg-background"
16
+ }, C = {
17
+ default: "[--content-inset:var(--ds-section-padding-x-md)]",
18
+ condensed: "[--content-inset:0.75rem]",
19
+ data: "[--content-inset:var(--ds-content-padding)]"
20
+ };
21
+ function v(r, a) {
22
+ return r ? !1 : a === "condensed" ? "px-3" : a === "data" ? "px-content" : "px-section-md";
9
23
  }
10
- const v = u(
11
- [
12
- "flex",
13
- "flex-col",
14
- "rounded-xl",
15
- "transition-colors duration-fast ease-out",
16
- "w-full",
17
- "max-w-[400px]"
18
- ],
19
- {
20
- variants: {
21
- variant: {
22
- filled: [
23
- "bg-card",
24
- "text-card-foreground",
25
- "border",
26
- "border-card-border"
27
- ],
28
- transparent: ["bg-transparent", "text-foreground"],
29
- border: [
30
- "bg-transparent",
31
- "text-foreground",
32
- "border",
33
- "border-border"
34
- ],
35
- "transparent-flush": ["bg-transparent", "text-foreground"]
36
- },
37
- density: {
38
- default: ["gap-8", "py-section-md"],
39
- condensed: ["gap-3", "py-3"]
40
- }
41
- },
42
- defaultVariants: {
43
- variant: "filled",
44
- density: "default"
45
- }
46
- }
47
- ), N = s.forwardRef(
48
- ({
49
- className: e,
50
- variant: t = "filled",
51
- density: a = "default",
52
- dataHook: r,
53
- trackingEl: o,
54
- trackingLabel: i,
55
- maxWidth: d,
56
- children: c,
57
- style: p,
58
- ...h
59
- }, x) => {
60
- const g = t === "transparent-flush";
61
- s.useEffect(() => {
62
- process.env.NODE_ENV !== "production" && d !== void 0 && console.warn(
63
- 'Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").'
64
- );
65
- }, [d]);
66
- const C = d !== void 0 ? {
67
- maxWidth: typeof d == "number" ? `${d}px` : d
68
- } : void 0;
69
- return /* @__PURE__ */ n(f.Provider, { value: { flush: g, density: a }, children: /* @__PURE__ */ n(
70
- "div",
71
- {
72
- ref: x,
73
- className: l(v({ variant: t, density: a }), e),
74
- "data-density": a,
75
- "data-hook": r,
76
- "data-slot": "card",
77
- "data-tracking-el": o || `card-${t}`,
78
- "data-tracking-label": i,
79
- style: { ...C, ...p },
80
- ...h,
81
- children: c
82
- }
83
- ) });
84
- }
85
- );
86
- N.displayName = "Card";
87
- const w = u(
88
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
89
- {
90
- variants: {
91
- align: {
92
- left: "items-start",
93
- center: "justify-items-center text-center",
94
- right: "items-start text-right"
95
- }
96
- },
97
- defaultVariants: {
98
- align: "left"
99
- }
100
- }
101
- ), b = s.forwardRef(
102
- ({ className: e, align: t = "left", dataHook: a, ...r }, o) => {
103
- const { flush: i, density: d } = s.useContext(f);
104
- return /* @__PURE__ */ n(
105
- "div",
106
- {
107
- ref: o,
108
- className: l(
109
- w({ align: t }),
110
- m(i, d),
111
- e
112
- ),
113
- "data-hook": a,
114
- "data-slot": "card-header",
115
- ...r
116
- }
117
- );
118
- }
119
- );
120
- b.displayName = "CardHeader";
121
- const k = u("", {
24
+ var N = m([
25
+ "flex",
26
+ "flex-col",
27
+ "rounded-xl",
28
+ "transition-colors duration-fast ease-out",
29
+ "w-full"
30
+ ], {
122
31
  variants: {
123
- size: {
124
- small: "text-heading-subsection",
125
- default: "text-heading-section"
32
+ variant: {
33
+ filled: [
34
+ "bg-muted",
35
+ "text-card-foreground",
36
+ "border",
37
+ "border-card-border"
38
+ ],
39
+ transparent: ["bg-transparent", "text-foreground"],
40
+ border: [
41
+ "bg-card",
42
+ "text-foreground",
43
+ "border",
44
+ "border-border"
45
+ ],
46
+ "transparent-flush": ["bg-transparent", "text-foreground"]
47
+ },
48
+ density: {
49
+ default: [
50
+ "gap-8",
51
+ "py-section-md",
52
+ "[&>[data-divider]+[data-flush]]:-mt-8"
53
+ ],
54
+ condensed: [
55
+ "gap-3",
56
+ "py-3",
57
+ "[&>[data-divider]+[data-flush]]:-mt-3"
58
+ ],
59
+ data: ["pb-6"]
126
60
  }
127
61
  },
128
62
  defaultVariants: {
129
- size: "default"
63
+ variant: "filled",
64
+ density: "default"
130
65
  }
131
- }), R = s.forwardRef(
132
- ({ className: e, size: t = "default", level: a, asChild: r = !1, dataHook: o, ...i }, d) => {
133
- const c = {
134
- className: l(k({ size: t }), e),
135
- "data-hook": o,
136
- "data-slot": "card-title",
137
- ...i
66
+ }), k = s.forwardRef(({ className: r, variant: a = "filled", density: t = "default", dataHook: e, trackingEl: o, trackingLabel: n, maxWidth: d, children: f, style: c, ...b }, u) => {
67
+ const g = a === "transparent-flush";
68
+ s.useEffect(() => {
69
+ process.env.NODE_ENV !== "production" && d !== void 0 && console.warn('Card: the "maxWidth" prop is deprecated. Use Tailwind max-width utilities via className instead (e.g., className="max-w-sm").');
70
+ }, [d]);
71
+ const h = d !== void 0 ? { maxWidth: typeof d == "number" ? `${d}px` : d } : void 0;
72
+ return /* @__PURE__ */ i(p.Provider, {
73
+ value: {
74
+ flush: g,
75
+ density: t,
76
+ variant: a
77
+ },
78
+ children: /* @__PURE__ */ i("div", {
79
+ ref: u,
80
+ className: l(N({
81
+ variant: a,
82
+ density: t
83
+ }), C[t], r),
84
+ "data-density": t,
85
+ "data-hook": e,
86
+ "data-slot": "card",
87
+ "data-tracking-el": o || `card-${a}`,
88
+ "data-tracking-label": n,
89
+ style: {
90
+ ...h,
91
+ ...c
92
+ },
93
+ ...b,
94
+ children: f
95
+ })
96
+ });
97
+ });
98
+ k.displayName = "Card";
99
+ var R = m("@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]", {
100
+ variants: { align: {
101
+ left: "items-start",
102
+ center: "justify-items-center text-center",
103
+ right: "items-start text-right"
104
+ } },
105
+ defaultVariants: { align: "left" }
106
+ });
107
+ function T(r, a) {
108
+ s.useLayoutEffect(() => {
109
+ const t = r.current, e = t?.closest('[data-slot="card"]');
110
+ if (!a || !t || !e) return;
111
+ const o = new ResizeObserver(([n]) => {
112
+ const d = n?.borderBoxSize?.[0]?.blockSize;
113
+ d !== void 0 && e.style.setProperty("--content-sticky-top", `${d}px`);
114
+ });
115
+ return o.observe(t, { box: "border-box" }), () => {
116
+ o.disconnect(), e.style.removeProperty("--content-sticky-top");
138
117
  };
139
- if (r)
140
- return /* @__PURE__ */ n(y, { ref: d, ...c });
141
- if (a) {
142
- const p = `h${a}`;
143
- return /* @__PURE__ */ n(p, { ref: d, ...c });
144
- }
145
- return /* @__PURE__ */ n("div", { ref: d, ...c });
146
- }
147
- );
148
- R.displayName = "CardTitle";
149
- const V = u("text-body-sm text-muted-foreground", {
150
- variants: {
151
- align: {
152
- left: "text-left",
153
- center: "text-center",
154
- right: "text-right"
155
- }
118
+ }, [r, a]);
119
+ }
120
+ var V = s.forwardRef(({ className: r, align: a = "left", divider: t = !1, sticky: e = !1, dataHook: o, ...n }, d) => {
121
+ const { flush: f, density: c, variant: b } = s.useContext(p), u = s.useRef(null);
122
+ return s.useImperativeHandle(d, () => u.current, []), T(u, e), /* @__PURE__ */ i("div", {
123
+ ref: u,
124
+ className: l(R({ align: a }), v(f, c), c === "data" && "pt-4 pb-4", t && c === "default" && "pb-8", t && c === "condensed" && "pb-3", t && "border-border border-b", e && ["sticky top-0 z-10 rounded-t-xl", y[b]], r),
125
+ "data-divider": t ? "" : void 0,
126
+ "data-hook": o,
127
+ "data-slot": "card-header",
128
+ "data-sticky": e ? "" : void 0,
129
+ ...n
130
+ });
131
+ });
132
+ V.displayName = "CardHeader";
133
+ var S = m("", {
134
+ variants: { size: {
135
+ small: "text-heading-subsection",
136
+ default: "text-heading-section"
137
+ } },
138
+ defaultVariants: { size: "default" }
139
+ }), j = s.forwardRef(({ className: r, size: a = "default", level: t, asChild: e = !1, dataHook: o, ...n }, d) => {
140
+ const f = {
141
+ className: l(S({ size: a }), r),
142
+ "data-hook": o,
143
+ "data-slot": "card-title",
144
+ ...n
145
+ };
146
+ if (e) return /* @__PURE__ */ i(w, {
147
+ ref: d,
148
+ ...f
149
+ });
150
+ if (t) {
151
+ const c = `h${t}`;
152
+ return /* @__PURE__ */ i(c, {
153
+ ref: d,
154
+ ...f
155
+ });
156
156
  }
157
- }), D = s.forwardRef(
158
- ({ className: e, align: t, dataHook: a, ...r }, o) => /* @__PURE__ */ n(
159
- "div",
160
- {
161
- ref: o,
162
- className: l(V({ align: t }), e),
163
- "data-hook": a,
164
- "data-slot": "card-description",
165
- ...r
166
- }
167
- )
168
- );
169
- D.displayName = "CardDescription";
170
- const H = s.forwardRef(
171
- ({ className: e, dataHook: t, ...a }, r) => /* @__PURE__ */ n(
172
- "div",
173
- {
174
- ref: r,
175
- className: l(
176
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
177
- e
178
- ),
179
- "data-hook": t,
180
- "data-slot": "card-action",
181
- ...a
182
- }
183
- )
184
- );
157
+ return /* @__PURE__ */ i("div", {
158
+ ref: d,
159
+ ...f
160
+ });
161
+ });
162
+ j.displayName = "CardTitle";
163
+ var z = m("text-body-sm text-muted-foreground", { variants: { align: {
164
+ left: "text-left",
165
+ center: "text-center",
166
+ right: "text-right"
167
+ } } }), E = s.forwardRef(({ className: r, align: a, dataHook: t, ...e }, o) => /* @__PURE__ */ i("div", {
168
+ ref: o,
169
+ className: l(z({ align: a }), r),
170
+ "data-hook": t,
171
+ "data-slot": "card-description",
172
+ ...e
173
+ }));
174
+ E.displayName = "CardDescription";
175
+ var H = s.forwardRef(({ className: r, dataHook: a, ...t }, e) => /* @__PURE__ */ i("div", {
176
+ ref: e,
177
+ className: l("col-start-2 row-span-2 row-start-1 self-center justify-self-end", r),
178
+ "data-hook": a,
179
+ "data-slot": "card-action",
180
+ ...t
181
+ }));
185
182
  H.displayName = "CardAction";
186
- const T = s.forwardRef(
187
- ({ className: e, children: t, dataHook: a, ...r }, o) => {
188
- const { flush: i, density: d } = s.useContext(f);
189
- return /* @__PURE__ */ n(
190
- "div",
191
- {
192
- ref: o,
193
- className: l(m(i, d), e),
194
- "data-hook": a,
195
- "data-slot": "card-media",
196
- ...r,
197
- children: /* @__PURE__ */ n("div", { className: "overflow-hidden rounded-md", "data-slot": "card-media-clip", children: t })
198
- }
199
- );
200
- }
201
- );
202
- T.displayName = "CardMedia";
203
- const j = s.forwardRef(
204
- ({ className: e, dataHook: t, ...a }, r) => {
205
- const { flush: o, density: i } = s.useContext(f);
206
- return /* @__PURE__ */ n(
207
- "div",
208
- {
209
- ref: r,
210
- className: l(m(o, i), e),
211
- "data-hook": t,
212
- "data-slot": "card-content",
213
- ...a
214
- }
215
- );
216
- }
217
- );
218
- j.displayName = "CardContent";
219
- const E = s.forwardRef(
220
- ({ className: e, dataHook: t, ...a }, r) => {
221
- const { flush: o, density: i } = s.useContext(f);
222
- return /* @__PURE__ */ n(
223
- "div",
224
- {
225
- ref: r,
226
- className: l(
227
- "flex items-center",
228
- m(o, i),
229
- e
230
- ),
231
- "data-hook": t,
232
- "data-slot": "card-footer",
233
- ...a
234
- }
235
- );
236
- }
237
- );
238
- E.displayName = "CardFooter";
183
+ var _ = s.forwardRef(({ className: r, children: a, dataHook: t, ...e }, o) => {
184
+ const { flush: n, density: d } = s.useContext(p);
185
+ return /* @__PURE__ */ i("div", {
186
+ ref: o,
187
+ className: l(v(n, d), d === "data" && "pt-6", r),
188
+ "data-hook": t,
189
+ "data-slot": "card-media",
190
+ ...e,
191
+ children: /* @__PURE__ */ i("div", {
192
+ className: "overflow-hidden rounded-md",
193
+ "data-slot": "card-media-clip",
194
+ children: a
195
+ })
196
+ });
197
+ });
198
+ _.displayName = "CardMedia";
199
+ var D = s.forwardRef(({ className: r, flush: a = !1, dataHook: t, ...e }, o) => {
200
+ const { flush: n, density: d } = s.useContext(p);
201
+ return /* @__PURE__ */ i("div", {
202
+ ref: o,
203
+ className: l(a ? !1 : v(n, d), d === "data" && !a && "pt-6", r),
204
+ "data-flush": a ? "" : void 0,
205
+ "data-hook": t,
206
+ "data-slot": "card-content",
207
+ ...e
208
+ });
209
+ });
210
+ D.displayName = "CardContent";
211
+ var M = s.forwardRef(({ className: r, dataHook: a, ...t }, e) => /* @__PURE__ */ i("div", {
212
+ ref: e,
213
+ className: l("col-span-full mt-2 flex flex-wrap items-center gap-2 justify-self-stretch", "[&>[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", "[&>[data-slot=combobox-trigger]]:w-fit [&>[data-slot=select-trigger]]:w-fit", r),
214
+ "data-hook": a,
215
+ "data-slot": "card-toolbar",
216
+ ...t
217
+ }));
218
+ M.displayName = "CardToolbar";
219
+ var $ = s.forwardRef(({ className: r, value: a, trend: t, dataHook: e, ...o }, n) => /* @__PURE__ */ x("div", {
220
+ ref: n,
221
+ className: l("col-start-2 row-span-2 row-start-1 flex items-baseline gap-2 self-center justify-self-end", r),
222
+ "data-hook": e,
223
+ "data-slot": "card-metric",
224
+ ...o,
225
+ children: [/* @__PURE__ */ i("span", {
226
+ className: "text-metric",
227
+ "data-slot": "card-metric-value",
228
+ children: a
229
+ }), t]
230
+ }));
231
+ $.displayName = "CardMetric";
232
+ var O = s.forwardRef(({ className: r, dataHook: a, ...t }, e) => {
233
+ const { flush: o, density: n } = s.useContext(p);
234
+ return /* @__PURE__ */ i("div", {
235
+ ref: e,
236
+ className: l("flex items-center", v(o, n), n === "data" && "pt-6", r),
237
+ "data-hook": a,
238
+ "data-slot": "card-footer",
239
+ ...t
240
+ });
241
+ });
242
+ O.displayName = "CardFooter";
239
243
  export {
240
- N as Card,
244
+ k as Card,
241
245
  H as CardAction,
242
- j as CardContent,
243
- D as CardDescription,
244
- E as CardFooter,
245
- b as CardHeader,
246
- T as CardMedia,
247
- R as CardTitle
246
+ D as CardContent,
247
+ E as CardDescription,
248
+ O as CardFooter,
249
+ V as CardHeader,
250
+ _ as CardMedia,
251
+ $ as CardMetric,
252
+ j as CardTitle,
253
+ M as CardToolbar
248
254
  };