@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
@@ -1,368 +1,229 @@
1
- import { jsx as o, jsxs as u, Fragment as H } from "react/jsx-runtime";
2
- import * as r from "react";
3
- import { ArrowLeft as k } from "@brightlocal/icons";
4
- import { cn as m } from "@brightlocal/ui-components/lib/utils";
5
1
  import { Breadcrumb as C } from "./breadcrumb.js";
6
- import { Button as j } from "./button.js";
7
- import { Header as w } from "./header.js";
2
+ import { Button as H } from "./button.js";
3
+ import { TypographyText as j } from "./typography-text.js";
4
+ import { Header as v } from "./header.js";
8
5
  import { Link as B } from "./link.js";
9
6
  import { ScrollArea as E } from "./scroll-area.js";
10
- import { TypographyText as S } from "./typography-text.js";
11
- const A = r.forwardRef(
12
- ({
13
- className: t,
14
- maxWidth: a = "none",
15
- dataHook: e,
16
- trackingEl: l,
17
- trackingLabel: n,
18
- children: s,
19
- ...i
20
- }, c) => {
21
- const f = typeof a == "number" ? `${a}px` : a;
22
- return /* @__PURE__ */ o(
23
- E,
24
- {
25
- className: m(
26
- "h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0! [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
27
- t
28
- ),
29
- dataHook: `${e}-scroll`,
30
- scrollOrientation: "both",
31
- children: /* @__PURE__ */ o(
32
- "div",
33
- {
34
- ref: c,
35
- className: "flex min-h-dvh w-full flex-col",
36
- "data-hook": e,
37
- "data-slot": "global-layout",
38
- "data-tracking-el": l,
39
- "data-tracking-label": n,
40
- ...i,
41
- children: /* @__PURE__ */ o(
42
- "div",
43
- {
44
- className: "mx-auto flex w-full flex-1",
45
- "data-slot": "global-container",
46
- style: { maxWidth: f },
47
- children: s
48
- }
49
- )
50
- }
51
- )
52
- }
53
- );
54
- }
55
- );
7
+ import * as n from "react";
8
+ import { ArrowLeft as k } from "@brightlocal/icons";
9
+ import { cn as m } from "@brightlocal/ui-components/lib/utils";
10
+ import { Fragment as S, jsx as l, jsxs as u } from "react/jsx-runtime";
11
+ var A = n.forwardRef(({ className: e, maxWidth: a = "none", dataHook: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => {
12
+ const f = typeof a == "number" ? `${a}px` : a;
13
+ return /* @__PURE__ */ l(E, {
14
+ className: m("h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0!", e),
15
+ dataHook: `${t}-scroll`,
16
+ scrollOrientation: "both",
17
+ children: /* @__PURE__ */ l("div", {
18
+ ref: c,
19
+ className: "flex min-h-dvh w-full flex-col",
20
+ "data-hook": t,
21
+ "data-slot": "global-layout",
22
+ "data-tracking-el": o,
23
+ "data-tracking-label": r,
24
+ ...i,
25
+ children: /* @__PURE__ */ l("div", {
26
+ className: "mx-auto flex w-full flex-1",
27
+ "data-slot": "global-container",
28
+ style: { maxWidth: f },
29
+ children: s
30
+ })
31
+ })
32
+ });
33
+ });
56
34
  A.displayName = "GlobalLayout";
57
- const _ = "288px", I = r.forwardRef(({ className: t, width: a = _, dataHook: e, children: l, ...n }, s) => {
35
+ var _ = "288px", I = n.forwardRef(({ className: e, width: a = _, dataHook: t, children: o, ...r }, s) => {
58
36
  const i = typeof a == "number" ? `${a}px` : a;
59
- return /* @__PURE__ */ o(
60
- "aside",
61
- {
62
- ref: s,
63
- className: m(
64
- "sticky hidden shrink-0 self-start outline-none lg:block",
65
- t
66
- ),
67
- "data-hook": e,
68
- "data-slot": "sidebar-container",
69
- ...n,
70
- style: {
71
- width: i,
72
- top: 0,
73
- height: "100dvh",
74
- ...n.style
75
- },
76
- children: l
77
- }
78
- );
37
+ return /* @__PURE__ */ l("aside", {
38
+ ref: s,
39
+ className: m("sticky hidden shrink-0 self-start outline-none lg:block", e),
40
+ "data-hook": t,
41
+ "data-slot": "sidebar-container",
42
+ ...r,
43
+ style: {
44
+ width: i,
45
+ top: 0,
46
+ height: "100dvh",
47
+ ...r.style
48
+ },
49
+ children: o
50
+ });
79
51
  });
80
52
  I.displayName = "GlobalLayoutSidebar";
81
- const M = r.forwardRef(
82
- ({
83
- className: t,
84
- maxWidth: a = "var(--ds-breakpoint-lg)",
85
- dataHook: e,
86
- children: l,
87
- ...n
88
- }, s) => {
89
- const i = typeof a == "number" ? `${a}px` : a;
90
- return /* @__PURE__ */ o(
91
- "div",
92
- {
93
- ref: s,
94
- className: m(
95
- "pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",
96
- t
97
- ),
98
- "data-hook": e,
99
- "data-slot": "content-wrapper",
100
- style: { "--content-max-width": i },
101
- ...n,
102
- children: l
103
- }
104
- );
105
- }
106
- );
53
+ var M = n.forwardRef(({ className: e, maxWidth: a = "var(--ds-breakpoint-lg)", dataHook: t, children: o, ...r }, s) => {
54
+ const i = typeof a == "number" ? `${a}px` : a;
55
+ return /* @__PURE__ */ l("div", {
56
+ ref: s,
57
+ className: m("pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6", e),
58
+ "data-hook": t,
59
+ "data-slot": "content-wrapper",
60
+ style: { "--content-max-width": i },
61
+ ...r,
62
+ children: o
63
+ });
64
+ });
107
65
  M.displayName = "GlobalLayoutContent";
108
- const x = "px-4 md:px-6 lg:px-section-xs", v = r.forwardRef((t, a) => {
109
- if (t.href === void 0) {
110
- const { dataHook: s, ariaLabel: i, ...c } = t;
111
- return /* @__PURE__ */ o(
112
- j,
113
- {
114
- ref: a,
115
- ariaLabel: i || "Go back",
116
- "data-slot": "content-header-back-link",
117
- dataHook: s ?? "content-header-back-link",
118
- variant: "ghost",
119
- ...c,
120
- children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
121
- }
122
- );
123
- }
124
- const { dataHook: e, ariaLabel: l, ...n } = t;
125
- return /* @__PURE__ */ o(
126
- B,
127
- {
66
+ var y = "px-4 md:px-6 lg:px-section-xs", w = n.forwardRef((e, a) => {
67
+ if (e.href === void 0) {
68
+ const { dataHook: s, ariaLabel: i, ...c } = e;
69
+ return /* @__PURE__ */ l(H, {
128
70
  ref: a,
129
- "aria-label": l || "Go back",
71
+ ariaLabel: i || "Go back",
130
72
  "data-slot": "content-header-back-link",
131
- dataHook: e ?? "content-header-back-link",
132
- variant: "icon",
133
- ...n,
134
- children: /* @__PURE__ */ o(k, { "aria-hidden": "true" })
135
- }
136
- );
137
- });
138
- v.displayName = "GlobalLayoutBackLink";
139
- const L = r.forwardRef(({ dataHook: t, asChild: a, ...e }, l) => /* @__PURE__ */ o(
140
- S,
141
- {
142
- ref: l,
143
- asChild: a,
144
- color: "muted",
145
- "data-slot": "content-header-subtitle",
146
- dataHook: t ?? "content-header-subtitle",
147
- variant: "body-sm",
148
- ...e
149
- }
150
- ));
151
- L.displayName = "GlobalLayoutSubtitle";
152
- const N = r.forwardRef(({ className: t, dataHook: a, children: e, ...l }, n) => /* @__PURE__ */ o(
153
- "div",
154
- {
155
- ref: n,
156
- className: m(
157
- "aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
158
- t
159
- ),
160
- "data-hook": a ?? "content-header-image",
161
- "data-slot": "content-header-image",
162
- ...l,
163
- children: e
73
+ dataHook: s ?? "content-header-back-link",
74
+ variant: "ghost",
75
+ ...c,
76
+ children: /* @__PURE__ */ l(k, { "aria-hidden": "true" })
77
+ });
164
78
  }
165
- ));
166
- N.displayName = "GlobalLayoutImage";
167
- const T = r.forwardRef(
168
- ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
169
- const c = [], f = [], y = [], b = [], p = [], h = [];
170
- return r.Children.forEach(n, (d) => {
171
- r.isValidElement(d) && d.type === v ? c.push(d) : r.isValidElement(d) && d.type === N ? f.push(d) : r.isValidElement(d) && d.type === C ? y.push(d) : r.isValidElement(d) && d.type === L ? b.push(d) : r.isValidElement(d) && d.type === g ? p.push(d) : h.push(d);
172
- }), c.length === 0 && f.length === 0 && y.length === 0 && b.length === 0 && p.length === 0 ? /* @__PURE__ */ o(
173
- "div",
174
- {
175
- className: m("w-full", x),
176
- "data-slot": "content-header-region",
177
- children: /* @__PURE__ */ o(
178
- w,
179
- {
180
- ref: i,
181
- className: m(
182
- "mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",
183
- t
184
- ),
185
- "data-slot": "content-header",
186
- dataHook: a,
187
- style: { maxWidth: "var(--ds-breakpoint-lg)" },
188
- trackingEl: e,
189
- trackingLabel: l,
190
- ...s,
191
- children: n
192
- }
193
- )
194
- }
195
- ) : /* @__PURE__ */ o(
196
- "div",
197
- {
198
- className: m("w-full", x),
199
- "data-slot": "content-header-region",
200
- children: /* @__PURE__ */ u(
201
- w,
202
- {
203
- ref: i,
204
- className: m("mx-auto w-full items-start gap-4", t),
205
- "data-slot": "content-header",
206
- dataHook: a,
207
- style: { maxWidth: "var(--ds-breakpoint-lg)" },
208
- trackingEl: e,
209
- trackingLabel: l,
210
- ...s,
211
- children: [
212
- c,
213
- f,
214
- /* @__PURE__ */ u(
215
- "div",
216
- {
217
- className: "flex min-w-0 flex-1 flex-col gap-2",
218
- "data-slot": "content-header-body",
219
- children: [
220
- y,
221
- p.length > 0 ? (
222
- // With a slotted GlobalLayoutActions the header follows
223
- // the Figma Page Header structure: a text block (title +
224
- // description) with the actions beside it — and below it on
225
- // mobile, so the action lands under the description.
226
- /* @__PURE__ */ u(
227
- "div",
228
- {
229
- className: "flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col",
230
- "data-slot": "content-header-title",
231
- children: [
232
- /* @__PURE__ */ u(
233
- "div",
234
- {
235
- className: "flex min-w-0 flex-1 flex-col gap-2",
236
- "data-slot": "content-header-text",
237
- children: [
238
- h,
239
- b
240
- ]
241
- }
242
- ),
243
- /* @__PURE__ */ o(G.Provider, { value: !0, children: p })
244
- ]
245
- }
246
- )
247
- ) : /* @__PURE__ */ u(H, { children: [
248
- /* @__PURE__ */ o(
249
- "div",
250
- {
251
- className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
252
- "data-slot": "content-header-title",
253
- children: h
254
- }
255
- ),
256
- b
257
- ] })
258
- ]
259
- }
260
- )
261
- ]
262
- }
263
- )
264
- }
265
- );
266
- }
267
- );
79
+ const { dataHook: t, ariaLabel: o, ...r } = e;
80
+ return /* @__PURE__ */ l(B, {
81
+ ref: a,
82
+ "aria-label": o || "Go back",
83
+ "data-slot": "content-header-back-link",
84
+ dataHook: t ?? "content-header-back-link",
85
+ variant: "icon",
86
+ ...r,
87
+ children: /* @__PURE__ */ l(k, { "aria-hidden": "true" })
88
+ });
89
+ });
90
+ w.displayName = "GlobalLayoutBackLink";
91
+ var N = n.forwardRef(({ dataHook: e, asChild: a, ...t }, o) => /* @__PURE__ */ l(j, {
92
+ ref: o,
93
+ asChild: a,
94
+ color: "muted",
95
+ "data-slot": "content-header-subtitle",
96
+ dataHook: e ?? "content-header-subtitle",
97
+ variant: "body-sm",
98
+ ...t
99
+ }));
100
+ N.displayName = "GlobalLayoutSubtitle";
101
+ var L = n.forwardRef(({ className: e, dataHook: a, children: t, ...o }, r) => /* @__PURE__ */ l("div", {
102
+ ref: r,
103
+ className: m("aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover", e),
104
+ "data-hook": a ?? "content-header-image",
105
+ "data-slot": "content-header-image",
106
+ ...o,
107
+ children: t
108
+ }));
109
+ L.displayName = "GlobalLayoutImage";
110
+ var T = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
111
+ const c = [], f = [], h = [], b = [], p = [], x = [];
112
+ return n.Children.forEach(r, (d) => {
113
+ n.isValidElement(d) && d.type === w ? c.push(d) : n.isValidElement(d) && d.type === L ? f.push(d) : n.isValidElement(d) && d.type === C ? h.push(d) : n.isValidElement(d) && d.type === N ? b.push(d) : n.isValidElement(d) && d.type === g ? p.push(d) : x.push(d);
114
+ }), c.length === 0 && f.length === 0 && h.length === 0 && b.length === 0 && p.length === 0 ? /* @__PURE__ */ l("div", {
115
+ className: m("w-full", y),
116
+ "data-slot": "content-header-region",
117
+ children: /* @__PURE__ */ l(v, {
118
+ ref: i,
119
+ className: m("mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start", e),
120
+ "data-slot": "content-header",
121
+ dataHook: a,
122
+ style: { maxWidth: "var(--ds-breakpoint-lg)" },
123
+ trackingEl: t,
124
+ trackingLabel: o,
125
+ ...s,
126
+ children: r
127
+ })
128
+ }) : /* @__PURE__ */ l("div", {
129
+ className: m("w-full", y),
130
+ "data-slot": "content-header-region",
131
+ children: /* @__PURE__ */ u(v, {
132
+ ref: i,
133
+ className: m("mx-auto w-full items-start gap-4", e),
134
+ "data-slot": "content-header",
135
+ dataHook: a,
136
+ style: { maxWidth: "var(--ds-breakpoint-lg)" },
137
+ trackingEl: t,
138
+ trackingLabel: o,
139
+ ...s,
140
+ children: [
141
+ c,
142
+ f,
143
+ /* @__PURE__ */ u("div", {
144
+ className: "flex min-w-0 flex-1 flex-col gap-2",
145
+ "data-slot": "content-header-body",
146
+ children: [h, p.length > 0 ? /* @__PURE__ */ u("div", {
147
+ className: "flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col",
148
+ "data-slot": "content-header-title",
149
+ children: [/* @__PURE__ */ u("div", {
150
+ className: "flex min-w-0 flex-1 flex-col gap-2",
151
+ "data-slot": "content-header-text",
152
+ children: [x, b]
153
+ }), /* @__PURE__ */ l(G.Provider, {
154
+ value: !0,
155
+ children: p
156
+ })]
157
+ }) : /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ l("div", {
158
+ className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
159
+ "data-slot": "content-header-title",
160
+ children: x
161
+ }), b] })]
162
+ })
163
+ ]
164
+ })
165
+ });
166
+ });
268
167
  T.displayName = "GlobalLayoutContentHeader";
269
- const G = r.createContext(!1), g = r.forwardRef(
270
- ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => {
271
- const c = r.useContext(G), f = /* @__PURE__ */ o(
272
- "div",
273
- {
274
- ref: i,
275
- className: m(
276
- c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
277
- t
278
- ),
279
- "data-hook": a,
280
- "data-slot": "content-actions",
281
- "data-tracking-el": e,
282
- "data-tracking-label": l,
283
- style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
284
- ...s,
285
- children: n
286
- }
287
- );
288
- return c ? f : /* @__PURE__ */ o(
289
- "div",
290
- {
291
- className: m("w-full", x),
292
- "data-slot": "content-actions-region",
293
- children: f
294
- }
295
- );
296
- }
297
- );
168
+ var G = n.createContext(!1), g = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
169
+ const c = n.useContext(G), f = /* @__PURE__ */ l("div", {
170
+ ref: i,
171
+ className: m(c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex", e),
172
+ "data-hook": a,
173
+ "data-slot": "content-actions",
174
+ "data-tracking-el": t,
175
+ "data-tracking-label": o,
176
+ style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
177
+ ...s,
178
+ children: r
179
+ });
180
+ return c ? f : /* @__PURE__ */ l("div", {
181
+ className: m("w-full", y),
182
+ "data-slot": "content-actions-region",
183
+ children: f
184
+ });
185
+ });
298
186
  g.displayName = "GlobalLayoutActions";
299
- const J = g, R = r.forwardRef(
300
- ({ className: t, dataHook: a, trackingEl: e, trackingLabel: l, children: n, ...s }, i) => /* @__PURE__ */ o(
301
- "div",
302
- {
303
- className: m("flex w-full flex-1 flex-col", x),
304
- "data-slot": "content-body-region",
305
- children: /* @__PURE__ */ o(
306
- "div",
307
- {
308
- ref: i,
309
- className: m("mx-auto flex w-full flex-1 flex-col gap-6", t),
310
- "data-hook": a,
311
- "data-slot": "content-body",
312
- "data-tracking-el": e,
313
- "data-tracking-label": l,
314
- style: { maxWidth: "var(--content-max-width)" },
315
- ...s,
316
- children: n
317
- }
318
- )
319
- }
320
- )
321
- );
187
+ var J = g, R = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => /* @__PURE__ */ l("div", {
188
+ className: m("flex w-full flex-1 flex-col", y),
189
+ "data-slot": "content-body-region",
190
+ children: /* @__PURE__ */ l("div", {
191
+ ref: i,
192
+ className: m("mx-auto flex w-full flex-1 flex-col gap-6", e),
193
+ "data-hook": a,
194
+ "data-slot": "content-body",
195
+ "data-tracking-el": t,
196
+ "data-tracking-label": o,
197
+ style: { maxWidth: "var(--content-max-width)" },
198
+ ...s,
199
+ children: r
200
+ })
201
+ }));
322
202
  R.displayName = "GlobalLayoutBody";
323
- const K = R, V = r.forwardRef(
324
- ({
325
- className: t,
326
- dataHook: a,
327
- ariaLabel: e,
328
- trackingEl: l,
329
- trackingLabel: n,
330
- children: s,
331
- ...i
332
- }, c) => /* @__PURE__ */ o(
333
- "div",
334
- {
335
- ref: c,
336
- "aria-label": e ?? "Mobile navigation",
337
- className: m(
338
- // The 2px negative margin pulls a slotted SidebarTrigger's box
339
- // left by its icon inset so the burger glyph — not the invisible
340
- // button box — sits on the content edge.
341
- "flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5",
342
- t
343
- ),
344
- "data-hook": a,
345
- "data-slot": "mobile-header",
346
- "data-tracking-el": l,
347
- "data-tracking-label": n,
348
- role: "toolbar",
349
- ...i,
350
- children: s
351
- }
352
- )
353
- );
203
+ var K = R, V = n.forwardRef(({ className: e, dataHook: a, ariaLabel: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => /* @__PURE__ */ l("div", {
204
+ ref: c,
205
+ "aria-label": t ?? "Mobile navigation",
206
+ className: m("flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5", e),
207
+ "data-hook": a,
208
+ "data-slot": "mobile-header",
209
+ "data-tracking-el": o,
210
+ "data-tracking-label": r,
211
+ role: "toolbar",
212
+ ...i,
213
+ children: s
214
+ }));
354
215
  V.displayName = "GlobalLayoutMobileHeader";
355
216
  export {
356
217
  A as GlobalLayout,
357
218
  g as GlobalLayoutActions,
358
- v as GlobalLayoutBackLink,
219
+ w as GlobalLayoutBackLink,
359
220
  R as GlobalLayoutBody,
360
221
  M as GlobalLayoutContent,
361
222
  J as GlobalLayoutContentActions,
362
223
  K as GlobalLayoutContentBody,
363
224
  T as GlobalLayoutContentHeader,
364
- N as GlobalLayoutImage,
225
+ L as GlobalLayoutImage,
365
226
  V as GlobalLayoutMobileHeader,
366
227
  I as GlobalLayoutSidebar,
367
- L as GlobalLayoutSubtitle
228
+ N as GlobalLayoutSubtitle
368
229
  };
package/dist/grid.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),u=require("@brightlocal/ui-components/lib/utils"),f=require("./lib/optical-center.cjs");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const p=g(d),c=p.forwardRef(({className:e,children:r,dataHook:t,variant:a,trackingEl:i,trackingLabel:l,...o},s)=>n.jsx("div",{ref:s,className:u.cn("flex w-full flex-1 flex-col items-center",e),"data-hook":t,"data-slot":"grid","data-tracking-el":i??"grid","data-tracking-label":l,"data-variant":a,...o,children:n.jsx(f.OpticalCenter,{children:r})}));c.displayName="Grid";exports.Grid=c;
1
+ const s=require("./_virtual/_rolldown/runtime.cjs"),_=require("./lib/optical-center.cjs");let e=require("react");e=s.__toESM(e,1);let q=require("@brightlocal/ui-components/lib/utils"),r=require("react/jsx-runtime");var t=e.forwardRef(({className:i,children:a,dataHook:l,variant:c,trackingEl:n,trackingLabel:d,...u},o)=>(0,r.jsx)("div",{ref:o,className:(0,q.cn)("flex w-full flex-1 flex-col items-center",i),"data-hook":l,"data-slot":"grid","data-tracking-el":n??"grid","data-tracking-label":d,"data-variant":c,...u,children:(0,r.jsx)(_.OpticalCenter,{children:a})}));t.displayName="Grid";exports.Grid=t;
package/dist/grid.d.ts CHANGED
@@ -23,6 +23,10 @@ interface GridBaseProps extends React.ComponentPropsWithoutRef<"div"> {
23
23
  /**
24
24
  * One message at the page body's optical centre (38/62). Give it a page body
25
25
  * to fill — it stretches with `flex-1` — and one message to hold.
26
+ *
27
+ * Requires an unbroken flex chain: the Grid's parent, and every wrapper up to
28
+ * the page body, must be a `flex flex-1 flex-col` box. Behind a non-flex
29
+ * wrapper it centres horizontally only — fix the wrapper, do not add a margin.
26
30
  */
27
31
  interface GridCenteredProps extends GridBaseProps {
28
32
  variant: "centered";
@@ -42,13 +46,32 @@ export type GridProps = GridCenteredProps;
42
46
  * <Grid dataHook="locations-empty-center" variant="centered">
43
47
  * <EmptyState
44
48
  * dataHook="locations-empty"
45
- * illustration={<BusinessLocation aria-hidden />}
49
+ * illustration={<SmallBusiness aria-hidden />}
46
50
  * size="lg"
47
51
  * title={t("locations.empty.title")}
48
52
  * />
49
53
  * </Grid>
50
54
  * </GlobalLayoutBody>
51
55
  * ```
56
+ *
57
+ * @example
58
+ * Wrappers between the page body and the Grid must continue the flex chain:
59
+ * ```tsx
60
+ * // Broken — the plain <div> has no height to give, so the Grid collapses to
61
+ * // its content and the message hugs the top (horizontal centring only).
62
+ * <GlobalLayoutBody dataHook="search-body">
63
+ * <div>
64
+ * <Grid dataHook="search-empty-center" variant="centered">…</Grid>
65
+ * </div>
66
+ * </GlobalLayoutBody>
67
+ *
68
+ * // Fixed — the wrapper passes the height down.
69
+ * <GlobalLayoutBody dataHook="search-body">
70
+ * <div className="flex flex-1 flex-col">
71
+ * <Grid dataHook="search-empty-center" variant="centered">…</Grid>
72
+ * </div>
73
+ * </GlobalLayoutBody>
74
+ * ```
52
75
  */
53
76
  declare const Grid: React.ForwardRefExoticComponent<GridCenteredProps & React.RefAttributes<HTMLDivElement>>;
54
77
  export { Grid };
@@ -1 +1 @@
1
- {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwC/B;;;;GAIG;AACH,KAAK,WAAW,GAAG,UAAU,CAAC;AAE9B,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../src/components/grid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgD/B;;;;GAIG;AACH,KAAK,WAAW,GAAG,UAAU,CAAC;AAE9B,UAAU,aAAc,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACnE;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,OAAO,EAAE,UAAU,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,QAAA,MAAM,IAAI,0FA4BT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,YAAY,EAAE,WAAW,EAAE,CAAC"}