@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/map.js CHANGED
@@ -1,40 +1,63 @@
1
- import { jsx as c, jsxs as y } from "react/jsx-runtime";
2
- import * as u from "react";
3
- import { cva as K } from "class-variance-authority";
4
- import { Map as W, RefreshCw as U, TriangleAlert as Y, Store as Z } from "@brightlocal/icons";
5
- import { GlobeyFixingFault as q, MapBackground as H } from "@brightlocal/illustrations";
1
+ "use client";
2
+ import { EmptyCanvas as B } from "./lib/empty-canvas.js";
3
+ import * as d from "react";
4
+ import { Map as G, RefreshCw as K, Store as W, TriangleAlert as U } from "@brightlocal/icons";
5
+ import { cn as u } from "@brightlocal/ui-components/lib/utils";
6
+ import { jsx as c, jsxs as g } from "react/jsx-runtime";
7
+ import { cva as Y } from "class-variance-authority";
6
8
  import { Button as T } from "@brightlocal/ui-components/button";
7
- import { Card as J, CardContent as Q } from "@brightlocal/ui-components/card";
8
- import { cn as g } from "@brightlocal/ui-components/lib/utils";
9
- import { Popover as X, PopoverAnchor as ee, PopoverContent as te } from "@brightlocal/ui-components/popover";
10
- import { EmptyCanvas as ae } from "./lib/empty-canvas.js";
11
- const Oe = {
12
- /** Default road map view */
9
+ import { Popover as Z, PopoverAnchor as q, PopoverContent as H } from "@brightlocal/ui-components/popover";
10
+ import { GlobeyFixingFault as J, MapBackground as Q } from "@brightlocal/illustrations";
11
+ import { Card as X, CardContent as ee } from "@brightlocal/ui-components/card";
12
+ var Ee = {
13
13
  ROADMAP: "roadmap",
14
- /** @deprecated Satellite imagery — prefer cloud-based map styling via Map ID */
15
14
  SATELLITE: "satellite"
16
- }, re = ["water", "landscape", "road", "poi", "transit"];
17
- function oe(e, t) {
15
+ }, te = [
16
+ "water",
17
+ "landscape",
18
+ "road",
19
+ "poi",
20
+ "transit"
21
+ ];
22
+ function re(e, t) {
18
23
  return [
19
- ...re.map((r) => ({
20
- featureType: r,
24
+ ...te.map((a) => ({
25
+ featureType: a,
21
26
  elementType: "geometry",
22
- stylers: [{ saturation: e, lightness: t }]
27
+ stylers: [{
28
+ saturation: e,
29
+ lightness: t
30
+ }]
23
31
  })),
24
32
  {
25
33
  elementType: "labels.text.fill",
26
- stylers: [{ saturation: e, lightness: t - 10 }]
34
+ stylers: [{
35
+ saturation: e,
36
+ lightness: t - 10
37
+ }]
27
38
  },
28
39
  {
29
40
  elementType: "labels.icon",
30
- stylers: [{ saturation: e, lightness: t }]
41
+ stylers: [{
42
+ saturation: e,
43
+ lightness: t
44
+ }]
31
45
  }
32
46
  ];
33
47
  }
34
- const P = [
35
- { elementType: "geometry", stylers: [{ color: "#444444" }] },
36
- { elementType: "labels.text.fill", stylers: [{ color: "#aaaaaa" }] },
37
- { elementType: "labels.text.stroke", stylers: [{ color: "#323232" }] },
48
+ var C = [
49
+ {
50
+ elementType: "geometry",
51
+ stylers: [{ color: "#444444" }]
52
+ },
53
+ {
54
+ elementType: "labels.text.fill",
55
+ stylers: [{ color: "#aaaaaa" }]
56
+ },
57
+ {
58
+ elementType: "labels.text.stroke",
59
+ stylers: [{ color: "#323232" }]
60
+ },
38
61
  {
39
62
  featureType: "water",
40
63
  elementType: "geometry",
@@ -65,175 +88,136 @@ const P = [
65
88
  elementType: "geometry",
66
89
  stylers: [{ color: "#505050" }]
67
90
  },
68
- { elementType: "labels.icon", stylers: [{ visibility: "off" }] }
69
- ], ne = {
70
- default: { light: [], dark: P },
71
- muted: { light: oe(-40, 20), dark: P }
72
- }, w = /* @__PURE__ */ new Set();
73
- let M = typeof document < "u" && !!document.body && document.body.classList.contains("dark"), S = !1;
74
- function se() {
75
- if (S || typeof document > "u") return;
76
- S = !0, new MutationObserver(() => {
77
- const t = document.body.classList.contains("dark");
78
- if (t !== M) {
79
- M = t;
80
- for (const r of w) r();
91
+ {
92
+ elementType: "labels.icon",
93
+ stylers: [{ visibility: "off" }]
94
+ }
95
+ ], ae = {
96
+ default: {
97
+ light: [],
98
+ dark: C
99
+ },
100
+ muted: {
101
+ light: re(-40, 20),
102
+ dark: C
103
+ }
104
+ }, w = /* @__PURE__ */ new Set(), M = typeof document < "u" && !!document.body && document.body.classList.contains("dark"), S = !1;
105
+ function oe() {
106
+ S || typeof document > "u" || (S = !0, new MutationObserver(() => {
107
+ const e = document.body.classList.contains("dark");
108
+ if (e !== M) {
109
+ M = e;
110
+ for (const t of w) t();
81
111
  }
82
112
  }).observe(document.body, {
83
113
  attributes: !0,
84
114
  attributeFilter: ["class"]
85
- });
115
+ }));
86
116
  }
87
- function le(e) {
88
- return w.add(e), se(), () => {
117
+ function ne(e) {
118
+ return w.add(e), oe(), () => {
89
119
  w.delete(e);
90
120
  };
91
121
  }
92
- function ie() {
122
+ function se() {
93
123
  return M;
94
124
  }
95
- function ce() {
125
+ function le() {
96
126
  return !1;
97
127
  }
98
128
  function E() {
99
- return u.useSyncExternalStore(
100
- le,
101
- ie,
102
- ce
103
- );
129
+ return d.useSyncExternalStore(ne, se, le);
104
130
  }
105
- function je(e = "default") {
131
+ function Re(e = "default") {
106
132
  const t = E();
107
- return ne[e][t ? "dark" : "light"];
133
+ return ae[e][t ? "dark" : "light"];
108
134
  }
109
- const R = {
135
+ var R = {
110
136
  primary: "strong",
111
137
  secondary: "moderate",
112
138
  warning: "moderate",
113
139
  destructive: "unranked",
114
140
  outline: "unranked"
115
141
  };
116
- function de(e) {
142
+ function ie(e) {
117
143
  return e in R;
118
144
  }
119
- function me(e) {
120
- return de(e) ? R[e] : e;
145
+ function ce(e) {
146
+ return ie(e) ? R[e] : e;
121
147
  }
122
- const v = {
148
+ var k = {
123
149
  strong: {
124
- className: "bg-primary dark:bg-green-400",
125
- cssVar: "--ds-tailwind-colors-green-400",
150
+ className: "bg-score-strong",
151
+ cssVar: "--score-strong",
126
152
  fallback: "#2ae855"
127
153
  },
128
154
  moderate: {
129
- className: "bg-chart-4",
130
- cssVar: "--ds-tailwind-colors-yellow-400",
155
+ className: "bg-score-moderate",
156
+ cssVar: "--score-moderate",
131
157
  fallback: "#facc15"
132
158
  },
133
159
  weak: {
134
- className: "bg-orange-400",
135
- cssVar: "--ds-tailwind-colors-orange-400",
160
+ className: "bg-score-weak",
161
+ cssVar: "--score-weak",
136
162
  fallback: "#fb923c"
137
163
  },
138
164
  unranked: {
139
- className: "bg-red-600",
140
- cssVar: "--ds-tailwind-colors-red-600",
141
- fallback: "#dc2626"
165
+ className: "bg-score-poor",
166
+ cssVar: "--score-poor",
167
+ fallback: "#f87171"
142
168
  },
143
169
  error: {
144
170
  className: "bg-warning-background dark:bg-orange-200",
145
171
  cssVar: "--ds-tailwind-colors-orange-200",
146
172
  fallback: "#fed7aa"
147
173
  }
148
- }, h = Object.fromEntries(
149
- Object.entries(v).map(([e, t]) => [e, t.className])
150
- ), ue = K(
151
- "inline-flex items-center justify-center rounded-full text-label font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-fast ease-out hover:shadow-md",
152
- {
153
- variants: {
154
- variant: {
155
- strong: `${h.strong}`,
156
- moderate: `${h.moderate}`,
157
- weak: `${h.weak}`,
158
- unranked: `${h.unranked} text-white dark:text-white`,
159
- error: `${h.error}`
160
- }
161
- },
162
- defaultVariants: {
163
- variant: "strong"
164
- }
165
- }
166
- ), O = u.forwardRef(
167
- ({
168
- value: e,
169
- variant: t = "strong",
170
- loading: r = !1,
171
- pulse: s,
172
- // eslint-disable-line @typescript-eslint/no-unused-vars -- absorbed from ...props to prevent DOM passthrough
173
- dataHook: n,
174
- className: o,
175
- trackingEl: a,
176
- trackingLabel: i,
177
- style: l,
178
- ...d
179
- }, p) => {
180
- const m = me(t);
181
- return /* @__PURE__ */ c(
182
- "div",
183
- {
184
- ref: p,
185
- className: g(
186
- r ? "border-border bg-accent rounded-full border" : ue({ variant: m }),
187
- "size-8 p-0",
188
- o
189
- ),
190
- "data-hook": n,
191
- "data-slot": "map-grid-pin",
192
- "data-state": r ? "loading" : void 0,
193
- "data-tracking-el": a || "map-grid-pin",
194
- "data-tracking-label": i,
195
- style: l,
196
- ...d,
197
- children: m === "error" && !r ? /* @__PURE__ */ c(
198
- Y,
199
- {
200
- "aria-hidden": "true",
201
- className: "text-warning-foreground",
202
- size: 14
203
- }
204
- ) : String(e)
205
- }
206
- );
207
- }
208
- );
174
+ }, b = Object.fromEntries(Object.entries(k).map(([e, t]) => [e, t.className])), de = Y("inline-flex items-center justify-center rounded-full text-label font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-fast ease-out hover:shadow-md", {
175
+ variants: { variant: {
176
+ strong: `${b.strong} text-score-strong-foreground dark:text-score-strong-foreground`,
177
+ moderate: `${b.moderate} text-score-moderate-foreground dark:text-score-moderate-foreground`,
178
+ weak: `${b.weak} text-score-weak-foreground dark:text-score-weak-foreground`,
179
+ unranked: `${b.unranked} text-score-poor-foreground dark:text-score-poor-foreground`,
180
+ error: `${b.error}`
181
+ } },
182
+ defaultVariants: { variant: "strong" }
183
+ }), O = d.forwardRef(({ value: e, variant: t = "strong", loading: a = !1, pulse: s, dataHook: l, className: o, trackingEl: r, trackingLabel: i, style: n, ...m }, f) => {
184
+ const y = ce(t);
185
+ return /* @__PURE__ */ c("div", {
186
+ ref: f,
187
+ className: u(a ? "border-border bg-accent rounded-full border" : de({ variant: y }), "size-8 p-0", o),
188
+ "data-hook": l,
189
+ "data-slot": "map-grid-pin",
190
+ "data-state": a ? "loading" : void 0,
191
+ "data-tracking-el": r || "map-grid-pin",
192
+ "data-tracking-label": i,
193
+ style: n,
194
+ ...m,
195
+ children: y === "error" && !a ? /* @__PURE__ */ c(U, {
196
+ "aria-hidden": "true",
197
+ className: "text-warning-foreground",
198
+ size: 14
199
+ }) : String(e)
200
+ });
201
+ });
209
202
  O.displayName = "MapGridPin";
210
203
  function j() {
211
- const t = {
212
- colors: Object.fromEntries(
213
- Object.entries(v).map(([s, n]) => [s, n.fallback])
214
- ),
204
+ const e = {
205
+ colors: Object.fromEntries(Object.entries(k).map(([a, s]) => [a, s.fallback])),
215
206
  fontFamily: "Inter, system-ui, sans-serif",
216
207
  textColor: "#111412"
217
208
  };
218
- if (typeof document > "u") return t;
219
- const r = getComputedStyle(document.documentElement);
209
+ if (typeof document > "u") return e;
210
+ const t = getComputedStyle(document.documentElement);
220
211
  return {
221
- colors: Object.fromEntries(
222
- Object.entries(v).map(([s, { cssVar: n, fallback: o }]) => [
223
- s,
224
- r.getPropertyValue(n).trim() || o
225
- ])
226
- ),
227
- fontFamily: r.getPropertyValue("--ds-font-font-sans").trim() || t.fontFamily,
228
- textColor: r.getPropertyValue("--ds-tailwind-colors-neutral-950").trim() || t.textColor
212
+ colors: Object.fromEntries(Object.entries(k).map(([a, { cssVar: s, fallback: l }]) => [a, t.getPropertyValue(s).trim() || l])),
213
+ fontFamily: t.getPropertyValue("--ds-font-font-sans").trim() || e.fontFamily,
214
+ textColor: t.getPropertyValue("--ds-tailwind-colors-neutral-950").trim() || e.textColor
229
215
  };
230
216
  }
231
- function Le() {
217
+ function Oe() {
232
218
  return j().colors;
233
219
  }
234
- const Ae = Object.fromEntries(
235
- Object.entries(v).map(([e, t]) => [e, t.fallback])
236
- ), N = [
220
+ var je = Object.fromEntries(Object.entries(k).map(([e, t]) => [e, t.fallback])), N = [
237
221
  "strong",
238
222
  "moderate",
239
223
  "weak",
@@ -241,470 +225,290 @@ const Ae = Object.fromEntries(
241
225
  "error"
242
226
  ];
243
227
  function L(e, t) {
244
- const { colors: r, fontFamily: s, textColor: n } = j(), o = 40, a = o / 2, i = 2, l = a - i, d = l * 0.55, m = [...e].sort(
245
- (f, b) => N.indexOf(f.variant) - N.indexOf(b.variant)
246
- ).filter((f) => f.count > 0), I = m.reduce((f, b) => f + b.count, 0) || 1, V = Math.max(Number(t) || 0, 1);
247
- let k;
248
- const C = m[0];
249
- if (m.length <= 1) {
250
- const f = C ? r[C.variant] : "#e5e7eb";
251
- k = `<circle cx="${a}" cy="${a}" r="${l}" fill="${f}"/>`;
252
- } else {
253
- k = "";
254
- let f = -Math.PI / 2;
255
- for (const b of m) {
256
- const $ = b.count / I * Math.PI * 2, x = f + $, F = a + l * Math.cos(f), _ = a + l * Math.sin(f), z = a + l * Math.cos(x), B = a + l * Math.sin(x), G = $ > Math.PI ? 1 : 0;
257
- k += `<path d="M${a},${a}L${F.toFixed(2)},${_.toFixed(2)}A${l},${l} 0 ${G} 1 ${z.toFixed(2)},${B.toFixed(2)}Z" fill="${r[b.variant]}"/>`, f = x;
228
+ const { colors: a, fontFamily: s, textColor: l } = j(), o = 40, r = o / 2, i = 2, n = 18, m = n * 0.55, f = [...e].sort((p, v) => N.indexOf(p.variant) - N.indexOf(v.variant)).filter((p) => p.count > 0), y = f.reduce((p, v) => p + v.count, 0) || 1, I = Math.max(Number(t) || 0, 1);
229
+ let h;
230
+ const $ = f[0];
231
+ if (f.length <= 1) h = `<circle cx="${r}" cy="${r}" r="${n}" fill="${$ ? a[$.variant] : "#e5e7eb"}"/>`;
232
+ else {
233
+ h = "";
234
+ let p = -Math.PI / 2;
235
+ for (const v of f) {
236
+ const P = v.count / y * Math.PI * 2, x = p + P, V = r + n * Math.cos(p), D = r + n * Math.sin(p), F = r + n * Math.cos(x), _ = r + n * Math.sin(x), z = P > Math.PI ? 1 : 0;
237
+ h += `<path d="M${r},${r}L${V.toFixed(2)},${D.toFixed(2)}A${n},${n} 0 ${z} 1 ${F.toFixed(2)},${_.toFixed(2)}Z" fill="${a[v.variant]}"/>`, p = x;
258
238
  }
259
239
  }
260
- const D = Math.round(o * 0.3);
261
240
  return [
262
241
  `<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}" style="filter:drop-shadow(0 1px 2px rgba(0,0,0,.15))">`,
263
- `<circle cx="${a}" cy="${a}" r="${a}" fill="white"/>`,
264
- k,
265
- `<circle cx="${a}" cy="${a}" r="${l}" fill="none" stroke="white" stroke-width="${i}"/>`,
266
- `<circle cx="${a}" cy="${a}" r="${d}" fill="white"/>`,
267
- `<text x="${a}" y="${a}" text-anchor="middle" dominant-baseline="central" font-family="${s}" font-size="${D}" font-weight="600" fill="${n}">${V}</text>`,
242
+ `<circle cx="${r}" cy="${r}" r="${r}" fill="white"/>`,
243
+ h,
244
+ `<circle cx="${r}" cy="${r}" r="${n}" fill="none" stroke="white" stroke-width="${i}"/>`,
245
+ `<circle cx="${r}" cy="${r}" r="${m}" fill="white"/>`,
246
+ `<text x="${r}" y="${r}" text-anchor="middle" dominant-baseline="central" font-family="${s}" font-size="${Math.round(o * 0.3)}" font-weight="600" fill="${l}">${I}</text>`,
268
247
  "</svg>"
269
248
  ].join("");
270
249
  }
271
- function Ie(e) {
272
- if (typeof DOMParser > "u")
273
- throw new Error(
274
- "createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR."
275
- );
276
- const { markers: t, count: r, getVariant: s } = e, n = /* @__PURE__ */ new Map();
277
- for (const p of t) {
278
- const m = s(p);
279
- n.set(m, (n.get(m) ?? 0) + 1);
250
+ function Le(e) {
251
+ if (typeof DOMParser > "u") throw new Error("createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR.");
252
+ const { markers: t, count: a, getVariant: s } = e, l = /* @__PURE__ */ new Map();
253
+ for (const n of t) {
254
+ const m = s(n);
255
+ l.set(m, (l.get(m) ?? 0) + 1);
280
256
  }
281
257
  const o = [];
282
- for (const p of N) {
283
- const m = n.get(p);
284
- m && o.push({ variant: p, count: m });
258
+ for (const n of N) {
259
+ const m = l.get(n);
260
+ m && o.push({
261
+ variant: n,
262
+ count: m
263
+ });
285
264
  }
286
- const a = L(o, r), d = new DOMParser().parseFromString(a, "image/svg+xml").documentElement;
287
- if (!(d instanceof SVGElement))
288
- throw new Error("createClusterPinElement: failed to parse SVG");
289
- return d;
265
+ const r = L(o, a), i = new DOMParser().parseFromString(r, "image/svg+xml").documentElement;
266
+ if (!(i instanceof SVGElement)) throw new Error("createClusterPinElement: failed to parse SVG");
267
+ return i;
290
268
  }
291
- const pe = u.forwardRef(
292
- ({
293
- segments: e,
294
- count: t,
295
- dataHook: r,
296
- className: s,
297
- trackingEl: n,
298
- trackingLabel: o,
299
- ...a
300
- }, i) => {
301
- const l = JSON.stringify(e), d = u.useMemo(
302
- () => L(e, t),
303
- // eslint-disable-next-line react-hooks/exhaustive-deps -- serialised key for stable comparison
304
- [l, t]
305
- );
306
- return /* @__PURE__ */ c(
307
- "div",
308
- {
309
- dangerouslySetInnerHTML: { __html: d },
310
- ref: i,
311
- className: g("inline-flex items-center justify-center", s),
312
- "data-hook": r,
313
- "data-slot": "map-cluster-pin",
314
- "data-tracking-el": n || "map-cluster-pin",
315
- "data-tracking-label": o,
316
- ...a
317
- }
318
- );
319
- }
320
- );
321
- pe.displayName = "MapClusterPin";
322
- const fe = u.forwardRef(
323
- ({
324
- icon: e,
325
- animateIn: t = !1,
326
- value: r,
327
- variant: s,
328
- pulse: n,
329
- dataHook: o,
330
- className: a,
331
- trackingEl: i,
332
- trackingLabel: l,
333
- ariaLabel: d,
334
- ...p
335
- }, m) => r !== void 0 || s !== void 0 || n !== void 0 ? /* @__PURE__ */ c(
336
- O,
337
- {
338
- ref: m,
339
- className: a,
340
- dataHook: o,
341
- pulse: n,
342
- trackingEl: i,
343
- trackingLabel: l,
344
- value: r ?? 1,
345
- variant: s,
346
- ...p
347
- }
348
- ) : /* @__PURE__ */ c(
349
- "div",
350
- {
351
- ref: m,
352
- "aria-label": d ?? "Location",
353
- className: g(
354
- "relative inline-flex h-[46px] w-[38px] items-start justify-center",
355
- a
356
- ),
357
- "data-hook": o,
358
- "data-slot": "map-location-pin",
359
- "data-tracking-el": i || "map-location-pin",
360
- "data-tracking-label": l,
361
- role: "img",
362
- ...p,
363
- children: /* @__PURE__ */ y(
364
- "span",
365
- {
366
- "aria-hidden": "true",
367
- className: g(
368
- "relative flex size-full",
369
- t && "animate-emphasis-pop origin-bottom will-change-transform"
370
- ),
371
- children: [
372
- /* @__PURE__ */ y(
373
- "svg",
374
- {
375
- "aria-hidden": "true",
376
- className: "size-full overflow-visible drop-shadow-sm",
377
- fill: "none",
378
- viewBox: "0 0 38 46",
379
- children: [
380
- /* @__PURE__ */ c(
381
- "path",
382
- {
383
- className: "fill-white",
384
- d: "M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"
385
- }
386
- ),
387
- /* @__PURE__ */ c("circle", { className: "fill-sky-500", cx: "19", cy: "19", r: "16" })
388
- ]
389
- }
390
- ),
391
- /* @__PURE__ */ c("span", { className: "absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white", children: e ?? /* @__PURE__ */ c(Z, { size: 16 }) })
392
- ]
393
- }
394
- )
395
- }
396
- )
397
- );
398
- fe.displayName = "MapLocationPin";
399
- const ge = u.forwardRef(
400
- ({
401
- className: e,
402
- dataHook: t,
403
- trackingEl: r,
404
- trackingLabel: s,
405
- children: n,
406
- iconOnly: o = !0,
407
- ...a
408
- }, i) => {
409
- const l = E();
410
- return /* @__PURE__ */ c(
411
- T,
412
- {
413
- ref: i,
414
- className: e,
415
- "data-slot": "map-control-button",
416
- dataHook: t,
417
- iconOnly: o,
418
- trackingEl: r || "map-control-button",
419
- trackingLabel: s,
420
- variant: l ? "secondary" : "outline",
421
- ...a,
422
- children: n
423
- }
424
- );
425
- }
426
- );
427
- ge.displayName = "MapControlButton";
428
- const ye = u.forwardRef(
429
- ({
430
- className: e,
431
- children: t,
432
- dataHook: r,
433
- trackingEl: s,
434
- trackingLabel: n,
435
- ariaLabel: o,
436
- ...a
437
- }, i) => /* @__PURE__ */ y(
438
- "div",
439
- {
440
- ref: i,
441
- "aria-label": o ?? "Loading map",
442
- className: g(
443
- "border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",
444
- e
445
- ),
446
- "data-hook": r,
447
- "data-slot": "map-loading-state",
448
- "data-tracking-el": s || "map-loading-state",
449
- "data-tracking-label": n,
450
- role: "status",
451
- ...a,
452
- children: [
453
- /* @__PURE__ */ c(A, {}),
454
- t && /* @__PURE__ */ c("div", { className: "relative", children: t })
455
- ]
456
- }
457
- )
458
- );
459
- ye.displayName = "MapLoadingState";
460
- const A = u.memo(function({
461
- rounded: t
462
- }) {
463
- return /* @__PURE__ */ c(
464
- H,
465
- {
269
+ var me = d.forwardRef(({ segments: e, count: t, dataHook: a, className: s, trackingEl: l, trackingLabel: o, ...r }, i) => {
270
+ const n = JSON.stringify(e), m = d.useMemo(() => L(e, t), [n, t]);
271
+ return /* @__PURE__ */ c("div", {
272
+ dangerouslySetInnerHTML: { __html: m },
273
+ ref: i,
274
+ className: u("inline-flex items-center justify-center", s),
275
+ "data-hook": a,
276
+ "data-slot": "map-cluster-pin",
277
+ "data-tracking-el": l || "map-cluster-pin",
278
+ "data-tracking-label": o,
279
+ ...r
280
+ });
281
+ });
282
+ me.displayName = "MapClusterPin";
283
+ var ue = d.forwardRef(({ icon: e, animateIn: t = !1, value: a, variant: s, pulse: l, dataHook: o, className: r, trackingEl: i, trackingLabel: n, ariaLabel: m, ...f }, y) => a !== void 0 || s !== void 0 || l !== void 0 ? /* @__PURE__ */ c(O, {
284
+ ref: y,
285
+ className: r,
286
+ dataHook: o,
287
+ pulse: l,
288
+ trackingEl: i,
289
+ trackingLabel: n,
290
+ value: a ?? 1,
291
+ variant: s,
292
+ ...f
293
+ }) : /* @__PURE__ */ c("div", {
294
+ ref: y,
295
+ "aria-label": m ?? "Location",
296
+ className: u("relative inline-flex h-[46px] w-[38px] items-start justify-center", r),
297
+ "data-hook": o,
298
+ "data-slot": "map-location-pin",
299
+ "data-tracking-el": i || "map-location-pin",
300
+ "data-tracking-label": n,
301
+ role: "img",
302
+ ...f,
303
+ children: /* @__PURE__ */ g("span", {
304
+ "aria-hidden": "true",
305
+ className: u("relative flex size-full", t && "animate-emphasis-pop origin-bottom will-change-transform"),
306
+ children: [/* @__PURE__ */ g("svg", {
466
307
  "aria-hidden": "true",
467
- className: g(
468
- "absolute inset-0 h-full w-full object-cover",
469
- t && "rounded-[inherit]"
470
- ),
471
- mode: "auto"
472
- }
473
- );
474
- }), be = u.forwardRef(
475
- ({
476
- className: e,
477
- title: t = "We couldn't load your map rankings.",
478
- message: r = "Reloading usually fixes it, and it won't use any credits",
479
- onRetry: s,
480
- retryLoading: n = !1,
481
- retryLabel: o = "Reload",
482
- dataHook: a,
483
- trackingEl: i,
484
- trackingLabel: l,
485
- ...d
486
- }, p) => /* @__PURE__ */ y(
487
- "div",
488
- {
489
- ref: p,
490
- className: g(
491
- "border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8",
492
- e
493
- ),
494
- "data-hook": a,
495
- "data-slot": "map-error-state",
496
- "data-tracking-el": i || "map-error-state",
497
- "data-tracking-label": l,
498
- role: "alert",
499
- ...d,
500
- children: [
501
- /* @__PURE__ */ c(A, { rounded: !0 }),
502
- /* @__PURE__ */ y("div", { className: "relative flex flex-col items-center gap-4 sm:gap-6", children: [
503
- /* @__PURE__ */ c(
504
- "div",
505
- {
506
- "aria-hidden": "true",
507
- className: "flex items-center justify-center",
508
- "data-slot": "map-error-illustration",
509
- children: /* @__PURE__ */ c(q, { className: "h-auto w-full max-w-41" })
510
- }
511
- ),
512
- /* @__PURE__ */ y("div", { className: "flex flex-col gap-2", children: [
513
- /* @__PURE__ */ c(
514
- "h3",
515
- {
516
- className: "text-foreground text-heading-subsection",
517
- "data-slot": "map-error-title",
518
- children: t
519
- }
520
- ),
521
- r && /* @__PURE__ */ c(
522
- "p",
523
- {
524
- className: "text-muted-foreground text-body-sm",
525
- "data-slot": "map-error-message",
526
- children: r
527
- }
528
- )
529
- ] }),
530
- s && /* @__PURE__ */ y(
531
- T,
532
- {
533
- className: "mt-1",
534
- dataHook: `${a}-retry`,
535
- loading: n,
536
- size: "sm",
537
- variant: "primary",
538
- onClick: s,
539
- children: [
540
- !n && /* @__PURE__ */ c(U, { "aria-hidden": "true" }),
541
- o
542
- ]
543
- }
544
- )
545
- ] })
546
- ]
547
- }
548
- )
549
- );
550
- be.displayName = "MapErrorState";
551
- const he = u.forwardRef(
552
- ({ className: e, dataHook: t, icon: r, message: s, trackingEl: n, trackingLabel: o, ...a }, i) => (
553
- /* `h-full w-full`, matching MapLoadingState: a map is always given its box
554
- by the consumer, and this fills it so nothing reflows when runs arrive. */
555
- /* @__PURE__ */ c(
556
- ae,
557
- {
558
- ref: i,
559
- className: g("h-full w-full rounded-lg", e),
560
- dataHook: t,
561
- icon: r ?? /* @__PURE__ */ c(W, { strokeWidth: 2 }),
562
- message: s ?? "No data yet",
563
- slot: "map-empty",
564
- trackingEl: n,
565
- trackingLabel: o,
566
- ...a
567
- }
568
- )
569
- )
570
- );
571
- he.displayName = "MapEmpty";
572
- const ke = u.forwardRef(
573
- ({ variant: e, color: t, dataHook: r, className: s, children: n, ...o }, a) => {
574
- const i = e ? h[e] : t;
575
- return /* @__PURE__ */ y(
576
- "span",
577
- {
578
- ref: a,
579
- className: g(
580
- "text-foreground text-body-xs flex items-center gap-1",
581
- s
582
- ),
583
- "data-hook": r,
584
- "data-slot": "map-legend-item",
585
- ...o,
586
- children: [
587
- /* @__PURE__ */ c(
588
- "span",
589
- {
590
- "aria-hidden": "true",
591
- className: g("inline-block size-2 shrink-0 rounded-full", i)
592
- }
593
- ),
594
- n
595
- ]
596
- }
597
- );
598
- }
599
- );
600
- ke.displayName = "MapLegendItem";
601
- const ve = u.forwardRef(
602
- ({
308
+ className: "size-full overflow-visible drop-shadow-sm",
309
+ fill: "none",
310
+ viewBox: "0 0 38 46",
311
+ children: [/* @__PURE__ */ c("path", {
312
+ className: "fill-white",
313
+ d: "M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"
314
+ }), /* @__PURE__ */ c("circle", {
315
+ className: "fill-sky-500",
316
+ cx: "19",
317
+ cy: "19",
318
+ r: "16"
319
+ })]
320
+ }), /* @__PURE__ */ c("span", {
321
+ className: "absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white",
322
+ children: e ?? /* @__PURE__ */ c(W, { size: 16 })
323
+ })]
324
+ })
325
+ }));
326
+ ue.displayName = "MapLocationPin";
327
+ var fe = d.forwardRef(({ className: e, dataHook: t, trackingEl: a, trackingLabel: s, children: l, iconOnly: o = !0, ...r }, i) => {
328
+ const n = E();
329
+ return /* @__PURE__ */ c(T, {
330
+ ref: i,
603
331
  className: e,
332
+ "data-slot": "map-control-button",
604
333
  dataHook: t,
605
- trackingEl: r,
334
+ iconOnly: o,
335
+ trackingEl: a || "map-control-button",
606
336
  trackingLabel: s,
607
- ariaLabel: n,
608
- children: o,
609
- ...a
610
- }, i) => /* @__PURE__ */ c(
611
- J,
612
- {
613
- ref: i,
614
- "aria-label": n ?? "Map legend",
615
- className: g(
616
- "inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800",
617
- e
618
- ),
619
- "data-slot": "map-legend",
620
- dataHook: t,
621
- density: "condensed",
622
- role: "group",
623
- trackingEl: r || "map-legend",
624
- trackingLabel: s,
625
- variant: "border",
626
- ...a,
627
- children: /* @__PURE__ */ c(Q, { className: "flex items-center gap-3", children: o })
628
- }
629
- )
630
- );
631
- ve.displayName = "MapLegend";
632
- function Ve(e) {
633
- const { hoverWhenOpen: t = !1 } = e ?? {}, [r, s] = u.useState(null), [n, o] = u.useState(null), a = u.useCallback((d) => {
634
- o(d), s(d);
635
- }, []), i = u.useCallback(() => {
636
- s(null);
637
- }, []), l = u.useCallback(
638
- (d) => {
639
- const p = {
640
- onClick: () => a(d)
641
- };
642
- return t && (p.onPointerEnter = (m) => {
643
- m.pointerType === "mouse" && r != null && a(d);
644
- }), p;
645
- },
646
- [t, a, r]
647
- );
337
+ variant: n ? "secondary" : "outline",
338
+ ...r,
339
+ children: l
340
+ });
341
+ });
342
+ fe.displayName = "MapControlButton";
343
+ var pe = d.forwardRef(({ className: e, children: t, dataHook: a, trackingEl: s, trackingLabel: l, ariaLabel: o, ...r }, i) => /* @__PURE__ */ g("div", {
344
+ ref: i,
345
+ "aria-label": o ?? "Loading map",
346
+ className: u("border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border", e),
347
+ "data-hook": a,
348
+ "data-slot": "map-loading-state",
349
+ "data-tracking-el": s || "map-loading-state",
350
+ "data-tracking-label": l,
351
+ role: "status",
352
+ ...r,
353
+ children: [/* @__PURE__ */ c(A, {}), t && /* @__PURE__ */ c("div", {
354
+ className: "relative",
355
+ children: t
356
+ })]
357
+ }));
358
+ pe.displayName = "MapLoadingState";
359
+ var A = d.memo(function({ rounded: t }) {
360
+ return /* @__PURE__ */ c(Q, {
361
+ "aria-hidden": "true",
362
+ className: u("absolute inset-0 h-full w-full object-cover", t && "rounded-[inherit]"),
363
+ mode: "auto"
364
+ });
365
+ }), ge = d.forwardRef(({ className: e, title: t = "We couldn't load your map rankings.", message: a = "Reloading usually fixes it, and it won't use any credits", onRetry: s, retryLoading: l = !1, retryLabel: o = "Reload", dataHook: r, trackingEl: i, trackingLabel: n, ...m }, f) => /* @__PURE__ */ g("div", {
366
+ ref: f,
367
+ className: u("border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8", e),
368
+ "data-hook": r,
369
+ "data-slot": "map-error-state",
370
+ "data-tracking-el": i || "map-error-state",
371
+ "data-tracking-label": n,
372
+ role: "alert",
373
+ ...m,
374
+ children: [/* @__PURE__ */ c(A, { rounded: !0 }), /* @__PURE__ */ g("div", {
375
+ className: "relative flex flex-col items-center gap-4 sm:gap-6",
376
+ children: [
377
+ /* @__PURE__ */ c("div", {
378
+ "aria-hidden": "true",
379
+ className: "flex items-center justify-center",
380
+ "data-slot": "map-error-illustration",
381
+ children: /* @__PURE__ */ c(J, { className: "h-auto w-full max-w-41" })
382
+ }),
383
+ /* @__PURE__ */ g("div", {
384
+ className: "flex flex-col gap-2",
385
+ children: [/* @__PURE__ */ c("h3", {
386
+ className: "text-foreground text-heading-subsection",
387
+ "data-slot": "map-error-title",
388
+ children: t
389
+ }), a && /* @__PURE__ */ c("p", {
390
+ className: "text-muted-foreground text-body-sm",
391
+ "data-slot": "map-error-message",
392
+ children: a
393
+ })]
394
+ }),
395
+ s && /* @__PURE__ */ g(T, {
396
+ className: "mt-1",
397
+ dataHook: `${r}-retry`,
398
+ loading: l,
399
+ size: "sm",
400
+ variant: "primary",
401
+ onClick: s,
402
+ children: [!l && /* @__PURE__ */ c(K, { "aria-hidden": "true" }), o]
403
+ })
404
+ ]
405
+ })]
406
+ }));
407
+ ge.displayName = "MapErrorState";
408
+ var ye = d.forwardRef(({ className: e, dataHook: t, icon: a, message: s, trackingEl: l, trackingLabel: o, ...r }, i) => /* @__PURE__ */ c(B, {
409
+ ref: i,
410
+ className: u("h-full w-full rounded-lg", e),
411
+ dataHook: t,
412
+ icon: a ?? /* @__PURE__ */ c(G, { strokeWidth: 2 }),
413
+ message: s ?? "No data yet",
414
+ slot: "map-empty",
415
+ trackingEl: l,
416
+ trackingLabel: o,
417
+ ...r
418
+ }));
419
+ ye.displayName = "MapEmpty";
420
+ var ve = d.forwardRef(({ variant: e, color: t, dataHook: a, className: s, children: l, ...o }, r) => {
421
+ const i = e ? b[e] : t;
422
+ return /* @__PURE__ */ g("span", {
423
+ ref: r,
424
+ className: u("text-foreground text-body-xs flex items-center gap-1", s),
425
+ "data-hook": a,
426
+ "data-slot": "map-legend-item",
427
+ ...o,
428
+ children: [/* @__PURE__ */ c("span", {
429
+ "aria-hidden": "true",
430
+ className: u("inline-block size-2 shrink-0 rounded-full", i)
431
+ }), l]
432
+ });
433
+ });
434
+ ve.displayName = "MapLegendItem";
435
+ var be = d.forwardRef(({ className: e, dataHook: t, trackingEl: a, trackingLabel: s, ariaLabel: l, children: o, ...r }, i) => /* @__PURE__ */ c(X, {
436
+ ref: i,
437
+ "aria-label": l ?? "Map legend",
438
+ className: u("inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800", e),
439
+ "data-slot": "map-legend",
440
+ dataHook: t,
441
+ density: "condensed",
442
+ role: "group",
443
+ trackingEl: a || "map-legend",
444
+ trackingLabel: s,
445
+ variant: "border",
446
+ ...r,
447
+ children: /* @__PURE__ */ c(ee, {
448
+ className: "flex items-center gap-3",
449
+ children: o
450
+ })
451
+ }));
452
+ be.displayName = "MapLegend";
453
+ function Ae(e) {
454
+ const { hoverWhenOpen: t = !1 } = e ?? {}, [a, s] = d.useState(null), [l, o] = d.useState(null), r = d.useCallback((i) => {
455
+ o(i), s(i);
456
+ }, []);
648
457
  return {
649
- activeItem: r,
650
- anchorItem: n,
651
- showItem: a,
652
- close: i,
653
- getInteractionProps: l
458
+ activeItem: a,
459
+ anchorItem: l,
460
+ showItem: r,
461
+ close: d.useCallback(() => {
462
+ s(null);
463
+ }, []),
464
+ getInteractionProps: d.useCallback((i) => {
465
+ const n = { onClick: () => r(i) };
466
+ return t && (n.onPointerEnter = (m) => {
467
+ m.pointerType === "mouse" && a != null && r(i);
468
+ }), n;
469
+ }, [
470
+ t,
471
+ r,
472
+ a
473
+ ])
654
474
  };
655
475
  }
656
- const De = X, xe = ee;
657
- xe.displayName = "MapPopoverAnchor";
658
- const we = u.forwardRef(
659
- ({
660
- className: e,
661
- side: t = "top",
662
- sideOffset: r = 4,
663
- dataHook: s,
664
- trackingEl: n,
665
- trackingLabel: o,
666
- ...a
667
- }, i) => /* @__PURE__ */ c(
668
- te,
669
- {
670
- ref: i,
671
- className: g(
672
- "w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",
673
- e
674
- ),
675
- "data-slot": "map-popover-content",
676
- "data-tracking-el": n || "map-popover",
677
- "data-tracking-label": o,
678
- dataHook: s,
679
- side: t,
680
- sideOffset: r,
681
- onCloseAutoFocus: (l) => l.preventDefault(),
682
- onOpenAutoFocus: (l) => l.preventDefault(),
683
- ...a
684
- }
685
- )
686
- );
687
- we.displayName = "MapPopoverContent";
476
+ var Ie = Z, he = q;
477
+ he.displayName = "MapPopoverAnchor";
478
+ var ke = d.forwardRef(({ className: e, side: t = "top", sideOffset: a = 4, dataHook: s, trackingEl: l, trackingLabel: o, ...r }, i) => /* @__PURE__ */ c(H, {
479
+ ref: i,
480
+ className: u("w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0", e),
481
+ "data-slot": "map-popover-content",
482
+ "data-tracking-el": l || "map-popover",
483
+ "data-tracking-label": o,
484
+ dataHook: s,
485
+ side: t,
486
+ sideOffset: a,
487
+ onCloseAutoFocus: (n) => n.preventDefault(),
488
+ onOpenAutoFocus: (n) => n.preventDefault(),
489
+ ...r
490
+ }));
491
+ ke.displayName = "MapPopoverContent";
688
492
  export {
689
- ne as MAP_STYLES,
690
- pe as MapClusterPin,
691
- ge as MapControlButton,
692
- he as MapEmpty,
693
- be as MapErrorState,
493
+ ae as MAP_STYLES,
494
+ me as MapClusterPin,
495
+ fe as MapControlButton,
496
+ ye as MapEmpty,
497
+ ge as MapErrorState,
694
498
  O as MapGridPin,
695
- ve as MapLegend,
696
- ke as MapLegendItem,
697
- ye as MapLoadingState,
698
- fe as MapLocationPin,
699
- De as MapPopover,
700
- xe as MapPopoverAnchor,
701
- we as MapPopoverContent,
702
- Oe as MapTypeId,
703
- Ae as clusterPinHexColors,
704
- Ie as createClusterPinElement,
499
+ be as MapLegend,
500
+ ve as MapLegendItem,
501
+ pe as MapLoadingState,
502
+ ue as MapLocationPin,
503
+ Ie as MapPopover,
504
+ he as MapPopoverAnchor,
505
+ ke as MapPopoverContent,
506
+ Ee as MapTypeId,
507
+ je as clusterPinHexColors,
508
+ Le as createClusterPinElement,
705
509
  L as createClusterPinSvg,
706
- h as mapGridPinColorMap,
707
- Le as resolveClusterPinColors,
708
- Ve as useMapPopoverClick,
709
- je as useMapStyles
510
+ b as mapGridPinColorMap,
511
+ Oe as resolveClusterPinColors,
512
+ Ae as useMapPopoverClick,
513
+ Re as useMapStyles
710
514
  };