@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,27 +1,30 @@
1
+ "use client";
2
+ import { usePrefersReducedMotion as $t } from "./hooks/use-prefers-reduced-motion.js";
3
+ import { SETTLE_REST_DELTA as wt } from "./lib/spring-settle.js";
4
+ import { SPRING_SETTLE as Xt, SPRING_SMOOTH as Ft } from "./lib/motion.js";
5
+ import * as bt from "react";
6
+ import { useCallback as Dt, useEffect as it, useId as Nt, useMemo as Rt, useRef as A, useState as _t } from "react";
7
+ import { cn as qt } from "@brightlocal/ui-components/lib/utils";
1
8
  import { jsx as C, jsxs as W } from "react/jsx-runtime";
2
- import * as wt from "react";
3
- import { useId as $t, useMemo as bt, useRef as M, useState as Xt, useCallback as Ft, useEffect as it } from "react";
4
9
  import { animate as G } from "framer-motion";
5
- import { cn as Dt } from "@brightlocal/ui-components/lib/utils";
6
- import { usePrefersReducedMotion as Nt } from "./hooks/use-prefers-reduced-motion.js";
7
- import { SPRING_SMOOTH as _t, SPRING_SETTLE as qt } from "./lib/motion.js";
8
- import { SETTLE_REST_DELTA as Rt } from "./lib/spring-settle.js";
9
- const xt = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", Lt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", At = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", q = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
10
+ var xt = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", vt = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", Lt = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", q = (u) => u < 0 ? 0 : u > 1 ? 1 : u, zt = [
10
11
  xt,
12
+ vt,
11
13
  Lt,
12
- At,
13
14
  xt,
14
- At,
15
- Lt
15
+ Lt,
16
+ vt
16
17
  ];
17
- function Ht(u, $, w, v) {
18
+ function Ht(u, $, w, S) {
18
19
  let b = !1, X = null;
19
- const c = { ballX: 0, clipRight: 100, rotate: 0, pathD: "" };
20
+ const c = {
21
+ ballX: 0,
22
+ clipRight: 100,
23
+ rotate: 0,
24
+ pathD: ""
25
+ };
20
26
  function O() {
21
- b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), $.style.transform = `rotate(${c.rotate}deg)`, v?.setAttribute(
22
- "gradientTransform",
23
- `rotate(${-c.rotate} 0.5 0.5)`
24
- ), w.setAttribute("d", c.pathD);
27
+ b = !1, u.style.transform = `translateX(${c.ballX}px)`, X && (X.style.clipPath = `inset(0 ${c.clipRight}% 0 0)`), $.style.transform = `rotate(${c.rotate}deg)`, S?.setAttribute("gradientTransform", `rotate(${-c.rotate} 0.5 0.5)`), w.setAttribute("d", c.pathD);
25
28
  }
26
29
  function z(F, Z, j, s) {
27
30
  c.ballX = F, c.clipRight = Z, c.rotate = j, c.pathD = s, b || (b = !0, requestAnimationFrame(O));
@@ -30,375 +33,316 @@ function Ht(u, $, w, v) {
30
33
  X = F;
31
34
  }, z;
32
35
  }
33
- function Mt(u, $) {
36
+ function At(u, $) {
34
37
  return new Promise((w) => {
35
- const v = performance.now();
38
+ const S = performance.now();
36
39
  function b() {
37
- $.cancelled || performance.now() - v >= u ? w() : requestAnimationFrame(b);
40
+ $.cancelled || performance.now() - S >= u ? w() : requestAnimationFrame(b);
38
41
  }
39
42
  requestAnimationFrame(b);
40
43
  });
41
44
  }
42
- const Ut = wt.forwardRef(
43
- ({
44
- className: u,
45
- dataHook: $,
46
- holdTime: w = 1300,
47
- shimmer: v = !0,
48
- gradientFrom: b = "var(--loading-gradient-from)",
49
- gradientTo: X = "var(--loading-gradient-to)",
50
- loadingLabel: c,
51
- trackingEl: O,
52
- trackingLabel: z,
53
- children: F,
54
- ...Z
55
- }, j) => {
56
- const s = zt, J = 0.8, { stiffness: K, damping: Q, mass: V } = _t, H = Nt(), ct = $t(), ft = bt(
57
- () => `text-reveal-gradient-${ct.replace(/:/g, "")}`,
58
- [ct]
59
- ), Y = M(null), tt = M(null), et = M(null), nt = M(null), rt = M(null), at = M(null), ot = M(null), S = M([]), k = wt.Children.toArray(F), [St, vt] = Xt({ widths: [], ballSize: 0 }), { widths: p, ballSize: a } = St, kt = Ft(
60
- (n) => (e) => {
61
- S.current[n] = e;
62
- },
63
- []
64
- );
65
- it(() => {
66
- if (S.current.length === 0 || !S.current[0]) return;
67
- let n = !1;
68
- function e() {
69
- if (n) return;
70
- const m = [];
71
- let R = 32;
72
- for (let h = 0; h < k.length; h++) {
73
- const x = S.current[h];
74
- if (x && (m[h] = x.scrollWidth, h === 0)) {
75
- const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
76
- R = Math.round(t * 1.5);
77
- }
78
- }
79
- vt({ widths: m, ballSize: R });
80
- }
81
- return document.fonts.ready.then(() => {
82
- n || requestAnimationFrame(e);
83
- }), () => {
84
- n = !0;
85
- };
86
- }, [k.length]), it(() => {
87
- if (H) return;
88
- const n = rt.current;
89
- if (!n) return;
90
- const e = n;
91
- let m, R = null;
92
- const h = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, E = Math.random() * Math.PI * 2, t = Math.random() * Math.PI * 2;
93
- let D = -1 / 0;
94
- function U(f) {
95
- R || (R = f);
96
- const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
97
- if (Math.abs(o - D) > 0.01) {
98
- D = o;
99
- const N = Math.cos(o), i = Math.sin(o);
100
- e.setAttribute("x1", `${50 + 45 * N}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * N}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
45
+ var Ut = bt.forwardRef(({ className: u, dataHook: $, holdTime: w = 1300, shimmer: S = !0, gradientFrom: b = "var(--loading-gradient-from)", gradientTo: X = "var(--loading-gradient-to)", loadingLabel: c, trackingEl: O, trackingLabel: z, children: F, ...Z }, j) => {
46
+ const s = zt, J = 0.8, { stiffness: K, damping: Q, mass: V } = Ft, H = $t(), ct = Nt(), ft = Rt(() => `text-reveal-gradient-${ct.replace(/:/g, "")}`, [ct]), Y = A(null), tt = A(null), et = A(null), nt = A(null), rt = A(null), at = A(null), ot = A(null), M = A([]), k = bt.Children.toArray(F), [Mt, St] = _t({
47
+ widths: [],
48
+ ballSize: 0
49
+ }), { widths: p, ballSize: a } = Mt, kt = Dt((n) => (e) => {
50
+ M.current[n] = e;
51
+ }, []);
52
+ it(() => {
53
+ if (M.current.length === 0 || !M.current[0]) return;
54
+ let n = !1;
55
+ function e() {
56
+ if (n) return;
57
+ const m = [];
58
+ let R = 32;
59
+ for (let h = 0; h < k.length; h++) {
60
+ const x = M.current[h];
61
+ if (x && (m[h] = x.scrollWidth, h === 0)) {
62
+ const E = x.firstElementChild ?? x, t = parseFloat(getComputedStyle(E).fontSize) || 16;
63
+ R = Math.round(t * 1.5);
101
64
  }
102
- m = requestAnimationFrame(U);
103
65
  }
104
- return m = requestAnimationFrame(U), () => cancelAnimationFrame(m);
105
- }, [H]);
106
- function Et(n) {
107
- n.style.opacity = "1", G(0, 1, {
108
- duration: 1.2,
109
- ease: [0.25, 1, 0.5, 1],
110
- onUpdate: (e) => {
111
- n.style.transform = `translateX(${-100 + e * 200}%)`;
112
- },
113
- onComplete: () => {
114
- n.style.opacity = "0";
115
- }
66
+ St({
67
+ widths: m,
68
+ ballSize: R
116
69
  });
117
70
  }
118
- it(() => {
119
- if (!et.current || !nt.current || !Y.current || !tt.current || !at.current || !ot.current || p.length === 0 || a === 0)
120
- return;
121
- const n = et.current, e = nt.current, m = Y.current, R = tt.current, h = at.current, x = ot.current;
122
- function E(f) {
123
- const l = `${f}px`;
124
- h.style.width = l, x.style.width = l;
71
+ return document.fonts.ready.then(() => {
72
+ n || requestAnimationFrame(e);
73
+ }), () => {
74
+ n = !0;
75
+ };
76
+ }, [k.length]), it(() => {
77
+ if (H) return;
78
+ const n = rt.current;
79
+ if (!n) return;
80
+ const e = n;
81
+ let m, R = null;
82
+ const h = 0.12 + Math.random() * 0.06, x = 0.08 + Math.random() * 0.04, E = Math.random() * Math.PI * 2, t = Math.random() * Math.PI * 2;
83
+ let D = -1 / 0;
84
+ function U(f) {
85
+ R || (R = f);
86
+ const l = (f - R) / 1e3, o = -Math.PI / 4 + Math.sin(l * h + E) * 0.5 + Math.sin(l * x + t) * 0.25;
87
+ if (Math.abs(o - D) > 0.01) {
88
+ D = o;
89
+ const N = Math.cos(o), i = Math.sin(o);
90
+ e.setAttribute("x1", `${50 + 45 * N}%`), e.setAttribute("y1", `${50 + 45 * i}%`), e.setAttribute("x2", `${50 - 45 * N}%`), e.setAttribute("y2", `${50 - 45 * i}%`);
125
91
  }
126
- if (H) {
127
- n.setAttribute("d", s[0]), e.style.opacity = "1";
128
- const f = S.current[0];
129
- f && (f.style.opacity = "1", f.style.clipPath = "none"), E(p[0] ?? 0);
130
- const l = a * 0.25, o = (p[0] ?? 0) + l + a / 2;
131
- m.style.transform = `translateX(${o}px)`;
132
- return;
92
+ m = requestAnimationFrame(U);
93
+ }
94
+ return m = requestAnimationFrame(U), () => cancelAnimationFrame(m);
95
+ }, [H]);
96
+ function Et(n) {
97
+ n.style.opacity = "1", G(0, 1, {
98
+ duration: 1.2,
99
+ ease: [
100
+ 0.25,
101
+ 1,
102
+ 0.5,
103
+ 1
104
+ ],
105
+ onUpdate: (e) => {
106
+ n.style.transform = `translateX(${-100 + e * 200}%)`;
107
+ },
108
+ onComplete: () => {
109
+ n.style.opacity = "0";
133
110
  }
134
- const t = { cancelled: !1 }, D = a * 0.25;
135
- async function U() {
136
- const { interpolate: f } = await import("flubber");
137
- if (t.cancelled) return;
138
- const l = [];
139
- for (let L = 0; L < s.length; L++)
140
- l.push(
141
- f(s[L], s[(L + 1) % s.length])
142
- );
143
- const o = Ht(
144
- m,
145
- e,
146
- n,
147
- rt.current
148
- );
149
- e.style.opacity = "1";
150
- let N = 0, i = 0, g = 0;
151
- for (; !t.cancelled; ) {
152
- const L = N % k.length, P = p[L] ?? 0;
153
- E(P);
154
- const I = -(D + a / 2), _ = P + D + a / 2, ut = _ - I, pt = S.current[L];
155
- if (!pt) break;
156
- o.setItem(pt);
157
- for (let r = 0; r < k.length; r++) {
158
- const d = S.current[r];
159
- d && (d.style.opacity = r === L ? "1" : "0", d.style.clipPath = "inset(0 100% 0 0)");
111
+ });
112
+ }
113
+ it(() => {
114
+ if (!et.current || !nt.current || !Y.current || !tt.current || !at.current || !ot.current || p.length === 0 || a === 0) return;
115
+ const n = et.current, e = nt.current, m = Y.current, R = tt.current, h = at.current, x = ot.current;
116
+ function E(f) {
117
+ const l = `${f}px`;
118
+ h.style.width = l, x.style.width = l;
119
+ }
120
+ if (H) {
121
+ n.setAttribute("d", s[0]), e.style.opacity = "1";
122
+ const f = M.current[0];
123
+ f && (f.style.opacity = "1", f.style.clipPath = "none"), E(p[0] ?? 0);
124
+ const l = a * 0.25, o = (p[0] ?? 0) + l + a / 2;
125
+ m.style.transform = `translateX(${o}px)`;
126
+ return;
127
+ }
128
+ const t = { cancelled: !1 }, D = a * 0.25;
129
+ async function U() {
130
+ const { interpolate: f } = await import("flubber");
131
+ if (t.cancelled) return;
132
+ const l = [];
133
+ for (let v = 0; v < s.length; v++) l.push(f(s[v], s[(v + 1) % s.length]));
134
+ const o = Ht(m, e, n, rt.current);
135
+ e.style.opacity = "1";
136
+ let N = 0, i = 0, g = 0;
137
+ for (; !t.cancelled; ) {
138
+ const v = N % k.length, P = p[v] ?? 0;
139
+ E(P);
140
+ const I = -(D + a / 2), _ = P + D + a / 2, ut = _ - I, pt = M.current[v];
141
+ if (!pt) break;
142
+ o.setItem(pt);
143
+ for (let r = 0; r < k.length; r++) {
144
+ const d = M.current[r];
145
+ d && (d.style.opacity = r === v ? "1" : "0", d.style.clipPath = "inset(0 100% 0 0)");
146
+ }
147
+ const mt = l[i], B = 360, ht = g;
148
+ if (await new Promise((r) => {
149
+ if (t.cancelled) {
150
+ r();
151
+ return;
160
152
  }
161
- const mt = l[i], B = 360, ht = g;
162
- if (await new Promise((r) => {
163
- if (t.cancelled) {
164
- r();
165
- return;
166
- }
167
- const d = G(I, _, {
168
- type: "spring",
169
- stiffness: K * J,
170
- damping: Q,
171
- mass: V,
172
- onUpdate: (y) => {
173
- if (t.cancelled) {
174
- d.stop(), r();
175
- return;
176
- }
177
- const A = q((y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
178
- o(y, T, ht + A * B, mt(A));
179
- },
180
- onComplete: () => {
181
- g = ht + B, i = (i + 1) % s.length, t.cancelled || o(_, 0, g, mt(1)), r();
153
+ const d = G(I, _, {
154
+ type: "spring",
155
+ stiffness: K * J,
156
+ damping: Q,
157
+ mass: V,
158
+ onUpdate: (y) => {
159
+ if (t.cancelled) {
160
+ d.stop(), r();
161
+ return;
182
162
  }
183
- });
184
- }), t.cancelled) break;
185
- if (v && Et(R), w > 0) {
186
- const r = performance.now(), d = _;
187
- for (; !t.cancelled && performance.now() - r < w && (await Mt(300, t), !(t.cancelled || performance.now() - r >= w)); ) {
188
- const y = (i + 1) % s.length, A = l[i], T = g, st = g + 360;
189
- await new Promise((lt) => {
190
- if (t.cancelled) {
191
- lt();
192
- return;
193
- }
194
- const It = G(0, 1 + Rt, {
195
- ...qt,
196
- restDelta: Rt,
197
- onUpdate: (Tt) => {
198
- if (t.cancelled) {
199
- It.stop(), lt();
200
- return;
201
- }
202
- const Ct = q(Tt);
203
- o(
204
- d,
205
- 0,
206
- T + Ct * (st - T),
207
- A(Ct)
208
- );
209
- },
210
- onComplete: lt
211
- });
212
- }), t.cancelled || o(d, 0, st, A(1)), g = st, i = y;
213
- }
214
- }
215
- if (t.cancelled) break;
216
- const gt = l[i], yt = g;
217
- if (await new Promise((r) => {
218
- if (t.cancelled) {
219
- r();
220
- return;
163
+ const L = q((y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
164
+ o(y, T, ht + L * B, mt(L));
165
+ },
166
+ onComplete: () => {
167
+ g = ht + B, i = (i + 1) % s.length, t.cancelled || o(_, 0, g, mt(1)), r();
221
168
  }
222
- const d = G(_, I, {
223
- type: "spring",
224
- stiffness: K * J,
225
- damping: Q,
226
- mass: V,
227
- onUpdate: (y) => {
228
- if (t.cancelled) {
229
- d.stop(), r();
230
- return;
231
- }
232
- const A = q(1 - (y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
233
- o(y, T, yt - A * B, gt(A));
234
- },
235
- onComplete: () => {
236
- g = yt - B, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
169
+ });
170
+ }), t.cancelled) break;
171
+ if (S && Et(R), w > 0) {
172
+ const r = performance.now(), d = _;
173
+ for (; !t.cancelled && performance.now() - r < w && (await At(300, t), !(t.cancelled || performance.now() - r >= w)); ) {
174
+ const y = (i + 1) % s.length, L = l[i], T = g, st = g + 360;
175
+ await new Promise((lt) => {
176
+ if (t.cancelled) {
177
+ lt();
178
+ return;
237
179
  }
238
- });
239
- }), t.cancelled) break;
240
- await Mt(300, t), N++;
180
+ const It = G(0, 1 + wt, {
181
+ ...Xt,
182
+ restDelta: wt,
183
+ onUpdate: (Tt) => {
184
+ if (t.cancelled) {
185
+ It.stop(), lt();
186
+ return;
187
+ }
188
+ const Ct = q(Tt);
189
+ o(d, 0, T + Ct * (st - T), L(Ct));
190
+ },
191
+ onComplete: lt
192
+ });
193
+ }), t.cancelled || o(d, 0, st, L(1)), g = st, i = y;
194
+ }
241
195
  }
196
+ if (t.cancelled) break;
197
+ const gt = l[i], yt = g;
198
+ if (await new Promise((r) => {
199
+ if (t.cancelled) {
200
+ r();
201
+ return;
202
+ }
203
+ const d = G(_, I, {
204
+ type: "spring",
205
+ stiffness: K * J,
206
+ damping: Q,
207
+ mass: V,
208
+ onUpdate: (y) => {
209
+ if (t.cancelled) {
210
+ d.stop(), r();
211
+ return;
212
+ }
213
+ const L = q(1 - (y - I) / ut), T = P > 0 ? 100 - q(y / P) * 100 : 100;
214
+ o(y, T, yt - L * B, gt(L));
215
+ },
216
+ onComplete: () => {
217
+ g = yt - B, i = (i + 1) % s.length, t.cancelled || o(I, 100, g, gt(1)), r();
218
+ }
219
+ });
220
+ }), t.cancelled) break;
221
+ await At(300, t), N++;
242
222
  }
243
- return U(), () => {
244
- t.cancelled = !0;
245
- };
246
- }, [
247
- p,
248
- a,
249
- k.length,
250
- H,
251
- J,
252
- w,
253
- v,
254
- K,
255
- Q,
256
- V,
257
- s
258
- ]);
259
- const dt = bt(
260
- () => p.length > 0 ? Math.max(...p) : 0,
261
- [p]
262
- ), Pt = p.length > 0 && a > 0;
263
- return /* @__PURE__ */ C(
264
- "div",
265
- {
266
- ref: j,
267
- className: Dt("relative inline-flex items-center", u),
268
- "data-hook": $,
269
- "data-slot": "text-reveal",
270
- "data-tracking-el": O,
271
- "data-tracking-label": z,
223
+ }
224
+ return U(), () => {
225
+ t.cancelled = !0;
226
+ };
227
+ }, [
228
+ p,
229
+ a,
230
+ k.length,
231
+ H,
232
+ J,
233
+ w,
234
+ S,
235
+ K,
236
+ Q,
237
+ V,
238
+ s
239
+ ]);
240
+ const dt = Rt(() => p.length > 0 ? Math.max(...p) : 0, [p]), Pt = p.length > 0 && a > 0;
241
+ return /* @__PURE__ */ C("div", {
242
+ ref: j,
243
+ className: qt("relative inline-flex items-center", u),
244
+ "data-hook": $,
245
+ "data-slot": "text-reveal",
246
+ "data-tracking-el": O,
247
+ "data-tracking-label": z,
248
+ style: {
249
+ opacity: Pt ? 1 : 0,
250
+ transition: "opacity 0.4s ease-out"
251
+ },
252
+ ...Z,
253
+ children: /* @__PURE__ */ W("div", {
254
+ ref: at,
255
+ className: "relative flex items-center",
256
+ style: {
257
+ width: dt || void 0,
258
+ transition: "width 0.3s ease-out"
259
+ },
260
+ children: [/* @__PURE__ */ W("span", {
261
+ ref: ot,
262
+ className: "relative inline-block overflow-hidden",
272
263
  style: {
273
- opacity: Pt ? 1 : 0,
274
- transition: "opacity 0.4s ease-out"
264
+ width: dt || void 0,
265
+ transition: "width 0.3s ease-out"
275
266
  },
276
- ...Z,
277
- children: /* @__PURE__ */ W(
278
- "div",
279
- {
280
- ref: at,
281
- className: "relative flex items-center",
267
+ children: [k.map((n, e) => /* @__PURE__ */ C("span", {
268
+ ref: kt(e),
269
+ style: {
270
+ display: "block",
271
+ whiteSpace: "nowrap",
272
+ opacity: 0,
273
+ clipPath: "inset(0 100% 0 0)",
274
+ willChange: "clip-path",
275
+ ...e > 0 ? {
276
+ position: "absolute",
277
+ top: 0,
278
+ left: 0
279
+ } : {}
280
+ },
281
+ children: n
282
+ }, e)), /* @__PURE__ */ C("div", {
283
+ ref: tt,
284
+ className: "pointer-events-none absolute inset-0",
285
+ style: {
286
+ opacity: 0,
287
+ transform: "translateX(-100%)",
288
+ willChange: "transform",
289
+ background: "linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--background) 40%, transparent) 40%, color-mix(in srgb, var(--background) 70%, transparent) 50%, color-mix(in srgb, var(--background) 40%, transparent) 60%, transparent 100%)"
290
+ }
291
+ })]
292
+ }), /* @__PURE__ */ C("div", {
293
+ ref: Y,
294
+ className: "absolute",
295
+ style: {
296
+ left: -a / 2,
297
+ top: "50%",
298
+ marginTop: -a / 2,
299
+ width: a,
300
+ height: a,
301
+ transform: "translateX(0px)",
302
+ willChange: "transform"
303
+ },
304
+ children: /* @__PURE__ */ W("svg", {
305
+ "aria-label": c ?? "Loading",
306
+ "data-slot": "text-reveal-ball",
307
+ fill: "none",
308
+ height: a,
309
+ role: "img",
310
+ style: { overflow: "visible" },
311
+ viewBox: "-30 -30 560 560",
312
+ width: a,
313
+ xmlns: "http://www.w3.org/2000/svg",
314
+ children: [/* @__PURE__ */ C("defs", { children: /* @__PURE__ */ W("linearGradient", {
315
+ ref: rt,
316
+ id: ft,
317
+ x1: "81.8%",
318
+ x2: "18.2%",
319
+ y1: "18.2%",
320
+ y2: "81.8%",
321
+ children: [/* @__PURE__ */ C("stop", {
322
+ offset: "-60%",
323
+ stopColor: b
324
+ }), /* @__PURE__ */ C("stop", {
325
+ offset: "120%",
326
+ stopColor: X
327
+ })]
328
+ }) }), /* @__PURE__ */ C("g", {
329
+ ref: nt,
282
330
  style: {
283
- width: dt || void 0,
284
- transition: "width 0.3s ease-out"
331
+ opacity: 0,
332
+ transformOrigin: "250px 250px",
333
+ willChange: "transform"
285
334
  },
286
- children: [
287
- /* @__PURE__ */ W(
288
- "span",
289
- {
290
- ref: ot,
291
- className: "relative inline-block overflow-hidden",
292
- style: {
293
- width: dt || void 0,
294
- transition: "width 0.3s ease-out"
295
- },
296
- children: [
297
- k.map((n, e) => /* @__PURE__ */ C(
298
- "span",
299
- {
300
- ref: kt(e),
301
- style: {
302
- display: "block",
303
- whiteSpace: "nowrap",
304
- opacity: 0,
305
- clipPath: "inset(0 100% 0 0)",
306
- willChange: "clip-path",
307
- ...e > 0 ? { position: "absolute", top: 0, left: 0 } : {}
308
- },
309
- children: n
310
- },
311
- e
312
- )),
313
- /* @__PURE__ */ C(
314
- "div",
315
- {
316
- ref: tt,
317
- className: "pointer-events-none absolute inset-0",
318
- style: {
319
- opacity: 0,
320
- transform: "translateX(-100%)",
321
- willChange: "transform",
322
- background: "linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--background) 40%, transparent) 40%, color-mix(in srgb, var(--background) 70%, transparent) 50%, color-mix(in srgb, var(--background) 40%, transparent) 60%, transparent 100%)"
323
- }
324
- }
325
- )
326
- ]
327
- }
328
- ),
329
- /* @__PURE__ */ C(
330
- "div",
331
- {
332
- ref: Y,
333
- className: "absolute",
334
- style: {
335
- left: -a / 2,
336
- top: "50%",
337
- marginTop: -a / 2,
338
- width: a,
339
- height: a,
340
- transform: "translateX(0px)",
341
- willChange: "transform"
342
- },
343
- children: /* @__PURE__ */ W(
344
- "svg",
345
- {
346
- "aria-label": c ?? "Loading",
347
- "data-slot": "text-reveal-ball",
348
- fill: "none",
349
- height: a,
350
- role: "img",
351
- style: { overflow: "visible" },
352
- viewBox: "-30 -30 560 560",
353
- width: a,
354
- xmlns: "http://www.w3.org/2000/svg",
355
- children: [
356
- /* @__PURE__ */ C("defs", { children: /* @__PURE__ */ W(
357
- "linearGradient",
358
- {
359
- ref: rt,
360
- id: ft,
361
- x1: "81.8%",
362
- x2: "18.2%",
363
- y1: "18.2%",
364
- y2: "81.8%",
365
- children: [
366
- /* @__PURE__ */ C("stop", { offset: "-60%", stopColor: b }),
367
- /* @__PURE__ */ C("stop", { offset: "120%", stopColor: X })
368
- ]
369
- }
370
- ) }),
371
- /* @__PURE__ */ C(
372
- "g",
373
- {
374
- ref: nt,
375
- style: {
376
- opacity: 0,
377
- transformOrigin: "250px 250px",
378
- willChange: "transform"
379
- },
380
- children: /* @__PURE__ */ C(
381
- "path",
382
- {
383
- ref: et,
384
- d: s[0],
385
- fill: `url(#${ft})`
386
- }
387
- )
388
- }
389
- )
390
- ]
391
- }
392
- )
393
- }
394
- )
395
- ]
396
- }
397
- )
398
- }
399
- );
400
- }
401
- );
335
+ children: /* @__PURE__ */ C("path", {
336
+ ref: et,
337
+ d: s[0],
338
+ fill: `url(#${ft})`
339
+ })
340
+ })]
341
+ })
342
+ })]
343
+ })
344
+ });
345
+ });
402
346
  Ut.displayName = "TextRevealMotion";
403
347
  export {
404
348
  Ut as TextRevealMotion