@beautinique/frontend-components 1.0.8 → 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 (380) hide show
  1. package/README.md +225 -16
  2. package/dist/auth/SocialAuth.d.cts +33 -0
  3. package/dist/auth/SocialAuth.d.cts.map +1 -0
  4. package/dist/auth/SocialAuth.d.ts +33 -0
  5. package/dist/auth/SocialAuth.d.ts.map +1 -0
  6. package/dist/auth/index.cjs +34 -26
  7. package/dist/auth/index.cjs.map +1 -1
  8. package/dist/auth/index.d.cts +1 -0
  9. package/dist/auth/index.d.cts.map +1 -1
  10. package/dist/auth/index.d.ts +1 -0
  11. package/dist/auth/index.d.ts.map +1 -1
  12. package/dist/auth/index.js +32 -25
  13. package/dist/auth/index.js.map +1 -1
  14. package/dist/breadcrumb/Breadcrumb.d.cts +34 -0
  15. package/dist/breadcrumb/Breadcrumb.d.cts.map +1 -0
  16. package/dist/breadcrumb/Breadcrumb.d.ts +34 -0
  17. package/dist/breadcrumb/Breadcrumb.d.ts.map +1 -0
  18. package/dist/breadcrumb/breadcrumb-icons.d.cts +6 -0
  19. package/dist/breadcrumb/breadcrumb-icons.d.cts.map +1 -0
  20. package/dist/breadcrumb/breadcrumb-icons.d.ts +6 -0
  21. package/dist/breadcrumb/breadcrumb-icons.d.ts.map +1 -0
  22. package/dist/breadcrumb/getBreadcrumbItems.d.cts +16 -0
  23. package/dist/breadcrumb/getBreadcrumbItems.d.cts.map +1 -0
  24. package/dist/breadcrumb/getBreadcrumbItems.d.ts +16 -0
  25. package/dist/breadcrumb/getBreadcrumbItems.d.ts.map +1 -0
  26. package/dist/breadcrumb/index.cjs +110 -0
  27. package/dist/breadcrumb/index.cjs.map +1 -0
  28. package/dist/breadcrumb/index.d.cts +3 -0
  29. package/dist/breadcrumb/index.d.cts.map +1 -0
  30. package/dist/breadcrumb/index.d.ts +3 -0
  31. package/dist/breadcrumb/index.d.ts.map +1 -0
  32. package/dist/breadcrumb/index.js +107 -0
  33. package/dist/breadcrumb/index.js.map +1 -0
  34. package/dist/color-input/ColorInput.d.cts +33 -0
  35. package/dist/color-input/ColorInput.d.cts.map +1 -0
  36. package/dist/color-input/ColorInput.d.ts +33 -0
  37. package/dist/color-input/ColorInput.d.ts.map +1 -0
  38. package/dist/color-input/color-input-icons.d.cts +6 -0
  39. package/dist/color-input/color-input-icons.d.cts.map +1 -0
  40. package/dist/color-input/color-input-icons.d.ts +6 -0
  41. package/dist/color-input/color-input-icons.d.ts.map +1 -0
  42. package/dist/color-input/color.d.cts +10 -0
  43. package/dist/color-input/color.d.cts.map +1 -0
  44. package/dist/color-input/color.d.ts +10 -0
  45. package/dist/color-input/color.d.ts.map +1 -0
  46. package/dist/color-input/index.cjs +375 -0
  47. package/dist/color-input/index.cjs.map +1 -0
  48. package/dist/color-input/index.d.cts +2 -0
  49. package/dist/color-input/index.d.cts.map +1 -0
  50. package/dist/color-input/index.d.ts +2 -0
  51. package/dist/color-input/index.d.ts.map +1 -0
  52. package/dist/color-input/index.js +373 -0
  53. package/dist/color-input/index.js.map +1 -0
  54. package/dist/file-input/FileInput.d.cts +53 -0
  55. package/dist/file-input/FileInput.d.cts.map +1 -0
  56. package/dist/file-input/FileInput.d.ts +53 -0
  57. package/dist/file-input/FileInput.d.ts.map +1 -0
  58. package/dist/file-input/file-input-icons.d.cts +6 -0
  59. package/dist/file-input/file-input-icons.d.cts.map +1 -0
  60. package/dist/file-input/file-input-icons.d.ts +6 -0
  61. package/dist/file-input/file-input-icons.d.ts.map +1 -0
  62. package/dist/file-input/index.cjs +259 -0
  63. package/dist/file-input/index.cjs.map +1 -0
  64. package/dist/file-input/index.d.cts +3 -0
  65. package/dist/file-input/index.d.cts.map +1 -0
  66. package/dist/file-input/index.d.ts +3 -0
  67. package/dist/file-input/index.d.ts.map +1 -0
  68. package/dist/file-input/index.js +256 -0
  69. package/dist/file-input/index.js.map +1 -0
  70. package/dist/file-input/media-type.d.cts +8 -0
  71. package/dist/file-input/media-type.d.cts.map +1 -0
  72. package/dist/file-input/media-type.d.ts +8 -0
  73. package/dist/file-input/media-type.d.ts.map +1 -0
  74. package/dist/file-input/useObjectUrls.d.cts +10 -0
  75. package/dist/file-input/useObjectUrls.d.cts.map +1 -0
  76. package/dist/file-input/useObjectUrls.d.ts +10 -0
  77. package/dist/file-input/useObjectUrls.d.ts.map +1 -0
  78. package/dist/hierarchy-select/HierarchySelect.d.cts +58 -0
  79. package/dist/hierarchy-select/HierarchySelect.d.cts.map +1 -0
  80. package/dist/hierarchy-select/HierarchySelect.d.ts +58 -0
  81. package/dist/hierarchy-select/HierarchySelect.d.ts.map +1 -0
  82. package/dist/hierarchy-select/hierarchy-select-icons.d.cts +6 -0
  83. package/dist/hierarchy-select/hierarchy-select-icons.d.cts.map +1 -0
  84. package/dist/hierarchy-select/hierarchy-select-icons.d.ts +6 -0
  85. package/dist/hierarchy-select/hierarchy-select-icons.d.ts.map +1 -0
  86. package/dist/hierarchy-select/index.cjs +596 -0
  87. package/dist/hierarchy-select/index.cjs.map +1 -0
  88. package/dist/hierarchy-select/index.d.cts +2 -0
  89. package/dist/hierarchy-select/index.d.cts.map +1 -0
  90. package/dist/hierarchy-select/index.d.ts +2 -0
  91. package/dist/hierarchy-select/index.d.ts.map +1 -0
  92. package/dist/hierarchy-select/index.js +594 -0
  93. package/dist/hierarchy-select/index.js.map +1 -0
  94. package/dist/hierarchy-select/tree.d.cts +38 -0
  95. package/dist/hierarchy-select/tree.d.cts.map +1 -0
  96. package/dist/hierarchy-select/tree.d.ts +38 -0
  97. package/dist/hierarchy-select/tree.d.ts.map +1 -0
  98. package/dist/index.cjs +7 -0
  99. package/dist/index.d.cts +1 -0
  100. package/dist/index.d.cts.map +1 -1
  101. package/dist/index.d.ts +1 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +1 -0
  104. package/dist/inputs/Checkbox.d.cts +21 -0
  105. package/dist/inputs/Checkbox.d.cts.map +1 -0
  106. package/dist/inputs/Checkbox.d.ts +21 -0
  107. package/dist/inputs/Checkbox.d.ts.map +1 -0
  108. package/dist/inputs/Input.d.cts +26 -0
  109. package/dist/inputs/Input.d.cts.map +1 -0
  110. package/dist/inputs/Input.d.ts +26 -0
  111. package/dist/inputs/Input.d.ts.map +1 -0
  112. package/dist/inputs/InputError.d.cts +11 -0
  113. package/dist/inputs/InputError.d.cts.map +1 -0
  114. package/dist/inputs/InputError.d.ts +11 -0
  115. package/dist/inputs/InputError.d.ts.map +1 -0
  116. package/dist/inputs/InputIcon.d.cts +9 -0
  117. package/dist/inputs/InputIcon.d.cts.map +1 -0
  118. package/dist/inputs/InputIcon.d.ts +9 -0
  119. package/dist/inputs/InputIcon.d.ts.map +1 -0
  120. package/dist/inputs/InputLabel.d.cts +8 -0
  121. package/dist/inputs/InputLabel.d.cts.map +1 -0
  122. package/dist/inputs/InputLabel.d.ts +8 -0
  123. package/dist/inputs/InputLabel.d.ts.map +1 -0
  124. package/dist/inputs/Radio.d.cts +25 -0
  125. package/dist/inputs/Radio.d.cts.map +1 -0
  126. package/dist/inputs/Radio.d.ts +25 -0
  127. package/dist/inputs/Radio.d.ts.map +1 -0
  128. package/dist/inputs/Select.d.cts +53 -0
  129. package/dist/inputs/Select.d.cts.map +1 -0
  130. package/dist/inputs/Select.d.ts +53 -0
  131. package/dist/inputs/Select.d.ts.map +1 -0
  132. package/dist/inputs/Textarea.d.cts +19 -0
  133. package/dist/inputs/Textarea.d.cts.map +1 -0
  134. package/dist/inputs/Textarea.d.ts +19 -0
  135. package/dist/inputs/Textarea.d.ts.map +1 -0
  136. package/dist/inputs/index.cjs +746 -0
  137. package/dist/inputs/index.cjs.map +1 -0
  138. package/dist/inputs/index.d.cts +10 -0
  139. package/dist/inputs/index.d.cts.map +1 -0
  140. package/dist/inputs/index.d.ts +10 -0
  141. package/dist/inputs/index.d.ts.map +1 -0
  142. package/dist/inputs/index.js +737 -0
  143. package/dist/inputs/index.js.map +1 -0
  144. package/dist/inputs/inputs-icons.d.cts +6 -0
  145. package/dist/inputs/inputs-icons.d.cts.map +1 -0
  146. package/dist/inputs/inputs-icons.d.ts +6 -0
  147. package/dist/inputs/inputs-icons.d.ts.map +1 -0
  148. package/dist/inputs/types.d.cts +48 -0
  149. package/dist/inputs/types.d.cts.map +1 -0
  150. package/dist/inputs/types.d.ts +48 -0
  151. package/dist/inputs/types.d.ts.map +1 -0
  152. package/dist/inputs/useFieldIds.d.cts +24 -0
  153. package/dist/inputs/useFieldIds.d.cts.map +1 -0
  154. package/dist/inputs/useFieldIds.d.ts +24 -0
  155. package/dist/inputs/useFieldIds.d.ts.map +1 -0
  156. package/dist/layout/ApiStatus.d.cts +20 -0
  157. package/dist/layout/ApiStatus.d.cts.map +1 -0
  158. package/dist/layout/ApiStatus.d.ts +20 -0
  159. package/dist/layout/ApiStatus.d.ts.map +1 -0
  160. package/dist/layout/BorderGradient.d.cts +11 -0
  161. package/dist/layout/BorderGradient.d.cts.map +1 -0
  162. package/dist/layout/BorderGradient.d.ts +11 -0
  163. package/dist/layout/BorderGradient.d.ts.map +1 -0
  164. package/dist/layout/ConfirmModal.d.cts +44 -0
  165. package/dist/layout/ConfirmModal.d.cts.map +1 -0
  166. package/dist/layout/ConfirmModal.d.ts +44 -0
  167. package/dist/layout/ConfirmModal.d.ts.map +1 -0
  168. package/dist/layout/Dropdown.d.cts +33 -0
  169. package/dist/layout/Dropdown.d.cts.map +1 -0
  170. package/dist/layout/Dropdown.d.ts +33 -0
  171. package/dist/layout/Dropdown.d.ts.map +1 -0
  172. package/dist/layout/LoadingPage.d.cts +11 -0
  173. package/dist/layout/LoadingPage.d.cts.map +1 -0
  174. package/dist/layout/LoadingPage.d.ts +11 -0
  175. package/dist/layout/LoadingPage.d.ts.map +1 -0
  176. package/dist/layout/LoadingRings.d.cts +12 -0
  177. package/dist/layout/LoadingRings.d.cts.map +1 -0
  178. package/dist/layout/LoadingRings.d.ts +12 -0
  179. package/dist/layout/LoadingRings.d.ts.map +1 -0
  180. package/dist/layout/LoadingText.d.cts +13 -0
  181. package/dist/layout/LoadingText.d.cts.map +1 -0
  182. package/dist/layout/LoadingText.d.ts +13 -0
  183. package/dist/layout/LoadingText.d.ts.map +1 -0
  184. package/dist/layout/ModalWrapper.d.cts +48 -0
  185. package/dist/layout/ModalWrapper.d.cts.map +1 -0
  186. package/dist/layout/ModalWrapper.d.ts +48 -0
  187. package/dist/layout/ModalWrapper.d.ts.map +1 -0
  188. package/dist/layout/NetworkStatusToaster.d.cts +39 -0
  189. package/dist/layout/NetworkStatusToaster.d.cts.map +1 -0
  190. package/dist/layout/NetworkStatusToaster.d.ts +39 -0
  191. package/dist/layout/NetworkStatusToaster.d.ts.map +1 -0
  192. package/dist/layout/ScrollableGradientContainer.d.cts +28 -0
  193. package/dist/layout/ScrollableGradientContainer.d.cts.map +1 -0
  194. package/dist/layout/ScrollableGradientContainer.d.ts +28 -0
  195. package/dist/layout/ScrollableGradientContainer.d.ts.map +1 -0
  196. package/dist/layout/Skeleton.d.cts +9 -0
  197. package/dist/layout/Skeleton.d.cts.map +1 -0
  198. package/dist/layout/Skeleton.d.ts +9 -0
  199. package/dist/layout/Skeleton.d.ts.map +1 -0
  200. package/dist/layout/Table.d.cts +9 -0
  201. package/dist/layout/Table.d.cts.map +1 -0
  202. package/dist/layout/Table.d.ts +9 -0
  203. package/dist/layout/Table.d.ts.map +1 -0
  204. package/dist/layout/index.cjs +743 -3
  205. package/dist/layout/index.cjs.map +1 -1
  206. package/dist/layout/index.d.cts +12 -0
  207. package/dist/layout/index.d.cts.map +1 -1
  208. package/dist/layout/index.d.ts +12 -0
  209. package/dist/layout/index.d.ts.map +1 -1
  210. package/dist/layout/index.js +724 -2
  211. package/dist/layout/index.js.map +1 -1
  212. package/dist/layout/layout-icons.d.cts +6 -0
  213. package/dist/layout/layout-icons.d.cts.map +1 -0
  214. package/dist/layout/layout-icons.d.ts +6 -0
  215. package/dist/layout/layout-icons.d.ts.map +1 -0
  216. package/dist/lib/dropdown-position.d.cts +33 -0
  217. package/dist/lib/dropdown-position.d.cts.map +1 -0
  218. package/dist/lib/dropdown-position.d.ts +33 -0
  219. package/dist/lib/dropdown-position.d.ts.map +1 -0
  220. package/dist/lib/focus.d.cts +3 -0
  221. package/dist/lib/focus.d.cts.map +1 -0
  222. package/dist/lib/focus.d.ts +3 -0
  223. package/dist/lib/focus.d.ts.map +1 -0
  224. package/dist/lib/icon-registry.d.cts +14 -0
  225. package/dist/lib/icon-registry.d.cts.map +1 -0
  226. package/dist/lib/icon-registry.d.ts +14 -0
  227. package/dist/lib/icon-registry.d.ts.map +1 -0
  228. package/dist/lib/mergeRefs.d.cts +10 -0
  229. package/dist/lib/mergeRefs.d.cts.map +1 -0
  230. package/dist/lib/mergeRefs.d.ts +10 -0
  231. package/dist/lib/mergeRefs.d.ts.map +1 -0
  232. package/dist/lib/scrollRowIntoView.d.cts +7 -0
  233. package/dist/lib/scrollRowIntoView.d.cts.map +1 -0
  234. package/dist/lib/scrollRowIntoView.d.ts +7 -0
  235. package/dist/lib/scrollRowIntoView.d.ts.map +1 -0
  236. package/dist/lib/typeahead.d.cts +21 -0
  237. package/dist/lib/typeahead.d.cts.map +1 -0
  238. package/dist/lib/typeahead.d.ts +21 -0
  239. package/dist/lib/typeahead.d.ts.map +1 -0
  240. package/dist/lib/useAnchoredBox.d.cts +26 -0
  241. package/dist/lib/useAnchoredBox.d.cts.map +1 -0
  242. package/dist/lib/useAnchoredBox.d.ts +26 -0
  243. package/dist/lib/useAnchoredBox.d.ts.map +1 -0
  244. package/dist/lib/useDismiss.d.cts +34 -0
  245. package/dist/lib/useDismiss.d.cts.map +1 -0
  246. package/dist/lib/useDismiss.d.ts +34 -0
  247. package/dist/lib/useDismiss.d.ts.map +1 -0
  248. package/dist/lib/useFocusTrap.d.cts +24 -0
  249. package/dist/lib/useFocusTrap.d.cts.map +1 -0
  250. package/dist/lib/useFocusTrap.d.ts +24 -0
  251. package/dist/lib/useFocusTrap.d.ts.map +1 -0
  252. package/dist/lib/useIsClient.d.cts +7 -0
  253. package/dist/lib/useIsClient.d.cts.map +1 -0
  254. package/dist/lib/useIsClient.d.ts +7 -0
  255. package/dist/lib/useIsClient.d.ts.map +1 -0
  256. package/dist/lib/usePrefersReducedMotion.d.cts +7 -0
  257. package/dist/lib/usePrefersReducedMotion.d.cts.map +1 -0
  258. package/dist/lib/usePrefersReducedMotion.d.ts +7 -0
  259. package/dist/lib/usePrefersReducedMotion.d.ts.map +1 -0
  260. package/dist/lib/useScrollLock.d.cts +7 -0
  261. package/dist/lib/useScrollLock.d.cts.map +1 -0
  262. package/dist/lib/useScrollLock.d.ts +7 -0
  263. package/dist/lib/useScrollLock.d.ts.map +1 -0
  264. package/dist/lib/useScrollable.d.cts +17 -0
  265. package/dist/lib/useScrollable.d.cts.map +1 -0
  266. package/dist/lib/useScrollable.d.ts +17 -0
  267. package/dist/lib/useScrollable.d.ts.map +1 -0
  268. package/dist/loading-screen/LoadingScreen.d.cts +21 -0
  269. package/dist/loading-screen/LoadingScreen.d.cts.map +1 -0
  270. package/dist/loading-screen/LoadingScreen.d.ts +21 -0
  271. package/dist/loading-screen/LoadingScreen.d.ts.map +1 -0
  272. package/dist/loading-screen/Teddy.d.cts +10 -0
  273. package/dist/loading-screen/Teddy.d.cts.map +1 -0
  274. package/dist/loading-screen/Teddy.d.ts +10 -0
  275. package/dist/loading-screen/Teddy.d.ts.map +1 -0
  276. package/dist/loading-screen/WakeUpProgress.d.cts +16 -0
  277. package/dist/loading-screen/WakeUpProgress.d.cts.map +1 -0
  278. package/dist/loading-screen/WakeUpProgress.d.ts +16 -0
  279. package/dist/loading-screen/WakeUpProgress.d.ts.map +1 -0
  280. package/dist/loading-screen/beauty-facts.d.cts +4 -0
  281. package/dist/loading-screen/beauty-facts.d.cts.map +1 -0
  282. package/dist/loading-screen/beauty-facts.d.ts +4 -0
  283. package/dist/loading-screen/beauty-facts.d.ts.map +1 -0
  284. package/dist/loading-screen/index.cjs +405 -0
  285. package/dist/loading-screen/index.cjs.map +1 -0
  286. package/dist/loading-screen/index.d.cts +5 -0
  287. package/dist/loading-screen/index.d.cts.map +1 -0
  288. package/dist/loading-screen/index.d.ts +5 -0
  289. package/dist/loading-screen/index.d.ts.map +1 -0
  290. package/dist/loading-screen/index.js +400 -0
  291. package/dist/loading-screen/index.js.map +1 -0
  292. package/dist/loading-screen/loading-screen-icons.d.cts +6 -0
  293. package/dist/loading-screen/loading-screen-icons.d.cts.map +1 -0
  294. package/dist/loading-screen/loading-screen-icons.d.ts +6 -0
  295. package/dist/loading-screen/loading-screen-icons.d.ts.map +1 -0
  296. package/dist/media/MediaCarousel.d.cts +30 -0
  297. package/dist/media/MediaCarousel.d.cts.map +1 -0
  298. package/dist/media/MediaCarousel.d.ts +30 -0
  299. package/dist/media/MediaCarousel.d.ts.map +1 -0
  300. package/dist/media/MediaCarouselWithModal.d.cts +17 -0
  301. package/dist/media/MediaCarouselWithModal.d.cts.map +1 -0
  302. package/dist/media/MediaCarouselWithModal.d.ts +17 -0
  303. package/dist/media/MediaCarouselWithModal.d.ts.map +1 -0
  304. package/dist/media/MediaCarouselWithParentMedia.d.cts +30 -0
  305. package/dist/media/MediaCarouselWithParentMedia.d.cts.map +1 -0
  306. package/dist/media/MediaCarouselWithParentMedia.d.ts +30 -0
  307. package/dist/media/MediaCarouselWithParentMedia.d.ts.map +1 -0
  308. package/dist/media/MediaModal.d.cts +27 -0
  309. package/dist/media/MediaModal.d.cts.map +1 -0
  310. package/dist/media/MediaModal.d.ts +27 -0
  311. package/dist/media/MediaModal.d.ts.map +1 -0
  312. package/dist/media/VideoPlayer.d.cts +37 -0
  313. package/dist/media/VideoPlayer.d.cts.map +1 -0
  314. package/dist/media/VideoPlayer.d.ts +37 -0
  315. package/dist/media/VideoPlayer.d.ts.map +1 -0
  316. package/dist/media/captureVideoPoster.d.cts +20 -0
  317. package/dist/media/captureVideoPoster.d.cts.map +1 -0
  318. package/dist/media/captureVideoPoster.d.ts +20 -0
  319. package/dist/media/captureVideoPoster.d.ts.map +1 -0
  320. package/dist/media/index.cjs +613 -0
  321. package/dist/media/index.cjs.map +1 -0
  322. package/dist/media/index.d.cts +8 -0
  323. package/dist/media/index.d.cts.map +1 -0
  324. package/dist/media/index.d.ts +8 -0
  325. package/dist/media/index.d.ts.map +1 -0
  326. package/dist/media/index.js +605 -0
  327. package/dist/media/index.js.map +1 -0
  328. package/dist/media/labels.d.cts +33 -0
  329. package/dist/media/labels.d.cts.map +1 -0
  330. package/dist/media/labels.d.ts +33 -0
  331. package/dist/media/labels.d.ts.map +1 -0
  332. package/dist/media/media-icons.d.cts +6 -0
  333. package/dist/media/media-icons.d.cts.map +1 -0
  334. package/dist/media/media-icons.d.ts +6 -0
  335. package/dist/media/media-icons.d.ts.map +1 -0
  336. package/dist/media/streaming.d.cts +18 -0
  337. package/dist/media/streaming.d.cts.map +1 -0
  338. package/dist/media/streaming.d.ts +18 -0
  339. package/dist/media/streaming.d.ts.map +1 -0
  340. package/dist/resend/index.cjs +5 -28
  341. package/dist/resend/index.cjs.map +1 -1
  342. package/dist/resend/index.js +1 -24
  343. package/dist/resend/index.js.map +1 -1
  344. package/dist/static-page/StaticPage.d.cts +91 -0
  345. package/dist/static-page/StaticPage.d.cts.map +1 -0
  346. package/dist/static-page/StaticPage.d.ts +91 -0
  347. package/dist/static-page/StaticPage.d.ts.map +1 -0
  348. package/dist/static-page/index.cjs +247 -0
  349. package/dist/static-page/index.cjs.map +1 -0
  350. package/dist/static-page/index.d.cts +2 -0
  351. package/dist/static-page/index.d.cts.map +1 -0
  352. package/dist/static-page/index.d.ts +2 -0
  353. package/dist/static-page/index.d.ts.map +1 -0
  354. package/dist/static-page/index.js +235 -0
  355. package/dist/static-page/index.js.map +1 -0
  356. package/dist/static-page/static-page-icons.d.cts +6 -0
  357. package/dist/static-page/static-page-icons.d.cts.map +1 -0
  358. package/dist/static-page/static-page-icons.d.ts +6 -0
  359. package/dist/static-page/static-page-icons.d.ts.map +1 -0
  360. package/dist/testimonials/TestimonialCarousel.d.cts +40 -0
  361. package/dist/testimonials/TestimonialCarousel.d.cts.map +1 -0
  362. package/dist/testimonials/TestimonialCarousel.d.ts +40 -0
  363. package/dist/testimonials/TestimonialCarousel.d.ts.map +1 -0
  364. package/dist/testimonials/index.cjs +246 -0
  365. package/dist/testimonials/index.cjs.map +1 -0
  366. package/dist/testimonials/index.d.cts +2 -0
  367. package/dist/testimonials/index.d.cts.map +1 -0
  368. package/dist/testimonials/index.d.ts +2 -0
  369. package/dist/testimonials/index.d.ts.map +1 -0
  370. package/dist/testimonials/index.js +244 -0
  371. package/dist/testimonials/index.js.map +1 -0
  372. package/dist/testimonials/testimonials-icons.d.cts +6 -0
  373. package/dist/testimonials/testimonials-icons.d.cts.map +1 -0
  374. package/dist/testimonials/testimonials-icons.d.ts +6 -0
  375. package/dist/testimonials/testimonials-icons.d.ts.map +1 -0
  376. package/dist/toast/index.cjs +2 -38
  377. package/dist/toast/index.cjs.map +1 -1
  378. package/dist/toast/index.js +1 -37
  379. package/dist/toast/index.js.map +1 -1
  380. package/package.json +67 -1
package/README.md CHANGED
@@ -13,6 +13,13 @@ npm install @beautinique/frontend-components @beautinique/frontend-stores @beaut
13
13
 
14
14
  Peer dependencies: `react`, `react-dom`, `@iconify/react`, `@beautinique/frontend-styles` and [`@beautinique/frontend-stores`](../stores/README.md) (the toasts are kept in a store that the app makes with it, see [Toasts](#toasts); that needs `zustand` in the app).
15
15
 
16
+ Two more are **optional**, needed only by the path that uses them (an app that never imports that path does not need them, and the bundler never looks for them):
17
+
18
+ | Optional peer | Needed by |
19
+ | --------------------- | ----------------------------------------------------------------------------------------------------------------- |
20
+ | `hls.js` | `/media`, only to play a stream (`.m3u8`) in a browser that cannot play it itself; it is loaded when it is needed |
21
+ | `react-color-palette` | `/color-input` (its picker) |
22
+
16
23
  ## Setup (once per app)
17
24
 
18
25
  In the app's own `index.css`, in this order:
@@ -29,22 +36,31 @@ generated and the components come out unstyled. (The playground has a page that
29
36
 
30
37
  ## Import paths
31
38
 
32
- Components that most screens use live in `/ui`, `/layout`, `/theme` and `/toast`, and the root gives
39
+ Components that most screens use live in `/ui`, `/layout`, `/inputs`, `/theme` and `/toast`, and the root gives
33
40
  all of them. Components that few screens use have a path of their own and are **not** in the root, so
34
41
  an app only bundles what it imports.
35
42
 
36
- | Import path | What it gives |
37
- | -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
38
- | `@beautinique/frontend-components` | Everything `/ui`, `/layout`, `/theme` and `/toast` give (the very same values), and the types |
39
- | `@beautinique/frontend-components/ui` | `Badge`, `Button`, `Divider`, `GradientText`, `Tooltip` |
40
- | `@beautinique/frontend-components/layout` | `ScrollToTop` |
41
- | `@beautinique/frontend-components/theme` | `Theme` (the dark / light button) |
42
- | `@beautinique/frontend-components/toast` | `ToastContainer`, `Toaster`, the types of the toasts, and what works out what a toast shows |
43
- | `@beautinique/frontend-components/auth` | `AuthBottomInstructions` |
44
- | `@beautinique/frontend-components/linear-gradient` | `LinearGradient` |
45
- | `@beautinique/frontend-components/resend` | `Resend` |
46
- | `@beautinique/frontend-components/stepper` | `Stepper` |
47
- | `@beautinique/frontend-components/source.css` | The `@source` line of the setup above |
43
+ | Import path | What it gives |
44
+ | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
45
+ | `@beautinique/frontend-components` | Everything `/ui`, `/layout`, `/inputs`, `/theme` and `/toast` give (the very same values), and the types |
46
+ | `@beautinique/frontend-components/ui` | `Badge`, `Button`, `Divider`, `GradientText`, `Tooltip` |
47
+ | `@beautinique/frontend-components/inputs` | `Input`, `Textarea`, `Checkbox`, `Radio`, `Select`, and what they are made of: `InputLabel`, `InputError`, `InputIcon` |
48
+ | `@beautinique/frontend-components/layout` | `ApiStatus`, `BorderGradient`, `ConfirmModal`, `Dropdown`, `LoadingPage`, `LoadingRings`, `LoadingText`, `ModalWrapper`, `NetworkStatusToaster`, `ScrollableGradientContainer`, `ScrollToTop`, `Skeleton`, `Table` and its parts |
49
+ | `@beautinique/frontend-components/theme` | `Theme` (the dark / light button) |
50
+ | `@beautinique/frontend-components/toast` | `ToastContainer`, `Toaster`, the types of the toasts, and what works out what a toast shows |
51
+ | `@beautinique/frontend-components/auth` | `AuthBottomInstructions`, `SocialAuth` |
52
+ | `@beautinique/frontend-components/breadcrumb` | `Breadcrumb`, `getBreadcrumbItems` |
53
+ | `@beautinique/frontend-components/color-input` | `ColorInput` (needs `react-color-palette`) |
54
+ | `@beautinique/frontend-components/file-input` | `FileInput`, `getMediaType` |
55
+ | `@beautinique/frontend-components/hierarchy-select` | `HierarchySelect` |
56
+ | `@beautinique/frontend-components/linear-gradient` | `LinearGradient` |
57
+ | `@beautinique/frontend-components/loading-screen` | `LoadingScreen`, `Teddy`, `WakeUpProgress`, `BEAUTY_FACTS` |
58
+ | `@beautinique/frontend-components/media` | `VideoPlayer`, `MediaCarousel`, `MediaCarouselWithParentMedia`, `MediaCarouselWithModal`, `MediaModal`, `captureVideoPoster`, `MEDIA_LABELS` |
59
+ | `@beautinique/frontend-components/resend` | `Resend` |
60
+ | `@beautinique/frontend-components/static-page` | `StaticPageLayout`, `StaticPageHeader`, `StaticPageSection`, `InfoCardGrid`, `Checklist`, `HighlightNote`, `NumberedSteps`, `StaticPageCTA`, `EmailUsAction`, `LastUpdatedBadge` |
61
+ | `@beautinique/frontend-components/stepper` | `Stepper` |
62
+ | `@beautinique/frontend-components/testimonials` | `TestimonialCarousel` |
63
+ | `@beautinique/frontend-components/source.css` | The `@source` line of the setup above |
48
64
 
49
65
  What the root gives can be imported from the root or from its own path, it is the same component
50
66
  either way:
@@ -267,6 +283,196 @@ the compiler asks for `href`), `terms` and `privacy` are the props of those link
267
283
  />
268
284
  ```
269
285
 
286
+ ### Inputs (`Input`, `Textarea`, `Checkbox`, `Radio`, `Select`)
287
+
288
+ ```tsx
289
+ import { Input, Select } from '@beautinique/frontend-components';
290
+
291
+ <Input
292
+ label="Name"
293
+ error={errors.name?.message}
294
+ inputProps={{ name: 'name', placeholder: 'Your name' }}
295
+ register={register('name')} // React Hook Form, optional
296
+ icons={{ right: { icon: 'solar:close-circle-linear', label: 'Clear', onClick: clear } }}
297
+ />;
298
+
299
+ <Select
300
+ label="Fruit"
301
+ options={[
302
+ { label: 'Apple', value: 'apple' },
303
+ { label: 'Banana', value: 'banana', disabled: true },
304
+ ]}
305
+ selectProps={{ value, onChange: setValue, placeholder: 'Pick a fruit' }}
306
+ />;
307
+ ```
308
+
309
+ The label sits on the border of the field and is its name (it is tied to the field by its `id`); an `error` is said as
310
+ soon as it shows up and marks the field `aria-invalid`. An icon that does something (`onClick`) is drawn inside a
311
+ real `<button>` and needs a `label` (the compiler asks for it). `Checkbox` is a `role="switch"`, `Radio` a real radio
312
+ group (the arrows move the choice), and `Select` a combobox: the arrow keys, Home, End, Enter, Escape and typing a word
313
+ work, the list is drawn in `document.body` (a parent that scrolls does not cut it) and it flips to the other side when
314
+ there is no room.
315
+
316
+ ### Layout parts
317
+
318
+ - `ApiStatus`: the state of a request in the middle of its place: rings while it loads, an icon with a title for `error` (said as an alert), `empty` and `success`.
319
+ - `BorderGradient`: a card with a gradient border.
320
+ - `Skeleton`: a grey block that pulses where something loads. It is hidden from assistive technology: say "loading" once, on the area (`aria-busy`).
321
+ - `Table`, `TableHead`, `TableBody`, `TableRow`, `TableHeadCell`, `TableRowCell`: real `<table>` elements with the look of the apps; they take their attributes (`colSpan`...), and a header cell is `scope="col"` unless told another.
322
+ - `ScrollableGradientContainer`: content that scrolls in a box with a fade on the edge that has more behind it; it is a tab stop while it scrolls. `scrollerRef` gives the element that scrolls.
323
+ - `LoadingRings`, `LoadingText`, `LoadingPage`: rings and a shining word for a part of a page that loads, and a whole page of them.
324
+ - `Dropdown`: a button that opens a panel under it (`aria-expanded`; a closed panel is `inert`, out of reach of the keyboard). `closeOnEscape`, `closeOnOutsideClick`; `children` can be a function that gets `{ close }`.
325
+ - `ModalWrapper`: a dialog over the page, drawn in `document.body`: `role="dialog"`, named by its title or `label`, the focus is kept inside and goes back to what had it, the page behind does not scroll, Escape closes the one that is on top.
326
+ - `ConfirmModal`: a dialog that asks for a decision (an `alertdialog`) or says how something went; `type="custom"` shows your own content. A press on the backdrop does not close it: a decision is not made by a stray click.
327
+ - `NetworkStatusToaster`: says when the connection goes away and when it comes back, with the toaster the app gives (`status` is e.g. `useOnlineStatus().status`).
328
+
329
+ ```tsx
330
+ import { ConfirmModal } from '@beautinique/frontend-components';
331
+
332
+ <ConfirmModal
333
+ type="warning"
334
+ title="Delete this category?"
335
+ description="It cannot be undone."
336
+ buttons={{
337
+ left: { content: 'Cancel' },
338
+ right: { content: 'Delete', buttonProps: { onClick: remove } },
339
+ }}
340
+ modalProps={{ isOpen, onClose: () => setIsOpen(false) }}
341
+ />;
342
+ ```
343
+
344
+ ### LoadingScreen, Teddy, WakeUpProgress
345
+
346
+ ```tsx
347
+ import { LoadingScreen, WakeUpProgress } from '@beautinique/frontend-components/loading-screen';
348
+
349
+ <LoadingScreen>
350
+ <WakeUpProgress phase="services" services={['user', 'product']} awakeServices={['user']} />
351
+ </LoadingScreen>;
352
+ ```
353
+
354
+ The screen of the start of an app: the bear (or what you give it) and a fact of beauty under it that changes every 5
355
+ seconds (`facts`, `interval`; `BEAUTY_FACTS` is the default list). A screen reader hears `label` once, not each fact.
356
+ `WakeUpProgress` shows the steps of a backend that wakes up. `Teddy` imports its css
357
+ (`@beautinique/frontend-styles/teddy.css`) itself.
358
+
359
+ ### Media
360
+
361
+ ```tsx
362
+ import { MediaCarouselWithModal, VideoPlayer } from '@beautinique/frontend-components/media';
363
+
364
+ const media = [
365
+ { type: 'image', url: '/a.webp' },
366
+ { type: 'video', url: 'https://cdn.example/clip.mp4' },
367
+ ];
368
+
369
+ <MediaCarouselWithModal media={media} />; // thumbnails; one opens a dialog
370
+ <VideoPlayer videoProps={{ src: 'https://cdn.example/master.m3u8', controls: true }} />;
371
+ ```
372
+
373
+ - `MediaCarousel` is the row of thumbnails: buttons named "Show image 2 of 5", `aria-current` on the chosen one, an optional remove button on each; the row scrolls to the chosen one without moving the page. `MediaCarouselWithParentMedia` shows the chosen item big with previous / next buttons (they go round, the left and right arrow keys do the same, the counter "2 of 5" is read out) and the row under it. `MediaModal` shows the same in a dialog (a video there has controls) and `MediaCarouselWithModal` is the row that opens it.
374
+ - `VideoPlayer` plays muted and inline, without controls or a loop, unless told otherwise. A **stream** (`.m3u8`) is played by the browser when it can (Safari, iOS) and by `hls.js` when it cannot: install `hls.js`; it is loaded **only then**, so a page that plays no stream never downloads it. `onStreamError` is told when a stream cannot be played; nothing is logged. `showPosterOnly` shows only the poster, which is made from the file in the browser (`captureVideoPoster`) unless you give `videoProps.poster` or `getPoster` (e.g. a poster that a CDN makes).
375
+ - Every word said to assistive technology is in `labels` (`MEDIA_LABELS` has the English ones), e.g. `labels={{ next: 'Siguiente' }}`.
376
+
377
+ ### TestimonialCarousel
378
+
379
+ ```tsx
380
+ import { TestimonialCarousel } from '@beautinique/frontend-components/testimonials';
381
+
382
+ <TestimonialCarousel
383
+ testimonials={[{ name: 'Asha Rao', role: 'Founder', content: 'Lovely products.', rating: 5 }]}
384
+ interval={5000}
385
+ />;
386
+ ```
387
+
388
+ One testimonial at a time, turning by itself the way a carousel that moves has to: it stops while the pointer is over it
389
+ (a mouse, not a finger) or the focus is in it, a pause / play button stops it for good, and with the system setting for
390
+ less motion it does not turn at all. Previous and next buttons go round. What is announced is the current slide, and only
391
+ while it is not turning. Without an `image` the initials of the name are shown.
392
+
393
+ ### HierarchySelect
394
+
395
+ ```tsx
396
+ import { HierarchySelect } from '@beautinique/frontend-components/hierarchy-select';
397
+
398
+ <HierarchySelect
399
+ label="Category"
400
+ options={[
401
+ { label: 'Skin care', value: 'skin', children: [{ label: 'Cleanser', value: 'cleanser' }] },
402
+ ]}
403
+ selectProps={{ value, onChange: setValue, placeholder: 'Choose a category' }}
404
+ />;
405
+ ```
406
+
407
+ A field that opens a tree of options with a search field above it. Only an option without children is chosen; the others
408
+ open and close. The focus stays in the search field while the arrow keys move through the tree (Right and Left open and
409
+ close a branch, Enter chooses, Escape closes and gives the focus back, Tab closes). A search shows the matches and the
410
+ branches that lead to them, all open. Give `inputProps={{ value, onChange }}` to own the search (to search on a server).
411
+
412
+ ### ColorInput
413
+
414
+ ```tsx
415
+ import { ColorInput } from '@beautinique/frontend-components/color-input';
416
+
417
+ <ColorInput label="Brand colour" value={hex} onChange={setHex} />;
418
+ ```
419
+
420
+ Needs `react-color-palette`. The field is one button that opens a picker (a dialog that holds the focus until it is closed
421
+ and gives it back). `value` and what `onChange` gets are hex strings; text that is no colour is not passed on. The
422
+ sliders need a mouse or a finger; the hex and rgb fields in the picker work from the keyboard.
423
+
424
+ ### FileInput
425
+
426
+ ```tsx
427
+ import { FileInput } from '@beautinique/frontend-components/file-input';
428
+
429
+ <FileInput
430
+ label="Photos"
431
+ fileInputProps={{ name: 'photos', multiple: true, value: files, onChange: addFiles }}
432
+ errors={files.map((file) => (file.size > MAX ? 'Too big' : undefined))}
433
+ handleRemove={removeFile}
434
+ />;
435
+ ```
436
+
437
+ A real file input (the keyboard reaches it, the field shows the focus, the same file can be chosen again) with a thumbnail
438
+ under it for each file in `value` (a `File`, or the address of one that is already saved). A thumbnail opens the file big
439
+ in a dialog and can have a remove button; `errors` gives a message per file and a red border to its thumbnail. The files
440
+ get a browser address (`URL.createObjectURL`) that is given back when the file goes. `getMediaType` says what is a picture
441
+ and what a video (the default looks at the type and at the ending).
442
+
443
+ ### Breadcrumb
444
+
445
+ ```tsx
446
+ import { Breadcrumb, getBreadcrumbItems } from '@beautinique/frontend-components/breadcrumb';
447
+
448
+ <Breadcrumb items={getBreadcrumbItems(pathname)} onNavigate={(href) => navigate(href)} />;
449
+ ```
450
+
451
+ A `nav` with a list; the last item is the current page. The links are plain `<a href>` (they work in a new tab);
452
+ `onNavigate` is called for a plain click (not for a click with a modifier, or a middle click) so the app can go there with
453
+ its router. `getBreadcrumbItems('/products/skin-care')` makes the items from a path.
454
+
455
+ ### SocialAuth
456
+
457
+ ```tsx
458
+ import { SocialAuth } from '@beautinique/frontend-components/auth';
459
+
460
+ <SocialAuth
461
+ providers={[{ name: 'Google', icon: 'logos:google-icon', href: '/auth/google' }]}
462
+ onProviderClick={() => sessionStorage.setItem('redirect', location.pathname)}
463
+ />;
464
+ ```
465
+
466
+ Icons that are links ("Continue with Google"). `onProviderClick` runs before the browser leaves for the provider. An icon
467
+ given by name comes from the Iconify API unless the app has it registered (`addIcon`).
468
+
469
+ ### Static page parts
470
+
471
+ `StaticPageLayout`, `StaticPageHeader` (the page `h1`), `StaticPageSection` (an `h2`), `InfoCardGrid` (`h3` cards),
472
+ `Checklist`, `HighlightNote` (a `note`), `NumberedSteps` (an ordered list), `StaticPageCTA`, `EmailUsAction` and
473
+ `LastUpdatedBadge` (`date` is required; it is written in UTC and in a fixed language, so a server and a browser agree)
474
+ make the pages that are only content (company, legal, information). The icons are given by name.
475
+
270
476
  ### Toasts
271
477
 
272
478
  This package draws the toasts; the store that keeps them and the `toaster` that shows them are [`@beautinique/frontend-stores`](../stores/README.md)'s. The store is **made by the app**, once, with the toasts of this package, and given to the two things that need it: the `ToastContainer` here, as a prop, and `createToaster` of the stores package. This package holds no store and no toaster of its own, and exports none.
@@ -321,12 +527,12 @@ The icons of the toasts are bundled, so a toast shows its icon without a network
321
527
 
322
528
  ## Rules for the code of this package
323
529
 
324
- - **The package holds no state.** The toast store is made by the app (`createToastStore` of `@beautinique/frontend-stores`, with this package's `TToast`) and given in, to the `ToastContainer` as a prop. The toaster is the stores package's too (`createToaster`). Nothing here makes a store or a toaster, or exports one, so the package can never be the cause of two stores. The root only re-exports `/ui`, `/layout`, `/theme` and `/toast` (`tsup.config.ts` keeps them external, and `built-files.test.ts` checks the built files after `npm run build`).
325
- - **The root has what most screens use** (`/ui`, `/layout`, `/theme` and `/toast`). A component that
530
+ - **The package holds no state.** The toast store is made by the app (`createToastStore` of `@beautinique/frontend-stores`, with this package's `TToast`) and given in, to the `ToastContainer` as a prop. The toaster is the stores package's too (`createToaster`). Nothing here makes a store or a toaster, or exports one, so the package can never be the cause of two stores. The root only re-exports `/ui`, `/layout`, `/inputs`, `/theme` and `/toast` (`tsup.config.ts` keeps them external, and `built-files.test.ts` checks the built files after `npm run build`).
531
+ - **The root has what most screens use** (`/ui`, `/layout`, `/inputs`, `/theme` and `/toast`). A component that
326
532
  few screens use gets a path of its own and is not in the root.
327
533
  - **Icons are Iconify icons, bundled and registered.** A component draws its icons with Iconify's
328
534
  `Icon`, and the icon data is in the package (`toast-icons.ts`, `stepper-icons.ts`,
329
- `theme-icons.ts`, registered with `addCollection`), so they show without a network and without
535
+ `theme-icons.ts`, `inputs-icons.ts`, `media-icons.ts`..., registered with `addCollection`), so they show without a network and without
330
536
  waiting for the Iconify API. A component registers its own icons when it renders (not when its file
331
537
  is imported), so an app only carries the icons of the components it uses. Iconify draws icons in the
332
538
  browser only: on a server a placeholder is in their place (fine for the Vite apps).
@@ -338,6 +544,9 @@ The icons of the toasts are bundled, so a toast shows its icon without a network
338
544
  import them again: importing them a second time, after the app's own css, would undo the app's
339
545
  overrides.
340
546
  - **No imports from an app.** What a component needs from its app comes in through props.
547
+ - **One entry imports another only through its `index`** (`../ui/index.js`, never `../ui/Button.js`): the build leaves such an import as an import of the public path, so a component is never bundled twice (`entries.test.ts` checks it).
548
+ - **Heavy or rare dependencies are optional peers, loaded when they are needed**: `hls.js` is `import()`ed when a stream is played, and `react-color-palette` is only imported by `/color-input`.
549
+ - **Words are props.** Every sentence a component says to assistive technology has a default in English and a prop (`labels`) to change it.
341
550
 
342
551
  ## Development
343
552
 
@@ -0,0 +1,33 @@
1
+ import type { MouseEvent, ReactElement } from 'react';
2
+ import type { IClassName } from '../types/component.js';
3
+ /** A service the person can sign in with. */
4
+ export interface ISocialProvider {
5
+ /** The name of the service ("Google"): the link says "Continue with Google". */
6
+ name: string;
7
+ /** An icon of Iconify (`'logos:google-icon'`) or any element. */
8
+ icon: string | ReactElement;
9
+ /** Where the sign in starts. */
10
+ href: string;
11
+ }
12
+ export interface ISocialAuth extends IClassName {
13
+ providers: readonly ISocialProvider[];
14
+ /**
15
+ * Called when a provider is pressed, before the browser goes to its address: the place to remember
16
+ * where the person was, to bring them back after the sign in.
17
+ */
18
+ onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;
19
+ /** What a link says to assistive technology. @default `Continue with ${provider.name}` */
20
+ getLabel?: (provider: ISocialProvider) => string;
21
+ /** The name of the group of links. @default 'Sign in with' */
22
+ label?: string;
23
+ }
24
+ /**
25
+ * A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain
26
+ * links, because signing in with a service leaves the app for the page of the service: an
27
+ * `<a href>`, named "Continue with Google", that also works when opened in a new tab.
28
+ *
29
+ * The icons that are given by name come from the Iconify API unless the app has them registered
30
+ * (`addIcon()`), which also makes them show without a network.
31
+ */
32
+ export declare const SocialAuth: ({ providers, onProviderClick, getLabel, label, className, }: ISocialAuth) => import("react").JSX.Element | null;
33
+ //# sourceMappingURL=SocialAuth.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocialAuth.d.cts","sourceRoot":"","sources":["../../src/auth/SocialAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5F,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,6DAMxB,WAAW,uCA6Bb,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { MouseEvent, ReactElement } from 'react';
2
+ import type { IClassName } from '../types/component.js';
3
+ /** A service the person can sign in with. */
4
+ export interface ISocialProvider {
5
+ /** The name of the service ("Google"): the link says "Continue with Google". */
6
+ name: string;
7
+ /** An icon of Iconify (`'logos:google-icon'`) or any element. */
8
+ icon: string | ReactElement;
9
+ /** Where the sign in starts. */
10
+ href: string;
11
+ }
12
+ export interface ISocialAuth extends IClassName {
13
+ providers: readonly ISocialProvider[];
14
+ /**
15
+ * Called when a provider is pressed, before the browser goes to its address: the place to remember
16
+ * where the person was, to bring them back after the sign in.
17
+ */
18
+ onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;
19
+ /** What a link says to assistive technology. @default `Continue with ${provider.name}` */
20
+ getLabel?: (provider: ISocialProvider) => string;
21
+ /** The name of the group of links. @default 'Sign in with' */
22
+ label?: string;
23
+ }
24
+ /**
25
+ * A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain
26
+ * links, because signing in with a service leaves the app for the page of the service: an
27
+ * `<a href>`, named "Continue with Google", that also works when opened in a new tab.
28
+ *
29
+ * The icons that are given by name come from the Iconify API unless the app has them registered
30
+ * (`addIcon()`), which also makes them show without a network.
31
+ */
32
+ export declare const SocialAuth: ({ providers, onProviderClick, getLabel, label, className, }: ISocialAuth) => import("react").JSX.Element | null;
33
+ //# sourceMappingURL=SocialAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SocialAuth.d.ts","sourceRoot":"","sources":["../../src/auth/SocialAuth.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,6CAA6C;AAC7C,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC;IAC5B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IACtC;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5F,0FAA0F;IAC1F,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,eAAe,KAAK,MAAM,CAAC;IACjD,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,6DAMxB,WAAW,uCA6Bb,CAAC"}
@@ -1,33 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ var ui = require('@beautinique/frontend-components/ui');
3
4
  var jsxRuntime = require('react/jsx-runtime');
5
+ var react = require('@iconify/react');
4
6
 
5
7
  var __defProp = Object.defineProperty;
6
8
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var BASE_CSS = "text-fill-transparent w-fit";
8
- var FORCED_COLORS_CSS = "forced-colors:bg-none forced-colors:[-webkit-text-fill-color:currentColor]";
9
- var GRADIENT_CSS = {
10
- accent: "bg-accent-duo",
11
- silver: "bg-silver-duo"
12
- };
13
- var GradientText = /* @__PURE__ */ __name(({
14
- as,
15
- type,
16
- text,
17
- children,
18
- className = "",
19
- ...rest
20
- }) => {
21
- const Component = as ?? "span";
22
- return /* @__PURE__ */ jsxRuntime.jsx(
23
- Component,
24
- {
25
- ...rest,
26
- className: `${BASE_CSS} ${GRADIENT_CSS[type]} ${FORCED_COLORS_CSS} ${className}`,
27
- children: children ?? text
28
- }
29
- );
30
- }, "GradientText");
31
9
  var defaultMessage = /* @__PURE__ */ __name(({ terms, privacy }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
32
10
  "By continuing, you agree to our ",
33
11
  terms,
@@ -49,7 +27,7 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
49
27
  const Link = as ?? "a";
50
28
  return /* @__PURE__ */ jsxRuntime.jsx("p", { ...pProps, className: `text-tertiary text-xs ${className}`, children: message({
51
29
  terms: /* @__PURE__ */ jsxRuntime.jsx(
52
- GradientText,
30
+ ui.GradientText,
53
31
  {
54
32
  ...terms,
55
33
  as: Link,
@@ -59,7 +37,7 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
59
37
  }
60
38
  ),
61
39
  privacy: /* @__PURE__ */ jsxRuntime.jsx(
62
- GradientText,
40
+ ui.GradientText,
63
41
  {
64
42
  ...privacy,
65
43
  as: Link,
@@ -70,7 +48,37 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
70
48
  )
71
49
  }) });
72
50
  }, "AuthBottomInstructions");
51
+ var defaultGetLabel = /* @__PURE__ */ __name((provider) => `Continue with ${provider.name}`, "defaultGetLabel");
52
+ var SocialAuth = /* @__PURE__ */ __name(({
53
+ providers,
54
+ onProviderClick,
55
+ getLabel = defaultGetLabel,
56
+ label = "Sign in with",
57
+ className = ""
58
+ }) => {
59
+ if (providers.length === 0) return null;
60
+ return /* @__PURE__ */ jsxRuntime.jsx("ul", { "aria-label": label, className: `flex items-center justify-center gap-4 ${className}`, children: providers.map((provider) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
61
+ "a",
62
+ {
63
+ href: provider.href,
64
+ "aria-label": getLabel(provider),
65
+ className: "block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
66
+ onClick: (event) => {
67
+ onProviderClick?.(provider, event);
68
+ },
69
+ children: typeof provider.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
70
+ react.Icon,
71
+ {
72
+ "aria-hidden": "true",
73
+ icon: provider.icon,
74
+ className: "border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none"
75
+ }
76
+ ) : provider.icon
77
+ }
78
+ ) }, provider.name)) });
79
+ }, "SocialAuth");
73
80
 
74
81
  exports.AuthBottomInstructions = AuthBottomInstructions;
82
+ exports.SocialAuth = SocialAuth;
75
83
  //# sourceMappingURL=index.cjs.map
76
84
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/GradientText.tsx","../../src/auth/AuthBottomInstructions.tsx"],"names":["jsx","jsxs","Fragment"],"mappings":";;;;;;AAwBA,IAAM,QAAA,GAAW,6BAAA;AAGjB,IAAM,iBAAA,GACJ,4EAAA;AAEF,IAAM,YAAA,GAAkD;AAAA,EACtD,MAAA,EAAQ,eAAA;AAAA,EACR,MAAA,EAAQ;AACV,CAAA;AAOO,IAAM,+BAAe,MAAA,CAAA,CAAmC;AAAA,EAC7D,EAAA;AAAA,EACA,IAAA;AAAA,EACA,IAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAA0B;AACxB,EAAA,MAAM,YAAyB,EAAA,IAAM,MAAA;AAErC,EAAA,uBACEA,cAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,CAAA,EAAG,QAAQ,CAAA,CAAA,EAAI,YAAA,CAAa,IAAI,CAAC,CAAA,CAAA,EAAI,iBAAiB,CAAA,CAAA,EAAI,SAAS,CAAA,CAAA;AAAA,MAE7E,QAAA,EAAA,QAAA,IAAY;AAAA;AAAA,GACf;AAEJ,CAAA,EAlB4B,cAAA,CAAA;ACK5B,IAAM,iCAAiB,MAAA,CAAA,CAAC,EAAE,KAAA,EAAO,OAAA,uBAC/BC,eAAA,CAAAC,mBAAA,EAAA,EAAE,QAAA,EAAA;AAAA,EAAA,kCAAA;AAAA,EACiC,KAAA;AAAA,EAAM,OAAA;AAAA,EAAM,OAAA;AAAA,EAAQ;AAAA,CAAA,EACvD,CAAA,EAHqB,gBAAA,CAAA;AAMvB,IAAM,QAAA,GAAW,aAAA;AAMV,IAAM,yCAAyB,MAAA,CAAA,CAAgC;AAAA,EACpE,EAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA,GAAa,oBAAA;AAAA,EACb,YAAA,GAAe,gBAAA;AAAA,EACf,OAAA,GAAU,cAAA;AAAA,EACV,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAAoC;AAClC,EAAA,MAAM,OAAoB,EAAA,IAAM,GAAA;AAEhC,EAAA,uBACEF,eAAC,GAAA,EAAA,EAAG,GAAG,QAAQ,SAAA,EAAW,CAAA,sBAAA,EAAyB,SAAS,CAAA,CAAA,EACzD,QAAA,EAAA,OAAA,CAAQ;AAAA,IACP,uBACEA,cAAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAI,KAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,UAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA,KACb;AAAA,IAEF,yBACEA,cAAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAI,OAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,YAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA;AACb,GAEH,CAAA,EACH,CAAA;AAEJ,CAAA,EApCsC,wBAAA","file":"index.cjs","sourcesContent":["import type { ComponentPropsWithRef, ElementType, ReactNode } from 'react';\n\n/** `accent`: the blue gradient of the brand. `silver`: the quiet grey one. */\nexport type TGradientTextType = 'accent' | 'silver';\n\n/** The text is given as `text`, or as `children` (anything React can show), not both. */\ntype TGradientTextContent =\n { text: string; children?: never } | { children: ReactNode; text?: never };\n\ninterface IGradientTextOwnProps<TAs extends ElementType> {\n /**\n * What renders the text: an element (`'a'`, `'p'`, ...) or a component, e.g. the `Link` of the\n * router, which then gets its own props (`to`) next to these.\n * @default 'span'\n */\n as?: TAs;\n type: TGradientTextType;\n className?: string;\n}\n\nexport type IGradientText<TAs extends ElementType = 'span'> = IGradientTextOwnProps<TAs> &\n TGradientTextContent &\n Omit<ComponentPropsWithRef<TAs>, 'as' | 'type' | 'className' | 'text' | 'children'>;\n\nconst BASE_CSS = 'text-fill-transparent w-fit';\n// In forced-colors mode (Windows high contrast) the browser draws no background, so a text that is\n// only a transparent fill over a gradient would vanish: there it takes the colour of the system.\nconst FORCED_COLORS_CSS =\n 'forced-colors:bg-none forced-colors:[-webkit-text-fill-color:currentColor]';\n\nconst GRADIENT_CSS: Record<TGradientTextType, string> = {\n accent: 'bg-accent-duo',\n silver: 'bg-silver-duo',\n};\n\n/**\n * Text filled with a gradient. A link is a text that is rendered by a link component:\n * `<GradientText as={Link} to=\"/terms\" type=\"accent\" text=\"Terms\" />`; the router is the app's, not\n * this package's.\n */\nexport const GradientText = <TAs extends ElementType = 'span'>({\n as,\n type,\n text,\n children,\n className = '',\n ...rest\n}: IGradientText<TAs>) => {\n const Component: ElementType = as ?? 'span';\n\n return (\n <Component\n {...rest}\n className={`${BASE_CSS} ${GRADIENT_CSS[type]} ${FORCED_COLORS_CSS} ${className}`}\n >\n {children ?? text}\n </Component>\n );\n};\n","import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from 'react';\n\nimport { GradientText } from '../ui/GradientText.js';\n\n/**\n * What the link to a page needs, as the component that makes the link asks for it: `{ to: '/terms' }`\n * for the `Link` of a router, `{ href: '/terms' }` for a plain `<a>` (which has to have one).\n */\nexport type TAuthLinkProps<TAs extends ElementType> = Omit<\n ComponentPropsWithRef<TAs>,\n 'children' | 'className' | 'text' | 'type'\n> &\n (TAs extends 'a' ? { href: string } : unknown);\n\n/** The two links of the sentence, ready to be put in it. */\nexport interface IAuthLinks {\n terms: ReactNode;\n privacy: ReactNode;\n}\n\ninterface IAuthBottomInstructionsOwnProps<TAs extends ElementType> {\n /**\n * What makes the links: `'a'`, or the `Link` of the router of the app. The router is the app's,\n * not this package's.\n * @default 'a'\n */\n as?: TAs;\n /** The link to the terms and conditions, in the props of `as`. */\n terms: TAuthLinkProps<TAs>;\n /** The link to the privacy policy, in the props of `as`. */\n privacy: TAuthLinkProps<TAs>;\n /** @default 'Terms & Conditions' */\n termsLabel?: string;\n /** @default 'Privacy Policy' */\n privacyLabel?: string;\n /**\n * The sentence around the two links, for another wording or another language.\n * @default ({ terms, privacy }) => <>By continuing, you agree to our {terms} and {privacy}.</>\n */\n message?: (links: IAuthLinks) => ReactNode;\n}\n\nexport type IAuthBottomInstructions<TAs extends ElementType = 'a'> =\n IAuthBottomInstructionsOwnProps<TAs> & Omit<ComponentProps<'p'>, 'children'>;\n\nconst defaultMessage = ({ terms, privacy }: IAuthLinks) => (\n <>\n By continuing, you agree to our {terms} and {privacy}.\n </>\n);\n\nconst LINK_CSS = 'font-medium';\n\n/**\n * The small print under a sign-in or sign-up form: that going on means accepting the terms and the\n * privacy policy, with a link to each.\n */\nexport const AuthBottomInstructions = <TAs extends ElementType = 'a'>({\n as,\n terms,\n privacy,\n termsLabel = 'Terms & Conditions',\n privacyLabel = 'Privacy Policy',\n message = defaultMessage,\n className = '',\n ...pProps\n}: IAuthBottomInstructions<TAs>) => {\n const Link: ElementType = as ?? 'a';\n\n return (\n <p {...pProps} className={`text-tertiary text-xs ${className}`}>\n {message({\n terms: (\n <GradientText\n {...(terms as object)}\n as={Link}\n type=\"accent\"\n text={termsLabel}\n className={LINK_CSS}\n />\n ),\n privacy: (\n <GradientText\n {...(privacy as object)}\n as={Link}\n type=\"accent\"\n text={privacyLabel}\n className={LINK_CSS}\n />\n ),\n })}\n </p>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../src/auth/AuthBottomInstructions.tsx","../../src/auth/SocialAuth.tsx"],"names":["jsxs","Fragment","jsx","GradientText","Icon"],"mappings":";;;;;;;;AA6CA,IAAM,iCAAiB,MAAA,CAAA,CAAC,EAAE,KAAA,EAAO,OAAA,uBAC/BA,eAAA,CAAAC,mBAAA,EAAA,EAAE,QAAA,EAAA;AAAA,EAAA,kCAAA;AAAA,EACiC,KAAA;AAAA,EAAM,OAAA;AAAA,EAAM,OAAA;AAAA,EAAQ;AAAA,CAAA,EACvD,CAAA,EAHqB,gBAAA,CAAA;AAMvB,IAAM,QAAA,GAAW,aAAA;AAMV,IAAM,yCAAyB,MAAA,CAAA,CAAgC;AAAA,EACpE,EAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA,GAAa,oBAAA;AAAA,EACb,YAAA,GAAe,gBAAA;AAAA,EACf,OAAA,GAAU,cAAA;AAAA,EACV,SAAA,GAAY,EAAA;AAAA,EACZ,GAAG;AACL,CAAA,KAAoC;AAClC,EAAA,MAAM,OAAoB,EAAA,IAAM,GAAA;AAEhC,EAAA,uBACEC,cAAA,CAAC,OAAG,GAAG,MAAA,EAAQ,WAAW,CAAA,sBAAA,EAAyB,SAAS,IACzD,QAAA,EAAA,OAAA,CAAQ;AAAA,IACP,KAAA,kBACEA,cAAA;AAAA,MAACC,eAAA;AAAA,MAAA;AAAA,QACE,GAAI,KAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,UAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA,KACb;AAAA,IAEF,OAAA,kBACED,cAAA;AAAA,MAACC,eAAA;AAAA,MAAA;AAAA,QACE,GAAI,OAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,YAAA;AAAA,QACN,SAAA,EAAW;AAAA;AAAA;AACb,GAEH,CAAA,EACH,CAAA;AAEJ,CAAA,EApCsC,wBAAA;AC7BtC,IAAM,kCAAkB,MAAA,CAAA,CAAC,QAAA,KAA8B,CAAA,cAAA,EAAiB,QAAA,CAAS,IAAI,CAAA,CAAA,EAA7D,iBAAA,CAAA;AAUjB,IAAM,6BAAa,MAAA,CAAA,CAAC;AAAA,EACzB,SAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA,GAAW,eAAA;AAAA,EACX,KAAA,GAAQ,cAAA;AAAA,EACR,SAAA,GAAY;AACd,CAAA,KAAmB;AACjB,EAAA,IAAI,SAAA,CAAU,MAAA,KAAW,CAAA,EAAG,OAAO,IAAA;AAEnC,EAAA,uBACED,cAAAA,CAAC,IAAA,EAAA,EAAG,YAAA,EAAY,KAAA,EAAO,WAAW,CAAA,uCAAA,EAA0C,SAAS,CAAA,CAAA,EAClF,QAAA,EAAA,SAAA,CAAU,IAAI,CAAC,QAAA,qBACdA,cAAAA,CAAC,QACC,QAAA,kBAAAA,cAAAA;AAAA,IAAC,GAAA;AAAA,IAAA;AAAA,MACC,MAAM,QAAA,CAAS,IAAA;AAAA,MACf,YAAA,EAAY,SAAS,QAAQ,CAAA;AAAA,MAC7B,SAAA,EAAU,8GAAA;AAAA,MACV,OAAA,EAAS,CAAC,KAAA,KAAU;AAClB,QAAA,eAAA,GAAkB,UAAU,KAAK,CAAA;AAAA,MACnC,CAAA;AAAA,MAEC,QAAA,EAAA,OAAO,QAAA,CAAS,IAAA,KAAS,QAAA,mBACxBA,cAAAA;AAAA,QAACE,UAAA;AAAA,QAAA;AAAA,UACC,aAAA,EAAY,MAAA;AAAA,UACZ,MAAM,QAAA,CAAS,IAAA;AAAA,UACf,SAAA,EAAU;AAAA;AAAA,UAGZ,QAAA,CAAS;AAAA;AAAA,GAEb,EAAA,EAlBO,QAAA,CAAS,IAmBlB,CACD,CAAA,EACH,CAAA;AAEJ,CAAA,EAnC0B,YAAA","file":"index.cjs","sourcesContent":["import type { ComponentProps, ComponentPropsWithRef, ElementType, ReactNode } from 'react';\n\nimport { GradientText } from '../ui/index.js';\n\n/**\n * What the link to a page needs, as the component that makes the link asks for it: `{ to: '/terms' }`\n * for the `Link` of a router, `{ href: '/terms' }` for a plain `<a>` (which has to have one).\n */\nexport type TAuthLinkProps<TAs extends ElementType> = Omit<\n ComponentPropsWithRef<TAs>,\n 'children' | 'className' | 'text' | 'type'\n> &\n (TAs extends 'a' ? { href: string } : unknown);\n\n/** The two links of the sentence, ready to be put in it. */\nexport interface IAuthLinks {\n terms: ReactNode;\n privacy: ReactNode;\n}\n\ninterface IAuthBottomInstructionsOwnProps<TAs extends ElementType> {\n /**\n * What makes the links: `'a'`, or the `Link` of the router of the app. The router is the app's,\n * not this package's.\n * @default 'a'\n */\n as?: TAs;\n /** The link to the terms and conditions, in the props of `as`. */\n terms: TAuthLinkProps<TAs>;\n /** The link to the privacy policy, in the props of `as`. */\n privacy: TAuthLinkProps<TAs>;\n /** @default 'Terms & Conditions' */\n termsLabel?: string;\n /** @default 'Privacy Policy' */\n privacyLabel?: string;\n /**\n * The sentence around the two links, for another wording or another language.\n * @default ({ terms, privacy }) => <>By continuing, you agree to our {terms} and {privacy}.</>\n */\n message?: (links: IAuthLinks) => ReactNode;\n}\n\nexport type IAuthBottomInstructions<TAs extends ElementType = 'a'> =\n IAuthBottomInstructionsOwnProps<TAs> & Omit<ComponentProps<'p'>, 'children'>;\n\nconst defaultMessage = ({ terms, privacy }: IAuthLinks) => (\n <>\n By continuing, you agree to our {terms} and {privacy}.\n </>\n);\n\nconst LINK_CSS = 'font-medium';\n\n/**\n * The small print under a sign-in or sign-up form: that going on means accepting the terms and the\n * privacy policy, with a link to each.\n */\nexport const AuthBottomInstructions = <TAs extends ElementType = 'a'>({\n as,\n terms,\n privacy,\n termsLabel = 'Terms & Conditions',\n privacyLabel = 'Privacy Policy',\n message = defaultMessage,\n className = '',\n ...pProps\n}: IAuthBottomInstructions<TAs>) => {\n const Link: ElementType = as ?? 'a';\n\n return (\n <p {...pProps} className={`text-tertiary text-xs ${className}`}>\n {message({\n terms: (\n <GradientText\n {...(terms as object)}\n as={Link}\n type=\"accent\"\n text={termsLabel}\n className={LINK_CSS}\n />\n ),\n privacy: (\n <GradientText\n {...(privacy as object)}\n as={Link}\n type=\"accent\"\n text={privacyLabel}\n className={LINK_CSS}\n />\n ),\n })}\n </p>\n );\n};\n","import { Icon } from '@iconify/react';\nimport type { MouseEvent, ReactElement } from 'react';\n\nimport type { IClassName } from '../types/component.js';\n\n/** A service the person can sign in with. */\nexport interface ISocialProvider {\n /** The name of the service (\"Google\"): the link says \"Continue with Google\". */\n name: string;\n /** An icon of Iconify (`'logos:google-icon'`) or any element. */\n icon: string | ReactElement;\n /** Where the sign in starts. */\n href: string;\n}\n\nexport interface ISocialAuth extends IClassName {\n providers: readonly ISocialProvider[];\n /**\n * Called when a provider is pressed, before the browser goes to its address: the place to remember\n * where the person was, to bring them back after the sign in.\n */\n onProviderClick?: (provider: ISocialProvider, event: MouseEvent<HTMLAnchorElement>) => void;\n /** What a link says to assistive technology. @default `Continue with ${provider.name}` */\n getLabel?: (provider: ISocialProvider) => string;\n /** The name of the group of links. @default 'Sign in with' */\n label?: string;\n}\n\nconst defaultGetLabel = (provider: ISocialProvider) => `Continue with ${provider.name}`;\n\n/**\n * A row of icons, each a link that starts a sign in with a service (Google, GitHub...). They are plain\n * links, because signing in with a service leaves the app for the page of the service: an\n * `<a href>`, named \"Continue with Google\", that also works when opened in a new tab.\n *\n * The icons that are given by name come from the Iconify API unless the app has them registered\n * (`addIcon()`), which also makes them show without a network.\n */\nexport const SocialAuth = ({\n providers,\n onProviderClick,\n getLabel = defaultGetLabel,\n label = 'Sign in with',\n className = '',\n}: ISocialAuth) => {\n if (providers.length === 0) return null;\n\n return (\n <ul aria-label={label} className={`flex items-center justify-center gap-4 ${className}`}>\n {providers.map((provider) => (\n <li key={provider.name}>\n <a\n href={provider.href}\n aria-label={getLabel(provider)}\n className=\"block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c\"\n onClick={(event) => {\n onProviderClick?.(provider, event);\n }}\n >\n {typeof provider.icon === 'string' ? (\n <Icon\n aria-hidden=\"true\"\n icon={provider.icon}\n className=\"border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none\"\n />\n ) : (\n provider.icon\n )}\n </a>\n </li>\n ))}\n </ul>\n );\n};\n"]}
@@ -1,2 +1,3 @@
1
1
  export { AuthBottomInstructions, type IAuthBottomInstructions, type IAuthLinks, type TAuthLinkProps, } from './AuthBottomInstructions.js';
2
+ export { type ISocialAuth, type ISocialProvider, SocialAuth } from './SocialAuth.js';
2
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { AuthBottomInstructions, type IAuthBottomInstructions, type IAuthLinks, type TAuthLinkProps, } from './AuthBottomInstructions.js';
2
+ export { type ISocialAuth, type ISocialProvider, SocialAuth } from './SocialAuth.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -1,31 +1,9 @@
1
+ import { GradientText } from '@beautinique/frontend-components/ui';
1
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { Icon } from '@iconify/react';
2
4
 
3
5
  var __defProp = Object.defineProperty;
4
6
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
5
- var BASE_CSS = "text-fill-transparent w-fit";
6
- var FORCED_COLORS_CSS = "forced-colors:bg-none forced-colors:[-webkit-text-fill-color:currentColor]";
7
- var GRADIENT_CSS = {
8
- accent: "bg-accent-duo",
9
- silver: "bg-silver-duo"
10
- };
11
- var GradientText = /* @__PURE__ */ __name(({
12
- as,
13
- type,
14
- text,
15
- children,
16
- className = "",
17
- ...rest
18
- }) => {
19
- const Component = as ?? "span";
20
- return /* @__PURE__ */ jsx(
21
- Component,
22
- {
23
- ...rest,
24
- className: `${BASE_CSS} ${GRADIENT_CSS[type]} ${FORCED_COLORS_CSS} ${className}`,
25
- children: children ?? text
26
- }
27
- );
28
- }, "GradientText");
29
7
  var defaultMessage = /* @__PURE__ */ __name(({ terms, privacy }) => /* @__PURE__ */ jsxs(Fragment, { children: [
30
8
  "By continuing, you agree to our ",
31
9
  terms,
@@ -68,7 +46,36 @@ var AuthBottomInstructions = /* @__PURE__ */ __name(({
68
46
  )
69
47
  }) });
70
48
  }, "AuthBottomInstructions");
49
+ var defaultGetLabel = /* @__PURE__ */ __name((provider) => `Continue with ${provider.name}`, "defaultGetLabel");
50
+ var SocialAuth = /* @__PURE__ */ __name(({
51
+ providers,
52
+ onProviderClick,
53
+ getLabel = defaultGetLabel,
54
+ label = "Sign in with",
55
+ className = ""
56
+ }) => {
57
+ if (providers.length === 0) return null;
58
+ return /* @__PURE__ */ jsx("ul", { "aria-label": label, className: `flex items-center justify-center gap-4 ${className}`, children: providers.map((provider) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
59
+ "a",
60
+ {
61
+ href: provider.href,
62
+ "aria-label": getLabel(provider),
63
+ className: "block rounded-xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
64
+ onClick: (event) => {
65
+ onProviderClick?.(provider, event);
66
+ },
67
+ children: typeof provider.icon === "string" ? /* @__PURE__ */ jsx(
68
+ Icon,
69
+ {
70
+ "aria-hidden": "true",
71
+ icon: provider.icon,
72
+ className: "border-primary/40 shadow-primary/50 h-12 w-12 shrink-0 rounded-xl border bg-white/90 p-2.5 shadow-sm backdrop-blur-sm transition-transform duration-500 hover:scale-110 motion-reduce:transition-none"
73
+ }
74
+ ) : provider.icon
75
+ }
76
+ ) }, provider.name)) });
77
+ }, "SocialAuth");
71
78
 
72
- export { AuthBottomInstructions };
79
+ export { AuthBottomInstructions, SocialAuth };
73
80
  //# sourceMappingURL=index.js.map
74
81
  //# sourceMappingURL=index.js.map