@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/chart.js CHANGED
@@ -1,546 +1,500 @@
1
- import { jsxs as b, jsx as s, Fragment as S } from "react/jsx-runtime";
2
- import * as k from "react";
3
- import * as N from "recharts";
4
- import { Area as J, AreaChart as Q, Bar as U, BarChart as Z, CartesianGrid as K, Cell as ee, Label as te, Legend as re, Tooltip as ne, Customized as ae, LabelList as le, Line as oe, LineChart as se, Pie as ie, PieChart as ce, PolarAngleAxis as de, PolarGrid as ue, PolarRadiusAxis as he, Radar as fe, RadarChart as pe, RadialBar as me, RadialBarChart as ge, Rectangle as Ce, ReferenceLine as be, ResponsiveContainer as xe, Sector as ve, XAxis as ke, YAxis as Ne } from "recharts";
5
- import { cn as p } from "@brightlocal/ui-components/lib/utils";
6
- const R = k.createContext(null);
7
- function P() {
8
- const t = k.useContext(R);
9
- if (!t)
10
- throw new Error("useChart must be used within a <ChartContainer />");
11
- return t;
1
+ "use client";
2
+ import { ChartEmpty as ot } from "./chart-empty.js";
3
+ import * as b from "react";
4
+ import { cn as x } from "@brightlocal/ui-components/lib/utils";
5
+ import { Fragment as A, jsx as i, jsxs as N } from "react/jsx-runtime";
6
+ import { Slot as j, Slottable as O } from "@radix-ui/react-slot";
7
+ import { cva as D } from "class-variance-authority";
8
+ import * as _ from "recharts";
9
+ import { Area as ut, AreaChart as ht, Bar as ft, BarChart as pt, CartesianGrid as mt, Cell as gt, Customized as vt, Label as Ct, LabelList as bt, Legend as xt, Line as yt, LineChart as kt, Pie as Nt, PieChart as Lt, PolarAngleAxis as _t, PolarGrid as wt, PolarRadiusAxis as $t, Radar as St, RadarChart as Pt, RadialBar as zt, RadialBarChart as Et, Rectangle as Rt, ReferenceLine as Tt, ResponsiveContainer as It, Sector as At, Tooltip as jt, XAxis as Ot, YAxis as Dt } from "recharts";
10
+ var $ = b.createContext(null);
11
+ function z() {
12
+ const e = b.useContext($);
13
+ if (!e) throw new Error("useChart must be used within a <ChartContainer />");
14
+ return e;
12
15
  }
13
- const j = k.forwardRef(
14
- ({
15
- id: t,
16
- className: r,
17
- children: l,
18
- config: e,
19
- dataHook: n,
20
- width: a,
21
- height: o,
22
- minWidth: d,
23
- minHeight: i,
24
- maxHeight: u,
25
- trackingEl: h,
26
- trackingLabel: g,
27
- ...m
28
- }, C) => {
29
- const x = k.useId(), f = `chart-${t || x.replace(/:/g, "")}`;
30
- return /* @__PURE__ */ s(R.Provider, { value: { config: e }, children: /* @__PURE__ */ b(
31
- "div",
32
- {
33
- ref: C,
34
- className: p(
35
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background text-body-xs flex aspect-video justify-center [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none",
36
- r
37
- ),
38
- "data-chart": f,
39
- "data-hook": n,
40
- "data-slot": "chart-container",
41
- "data-tracking-el": h,
42
- "data-tracking-label": g,
43
- ...m,
44
- children: [
45
- /* @__PURE__ */ s(T, { config: e, id: f }),
46
- /* @__PURE__ */ s(
47
- N.ResponsiveContainer,
48
- {
49
- height: o ?? "100%",
50
- initialDimension: { width: 1, height: 1 },
51
- maxHeight: u,
52
- minHeight: i,
53
- minWidth: d ?? 0,
54
- width: a ?? "100%",
55
- children: l
56
- }
57
- )
58
- ]
59
- }
60
- ) });
61
- }
62
- );
63
- j.displayName = "ChartContainer";
64
- function T({ id: t, config: r }) {
65
- const l = Object.entries(r).filter(
66
- ([, e]) => e.theme || e.color
67
- );
68
- return l.length ? /* @__PURE__ */ s(
69
- "style",
70
- {
71
- dangerouslySetInnerHTML: {
72
- __html: l.map(([e, n]) => {
73
- const a = typeof n.color == "string" ? n.color.replace(/^hsl\((.*)\)$/, "$1") : null;
74
- return a ? `
75
- [data-chart=${t}] {
76
- --color-${e}: ${a};
16
+ function E() {
17
+ return b.useContext($);
18
+ }
19
+ var V = b.forwardRef(({ id: e, className: a, children: o, config: t, dataHook: r, width: n, height: s, minWidth: d, minHeight: l, maxHeight: h, trackingEl: m, trackingLabel: g, ...v }, C) => {
20
+ const y = b.useId(), p = `chart-${e || y.replace(/:/g, "")}`, u = b.useRef(null), k = b.useCallback((f) => {
21
+ u.current = f, typeof C == "function" ? C(f) : C && (C.current = f);
22
+ }, [C]), c = typeof s == "number";
23
+ return /* @__PURE__ */ i($.Provider, {
24
+ value: {
25
+ config: t,
26
+ containerRef: u
27
+ },
28
+ children: /* @__PURE__ */ N("div", {
29
+ ref: k,
30
+ className: x("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-polar-radius-axis-tick-value]:fill-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-pie-sector]:stroke-background text-body-xs flex justify-center [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-pie-sector]:stroke-2 [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none [&_svg_g]:outline-none [&_svg_g]:focus:outline-none", c ? "aspect-auto" : "aspect-video", a),
31
+ "data-chart": p,
32
+ "data-hook": r,
33
+ "data-slot": "chart-container",
34
+ "data-tracking-el": m,
35
+ "data-tracking-label": g,
36
+ style: c ? { height: s } : void 0,
37
+ ...v,
38
+ children: [/* @__PURE__ */ i(W, {
39
+ config: t,
40
+ id: p
41
+ }), /* @__PURE__ */ i(_.ResponsiveContainer, {
42
+ height: s ?? "100%",
43
+ initialDimension: {
44
+ width: 1,
45
+ height: 1
46
+ },
47
+ maxHeight: h,
48
+ minHeight: l,
49
+ minWidth: d ?? 0,
50
+ width: n ?? "100%",
51
+ children: o
52
+ })]
53
+ })
54
+ });
55
+ });
56
+ V.displayName = "ChartContainer";
57
+ function W({ id: e, config: a }) {
58
+ const o = Object.entries(a).filter(([, t]) => t.theme || t.color);
59
+ return o.length ? /* @__PURE__ */ i("style", { dangerouslySetInnerHTML: { __html: o.map(([t, r]) => {
60
+ const n = typeof r.color == "string" ? r.color.replace(/^hsl\((.*)\)$/, "$1") : null;
61
+ return n ? `
62
+ [data-chart=${e}] {
63
+ --color-${t}: ${n};
77
64
  }
78
- ` : n.theme ? Object.entries(n.theme).map(
79
- ([o, d]) => `
80
- .${o} [data-chart=${t}] {
81
- --color-${e}: ${d.replace(/^hsl\((.*)\)$/, "$1")};
65
+ ` : r.theme ? Object.entries(r.theme).map(([s, d]) => `
66
+ .${s} [data-chart=${e}] {
67
+ --color-${t}: ${d.replace(/^hsl\((.*)\)$/, "$1")};
82
68
  }
83
- `
84
- ).join("") : "";
85
- }).join(`
86
- `)
87
- }
69
+ `).join("") : "";
70
+ }).join(`
71
+ `) } }) : null;
72
+ }
73
+ function P(e) {
74
+ return e == null || e === "" ? !1 : typeof e == "number" ? Number.isFinite(e) : !0;
75
+ }
76
+ var G = 50;
77
+ function M(e) {
78
+ const [a, o] = b.useState(null);
79
+ return b.useEffect(() => {
80
+ if (!e) {
81
+ o(null);
82
+ return;
88
83
  }
89
- ) : null;
84
+ const t = document.createElement("div");
85
+ return t.setAttribute("data-slot", "chart-tooltip-portal"), document.body.appendChild(t), o(t), () => {
86
+ document.body.removeChild(t);
87
+ };
88
+ }, [e]), a;
90
89
  }
91
- function $(t) {
92
- return t == null || t === "" ? !1 : typeof t == "number" ? Number.isFinite(t) : !0;
90
+ function H(e, a) {
91
+ b.useEffect(() => {
92
+ const o = e?.current;
93
+ if (!o) return;
94
+ const t = a ?? o;
95
+ let r = !1;
96
+ function n() {
97
+ const l = t.querySelector(".recharts-tooltip-wrapper");
98
+ l && (l.style.visibility = "hidden");
99
+ }
100
+ function s(l) {
101
+ r = !0;
102
+ const h = l.target;
103
+ !o.contains(h) && !t.contains(h) && (n(), r = !1);
104
+ }
105
+ function d() {
106
+ r && (n(), r = !1);
107
+ }
108
+ return document.addEventListener("touchstart", s, { passive: !0 }), window.addEventListener("scroll", d, {
109
+ passive: !0,
110
+ capture: !0
111
+ }), () => {
112
+ document.removeEventListener("touchstart", s), window.removeEventListener("scroll", d, { capture: !0 });
113
+ };
114
+ }, [e, a]);
93
115
  }
94
- function A({ ...t }) {
95
- return /* @__PURE__ */ s(N.Tooltip, { ...t });
116
+ function q({ portal: e, wrapperStyle: a, allowEscapeViewBox: o, ...t }) {
117
+ const r = E(), n = M(e !== null);
118
+ return H(r?.containerRef, n), /* @__PURE__ */ i(_.Tooltip, {
119
+ allowEscapeViewBox: o ?? {
120
+ x: !0,
121
+ y: !0
122
+ },
123
+ portal: e !== void 0 ? e : n,
124
+ wrapperStyle: {
125
+ zIndex: G,
126
+ ...a
127
+ },
128
+ ...t
129
+ });
96
130
  }
97
- A.displayName = "ChartTooltip";
98
- function W({
99
- active: t,
100
- payload: r,
101
- className: l,
102
- indicator: e = "dot",
103
- hideLabel: n = !1,
104
- hideIndicator: a = !1,
105
- label: o,
106
- labelFormatter: d,
107
- labelClassName: i,
108
- formatter: u,
109
- color: h,
110
- nameKey: g,
111
- labelKey: m
112
- }) {
113
- const { config: C } = P(), x = k.useMemo(() => {
114
- if (n || !r?.length)
115
- return null;
116
- const [c] = r;
117
- if (!c)
118
- return null;
119
- const L = `${m || c.dataKey || c.name || "value"}`, y = C[L], v = !m && typeof o == "string" ? C[o]?.label || o : y?.label;
120
- return d ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: d(v, r) }) : v ? /* @__PURE__ */ s("div", { className: p("font-medium", i), children: v }) : null;
131
+ q.displayName = "ChartTooltip";
132
+ function F({ active: e, payload: a, className: o, indicator: t = "dot", hideLabel: r = !1, hideIndicator: n = !1, label: s, labelFormatter: d, labelClassName: l, formatter: h, color: m, nameKey: g, labelKey: v }) {
133
+ const { config: C } = z(), y = b.useMemo(() => {
134
+ if (r || !a?.length) return null;
135
+ const [u] = a;
136
+ if (!u) return null;
137
+ const k = `${v || u.dataKey || u.name || "value"}`, c = C[k], f = !v && typeof s == "string" ? C[s]?.label || s : c?.label;
138
+ return d ? /* @__PURE__ */ i("div", {
139
+ className: x("font-medium", l),
140
+ children: d(f, a)
141
+ }) : f ? /* @__PURE__ */ i("div", {
142
+ className: x("font-medium", l),
143
+ children: f
144
+ }) : null;
121
145
  }, [
122
- o,
146
+ s,
123
147
  d,
148
+ a,
124
149
  r,
125
- n,
126
- i,
150
+ l,
127
151
  C,
128
- m
152
+ v
129
153
  ]);
130
- if (!t || !r?.length)
131
- return null;
132
- const f = r.length === 1 && e !== "dot";
133
- return /* @__PURE__ */ b(
134
- "div",
135
- {
136
- className: p(
137
- "border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl",
138
- l
139
- ),
140
- "data-slot": "chart-tooltip-content",
141
- children: [
142
- f ? null : x,
143
- /* @__PURE__ */ s("div", { className: "grid gap-1.5", children: r.map((c, L) => {
144
- const y = `${g || c.name || c.dataKey || "value"}`, v = C[y], _ = h || c.color || c.payload.fill || `var(--color-${y})`;
145
- return /* @__PURE__ */ s(
146
- "div",
147
- {
148
- className: p(
149
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2",
150
- e === "dot" && "items-center"
151
- ),
152
- "data-slot": "chart-tooltip-item",
153
- children: u && $(c.value) && c.name ? u(c.value, c.name, c, L, r) : /* @__PURE__ */ b(S, { children: [
154
- v?.icon && !a ? /* @__PURE__ */ s(v.icon, { size: 10 }) : !a && /* @__PURE__ */ s(
155
- "div",
156
- {
157
- className: p("shrink-0 rounded-[2px]", {
158
- "h-2.5 w-2.5": e === "dot",
159
- "w-1": e === "line",
160
- "w-0 border-[1.5px] border-dashed bg-transparent": e === "dashed",
161
- "my-0.5": f && e === "dashed"
162
- }),
163
- style: {
164
- backgroundColor: e === "dashed" ? "transparent" : _,
165
- borderColor: _
166
- }
167
- }
168
- ),
169
- /* @__PURE__ */ b(
170
- "div",
171
- {
172
- className: p(
173
- "flex flex-1 justify-between gap-2 leading-none",
174
- f ? "items-end" : "items-center"
175
- ),
176
- children: [
177
- /* @__PURE__ */ b("div", { className: "grid gap-1.5", children: [
178
- f ? x : null,
179
- /* @__PURE__ */ s(
180
- "span",
181
- {
182
- className: "text-muted-foreground",
183
- "data-slot": "chart-tooltip-item-name",
184
- children: v?.label || c.name
185
- }
186
- )
187
- ] }),
188
- $(c.value) && /* @__PURE__ */ s(
189
- "span",
190
- {
191
- className: "text-foreground tabular-nums",
192
- "data-slot": "chart-tooltip-item-value",
193
- children: typeof c.value == "number" ? c.value.toLocaleString() : c.value
194
- }
195
- )
196
- ]
197
- }
198
- )
199
- ] })
200
- },
201
- c.dataKey
202
- );
203
- }) })
204
- ]
205
- }
206
- );
154
+ if (!e || !a?.length) return null;
155
+ const p = a.length === 1 && t !== "dot";
156
+ return /* @__PURE__ */ N("div", {
157
+ className: x("border-border/50 bg-background text-body-xs grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 shadow-xl", o),
158
+ "data-slot": "chart-tooltip-content",
159
+ children: [p ? null : y, /* @__PURE__ */ i("div", {
160
+ className: "grid gap-1.5",
161
+ children: a.map((u, k) => {
162
+ const c = `${g || u.name || u.dataKey || "value"}`, f = C[c], L = m || u.color || u.payload.fill || `var(--color-${c})`;
163
+ return /* @__PURE__ */ i("div", {
164
+ className: x("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2", t === "dot" && "items-center"),
165
+ "data-slot": "chart-tooltip-item",
166
+ children: h && P(u.value) && u.name ? h(u.value, u.name, u, k, a) : /* @__PURE__ */ N(A, { children: [f?.icon && !n ? /* @__PURE__ */ i(f.icon, { size: 10 }) : !n && /* @__PURE__ */ i("div", {
167
+ className: x("shrink-0 rounded-[2px]", {
168
+ "h-2.5 w-2.5": t === "dot",
169
+ "w-1": t === "line",
170
+ "w-0 border-[1.5px] border-dashed bg-transparent": t === "dashed",
171
+ "my-0.5": p && t === "dashed"
172
+ }),
173
+ style: {
174
+ backgroundColor: t === "dashed" ? "transparent" : L,
175
+ borderColor: L
176
+ }
177
+ }), /* @__PURE__ */ N("div", {
178
+ className: x("flex flex-1 justify-between gap-2 leading-none", p ? "items-end" : "items-center"),
179
+ children: [/* @__PURE__ */ N("div", {
180
+ className: "grid gap-1.5",
181
+ children: [p ? y : null, /* @__PURE__ */ i("span", {
182
+ className: "text-muted-foreground",
183
+ "data-slot": "chart-tooltip-item-name",
184
+ children: f?.label || u.name
185
+ })]
186
+ }), P(u.value) && /* @__PURE__ */ i("span", {
187
+ className: "text-foreground tabular-nums",
188
+ "data-slot": "chart-tooltip-item-value",
189
+ children: typeof u.value == "number" ? u.value.toLocaleString() : u.value
190
+ })]
191
+ })] })
192
+ }, u.dataKey);
193
+ })
194
+ })]
195
+ });
207
196
  }
208
- W.displayName = "ChartTooltipContent";
209
- function D({ ...t }) {
210
- return /* @__PURE__ */ s(N.Legend, { ...t });
197
+ F.displayName = "ChartTooltipContent";
198
+ function X({ ...e }) {
199
+ return /* @__PURE__ */ i(_.Legend, { ...e });
211
200
  }
212
- D.displayName = "ChartLegend";
213
- function G({
214
- className: t,
215
- hideIcon: r = !1,
216
- payload: l,
217
- verticalAlign: e = "bottom",
218
- nameKey: n
219
- }) {
220
- const { config: a } = P();
221
- return l?.length ? /* @__PURE__ */ s(
222
- "div",
223
- {
224
- className: p(
225
- "flex items-center justify-center gap-4",
226
- e === "top" ? "pb-4" : "pt-4",
227
- t
228
- ),
229
- "data-slot": "chart-legend-content",
230
- children: l.map((o) => {
231
- const d = `${n || o.dataKey || "value"}`, i = a[d];
232
- return /* @__PURE__ */ b(
233
- "div",
234
- {
235
- className: p(
236
- "[&>svg]:text-muted-foreground flex items-center gap-1.5"
237
- ),
238
- children: [
239
- i?.icon && !r ? /* @__PURE__ */ s(i.icon, { size: 12 }) : /* @__PURE__ */ s(
240
- "div",
241
- {
242
- className: "h-2 w-2 shrink-0 rounded-[2px]",
243
- style: {
244
- backgroundColor: o.color
245
- }
246
- }
247
- ),
248
- i?.label || o.value
249
- ]
250
- },
251
- o.value
252
- );
201
+ X.displayName = "ChartLegend";
202
+ var R = b.forwardRef(({ asChild: e = !1, children: a, className: o, color: t, dataHook: r, hidden: n = !1, hideIcon: s = !1, muted: d = !1, seriesKey: l, trackingEl: h, trackingLabel: m, value: g, ...v }, C) => {
203
+ const y = E(), p = l ? y?.config[l] : void 0, u = t ?? p?.color ?? (l ? `var(--color-${l})` : void 0), k = !!l && !t && (!y || !!y.standalone && !p?.color);
204
+ b.useEffect(() => {
205
+ process.env.NODE_ENV !== "production" && k && console.warn(`ChartLegendItem: seriesKey="${l}" has no colour to resolve — render it inside a ChartContainer, give the ChartLegendList config a \`color\` for this key (a \`theme\` only resolves inside a container), or set \`color\`.`);
206
+ }, [l, k]);
207
+ const c = e ? j : "div", f = a ?? p?.label ?? l;
208
+ return /* @__PURE__ */ N(c, {
209
+ ref: C,
210
+ className: x("[&>svg]:text-muted-foreground focus-visible:shadow-default flex items-center gap-1.5 rounded-sm outline-none group-data-[size=md]/legend:gap-2 [&>svg]:size-3 group-data-[size=md]/legend:[&>svg]:size-3.5", (d || n) && "text-muted-foreground", n && "line-through [&_:is(button,a)]:line-through", o),
211
+ "data-hidden": n || void 0,
212
+ "data-hook": r,
213
+ "data-muted": d || n || void 0,
214
+ "data-slot": "chart-legend-item",
215
+ "data-tracking-el": h,
216
+ "data-tracking-label": m,
217
+ ...v,
218
+ children: [
219
+ p?.icon && !s ? /* @__PURE__ */ i(p.icon, { size: 12 }) : /* @__PURE__ */ i("span", {
220
+ "aria-hidden": "true",
221
+ className: x("duration-fast block size-2 shrink-0 rounded-[2px] transition-opacity ease-out group-data-[size=md]/legend:size-2.5", (d || n) && "opacity-40"),
222
+ "data-slot": "chart-legend-item-swatch",
223
+ style: { backgroundColor: u }
224
+ }),
225
+ /* @__PURE__ */ i(O, { children: f }),
226
+ g != null && /* @__PURE__ */ i("span", {
227
+ className: "ml-auto pl-0.5 tabular-nums",
228
+ "data-slot": "chart-legend-item-value",
229
+ children: /* @__PURE__ */ i("span", {
230
+ className: "inline-block",
231
+ children: g
232
+ })
253
233
  })
234
+ ]
235
+ });
236
+ });
237
+ R.displayName = "ChartLegendItem";
238
+ var Y = D("group/legend flex", {
239
+ variants: {
240
+ size: {
241
+ sm: "text-body-xs",
242
+ md: "text-body-sm"
243
+ },
244
+ orientation: {
245
+ horizontal: "flex-wrap items-center justify-center gap-x-4 gap-y-1",
246
+ vertical: "flex-col items-stretch gap-3"
254
247
  }
255
- ) : null;
248
+ },
249
+ defaultVariants: {
250
+ orientation: "horizontal",
251
+ size: "sm"
252
+ }
253
+ }), T = b.forwardRef(({ ariaLabel: e, children: a, className: o, config: t, dataHook: r, orientation: n = "horizontal", size: s = "sm", trackingEl: d, trackingLabel: l, ...h }, m) => {
254
+ const g = b.useMemo(() => t ? {
255
+ config: t,
256
+ standalone: !0
257
+ } : null, [t]), v = /* @__PURE__ */ i("div", {
258
+ ref: m,
259
+ "aria-label": e ?? "Chart legend",
260
+ className: x(Y({
261
+ orientation: n,
262
+ size: s
263
+ }), o),
264
+ "data-hook": r,
265
+ "data-orientation": n,
266
+ "data-size": s,
267
+ "data-slot": "chart-legend-list",
268
+ "data-tracking-el": d,
269
+ "data-tracking-label": l,
270
+ role: "group",
271
+ ...h,
272
+ children: a
273
+ });
274
+ return g ? /* @__PURE__ */ i($.Provider, {
275
+ value: g,
276
+ children: v
277
+ }) : v;
278
+ });
279
+ T.displayName = "ChartLegendList";
280
+ var Z = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
281
+ function B({ ariaLabel: e, className: a, dataHook: o = "chart-legend", hideIcon: t = !1, nameKey: r, orientation: n = "horizontal", payload: s, renderItem: d, showValue: l = !1, size: h = "sm", sortBy: m, valueFormatter: g, valueKey: v, verticalAlign: C = "bottom" }) {
282
+ const { config: y } = z();
283
+ if (!s?.length) return null;
284
+ const p = (c) => {
285
+ const f = c.dataKey !== void 0 && c.payload?.dataKey === c.dataKey;
286
+ return String((r ? c.payload?.[r] : void 0) ?? (f ? c.dataKey : c.value ?? c.dataKey));
287
+ }, u = (c) => {
288
+ const f = Array.isArray(m) ? m.indexOf(p(c)) : -1;
289
+ return f === -1 ? Number.POSITIVE_INFINITY : f;
290
+ }, k = m ? [...s].sort(Array.isArray(m) ? (c, f) => {
291
+ const L = u(c), w = u(f);
292
+ return L === w ? 0 : L - w;
293
+ } : m) : s;
294
+ return /* @__PURE__ */ i(T, {
295
+ ariaLabel: e,
296
+ className: x(C === "top" && "pb-4", C === "bottom" && "pt-4", a),
297
+ "data-slot": "chart-legend-content",
298
+ dataHook: o,
299
+ orientation: n,
300
+ size: h,
301
+ children: k.map((c) => {
302
+ const f = p(c), L = y[f], w = l ? g ? g(c) : c.payload?.[v ?? c.dataKey ?? "value"] : void 0, S = /* @__PURE__ */ i(R, {
303
+ color: c.color,
304
+ dataHook: `${o}-${Z(f)}`,
305
+ hideIcon: t,
306
+ seriesKey: f,
307
+ value: w,
308
+ children: L?.label || c.value
309
+ }, c.value);
310
+ return d ? /* @__PURE__ */ i(b.Fragment, { children: d(c, S) }, c.value) : S;
311
+ })
312
+ });
256
313
  }
257
- G.displayName = "ChartLegendContent";
258
- function w({
259
- colorKey: t,
260
- color: r,
261
- fill: l,
262
- stroke: e,
263
- payload: n
264
- }) {
265
- return (t && typeof n?.[t] == "string" ? n[t] : void 0) ?? r ?? l ?? e ?? "currentColor";
314
+ B.displayName = "ChartLegendContent";
315
+ function I({ colorKey: e, color: a, fill: o, stroke: t, payload: r }) {
316
+ return (e && typeof r?.[e] == "string" ? r[e] : void 0) ?? a ?? o ?? t ?? "currentColor";
266
317
  }
267
- function M({
268
- size: t = 8,
269
- custom: r = !1,
270
- color: l,
271
- colorKey: e,
272
- cx: n,
273
- cy: a,
274
- stroke: o,
275
- fill: d,
276
- payload: i
277
- }) {
278
- if (n == null || a == null)
279
- return null;
280
- const u = w({
281
- colorKey: e,
282
- color: l,
318
+ function J({ size: e = 8, custom: a = !1, color: o, colorKey: t, cx: r, cy: n, stroke: s, fill: d, payload: l }) {
319
+ if (r == null || n == null) return null;
320
+ const h = I({
321
+ colorKey: t,
322
+ color: o,
283
323
  fill: d,
284
- stroke: o,
285
- payload: i
324
+ stroke: s,
325
+ payload: l
326
+ });
327
+ return /* @__PURE__ */ i("circle", {
328
+ className: a ? "fill-background" : void 0,
329
+ cx: r,
330
+ cy: n,
331
+ "data-slot": "chart-dot",
332
+ fill: a ? void 0 : h,
333
+ r: e / 2,
334
+ stroke: a ? h : "none",
335
+ strokeWidth: a ? 2 : void 0
286
336
  });
287
- return /* @__PURE__ */ s(
288
- "circle",
289
- {
290
- className: r ? "fill-background" : void 0,
291
- cx: n,
292
- cy: a,
293
- "data-slot": "chart-dot",
294
- fill: r ? void 0 : u,
295
- r: t / 2,
296
- stroke: r ? u : "none",
297
- strokeWidth: r ? 2 : void 0
298
- }
299
- );
300
337
  }
301
- M.displayName = "ChartDot";
302
- function z({
303
- size: t = 6,
304
- color: r,
305
- colorKey: l,
306
- cx: e,
307
- cy: n,
308
- stroke: a,
309
- fill: o,
310
- payload: d
311
- }) {
312
- if (e == null || n == null)
313
- return null;
314
- const i = w({
315
- colorKey: l,
316
- color: r,
317
- fill: o,
318
- stroke: a,
338
+ J.displayName = "ChartDot";
339
+ function Q({ size: e = 6, color: a, colorKey: o, cx: t, cy: r, stroke: n, fill: s, payload: d }) {
340
+ if (t == null || r == null) return null;
341
+ const l = I({
342
+ colorKey: o,
343
+ color: a,
344
+ fill: s,
345
+ stroke: n,
319
346
  payload: d
320
347
  });
321
- return /* @__PURE__ */ s(
322
- "circle",
323
- {
324
- className: "stroke-background",
325
- cx: e,
326
- cy: n,
327
- "data-slot": "chart-dot-on-stroke",
328
- fill: i,
329
- r: t / 2,
330
- strokeWidth: 2
331
- }
332
- );
348
+ return /* @__PURE__ */ i("circle", {
349
+ className: "stroke-background",
350
+ cx: t,
351
+ cy: r,
352
+ "data-slot": "chart-dot-on-stroke",
353
+ fill: l,
354
+ r: e / 2,
355
+ strokeWidth: 2
356
+ });
333
357
  }
334
- z.displayName = "ChartDotOnStroke";
335
- function I({
336
- type: t = "default",
337
- filled: r = !1,
338
- fillColor: l = "var(--chart-teal)",
339
- fillOpacity: e = 0.2,
340
- boundaryOnly: n = !1,
341
- radialLines: a,
342
- className: o,
343
- ...d
344
- }) {
345
- const i = t === "circle" ? "circle" : "polygon", h = n ? `[&_.${i === "circle" ? "recharts-polar-grid-concentric-circle" : "recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent` : void 0;
346
- return r ? /* @__PURE__ */ s(
347
- N.PolarGrid,
348
- {
349
- className: p(h, o),
350
- fill: l,
351
- fillOpacity: e,
352
- gridType: i,
353
- radialLines: a ?? !1,
354
- stroke: "none",
355
- ...d
356
- }
357
- ) : /* @__PURE__ */ s(
358
- N.PolarGrid,
359
- {
360
- className: p(h, o),
361
- gridType: i,
362
- radialLines: a,
363
- ...d
364
- }
365
- );
358
+ Q.displayName = "ChartDotOnStroke";
359
+ function U({ type: e = "default", filled: a = !1, fillColor: o = "var(--chart-teal)", fillOpacity: t = 0.2, boundaryOnly: r = !1, radialLines: n, className: s, ...d }) {
360
+ const l = e === "circle" ? "circle" : "polygon", h = r ? `[&_.${l === "circle" ? "recharts-polar-grid-concentric-circle" : "recharts-polar-grid-concentric-polygon"}:not(:last-of-type)]:stroke-transparent` : void 0;
361
+ return a ? /* @__PURE__ */ i(_.PolarGrid, {
362
+ className: x(h, s),
363
+ fill: o,
364
+ fillOpacity: t,
365
+ gridType: l,
366
+ radialLines: n ?? !1,
367
+ stroke: "none",
368
+ ...d
369
+ }) : /* @__PURE__ */ i(_.PolarGrid, {
370
+ className: x(h, s),
371
+ gridType: l,
372
+ radialLines: n,
373
+ ...d
374
+ });
366
375
  }
367
- I.displayName = "ChartRadarGrid";
368
- function O({
369
- type: t = "default",
370
- data: r,
371
- primaryKey: l,
372
- secondaryKey: e,
373
- x: n,
374
- y: a,
375
- textAnchor: o,
376
- payload: d,
377
- index: i
378
- }) {
379
- const u = r != null && i != null ? r[i] : void 0, h = u && l != null ? u[l] : void 0, g = u && e != null ? u[e] : void 0, m = t === "default" && h != null ? g != null ? `${String(h)}/${String(g)}` : String(h) : null;
380
- return /* @__PURE__ */ b(
381
- "text",
382
- {
383
- className: "text-body-xs",
384
- "data-slot": "chart-radar-label-wrapper",
385
- textAnchor: o,
386
- x: n,
387
- y: a,
388
- children: [
389
- m != null && /* @__PURE__ */ s("tspan", { className: "fill-card-foreground", dy: "-0.5em", x: n, children: m }),
390
- /* @__PURE__ */ s(
391
- "tspan",
392
- {
393
- className: "fill-muted-foreground",
394
- dy: m != null ? "1.2em" : void 0,
395
- x: n,
396
- children: d?.value
397
- }
398
- )
399
- ]
400
- }
401
- );
376
+ U.displayName = "ChartRadarGrid";
377
+ function K({ type: e = "default", data: a, primaryKey: o, secondaryKey: t, x: r, y: n, textAnchor: s, payload: d, index: l }) {
378
+ const h = a != null && l != null ? a[l] : void 0, m = h && o != null ? h[o] : void 0, g = h && t != null ? h[t] : void 0, v = e === "default" && m != null ? g != null ? `${String(m)}/${String(g)}` : String(m) : null;
379
+ return /* @__PURE__ */ N("text", {
380
+ className: "text-body-xs",
381
+ "data-slot": "chart-radar-label-wrapper",
382
+ textAnchor: s,
383
+ x: r,
384
+ y: n,
385
+ children: [v != null && /* @__PURE__ */ i("tspan", {
386
+ className: "fill-card-foreground",
387
+ dy: "-0.5em",
388
+ x: r,
389
+ children: v
390
+ }), /* @__PURE__ */ i("tspan", {
391
+ className: "fill-muted-foreground",
392
+ dy: v != null ? "1.2em" : void 0,
393
+ x: r,
394
+ children: d?.value
395
+ })]
396
+ });
402
397
  }
403
- O.displayName = "ChartRadarLabelWrapper";
404
- function B({
405
- nameKey: t,
406
- config: r,
407
- radiusRatio: l = 0.5,
408
- cx: e,
409
- cy: n,
410
- midAngle: a = 0,
411
- innerRadius: o = 0,
412
- outerRadius: d = 0,
413
- payload: i,
414
- name: u
415
- }) {
416
- if (e == null || n == null)
417
- return null;
418
- const h = Math.PI / 180, g = o + (d - o) * l, m = e + g * Math.cos(-a * h), C = n + g * Math.sin(-a * h), x = t != null && i != null ? i[t] : void 0, f = x != null ? String(x) : u, c = f != null ? r?.[f]?.label ?? f : f;
419
- return /* @__PURE__ */ s(
420
- "text",
421
- {
422
- className: "fill-foreground text-body-xs",
423
- "data-slot": "chart-pie-label-list",
424
- dominantBaseline: "middle",
425
- textAnchor: "middle",
426
- x: m,
427
- y: C,
428
- children: c
429
- }
430
- );
398
+ K.displayName = "ChartRadarLabelWrapper";
399
+ function tt({ nameKey: e, config: a, radiusRatio: o = 0.5, cx: t, cy: r, midAngle: n = 0, innerRadius: s = 0, outerRadius: d = 0, payload: l, name: h }) {
400
+ if (t == null || r == null) return null;
401
+ const m = Math.PI / 180, g = s + (d - s) * o, v = t + g * Math.cos(-n * m), C = r + g * Math.sin(-n * m), y = e != null && l != null ? l[e] : void 0, p = y != null ? String(y) : h, u = p != null ? a?.[p]?.label ?? p : p;
402
+ return /* @__PURE__ */ i("text", {
403
+ className: "fill-foreground text-body-xs",
404
+ "data-slot": "chart-pie-label-list",
405
+ dominantBaseline: "middle",
406
+ textAnchor: "middle",
407
+ x: v,
408
+ y: C,
409
+ children: u
410
+ });
431
411
  }
432
- B.displayName = "ChartPieLabelList";
433
- function V({
434
- valueKey: t,
435
- x: r,
436
- y: l,
437
- textAnchor: e,
438
- payload: n,
439
- value: a
440
- }) {
441
- if (r == null || l == null)
442
- return null;
443
- const o = t != null && n != null ? n[t] : a;
444
- return /* @__PURE__ */ s(
445
- "text",
446
- {
447
- className: "fill-foreground text-body-xs",
448
- "data-slot": "chart-pie-label-wrapper",
449
- dominantBaseline: "middle",
450
- textAnchor: e,
451
- x: r,
452
- y: l,
453
- children: o
454
- }
455
- );
412
+ tt.displayName = "ChartPieLabelList";
413
+ function et({ valueKey: e, x: a, y: o, textAnchor: t, payload: r, value: n }) {
414
+ if (a == null || o == null) return null;
415
+ const s = e != null && r != null ? r[e] : n;
416
+ return /* @__PURE__ */ i("text", {
417
+ className: "fill-foreground text-body-xs",
418
+ "data-slot": "chart-pie-label-wrapper",
419
+ dominantBaseline: "middle",
420
+ textAnchor: t,
421
+ x: a,
422
+ y: o,
423
+ children: s
424
+ });
456
425
  }
457
- V.displayName = "ChartPieLabelWrapper";
458
- const q = {
426
+ et.displayName = "ChartPieLabelWrapper";
427
+ var rt = {
459
428
  "2xl": "text-metric",
460
429
  "3xl": "font-sans text-3xl font-semibold",
461
430
  "4xl": "font-sans text-4xl font-semibold"
462
431
  };
463
- function E({
464
- primary: t,
465
- secondary: r,
466
- size: l = "3xl",
467
- viewBox: e
468
- }) {
469
- if (e == null || typeof e != "object" || !("cx" in e) || !("cy" in e))
470
- return null;
471
- const { cx: n, cy: a } = e;
472
- return /* @__PURE__ */ b(
473
- "text",
474
- {
475
- "data-slot": "chart-center-label",
476
- dominantBaseline: "middle",
477
- textAnchor: "middle",
478
- x: n,
479
- y: a,
480
- children: [
481
- /* @__PURE__ */ s(
482
- "tspan",
483
- {
484
- className: p("fill-foreground", q[l]),
485
- x: n,
486
- y: a,
487
- children: t
488
- }
489
- ),
490
- r != null && /* @__PURE__ */ s(
491
- "tspan",
492
- {
493
- className: "fill-muted-foreground text-body-xs",
494
- x: n,
495
- y: a + 24,
496
- children: r
497
- }
498
- )
499
- ]
500
- }
501
- );
432
+ function at({ primary: e, secondary: a, size: o = "3xl", viewBox: t }) {
433
+ if (t == null || typeof t != "object" || !("cx" in t) || !("cy" in t)) return null;
434
+ const { cx: r, cy: n } = t;
435
+ return /* @__PURE__ */ N("text", {
436
+ "data-slot": "chart-center-label",
437
+ dominantBaseline: "middle",
438
+ textAnchor: "middle",
439
+ x: r,
440
+ y: n,
441
+ children: [/* @__PURE__ */ i("tspan", {
442
+ className: x("fill-foreground", rt[o]),
443
+ x: r,
444
+ y: n,
445
+ children: e
446
+ }), a != null && /* @__PURE__ */ i("tspan", {
447
+ className: "fill-muted-foreground text-body-xs",
448
+ x: r,
449
+ y: n + 24,
450
+ children: a
451
+ })]
452
+ });
502
453
  }
503
- E.displayName = "ChartCenterLabel";
454
+ at.displayName = "ChartCenterLabel";
504
455
  export {
505
- J as Area,
506
- Q as AreaChart,
507
- U as Bar,
508
- Z as BarChart,
509
- K as CartesianGrid,
510
- ee as Cell,
511
- E as ChartCenterLabel,
512
- j as ChartContainer,
513
- M as ChartDot,
514
- z as ChartDotOnStroke,
515
- te as ChartLabel,
516
- D as ChartLegend,
517
- G as ChartLegendContent,
518
- B as ChartPieLabelList,
519
- V as ChartPieLabelWrapper,
520
- I as ChartRadarGrid,
521
- O as ChartRadarLabelWrapper,
522
- T as ChartStyle,
523
- A as ChartTooltip,
524
- W as ChartTooltipContent,
525
- re as ChartsLegend,
526
- ne as ChartsTooltip,
527
- ae as Customized,
528
- le as LabelList,
529
- oe as Line,
530
- se as LineChart,
531
- ie as Pie,
532
- ce as PieChart,
533
- de as PolarAngleAxis,
534
- ue as PolarGrid,
535
- he as PolarRadiusAxis,
536
- fe as Radar,
537
- pe as RadarChart,
538
- me as RadialBar,
539
- ge as RadialBarChart,
540
- Ce as Rectangle,
541
- be as ReferenceLine,
542
- xe as ResponsiveContainer,
543
- ve as Sector,
544
- ke as XAxis,
545
- Ne as YAxis
456
+ ut as Area,
457
+ ht as AreaChart,
458
+ ft as Bar,
459
+ pt as BarChart,
460
+ mt as CartesianGrid,
461
+ gt as Cell,
462
+ at as ChartCenterLabel,
463
+ V as ChartContainer,
464
+ J as ChartDot,
465
+ Q as ChartDotOnStroke,
466
+ ot as ChartEmpty,
467
+ Ct as ChartLabel,
468
+ X as ChartLegend,
469
+ B as ChartLegendContent,
470
+ R as ChartLegendItem,
471
+ T as ChartLegendList,
472
+ tt as ChartPieLabelList,
473
+ et as ChartPieLabelWrapper,
474
+ U as ChartRadarGrid,
475
+ K as ChartRadarLabelWrapper,
476
+ W as ChartStyle,
477
+ q as ChartTooltip,
478
+ F as ChartTooltipContent,
479
+ xt as ChartsLegend,
480
+ jt as ChartsTooltip,
481
+ vt as Customized,
482
+ bt as LabelList,
483
+ yt as Line,
484
+ kt as LineChart,
485
+ Nt as Pie,
486
+ Lt as PieChart,
487
+ _t as PolarAngleAxis,
488
+ wt as PolarGrid,
489
+ $t as PolarRadiusAxis,
490
+ St as Radar,
491
+ Pt as RadarChart,
492
+ zt as RadialBar,
493
+ Et as RadialBarChart,
494
+ Rt as Rectangle,
495
+ Tt as ReferenceLine,
496
+ It as ResponsiveContainer,
497
+ At as Sector,
498
+ Ot as XAxis,
499
+ Dt as YAxis
546
500
  };