@appica/ui-react 1.0.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 (534) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +91 -0
  3. package/dist/components/accordion/accordion.d.ts +29 -0
  4. package/dist/components/accordion/accordion.d.ts.map +1 -0
  5. package/dist/components/accordion/accordion.js +210 -0
  6. package/dist/components/accordion/accordion.js.map +1 -0
  7. package/dist/components/alert/alert.d.ts +32 -0
  8. package/dist/components/alert/alert.d.ts.map +1 -0
  9. package/dist/components/alert/alert.js +203 -0
  10. package/dist/components/alert/alert.js.map +1 -0
  11. package/dist/components/alert-dialog/alert-dialog.d.ts +28 -0
  12. package/dist/components/alert-dialog/alert-dialog.d.ts.map +1 -0
  13. package/dist/components/alert-dialog/alert-dialog.js +127 -0
  14. package/dist/components/alert-dialog/alert-dialog.js.map +1 -0
  15. package/dist/components/autocomplete/autocomplete.d.ts +48 -0
  16. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -0
  17. package/dist/components/autocomplete/autocomplete.js +299 -0
  18. package/dist/components/autocomplete/autocomplete.js.map +1 -0
  19. package/dist/components/avatar/avatar.d.ts +29 -0
  20. package/dist/components/avatar/avatar.d.ts.map +1 -0
  21. package/dist/components/avatar/avatar.js +115 -0
  22. package/dist/components/avatar/avatar.js.map +1 -0
  23. package/dist/components/background-pattern/background-pattern-interactive.d.ts +10 -0
  24. package/dist/components/background-pattern/background-pattern-interactive.d.ts.map +1 -0
  25. package/dist/components/background-pattern/background-pattern-interactive.js +72 -0
  26. package/dist/components/background-pattern/background-pattern-interactive.js.map +1 -0
  27. package/dist/components/background-pattern/background-pattern-shared.d.ts +12 -0
  28. package/dist/components/background-pattern/background-pattern-shared.d.ts.map +1 -0
  29. package/dist/components/background-pattern/background-pattern-shared.js +73 -0
  30. package/dist/components/background-pattern/background-pattern-shared.js.map +1 -0
  31. package/dist/components/background-pattern/background-pattern.d.ts +23 -0
  32. package/dist/components/background-pattern/background-pattern.d.ts.map +1 -0
  33. package/dist/components/background-pattern/background-pattern.js +49 -0
  34. package/dist/components/background-pattern/background-pattern.js.map +1 -0
  35. package/dist/components/background-pattern/index.d.ts +4 -0
  36. package/dist/components/background-pattern/index.d.ts.map +1 -0
  37. package/dist/components/background-pattern/index.js +3 -0
  38. package/dist/components/background-pattern/index.js.map +1 -0
  39. package/dist/components/badge/badge.d.ts +17 -0
  40. package/dist/components/badge/badge.d.ts.map +1 -0
  41. package/dist/components/badge/badge.js +134 -0
  42. package/dist/components/badge/badge.js.map +1 -0
  43. package/dist/components/breadcrumb/breadcrumb.d.ts +24 -0
  44. package/dist/components/breadcrumb/breadcrumb.d.ts.map +1 -0
  45. package/dist/components/breadcrumb/breadcrumb.js +106 -0
  46. package/dist/components/breadcrumb/breadcrumb.js.map +1 -0
  47. package/dist/components/button/button-variants.d.ts +6 -0
  48. package/dist/components/button/button-variants.d.ts.map +1 -0
  49. package/dist/components/button/button-variants.js +69 -0
  50. package/dist/components/button/button-variants.js.map +1 -0
  51. package/dist/components/button/button.d.ts +10 -0
  52. package/dist/components/button/button.d.ts.map +1 -0
  53. package/dist/components/button/button.js +26 -0
  54. package/dist/components/button/button.js.map +1 -0
  55. package/dist/components/button/index.d.ts +3 -0
  56. package/dist/components/button/index.d.ts.map +1 -0
  57. package/dist/components/button/index.js +3 -0
  58. package/dist/components/button/index.js.map +1 -0
  59. package/dist/components/button-group/button-group-context.d.ts +13 -0
  60. package/dist/components/button-group/button-group-context.d.ts.map +1 -0
  61. package/dist/components/button-group/button-group-context.js +7 -0
  62. package/dist/components/button-group/button-group-context.js.map +1 -0
  63. package/dist/components/button-group/button-group.d.ts +12 -0
  64. package/dist/components/button-group/button-group.d.ts.map +1 -0
  65. package/dist/components/button-group/button-group.js +45 -0
  66. package/dist/components/button-group/button-group.js.map +1 -0
  67. package/dist/components/calendar/calendar.d.ts +14 -0
  68. package/dist/components/calendar/calendar.d.ts.map +1 -0
  69. package/dist/components/calendar/calendar.js +228 -0
  70. package/dist/components/calendar/calendar.js.map +1 -0
  71. package/dist/components/carousel/carousel.d.ts +128 -0
  72. package/dist/components/carousel/carousel.d.ts.map +1 -0
  73. package/dist/components/carousel/carousel.js +795 -0
  74. package/dist/components/carousel/carousel.js.map +1 -0
  75. package/dist/components/checkbox/checkbox.d.ts +7 -0
  76. package/dist/components/checkbox/checkbox.d.ts.map +1 -0
  77. package/dist/components/checkbox/checkbox.js +128 -0
  78. package/dist/components/checkbox/checkbox.js.map +1 -0
  79. package/dist/components/checkbox-group/checkbox-group.d.ts +9 -0
  80. package/dist/components/checkbox-group/checkbox-group.d.ts.map +1 -0
  81. package/dist/components/checkbox-group/checkbox-group.js +18 -0
  82. package/dist/components/checkbox-group/checkbox-group.js.map +1 -0
  83. package/dist/components/chip/chip.d.ts +36 -0
  84. package/dist/components/chip/chip.d.ts.map +1 -0
  85. package/dist/components/chip/chip.js +159 -0
  86. package/dist/components/chip/chip.js.map +1 -0
  87. package/dist/components/collapsible/collapsible.d.ts +11 -0
  88. package/dist/components/collapsible/collapsible.d.ts.map +1 -0
  89. package/dist/components/collapsible/collapsible.js +41 -0
  90. package/dist/components/collapsible/collapsible.js.map +1 -0
  91. package/dist/components/combobox/combobox.d.ts +57 -0
  92. package/dist/components/combobox/combobox.d.ts.map +1 -0
  93. package/dist/components/combobox/combobox.js +456 -0
  94. package/dist/components/combobox/combobox.js.map +1 -0
  95. package/dist/components/context-menu/context-menu.d.ts +43 -0
  96. package/dist/components/context-menu/context-menu.d.ts.map +1 -0
  97. package/dist/components/context-menu/context-menu.js +243 -0
  98. package/dist/components/context-menu/context-menu.js.map +1 -0
  99. package/dist/components/copy-button/copy-button.d.ts +15 -0
  100. package/dist/components/copy-button/copy-button.d.ts.map +1 -0
  101. package/dist/components/copy-button/copy-button.js +126 -0
  102. package/dist/components/copy-button/copy-button.js.map +1 -0
  103. package/dist/components/countdown/countdown.d.ts +26 -0
  104. package/dist/components/countdown/countdown.d.ts.map +1 -0
  105. package/dist/components/countdown/countdown.js +111 -0
  106. package/dist/components/countdown/countdown.js.map +1 -0
  107. package/dist/components/date-field/date-field.d.ts +25 -0
  108. package/dist/components/date-field/date-field.d.ts.map +1 -0
  109. package/dist/components/date-field/date-field.js +403 -0
  110. package/dist/components/date-field/date-field.js.map +1 -0
  111. package/dist/components/date-picker/date-picker.d.ts +58 -0
  112. package/dist/components/date-picker/date-picker.d.ts.map +1 -0
  113. package/dist/components/date-picker/date-picker.js +449 -0
  114. package/dist/components/date-picker/date-picker.js.map +1 -0
  115. package/dist/components/dialog/dialog.d.ts +30 -0
  116. package/dist/components/dialog/dialog.d.ts.map +1 -0
  117. package/dist/components/dialog/dialog.js +138 -0
  118. package/dist/components/dialog/dialog.js.map +1 -0
  119. package/dist/components/drawer/drawer.d.ts +39 -0
  120. package/dist/components/drawer/drawer.d.ts.map +1 -0
  121. package/dist/components/drawer/drawer.js +270 -0
  122. package/dist/components/drawer/drawer.js.map +1 -0
  123. package/dist/components/dropdown-menu/dropdown-menu.d.ts +43 -0
  124. package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -0
  125. package/dist/components/dropdown-menu/dropdown-menu.js +235 -0
  126. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -0
  127. package/dist/components/field/field.d.ts +15 -0
  128. package/dist/components/field/field.d.ts.map +1 -0
  129. package/dist/components/field/field.js +62 -0
  130. package/dist/components/field/field.js.map +1 -0
  131. package/dist/components/fieldset/fieldset.d.ts +9 -0
  132. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  133. package/dist/components/fieldset/fieldset.js +20 -0
  134. package/dist/components/fieldset/fieldset.js.map +1 -0
  135. package/dist/components/form/form.d.ts +7 -0
  136. package/dist/components/form/form.d.ts.map +1 -0
  137. package/dist/components/form/form.js +9 -0
  138. package/dist/components/form/form.js.map +1 -0
  139. package/dist/components/gradient-glow/gradient-glow.d.ts +21 -0
  140. package/dist/components/gradient-glow/gradient-glow.d.ts.map +1 -0
  141. package/dist/components/gradient-glow/gradient-glow.js +99 -0
  142. package/dist/components/gradient-glow/gradient-glow.js.map +1 -0
  143. package/dist/components/input/index.d.ts +3 -0
  144. package/dist/components/input/index.d.ts.map +1 -0
  145. package/dist/components/input/index.js +3 -0
  146. package/dist/components/input/index.js.map +1 -0
  147. package/dist/components/input/input-variants.d.ts +7 -0
  148. package/dist/components/input/input-variants.d.ts.map +1 -0
  149. package/dist/components/input/input-variants.js +52 -0
  150. package/dist/components/input/input-variants.js.map +1 -0
  151. package/dist/components/input/input.d.ts +19 -0
  152. package/dist/components/input/input.d.ts.map +1 -0
  153. package/dist/components/input/input.js +96 -0
  154. package/dist/components/input/input.js.map +1 -0
  155. package/dist/components/kbd/kbd.d.ts +13 -0
  156. package/dist/components/kbd/kbd.d.ts.map +1 -0
  157. package/dist/components/kbd/kbd.js +34 -0
  158. package/dist/components/kbd/kbd.js.map +1 -0
  159. package/dist/components/loader/loader.d.ts +10 -0
  160. package/dist/components/loader/loader.d.ts.map +1 -0
  161. package/dist/components/loader/loader.js +137 -0
  162. package/dist/components/loader/loader.js.map +1 -0
  163. package/dist/components/menubar/menubar.d.ts +44 -0
  164. package/dist/components/menubar/menubar.d.ts.map +1 -0
  165. package/dist/components/menubar/menubar.js +114 -0
  166. package/dist/components/menubar/menubar.js.map +1 -0
  167. package/dist/components/meter/meter.d.ts +24 -0
  168. package/dist/components/meter/meter.d.ts.map +1 -0
  169. package/dist/components/meter/meter.js +105 -0
  170. package/dist/components/meter/meter.js.map +1 -0
  171. package/dist/components/navigation/index.d.ts +4 -0
  172. package/dist/components/navigation/index.d.ts.map +1 -0
  173. package/dist/components/navigation/index.js +4 -0
  174. package/dist/components/navigation/index.js.map +1 -0
  175. package/dist/components/navigation/navigation-context.d.ts +16 -0
  176. package/dist/components/navigation/navigation-context.d.ts.map +1 -0
  177. package/dist/components/navigation/navigation-context.js +10 -0
  178. package/dist/components/navigation/navigation-context.js.map +1 -0
  179. package/dist/components/navigation/navigation-link-variants.d.ts +9 -0
  180. package/dist/components/navigation/navigation-link-variants.d.ts.map +1 -0
  181. package/dist/components/navigation/navigation-link-variants.js +189 -0
  182. package/dist/components/navigation/navigation-link-variants.js.map +1 -0
  183. package/dist/components/navigation/navigation-link.d.ts +20 -0
  184. package/dist/components/navigation/navigation-link.d.ts.map +1 -0
  185. package/dist/components/navigation/navigation-link.js +54 -0
  186. package/dist/components/navigation/navigation-link.js.map +1 -0
  187. package/dist/components/navigation/navigation.d.ts +21 -0
  188. package/dist/components/navigation/navigation.d.ts.map +1 -0
  189. package/dist/components/navigation/navigation.js +41 -0
  190. package/dist/components/navigation/navigation.js.map +1 -0
  191. package/dist/components/navigation-menu/navigation-menu.d.ts +41 -0
  192. package/dist/components/navigation-menu/navigation-menu.d.ts.map +1 -0
  193. package/dist/components/navigation-menu/navigation-menu.js +329 -0
  194. package/dist/components/navigation-menu/navigation-menu.js.map +1 -0
  195. package/dist/components/number-field/number-field.d.ts +17 -0
  196. package/dist/components/number-field/number-field.d.ts.map +1 -0
  197. package/dist/components/number-field/number-field.js +270 -0
  198. package/dist/components/number-field/number-field.js.map +1 -0
  199. package/dist/components/otp-field/otp-field.d.ts +19 -0
  200. package/dist/components/otp-field/otp-field.d.ts.map +1 -0
  201. package/dist/components/otp-field/otp-field.js +66 -0
  202. package/dist/components/otp-field/otp-field.js.map +1 -0
  203. package/dist/components/pagination/pagination.d.ts +29 -0
  204. package/dist/components/pagination/pagination.d.ts.map +1 -0
  205. package/dist/components/pagination/pagination.js +92 -0
  206. package/dist/components/pagination/pagination.js.map +1 -0
  207. package/dist/components/popover/popover.d.ts +22 -0
  208. package/dist/components/popover/popover.d.ts.map +1 -0
  209. package/dist/components/popover/popover.js +108 -0
  210. package/dist/components/popover/popover.js.map +1 -0
  211. package/dist/components/preview-card/preview-card.d.ts +16 -0
  212. package/dist/components/preview-card/preview-card.d.ts.map +1 -0
  213. package/dist/components/preview-card/preview-card.js +92 -0
  214. package/dist/components/preview-card/preview-card.js.map +1 -0
  215. package/dist/components/progress/progress.d.ts +18 -0
  216. package/dist/components/progress/progress.d.ts.map +1 -0
  217. package/dist/components/progress/progress.js +134 -0
  218. package/dist/components/progress/progress.js.map +1 -0
  219. package/dist/components/radio/radio.d.ts +7 -0
  220. package/dist/components/radio/radio.d.ts.map +1 -0
  221. package/dist/components/radio/radio.js +73 -0
  222. package/dist/components/radio/radio.js.map +1 -0
  223. package/dist/components/radio-group/radio-group.d.ts +9 -0
  224. package/dist/components/radio-group/radio-group.d.ts.map +1 -0
  225. package/dist/components/radio-group/radio-group.js +19 -0
  226. package/dist/components/radio-group/radio-group.js.map +1 -0
  227. package/dist/components/scroll-area/scroll-area.d.ts +14 -0
  228. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  229. package/dist/components/scroll-area/scroll-area.js +87 -0
  230. package/dist/components/scroll-area/scroll-area.js.map +1 -0
  231. package/dist/components/select/select.d.ts +36 -0
  232. package/dist/components/select/select.d.ts.map +1 -0
  233. package/dist/components/select/select.js +345 -0
  234. package/dist/components/select/select.js.map +1 -0
  235. package/dist/components/separator/separator.d.ts +10 -0
  236. package/dist/components/separator/separator.d.ts.map +1 -0
  237. package/dist/components/separator/separator.js +81 -0
  238. package/dist/components/separator/separator.js.map +1 -0
  239. package/dist/components/skeleton/skeleton.d.ts +9 -0
  240. package/dist/components/skeleton/skeleton.d.ts.map +1 -0
  241. package/dist/components/skeleton/skeleton.js +27 -0
  242. package/dist/components/skeleton/skeleton.js.map +1 -0
  243. package/dist/components/slider/slider.d.ts +11 -0
  244. package/dist/components/slider/slider.d.ts.map +1 -0
  245. package/dist/components/slider/slider.js +187 -0
  246. package/dist/components/slider/slider.js.map +1 -0
  247. package/dist/components/sparkline/sparkline.d.ts +39 -0
  248. package/dist/components/sparkline/sparkline.d.ts.map +1 -0
  249. package/dist/components/sparkline/sparkline.js +356 -0
  250. package/dist/components/sparkline/sparkline.js.map +1 -0
  251. package/dist/components/spinner/spinner.d.ts +10 -0
  252. package/dist/components/spinner/spinner.d.ts.map +1 -0
  253. package/dist/components/spinner/spinner.js +179 -0
  254. package/dist/components/spinner/spinner.js.map +1 -0
  255. package/dist/components/switch/switch.d.ts +33 -0
  256. package/dist/components/switch/switch.d.ts.map +1 -0
  257. package/dist/components/switch/switch.js +137 -0
  258. package/dist/components/switch/switch.js.map +1 -0
  259. package/dist/components/table/table.d.ts +34 -0
  260. package/dist/components/table/table.d.ts.map +1 -0
  261. package/dist/components/table/table.js +108 -0
  262. package/dist/components/table/table.js.map +1 -0
  263. package/dist/components/tabs/tabs.d.ts +35 -0
  264. package/dist/components/tabs/tabs.d.ts.map +1 -0
  265. package/dist/components/tabs/tabs.js +192 -0
  266. package/dist/components/tabs/tabs.js.map +1 -0
  267. package/dist/components/text-animate/text-animate.d.ts +31 -0
  268. package/dist/components/text-animate/text-animate.d.ts.map +1 -0
  269. package/dist/components/text-animate/text-animate.js +230 -0
  270. package/dist/components/text-animate/text-animate.js.map +1 -0
  271. package/dist/components/textarea/textarea.d.ts +17 -0
  272. package/dist/components/textarea/textarea.d.ts.map +1 -0
  273. package/dist/components/textarea/textarea.js +117 -0
  274. package/dist/components/textarea/textarea.js.map +1 -0
  275. package/dist/components/thumbnail/thumbnail.d.ts +26 -0
  276. package/dist/components/thumbnail/thumbnail.d.ts.map +1 -0
  277. package/dist/components/thumbnail/thumbnail.js +116 -0
  278. package/dist/components/thumbnail/thumbnail.js.map +1 -0
  279. package/dist/components/time-field/time-field.d.ts +25 -0
  280. package/dist/components/time-field/time-field.d.ts.map +1 -0
  281. package/dist/components/time-field/time-field.js +488 -0
  282. package/dist/components/time-field/time-field.js.map +1 -0
  283. package/dist/components/toast/toast.d.ts +59 -0
  284. package/dist/components/toast/toast.d.ts.map +1 -0
  285. package/dist/components/toast/toast.js +239 -0
  286. package/dist/components/toast/toast.js.map +1 -0
  287. package/dist/components/toc/toc.d.ts +21 -0
  288. package/dist/components/toc/toc.d.ts.map +1 -0
  289. package/dist/components/toc/toc.js +185 -0
  290. package/dist/components/toc/toc.js.map +1 -0
  291. package/dist/components/toggle/toggle.d.ts +7 -0
  292. package/dist/components/toggle/toggle.d.ts.map +1 -0
  293. package/dist/components/toggle/toggle.js +9 -0
  294. package/dist/components/toggle/toggle.js.map +1 -0
  295. package/dist/components/toggle-group/toggle-group.d.ts +7 -0
  296. package/dist/components/toggle-group/toggle-group.d.ts.map +1 -0
  297. package/dist/components/toggle-group/toggle-group.js +21 -0
  298. package/dist/components/toggle-group/toggle-group.js.map +1 -0
  299. package/dist/components/toolbar/toolbar.d.ts +23 -0
  300. package/dist/components/toolbar/toolbar.d.ts.map +1 -0
  301. package/dist/components/toolbar/toolbar.js +56 -0
  302. package/dist/components/toolbar/toolbar.js.map +1 -0
  303. package/dist/components/tooltip/tooltip.d.ts +16 -0
  304. package/dist/components/tooltip/tooltip.d.ts.map +1 -0
  305. package/dist/components/tooltip/tooltip.js +64 -0
  306. package/dist/components/tooltip/tooltip.js.map +1 -0
  307. package/dist/floating.d.ts +47 -0
  308. package/dist/floating.d.ts.map +1 -0
  309. package/dist/floating.js +35 -0
  310. package/dist/floating.js.map +1 -0
  311. package/dist/hooks/use-direction.d.ts +2 -0
  312. package/dist/hooks/use-direction.d.ts.map +1 -0
  313. package/dist/hooks/use-direction.js +3 -0
  314. package/dist/hooks/use-direction.js.map +1 -0
  315. package/dist/hooks/use-dismissible.d.ts +16 -0
  316. package/dist/hooks/use-dismissible.d.ts.map +1 -0
  317. package/dist/hooks/use-dismissible.js +17 -0
  318. package/dist/hooks/use-dismissible.js.map +1 -0
  319. package/dist/hooks/use-local-storage.d.ts +24 -0
  320. package/dist/hooks/use-local-storage.d.ts.map +1 -0
  321. package/dist/hooks/use-local-storage.js +127 -0
  322. package/dist/hooks/use-local-storage.js.map +1 -0
  323. package/dist/hooks/use-media-query.d.ts +20 -0
  324. package/dist/hooks/use-media-query.d.ts.map +1 -0
  325. package/dist/hooks/use-media-query.js +19 -0
  326. package/dist/hooks/use-media-query.js.map +1 -0
  327. package/dist/hooks/use-reduced-motion.d.ts +7 -0
  328. package/dist/hooks/use-reduced-motion.d.ts.map +1 -0
  329. package/dist/hooks/use-reduced-motion.js +13 -0
  330. package/dist/hooks/use-reduced-motion.js.map +1 -0
  331. package/dist/hooks/use-theme.d.ts +11 -0
  332. package/dist/hooks/use-theme.d.ts.map +1 -0
  333. package/dist/hooks/use-theme.js +9 -0
  334. package/dist/hooks/use-theme.js.map +1 -0
  335. package/dist/index.d.ts +74 -0
  336. package/dist/index.d.ts.map +1 -0
  337. package/dist/index.js +80 -0
  338. package/dist/index.js.map +1 -0
  339. package/dist/modal.d.ts +42 -0
  340. package/dist/modal.d.ts.map +1 -0
  341. package/dist/modal.js +18 -0
  342. package/dist/modal.js.map +1 -0
  343. package/dist/providers/direction-provider.d.ts +21 -0
  344. package/dist/providers/direction-provider.d.ts.map +1 -0
  345. package/dist/providers/direction-provider.js +9 -0
  346. package/dist/providers/direction-provider.js.map +1 -0
  347. package/dist/providers/reduced-motion-provider.d.ts +30 -0
  348. package/dist/providers/reduced-motion-provider.d.ts.map +1 -0
  349. package/dist/providers/reduced-motion-provider.js +27 -0
  350. package/dist/providers/reduced-motion-provider.js.map +1 -0
  351. package/dist/providers/theme-provider/index.d.ts +5 -0
  352. package/dist/providers/theme-provider/index.d.ts.map +1 -0
  353. package/dist/providers/theme-provider/index.js +3 -0
  354. package/dist/providers/theme-provider/index.js.map +1 -0
  355. package/dist/providers/theme-provider/theme-provider.d.ts +39 -0
  356. package/dist/providers/theme-provider/theme-provider.d.ts.map +1 -0
  357. package/dist/providers/theme-provider/theme-provider.js +118 -0
  358. package/dist/providers/theme-provider/theme-provider.js.map +1 -0
  359. package/dist/providers/theme-provider/theme-script.d.ts +28 -0
  360. package/dist/providers/theme-provider/theme-script.d.ts.map +1 -0
  361. package/dist/providers/theme-provider/theme-script.js +59 -0
  362. package/dist/providers/theme-provider/theme-script.js.map +1 -0
  363. package/dist/utils.d.ts +17 -0
  364. package/dist/utils.d.ts.map +1 -0
  365. package/dist/utils.js +51 -0
  366. package/dist/utils.js.map +1 -0
  367. package/package.json +479 -0
  368. package/src/components/accordion/accordion.test.tsx +220 -0
  369. package/src/components/accordion/accordion.tsx +269 -0
  370. package/src/components/alert/alert.test.tsx +188 -0
  371. package/src/components/alert/alert.tsx +243 -0
  372. package/src/components/alert-dialog/alert-dialog.test.tsx +141 -0
  373. package/src/components/alert-dialog/alert-dialog.tsx +179 -0
  374. package/src/components/autocomplete/autocomplete.test.tsx +384 -0
  375. package/src/components/autocomplete/autocomplete.tsx +442 -0
  376. package/src/components/avatar/avatar.test.tsx +368 -0
  377. package/src/components/avatar/avatar.tsx +142 -0
  378. package/src/components/background-pattern/background-pattern-interactive.tsx +93 -0
  379. package/src/components/background-pattern/background-pattern-shared.tsx +96 -0
  380. package/src/components/background-pattern/background-pattern.test.tsx +97 -0
  381. package/src/components/background-pattern/background-pattern.tsx +67 -0
  382. package/src/components/background-pattern/index.ts +3 -0
  383. package/src/components/badge/badge.test.tsx +58 -0
  384. package/src/components/badge/badge.tsx +149 -0
  385. package/src/components/breadcrumb/breadcrumb.test.tsx +174 -0
  386. package/src/components/breadcrumb/breadcrumb.tsx +146 -0
  387. package/src/components/button/button-variants.ts +69 -0
  388. package/src/components/button/button.test.tsx +79 -0
  389. package/src/components/button/button.tsx +28 -0
  390. package/src/components/button/index.ts +2 -0
  391. package/src/components/button-group/button-group-context.ts +18 -0
  392. package/src/components/button-group/button-group.test.tsx +223 -0
  393. package/src/components/button-group/button-group.tsx +59 -0
  394. package/src/components/calendar/calendar.test.tsx +69 -0
  395. package/src/components/calendar/calendar.tsx +295 -0
  396. package/src/components/carousel/carousel.test.tsx +493 -0
  397. package/src/components/carousel/carousel.tsx +1003 -0
  398. package/src/components/checkbox/checkbox.test.tsx +100 -0
  399. package/src/components/checkbox/checkbox.tsx +154 -0
  400. package/src/components/checkbox-group/checkbox-group.test.tsx +86 -0
  401. package/src/components/checkbox-group/checkbox-group.tsx +21 -0
  402. package/src/components/chip/chip.test.tsx +242 -0
  403. package/src/components/chip/chip.tsx +234 -0
  404. package/src/components/collapsible/collapsible.test.tsx +126 -0
  405. package/src/components/collapsible/collapsible.tsx +47 -0
  406. package/src/components/combobox/combobox.test.tsx +410 -0
  407. package/src/components/combobox/combobox.tsx +598 -0
  408. package/src/components/context-menu/context-menu.test.tsx +226 -0
  409. package/src/components/context-menu/context-menu.tsx +345 -0
  410. package/src/components/copy-button/copy-button.test.tsx +147 -0
  411. package/src/components/copy-button/copy-button.tsx +141 -0
  412. package/src/components/countdown/countdown.test.tsx +130 -0
  413. package/src/components/countdown/countdown.tsx +170 -0
  414. package/src/components/date-field/date-field.test.tsx +373 -0
  415. package/src/components/date-field/date-field.tsx +512 -0
  416. package/src/components/date-picker/date-picker.test.tsx +291 -0
  417. package/src/components/date-picker/date-picker.tsx +572 -0
  418. package/src/components/dialog/dialog.test.tsx +173 -0
  419. package/src/components/dialog/dialog.tsx +190 -0
  420. package/src/components/drawer/drawer.test.tsx +191 -0
  421. package/src/components/drawer/drawer.tsx +365 -0
  422. package/src/components/dropdown-menu/dropdown-menu.test.tsx +227 -0
  423. package/src/components/dropdown-menu/dropdown-menu.tsx +341 -0
  424. package/src/components/field/field.test.tsx +84 -0
  425. package/src/components/field/field.tsx +71 -0
  426. package/src/components/fieldset/fieldset.test.tsx +62 -0
  427. package/src/components/fieldset/fieldset.tsx +24 -0
  428. package/src/components/form/form.test.tsx +61 -0
  429. package/src/components/form/form.tsx +11 -0
  430. package/src/components/gradient-glow/gradient-glow.test.tsx +110 -0
  431. package/src/components/gradient-glow/gradient-glow.tsx +132 -0
  432. package/src/components/input/index.ts +2 -0
  433. package/src/components/input/input-variants.ts +52 -0
  434. package/src/components/input/input.test.tsx +118 -0
  435. package/src/components/input/input.tsx +120 -0
  436. package/src/components/kbd/kbd.test.tsx +119 -0
  437. package/src/components/kbd/kbd.tsx +48 -0
  438. package/src/components/loader/loader.test.tsx +57 -0
  439. package/src/components/loader/loader.tsx +163 -0
  440. package/src/components/menubar/menubar.test.tsx +162 -0
  441. package/src/components/menubar/menubar.tsx +226 -0
  442. package/src/components/meter/meter.test.tsx +172 -0
  443. package/src/components/meter/meter.tsx +144 -0
  444. package/src/components/navigation/index.ts +3 -0
  445. package/src/components/navigation/navigation-context.ts +24 -0
  446. package/src/components/navigation/navigation-link-variants.ts +197 -0
  447. package/src/components/navigation/navigation-link.tsx +90 -0
  448. package/src/components/navigation/navigation.test.tsx +253 -0
  449. package/src/components/navigation/navigation.tsx +74 -0
  450. package/src/components/navigation-menu/navigation-menu.test.tsx +258 -0
  451. package/src/components/navigation-menu/navigation-menu.tsx +410 -0
  452. package/src/components/number-field/number-field.test.tsx +224 -0
  453. package/src/components/number-field/number-field.tsx +310 -0
  454. package/src/components/otp-field/otp-field.test.tsx +113 -0
  455. package/src/components/otp-field/otp-field.tsx +105 -0
  456. package/src/components/pagination/pagination.test.tsx +147 -0
  457. package/src/components/pagination/pagination.tsx +139 -0
  458. package/src/components/popover/popover.test.tsx +135 -0
  459. package/src/components/popover/popover.tsx +134 -0
  460. package/src/components/preview-card/preview-card.test.tsx +99 -0
  461. package/src/components/preview-card/preview-card.tsx +103 -0
  462. package/src/components/progress/progress.test.tsx +109 -0
  463. package/src/components/progress/progress.tsx +151 -0
  464. package/src/components/radio/radio.test.tsx +141 -0
  465. package/src/components/radio/radio.tsx +94 -0
  466. package/src/components/radio-group/radio-group.test.tsx +80 -0
  467. package/src/components/radio-group/radio-group.tsx +22 -0
  468. package/src/components/scroll-area/scroll-area.test.tsx +133 -0
  469. package/src/components/scroll-area/scroll-area.tsx +101 -0
  470. package/src/components/select/select.test.tsx +251 -0
  471. package/src/components/select/select.tsx +446 -0
  472. package/src/components/separator/separator.test.tsx +46 -0
  473. package/src/components/separator/separator.tsx +95 -0
  474. package/src/components/skeleton/skeleton.test.tsx +55 -0
  475. package/src/components/skeleton/skeleton.tsx +33 -0
  476. package/src/components/slider/slider.test.tsx +123 -0
  477. package/src/components/slider/slider.tsx +262 -0
  478. package/src/components/sparkline/sparkline.test.tsx +249 -0
  479. package/src/components/sparkline/sparkline.tsx +446 -0
  480. package/src/components/spinner/spinner.test.tsx +57 -0
  481. package/src/components/spinner/spinner.tsx +219 -0
  482. package/src/components/switch/switch.test.tsx +100 -0
  483. package/src/components/switch/switch.tsx +166 -0
  484. package/src/components/table/table.test.tsx +175 -0
  485. package/src/components/table/table.tsx +157 -0
  486. package/src/components/tabs/tabs.test.tsx +165 -0
  487. package/src/components/tabs/tabs.tsx +246 -0
  488. package/src/components/text-animate/text-animate.test.tsx +125 -0
  489. package/src/components/text-animate/text-animate.tsx +354 -0
  490. package/src/components/textarea/textarea.test.tsx +188 -0
  491. package/src/components/textarea/textarea.tsx +144 -0
  492. package/src/components/thumbnail/thumbnail.test.tsx +217 -0
  493. package/src/components/thumbnail/thumbnail.tsx +139 -0
  494. package/src/components/time-field/time-field.test.tsx +376 -0
  495. package/src/components/time-field/time-field.tsx +625 -0
  496. package/src/components/toast/toast.test.tsx +277 -0
  497. package/src/components/toast/toast.tsx +377 -0
  498. package/src/components/toc/toc.test.tsx +197 -0
  499. package/src/components/toc/toc.tsx +233 -0
  500. package/src/components/toggle/toggle.test.tsx +109 -0
  501. package/src/components/toggle/toggle.tsx +10 -0
  502. package/src/components/toggle-group/toggle-group.test.tsx +95 -0
  503. package/src/components/toggle-group/toggle-group.tsx +21 -0
  504. package/src/components/toolbar/toolbar.test.tsx +78 -0
  505. package/src/components/toolbar/toolbar.tsx +77 -0
  506. package/src/components/tooltip/tooltip.test.tsx +100 -0
  507. package/src/components/tooltip/tooltip.tsx +78 -0
  508. package/src/floating.test.ts +40 -0
  509. package/src/floating.ts +103 -0
  510. package/src/globals.d.ts +34 -0
  511. package/src/hooks/use-direction.ts +3 -0
  512. package/src/hooks/use-dismissible.ts +33 -0
  513. package/src/hooks/use-local-storage.test.tsx +63 -0
  514. package/src/hooks/use-local-storage.ts +190 -0
  515. package/src/hooks/use-media-query.test.tsx +65 -0
  516. package/src/hooks/use-media-query.ts +38 -0
  517. package/src/hooks/use-reduced-motion.ts +17 -0
  518. package/src/hooks/use-theme.ts +16 -0
  519. package/src/index.ts +76 -0
  520. package/src/modal.test.ts +34 -0
  521. package/src/modal.ts +80 -0
  522. package/src/providers/direction-provider.test.tsx +20 -0
  523. package/src/providers/direction-provider.tsx +26 -0
  524. package/src/providers/reduced-motion-provider.test.tsx +42 -0
  525. package/src/providers/reduced-motion-provider.tsx +58 -0
  526. package/src/providers/theme-provider/index.ts +4 -0
  527. package/src/providers/theme-provider/theme-provider.test.tsx +97 -0
  528. package/src/providers/theme-provider/theme-provider.tsx +169 -0
  529. package/src/providers/theme-provider/theme-script.tsx +108 -0
  530. package/src/test/setup.ts +27 -0
  531. package/src/test/vitest-axe.d.ts +7 -0
  532. package/src/utils.test.tsx +63 -0
  533. package/src/utils.ts +57 -0
  534. package/styles.css +523 -0
@@ -0,0 +1,795 @@
1
+ 'use client';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import * as React from 'react';
4
+ import useEmblaCarousel from 'embla-carousel-react';
5
+ import { mergeProps } from '@base-ui/react/merge-props';
6
+ import { useRender } from '@base-ui/react/use-render';
7
+ import Accessibility from 'embla-carousel-accessibility';
8
+ import Autoplay from 'embla-carousel-autoplay';
9
+ import AutoScroll from 'embla-carousel-auto-scroll';
10
+ import AutoHeight from 'embla-carousel-auto-height';
11
+ import ClassNames from 'embla-carousel-class-names';
12
+ import Fade from 'embla-carousel-fade';
13
+ import { WheelGesturesPlugin } from 'embla-carousel-wheel-gestures';
14
+ import { cn } from '../../utils.js';
15
+ import { useReducedMotion } from '../../hooks/use-reduced-motion.js';
16
+ import { useDirection } from '@base-ui/react/direction-provider';
17
+
18
+ const CarouselContext = React.createContext(null);
19
+ function useCarousel() {
20
+ const ctx = React.useContext(CarouselContext);
21
+ if (!ctx) {
22
+ throw new Error("Carousel sub-components must be rendered inside <Carousel>");
23
+ }
24
+ return ctx;
25
+ }
26
+ function Carousel({
27
+ orientation = "horizontal",
28
+ loop = false,
29
+ align = "start",
30
+ slidesToScroll = 1,
31
+ containScroll = "trimSnaps",
32
+ dragFree,
33
+ startSnap,
34
+ active = true,
35
+ draggable,
36
+ duration,
37
+ options,
38
+ autoplay,
39
+ autoScroll,
40
+ autoHeight,
41
+ fade,
42
+ classNames,
43
+ accessibility = true,
44
+ wheelGestures = false,
45
+ plugins: userPlugins,
46
+ setApi,
47
+ onReInit,
48
+ onSelect,
49
+ onScroll,
50
+ light = false,
51
+ className,
52
+ children,
53
+ ...rest
54
+ }) {
55
+ const direction = useDirection();
56
+ const reducedMotion = useReducedMotion();
57
+ const autoplayEnabled = !!autoplay;
58
+ const autoScrollEnabled = !!autoScroll;
59
+ const warnedMutualExclusive = React.useRef(false);
60
+ React.useEffect(() => {
61
+ if (process.env.NODE_ENV !== "production" && autoplayEnabled && autoScrollEnabled && !warnedMutualExclusive.current) {
62
+ warnedMutualExclusive.current = true;
63
+ console.warn("[Carousel] `autoplay` and `autoScroll` are mutually exclusive \u2014 preferring `autoplay`.");
64
+ }
65
+ }, [autoplayEnabled, autoScrollEnabled]);
66
+ const resumeAfterMs = typeof autoplay === "object" && typeof autoplay.resumeAfter === "number" && autoplay.resumeAfter || typeof autoScroll === "object" && typeof autoScroll.resumeAfter === "number" && autoScroll.resumeAfter || 0;
67
+ const plugins = React.useMemo(() => {
68
+ const list = [];
69
+ if (accessibility !== false) {
70
+ list.push(Accessibility(typeof accessibility === "object" ? accessibility : void 0));
71
+ }
72
+ if (wheelGestures !== false) {
73
+ list.push(WheelGesturesPlugin(typeof wheelGestures === "object" ? wheelGestures : void 0));
74
+ }
75
+ if (autoplay) {
76
+ const opts = typeof autoplay === "object" ? autoplay : void 0;
77
+ const { resumeAfter, ...emblaOpts } = opts ?? {};
78
+ const autoResume = typeof resumeAfter === "number" && resumeAfter > 0;
79
+ list.push(Autoplay(autoResume ? { ...emblaOpts, defaultInteraction: false } : emblaOpts));
80
+ } else if (autoScroll && !reducedMotion) {
81
+ const opts = typeof autoScroll === "object" ? autoScroll : void 0;
82
+ const { resumeAfter, ...emblaOpts } = opts ?? {};
83
+ const autoResume = typeof resumeAfter === "number" && resumeAfter > 0;
84
+ list.push(AutoScroll(autoResume ? { ...emblaOpts, defaultInteraction: false } : emblaOpts));
85
+ }
86
+ if (autoHeight) {
87
+ list.push(AutoHeight(typeof autoHeight === "object" ? autoHeight : void 0));
88
+ }
89
+ if (fade) {
90
+ list.push(Fade(typeof fade === "object" ? fade : void 0));
91
+ }
92
+ if (classNames) {
93
+ list.push(ClassNames(typeof classNames === "object" ? classNames : void 0));
94
+ }
95
+ if (userPlugins) list.push(...userPlugins);
96
+ return list;
97
+ }, [accessibility, wheelGestures, autoplay, autoScroll, autoHeight, fade, classNames, userPlugins, reducedMotion]);
98
+ const emblaOptions = React.useMemo(() => {
99
+ const merged = {
100
+ axis: orientation === "vertical" ? "y" : "x",
101
+ loop,
102
+ align,
103
+ slidesToScroll,
104
+ containScroll,
105
+ active
106
+ };
107
+ if (dragFree !== void 0) merged.dragFree = dragFree;
108
+ if (startSnap !== void 0) merged.startSnap = startSnap;
109
+ if (duration !== void 0) merged.duration = duration;
110
+ if (draggable !== void 0) merged.draggable = draggable;
111
+ if (orientation === "horizontal") merged.direction = direction;
112
+ if (reducedMotion) merged.duration = 0;
113
+ return { ...merged, ...options };
114
+ }, [
115
+ orientation,
116
+ direction,
117
+ loop,
118
+ align,
119
+ slidesToScroll,
120
+ containScroll,
121
+ dragFree,
122
+ startSnap,
123
+ active,
124
+ draggable,
125
+ duration,
126
+ options,
127
+ reducedMotion
128
+ ]);
129
+ const [viewportRef, emblaApi] = useEmblaCarousel(emblaOptions, plugins);
130
+ const setApiRef = React.useRef(setApi);
131
+ const onReInitRef = React.useRef(onReInit);
132
+ const onSelectRef = React.useRef(onSelect);
133
+ const onScrollRef = React.useRef(onScroll);
134
+ React.useEffect(() => {
135
+ setApiRef.current = setApi;
136
+ });
137
+ React.useEffect(() => {
138
+ onReInitRef.current = onReInit;
139
+ });
140
+ React.useEffect(() => {
141
+ onSelectRef.current = onSelect;
142
+ });
143
+ React.useEffect(() => {
144
+ onScrollRef.current = onScroll;
145
+ });
146
+ React.useEffect(() => {
147
+ if (!emblaApi || !reducedMotion) return;
148
+ const snapToTargetInstantly = () => {
149
+ emblaApi.internalEngine().scrollBody.useDuration(0);
150
+ };
151
+ emblaApi.on("pointerup", snapToTargetInstantly);
152
+ return () => {
153
+ emblaApi.off("pointerup", snapToTargetInstantly);
154
+ };
155
+ }, [emblaApi, reducedMotion]);
156
+ const [state, setState] = React.useState({
157
+ selectedIndex: 0,
158
+ scrollSnaps: [],
159
+ canScrollPrev: false,
160
+ canScrollNext: false
161
+ });
162
+ const [autoplayState, setAutoplayState] = React.useState(null);
163
+ const scrollProgressRef = React.useRef(0);
164
+ const scrollListenersRef = React.useRef(/* @__PURE__ */ new Set());
165
+ const subscribeScrollProgress = React.useCallback((onChange) => {
166
+ scrollListenersRef.current.add(onChange);
167
+ return () => {
168
+ scrollListenersRef.current.delete(onChange);
169
+ };
170
+ }, []);
171
+ const getScrollProgress = React.useCallback(() => scrollProgressRef.current, []);
172
+ React.useEffect(() => {
173
+ if (!emblaApi) return;
174
+ const notifyScroll = () => {
175
+ scrollProgressRef.current = emblaApi.scrollProgress();
176
+ scrollListenersRef.current.forEach((cb) => cb());
177
+ };
178
+ const syncFull = () => {
179
+ notifyScroll();
180
+ setState({
181
+ selectedIndex: emblaApi.selectedSnap(),
182
+ scrollSnaps: emblaApi.snapList(),
183
+ canScrollPrev: emblaApi.canGoToPrev(),
184
+ canScrollNext: emblaApi.canGoToNext()
185
+ });
186
+ };
187
+ const syncSelection = () => {
188
+ setState((s) => ({
189
+ ...s,
190
+ selectedIndex: emblaApi.selectedSnap(),
191
+ canScrollPrev: emblaApi.canGoToPrev(),
192
+ canScrollNext: emblaApi.canGoToNext()
193
+ }));
194
+ };
195
+ const syncScroll = () => {
196
+ notifyScroll();
197
+ };
198
+ const syncInView = () => {
199
+ };
200
+ syncFull();
201
+ setApiRef.current?.(emblaApi);
202
+ onReInitRef.current?.(emblaApi);
203
+ const handleReInit = () => {
204
+ const autoplayWasPlaying = emblaApi.plugins().autoplay?.isPlaying();
205
+ const autoScrollWasPlaying = emblaApi.plugins().autoScroll?.isPlaying();
206
+ syncFull();
207
+ onReInitRef.current?.(emblaApi);
208
+ if (autoplayEnabled && autoplayWasPlaying) emblaApi.plugins().autoplay?.play();
209
+ else if (autoScrollEnabled && autoScrollWasPlaying) emblaApi.plugins().autoScroll?.play();
210
+ };
211
+ const handleSelect = () => {
212
+ syncSelection();
213
+ onSelectRef.current?.(emblaApi);
214
+ };
215
+ const handleScroll = () => {
216
+ syncScroll();
217
+ onScrollRef.current?.(emblaApi);
218
+ };
219
+ emblaApi.on("reinit", handleReInit);
220
+ emblaApi.on("select", handleSelect);
221
+ emblaApi.on("scroll", handleScroll);
222
+ emblaApi.on("slidesinview", syncInView);
223
+ emblaApi.on("slideschanged", syncFull);
224
+ const autoplayPlugin = emblaApi.plugins().autoplay;
225
+ const autoScrollPlugin = emblaApi.plugins().autoScroll;
226
+ const resumeAfter = resumeAfterMs;
227
+ let resumeTimer;
228
+ const clearResumeTimer = () => {
229
+ if (resumeTimer !== void 0) {
230
+ clearTimeout(resumeTimer);
231
+ resumeTimer = void 0;
232
+ }
233
+ };
234
+ const scheduleResume = (play) => {
235
+ if (resumeAfter <= 0) return;
236
+ clearResumeTimer();
237
+ resumeTimer = setTimeout(() => {
238
+ resumeTimer = void 0;
239
+ play();
240
+ }, resumeAfter);
241
+ };
242
+ let cleanupAutoplay;
243
+ if (autoplayPlugin) {
244
+ const rawDelay = autoplayPlugin.options.delay;
245
+ const initialDelay = typeof rawDelay === "number" ? rawDelay : 4e3;
246
+ setAutoplayState({
247
+ delay: initialDelay,
248
+ cycleId: 0,
249
+ isPlaying: autoplayPlugin.isPlaying()
250
+ });
251
+ const onPlay = () => {
252
+ clearResumeTimer();
253
+ setAutoplayState((s) => s ? { ...s, isPlaying: true } : s);
254
+ };
255
+ const onStop = () => setAutoplayState((s) => s ? { ...s, isPlaying: false } : s);
256
+ const onTimerSet = () => setAutoplayState((s) => s ? { ...s, cycleId: s.cycleId + 1, isPlaying: true } : s);
257
+ const onTimerStopped = () => setAutoplayState((s) => s ? { ...s, isPlaying: false } : s);
258
+ const resetOnSelect = () => autoplayPlugin.reset();
259
+ const onInteraction = (_api, event) => {
260
+ if (event.detail.interaction === "pointerdown" || event.detail.interaction === "slidefocus") {
261
+ autoplayPlugin.stop();
262
+ scheduleResume(() => emblaApi.plugins().autoplay?.play());
263
+ }
264
+ };
265
+ emblaApi.on("autoplay:play", onPlay);
266
+ emblaApi.on("autoplay:stop", onStop);
267
+ emblaApi.on("autoplay:timerset", onTimerSet);
268
+ emblaApi.on("autoplay:timerstopped", onTimerStopped);
269
+ emblaApi.on("select", resetOnSelect);
270
+ if (resumeAfter > 0) emblaApi.on("autoplay:interaction", onInteraction);
271
+ if (autoplayEnabled) autoplayPlugin.play();
272
+ cleanupAutoplay = () => {
273
+ emblaApi.off("autoplay:play", onPlay);
274
+ emblaApi.off("autoplay:stop", onStop);
275
+ emblaApi.off("autoplay:timerset", onTimerSet);
276
+ emblaApi.off("autoplay:timerstopped", onTimerStopped);
277
+ emblaApi.off("select", resetOnSelect);
278
+ if (resumeAfter > 0) emblaApi.off("autoplay:interaction", onInteraction);
279
+ };
280
+ } else {
281
+ setAutoplayState(null);
282
+ }
283
+ let cleanupAutoScroll;
284
+ if (autoScrollPlugin && autoScrollEnabled && !autoplayEnabled) {
285
+ autoScrollPlugin.play();
286
+ const onInteraction = (_api, event) => {
287
+ if (event.detail.interaction === "pointerdown" || event.detail.interaction === "slidefocus") {
288
+ autoScrollPlugin.stop();
289
+ scheduleResume(() => emblaApi.plugins().autoScroll?.play());
290
+ }
291
+ };
292
+ if (resumeAfter > 0) {
293
+ emblaApi.on("autoscroll:interaction", onInteraction);
294
+ cleanupAutoScroll = () => emblaApi.off("autoscroll:interaction", onInteraction);
295
+ }
296
+ }
297
+ return () => {
298
+ emblaApi.off("reinit", handleReInit);
299
+ emblaApi.off("select", handleSelect);
300
+ emblaApi.off("scroll", handleScroll);
301
+ emblaApi.off("slidesinview", syncInView);
302
+ emblaApi.off("slideschanged", syncFull);
303
+ cleanupAutoplay?.();
304
+ cleanupAutoScroll?.();
305
+ clearResumeTimer();
306
+ };
307
+ }, [emblaApi, autoplayEnabled, autoScrollEnabled, resumeAfterMs]);
308
+ const scrollPrev = React.useCallback(() => emblaApi?.goToPrev(), [emblaApi]);
309
+ const scrollNext = React.useCallback(() => emblaApi?.goToNext(), [emblaApi]);
310
+ const scrollTo = React.useCallback((i) => emblaApi?.goTo(i), [emblaApi]);
311
+ const isAutoHeight = !!autoHeight;
312
+ const contextValue = React.useMemo(
313
+ () => ({
314
+ api: emblaApi,
315
+ viewportRef,
316
+ orientation,
317
+ direction,
318
+ light,
319
+ autoHeight: isAutoHeight,
320
+ loop,
321
+ reducedMotion,
322
+ selectedIndex: state.selectedIndex,
323
+ scrollSnaps: state.scrollSnaps,
324
+ canScrollPrev: state.canScrollPrev,
325
+ canScrollNext: state.canScrollNext,
326
+ subscribeScrollProgress,
327
+ getScrollProgress,
328
+ autoplay: autoplayState,
329
+ scrollPrev,
330
+ scrollNext,
331
+ scrollTo
332
+ }),
333
+ [
334
+ emblaApi,
335
+ viewportRef,
336
+ orientation,
337
+ direction,
338
+ light,
339
+ isAutoHeight,
340
+ loop,
341
+ reducedMotion,
342
+ state,
343
+ subscribeScrollProgress,
344
+ getScrollProgress,
345
+ autoplayState,
346
+ scrollPrev,
347
+ scrollNext,
348
+ scrollTo
349
+ ]
350
+ );
351
+ return /* @__PURE__ */ jsx(CarouselContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
352
+ "div",
353
+ {
354
+ "data-slot": "carousel",
355
+ "data-orientation": orientation,
356
+ role: "region",
357
+ "aria-roledescription": "carousel",
358
+ "aria-label": "Carousel",
359
+ className: cn("relative", className),
360
+ ...rest,
361
+ children
362
+ }
363
+ ) });
364
+ }
365
+ function CarouselContent({ className, children, ...rest }) {
366
+ const { viewportRef, orientation, autoHeight } = useCarousel();
367
+ return /* @__PURE__ */ jsx(
368
+ "div",
369
+ {
370
+ ref: viewportRef,
371
+ "data-slot": "carousel-viewport",
372
+ "data-orientation": orientation,
373
+ "data-auto-height": autoHeight || void 0,
374
+ className: cn(
375
+ "overflow-hidden",
376
+ autoHeight && "motion-safe:transition-[height] motion-safe:duration-300 motion-safe:ease-out"
377
+ ),
378
+ children: /* @__PURE__ */ jsx(
379
+ "div",
380
+ {
381
+ "data-slot": "carousel-content",
382
+ "data-orientation": orientation,
383
+ className: cn(
384
+ "flex",
385
+ orientation === "horizontal" ? "-ms-4 touch-pan-y touch-pinch-zoom items-start" : "-mt-4 h-full touch-pan-x touch-pinch-zoom flex-col",
386
+ className
387
+ ),
388
+ ...rest,
389
+ children
390
+ }
391
+ )
392
+ }
393
+ );
394
+ }
395
+ function CarouselSlide({ className, ...rest }) {
396
+ const { orientation } = useCarousel();
397
+ return /* @__PURE__ */ jsx(
398
+ "div",
399
+ {
400
+ "data-slot": "carousel-slide",
401
+ "data-orientation": orientation,
402
+ role: "group",
403
+ "aria-roledescription": "slide",
404
+ className: cn(
405
+ "min-h-0 min-w-0 shrink-0 grow-0 basis-full",
406
+ orientation === "horizontal" ? "ps-4" : "pt-4",
407
+ className
408
+ ),
409
+ ...rest
410
+ }
411
+ );
412
+ }
413
+ const PREV_POSITION_CLASSES = {
414
+ inside: cn(
415
+ "absolute z-10",
416
+ "data-[orientation=horizontal]:inset-s-4 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
417
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:top-4 data-[orientation=vertical]:-translate-x-1/2"
418
+ ),
419
+ outside: cn(
420
+ "absolute z-10",
421
+ "data-[orientation=horizontal]:-inset-s-14 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
422
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:-top-14 data-[orientation=vertical]:-translate-x-1/2"
423
+ ),
424
+ "outside-half": cn(
425
+ "absolute z-10",
426
+ "data-[orientation=horizontal]:inset-s-0 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
427
+ "data-[orientation=horizontal]:ltr:-translate-x-1/2 data-[orientation=horizontal]:rtl:translate-x-1/2",
428
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:top-0 data-[orientation=vertical]:-translate-x-1/2 data-[orientation=vertical]:-translate-y-1/2"
429
+ ),
430
+ none: ""
431
+ };
432
+ const NEXT_POSITION_CLASSES = {
433
+ inside: cn(
434
+ "absolute z-10",
435
+ "data-[orientation=horizontal]:inset-e-4 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
436
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:bottom-4 data-[orientation=vertical]:-translate-x-1/2"
437
+ ),
438
+ outside: cn(
439
+ "absolute z-10",
440
+ "data-[orientation=horizontal]:-inset-e-14 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
441
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:-bottom-14 data-[orientation=vertical]:-translate-x-1/2"
442
+ ),
443
+ "outside-half": cn(
444
+ "absolute z-10",
445
+ "data-[orientation=horizontal]:inset-e-0 data-[orientation=horizontal]:top-1/2 data-[orientation=horizontal]:-translate-y-1/2",
446
+ "data-[orientation=horizontal]:ltr:translate-x-1/2 data-[orientation=horizontal]:rtl:-translate-x-1/2",
447
+ "data-[orientation=vertical]:inset-s-1/2 data-[orientation=vertical]:bottom-0 data-[orientation=vertical]:-translate-x-1/2 data-[orientation=vertical]:translate-y-1/2"
448
+ ),
449
+ none: ""
450
+ };
451
+ function CarouselPrev({ className, position = "inside", disabled: disabledProp, render, ...props }) {
452
+ const { scrollPrev, canScrollPrev, orientation } = useCarousel();
453
+ const disabled = (disabledProp ?? false) || !canScrollPrev;
454
+ const state = { disabled, direction: "prev" };
455
+ const trigger = useRender({
456
+ defaultTagName: "button",
457
+ render,
458
+ state,
459
+ props: mergeProps(
460
+ {
461
+ type: "button",
462
+ "data-slot": "carousel-prev",
463
+ "data-disabled": disabled || void 0,
464
+ "aria-label": "Previous slide",
465
+ disabled,
466
+ onClick: scrollPrev,
467
+ suppressHydrationWarning: true
468
+ },
469
+ props
470
+ )
471
+ });
472
+ return /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ "data-slot": "carousel-prev-positioner",
476
+ "data-orientation": orientation,
477
+ className: cn(PREV_POSITION_CLASSES[position], className),
478
+ suppressHydrationWarning: true,
479
+ children: trigger
480
+ }
481
+ );
482
+ }
483
+ function CarouselNext({ className, position = "inside", disabled: disabledProp, render, ...props }) {
484
+ const { scrollNext, canScrollNext, orientation } = useCarousel();
485
+ const disabled = (disabledProp ?? false) || !canScrollNext;
486
+ const state = { disabled, direction: "next" };
487
+ const trigger = useRender({
488
+ defaultTagName: "button",
489
+ render,
490
+ state,
491
+ props: mergeProps(
492
+ {
493
+ type: "button",
494
+ "data-slot": "carousel-next",
495
+ "data-disabled": disabled || void 0,
496
+ "aria-label": "Next slide",
497
+ disabled,
498
+ onClick: scrollNext,
499
+ suppressHydrationWarning: true
500
+ },
501
+ props
502
+ )
503
+ });
504
+ return /* @__PURE__ */ jsx(
505
+ "div",
506
+ {
507
+ "data-slot": "carousel-next-positioner",
508
+ "data-orientation": orientation,
509
+ className: cn(NEXT_POSITION_CLASSES[position], className),
510
+ suppressHydrationWarning: true,
511
+ children: trigger
512
+ }
513
+ );
514
+ }
515
+ function CarouselPagination({
516
+ className,
517
+ orientation = "horizontal",
518
+ light: lightProp,
519
+ ...rest
520
+ }) {
521
+ const { scrollSnaps, selectedIndex, scrollTo, autoplay, reducedMotion, light: ctxLight } = useCarousel();
522
+ const light = lightProp ?? ctxLight;
523
+ if (scrollSnaps.length <= 1) return null;
524
+ const isHorizontal = orientation === "horizontal";
525
+ return /* @__PURE__ */ jsx(
526
+ "div",
527
+ {
528
+ "data-slot": "carousel-pagination",
529
+ "data-orientation": orientation,
530
+ role: "group",
531
+ "aria-label": "Choose slide to display",
532
+ className: cn("flex gap-2 data-[orientation=vertical]:flex-col", className),
533
+ ...rest,
534
+ children: scrollSnaps.map((_, index) => {
535
+ const isActive = index === selectedIndex;
536
+ const renderAutoplay = isActive && autoplay !== null && autoplay.isPlaying && !reducedMotion;
537
+ return /* @__PURE__ */ jsx(
538
+ "button",
539
+ {
540
+ type: "button",
541
+ "aria-current": isActive ? "true" : void 0,
542
+ "aria-label": `Go to slide ${index + 1}`,
543
+ "data-slot": "carousel-pagination-bullet",
544
+ "data-orientation": orientation,
545
+ "data-active": isActive || void 0,
546
+ "data-autoplay": renderAutoplay || void 0,
547
+ onClick: () => scrollTo(index),
548
+ className: cn(
549
+ "cursor-pointer rounded-full outline-offset-1",
550
+ isHorizontal ? "h-1.5" : "w-1.5",
551
+ light ? "outline-ring-light" : "outline-ring",
552
+ "motion-safe:transition-[width,height,background-color] motion-safe:duration-300",
553
+ !isActive && (light ? "bg-white/25" : "bg-border-strong"),
554
+ !isActive && (isHorizontal ? "w-1.5" : "h-1.5"),
555
+ isActive && !renderAutoplay && (light ? "bg-white" : "bg-primary"),
556
+ isActive && !renderAutoplay && (isHorizontal ? "w-5" : "h-5"),
557
+ renderAutoplay && "relative overflow-hidden",
558
+ renderAutoplay && (light ? "bg-white/25" : "bg-border-strong"),
559
+ renderAutoplay && (isHorizontal ? "w-10" : "h-10")
560
+ ),
561
+ children: renderAutoplay && autoplay ? /* @__PURE__ */ jsx(
562
+ CarouselAutoplayIndicator,
563
+ {
564
+ delay: autoplay.delay,
565
+ isPlaying: autoplay.isPlaying,
566
+ light,
567
+ orientation
568
+ },
569
+ autoplay.cycleId
570
+ ) : null
571
+ },
572
+ index
573
+ );
574
+ })
575
+ }
576
+ );
577
+ }
578
+ function CarouselAutoplayIndicator({ delay, isPlaying, light, orientation }) {
579
+ const [armed, setArmed] = React.useState(false);
580
+ React.useEffect(() => {
581
+ let raf2 = 0;
582
+ const raf1 = requestAnimationFrame(() => {
583
+ raf2 = requestAnimationFrame(() => setArmed(true));
584
+ });
585
+ return () => {
586
+ cancelAnimationFrame(raf1);
587
+ cancelAnimationFrame(raf2);
588
+ };
589
+ }, []);
590
+ const isHorizontal = orientation === "horizontal";
591
+ const fillValue = armed && isPlaying ? "100%" : "0%";
592
+ return /* @__PURE__ */ jsx(
593
+ "span",
594
+ {
595
+ "aria-hidden": "true",
596
+ "data-slot": "carousel-pagination-indicator",
597
+ "data-orientation": orientation,
598
+ "data-playing": isPlaying || void 0,
599
+ className: cn(
600
+ "absolute rounded-full",
601
+ isHorizontal ? "inset-y-0 inset-s-0" : "inset-x-0 top-0",
602
+ isHorizontal ? "motion-safe:transition-[width]" : "motion-safe:transition-[height]",
603
+ "motion-safe:ease-linear",
604
+ light ? "bg-white" : "bg-primary"
605
+ ),
606
+ style: {
607
+ transitionDuration: `${delay}ms`,
608
+ width: isHorizontal ? fillValue : void 0,
609
+ height: isHorizontal ? void 0 : fillValue
610
+ }
611
+ }
612
+ );
613
+ }
614
+ const CAROUSEL_PROGRESS_CIRCULAR_VIEWBOX = 40;
615
+ const CAROUSEL_PROGRESS_CIRCULAR_THICKNESS = 4;
616
+ const CAROUSEL_PROGRESS_CIRCULAR_RADIUS = (CAROUSEL_PROGRESS_CIRCULAR_VIEWBOX - CAROUSEL_PROGRESS_CIRCULAR_THICKNESS) / 2;
617
+ const CAROUSEL_PROGRESS_CIRCULAR_CIRCUMFERENCE = 2 * Math.PI * CAROUSEL_PROGRESS_CIRCULAR_RADIUS;
618
+ function CarouselProgress({
619
+ source = "auto",
620
+ variant = "bar",
621
+ orientation = "horizontal",
622
+ light: lightProp,
623
+ className,
624
+ ...rest
625
+ }) {
626
+ const { subscribeScrollProgress, getScrollProgress, autoplay, reducedMotion, light: ctxLight } = useCarousel();
627
+ const scrollProgress = React.useSyncExternalStore(subscribeScrollProgress, getScrollProgress, getScrollProgress);
628
+ const light = lightProp ?? ctxLight;
629
+ const resolvedSource = source === "auto" ? autoplay && autoplay.isPlaying ? "autoplay" : "scroll" : source;
630
+ const showAutoplay = resolvedSource === "autoplay" && autoplay !== null && !reducedMotion;
631
+ if (variant === "circular") {
632
+ const center = CAROUSEL_PROGRESS_CIRCULAR_VIEWBOX / 2;
633
+ const offset = CAROUSEL_PROGRESS_CIRCULAR_CIRCUMFERENCE * (1 - scrollProgress);
634
+ return /* @__PURE__ */ jsx(
635
+ "div",
636
+ {
637
+ "data-slot": "carousel-progress",
638
+ "data-variant": "circular",
639
+ "data-source": resolvedSource,
640
+ "data-light": light || void 0,
641
+ className: cn("relative size-10", className),
642
+ ...rest,
643
+ children: /* @__PURE__ */ jsxs(
644
+ "svg",
645
+ {
646
+ "aria-hidden": "true",
647
+ viewBox: `0 0 ${CAROUSEL_PROGRESS_CIRCULAR_VIEWBOX} ${CAROUSEL_PROGRESS_CIRCULAR_VIEWBOX}`,
648
+ className: "size-full -rotate-90 overflow-visible",
649
+ children: [
650
+ /* @__PURE__ */ jsx(
651
+ "circle",
652
+ {
653
+ "data-slot": "carousel-progress-track",
654
+ cx: center,
655
+ cy: center,
656
+ r: CAROUSEL_PROGRESS_CIRCULAR_RADIUS,
657
+ fill: "none",
658
+ strokeWidth: CAROUSEL_PROGRESS_CIRCULAR_THICKNESS,
659
+ className: light ? "stroke-white/25" : "stroke-border-strong"
660
+ }
661
+ ),
662
+ showAutoplay && autoplay ? /* @__PURE__ */ jsx(
663
+ CarouselAutoplayCircularIndicator,
664
+ {
665
+ delay: autoplay.delay,
666
+ isPlaying: autoplay.isPlaying,
667
+ light,
668
+ center,
669
+ radius: CAROUSEL_PROGRESS_CIRCULAR_RADIUS,
670
+ circumference: CAROUSEL_PROGRESS_CIRCULAR_CIRCUMFERENCE,
671
+ thickness: CAROUSEL_PROGRESS_CIRCULAR_THICKNESS
672
+ },
673
+ autoplay.cycleId
674
+ ) : /* @__PURE__ */ jsx(
675
+ "circle",
676
+ {
677
+ "data-slot": "carousel-progress-indicator",
678
+ cx: center,
679
+ cy: center,
680
+ r: CAROUSEL_PROGRESS_CIRCULAR_RADIUS,
681
+ fill: "none",
682
+ strokeWidth: CAROUSEL_PROGRESS_CIRCULAR_THICKNESS,
683
+ strokeLinecap: "round",
684
+ strokeDasharray: CAROUSEL_PROGRESS_CIRCULAR_CIRCUMFERENCE,
685
+ strokeDashoffset: offset,
686
+ className: light ? "stroke-white" : "stroke-primary"
687
+ }
688
+ )
689
+ ]
690
+ }
691
+ )
692
+ }
693
+ );
694
+ }
695
+ const isHorizontal = orientation === "horizontal";
696
+ return /* @__PURE__ */ jsx(
697
+ "div",
698
+ {
699
+ "data-slot": "carousel-progress",
700
+ "data-variant": "bar",
701
+ "data-orientation": orientation,
702
+ "data-source": resolvedSource,
703
+ "data-light": light || void 0,
704
+ className: cn(
705
+ "relative overflow-hidden rounded-full",
706
+ isHorizontal ? "h-1.5 w-full" : "h-full w-1.5",
707
+ light ? "bg-white/25" : "bg-border-strong",
708
+ className
709
+ ),
710
+ ...rest,
711
+ children: showAutoplay && autoplay ? /* @__PURE__ */ jsx(
712
+ CarouselAutoplayIndicator,
713
+ {
714
+ delay: autoplay.delay,
715
+ isPlaying: autoplay.isPlaying,
716
+ light,
717
+ orientation
718
+ },
719
+ autoplay.cycleId
720
+ ) : /* @__PURE__ */ jsx(
721
+ "span",
722
+ {
723
+ "aria-hidden": "true",
724
+ "data-slot": "carousel-progress-indicator",
725
+ "data-orientation": orientation,
726
+ className: cn("block rounded-full", isHorizontal ? "h-full" : "w-full", light ? "bg-white" : "bg-primary"),
727
+ style: isHorizontal ? { width: `${scrollProgress * 100}%` } : { height: `${scrollProgress * 100}%` }
728
+ }
729
+ )
730
+ }
731
+ );
732
+ }
733
+ function CarouselAutoplayCircularIndicator({
734
+ delay,
735
+ isPlaying,
736
+ light,
737
+ center,
738
+ radius,
739
+ circumference,
740
+ thickness
741
+ }) {
742
+ const [armed, setArmed] = React.useState(false);
743
+ React.useEffect(() => {
744
+ let raf2 = 0;
745
+ const raf1 = requestAnimationFrame(() => {
746
+ raf2 = requestAnimationFrame(() => setArmed(true));
747
+ });
748
+ return () => {
749
+ cancelAnimationFrame(raf1);
750
+ cancelAnimationFrame(raf2);
751
+ };
752
+ }, []);
753
+ const offset = armed && isPlaying ? 0 : circumference;
754
+ return /* @__PURE__ */ jsx(
755
+ "circle",
756
+ {
757
+ "data-slot": "carousel-progress-indicator",
758
+ "data-playing": isPlaying || void 0,
759
+ cx: center,
760
+ cy: center,
761
+ r: radius,
762
+ fill: "none",
763
+ strokeWidth: thickness,
764
+ strokeLinecap: "round",
765
+ strokeDasharray: circumference,
766
+ strokeDashoffset: offset,
767
+ className: cn(
768
+ "motion-safe:transition-[stroke-dashoffset] motion-safe:ease-linear",
769
+ light ? "stroke-white" : "stroke-primary"
770
+ ),
771
+ style: { transitionDuration: `${delay}ms` }
772
+ }
773
+ );
774
+ }
775
+ function useLinkedCarousels(mainApi, thumbsApi) {
776
+ React.useEffect(() => {
777
+ if (!mainApi || !thumbsApi) return;
778
+ const syncThumbsFromMain = () => {
779
+ thumbsApi.goTo(mainApi.selectedSnap());
780
+ };
781
+ const syncMainFromThumbs = () => {
782
+ mainApi.goTo(thumbsApi.selectedSnap());
783
+ };
784
+ syncThumbsFromMain();
785
+ mainApi.on("select", syncThumbsFromMain);
786
+ thumbsApi.on("select", syncMainFromThumbs);
787
+ return () => {
788
+ mainApi.off("select", syncThumbsFromMain);
789
+ thumbsApi.off("select", syncMainFromThumbs);
790
+ };
791
+ }, [mainApi, thumbsApi]);
792
+ }
793
+
794
+ export { Carousel, CarouselContent, CarouselNext, CarouselPagination, CarouselPrev, CarouselProgress, CarouselSlide, useCarousel, useLinkedCarousels };
795
+ //# sourceMappingURL=carousel.js.map