@beautinique/frontend-components 1.0.7 → 1.0.9

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 (472) hide show
  1. package/README.md +389 -14
  2. package/dist/auth/AuthBottomInstructions.d.cts +42 -0
  3. package/dist/auth/AuthBottomInstructions.d.cts.map +1 -0
  4. package/dist/auth/AuthBottomInstructions.d.ts +42 -0
  5. package/dist/auth/AuthBottomInstructions.d.ts.map +1 -0
  6. package/dist/auth/SocialAuth.d.cts +33 -0
  7. package/dist/auth/SocialAuth.d.cts.map +1 -0
  8. package/dist/auth/SocialAuth.d.ts +33 -0
  9. package/dist/auth/SocialAuth.d.ts.map +1 -0
  10. package/dist/auth/index.cjs +84 -0
  11. package/dist/auth/index.cjs.map +1 -0
  12. package/dist/auth/index.d.cts +3 -0
  13. package/dist/auth/index.d.cts.map +1 -0
  14. package/dist/auth/index.d.ts +3 -0
  15. package/dist/auth/index.d.ts.map +1 -0
  16. package/dist/auth/index.js +81 -0
  17. package/dist/auth/index.js.map +1 -0
  18. package/dist/breadcrumb/Breadcrumb.d.cts +34 -0
  19. package/dist/breadcrumb/Breadcrumb.d.cts.map +1 -0
  20. package/dist/breadcrumb/Breadcrumb.d.ts +34 -0
  21. package/dist/breadcrumb/Breadcrumb.d.ts.map +1 -0
  22. package/dist/breadcrumb/breadcrumb-icons.d.cts +6 -0
  23. package/dist/breadcrumb/breadcrumb-icons.d.cts.map +1 -0
  24. package/dist/breadcrumb/breadcrumb-icons.d.ts +6 -0
  25. package/dist/breadcrumb/breadcrumb-icons.d.ts.map +1 -0
  26. package/dist/breadcrumb/getBreadcrumbItems.d.cts +16 -0
  27. package/dist/breadcrumb/getBreadcrumbItems.d.cts.map +1 -0
  28. package/dist/breadcrumb/getBreadcrumbItems.d.ts +16 -0
  29. package/dist/breadcrumb/getBreadcrumbItems.d.ts.map +1 -0
  30. package/dist/breadcrumb/index.cjs +110 -0
  31. package/dist/breadcrumb/index.cjs.map +1 -0
  32. package/dist/breadcrumb/index.d.cts +3 -0
  33. package/dist/breadcrumb/index.d.cts.map +1 -0
  34. package/dist/breadcrumb/index.d.ts +3 -0
  35. package/dist/breadcrumb/index.d.ts.map +1 -0
  36. package/dist/breadcrumb/index.js +107 -0
  37. package/dist/breadcrumb/index.js.map +1 -0
  38. package/dist/color-input/ColorInput.d.cts +33 -0
  39. package/dist/color-input/ColorInput.d.cts.map +1 -0
  40. package/dist/color-input/ColorInput.d.ts +33 -0
  41. package/dist/color-input/ColorInput.d.ts.map +1 -0
  42. package/dist/color-input/color-input-icons.d.cts +6 -0
  43. package/dist/color-input/color-input-icons.d.cts.map +1 -0
  44. package/dist/color-input/color-input-icons.d.ts +6 -0
  45. package/dist/color-input/color-input-icons.d.ts.map +1 -0
  46. package/dist/color-input/color.d.cts +10 -0
  47. package/dist/color-input/color.d.cts.map +1 -0
  48. package/dist/color-input/color.d.ts +10 -0
  49. package/dist/color-input/color.d.ts.map +1 -0
  50. package/dist/color-input/index.cjs +375 -0
  51. package/dist/color-input/index.cjs.map +1 -0
  52. package/dist/color-input/index.d.cts +2 -0
  53. package/dist/color-input/index.d.cts.map +1 -0
  54. package/dist/color-input/index.d.ts +2 -0
  55. package/dist/color-input/index.d.ts.map +1 -0
  56. package/dist/color-input/index.js +373 -0
  57. package/dist/color-input/index.js.map +1 -0
  58. package/dist/file-input/FileInput.d.cts +53 -0
  59. package/dist/file-input/FileInput.d.cts.map +1 -0
  60. package/dist/file-input/FileInput.d.ts +53 -0
  61. package/dist/file-input/FileInput.d.ts.map +1 -0
  62. package/dist/file-input/file-input-icons.d.cts +6 -0
  63. package/dist/file-input/file-input-icons.d.cts.map +1 -0
  64. package/dist/file-input/file-input-icons.d.ts +6 -0
  65. package/dist/file-input/file-input-icons.d.ts.map +1 -0
  66. package/dist/file-input/index.cjs +259 -0
  67. package/dist/file-input/index.cjs.map +1 -0
  68. package/dist/file-input/index.d.cts +3 -0
  69. package/dist/file-input/index.d.cts.map +1 -0
  70. package/dist/file-input/index.d.ts +3 -0
  71. package/dist/file-input/index.d.ts.map +1 -0
  72. package/dist/file-input/index.js +256 -0
  73. package/dist/file-input/index.js.map +1 -0
  74. package/dist/file-input/media-type.d.cts +8 -0
  75. package/dist/file-input/media-type.d.cts.map +1 -0
  76. package/dist/file-input/media-type.d.ts +8 -0
  77. package/dist/file-input/media-type.d.ts.map +1 -0
  78. package/dist/file-input/useObjectUrls.d.cts +10 -0
  79. package/dist/file-input/useObjectUrls.d.cts.map +1 -0
  80. package/dist/file-input/useObjectUrls.d.ts +10 -0
  81. package/dist/file-input/useObjectUrls.d.ts.map +1 -0
  82. package/dist/hierarchy-select/HierarchySelect.d.cts +58 -0
  83. package/dist/hierarchy-select/HierarchySelect.d.cts.map +1 -0
  84. package/dist/hierarchy-select/HierarchySelect.d.ts +58 -0
  85. package/dist/hierarchy-select/HierarchySelect.d.ts.map +1 -0
  86. package/dist/hierarchy-select/hierarchy-select-icons.d.cts +6 -0
  87. package/dist/hierarchy-select/hierarchy-select-icons.d.cts.map +1 -0
  88. package/dist/hierarchy-select/hierarchy-select-icons.d.ts +6 -0
  89. package/dist/hierarchy-select/hierarchy-select-icons.d.ts.map +1 -0
  90. package/dist/hierarchy-select/index.cjs +596 -0
  91. package/dist/hierarchy-select/index.cjs.map +1 -0
  92. package/dist/hierarchy-select/index.d.cts +2 -0
  93. package/dist/hierarchy-select/index.d.cts.map +1 -0
  94. package/dist/hierarchy-select/index.d.ts +2 -0
  95. package/dist/hierarchy-select/index.d.ts.map +1 -0
  96. package/dist/hierarchy-select/index.js +594 -0
  97. package/dist/hierarchy-select/index.js.map +1 -0
  98. package/dist/hierarchy-select/tree.d.cts +38 -0
  99. package/dist/hierarchy-select/tree.d.cts.map +1 -0
  100. package/dist/hierarchy-select/tree.d.ts +38 -0
  101. package/dist/hierarchy-select/tree.d.ts.map +1 -0
  102. package/dist/index.cjs +21 -0
  103. package/dist/index.d.cts +3 -0
  104. package/dist/index.d.cts.map +1 -1
  105. package/dist/index.d.ts +3 -0
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +3 -0
  108. package/dist/inputs/Checkbox.d.cts +21 -0
  109. package/dist/inputs/Checkbox.d.cts.map +1 -0
  110. package/dist/inputs/Checkbox.d.ts +21 -0
  111. package/dist/inputs/Checkbox.d.ts.map +1 -0
  112. package/dist/inputs/Input.d.cts +26 -0
  113. package/dist/inputs/Input.d.cts.map +1 -0
  114. package/dist/inputs/Input.d.ts +26 -0
  115. package/dist/inputs/Input.d.ts.map +1 -0
  116. package/dist/inputs/InputError.d.cts +11 -0
  117. package/dist/inputs/InputError.d.cts.map +1 -0
  118. package/dist/inputs/InputError.d.ts +11 -0
  119. package/dist/inputs/InputError.d.ts.map +1 -0
  120. package/dist/inputs/InputIcon.d.cts +9 -0
  121. package/dist/inputs/InputIcon.d.cts.map +1 -0
  122. package/dist/inputs/InputIcon.d.ts +9 -0
  123. package/dist/inputs/InputIcon.d.ts.map +1 -0
  124. package/dist/inputs/InputLabel.d.cts +8 -0
  125. package/dist/inputs/InputLabel.d.cts.map +1 -0
  126. package/dist/inputs/InputLabel.d.ts +8 -0
  127. package/dist/inputs/InputLabel.d.ts.map +1 -0
  128. package/dist/inputs/Radio.d.cts +25 -0
  129. package/dist/inputs/Radio.d.cts.map +1 -0
  130. package/dist/inputs/Radio.d.ts +25 -0
  131. package/dist/inputs/Radio.d.ts.map +1 -0
  132. package/dist/inputs/Select.d.cts +53 -0
  133. package/dist/inputs/Select.d.cts.map +1 -0
  134. package/dist/inputs/Select.d.ts +53 -0
  135. package/dist/inputs/Select.d.ts.map +1 -0
  136. package/dist/inputs/Textarea.d.cts +19 -0
  137. package/dist/inputs/Textarea.d.cts.map +1 -0
  138. package/dist/inputs/Textarea.d.ts +19 -0
  139. package/dist/inputs/Textarea.d.ts.map +1 -0
  140. package/dist/inputs/index.cjs +746 -0
  141. package/dist/inputs/index.cjs.map +1 -0
  142. package/dist/inputs/index.d.cts +10 -0
  143. package/dist/inputs/index.d.cts.map +1 -0
  144. package/dist/inputs/index.d.ts +10 -0
  145. package/dist/inputs/index.d.ts.map +1 -0
  146. package/dist/inputs/index.js +737 -0
  147. package/dist/inputs/index.js.map +1 -0
  148. package/dist/inputs/inputs-icons.d.cts +6 -0
  149. package/dist/inputs/inputs-icons.d.cts.map +1 -0
  150. package/dist/inputs/inputs-icons.d.ts +6 -0
  151. package/dist/inputs/inputs-icons.d.ts.map +1 -0
  152. package/dist/inputs/types.d.cts +48 -0
  153. package/dist/inputs/types.d.cts.map +1 -0
  154. package/dist/inputs/types.d.ts +48 -0
  155. package/dist/inputs/types.d.ts.map +1 -0
  156. package/dist/inputs/useFieldIds.d.cts +24 -0
  157. package/dist/inputs/useFieldIds.d.cts.map +1 -0
  158. package/dist/inputs/useFieldIds.d.ts +24 -0
  159. package/dist/inputs/useFieldIds.d.ts.map +1 -0
  160. package/dist/layout/ApiStatus.d.cts +20 -0
  161. package/dist/layout/ApiStatus.d.cts.map +1 -0
  162. package/dist/layout/ApiStatus.d.ts +20 -0
  163. package/dist/layout/ApiStatus.d.ts.map +1 -0
  164. package/dist/layout/BorderGradient.d.cts +11 -0
  165. package/dist/layout/BorderGradient.d.cts.map +1 -0
  166. package/dist/layout/BorderGradient.d.ts +11 -0
  167. package/dist/layout/BorderGradient.d.ts.map +1 -0
  168. package/dist/layout/ConfirmModal.d.cts +44 -0
  169. package/dist/layout/ConfirmModal.d.cts.map +1 -0
  170. package/dist/layout/ConfirmModal.d.ts +44 -0
  171. package/dist/layout/ConfirmModal.d.ts.map +1 -0
  172. package/dist/layout/Dropdown.d.cts +33 -0
  173. package/dist/layout/Dropdown.d.cts.map +1 -0
  174. package/dist/layout/Dropdown.d.ts +33 -0
  175. package/dist/layout/Dropdown.d.ts.map +1 -0
  176. package/dist/layout/LoadingPage.d.cts +11 -0
  177. package/dist/layout/LoadingPage.d.cts.map +1 -0
  178. package/dist/layout/LoadingPage.d.ts +11 -0
  179. package/dist/layout/LoadingPage.d.ts.map +1 -0
  180. package/dist/layout/LoadingRings.d.cts +12 -0
  181. package/dist/layout/LoadingRings.d.cts.map +1 -0
  182. package/dist/layout/LoadingRings.d.ts +12 -0
  183. package/dist/layout/LoadingRings.d.ts.map +1 -0
  184. package/dist/layout/LoadingText.d.cts +13 -0
  185. package/dist/layout/LoadingText.d.cts.map +1 -0
  186. package/dist/layout/LoadingText.d.ts +13 -0
  187. package/dist/layout/LoadingText.d.ts.map +1 -0
  188. package/dist/layout/ModalWrapper.d.cts +48 -0
  189. package/dist/layout/ModalWrapper.d.cts.map +1 -0
  190. package/dist/layout/ModalWrapper.d.ts +48 -0
  191. package/dist/layout/ModalWrapper.d.ts.map +1 -0
  192. package/dist/layout/NetworkStatusToaster.d.cts +39 -0
  193. package/dist/layout/NetworkStatusToaster.d.cts.map +1 -0
  194. package/dist/layout/NetworkStatusToaster.d.ts +39 -0
  195. package/dist/layout/NetworkStatusToaster.d.ts.map +1 -0
  196. package/dist/layout/ScrollToTop.d.cts +36 -0
  197. package/dist/layout/ScrollToTop.d.cts.map +1 -0
  198. package/dist/layout/ScrollToTop.d.ts +36 -0
  199. package/dist/layout/ScrollToTop.d.ts.map +1 -0
  200. package/dist/layout/ScrollableGradientContainer.d.cts +28 -0
  201. package/dist/layout/ScrollableGradientContainer.d.cts.map +1 -0
  202. package/dist/layout/ScrollableGradientContainer.d.ts +28 -0
  203. package/dist/layout/ScrollableGradientContainer.d.ts.map +1 -0
  204. package/dist/layout/Skeleton.d.cts +9 -0
  205. package/dist/layout/Skeleton.d.cts.map +1 -0
  206. package/dist/layout/Skeleton.d.ts +9 -0
  207. package/dist/layout/Skeleton.d.ts.map +1 -0
  208. package/dist/layout/Table.d.cts +9 -0
  209. package/dist/layout/Table.d.cts.map +1 -0
  210. package/dist/layout/Table.d.ts +9 -0
  211. package/dist/layout/Table.d.ts.map +1 -0
  212. package/dist/layout/index.cjs +773 -0
  213. package/dist/layout/index.cjs.map +1 -0
  214. package/dist/layout/index.d.cts +14 -0
  215. package/dist/layout/index.d.cts.map +1 -0
  216. package/dist/layout/index.d.ts +14 -0
  217. package/dist/layout/index.d.ts.map +1 -0
  218. package/dist/layout/index.js +753 -0
  219. package/dist/layout/index.js.map +1 -0
  220. package/dist/layout/layout-icons.d.cts +6 -0
  221. package/dist/layout/layout-icons.d.cts.map +1 -0
  222. package/dist/layout/layout-icons.d.ts +6 -0
  223. package/dist/layout/layout-icons.d.ts.map +1 -0
  224. package/dist/lib/content.d.cts +7 -0
  225. package/dist/lib/content.d.cts.map +1 -0
  226. package/dist/lib/content.d.ts +7 -0
  227. package/dist/lib/content.d.ts.map +1 -0
  228. package/dist/lib/countdown.d.cts +13 -0
  229. package/dist/lib/countdown.d.cts.map +1 -0
  230. package/dist/lib/countdown.d.ts +13 -0
  231. package/dist/lib/countdown.d.ts.map +1 -0
  232. package/dist/lib/dropdown-position.d.cts +33 -0
  233. package/dist/lib/dropdown-position.d.cts.map +1 -0
  234. package/dist/lib/dropdown-position.d.ts +33 -0
  235. package/dist/lib/dropdown-position.d.ts.map +1 -0
  236. package/dist/lib/focus.d.cts +3 -0
  237. package/dist/lib/focus.d.cts.map +1 -0
  238. package/dist/lib/focus.d.ts +3 -0
  239. package/dist/lib/focus.d.ts.map +1 -0
  240. package/dist/lib/icon-registry.d.cts +14 -0
  241. package/dist/lib/icon-registry.d.cts.map +1 -0
  242. package/dist/lib/icon-registry.d.ts +14 -0
  243. package/dist/lib/icon-registry.d.ts.map +1 -0
  244. package/dist/lib/mergeRefs.d.cts +10 -0
  245. package/dist/lib/mergeRefs.d.cts.map +1 -0
  246. package/dist/lib/mergeRefs.d.ts +10 -0
  247. package/dist/lib/mergeRefs.d.ts.map +1 -0
  248. package/dist/lib/scrollRowIntoView.d.cts +7 -0
  249. package/dist/lib/scrollRowIntoView.d.cts.map +1 -0
  250. package/dist/lib/scrollRowIntoView.d.ts +7 -0
  251. package/dist/lib/scrollRowIntoView.d.ts.map +1 -0
  252. package/dist/lib/stepper.d.cts +9 -0
  253. package/dist/lib/stepper.d.cts.map +1 -0
  254. package/dist/lib/stepper.d.ts +9 -0
  255. package/dist/lib/stepper.d.ts.map +1 -0
  256. package/dist/lib/typeahead.d.cts +21 -0
  257. package/dist/lib/typeahead.d.cts.map +1 -0
  258. package/dist/lib/typeahead.d.ts +21 -0
  259. package/dist/lib/typeahead.d.ts.map +1 -0
  260. package/dist/lib/useAnchoredBox.d.cts +26 -0
  261. package/dist/lib/useAnchoredBox.d.cts.map +1 -0
  262. package/dist/lib/useAnchoredBox.d.ts +26 -0
  263. package/dist/lib/useAnchoredBox.d.ts.map +1 -0
  264. package/dist/lib/useDismiss.d.cts +34 -0
  265. package/dist/lib/useDismiss.d.cts.map +1 -0
  266. package/dist/lib/useDismiss.d.ts +34 -0
  267. package/dist/lib/useDismiss.d.ts.map +1 -0
  268. package/dist/lib/useFocusTrap.d.cts +24 -0
  269. package/dist/lib/useFocusTrap.d.cts.map +1 -0
  270. package/dist/lib/useFocusTrap.d.ts +24 -0
  271. package/dist/lib/useFocusTrap.d.ts.map +1 -0
  272. package/dist/lib/useIsClient.d.cts +7 -0
  273. package/dist/lib/useIsClient.d.cts.map +1 -0
  274. package/dist/lib/useIsClient.d.ts +7 -0
  275. package/dist/lib/useIsClient.d.ts.map +1 -0
  276. package/dist/lib/usePrefersReducedMotion.d.cts +7 -0
  277. package/dist/lib/usePrefersReducedMotion.d.cts.map +1 -0
  278. package/dist/lib/usePrefersReducedMotion.d.ts +7 -0
  279. package/dist/lib/usePrefersReducedMotion.d.ts.map +1 -0
  280. package/dist/lib/useScrollLock.d.cts +7 -0
  281. package/dist/lib/useScrollLock.d.cts.map +1 -0
  282. package/dist/lib/useScrollLock.d.ts +7 -0
  283. package/dist/lib/useScrollLock.d.ts.map +1 -0
  284. package/dist/lib/useScrollable.d.cts +17 -0
  285. package/dist/lib/useScrollable.d.cts.map +1 -0
  286. package/dist/lib/useScrollable.d.ts +17 -0
  287. package/dist/lib/useScrollable.d.ts.map +1 -0
  288. package/dist/linear-gradient/LinearGradient.d.cts +13 -0
  289. package/dist/linear-gradient/LinearGradient.d.cts.map +1 -0
  290. package/dist/linear-gradient/LinearGradient.d.ts +13 -0
  291. package/dist/linear-gradient/LinearGradient.d.ts.map +1 -0
  292. package/dist/linear-gradient/index.cjs +25 -0
  293. package/dist/linear-gradient/index.cjs.map +1 -0
  294. package/dist/linear-gradient/index.d.cts +2 -0
  295. package/dist/linear-gradient/index.d.cts.map +1 -0
  296. package/dist/linear-gradient/index.d.ts +2 -0
  297. package/dist/linear-gradient/index.d.ts.map +1 -0
  298. package/dist/linear-gradient/index.js +23 -0
  299. package/dist/linear-gradient/index.js.map +1 -0
  300. package/dist/loading-screen/LoadingScreen.d.cts +21 -0
  301. package/dist/loading-screen/LoadingScreen.d.cts.map +1 -0
  302. package/dist/loading-screen/LoadingScreen.d.ts +21 -0
  303. package/dist/loading-screen/LoadingScreen.d.ts.map +1 -0
  304. package/dist/loading-screen/Teddy.d.cts +10 -0
  305. package/dist/loading-screen/Teddy.d.cts.map +1 -0
  306. package/dist/loading-screen/Teddy.d.ts +10 -0
  307. package/dist/loading-screen/Teddy.d.ts.map +1 -0
  308. package/dist/loading-screen/WakeUpProgress.d.cts +16 -0
  309. package/dist/loading-screen/WakeUpProgress.d.cts.map +1 -0
  310. package/dist/loading-screen/WakeUpProgress.d.ts +16 -0
  311. package/dist/loading-screen/WakeUpProgress.d.ts.map +1 -0
  312. package/dist/loading-screen/beauty-facts.d.cts +4 -0
  313. package/dist/loading-screen/beauty-facts.d.cts.map +1 -0
  314. package/dist/loading-screen/beauty-facts.d.ts +4 -0
  315. package/dist/loading-screen/beauty-facts.d.ts.map +1 -0
  316. package/dist/loading-screen/index.cjs +405 -0
  317. package/dist/loading-screen/index.cjs.map +1 -0
  318. package/dist/loading-screen/index.d.cts +5 -0
  319. package/dist/loading-screen/index.d.cts.map +1 -0
  320. package/dist/loading-screen/index.d.ts +5 -0
  321. package/dist/loading-screen/index.d.ts.map +1 -0
  322. package/dist/loading-screen/index.js +400 -0
  323. package/dist/loading-screen/index.js.map +1 -0
  324. package/dist/loading-screen/loading-screen-icons.d.cts +6 -0
  325. package/dist/loading-screen/loading-screen-icons.d.cts.map +1 -0
  326. package/dist/loading-screen/loading-screen-icons.d.ts +6 -0
  327. package/dist/loading-screen/loading-screen-icons.d.ts.map +1 -0
  328. package/dist/media/MediaCarousel.d.cts +30 -0
  329. package/dist/media/MediaCarousel.d.cts.map +1 -0
  330. package/dist/media/MediaCarousel.d.ts +30 -0
  331. package/dist/media/MediaCarousel.d.ts.map +1 -0
  332. package/dist/media/MediaCarouselWithModal.d.cts +17 -0
  333. package/dist/media/MediaCarouselWithModal.d.cts.map +1 -0
  334. package/dist/media/MediaCarouselWithModal.d.ts +17 -0
  335. package/dist/media/MediaCarouselWithModal.d.ts.map +1 -0
  336. package/dist/media/MediaCarouselWithParentMedia.d.cts +30 -0
  337. package/dist/media/MediaCarouselWithParentMedia.d.cts.map +1 -0
  338. package/dist/media/MediaCarouselWithParentMedia.d.ts +30 -0
  339. package/dist/media/MediaCarouselWithParentMedia.d.ts.map +1 -0
  340. package/dist/media/MediaModal.d.cts +27 -0
  341. package/dist/media/MediaModal.d.cts.map +1 -0
  342. package/dist/media/MediaModal.d.ts +27 -0
  343. package/dist/media/MediaModal.d.ts.map +1 -0
  344. package/dist/media/VideoPlayer.d.cts +37 -0
  345. package/dist/media/VideoPlayer.d.cts.map +1 -0
  346. package/dist/media/VideoPlayer.d.ts +37 -0
  347. package/dist/media/VideoPlayer.d.ts.map +1 -0
  348. package/dist/media/captureVideoPoster.d.cts +20 -0
  349. package/dist/media/captureVideoPoster.d.cts.map +1 -0
  350. package/dist/media/captureVideoPoster.d.ts +20 -0
  351. package/dist/media/captureVideoPoster.d.ts.map +1 -0
  352. package/dist/media/index.cjs +613 -0
  353. package/dist/media/index.cjs.map +1 -0
  354. package/dist/media/index.d.cts +8 -0
  355. package/dist/media/index.d.cts.map +1 -0
  356. package/dist/media/index.d.ts +8 -0
  357. package/dist/media/index.d.ts.map +1 -0
  358. package/dist/media/index.js +605 -0
  359. package/dist/media/index.js.map +1 -0
  360. package/dist/media/labels.d.cts +33 -0
  361. package/dist/media/labels.d.cts.map +1 -0
  362. package/dist/media/labels.d.ts +33 -0
  363. package/dist/media/labels.d.ts.map +1 -0
  364. package/dist/media/media-icons.d.cts +6 -0
  365. package/dist/media/media-icons.d.cts.map +1 -0
  366. package/dist/media/media-icons.d.ts +6 -0
  367. package/dist/media/media-icons.d.ts.map +1 -0
  368. package/dist/media/streaming.d.cts +18 -0
  369. package/dist/media/streaming.d.cts.map +1 -0
  370. package/dist/media/streaming.d.ts +18 -0
  371. package/dist/media/streaming.d.ts.map +1 -0
  372. package/dist/resend/Resend.d.cts +37 -0
  373. package/dist/resend/Resend.d.cts.map +1 -0
  374. package/dist/resend/Resend.d.ts +37 -0
  375. package/dist/resend/Resend.d.ts.map +1 -0
  376. package/dist/resend/index.cjs +115 -0
  377. package/dist/resend/index.cjs.map +1 -0
  378. package/dist/resend/index.d.cts +2 -0
  379. package/dist/resend/index.d.cts.map +1 -0
  380. package/dist/resend/index.d.ts +2 -0
  381. package/dist/resend/index.d.ts.map +1 -0
  382. package/dist/resend/index.js +113 -0
  383. package/dist/resend/index.js.map +1 -0
  384. package/dist/static-page/StaticPage.d.cts +91 -0
  385. package/dist/static-page/StaticPage.d.cts.map +1 -0
  386. package/dist/static-page/StaticPage.d.ts +91 -0
  387. package/dist/static-page/StaticPage.d.ts.map +1 -0
  388. package/dist/static-page/index.cjs +247 -0
  389. package/dist/static-page/index.cjs.map +1 -0
  390. package/dist/static-page/index.d.cts +2 -0
  391. package/dist/static-page/index.d.cts.map +1 -0
  392. package/dist/static-page/index.d.ts +2 -0
  393. package/dist/static-page/index.d.ts.map +1 -0
  394. package/dist/static-page/index.js +235 -0
  395. package/dist/static-page/index.js.map +1 -0
  396. package/dist/static-page/static-page-icons.d.cts +6 -0
  397. package/dist/static-page/static-page-icons.d.cts.map +1 -0
  398. package/dist/static-page/static-page-icons.d.ts +6 -0
  399. package/dist/static-page/static-page-icons.d.ts.map +1 -0
  400. package/dist/stepper/Stepper.d.cts +35 -0
  401. package/dist/stepper/Stepper.d.cts.map +1 -0
  402. package/dist/stepper/Stepper.d.ts +35 -0
  403. package/dist/stepper/Stepper.d.ts.map +1 -0
  404. package/dist/stepper/index.cjs +149 -0
  405. package/dist/stepper/index.cjs.map +1 -0
  406. package/dist/stepper/index.d.cts +2 -0
  407. package/dist/stepper/index.d.cts.map +1 -0
  408. package/dist/stepper/index.d.ts +2 -0
  409. package/dist/stepper/index.d.ts.map +1 -0
  410. package/dist/stepper/index.js +147 -0
  411. package/dist/stepper/index.js.map +1 -0
  412. package/dist/stepper/stepper-icons.d.cts +10 -0
  413. package/dist/stepper/stepper-icons.d.cts.map +1 -0
  414. package/dist/stepper/stepper-icons.d.ts +10 -0
  415. package/dist/stepper/stepper-icons.d.ts.map +1 -0
  416. package/dist/testimonials/TestimonialCarousel.d.cts +40 -0
  417. package/dist/testimonials/TestimonialCarousel.d.cts.map +1 -0
  418. package/dist/testimonials/TestimonialCarousel.d.ts +40 -0
  419. package/dist/testimonials/TestimonialCarousel.d.ts.map +1 -0
  420. package/dist/testimonials/index.cjs +246 -0
  421. package/dist/testimonials/index.cjs.map +1 -0
  422. package/dist/testimonials/index.d.cts +2 -0
  423. package/dist/testimonials/index.d.cts.map +1 -0
  424. package/dist/testimonials/index.d.ts +2 -0
  425. package/dist/testimonials/index.d.ts.map +1 -0
  426. package/dist/testimonials/index.js +244 -0
  427. package/dist/testimonials/index.js.map +1 -0
  428. package/dist/testimonials/testimonials-icons.d.cts +6 -0
  429. package/dist/testimonials/testimonials-icons.d.cts.map +1 -0
  430. package/dist/testimonials/testimonials-icons.d.ts +6 -0
  431. package/dist/testimonials/testimonials-icons.d.ts.map +1 -0
  432. package/dist/theme/Theme.d.cts +23 -0
  433. package/dist/theme/Theme.d.cts.map +1 -0
  434. package/dist/theme/Theme.d.ts +23 -0
  435. package/dist/theme/Theme.d.ts.map +1 -0
  436. package/dist/theme/index.cjs +76 -0
  437. package/dist/theme/index.cjs.map +1 -0
  438. package/dist/theme/index.d.cts +2 -0
  439. package/dist/theme/index.d.cts.map +1 -0
  440. package/dist/theme/index.d.ts +2 -0
  441. package/dist/theme/index.d.ts.map +1 -0
  442. package/dist/theme/index.js +74 -0
  443. package/dist/theme/index.js.map +1 -0
  444. package/dist/theme/theme-icons.d.cts +21 -0
  445. package/dist/theme/theme-icons.d.cts.map +1 -0
  446. package/dist/theme/theme-icons.d.ts +21 -0
  447. package/dist/theme/theme-icons.d.ts.map +1 -0
  448. package/dist/toast/index.cjs +2 -38
  449. package/dist/toast/index.cjs.map +1 -1
  450. package/dist/toast/index.js +1 -37
  451. package/dist/toast/index.js.map +1 -1
  452. package/dist/ui/Badge.d.cts +12 -0
  453. package/dist/ui/Badge.d.cts.map +1 -0
  454. package/dist/ui/Badge.d.ts +12 -0
  455. package/dist/ui/Badge.d.ts.map +1 -0
  456. package/dist/ui/Divider.d.cts +12 -0
  457. package/dist/ui/Divider.d.cts.map +1 -0
  458. package/dist/ui/Divider.d.ts +12 -0
  459. package/dist/ui/Divider.d.ts.map +1 -0
  460. package/dist/ui/GradientText.d.cts +30 -0
  461. package/dist/ui/GradientText.d.cts.map +1 -0
  462. package/dist/ui/GradientText.d.ts +30 -0
  463. package/dist/ui/GradientText.d.ts.map +1 -0
  464. package/dist/ui/index.cjs +37 -3
  465. package/dist/ui/index.cjs.map +1 -1
  466. package/dist/ui/index.d.cts +3 -0
  467. package/dist/ui/index.d.cts.map +1 -1
  468. package/dist/ui/index.d.ts +3 -0
  469. package/dist/ui/index.d.ts.map +1 -1
  470. package/dist/ui/index.js +35 -4
  471. package/dist/ui/index.js.map +1 -1
  472. package/package.json +108 -6
@@ -0,0 +1,737 @@
1
+ import { useMemo, isValidElement, useRef, useEffect, useId, useState, useLayoutEffect } from 'react';
2
+ import { Tooltip } from '@beautinique/frontend-components/ui';
3
+ import { addCollection, Icon } from '@iconify/react';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+ import { createPortal } from 'react-dom';
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+
10
+ // src/lib/content.ts
11
+ var hasContent = /* @__PURE__ */ __name((content) => content !== null && content !== void 0 && content !== false && content !== true && content !== "", "hasContent");
12
+
13
+ // src/lib/mergeRefs.ts
14
+ var assign = /* @__PURE__ */ __name((ref, node) => {
15
+ if (typeof ref === "function") return ref(node);
16
+ if (ref) ref.current = node;
17
+ return void 0;
18
+ }, "assign");
19
+ var mergeRefs = /* @__PURE__ */ __name((...refs) => (node) => {
20
+ const cleanups = refs.map((ref) => assign(ref, node));
21
+ return () => {
22
+ refs.forEach((ref, index) => {
23
+ const cleanup = cleanups[index];
24
+ if (typeof cleanup === "function") cleanup();
25
+ else assign(ref, null);
26
+ });
27
+ };
28
+ }, "mergeRefs");
29
+ var createIconRegistry = /* @__PURE__ */ __name((sets) => {
30
+ let registered = false;
31
+ return {
32
+ register: /* @__PURE__ */ __name(() => {
33
+ if (registered) return;
34
+ for (const set of sets) addCollection(set);
35
+ registered = true;
36
+ }, "register"),
37
+ names: sets.flatMap(
38
+ ({ prefix, icons, aliases }) => [...Object.keys(icons), ...Object.keys(aliases ?? {})].map((name) => `${prefix}:${name}`)
39
+ )
40
+ };
41
+ }, "createIconRegistry");
42
+
43
+ // src/inputs/inputs-icons.ts
44
+ var ICON_SETS = [
45
+ {
46
+ prefix: "solar",
47
+ width: 24,
48
+ height: 24,
49
+ icons: {
50
+ "info-circle-linear": {
51
+ body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><circle cx="12" cy="12" r="10"/><path d="M12 17V11"/><path stroke-linejoin="round" d="M12 8H12.0001"/></g>'
52
+ },
53
+ "alt-arrow-down-linear": {
54
+ body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 9L12 15L5 9"/>'
55
+ },
56
+ "unread-linear": {
57
+ body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7 12.9L10.1429 16.5L18 7.5"/>'
58
+ }
59
+ }
60
+ }
61
+ ];
62
+ var { register: registerInputIcons, names: INPUT_ICON_NAMES } = createIconRegistry(ICON_SETS);
63
+ var InputError = /* @__PURE__ */ __name(({ error = "", className = "", ...pProps }) => {
64
+ registerInputIcons();
65
+ if (!error) return null;
66
+ return /* @__PURE__ */ jsxs(
67
+ "p",
68
+ {
69
+ role: "alert",
70
+ ...pProps,
71
+ className: `text-red-c flex w-full items-center gap-1 text-start text-[11px] ${className}`,
72
+ children: [
73
+ /* @__PURE__ */ jsx(Icon, { icon: "solar:info-circle-linear", className: "mb-0.5 shrink-0" }),
74
+ /* @__PURE__ */ jsx("span", { className: "line-clamp-2 leading-3 whitespace-pre-line first-letter:uppercase", children: error })
75
+ ]
76
+ }
77
+ );
78
+ }, "InputError");
79
+ var useFieldIds = /* @__PURE__ */ __name(({ id, name, error, describedBy }) => {
80
+ const generated = useId();
81
+ const fieldId = id ?? name ?? generated;
82
+ const errorId = `${fieldId}-error`;
83
+ return {
84
+ id: fieldId,
85
+ errorId,
86
+ "aria-invalid": error ? true : void 0,
87
+ "aria-describedby": [describedBy, error ? errorId : void 0].filter(Boolean).join(" ") || void 0
88
+ };
89
+ }, "useFieldIds");
90
+ var Checkbox = /* @__PURE__ */ __name(({
91
+ register,
92
+ className = "",
93
+ content,
94
+ checkboxProps,
95
+ containerClassName = "",
96
+ error = "",
97
+ tooltip,
98
+ ref
99
+ }) => {
100
+ const { id, errorId, ...aria } = useFieldIds({
101
+ id: checkboxProps.id,
102
+ name: checkboxProps.name ?? register?.name,
103
+ error,
104
+ describedBy: checkboxProps["aria-describedby"]
105
+ });
106
+ const mergedRef = useMemo(
107
+ () => mergeRefs(register?.ref, ref),
108
+ [register?.ref, ref]
109
+ );
110
+ const handleChange = /* @__PURE__ */ __name((event) => {
111
+ if (checkboxProps.disabled) return;
112
+ void register?.onChange(event);
113
+ checkboxProps.onChange?.(event);
114
+ }, "handleChange");
115
+ const handleBlur = /* @__PURE__ */ __name((event) => {
116
+ checkboxProps.onBlur?.(event);
117
+ void register?.onBlur(event);
118
+ }, "handleBlur");
119
+ return /* @__PURE__ */ jsxs("div", { className: `flex max-w-full min-w-0 flex-col gap-1.5 ${containerClassName}`, children: [
120
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 sm:gap-3", children: [
121
+ /* @__PURE__ */ jsx(
122
+ Tooltip,
123
+ {
124
+ title: tooltip?.title,
125
+ description: tooltip?.description,
126
+ placement: tooltip?.placement,
127
+ required: tooltip?.required ?? false,
128
+ children: /* @__PURE__ */ jsxs("label", { className: "relative inline-block h-6 w-12 shrink-0", children: [
129
+ /* @__PURE__ */ jsx(
130
+ "input",
131
+ {
132
+ ...register,
133
+ ...checkboxProps,
134
+ ...aria,
135
+ type: "checkbox",
136
+ role: "switch",
137
+ ref: mergedRef,
138
+ id,
139
+ onChange: handleChange,
140
+ onBlur: handleBlur,
141
+ className: "peer sr-only"
142
+ }
143
+ ),
144
+ /* @__PURE__ */ jsx(
145
+ "span",
146
+ {
147
+ "aria-hidden": "true",
148
+ className: `border-primary/10 bg-tertiary-invert peer-checked:border-blue-crayola-c before:bg-silver-duo peer-checked:before:bg-accent-duo absolute inset-0 cursor-pointer rounded-full border transition-all duration-400 ease-[cubic-bezier(0.175,0.885,0.32,1.275)] peer-checked:shadow-[0_0_10px_rgba(var(--blue-crayola-c-rgb),0.8)] peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-crayola-c peer-disabled:cursor-not-allowed peer-disabled:opacity-60 motion-reduce:transition-none before:absolute before:top-1/2 before:left-1 before:aspect-square before:h-[70%] before:-translate-y-1/2 before:rounded-full before:transition-all before:duration-400 before:ease-[cubic-bezier(0.23,1,0.32,1)] before:content-[''] motion-reduce:before:transition-none peer-checked:before:translate-x-[calc(150%)] ${className}`
149
+ }
150
+ )
151
+ ] })
152
+ }
153
+ ),
154
+ hasContent(content) && /* @__PURE__ */ jsx(
155
+ "label",
156
+ {
157
+ htmlFor: id,
158
+ className: "text-primary/50 cursor-pointer text-xs font-medium whitespace-break-spaces sm:text-[13px] md:text-sm",
159
+ children: content
160
+ }
161
+ )
162
+ ] }),
163
+ /* @__PURE__ */ jsx(InputError, { id: errorId, error })
164
+ ] });
165
+ }, "Checkbox");
166
+ var BUTTON_CSS = "flex shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c disabled:cursor-not-allowed disabled:opacity-60";
167
+ var InputIcon = /* @__PURE__ */ __name(({ icon }) => {
168
+ if (!icon) return null;
169
+ if (isValidElement(icon)) return icon;
170
+ if (icon.onClick) {
171
+ const { onClick, label, disabled, className: className2 = "", ...iconProps2 } = icon;
172
+ return /* @__PURE__ */ jsx(
173
+ "button",
174
+ {
175
+ type: "button",
176
+ "aria-label": label,
177
+ disabled,
178
+ onClick,
179
+ className: BUTTON_CSS,
180
+ children: /* @__PURE__ */ jsx(Icon, { ...iconProps2, className: className2 })
181
+ }
182
+ );
183
+ }
184
+ const { className = "", ...iconProps } = icon;
185
+ return /* @__PURE__ */ jsx(Icon, { ...iconProps, className: `shrink-0 ${className}` });
186
+ }, "InputIcon");
187
+ var InputLabel = /* @__PURE__ */ __name(({
188
+ children,
189
+ className = "",
190
+ htmlFor,
191
+ ...labelProps
192
+ }) => hasContent(children) ? /* @__PURE__ */ jsx(
193
+ "label",
194
+ {
195
+ ...labelProps,
196
+ htmlFor,
197
+ className: `text-primary/50 border-primary/10 bg-smoke-eerie absolute top-0 left-3 -translate-y-1/2 transform rounded-sm border px-1 py-0.5 pt-1 text-[10px] leading-none md:px-2 ${htmlFor ? "cursor-pointer" : "cursor-default"} ${className}`,
198
+ children
199
+ }
200
+ ) : null, "InputLabel");
201
+ var Input = /* @__PURE__ */ __name(({
202
+ label = "",
203
+ register,
204
+ className = "",
205
+ error = "",
206
+ containerClassName = "",
207
+ icons,
208
+ inputProps,
209
+ needRef = false,
210
+ ref
211
+ }) => {
212
+ const inputRef = useRef(null);
213
+ const { id, errorId, ...aria } = useFieldIds({
214
+ id: inputProps.id,
215
+ name: inputProps.name ?? register?.name,
216
+ error,
217
+ describedBy: inputProps["aria-describedby"]
218
+ });
219
+ const mergedRef = useMemo(
220
+ () => mergeRefs(register?.ref, ref, inputRef),
221
+ [register?.ref, ref]
222
+ );
223
+ useEffect(() => {
224
+ if (needRef) inputRef.current?.focus();
225
+ }, [needRef]);
226
+ const handleChange = /* @__PURE__ */ __name((event) => {
227
+ if (inputProps.disabled) return;
228
+ inputProps.onChange?.(event);
229
+ void register?.onChange(event);
230
+ }, "handleChange");
231
+ const handleBlur = /* @__PURE__ */ __name((event) => {
232
+ inputProps.onBlur?.(event);
233
+ void register?.onBlur(event);
234
+ }, "handleBlur");
235
+ return /* @__PURE__ */ jsxs("div", { className: `flex max-w-full min-w-0 flex-col gap-1.5 ${containerClassName}`, children: [
236
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
237
+ /* @__PURE__ */ jsx(InputLabel, { htmlFor: id, children: label }),
238
+ /* @__PURE__ */ jsxs(
239
+ "div",
240
+ {
241
+ "data-invalid": error ? "" : void 0,
242
+ className: `border-primary/10 bg-smoke-eerie focus-within:border-blue-crayola-c data-invalid:border-red-c flex items-center gap-3 overflow-hidden rounded-lg border px-3 ${className}`,
243
+ children: [
244
+ /* @__PURE__ */ jsx(InputIcon, { icon: icons?.left }),
245
+ /* @__PURE__ */ jsx(
246
+ "input",
247
+ {
248
+ ...register,
249
+ ...inputProps,
250
+ ...aria,
251
+ ref: mergedRef,
252
+ id,
253
+ onChange: handleChange,
254
+ onBlur: handleBlur,
255
+ onWheel: (event) => {
256
+ inputProps.onWheel?.(event);
257
+ if (inputProps.type === "number") event.currentTarget.blur();
258
+ },
259
+ className: `text-primary placeholder:text-primary/30 autofill-effect min-w-0 flex-1 border-none bg-transparent py-2 text-[13px] leading-normal outline-hidden placeholder:text-[13px] focus:border-none focus:outline-hidden disabled:cursor-not-allowed xl:py-3 ${inputProps.className ?? ""}`
260
+ }
261
+ ),
262
+ /* @__PURE__ */ jsx(InputIcon, { icon: icons?.right })
263
+ ]
264
+ }
265
+ )
266
+ ] }),
267
+ /* @__PURE__ */ jsx(InputError, { id: errorId, error })
268
+ ] });
269
+ }, "Input");
270
+ var Radio = /* @__PURE__ */ __name(({
271
+ value,
272
+ onChange,
273
+ options,
274
+ className = "",
275
+ containerClassName = "",
276
+ error = "",
277
+ label,
278
+ name,
279
+ disabled = false
280
+ }) => {
281
+ const generated = useId();
282
+ const groupName = name ?? generated;
283
+ const errorId = `${groupName}-error`;
284
+ const index = options.findIndex((option) => option.value === value);
285
+ return /* @__PURE__ */ jsxs("div", { className: `flex max-w-full min-w-0 flex-col gap-1.5 ${containerClassName}`, children: [
286
+ /* @__PURE__ */ jsx(
287
+ "div",
288
+ {
289
+ role: "radiogroup",
290
+ "aria-label": label,
291
+ "aria-invalid": error ? true : void 0,
292
+ "aria-describedby": error ? errorId : void 0,
293
+ className: `border-battleship-davys-gray mx-auto flex w-full items-center justify-center gap-4 overflow-hidden rounded-full border ${className}`,
294
+ children: /* @__PURE__ */ jsxs("div", { className: "bg-smoke-eerie shadow-primary-btn hover:shadow-primary-btn-hover relative flex h-9 w-full items-center justify-between rounded-full transition-shadow duration-300", children: [
295
+ index >= 0 && /* @__PURE__ */ jsx(
296
+ "div",
297
+ {
298
+ "aria-hidden": "true",
299
+ className: "bg-accent-duo absolute h-full transform rounded-full shadow-lg transition-transform duration-300 ease-in-out motion-reduce:transition-none",
300
+ style: {
301
+ width: `${String(100 / options.length)}%`,
302
+ transform: `translateX(${String(index * 100)}%)`
303
+ }
304
+ }
305
+ ),
306
+ options.map((option) => /* @__PURE__ */ jsxs(
307
+ "label",
308
+ {
309
+ className: `has-focus-visible:outline-blue-crayola-c relative z-1 inline-block flex-1 rounded-full text-center text-sm has-focus-visible:outline-2 has-focus-visible:outline-offset-2 ${disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"} ${value === option.value ? "font-semibold text-white/90" : "text-primary/50 font-medium"}`,
310
+ children: [
311
+ /* @__PURE__ */ jsx(
312
+ "input",
313
+ {
314
+ type: "radio",
315
+ name: groupName,
316
+ value: option.value,
317
+ checked: value === option.value,
318
+ disabled,
319
+ onChange: () => {
320
+ onChange(option.value);
321
+ },
322
+ className: "sr-only"
323
+ }
324
+ ),
325
+ option.label
326
+ ]
327
+ },
328
+ option.value
329
+ ))
330
+ ] })
331
+ }
332
+ ),
333
+ /* @__PURE__ */ jsx(InputError, { id: errorId, error })
334
+ ] });
335
+ }, "Radio");
336
+
337
+ // src/lib/dropdown-position.ts
338
+ var DROPDOWN_GAP = 8;
339
+ var getDropdownPlacement = /* @__PURE__ */ __name(({
340
+ rect,
341
+ viewportHeight,
342
+ desired,
343
+ needed
344
+ }) => {
345
+ const below = viewportHeight - rect.bottom - DROPDOWN_GAP;
346
+ const above = rect.top - DROPDOWN_GAP;
347
+ const room = desired === "bottom" ? below : above;
348
+ const other = desired === "bottom" ? above : below;
349
+ if (room >= needed || other <= room) return desired;
350
+ return desired === "bottom" ? "top" : "bottom";
351
+ }, "getDropdownPlacement");
352
+ var getDropdownStyle = /* @__PURE__ */ __name((rect, placement, viewportHeight) => ({
353
+ left: rect.left,
354
+ width: rect.width,
355
+ ...placement === "top" ? { bottom: viewportHeight - rect.top + DROPDOWN_GAP } : { top: rect.bottom + DROPDOWN_GAP }
356
+ }), "getDropdownStyle");
357
+
358
+ // src/lib/scrollRowIntoView.ts
359
+ var scrollRowIntoView = /* @__PURE__ */ __name((list, row) => {
360
+ const top = row.offsetTop;
361
+ const bottom = top + row.offsetHeight;
362
+ if (top < list.scrollTop) list.scrollTop = top;
363
+ else if (bottom > list.scrollTop + list.clientHeight) list.scrollTop = bottom - list.clientHeight;
364
+ }, "scrollRowIntoView");
365
+
366
+ // src/lib/typeahead.ts
367
+ var findTypeaheadMatch = /* @__PURE__ */ __name((options, typed, fromIndex) => {
368
+ const text = typed.toLowerCase();
369
+ if (!text || options.length === 0) return -1;
370
+ const isRepeat = text.length > 1 && new Set(text).size === 1;
371
+ const query = isRepeat ? text.slice(0, 1) : text;
372
+ const start = isRepeat ? fromIndex + 1 : fromIndex;
373
+ for (let step = 0; step < options.length; step += 1) {
374
+ const index = ((start + step) % options.length + options.length) % options.length;
375
+ const option = options.at(index);
376
+ if (option && !option.disabled && option.label.toLowerCase().startsWith(query)) return index;
377
+ }
378
+ return -1;
379
+ }, "findTypeaheadMatch");
380
+ var findEnabledIndex = /* @__PURE__ */ __name((options, from, step) => {
381
+ for (let index = from + step; index >= 0 && index < options.length; index += step) {
382
+ if (!options[index]?.disabled) return index;
383
+ }
384
+ return -1;
385
+ }, "findEnabledIndex");
386
+ var openStack = [];
387
+ var useDismiss = /* @__PURE__ */ __name((onDismiss, { enabled = true, ignore, outside = true, escape = true } = {}) => {
388
+ const ref = useRef(null);
389
+ const onDismissRef = useRef(onDismiss);
390
+ const ignoreRef = useRef(ignore);
391
+ useLayoutEffect(() => {
392
+ onDismissRef.current = onDismiss;
393
+ ignoreRef.current = ignore;
394
+ });
395
+ useEffect(() => {
396
+ if (!enabled) return;
397
+ const token = /* @__PURE__ */ Symbol("dismissable");
398
+ if (escape) openStack.push(token);
399
+ const handlePress = /* @__PURE__ */ __name((event) => {
400
+ const element = ref.current;
401
+ if (!outside || !element) return;
402
+ const path = event.composedPath();
403
+ const isInside = path.includes(element) || (ignoreRef.current ?? []).some(({ current }) => current !== null && path.includes(current));
404
+ if (!isInside) onDismissRef.current("outside", event);
405
+ }, "handlePress");
406
+ const handleKey = /* @__PURE__ */ __name((event) => {
407
+ if (!escape || event.key !== "Escape" || event.defaultPrevented) return;
408
+ if (openStack.at(-1) !== token) return;
409
+ onDismissRef.current("escape", event);
410
+ }, "handleKey");
411
+ document.addEventListener("pointerdown", handlePress, true);
412
+ document.addEventListener("keydown", handleKey);
413
+ return () => {
414
+ document.removeEventListener("pointerdown", handlePress, true);
415
+ document.removeEventListener("keydown", handleKey);
416
+ const index = openStack.indexOf(token);
417
+ if (index !== -1) openStack.splice(index, 1);
418
+ };
419
+ }, [enabled, outside, escape]);
420
+ return ref;
421
+ }, "useDismiss");
422
+ var LIST_MAX_HEIGHT = 240 + 10;
423
+ var TYPEAHEAD_RESET_MS = 700;
424
+ var labelTextOf = /* @__PURE__ */ __name((option) => option.searchLabel ?? (typeof option.label === "string" ? option.label : String(option.value)), "labelTextOf");
425
+ var Select = /* @__PURE__ */ __name(({
426
+ label = "",
427
+ className = "",
428
+ error = "",
429
+ containerClassName = "",
430
+ optionsClassName = "",
431
+ icons,
432
+ selectProps,
433
+ options,
434
+ position = "bottom",
435
+ clearable = true
436
+ }) => {
437
+ registerInputIcons();
438
+ const baseId = useId();
439
+ const triggerId = selectProps.id ?? `${baseId}-field`;
440
+ const listId = `${baseId}-list`;
441
+ const errorId = `${baseId}-error`;
442
+ const optionId = /* @__PURE__ */ __name((index) => `${baseId}-option-${String(index)}`, "optionId");
443
+ const [isOpenState, setIsOpen] = useState(false);
444
+ const [activeIndex, setActiveIndex] = useState(-1);
445
+ const [list, setList] = useState(null);
446
+ const triggerBoxRef = useRef(null);
447
+ const listRef = useRef(null);
448
+ const activeOptionRef = useRef(null);
449
+ const listboxRef = useRef(null);
450
+ const typedRef = useRef({ text: "", timer: 0 });
451
+ const selectedIndex = options.findIndex((option) => option.value === selectProps.value);
452
+ const optionAt = /* @__PURE__ */ __name((index) => index >= 0 && index < options.length ? options[index] : void 0, "optionAt");
453
+ const selected = optionAt(selectedIndex);
454
+ const hasValue = selected !== void 0 && selected.value !== "";
455
+ const canOpen = options.length > 0;
456
+ const isOpen = isOpenState && !selectProps.disabled;
457
+ const containerRef = useDismiss(
458
+ () => {
459
+ setIsOpen(false);
460
+ },
461
+ { enabled: isOpen, ignore: [listRef] }
462
+ );
463
+ const open = /* @__PURE__ */ __name((at) => {
464
+ if (!canOpen) return;
465
+ setActiveIndex(at);
466
+ setIsOpen(true);
467
+ }, "open");
468
+ const close = /* @__PURE__ */ __name(() => {
469
+ setIsOpen(false);
470
+ }, "close");
471
+ const choose = /* @__PURE__ */ __name((index) => {
472
+ const option = optionAt(index);
473
+ if (!option || option.disabled || selectProps.disabled) return;
474
+ selectProps.onChange(clearable && index === selectedIndex ? "" : option.value);
475
+ close();
476
+ }, "choose");
477
+ useLayoutEffect(() => {
478
+ if (!isOpen) return;
479
+ const update = /* @__PURE__ */ __name(() => {
480
+ const box = triggerBoxRef.current;
481
+ if (!box) return;
482
+ const rect = box.getBoundingClientRect();
483
+ const placement = getDropdownPlacement({
484
+ rect,
485
+ viewportHeight: window.innerHeight,
486
+ desired: position,
487
+ needed: Math.min(options.length * 32 + 8, LIST_MAX_HEIGHT)
488
+ });
489
+ setList({ rect, placement });
490
+ }, "update");
491
+ update();
492
+ window.addEventListener("scroll", update, true);
493
+ window.addEventListener("resize", update);
494
+ return () => {
495
+ window.removeEventListener("scroll", update, true);
496
+ window.removeEventListener("resize", update);
497
+ };
498
+ }, [isOpen, position, options.length]);
499
+ useEffect(() => {
500
+ const row = activeOptionRef.current;
501
+ const scroller = listboxRef.current;
502
+ if (isOpen && scroller && row) scrollRowIntoView(scroller, row);
503
+ }, [isOpen, activeIndex, list]);
504
+ useEffect(() => {
505
+ const typed = typedRef.current;
506
+ return () => {
507
+ window.clearTimeout(typed.timer);
508
+ };
509
+ }, []);
510
+ const typeAhead = /* @__PURE__ */ __name((character) => {
511
+ const typed = typedRef.current;
512
+ window.clearTimeout(typed.timer);
513
+ typed.text += character;
514
+ typed.timer = window.setTimeout(() => {
515
+ typed.text = "";
516
+ }, TYPEAHEAD_RESET_MS);
517
+ const match = findTypeaheadMatch(
518
+ options.map((option) => ({ label: labelTextOf(option), disabled: option.disabled })),
519
+ typed.text,
520
+ isOpen ? activeIndex : selectedIndex
521
+ );
522
+ if (match === -1) return;
523
+ if (isOpen) setActiveIndex(match);
524
+ else open(match);
525
+ }, "typeAhead");
526
+ const handleKeyDown = /* @__PURE__ */ __name((event) => {
527
+ if (selectProps.disabled || event.altKey || event.ctrlKey || event.metaKey) return;
528
+ const first = findEnabledIndex(options, -1, 1);
529
+ const last = findEnabledIndex(options, options.length, -1);
530
+ switch (event.key) {
531
+ case "ArrowDown":
532
+ case "ArrowUp": {
533
+ event.preventDefault();
534
+ if (!isOpen) {
535
+ open(selectedIndex !== -1 ? selectedIndex : event.key === "ArrowDown" ? first : last);
536
+ return;
537
+ }
538
+ const next = findEnabledIndex(options, activeIndex, event.key === "ArrowDown" ? 1 : -1);
539
+ if (next !== -1) setActiveIndex(next);
540
+ return;
541
+ }
542
+ case "Home":
543
+ case "End":
544
+ event.preventDefault();
545
+ if (isOpen) setActiveIndex(event.key === "Home" ? first : last);
546
+ else open(event.key === "Home" ? first : last);
547
+ return;
548
+ case "Enter":
549
+ case " ":
550
+ event.preventDefault();
551
+ if (isOpen) choose(activeIndex);
552
+ else open(selectedIndex !== -1 ? selectedIndex : first);
553
+ return;
554
+ case "Tab":
555
+ close();
556
+ return;
557
+ default:
558
+ if (event.key.length === 1) {
559
+ event.preventDefault();
560
+ typeAhead(event.key);
561
+ }
562
+ }
563
+ }, "handleKeyDown");
564
+ return /* @__PURE__ */ jsxs(
565
+ "div",
566
+ {
567
+ ref: containerRef,
568
+ className: `flex max-w-full min-w-0 flex-col gap-1.5 ${containerClassName}`,
569
+ children: [
570
+ /* @__PURE__ */ jsxs("div", { className: "relative", ref: triggerBoxRef, children: [
571
+ /* @__PURE__ */ jsx(InputLabel, { htmlFor: triggerId, className: "z-2", children: label }),
572
+ /* @__PURE__ */ jsxs(
573
+ "div",
574
+ {
575
+ "data-invalid": error ? "" : void 0,
576
+ className: `border-primary/10 bg-smoke-eerie focus-within:border-blue-crayola-c data-invalid:border-red-c flex items-center gap-3 overflow-hidden rounded-lg border px-3 ${className}`,
577
+ children: [
578
+ /* @__PURE__ */ jsx(InputIcon, { icon: icons?.left }),
579
+ /* @__PURE__ */ jsxs(
580
+ "button",
581
+ {
582
+ id: triggerId,
583
+ type: "button",
584
+ role: "combobox",
585
+ "aria-haspopup": "listbox",
586
+ "aria-expanded": isOpen,
587
+ "aria-controls": isOpen ? listId : void 0,
588
+ "aria-activedescendant": isOpen && activeIndex !== -1 ? optionId(activeIndex) : void 0,
589
+ "aria-invalid": error ? true : void 0,
590
+ "aria-describedby": error ? errorId : void 0,
591
+ disabled: selectProps.disabled,
592
+ onClick: () => {
593
+ if (isOpen) close();
594
+ else open(selectedIndex);
595
+ },
596
+ onKeyDown: handleKeyDown,
597
+ className: `text-primary flex min-w-0 flex-1 items-center justify-between gap-0.5 truncate border-none bg-transparent text-left text-[13px] outline-hidden ${selectProps.disabled ? "cursor-no-drop" : "cursor-pointer"}`,
598
+ children: [
599
+ /* @__PURE__ */ jsx(
600
+ "span",
601
+ {
602
+ className: `flex-1 truncate py-2 first-letter:capitalize xl:py-3 ${hasValue ? "" : "text-primary/30"}`,
603
+ children: selected?.label ?? selectProps.placeholder
604
+ }
605
+ ),
606
+ /* @__PURE__ */ jsx(
607
+ Icon,
608
+ {
609
+ icon: "solar:alt-arrow-down-linear",
610
+ className: `size-4 transition-transform motion-reduce:transition-none md:size-5 ${isOpen ? "rotate-180" : ""} ${hasValue ? "text-primary" : "text-primary/30"}`
611
+ }
612
+ )
613
+ ]
614
+ }
615
+ ),
616
+ /* @__PURE__ */ jsx(InputIcon, { icon: icons?.right })
617
+ ]
618
+ }
619
+ )
620
+ ] }),
621
+ /* @__PURE__ */ jsx(InputError, { id: errorId, error }),
622
+ isOpen && list && createPortal(
623
+ /* @__PURE__ */ jsx(
624
+ "div",
625
+ {
626
+ ref: listRef,
627
+ className: `border-primary/10 bg-smoke-eerie fixed z-3 overflow-hidden rounded-lg border shadow-md ${optionsClassName}`,
628
+ style: getDropdownStyle(list.rect, list.placement, window.innerHeight),
629
+ children: /* @__PURE__ */ jsx(
630
+ "ul",
631
+ {
632
+ id: listId,
633
+ ref: listboxRef,
634
+ role: "listbox",
635
+ "aria-label": label || void 0,
636
+ className: "relative flex max-h-60 flex-col gap-0.5 overflow-auto p-1",
637
+ children: options.map((option, index) => {
638
+ const isSelected = index === selectedIndex;
639
+ const isActive = index === activeIndex;
640
+ return /* @__PURE__ */ jsxs(
641
+ "li",
642
+ {
643
+ id: optionId(index),
644
+ ref: isActive ? activeOptionRef : null,
645
+ role: "option",
646
+ "aria-selected": isSelected,
647
+ "aria-disabled": option.disabled ? true : void 0,
648
+ className: `text-tertiary flex items-center justify-between gap-2 rounded-sm px-2 py-1.5 text-[13px] ${option.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"} ${isActive ? "bg-primary/5" : ""} ${isSelected ? "bg-primary/8" : ""}`,
649
+ onMouseMove: () => {
650
+ if (!option.disabled && !isActive) setActiveIndex(index);
651
+ },
652
+ onClick: () => {
653
+ choose(index);
654
+ },
655
+ children: [
656
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-left text-[13px] first-letter:capitalize", children: option.label }),
657
+ isSelected && /* @__PURE__ */ jsx(Icon, { icon: "solar:unread-linear", className: "text-primary size-4 md:size-5" })
658
+ ]
659
+ },
660
+ option.value
661
+ );
662
+ })
663
+ }
664
+ )
665
+ }
666
+ ),
667
+ document.body
668
+ )
669
+ ]
670
+ }
671
+ );
672
+ }, "Select");
673
+ var Textarea = /* @__PURE__ */ __name(({
674
+ label = "",
675
+ register,
676
+ className = "",
677
+ error = "",
678
+ containerClassName = "",
679
+ textAreaProps,
680
+ needRef = false,
681
+ ref
682
+ }) => {
683
+ const textareaRef = useRef(null);
684
+ const { id, errorId, ...aria } = useFieldIds({
685
+ id: textAreaProps.id,
686
+ name: textAreaProps.name ?? register?.name,
687
+ error,
688
+ describedBy: textAreaProps["aria-describedby"]
689
+ });
690
+ const mergedRef = useMemo(
691
+ () => mergeRefs(register?.ref, ref, textareaRef),
692
+ [register?.ref, ref]
693
+ );
694
+ useEffect(() => {
695
+ if (needRef) textareaRef.current?.focus();
696
+ }, [needRef]);
697
+ const handleChange = /* @__PURE__ */ __name((event) => {
698
+ if (textAreaProps.disabled) return;
699
+ textAreaProps.onChange?.(event);
700
+ void register?.onChange(event);
701
+ }, "handleChange");
702
+ const handleBlur = /* @__PURE__ */ __name((event) => {
703
+ textAreaProps.onBlur?.(event);
704
+ void register?.onBlur(event);
705
+ }, "handleBlur");
706
+ return /* @__PURE__ */ jsxs("div", { className: `flex max-w-full min-w-0 flex-col gap-1.5 ${containerClassName}`, children: [
707
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
708
+ /* @__PURE__ */ jsx(InputLabel, { htmlFor: id, children: label }),
709
+ /* @__PURE__ */ jsx(
710
+ "div",
711
+ {
712
+ "data-invalid": error ? "" : void 0,
713
+ className: `border-primary/10 bg-smoke-eerie focus-within:border-blue-crayola-c data-invalid:border-red-c overflow-hidden rounded-lg border ${className}`,
714
+ children: /* @__PURE__ */ jsx(
715
+ "textarea",
716
+ {
717
+ ...register,
718
+ ...textAreaProps,
719
+ ...aria,
720
+ ref: mergedRef,
721
+ id,
722
+ rows: textAreaProps.rows ?? 5,
723
+ onChange: handleChange,
724
+ onBlur: handleBlur,
725
+ className: `text-primary placeholder:text-primary/30 autofill-effect block w-full resize-y border-none bg-transparent px-3 py-2 text-[13px] leading-normal outline-hidden placeholder:text-[13px] focus:border-none focus:outline-hidden disabled:cursor-not-allowed xl:py-3 ${textAreaProps.className ?? ""}`
726
+ }
727
+ )
728
+ }
729
+ )
730
+ ] }),
731
+ /* @__PURE__ */ jsx(InputError, { id: errorId, error })
732
+ ] });
733
+ }, "Textarea");
734
+
735
+ export { Checkbox, Input, InputError, InputIcon, InputLabel, Radio, Select, Textarea };
736
+ //# sourceMappingURL=index.js.map
737
+ //# sourceMappingURL=index.js.map