@brightlocal/ui-components 3.2.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 (428) hide show
  1. package/AI_USAGE.md +10 -0
  2. package/README.md +3 -1
  3. package/component-meta.json +1271 -428
  4. package/deprecations.json +44 -0
  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 +6 -4
  10. package/dist/alert-dialog.d.ts.map +1 -1
  11. package/dist/alert-dialog.js +85 -133
  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 +106 -168
  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 +23 -1
  22. package/dist/badge.d.ts.map +1 -1
  23. package/dist/badge.js +90 -91
  24. package/dist/banner.cjs +1 -1
  25. package/dist/banner.js +102 -148
  26. package/dist/blocks/empty-state.cjs +1 -1
  27. package/dist/blocks/empty-state.d.ts +20 -3
  28. package/dist/blocks/empty-state.d.ts.map +1 -1
  29. package/dist/blocks/empty-state.js +73 -140
  30. package/dist/blocks/input-list.cjs +2 -2
  31. package/dist/blocks/input-list.d.ts +2 -2
  32. package/dist/blocks/input-list.d.ts.map +1 -1
  33. package/dist/blocks/input-list.js +136 -176
  34. package/dist/blocks/progress-state.cjs +1 -1
  35. package/dist/blocks/progress-state.js +223 -347
  36. package/dist/blocks/sidebar.cjs +1 -1
  37. package/dist/blocks/sidebar.d.ts +11 -6
  38. package/dist/blocks/sidebar.d.ts.map +1 -1
  39. package/dist/blocks/sidebar.js +763 -1092
  40. package/dist/brand-illustration-motif.cjs +1 -1
  41. package/dist/brand-illustration-motif.js +40 -61
  42. package/dist/breadcrumb.cjs +1 -1
  43. package/dist/breadcrumb.js +62 -102
  44. package/dist/button-group.cjs +1 -1
  45. package/dist/button-group.js +23 -31
  46. package/dist/button.cjs +1 -1
  47. package/dist/button.d.ts +4 -2
  48. package/dist/button.d.ts.map +1 -1
  49. package/dist/button.js +149 -189
  50. package/dist/calendar.cjs +1 -1
  51. package/dist/calendar.d.ts +87 -3
  52. package/dist/calendar.d.ts.map +1 -1
  53. package/dist/calendar.js +116 -173
  54. package/dist/callout.cjs +1 -1
  55. package/dist/callout.js +73 -96
  56. package/dist/card.cjs +1 -1
  57. package/dist/card.d.ts +10 -4
  58. package/dist/card.d.ts.map +1 -1
  59. package/dist/card.js +233 -316
  60. package/dist/carousel.cjs +1 -1
  61. package/dist/carousel.d.ts +3 -3
  62. package/dist/carousel.d.ts.map +1 -1
  63. package/dist/carousel.js +174 -268
  64. package/dist/centred-layout.cjs +1 -1
  65. package/dist/centred-layout.js +27 -48
  66. package/dist/chart-empty.cjs +1 -1
  67. package/dist/chart-empty.js +18 -27
  68. package/dist/chart.cjs +7 -7
  69. package/dist/chart.d.ts +23 -13
  70. package/dist/chart.d.ts.map +1 -1
  71. package/dist/chart.js +445 -651
  72. package/dist/checkbox.cjs +1 -1
  73. package/dist/checkbox.js +36 -69
  74. package/dist/chip.cjs +1 -1
  75. package/dist/chip.js +116 -173
  76. package/dist/collapsible.cjs +1 -1
  77. package/dist/collapsible.d.ts.map +1 -1
  78. package/dist/collapsible.js +35 -41
  79. package/dist/combobox.cjs +3 -3
  80. package/dist/combobox.d.ts +14 -4
  81. package/dist/combobox.d.ts.map +1 -1
  82. package/dist/combobox.js +439 -638
  83. package/dist/command.cjs +1 -1
  84. package/dist/command.d.ts.map +1 -1
  85. package/dist/command.js +273 -420
  86. package/dist/context-menu.cjs +1 -1
  87. package/dist/context-menu.d.ts +5 -5
  88. package/dist/context-menu.d.ts.map +1 -1
  89. package/dist/context-menu.js +121 -191
  90. package/dist/data-table.cjs +1 -1
  91. package/dist/data-table.d.ts +280 -129
  92. package/dist/data-table.d.ts.map +1 -1
  93. package/dist/data-table.js +687 -948
  94. package/dist/date-picker.cjs +1 -1
  95. package/dist/date-picker.d.ts +15 -4
  96. package/dist/date-picker.d.ts.map +1 -1
  97. package/dist/date-picker.js +156 -231
  98. package/dist/delta.cjs +1 -0
  99. package/dist/delta.d.ts +79 -0
  100. package/dist/delta.d.ts.map +1 -0
  101. package/dist/delta.js +62 -0
  102. package/dist/description.cjs +1 -1
  103. package/dist/description.js +11 -20
  104. package/dist/dialog.cjs +1 -1
  105. package/dist/dialog.d.ts +1 -1
  106. package/dist/dialog.d.ts.map +1 -1
  107. package/dist/dialog.js +76 -116
  108. package/dist/drawer.cjs +1 -1
  109. package/dist/drawer.d.ts +11 -11
  110. package/dist/drawer.d.ts.map +1 -1
  111. package/dist/drawer.js +76 -134
  112. package/dist/dropdown-menu.cjs +1 -1
  113. package/dist/dropdown-menu.d.ts +6 -6
  114. package/dist/dropdown-menu.d.ts.map +1 -1
  115. package/dist/dropdown-menu.js +179 -300
  116. package/dist/field.cjs +1 -1
  117. package/dist/field.d.ts +9 -9
  118. package/dist/field.d.ts.map +1 -1
  119. package/dist/field.js +166 -286
  120. package/dist/global-layout.cjs +1 -1
  121. package/dist/global-layout.js +203 -342
  122. package/dist/grid.cjs +1 -1
  123. package/dist/grid.js +16 -29
  124. package/dist/header.cjs +1 -1
  125. package/dist/header.js +21 -38
  126. package/dist/height-transition.cjs +1 -1
  127. package/dist/height-transition.js +38 -55
  128. package/dist/hooks/use-breakpoint.cjs +1 -1
  129. package/dist/hooks/use-breakpoint.js +9 -9
  130. package/dist/hooks/use-debounce.cjs +1 -1
  131. package/dist/hooks/use-debounce.js +12 -11
  132. package/dist/hooks/use-delayed-pending.cjs +1 -1
  133. package/dist/hooks/use-delayed-pending.js +8 -9
  134. package/dist/hooks/use-filter-search-params.cjs +1 -0
  135. package/dist/hooks/use-filter-search-params.d.ts +93 -0
  136. package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
  137. package/dist/hooks/use-filter-search-params.js +122 -0
  138. package/dist/hooks/use-mobile.cjs +1 -1
  139. package/dist/hooks/use-mobile.js +6 -6
  140. package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
  141. package/dist/hooks/use-overlay-pointer-lock.js +8 -9
  142. package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
  143. package/dist/hooks/use-prefers-reduced-motion.js +5 -8
  144. package/dist/hover-card.cjs +1 -1
  145. package/dist/hover-card.d.ts +1 -1
  146. package/dist/hover-card.d.ts.map +1 -1
  147. package/dist/hover-card.js +30 -62
  148. package/dist/index.cjs +1 -1
  149. package/dist/index.d.ts +6 -0
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +630 -608
  152. package/dist/info-tooltip.cjs +1 -1
  153. package/dist/info-tooltip.js +22 -36
  154. package/dist/input-chip.cjs +1 -1
  155. package/dist/input-chip.d.ts +32 -3
  156. package/dist/input-chip.d.ts.map +1 -1
  157. package/dist/input-chip.js +181 -230
  158. package/dist/input-group.cjs +1 -1
  159. package/dist/input-group.js +174 -221
  160. package/dist/input-otp.cjs +1 -1
  161. package/dist/input-otp.d.ts +3 -3
  162. package/dist/input-otp.d.ts.map +1 -1
  163. package/dist/input-otp.js +102 -146
  164. package/dist/input-password.cjs +1 -1
  165. package/dist/input-password.d.ts +12 -16
  166. package/dist/input-password.d.ts.map +1 -1
  167. package/dist/input-password.js +139 -171
  168. package/dist/input.cjs +1 -1
  169. package/dist/input.d.ts.map +1 -1
  170. package/dist/input.js +51 -73
  171. package/dist/label.cjs +1 -1
  172. package/dist/label.js +20 -38
  173. package/dist/lib/block-illustration.cjs +1 -1
  174. package/dist/lib/block-illustration.d.ts +1 -1
  175. package/dist/lib/block-illustration.d.ts.map +1 -1
  176. package/dist/lib/block-illustration.js +16 -18
  177. package/dist/lib/compose-event-handlers.cjs +1 -0
  178. package/dist/lib/compose-event-handlers.d.ts +9 -0
  179. package/dist/lib/compose-event-handlers.d.ts.map +1 -0
  180. package/dist/lib/compose-event-handlers.js +8 -0
  181. package/dist/lib/download-file.cjs +1 -0
  182. package/dist/lib/download-file.d.ts +14 -0
  183. package/dist/lib/download-file.d.ts.map +1 -0
  184. package/dist/lib/download-file.js +40 -0
  185. package/dist/lib/empty-canvas.cjs +1 -1
  186. package/dist/lib/empty-canvas.js +28 -56
  187. package/dist/lib/empty-chip.cjs +1 -1
  188. package/dist/lib/empty-chip.d.ts +14 -3
  189. package/dist/lib/empty-chip.d.ts.map +1 -1
  190. package/dist/lib/empty-chip.js +15 -11
  191. package/dist/lib/field-aria.cjs +1 -0
  192. package/dist/lib/field-aria.d.ts +34 -0
  193. package/dist/lib/field-aria.d.ts.map +1 -0
  194. package/dist/lib/field-aria.js +52 -0
  195. package/dist/lib/image-file-info.cjs +1 -0
  196. package/dist/lib/image-file-info.d.ts +25 -0
  197. package/dist/lib/image-file-info.d.ts.map +1 -0
  198. package/dist/lib/image-file-info.js +67 -0
  199. package/dist/lib/media-viewer-content.cjs +1 -0
  200. package/dist/lib/media-viewer-content.d.ts +102 -0
  201. package/dist/lib/media-viewer-content.d.ts.map +1 -0
  202. package/dist/lib/media-viewer-content.js +650 -0
  203. package/dist/lib/media-viewer-internal.cjs +1 -0
  204. package/dist/lib/media-viewer-internal.d.ts +98 -0
  205. package/dist/lib/media-viewer-internal.d.ts.map +1 -0
  206. package/dist/lib/media-viewer-internal.js +61 -0
  207. package/dist/lib/media-viewer-motion.cjs +1 -0
  208. package/dist/lib/media-viewer-motion.d.ts +40 -0
  209. package/dist/lib/media-viewer-motion.d.ts.map +1 -0
  210. package/dist/lib/media-viewer-motion.js +37 -0
  211. package/dist/lib/motion.cjs +1 -1
  212. package/dist/lib/motion.d.ts +8 -0
  213. package/dist/lib/motion.d.ts.map +1 -1
  214. package/dist/lib/motion.js +11 -10
  215. package/dist/lib/optical-center.cjs +1 -1
  216. package/dist/lib/optical-center.d.ts +1 -1
  217. package/dist/lib/optical-center.d.ts.map +1 -1
  218. package/dist/lib/optical-center.js +12 -5
  219. package/dist/lib/spring-settle.cjs +1 -1
  220. package/dist/lib/spring-settle.js +1 -1
  221. package/dist/lib/table-internal.cjs +1 -0
  222. package/dist/lib/table-internal.d.ts +62 -0
  223. package/dist/lib/table-internal.d.ts.map +1 -0
  224. package/dist/lib/table-internal.js +18 -0
  225. package/dist/lib/use-controllable.cjs +1 -0
  226. package/dist/lib/use-controllable.d.ts +12 -0
  227. package/dist/lib/use-controllable.d.ts.map +1 -0
  228. package/dist/lib/use-controllable.js +15 -0
  229. package/dist/lib/use-dev-warning.cjs +1 -1
  230. package/dist/lib/utils.cjs +1 -1
  231. package/dist/lib/utils.js +26 -33
  232. package/dist/link.cjs +1 -1
  233. package/dist/link.d.ts +1 -1
  234. package/dist/link.js +78 -124
  235. package/dist/list.cjs +1 -1
  236. package/dist/list.d.ts +8 -0
  237. package/dist/list.d.ts.map +1 -1
  238. package/dist/list.js +94 -156
  239. package/dist/loading.cjs +1 -1
  240. package/dist/loading.js +124 -151
  241. package/dist/logo-mark.cjs +1 -0
  242. package/dist/logo-mark.d.ts +79 -0
  243. package/dist/logo-mark.d.ts.map +1 -0
  244. package/dist/logo-mark.js +219 -0
  245. package/dist/logo.cjs +1 -1
  246. package/dist/logo.d.ts +1 -1
  247. package/dist/logo.d.ts.map +1 -1
  248. package/dist/logo.js +51 -87
  249. package/dist/map.cjs +1 -1
  250. package/dist/map.d.ts.map +1 -1
  251. package/dist/map.js +390 -586
  252. package/dist/media-empty.cjs +1 -1
  253. package/dist/media-empty.js +27 -42
  254. package/dist/media-viewer.cjs +1 -0
  255. package/dist/media-viewer.d.ts +224 -0
  256. package/dist/media-viewer.d.ts.map +1 -0
  257. package/dist/media-viewer.js +295 -0
  258. package/dist/menubar.cjs +1 -1
  259. package/dist/menubar.d.ts +14 -14
  260. package/dist/menubar.d.ts.map +1 -1
  261. package/dist/menubar.js +130 -267
  262. package/dist/multi-select-filter.cjs +1 -1
  263. package/dist/multi-select-filter.d.ts +9 -1
  264. package/dist/multi-select-filter.d.ts.map +1 -1
  265. package/dist/multi-select-filter.js +357 -446
  266. package/dist/navigation-menu.cjs +1 -1
  267. package/dist/navigation-menu.js +108 -172
  268. package/dist/pagination.cjs +1 -1
  269. package/dist/pagination.d.ts +36 -12
  270. package/dist/pagination.d.ts.map +1 -1
  271. package/dist/pagination.js +208 -281
  272. package/dist/popover.cjs +1 -1
  273. package/dist/popover.d.ts +1 -1
  274. package/dist/popover.d.ts.map +1 -1
  275. package/dist/popover.js +34 -45
  276. package/dist/progress.cjs +1 -1
  277. package/dist/progress.d.ts +17 -2
  278. package/dist/progress.d.ts.map +1 -1
  279. package/dist/progress.js +116 -162
  280. package/dist/radio-group.cjs +1 -1
  281. package/dist/radio-group.js +90 -146
  282. package/dist/rating.cjs +1 -1
  283. package/dist/rating.d.ts +80 -13
  284. package/dist/rating.d.ts.map +1 -1
  285. package/dist/rating.js +70 -65
  286. package/dist/relative-date.cjs +1 -1
  287. package/dist/relative-date.d.ts.map +1 -1
  288. package/dist/relative-date.js +73 -89
  289. package/dist/resizable.cjs +1 -1
  290. package/dist/resizable.d.ts +39 -23
  291. package/dist/resizable.d.ts.map +1 -1
  292. package/dist/resizable.js +42 -44
  293. package/dist/result-count.cjs +1 -0
  294. package/dist/result-count.d.ts +110 -0
  295. package/dist/result-count.d.ts.map +1 -0
  296. package/dist/result-count.js +49 -0
  297. package/dist/route-progress.cjs +1 -1
  298. package/dist/route-progress.js +58 -102
  299. package/dist/scroll-area.cjs +1 -1
  300. package/dist/scroll-area.d.ts +9 -1
  301. package/dist/scroll-area.d.ts.map +1 -1
  302. package/dist/scroll-area.js +44 -79
  303. package/dist/select.cjs +2 -2
  304. package/dist/select.d.ts +10 -10
  305. package/dist/select.d.ts.map +1 -1
  306. package/dist/select.js +118 -238
  307. package/dist/separator.cjs +1 -1
  308. package/dist/separator.js +90 -78
  309. package/dist/sheet.cjs +1 -1
  310. package/dist/sheet.d.ts +8 -5
  311. package/dist/sheet.d.ts.map +1 -1
  312. package/dist/sheet.js +250 -317
  313. package/dist/single-select-filter.cjs +1 -1
  314. package/dist/single-select-filter.d.ts +32 -0
  315. package/dist/single-select-filter.d.ts.map +1 -1
  316. package/dist/single-select-filter.js +201 -203
  317. package/dist/skeleton.cjs +1 -1
  318. package/dist/skeleton.js +24 -38
  319. package/dist/slider.cjs +1 -1
  320. package/dist/slider.js +51 -81
  321. package/dist/sonner.cjs +1 -1
  322. package/dist/sonner.d.ts +1 -1
  323. package/dist/sonner.d.ts.map +1 -1
  324. package/dist/sonner.js +101 -125
  325. package/dist/spinner.cjs +1 -1
  326. package/dist/spinner.js +22 -31
  327. package/dist/split-layout.cjs +1 -1
  328. package/dist/split-layout.js +52 -101
  329. package/dist/status.cjs +1 -0
  330. package/dist/status.d.ts +51 -0
  331. package/dist/status.d.ts.map +1 -0
  332. package/dist/status.js +60 -0
  333. package/dist/stepper.cjs +1 -1
  334. package/dist/stepper.js +184 -316
  335. package/dist/switch.cjs +1 -1
  336. package/dist/switch.js +17 -32
  337. package/dist/table.cjs +1 -1
  338. package/dist/table.d.ts +103 -30
  339. package/dist/table.d.ts.map +1 -1
  340. package/dist/table.js +170 -209
  341. package/dist/tabs.cjs +1 -1
  342. package/dist/tabs.d.ts.map +1 -1
  343. package/dist/tabs.js +102 -147
  344. package/dist/text-reveal-motion.cjs +1 -1
  345. package/dist/text-reveal-motion.js +307 -363
  346. package/dist/textarea.cjs +1 -1
  347. package/dist/textarea.d.ts.map +1 -1
  348. package/dist/textarea.js +22 -35
  349. package/dist/toggle-group.cjs +1 -1
  350. package/dist/toggle-group.js +43 -62
  351. package/dist/toggle.cjs +1 -1
  352. package/dist/toggle.js +34 -46
  353. package/dist/tooltip.cjs +1 -1
  354. package/dist/tooltip.d.ts +2 -2
  355. package/dist/tooltip.d.ts.map +1 -1
  356. package/dist/tooltip.js +157 -249
  357. package/dist/typography-heading.cjs +1 -1
  358. package/dist/typography-heading.js +25 -61
  359. package/dist/typography-text.cjs +1 -1
  360. package/dist/typography-text.js +27 -57
  361. package/dist/typography.cjs +1 -1
  362. package/dist/typography.js +132 -340
  363. package/package.json +46 -46
  364. package/src/blocks/empty-state.tsx +34 -18
  365. package/src/blocks/sidebar.tsx +86 -31
  366. package/src/components/accordion.tsx +1 -1
  367. package/src/components/alert-dialog.tsx +4 -2
  368. package/src/components/badge.tsx +127 -15
  369. package/src/components/breadcrumb.tsx +1 -1
  370. package/src/components/button.tsx +8 -6
  371. package/src/components/calendar.tsx +155 -9
  372. package/src/components/card.tsx +63 -10
  373. package/src/components/carousel.tsx +4 -1
  374. package/src/components/chart.tsx +151 -17
  375. package/src/components/checkbox.tsx +1 -1
  376. package/src/components/collapsible.tsx +4 -1
  377. package/src/components/combobox.tsx +40 -7
  378. package/src/components/command.tsx +9 -10
  379. package/src/components/context-menu.tsx +4 -4
  380. package/src/components/data-table.tsx +619 -237
  381. package/src/components/date-picker.tsx +31 -4
  382. package/src/components/delta.tsx +217 -0
  383. package/src/components/drawer.tsx +5 -5
  384. package/src/components/dropdown-menu.tsx +4 -4
  385. package/src/components/field.tsx +36 -15
  386. package/src/components/global-layout.tsx +1 -1
  387. package/src/components/input-chip.tsx +51 -7
  388. package/src/components/input-group.tsx +1 -1
  389. package/src/components/input-password.tsx +15 -19
  390. package/src/components/input.tsx +10 -1
  391. package/src/components/list.tsx +14 -2
  392. package/src/components/logo-mark.tsx +345 -0
  393. package/src/components/map.tsx +18 -20
  394. package/src/components/media-viewer.tsx +908 -0
  395. package/src/components/multi-select-filter.tsx +255 -121
  396. package/src/components/navigation-menu.tsx +2 -2
  397. package/src/components/pagination.tsx +86 -26
  398. package/src/components/progress.tsx +91 -23
  399. package/src/components/rating.tsx +200 -74
  400. package/src/components/relative-date.tsx +19 -11
  401. package/src/components/resizable.tsx +86 -33
  402. package/src/components/result-count.tsx +253 -0
  403. package/src/components/scroll-area.tsx +31 -5
  404. package/src/components/select.tsx +2 -2
  405. package/src/components/sheet.tsx +14 -4
  406. package/src/components/single-select-filter.tsx +136 -41
  407. package/src/components/slider.tsx +2 -2
  408. package/src/components/status.tsx +162 -0
  409. package/src/components/switch.tsx +1 -1
  410. package/src/components/table.tsx +278 -106
  411. package/src/components/tabs.tsx +1 -0
  412. package/src/components/textarea.tsx +20 -2
  413. package/src/components/toggle.tsx +2 -2
  414. package/src/components/tooltip.tsx +11 -20
  415. package/src/hooks/use-filter-search-params.ts +302 -0
  416. package/src/index.ts +6 -0
  417. package/src/lib/compose-event-handlers.ts +14 -0
  418. package/src/lib/download-file.ts +61 -0
  419. package/src/lib/empty-chip.tsx +52 -0
  420. package/src/lib/field-aria.tsx +97 -0
  421. package/src/lib/image-file-info.ts +102 -0
  422. package/src/lib/media-viewer-content.tsx +1587 -0
  423. package/src/lib/media-viewer-internal.tsx +191 -0
  424. package/src/lib/media-viewer-motion.ts +120 -0
  425. package/src/lib/motion.ts +9 -0
  426. package/src/lib/table-internal.ts +74 -0
  427. package/src/lib/use-controllable.ts +43 -0
  428. package/src/lib/empty-chip.ts +0 -24
package/dist/header.js CHANGED
@@ -1,41 +1,24 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { cva as d } from "class-variance-authority";
4
- import { cn as c } from "@brightlocal/ui-components/lib/utils";
5
- const m = d("flex w-full items-center", {
6
- variants: {
7
- align: {
8
- left: "justify-start",
9
- center: "justify-center",
10
- right: "justify-end"
11
- }
12
- },
13
- defaultVariants: {
14
- align: "left"
15
- }
16
- }), p = o.forwardRef(
17
- ({
18
- className: a,
19
- dataHook: t,
20
- align: e = "left",
21
- trackingEl: r,
22
- trackingLabel: i,
23
- children: s,
24
- ...f
25
- }, l) => /* @__PURE__ */ n(
26
- "header",
27
- {
28
- ref: l,
29
- className: c(m({ align: e }), a),
30
- "data-hook": t,
31
- "data-slot": "header",
32
- "data-tracking-el": r,
33
- "data-tracking-label": i,
34
- ...f,
35
- children: s
36
- }
37
- )
38
- );
1
+ import * as d from "react";
2
+ import { cn as n } from "@brightlocal/ui-components/lib/utils";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ import { cva as m } from "class-variance-authority";
5
+ var c = m("flex w-full items-center", {
6
+ variants: { align: {
7
+ left: "justify-start",
8
+ center: "justify-center",
9
+ right: "justify-end"
10
+ } },
11
+ defaultVariants: { align: "left" }
12
+ }), p = d.forwardRef(({ className: a, dataHook: e, align: t = "left", trackingEl: r, trackingLabel: i, children: f, ...l }, s) => /* @__PURE__ */ o("header", {
13
+ ref: s,
14
+ className: n(c({ align: t }), a),
15
+ "data-hook": e,
16
+ "data-slot": "header",
17
+ "data-tracking-el": r,
18
+ "data-tracking-label": i,
19
+ ...l,
20
+ children: f
21
+ }));
39
22
  p.displayName = "Header";
40
23
  export {
41
24
  p as Header
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),g=require("react"),h=require("@brightlocal/ui-components/lib/utils");function b(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const o=b(g);function y(){const e=o.useRef(null),[r,n]=o.useState();return o.useLayoutEffect(()=>{const t=e.current;if(!t||typeof ResizeObserver>"u")return;const i=new ResizeObserver(s=>{if(t.offsetParent===null)return;const a=s[0]?.borderBoxSize?.[0]?.blockSize??t.getBoundingClientRect().height;n(a)});return i.observe(t),()=>i.disconnect()},[]),{contentRef:e,height:r}}const l=o.forwardRef(({className:e,style:r,dataHook:n,trackingEl:t,trackingLabel:i,children:s,...c},a)=>{const{contentRef:f,height:d}=y();return u.jsx("div",{ref:a,className:h.cn("duration-base overflow-hidden transition-[height] ease-out",e),"data-hook":n,"data-slot":"height-transition","data-tracking-el":t||"height-transition","data-tracking-label":i,style:{...r,height:d},...c,children:u.jsx("div",{ref:f,className:"flow-root","data-slot":"height-transition-content",children:s})})});l.displayName="HeightTransition";exports.HeightTransition=l;
1
+ "use client";const f=require("./_virtual/_rolldown/runtime.cjs");let t=require("react");t=f.__toESM(t,1);let g=require("@brightlocal/ui-components/lib/utils"),u=require("react/jsx-runtime");function b(){const n=t.useRef(null),[r,o]=t.useState();return t.useLayoutEffect(()=>{const e=n.current;if(!e||typeof ResizeObserver>"u")return;const i=new ResizeObserver(s=>{if(e.offsetParent===null)return;const a=s[0]?.borderBoxSize?.[0]?.blockSize??e.getBoundingClientRect().height;o(a)});return i.observe(e),()=>i.disconnect()},[]),{contentRef:n,height:r}}var c=t.forwardRef(({className:n,style:r,dataHook:o,trackingEl:e,trackingLabel:i,children:s,...a},l)=>{const{contentRef:h,height:d}=b();return(0,u.jsx)("div",{ref:l,className:(0,g.cn)("duration-base overflow-hidden transition-[height] ease-out",n),"data-hook":o,"data-slot":"height-transition","data-tracking-el":e||"height-transition","data-tracking-label":i,style:{...r,height:d},...a,children:(0,u.jsx)("div",{ref:h,className:"flow-root","data-slot":"height-transition-content",children:s})})});c.displayName="HeightTransition";exports.HeightTransition=c;
@@ -1,62 +1,45 @@
1
- import { jsx as f } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { cn as u } from "@brightlocal/ui-components/lib/utils";
1
+ "use client";
2
+ import * as i from "react";
3
+ import { cn as d } from "@brightlocal/ui-components/lib/utils";
4
+ import { jsx as c } from "react/jsx-runtime";
4
5
  function l() {
5
- const e = o.useRef(null), [r, i] = o.useState();
6
- return o.useLayoutEffect(() => {
7
- const t = e.current;
8
- if (!t || typeof ResizeObserver > "u")
9
- return;
6
+ const t = i.useRef(null), [r, o] = i.useState();
7
+ return i.useLayoutEffect(() => {
8
+ const e = t.current;
9
+ if (!e || typeof ResizeObserver > "u") return;
10
10
  const n = new ResizeObserver((s) => {
11
- if (t.offsetParent === null)
12
- return;
13
- const a = s[0]?.borderBoxSize?.[0]?.blockSize ?? t.getBoundingClientRect().height;
14
- i(a);
11
+ if (e.offsetParent === null) return;
12
+ const a = s[0]?.borderBoxSize?.[0]?.blockSize ?? e.getBoundingClientRect().height;
13
+ o(a);
15
14
  });
16
- return n.observe(t), () => n.disconnect();
17
- }, []), { contentRef: e, height: r };
15
+ return n.observe(e), () => n.disconnect();
16
+ }, []), {
17
+ contentRef: t,
18
+ height: r
19
+ };
18
20
  }
19
- const g = o.forwardRef(
20
- ({
21
- className: e,
22
- style: r,
23
- dataHook: i,
24
- trackingEl: t,
25
- trackingLabel: n,
26
- children: s,
27
- ...c
28
- }, a) => {
29
- const { contentRef: h, height: d } = l();
30
- return /* @__PURE__ */ f(
31
- "div",
32
- {
33
- ref: a,
34
- className: u(
35
- "duration-base overflow-hidden transition-[height] ease-out",
36
- e
37
- ),
38
- "data-hook": i,
39
- "data-slot": "height-transition",
40
- "data-tracking-el": t || "height-transition",
41
- "data-tracking-label": n,
42
- style: {
43
- ...r,
44
- height: d
45
- },
46
- ...c,
47
- children: /* @__PURE__ */ f(
48
- "div",
49
- {
50
- ref: h,
51
- className: "flow-root",
52
- "data-slot": "height-transition-content",
53
- children: s
54
- }
55
- )
56
- }
57
- );
58
- }
59
- );
21
+ var g = i.forwardRef(({ className: t, style: r, dataHook: o, trackingEl: e, trackingLabel: n, children: s, ...a }, f) => {
22
+ const { contentRef: h, height: u } = l();
23
+ return /* @__PURE__ */ c("div", {
24
+ ref: f,
25
+ className: d("duration-base overflow-hidden transition-[height] ease-out", t),
26
+ "data-hook": o,
27
+ "data-slot": "height-transition",
28
+ "data-tracking-el": e || "height-transition",
29
+ "data-tracking-label": n,
30
+ style: {
31
+ ...r,
32
+ height: u
33
+ },
34
+ ...a,
35
+ children: /* @__PURE__ */ c("div", {
36
+ ref: h,
37
+ className: "flow-root",
38
+ "data-slot": "height-transition-content",
39
+ children: s
40
+ })
41
+ });
42
+ });
60
43
  g.displayName = "HeightTransition";
61
44
  export {
62
45
  g as HeightTransition
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");function l(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const u=l(d),c={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function r(e="sm"){if(typeof document>"u")return c[e];const n=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(n,10);return Number.isNaN(t)?c[e]:t}function s(e="sm"){return typeof window<"u"&&window.innerWidth<r(e)}function p(e="sm"){const[n,t]=u.useState(()=>s(e));return u.useEffect(()=>{const o=r(e),i=window.matchMedia(`(max-width: ${o-1}px)`),a=()=>{t(window.innerWidth<o)};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[e]),n}exports.getBreakpointValue=r;exports.isBelowBreakpoint=s;exports.useIsBelowBreakpoint=p;
1
+ const c=require("../_virtual/_rolldown/runtime.cjs");let n=require("react");n=c.__toESM(n,1);var a={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function o(e="sm"){if(typeof document>"u")return a[e];const r=getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(),t=parseInt(r,10);return Number.isNaN(t)?a[e]:t}function d(e="sm"){return typeof window<"u"&&window.innerWidth<o(e)}function m(e="sm"){const[r,t]=n.useState(()=>d(e));return n.useEffect(()=>{const i=o(e),u=window.matchMedia(`(max-width: ${i-1}px)`),s=()=>{t(window.innerWidth<i)};return u.addEventListener("change",s),()=>u.removeEventListener("change",s)},[e]),r}exports.getBreakpointValue=o;exports.isBelowBreakpoint=d;exports.useIsBelowBreakpoint=m;
@@ -1,5 +1,5 @@
1
1
  import * as s from "react";
2
- const d = {
2
+ var a = {
3
3
  xs: 480,
4
4
  sm: 640,
5
5
  md: 768,
@@ -7,25 +7,25 @@ const d = {
7
7
  xl: 1280,
8
8
  "2xl": 1536
9
9
  };
10
- function a(e = "sm") {
11
- if (typeof document > "u") return d[e];
10
+ function d(e = "sm") {
11
+ if (typeof document > "u") return a[e];
12
12
  const n = getComputedStyle(document.documentElement).getPropertyValue(`--ds-breakpoint-${e}`).trim(), t = parseInt(n, 10);
13
- return Number.isNaN(t) ? d[e] : t;
13
+ return Number.isNaN(t) ? a[e] : t;
14
14
  }
15
15
  function u(e = "sm") {
16
- return typeof window < "u" && window.innerWidth < a(e);
16
+ return typeof window < "u" && window.innerWidth < d(e);
17
17
  }
18
- function c(e = "sm") {
18
+ function m(e = "sm") {
19
19
  const [n, t] = s.useState(() => u(e));
20
20
  return s.useEffect(() => {
21
- const o = a(e), r = window.matchMedia(`(max-width: ${o - 1}px)`), i = () => {
21
+ const o = d(e), r = window.matchMedia(`(max-width: ${o - 1}px)`), i = () => {
22
22
  t(window.innerWidth < o);
23
23
  };
24
24
  return r.addEventListener("change", i), () => r.removeEventListener("change", i);
25
25
  }, [e]), n;
26
26
  }
27
27
  export {
28
- a as getBreakpointValue,
28
+ d as getBreakpointValue,
29
29
  u as isBelowBreakpoint,
30
- c as useIsBelowBreakpoint
30
+ m as useIsBelowBreakpoint
31
31
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react");function l(t,r=300){const[s,n]=u.useState(t),e=u.useRef(null),c=u.useRef(t);u.useEffect(()=>{c.current=t},[t]),u.useEffect(()=>(e.current=setTimeout(()=>{e.current=null,n(t)},r),()=>{e.current&&(clearTimeout(e.current),e.current=null)}),[t,r]);const o=u.useCallback(()=>{e.current&&(clearTimeout(e.current),e.current=null),n(c.current)},[]);return{debouncedValue:s,flush:o}}exports.useDebounce=l;
1
+ let r=require("react");function l(u,t=300){const[s,n]=(0,r.useState)(u),e=(0,r.useRef)(null),c=(0,r.useRef)(u);return(0,r.useEffect)(()=>{c.current=u},[u]),(0,r.useEffect)(()=>(e.current=setTimeout(()=>{e.current=null,n(u)},t),()=>{e.current&&(clearTimeout(e.current),e.current=null)}),[u,t]),{debouncedValue:s,flush:(0,r.useCallback)(()=>{e.current&&(clearTimeout(e.current),e.current=null),n(c.current)},[])}}exports.useDebounce=l;
@@ -1,18 +1,19 @@
1
- import { useState as f, useRef as c, useEffect as o, useCallback as i } from "react";
2
- function b(r, t = 300) {
3
- const [s, u] = f(r), e = c(null), n = c(r);
4
- o(() => {
1
+ import { useCallback as l, useEffect as c, useRef as o, useState as f } from "react";
2
+ function m(r, t = 300) {
3
+ const [s, u] = f(r), e = o(null), n = o(r);
4
+ return c(() => {
5
5
  n.current = r;
6
- }, [r]), o(() => (e.current = setTimeout(() => {
6
+ }, [r]), c(() => (e.current = setTimeout(() => {
7
7
  e.current = null, u(r);
8
8
  }, t), () => {
9
9
  e.current && (clearTimeout(e.current), e.current = null);
10
- }), [r, t]);
11
- const l = i(() => {
12
- e.current && (clearTimeout(e.current), e.current = null), u(n.current);
13
- }, []);
14
- return { debouncedValue: s, flush: l };
10
+ }), [r, t]), {
11
+ debouncedValue: s,
12
+ flush: l(() => {
13
+ e.current && (clearTimeout(e.current), e.current = null), u(n.current);
14
+ }, [])
15
+ };
15
16
  }
16
17
  export {
17
- b as useDebounce
18
+ m as useDebounce
18
19
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),u=150;function a(e,t=u){const[n,s]=r.useState(!1);return r.useEffect(()=>{if(!e)return;const o=setTimeout(()=>s(!0),t);return()=>{clearTimeout(o),s(!1)}},[e,t]),e&&n}exports.FLASH_THRESHOLD_MS=u;exports.useDelayedPending=a;
1
+ let s=require("react");var l=150;function n(e,t=150){const[u,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!e)return;const a=setTimeout(()=>r(!0),t);return()=>{clearTimeout(a),r(!1)}},[e,t]),e&&u}exports.FLASH_THRESHOLD_MS=l;exports.useDelayedPending=n;
@@ -1,10 +1,9 @@
1
- import { useState as o, useEffect as f } from "react";
2
- const a = 150;
3
- function n(e, t = a) {
4
- const [s, r] = o(!1);
5
- return f(() => {
6
- if (!e)
7
- return;
1
+ import { useEffect as o, useState as a } from "react";
2
+ var c = 150;
3
+ function i(e, t = 150) {
4
+ const [s, r] = a(!1);
5
+ return o(() => {
6
+ if (!e) return;
8
7
  const u = setTimeout(() => r(!0), t);
9
8
  return () => {
10
9
  clearTimeout(u), r(!1);
@@ -12,6 +11,6 @@ function n(e, t = a) {
12
11
  }, [e, t]), e && s;
13
12
  }
14
13
  export {
15
- a as FLASH_THRESHOLD_MS,
16
- n as useDelayedPending
14
+ c as FLASH_THRESHOLD_MS,
15
+ i as useDelayedPending
17
16
  };
@@ -0,0 +1 @@
1
+ "use client";const P=require("../_virtual/_rolldown/runtime.cjs");let i=require("react");i=P.__toESM(i,1);var b="ds:filter-search-params";function $(e){return window.addEventListener("popstate",e),window.addEventListener(b,e),()=>{window.removeEventListener("popstate",e),window.removeEventListener(b,e)}}var q=()=>window.location.search,M=()=>"",S=null;function j(e){if(e!==void 0)return e===""||e.startsWith("?")?e:`?${e}`}function N(e,t){const r=new URLSearchParams(t),n={};for(const u of Object.keys(e)){const p=y(e,u),l=r.get(u);n[u]=l===null?p.default:p.parse(l)}return n}function y(e,t){return e[t]}function L(e,t){return e.serialize(t)===e.serialize(e.default)}function R(e,t={}){const r=i.useSyncExternalStore($,q,M),n=j(t.search)??r,u=i.useMemo(()=>N(e,n),[e,n]),p=i.useMemo(()=>Object.keys(e).filter(s=>!L(y(e,s),u[s])),[e,u]),l=i.useRef({schema:e,options:t});i.useEffect(()=>{l.current={schema:e,options:t}});const E=i.useCallback(s=>{const{schema:f,options:o}=l.current,a=j(o.search)??window.location.search,d=S&&S.from===a?S.to:a,c=new URLSearchParams(d);for(const[w,z]of Object.entries(s)){const h=f[w];if(!h)continue;const O=z===void 0?h.default:z;L(h,O)?c.delete(w):c.set(w,h.serialize(O))}const g=c.toString(),m=g?`?${g}`:"";if(m===d)return;S={from:a,to:m};const k=(o.history??"replace")==="replace";if(o.navigate)o.navigate(m,{replace:k});else{const w=`${window.location.pathname}${m}${window.location.hash}`;k?window.history.replaceState(window.history.state,"",w):window.history.pushState(window.history.state,"",w)}window.dispatchEvent(new Event(b))},[]),v=i.useCallback(s=>{const{schema:f,options:o}=l.current,a=o.resetOnChange??("page"in f?["page"]:[]),d={...s};if(Object.keys(s).some(c=>!a.includes(c)))for(const c of a)c in d||(d[c]=y(f,c).default);E(d)},[E]);return{values:u,set:i.useCallback(s=>v(s),[v]),reset:i.useCallback(s=>{const{schema:f}=l.current,o={};for(const a of s??Object.keys(f))o[a]=y(f,a).default;v(o)},[v]),changed:p,search:n}}var _={string(e=""){return{default:e,parse:t=>t,serialize:t=>t}},oneOf(e,t){return{default:t,parse:r=>e.find(n=>n===r)??t,serialize:r=>r}},list(e,t=[]){return{default:t,parse:r=>r.split(",").filter(n=>e.includes(n)),serialize:r=>r.join(",")}},number(e,t=1){return{default:e,parse:r=>{if(!/^\d+$/.test(r))return e;const n=Number(r);return Number.isSafeInteger(n)&&n>=t?n:e},serialize:r=>String(r)}},boolean(e=!1){return{default:e,parse:t=>t==="1"||t==="true",serialize:t=>t?"1":"0"}}};exports.filterParam=_;exports.useFilterSearchParams=R;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * How one key reads from and writes to the query string. Build these with
3
+ * `filterParam` rather than by hand.
4
+ */
5
+ export interface FilterParamCodec<T> {
6
+ /** The value when the key is absent from the link. */
7
+ default: T;
8
+ /** Reads the raw string. Anything unknown comes back as the default. */
9
+ parse(raw: string): T;
10
+ /** Writes the value. The key is dropped when this equals the default's. */
11
+ serialize(value: T): string;
12
+ }
13
+ export type FilterParamSchema = Record<string, FilterParamCodec<unknown>>;
14
+ /** The decoded values of a schema. */
15
+ export type FilterParamValues<S extends FilterParamSchema> = {
16
+ [K in keyof S]: S[K] extends FilterParamCodec<infer T> ? T : never;
17
+ };
18
+ export interface UseFilterSearchParamsOptions<S extends FilterParamSchema> {
19
+ /**
20
+ * Keys that go back to their default whenever another key changes — the
21
+ * pattern's "any filter, search or sort change goes back to page 1".
22
+ * @default ["page"] when the schema has a `page` key, otherwise none
23
+ */
24
+ resetOnChange?: (keyof S)[];
25
+ /**
26
+ * `"replace"` rewrites the current history entry so filtering doesn't fill
27
+ * the back button; `"push"` adds one per change.
28
+ * @default "replace"
29
+ */
30
+ history?: "push" | "replace";
31
+ /**
32
+ * Hand the write to a router instead of `window.history` — React Router's
33
+ * `navigate({ search }, { replace })`, Next's `router.replace(...)`. Pair
34
+ * it with `search` when the router commits the address asynchronously.
35
+ */
36
+ navigate?: (search: string, options: {
37
+ replace: boolean;
38
+ }) => void;
39
+ /**
40
+ * The query string to read when a router owns it — React Router's
41
+ * `useLocation().search`, Next's `useSearchParams().toString()`; with or
42
+ * without the leading `?`. Without it the hook reads `window.location`,
43
+ * which is current as long as the URL is written through `window.history`.
44
+ * A router that commits the address asynchronously (a data router with
45
+ * loaders, Next's app router) updates `window.location` only after
46
+ * `navigate` returns, so pass its search here to stay in step with it.
47
+ */
48
+ search?: string;
49
+ }
50
+ export interface UseFilterSearchParamsResult<S extends FilterParamSchema> {
51
+ /** The current values, decoded from the link. */
52
+ values: FilterParamValues<S>;
53
+ /**
54
+ * Change one or more keys in a single write. Keys in `resetOnChange` go
55
+ * back to default; a key set to `undefined` goes back to its default too.
56
+ */
57
+ set: (patch: Partial<FilterParamValues<S>>) => void;
58
+ /**
59
+ * Put the given keys — or every key — back to their default. Keys in
60
+ * `resetOnChange` go back too, so clearing a filter also returns to page 1.
61
+ */
62
+ reset: (keys?: (keyof S)[]) => void;
63
+ /** The keys that are off their default: "Clear filters" shows while any filter key is here. */
64
+ changed: (keyof S)[];
65
+ /** The query string as it stands (with the leading `?`, or empty), for building links. */
66
+ search: string;
67
+ }
68
+ /**
69
+ * Keeps a section's filters, search, sort and page in the link, so sharing the
70
+ * address shares the view and the back button works. Defaults stay out of the
71
+ * address; keys the schema doesn't name (a router's own, `utm_*`) are left
72
+ * untouched; any change to one key resets the `page` key, as the Filtering
73
+ * pattern asks. Layout and density belong in local storage, the selection
74
+ * nowhere — don't put them here.
75
+ *
76
+ * @param schema - One `filterParam` codec per key, defined outside the component.
77
+ * @param options - Which keys reset on change, replace vs push, and a router's navigate and search.
78
+ */
79
+ export declare function useFilterSearchParams<S extends FilterParamSchema>(schema: S, options?: UseFilterSearchParamsOptions<S>): UseFilterSearchParamsResult<S>;
80
+ /** Codecs for the usual keys. Each takes the default — what an absent key means. */
81
+ export declare const filterParam: {
82
+ /** Free text: the search box. */
83
+ string(fallback?: string): FilterParamCodec<string>;
84
+ /** One of a fixed set: a single-select filter, a sort column, a view. Unknown reads as the default. */
85
+ oneOf<T extends string>(options: readonly T[], fallback: T): FilterParamCodec<T>;
86
+ /** Several of a fixed set, comma-joined: a multi-select filter. Unknown entries are dropped. */
87
+ list<T extends string>(options: readonly T[], fallback?: T[]): FilterParamCodec<T[]>;
88
+ /** A whole number at or above `min`: the page. Anything else — `2.7`, `2junk`, `-1` — reads as the default. */
89
+ number(fallback: number, min?: number): FilterParamCodec<number>;
90
+ /** A flag: present as `1`, absent otherwise. */
91
+ boolean(fallback?: boolean): FilterParamCodec<boolean>;
92
+ };
93
+ //# sourceMappingURL=use-filter-search-params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-filter-search-params.d.ts","sourceRoot":"","sources":["../../src/hooks/use-filter-search-params.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,sDAAsD;IACtD,OAAO,EAAE,CAAC,CAAC;IACX,wEAAwE;IACxE,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC;IACtB,2EAA2E;IAC3E,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC;CAC7B;AAMD,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAE1E,sCAAsC;AACtC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,iBAAiB,IAAI;KAC1D,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CACnE,CAAC;AAEF,MAAM,WAAW,4BAA4B,CAAC,CAAC,SAAS,iBAAiB;IACvE;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACnE;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,iBAAiB;IACtE,iDAAiD;IACjD,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAC7B;;;OAGG;IACH,GAAG,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACpD;;;OAGG;IACH,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;IACpC,+FAA+F;IAC/F,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IACrB,0FAA0F;IAC1F,MAAM,EAAE,MAAM,CAAC;CAChB;AA0DD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,MAAM,EAAE,CAAC,EACT,OAAO,GAAE,4BAA4B,CAAC,CAAC,CAAM,GAC5C,2BAA2B,CAAC,CAAC,CAAC,CAsGhC;AAED,oFAAoF;AACpF,eAAO,MAAM,WAAW;IACtB,iCAAiC;+BACV,gBAAgB,CAAC,MAAM,CAAC;IAG/C,uGAAuG;UACjG,CAAC,SAAS,MAAM,WACX,SAAS,CAAC,EAAE,YACX,CAAC,GACV,gBAAgB,CAAC,CAAC,CAAC;IAOtB,gGAAgG;SAC3F,CAAC,SAAS,MAAM,WACV,SAAS,CAAC,EAAE,aACX,CAAC,EAAE,GACZ,gBAAgB,CAAC,CAAC,EAAE,CAAC;IAQxB,+GAA+G;qBAC9F,MAAM,iBAAY,gBAAgB,CAAC,MAAM,CAAC;IAW3D,gDAAgD;iCACrB,gBAAgB,CAAC,OAAO,CAAC;CAOrD,CAAC"}
@@ -0,0 +1,122 @@
1
+ "use client";
2
+ import * as c from "react";
3
+ var b = "ds:filter-search-params";
4
+ function $(e) {
5
+ return window.addEventListener("popstate", e), window.addEventListener(b, e), () => {
6
+ window.removeEventListener("popstate", e), window.removeEventListener(b, e);
7
+ };
8
+ }
9
+ var R = () => window.location.search, N = () => "", y = null;
10
+ function j(e) {
11
+ if (e !== void 0)
12
+ return e === "" || e.startsWith("?") ? e : `?${e}`;
13
+ }
14
+ function P(e, t) {
15
+ const r = new URLSearchParams(t), n = {};
16
+ for (const u of Object.keys(e)) {
17
+ const p = S(e, u), l = r.get(u);
18
+ n[u] = l === null ? p.default : p.parse(l);
19
+ }
20
+ return n;
21
+ }
22
+ function S(e, t) {
23
+ return e[t];
24
+ }
25
+ function L(e, t) {
26
+ return e.serialize(t) === e.serialize(e.default);
27
+ }
28
+ function x(e, t = {}) {
29
+ const r = c.useSyncExternalStore($, R, N), n = j(t.search) ?? r, u = c.useMemo(() => P(e, n), [e, n]), p = c.useMemo(() => Object.keys(e).filter((s) => !L(S(e, s), u[s])), [e, u]), l = c.useRef({
30
+ schema: e,
31
+ options: t
32
+ });
33
+ c.useEffect(() => {
34
+ l.current = {
35
+ schema: e,
36
+ options: t
37
+ };
38
+ });
39
+ const g = c.useCallback((s) => {
40
+ const { schema: f, options: o } = l.current, i = j(o.search) ?? window.location.search, d = y && y.from === i ? y.to : i, a = new URLSearchParams(d);
41
+ for (const [w, z] of Object.entries(s)) {
42
+ const h = f[w];
43
+ if (!h) continue;
44
+ const O = z === void 0 ? h.default : z;
45
+ L(h, O) ? a.delete(w) : a.set(w, h.serialize(O));
46
+ }
47
+ const E = a.toString(), m = E ? `?${E}` : "";
48
+ if (m === d) return;
49
+ y = {
50
+ from: i,
51
+ to: m
52
+ };
53
+ const k = (o.history ?? "replace") === "replace";
54
+ if (o.navigate) o.navigate(m, { replace: k });
55
+ else {
56
+ const w = `${window.location.pathname}${m}${window.location.hash}`;
57
+ k ? window.history.replaceState(window.history.state, "", w) : window.history.pushState(window.history.state, "", w);
58
+ }
59
+ window.dispatchEvent(new Event(b));
60
+ }, []), v = c.useCallback((s) => {
61
+ const { schema: f, options: o } = l.current, i = o.resetOnChange ?? ("page" in f ? ["page"] : []), d = { ...s };
62
+ if (Object.keys(s).some((a) => !i.includes(a)))
63
+ for (const a of i) a in d || (d[a] = S(f, a).default);
64
+ g(d);
65
+ }, [g]);
66
+ return {
67
+ values: u,
68
+ set: c.useCallback((s) => v(s), [v]),
69
+ reset: c.useCallback((s) => {
70
+ const { schema: f } = l.current, o = {};
71
+ for (const i of s ?? Object.keys(f)) o[i] = S(f, i).default;
72
+ v(o);
73
+ }, [v]),
74
+ changed: p,
75
+ search: n
76
+ };
77
+ }
78
+ var C = {
79
+ string(e = "") {
80
+ return {
81
+ default: e,
82
+ parse: (t) => t,
83
+ serialize: (t) => t
84
+ };
85
+ },
86
+ oneOf(e, t) {
87
+ return {
88
+ default: t,
89
+ parse: (r) => e.find((n) => n === r) ?? t,
90
+ serialize: (r) => r
91
+ };
92
+ },
93
+ list(e, t = []) {
94
+ return {
95
+ default: t,
96
+ parse: (r) => r.split(",").filter((n) => e.includes(n)),
97
+ serialize: (r) => r.join(",")
98
+ };
99
+ },
100
+ number(e, t = 1) {
101
+ return {
102
+ default: e,
103
+ parse: (r) => {
104
+ if (!/^\d+$/.test(r)) return e;
105
+ const n = Number(r);
106
+ return Number.isSafeInteger(n) && n >= t ? n : e;
107
+ },
108
+ serialize: (r) => String(r)
109
+ };
110
+ },
111
+ boolean(e = !1) {
112
+ return {
113
+ default: e,
114
+ parse: (t) => t === "1" || t === "true",
115
+ serialize: (t) => t ? "1" : "0"
116
+ };
117
+ }
118
+ };
119
+ export {
120
+ C as filterParam,
121
+ x as useFilterSearchParams
122
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-breakpoint.cjs");exports.getBreakpointValue=e.getBreakpointValue;exports.getMobileBreakpoint=e.getBreakpointValue;exports.isMobileViewport=e.isBelowBreakpoint;exports.useIsBelowBreakpoint=e.useIsBelowBreakpoint;exports.useIsMobile=e.useIsBelowBreakpoint;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./use-breakpoint.cjs");exports.getBreakpointValue=e.getBreakpointValue;exports.getMobileBreakpoint=e.getBreakpointValue;exports.isMobileViewport=e.isBelowBreakpoint;exports.useIsBelowBreakpoint=e.useIsBelowBreakpoint;exports.useIsMobile=e.useIsBelowBreakpoint;
@@ -1,8 +1,8 @@
1
- import { getBreakpointValue as i, getBreakpointValue as a, isBelowBreakpoint as s, useIsBelowBreakpoint as t, useIsBelowBreakpoint as r } from "./use-breakpoint.js";
1
+ import { getBreakpointValue as o, isBelowBreakpoint as i, useIsBelowBreakpoint as s } from "./use-breakpoint.js";
2
2
  export {
3
- i as getBreakpointValue,
4
- a as getMobileBreakpoint,
5
- s as isMobileViewport,
6
- t as useIsBelowBreakpoint,
7
- r as useIsMobile
3
+ o as getBreakpointValue,
4
+ o as getMobileBreakpoint,
5
+ i as isMobileViewport,
6
+ s as useIsBelowBreakpoint,
7
+ s as useIsMobile
8
8
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react");function d(e){const o=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(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const u=d(i),l=['[data-slot="dialog-content"][data-state="open"]','[data-slot="alert-dialog-content"][data-state="open"]','[data-slot="sheet-content"][data-state="open"]','[data-slot="dropdown-menu-content"][data-state="open"]','[data-slot="dropdown-menu-sub-content"][data-state="open"]','[data-slot="context-menu-content"][data-state="open"]','[data-slot="context-menu-sub-content"][data-state="open"]','[data-slot="popover-content"][data-state="open"]','[data-slot="select-content"][data-state="open"]','[role="dialog"][data-state="open"]','[role="alertdialog"][data-state="open"]','[role="menu"][data-state="open"]','[role="listbox"][data-state="open"]'].join(",");let r=!1;function n(){typeof document>"u"||document.body.style.pointerEvents==="none"&&document.querySelector(l)===null&&(document.body.style.pointerEvents="")}function c(){typeof requestAnimationFrame=="function"?requestAnimationFrame(n):typeof setTimeout=="function"&&setTimeout(n,0)}function s(){typeof document>"u"||document.visibilityState==="visible"&&n()}function f(){r||typeof document>"u"||(r=!0,document.addEventListener("visibilitychange",s),window.addEventListener("pageshow",s),typeof MutationObserver<"u"&&new MutationObserver(n).observe(document.body,{attributes:!0,attributeFilter:["style"]}))}function p(){u.useEffect(()=>(f(),c),[])}exports.useOverlayPointerLock=p;
1
+ "use client";const a=require("../_virtual/_rolldown/runtime.cjs");let e=require("react");e=a.__toESM(e,1);var i=['[data-slot="dialog-content"][data-state="open"]','[data-slot="alert-dialog-content"][data-state="open"]','[data-slot="sheet-content"][data-state="open"]','[data-slot="dropdown-menu-content"][data-state="open"]','[data-slot="dropdown-menu-sub-content"][data-state="open"]','[data-slot="context-menu-content"][data-state="open"]','[data-slot="context-menu-sub-content"][data-state="open"]','[data-slot="popover-content"][data-state="open"]','[data-slot="select-content"][data-state="open"]','[role="dialog"][data-state="open"]','[role="alertdialog"][data-state="open"]','[role="menu"][data-state="open"]','[role="listbox"][data-state="open"]'].join(","),n=!1;function t(){typeof document>"u"||document.body.style.pointerEvents==="none"&&document.querySelector(i)===null&&(document.body.style.pointerEvents="")}function d(){typeof requestAnimationFrame=="function"?requestAnimationFrame(t):typeof setTimeout=="function"&&setTimeout(t,0)}function o(){typeof document>"u"||document.visibilityState==="visible"&&t()}function r(){n||typeof document>"u"||(n=!0,document.addEventListener("visibilitychange",o),window.addEventListener("pageshow",o),typeof MutationObserver<"u"&&new MutationObserver(t).observe(document.body,{attributes:!0,attributeFilter:["style"]}))}function s(){e.useEffect(()=>(r(),d),[])}exports.useOverlayPointerLock=s;
@@ -1,5 +1,6 @@
1
+ "use client";
1
2
  import * as o from "react";
2
- const a = [
3
+ var a = [
3
4
  '[data-slot="dialog-content"][data-state="open"]',
4
5
  '[data-slot="alert-dialog-content"][data-state="open"]',
5
6
  '[data-slot="sheet-content"][data-state="open"]',
@@ -9,31 +10,29 @@ const a = [
9
10
  '[data-slot="context-menu-sub-content"][data-state="open"]',
10
11
  '[data-slot="popover-content"][data-state="open"]',
11
12
  '[data-slot="select-content"][data-state="open"]',
12
- // Generic fallbacks: any open Radix overlay (or overridden DS one) by role.
13
13
  '[role="dialog"][data-state="open"]',
14
14
  '[role="alertdialog"][data-state="open"]',
15
15
  '[role="menu"][data-state="open"]',
16
16
  '[role="listbox"][data-state="open"]'
17
- ].join(",");
18
- let e = !1;
17
+ ].join(","), e = !1;
19
18
  function t() {
20
19
  typeof document > "u" || document.body.style.pointerEvents === "none" && document.querySelector(a) === null && (document.body.style.pointerEvents = "");
21
20
  }
22
- function s() {
21
+ function d() {
23
22
  typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : typeof setTimeout == "function" && setTimeout(t, 0);
24
23
  }
25
24
  function n() {
26
25
  typeof document > "u" || document.visibilityState === "visible" && t();
27
26
  }
28
- function d() {
27
+ function s() {
29
28
  e || typeof document > "u" || (e = !0, document.addEventListener("visibilitychange", n), window.addEventListener("pageshow", n), typeof MutationObserver < "u" && new MutationObserver(t).observe(document.body, {
30
29
  attributes: !0,
31
30
  attributeFilter: ["style"]
32
31
  }));
33
32
  }
34
- function r() {
35
- o.useEffect(() => (d(), s), []);
33
+ function i() {
34
+ o.useEffect(() => (s(), d), []);
36
35
  }
37
36
  export {
38
- r as useOverlayPointerLock
37
+ i as useOverlayPointerLock
39
38
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),r="(prefers-reduced-motion: reduce)",o=n.createContext(null);function c(e){const t=window.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function s(){return window.matchMedia(r).matches}function u(){return!1}function d(){const e=n.useContext(o),t=n.useSyncExternalStore(c,s,u);return e??t}exports.ReducedMotionOverrideContext=o;exports.usePrefersReducedMotion=d;
1
+ "use client";let n=require("react");var r="(prefers-reduced-motion: reduce)",o=(0,n.createContext)(null);function u(e){const t=window.matchMedia(r);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function c(){return window.matchMedia(r).matches}function d(){return!1}function i(){const e=(0,n.useContext)(o),t=(0,n.useSyncExternalStore)(u,c,d);return e??t}exports.ReducedMotionOverrideContext=o;exports.usePrefersReducedMotion=i;
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { createContext as r, useContext as o, useSyncExternalStore as c } from "react";
2
- const n = "(prefers-reduced-motion: reduce)", s = r(null);
3
- function i(e) {
3
+ var n = "(prefers-reduced-motion: reduce)", i = r(null);
4
+ function s(e) {
4
5
  const t = window.matchMedia(n);
5
6
  return t.addEventListener("change", e), () => t.removeEventListener("change", e);
6
7
  }
@@ -11,14 +12,10 @@ function d() {
11
12
  return !1;
12
13
  }
13
14
  function f() {
14
- const e = o(s), t = c(
15
- i,
16
- u,
17
- d
18
- );
15
+ const e = o(i), t = c(s, u, d);
19
16
  return e ?? t;
20
17
  }
21
18
  export {
22
- s as ReducedMotionOverrideContext,
19
+ i as ReducedMotionOverrideContext,
23
20
  f as usePrefersReducedMotion
24
21
  };