@brightlocal/ui-components 3.2.0 → 3.4.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 (434) hide show
  1. package/AI_USAGE.md +10 -0
  2. package/README.md +3 -1
  3. package/component-meta.json +1458 -380
  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 +138 -178
  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-list.cjs +1 -0
  103. package/dist/description-list.d.ts +142 -0
  104. package/dist/description-list.d.ts.map +1 -0
  105. package/dist/description-list.js +173 -0
  106. package/dist/description.cjs +1 -1
  107. package/dist/description.js +11 -20
  108. package/dist/dialog.cjs +1 -1
  109. package/dist/dialog.d.ts +1 -1
  110. package/dist/dialog.d.ts.map +1 -1
  111. package/dist/dialog.js +76 -116
  112. package/dist/drawer.cjs +1 -1
  113. package/dist/drawer.d.ts +11 -11
  114. package/dist/drawer.d.ts.map +1 -1
  115. package/dist/drawer.js +76 -134
  116. package/dist/dropdown-menu.cjs +1 -1
  117. package/dist/dropdown-menu.d.ts +6 -6
  118. package/dist/dropdown-menu.d.ts.map +1 -1
  119. package/dist/dropdown-menu.js +179 -300
  120. package/dist/field.cjs +1 -1
  121. package/dist/field.d.ts +9 -9
  122. package/dist/field.d.ts.map +1 -1
  123. package/dist/field.js +166 -286
  124. package/dist/global-layout.cjs +1 -1
  125. package/dist/global-layout.js +203 -342
  126. package/dist/grid.cjs +1 -1
  127. package/dist/grid.js +16 -29
  128. package/dist/header.cjs +1 -1
  129. package/dist/header.js +21 -38
  130. package/dist/height-transition.cjs +1 -1
  131. package/dist/height-transition.js +38 -55
  132. package/dist/hooks/use-breakpoint.cjs +1 -1
  133. package/dist/hooks/use-breakpoint.js +9 -9
  134. package/dist/hooks/use-debounce.cjs +1 -1
  135. package/dist/hooks/use-debounce.js +12 -11
  136. package/dist/hooks/use-delayed-pending.cjs +1 -1
  137. package/dist/hooks/use-delayed-pending.js +8 -9
  138. package/dist/hooks/use-filter-search-params.cjs +1 -0
  139. package/dist/hooks/use-filter-search-params.d.ts +93 -0
  140. package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
  141. package/dist/hooks/use-filter-search-params.js +122 -0
  142. package/dist/hooks/use-mobile.cjs +1 -1
  143. package/dist/hooks/use-mobile.js +6 -6
  144. package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
  145. package/dist/hooks/use-overlay-pointer-lock.js +8 -9
  146. package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
  147. package/dist/hooks/use-prefers-reduced-motion.js +5 -8
  148. package/dist/hover-card.cjs +1 -1
  149. package/dist/hover-card.d.ts +1 -1
  150. package/dist/hover-card.d.ts.map +1 -1
  151. package/dist/hover-card.js +30 -62
  152. package/dist/index.cjs +1 -1
  153. package/dist/index.d.ts +7 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +658 -614
  156. package/dist/info-tooltip.cjs +1 -1
  157. package/dist/info-tooltip.js +22 -36
  158. package/dist/input-chip.cjs +1 -1
  159. package/dist/input-chip.d.ts +32 -3
  160. package/dist/input-chip.d.ts.map +1 -1
  161. package/dist/input-chip.js +181 -230
  162. package/dist/input-group.cjs +1 -1
  163. package/dist/input-group.js +174 -221
  164. package/dist/input-otp.cjs +1 -1
  165. package/dist/input-otp.d.ts +3 -3
  166. package/dist/input-otp.d.ts.map +1 -1
  167. package/dist/input-otp.js +102 -146
  168. package/dist/input-password.cjs +1 -1
  169. package/dist/input-password.d.ts +12 -16
  170. package/dist/input-password.d.ts.map +1 -1
  171. package/dist/input-password.js +139 -171
  172. package/dist/input.cjs +1 -1
  173. package/dist/input.d.ts.map +1 -1
  174. package/dist/input.js +51 -73
  175. package/dist/label.cjs +1 -1
  176. package/dist/label.js +20 -38
  177. package/dist/lib/block-illustration.cjs +1 -1
  178. package/dist/lib/block-illustration.d.ts +1 -1
  179. package/dist/lib/block-illustration.d.ts.map +1 -1
  180. package/dist/lib/block-illustration.js +16 -18
  181. package/dist/lib/compose-event-handlers.cjs +1 -0
  182. package/dist/lib/compose-event-handlers.d.ts +9 -0
  183. package/dist/lib/compose-event-handlers.d.ts.map +1 -0
  184. package/dist/lib/compose-event-handlers.js +8 -0
  185. package/dist/lib/download-file.cjs +1 -0
  186. package/dist/lib/download-file.d.ts +14 -0
  187. package/dist/lib/download-file.d.ts.map +1 -0
  188. package/dist/lib/download-file.js +40 -0
  189. package/dist/lib/empty-canvas.cjs +1 -1
  190. package/dist/lib/empty-canvas.js +28 -56
  191. package/dist/lib/empty-chip.cjs +1 -1
  192. package/dist/lib/empty-chip.d.ts +14 -3
  193. package/dist/lib/empty-chip.d.ts.map +1 -1
  194. package/dist/lib/empty-chip.js +15 -11
  195. package/dist/lib/field-aria.cjs +1 -0
  196. package/dist/lib/field-aria.d.ts +34 -0
  197. package/dist/lib/field-aria.d.ts.map +1 -0
  198. package/dist/lib/field-aria.js +52 -0
  199. package/dist/lib/image-file-info.cjs +1 -0
  200. package/dist/lib/image-file-info.d.ts +25 -0
  201. package/dist/lib/image-file-info.d.ts.map +1 -0
  202. package/dist/lib/image-file-info.js +67 -0
  203. package/dist/lib/media-viewer-content.cjs +1 -0
  204. package/dist/lib/media-viewer-content.d.ts +102 -0
  205. package/dist/lib/media-viewer-content.d.ts.map +1 -0
  206. package/dist/lib/media-viewer-content.js +650 -0
  207. package/dist/lib/media-viewer-internal.cjs +1 -0
  208. package/dist/lib/media-viewer-internal.d.ts +98 -0
  209. package/dist/lib/media-viewer-internal.d.ts.map +1 -0
  210. package/dist/lib/media-viewer-internal.js +61 -0
  211. package/dist/lib/media-viewer-motion.cjs +1 -0
  212. package/dist/lib/media-viewer-motion.d.ts +40 -0
  213. package/dist/lib/media-viewer-motion.d.ts.map +1 -0
  214. package/dist/lib/media-viewer-motion.js +37 -0
  215. package/dist/lib/motion.cjs +1 -1
  216. package/dist/lib/motion.d.ts +8 -0
  217. package/dist/lib/motion.d.ts.map +1 -1
  218. package/dist/lib/motion.js +14 -8
  219. package/dist/lib/optical-center.cjs +1 -1
  220. package/dist/lib/optical-center.d.ts +1 -1
  221. package/dist/lib/optical-center.d.ts.map +1 -1
  222. package/dist/lib/optical-center.js +12 -5
  223. package/dist/lib/spring-settle.cjs +1 -1
  224. package/dist/lib/spring-settle.js +1 -1
  225. package/dist/lib/table-internal.cjs +1 -0
  226. package/dist/lib/table-internal.d.ts +62 -0
  227. package/dist/lib/table-internal.d.ts.map +1 -0
  228. package/dist/lib/table-internal.js +18 -0
  229. package/dist/lib/use-controllable.cjs +1 -0
  230. package/dist/lib/use-controllable.d.ts +12 -0
  231. package/dist/lib/use-controllable.d.ts.map +1 -0
  232. package/dist/lib/use-controllable.js +15 -0
  233. package/dist/lib/use-dev-warning.cjs +1 -1
  234. package/dist/lib/utils.cjs +1 -1
  235. package/dist/lib/utils.js +26 -33
  236. package/dist/link.cjs +1 -1
  237. package/dist/link.d.ts +1 -1
  238. package/dist/link.js +78 -124
  239. package/dist/list.cjs +1 -1
  240. package/dist/list.d.ts +224 -39
  241. package/dist/list.d.ts.map +1 -1
  242. package/dist/list.js +323 -171
  243. package/dist/loading.cjs +1 -1
  244. package/dist/loading.js +124 -151
  245. package/dist/logo-mark.cjs +1 -0
  246. package/dist/logo-mark.d.ts +79 -0
  247. package/dist/logo-mark.d.ts.map +1 -0
  248. package/dist/logo-mark.js +219 -0
  249. package/dist/logo.cjs +1 -1
  250. package/dist/logo.d.ts +1 -1
  251. package/dist/logo.d.ts.map +1 -1
  252. package/dist/logo.js +51 -87
  253. package/dist/map.cjs +1 -1
  254. package/dist/map.d.ts.map +1 -1
  255. package/dist/map.js +390 -586
  256. package/dist/media-empty.cjs +1 -1
  257. package/dist/media-empty.js +27 -42
  258. package/dist/media-viewer.cjs +1 -0
  259. package/dist/media-viewer.d.ts +224 -0
  260. package/dist/media-viewer.d.ts.map +1 -0
  261. package/dist/media-viewer.js +295 -0
  262. package/dist/menubar.cjs +1 -1
  263. package/dist/menubar.d.ts +14 -14
  264. package/dist/menubar.d.ts.map +1 -1
  265. package/dist/menubar.js +130 -267
  266. package/dist/multi-select-filter.cjs +1 -1
  267. package/dist/multi-select-filter.d.ts +9 -1
  268. package/dist/multi-select-filter.d.ts.map +1 -1
  269. package/dist/multi-select-filter.js +357 -446
  270. package/dist/navigation-menu.cjs +1 -1
  271. package/dist/navigation-menu.js +108 -172
  272. package/dist/pagination.cjs +1 -1
  273. package/dist/pagination.d.ts +36 -12
  274. package/dist/pagination.d.ts.map +1 -1
  275. package/dist/pagination.js +208 -281
  276. package/dist/popover.cjs +1 -1
  277. package/dist/popover.d.ts +1 -1
  278. package/dist/popover.d.ts.map +1 -1
  279. package/dist/popover.js +34 -45
  280. package/dist/progress.cjs +1 -1
  281. package/dist/progress.d.ts +17 -2
  282. package/dist/progress.d.ts.map +1 -1
  283. package/dist/progress.js +116 -162
  284. package/dist/radio-group.cjs +1 -1
  285. package/dist/radio-group.js +90 -146
  286. package/dist/rating.cjs +1 -1
  287. package/dist/rating.d.ts +80 -13
  288. package/dist/rating.d.ts.map +1 -1
  289. package/dist/rating.js +70 -65
  290. package/dist/relative-date.cjs +1 -1
  291. package/dist/relative-date.d.ts.map +1 -1
  292. package/dist/relative-date.js +73 -89
  293. package/dist/resizable.cjs +1 -1
  294. package/dist/resizable.d.ts +39 -23
  295. package/dist/resizable.d.ts.map +1 -1
  296. package/dist/resizable.js +42 -44
  297. package/dist/result-count.cjs +1 -0
  298. package/dist/result-count.d.ts +110 -0
  299. package/dist/result-count.d.ts.map +1 -0
  300. package/dist/result-count.js +49 -0
  301. package/dist/route-progress.cjs +1 -1
  302. package/dist/route-progress.js +59 -102
  303. package/dist/scroll-area.cjs +1 -1
  304. package/dist/scroll-area.d.ts +9 -1
  305. package/dist/scroll-area.d.ts.map +1 -1
  306. package/dist/scroll-area.js +44 -79
  307. package/dist/select.cjs +2 -2
  308. package/dist/select.d.ts +10 -10
  309. package/dist/select.d.ts.map +1 -1
  310. package/dist/select.js +118 -238
  311. package/dist/separator.cjs +1 -1
  312. package/dist/separator.js +90 -78
  313. package/dist/sheet.cjs +1 -1
  314. package/dist/sheet.d.ts +8 -5
  315. package/dist/sheet.d.ts.map +1 -1
  316. package/dist/sheet.js +250 -317
  317. package/dist/single-select-filter.cjs +1 -1
  318. package/dist/single-select-filter.d.ts +32 -0
  319. package/dist/single-select-filter.d.ts.map +1 -1
  320. package/dist/single-select-filter.js +201 -203
  321. package/dist/skeleton.cjs +1 -1
  322. package/dist/skeleton.js +24 -38
  323. package/dist/slider.cjs +1 -1
  324. package/dist/slider.js +51 -81
  325. package/dist/sonner.cjs +1 -1
  326. package/dist/sonner.d.ts +1 -1
  327. package/dist/sonner.d.ts.map +1 -1
  328. package/dist/sonner.js +101 -125
  329. package/dist/spinner.cjs +1 -1
  330. package/dist/spinner.js +22 -31
  331. package/dist/split-layout.cjs +1 -1
  332. package/dist/split-layout.js +52 -101
  333. package/dist/status.cjs +1 -0
  334. package/dist/status.d.ts +51 -0
  335. package/dist/status.d.ts.map +1 -0
  336. package/dist/status.js +60 -0
  337. package/dist/stepper.cjs +1 -1
  338. package/dist/stepper.js +184 -316
  339. package/dist/switch.cjs +1 -1
  340. package/dist/switch.js +17 -32
  341. package/dist/table.cjs +1 -1
  342. package/dist/table.d.ts +103 -30
  343. package/dist/table.d.ts.map +1 -1
  344. package/dist/table.js +170 -209
  345. package/dist/tabs.cjs +1 -1
  346. package/dist/tabs.d.ts.map +1 -1
  347. package/dist/tabs.js +102 -147
  348. package/dist/text-reveal-motion.cjs +1 -1
  349. package/dist/text-reveal-motion.js +307 -363
  350. package/dist/textarea.cjs +1 -1
  351. package/dist/textarea.d.ts.map +1 -1
  352. package/dist/textarea.js +22 -35
  353. package/dist/toggle-group.cjs +1 -1
  354. package/dist/toggle-group.js +43 -62
  355. package/dist/toggle.cjs +1 -1
  356. package/dist/toggle.js +34 -46
  357. package/dist/tooltip.cjs +1 -1
  358. package/dist/tooltip.d.ts +2 -2
  359. package/dist/tooltip.d.ts.map +1 -1
  360. package/dist/tooltip.js +157 -249
  361. package/dist/typography-heading.cjs +1 -1
  362. package/dist/typography-heading.js +25 -61
  363. package/dist/typography-text.cjs +1 -1
  364. package/dist/typography-text.js +27 -57
  365. package/dist/typography.cjs +1 -1
  366. package/dist/typography.js +132 -340
  367. package/package.json +47 -47
  368. package/src/blocks/empty-state.tsx +34 -18
  369. package/src/blocks/input-list.tsx +14 -9
  370. package/src/blocks/sidebar.tsx +86 -31
  371. package/src/components/accordion.tsx +1 -1
  372. package/src/components/alert-dialog.tsx +4 -2
  373. package/src/components/badge.tsx +127 -15
  374. package/src/components/breadcrumb.tsx +1 -1
  375. package/src/components/button.tsx +8 -6
  376. package/src/components/calendar.tsx +155 -9
  377. package/src/components/card.tsx +63 -10
  378. package/src/components/carousel.tsx +4 -1
  379. package/src/components/chart.tsx +151 -17
  380. package/src/components/checkbox.tsx +1 -1
  381. package/src/components/collapsible.tsx +4 -1
  382. package/src/components/combobox.tsx +40 -7
  383. package/src/components/command.tsx +9 -10
  384. package/src/components/context-menu.tsx +4 -4
  385. package/src/components/data-table.tsx +619 -237
  386. package/src/components/date-picker.tsx +31 -4
  387. package/src/components/delta.tsx +217 -0
  388. package/src/components/description-list.tsx +445 -0
  389. package/src/components/drawer.tsx +5 -5
  390. package/src/components/dropdown-menu.tsx +4 -4
  391. package/src/components/field.tsx +36 -15
  392. package/src/components/global-layout.tsx +1 -1
  393. package/src/components/input-chip.tsx +51 -7
  394. package/src/components/input-group.tsx +1 -1
  395. package/src/components/input-password.tsx +15 -19
  396. package/src/components/input.tsx +10 -1
  397. package/src/components/list.tsx +695 -72
  398. package/src/components/logo-mark.tsx +345 -0
  399. package/src/components/map.tsx +18 -20
  400. package/src/components/media-viewer.tsx +908 -0
  401. package/src/components/multi-select-filter.tsx +255 -121
  402. package/src/components/navigation-menu.tsx +2 -2
  403. package/src/components/pagination.tsx +86 -26
  404. package/src/components/progress.tsx +91 -23
  405. package/src/components/rating.tsx +200 -74
  406. package/src/components/relative-date.tsx +19 -11
  407. package/src/components/resizable.tsx +86 -33
  408. package/src/components/result-count.tsx +253 -0
  409. package/src/components/scroll-area.tsx +31 -5
  410. package/src/components/select.tsx +2 -2
  411. package/src/components/sheet.tsx +14 -4
  412. package/src/components/single-select-filter.tsx +136 -41
  413. package/src/components/slider.tsx +2 -2
  414. package/src/components/status.tsx +162 -0
  415. package/src/components/switch.tsx +1 -1
  416. package/src/components/table.tsx +278 -106
  417. package/src/components/tabs.tsx +1 -0
  418. package/src/components/textarea.tsx +20 -2
  419. package/src/components/toggle.tsx +2 -2
  420. package/src/components/tooltip.tsx +11 -20
  421. package/src/hooks/use-filter-search-params.ts +302 -0
  422. package/src/index.ts +7 -0
  423. package/src/lib/compose-event-handlers.ts +14 -0
  424. package/src/lib/download-file.ts +61 -0
  425. package/src/lib/empty-chip.tsx +52 -0
  426. package/src/lib/field-aria.tsx +97 -0
  427. package/src/lib/image-file-info.ts +102 -0
  428. package/src/lib/media-viewer-content.tsx +1587 -0
  429. package/src/lib/media-viewer-internal.tsx +191 -0
  430. package/src/lib/media-viewer-motion.ts +120 -0
  431. package/src/lib/motion.ts +9 -0
  432. package/src/lib/table-internal.ts +74 -0
  433. package/src/lib/use-controllable.ts +43 -0
  434. 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