@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
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ui/GradientText.tsx","../../src/auth/AuthBottomInstructions.tsx"],"names":["jsx"],"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,uBACE,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,SAAA,E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AA;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.js","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":["jsx"],"mappings":";;;;;;AA6CA,IAAM,iCAAiB,MAAA,CAAA,CAAC,EAAE,KAAA,EAAO,OAAA,uBAC/B,IAAA,CAAA,QAAA,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,uBACE,GAAA,CAAC,OAAG,GAAG,MAAA,EAAQ,WAAW,CAAA,sBAAA,EAAyB,SAAS,IACzD,QAAA,EAAA,OAAA,CAAQ;AAAA,IACP,KAAA,kBACE,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAI,KAAA;AAAA,QACL,EAAA,EAAI,IAAA;AAAA,QACJ,IAAA,EAAK,QAAA;AAAA,QACL,IAAA,EAAM,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;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.js","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"]}
@@ -0,0 +1,34 @@
1
+ import type { MouseEvent, ReactNode } from 'react';
2
+ import type { IClassName } from '../types/component.js';
3
+ export interface IBreadcrumbItem {
4
+ /** What is written for the item. */
5
+ label: ReactNode;
6
+ /**
7
+ * Where the item goes. Without one it is plain text. The last item is the page the person is on: it
8
+ * is never a link, whatever it has.
9
+ */
10
+ href?: string;
11
+ }
12
+ export interface IBreadcrumb extends IClassName {
13
+ /** The path to the page, from the top: the last one is the page itself. */
14
+ items: readonly IBreadcrumbItem[];
15
+ /**
16
+ * Called when an item is pressed with a plain click, in place of the browser going to the address:
17
+ * the app goes there itself, with its router, without loading the page. A click with a modifier
18
+ * (new tab, new window) and a middle click are left to the browser, so the links keep working as
19
+ * links. Without it the links are plain links.
20
+ */
21
+ onNavigate?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;
22
+ /** The name of the navigation, for assistive technology. @default 'Breadcrumb' */
23
+ label?: string;
24
+ }
25
+ /**
26
+ * Where the person is in the site (Home › Products › Face), each step but the last a link to the page
27
+ * above it. It is a list in a `nav`, the last item is marked as the current page, and the arrows
28
+ * between the items are not read out. A path that is too long for the width scrolls, with a fade.
29
+ *
30
+ * The router is the app's: the links are plain `<a href>`; give `onNavigate` to go there without
31
+ * loading the page. `getBreadcrumbItems()` makes the items from a path.
32
+ */
33
+ export declare const Breadcrumb: ({ items, onNavigate, label, className, }: IBreadcrumb) => import("react").JSX.Element | null;
34
+ //# sourceMappingURL=Breadcrumb.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.d.cts","sourceRoot":"","sources":["../../src/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,2EAA2E;IAC3E,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1E,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,0CAKxB,WAAW,uCAkDb,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { MouseEvent, ReactNode } from 'react';
2
+ import type { IClassName } from '../types/component.js';
3
+ export interface IBreadcrumbItem {
4
+ /** What is written for the item. */
5
+ label: ReactNode;
6
+ /**
7
+ * Where the item goes. Without one it is plain text. The last item is the page the person is on: it
8
+ * is never a link, whatever it has.
9
+ */
10
+ href?: string;
11
+ }
12
+ export interface IBreadcrumb extends IClassName {
13
+ /** The path to the page, from the top: the last one is the page itself. */
14
+ items: readonly IBreadcrumbItem[];
15
+ /**
16
+ * Called when an item is pressed with a plain click, in place of the browser going to the address:
17
+ * the app goes there itself, with its router, without loading the page. A click with a modifier
18
+ * (new tab, new window) and a middle click are left to the browser, so the links keep working as
19
+ * links. Without it the links are plain links.
20
+ */
21
+ onNavigate?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;
22
+ /** The name of the navigation, for assistive technology. @default 'Breadcrumb' */
23
+ label?: string;
24
+ }
25
+ /**
26
+ * Where the person is in the site (Home › Products › Face), each step but the last a link to the page
27
+ * above it. It is a list in a `nav`, the last item is marked as the current page, and the arrows
28
+ * between the items are not read out. A path that is too long for the width scrolls, with a fade.
29
+ *
30
+ * The router is the app's: the links are plain `<a href>`; give `onNavigate` to go there without
31
+ * loading the page. `getBreadcrumbItems()` makes the items from a path.
32
+ */
33
+ export declare const Breadcrumb: ({ items, onNavigate, label, className, }: IBreadcrumb) => import("react").JSX.Element | null;
34
+ //# sourceMappingURL=Breadcrumb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Breadcrumb.d.ts","sourceRoot":"","sources":["../../src/breadcrumb/Breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGxD,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACpC,KAAK,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,2EAA2E;IAC3E,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1E,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAWD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,0CAKxB,WAAW,uCAkDb,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Registers the icons above with Iconify; the components of this entry call it when they render
3
+ * (calling it again is harmless).
4
+ */
5
+ export declare const registerBreadcrumbIcons: () => void, BREADCRUMB_ICON_NAMES: string[];
6
+ //# sourceMappingURL=breadcrumb-icons.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb-icons.d.cts","sourceRoot":"","sources":["../../src/breadcrumb/breadcrumb-icons.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,eAAO,MAAkB,uBAAuB,cAAS,qBAAqB,UAC/C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Registers the icons above with Iconify; the components of this entry call it when they render
3
+ * (calling it again is harmless).
4
+ */
5
+ export declare const registerBreadcrumbIcons: () => void, BREADCRUMB_ICON_NAMES: string[];
6
+ //# sourceMappingURL=breadcrumb-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb-icons.d.ts","sourceRoot":"","sources":["../../src/breadcrumb/breadcrumb-icons.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,eAAO,MAAkB,uBAAuB,cAAS,qBAAqB,UAC/C,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { IBreadcrumbItem } from './Breadcrumb.js';
2
+ export interface IBreadcrumbPathOptions {
3
+ /** What the first item says. @default 'Home' */
4
+ homeLabel?: string;
5
+ /** Where the first item goes. @default '/' */
6
+ homeHref?: string;
7
+ /** Makes the text of a step from its part of the path. The default turns `skin-care` into `skin care`. */
8
+ formatSegment?: (segment: string) => string;
9
+ }
10
+ /**
11
+ * The items of a breadcrumb for an address: `/products/skin-care/serum` is Home, products, skin care
12
+ * and serum, each with the address of the page it goes to. The query string and the hash are left out,
13
+ * and so are empty parts (`//`, a slash at the end).
14
+ */
15
+ export declare const getBreadcrumbItems: (pathname: string, { homeLabel, homeHref, formatSegment, }?: IBreadcrumbPathOptions) => IBreadcrumbItem[];
16
+ //# sourceMappingURL=getBreadcrumbItems.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBreadcrumbItems.d.cts","sourceRoot":"","sources":["../../src/breadcrumb/getBreadcrumbItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0GAA0G;IAC1G,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAcD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,0CAIG,sBAA2B,KAC7B,eAAe,EAWjB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { IBreadcrumbItem } from './Breadcrumb.js';
2
+ export interface IBreadcrumbPathOptions {
3
+ /** What the first item says. @default 'Home' */
4
+ homeLabel?: string;
5
+ /** Where the first item goes. @default '/' */
6
+ homeHref?: string;
7
+ /** Makes the text of a step from its part of the path. The default turns `skin-care` into `skin care`. */
8
+ formatSegment?: (segment: string) => string;
9
+ }
10
+ /**
11
+ * The items of a breadcrumb for an address: `/products/skin-care/serum` is Home, products, skin care
12
+ * and serum, each with the address of the page it goes to. The query string and the hash are left out,
13
+ * and so are empty parts (`//`, a slash at the end).
14
+ */
15
+ export declare const getBreadcrumbItems: (pathname: string, { homeLabel, homeHref, formatSegment, }?: IBreadcrumbPathOptions) => IBreadcrumbItem[];
16
+ //# sourceMappingURL=getBreadcrumbItems.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBreadcrumbItems.d.ts","sourceRoot":"","sources":["../../src/breadcrumb/getBreadcrumbItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0GAA0G;IAC1G,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C;AAcD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU,MAAM,EAChB,0CAIG,sBAA2B,KAC7B,eAAe,EAWjB,CAAC"}
@@ -0,0 +1,110 @@
1
+ 'use strict';
2
+
3
+ var react = require('@iconify/react');
4
+ var layout = require('@beautinique/frontend-components/layout');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ var createIconRegistry = /* @__PURE__ */ __name((sets) => {
10
+ let registered = false;
11
+ return {
12
+ register: /* @__PURE__ */ __name(() => {
13
+ if (registered) return;
14
+ for (const set of sets) react.addCollection(set);
15
+ registered = true;
16
+ }, "register"),
17
+ names: sets.flatMap(
18
+ ({ prefix, icons, aliases }) => [...Object.keys(icons), ...Object.keys(aliases ?? {})].map((name) => `${prefix}:${name}`)
19
+ )
20
+ };
21
+ }, "createIconRegistry");
22
+
23
+ // src/breadcrumb/breadcrumb-icons.ts
24
+ var ICON_SETS = [
25
+ {
26
+ prefix: "solar",
27
+ width: 24,
28
+ height: 24,
29
+ icons: {
30
+ "alt-arrow-right-linear": {
31
+ body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 5L15 12L9 19"/>'
32
+ }
33
+ }
34
+ }
35
+ ];
36
+ var { register: registerBreadcrumbIcons, names: BREADCRUMB_ICON_NAMES } = createIconRegistry(ICON_SETS);
37
+ var isPlainClick = /* @__PURE__ */ __name((event) => event.button === 0 && !event.defaultPrevented && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && (event.currentTarget.target === "" || event.currentTarget.target === "_self"), "isPlainClick");
38
+ var Breadcrumb = /* @__PURE__ */ __name(({
39
+ items,
40
+ onNavigate,
41
+ label = "Breadcrumb",
42
+ className = ""
43
+ }) => {
44
+ registerBreadcrumbIcons();
45
+ if (items.length === 0) return null;
46
+ return /* @__PURE__ */ jsxRuntime.jsx(layout.ScrollableGradientContainer, { direction: "horizontal", className: "[&>div]:justify-start", children: /* @__PURE__ */ jsxRuntime.jsx("nav", { "aria-label": label, className: `text-secondary ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "flex items-center gap-2", children: items.map((item, index) => {
47
+ const isLast = index === items.length - 1;
48
+ const href = isLast ? void 0 : item.href;
49
+ return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-center gap-2 truncate", children: [
50
+ href === void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
51
+ "span",
52
+ {
53
+ "aria-current": isLast ? "page" : void 0,
54
+ className: `truncate capitalize ${isLast ? "opacity-80" : ""}`,
55
+ children: item.label
56
+ }
57
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
58
+ "a",
59
+ {
60
+ href,
61
+ className: "cursor-pointer truncate capitalize focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
62
+ onClick: (event) => {
63
+ if (!onNavigate || !isPlainClick(event)) return;
64
+ event.preventDefault();
65
+ onNavigate(href, event);
66
+ },
67
+ children: item.label
68
+ }
69
+ ),
70
+ !isLast && /* @__PURE__ */ jsxRuntime.jsx(
71
+ react.Icon,
72
+ {
73
+ "aria-hidden": "true",
74
+ icon: "solar:alt-arrow-right-linear",
75
+ className: "shrink-0"
76
+ }
77
+ )
78
+ ] }, index);
79
+ }) }) }) });
80
+ }, "Breadcrumb");
81
+
82
+ // src/breadcrumb/getBreadcrumbItems.ts
83
+ var safeDecode = /* @__PURE__ */ __name((segment) => {
84
+ try {
85
+ return decodeURIComponent(segment);
86
+ } catch {
87
+ return segment;
88
+ }
89
+ }, "safeDecode");
90
+ var defaultFormat = /* @__PURE__ */ __name((segment) => safeDecode(segment).replaceAll(/[-_]+/g, " "), "defaultFormat");
91
+ var getBreadcrumbItems = /* @__PURE__ */ __name((pathname, {
92
+ homeLabel = "Home",
93
+ homeHref = "/",
94
+ formatSegment = defaultFormat
95
+ } = {}) => {
96
+ const path = pathname.split(/[?#]/, 1).at(0) ?? "";
97
+ const segments = path.split("/").filter(Boolean);
98
+ return [
99
+ { label: homeLabel, href: homeHref },
100
+ ...segments.map((segment, index) => ({
101
+ label: formatSegment(segment),
102
+ href: `/${segments.slice(0, index + 1).join("/")}`
103
+ }))
104
+ ];
105
+ }, "getBreadcrumbItems");
106
+
107
+ exports.Breadcrumb = Breadcrumb;
108
+ exports.getBreadcrumbItems = getBreadcrumbItems;
109
+ //# sourceMappingURL=index.cjs.map
110
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/icon-registry.ts","../../src/breadcrumb/breadcrumb-icons.ts","../../src/breadcrumb/Breadcrumb.tsx","../../src/breadcrumb/getBreadcrumbItems.ts"],"names":["addCollection","jsx","ScrollableGradientContainer","jsxs","Icon"],"mappings":";;;;;;;;AAUO,IAAM,kBAAA,2BAAsB,IAAA,KAAiC;AAClE,EAAA,IAAI,UAAA,GAAa,KAAA;AAEjB,EAAA,OAAO;AAAA,IACL,0BAAU,MAAA,CAAA,MAAM;AACd,MAAA,IAAI,UAAA,EAAY;AAEhB,MAAA,KAAA,MAAW,GAAA,IAAO,IAAA,EAAMA,mBAAA,CAAc,GAAG,CAAA;AACzC,MAAA,UAAA,GAAa,IAAA;AAAA,IACf,CAAA,EALU,UAAA,CAAA;AAAA,IAMV,OAAO,IAAA,CAAK,OAAA;AAAA,MAAQ,CAAC,EAAE,M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EAlBkC,oBAAA","file":"index.cjs","sourcesContent":["import { addCollection, type IconifyJSON } from '@iconify/react';\n\n/**\n * Makes the registration of a bundled icon set: `register` puts the sets in Iconify (once, calling it\n * again does nothing) and `names` lists every icon, e.g. `solar:info-circle-linear`.\n *\n * A component calls `register` when it renders, not when its file is imported: an app that never\n * renders the component never runs it, and nothing depends on the bundler keeping an import that is\n * only there for its effect (the build says \"ignored-bare-import\" for those).\n */\nexport const createIconRegistry = (sets: readonly IconifyJSON[]) => {\n let registered = false;\n\n return {\n register: () => {\n if (registered) return;\n\n for (const set of sets) addCollection(set);\n registered = true;\n },\n names: sets.flatMap(({ prefix, icons, aliases }) =>\n [...Object.keys(icons), ...Object.keys(aliases ?? {})].map((name) => `${prefix}:${name}`),\n ),\n };\n};\n","import type { IconifyJSON } from '@iconify/react';\n\nimport { createIconRegistry } from '../lib/icon-registry.js';\n\n/*\n * The icons of the separator of the breadcrumb, bundled so they show without a network and without waiting for the\n * Iconify API (see `toast/toast-icons.ts`). The data is what\n * `https://api.iconify.design/<prefix>.json?icons=<name>` answers.\n */\nconst ICON_SETS: IconifyJSON[] = [\n {\n prefix: 'solar',\n width: 24,\n height: 24,\n icons: {\n 'alt-arrow-right-linear': {\n body: '<path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" d=\"M9 5L15 12L9 19\"/>',\n },\n },\n },\n];\n\n/**\n * Registers the icons above with Iconify; the components of this entry call it when they render\n * (calling it again is harmless).\n */\nexport const { register: registerBreadcrumbIcons, names: BREADCRUMB_ICON_NAMES } =\n createIconRegistry(ICON_SETS);\n","import { Icon } from '@iconify/react';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { ScrollableGradientContainer } from '../layout/index.js';\nimport type { IClassName } from '../types/component.js';\nimport { registerBreadcrumbIcons } from './breadcrumb-icons.js';\n\nexport interface IBreadcrumbItem {\n /** What is written for the item. */\n label: ReactNode;\n /**\n * Where the item goes. Without one it is plain text. The last item is the page the person is on: it\n * is never a link, whatever it has.\n */\n href?: string;\n}\n\nexport interface IBreadcrumb extends IClassName {\n /** The path to the page, from the top: the last one is the page itself. */\n items: readonly IBreadcrumbItem[];\n /**\n * Called when an item is pressed with a plain click, in place of the browser going to the address:\n * the app goes there itself, with its router, without loading the page. A click with a modifier\n * (new tab, new window) and a middle click are left to the browser, so the links keep working as\n * links. Without it the links are plain links.\n */\n onNavigate?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;\n /** The name of the navigation, for assistive technology. @default 'Breadcrumb' */\n label?: string;\n}\n\nconst isPlainClick = (event: MouseEvent<HTMLAnchorElement>) =>\n event.button === 0 &&\n !event.defaultPrevented &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n (event.currentTarget.target === '' || event.currentTarget.target === '_self');\n\n/**\n * Where the person is in the site (Home › Products › Face), each step but the last a link to the page\n * above it. It is a list in a `nav`, the last item is marked as the current page, and the arrows\n * between the items are not read out. A path that is too long for the width scrolls, with a fade.\n *\n * The router is the app's: the links are plain `<a href>`; give `onNavigate` to go there without\n * loading the page. `getBreadcrumbItems()` makes the items from a path.\n */\nexport const Breadcrumb = ({\n items,\n onNavigate,\n label = 'Breadcrumb',\n className = '',\n}: IBreadcrumb) => {\n registerBreadcrumbIcons();\n\n if (items.length === 0) return null;\n\n return (\n <ScrollableGradientContainer direction=\"horizontal\" className=\"[&>div]:justify-start\">\n <nav aria-label={label} className={`text-secondary ${className}`}>\n <ol className=\"flex items-center gap-2\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const href = isLast ? undefined : item.href;\n\n return (\n <li key={index} className=\"flex items-center gap-2 truncate\">\n {href === undefined ? (\n <span\n aria-current={isLast ? 'page' : undefined}\n className={`truncate capitalize ${isLast ? 'opacity-80' : ''}`}\n >\n {item.label}\n </span>\n ) : (\n <a\n href={href}\n className=\"cursor-pointer truncate capitalize focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c\"\n onClick={(event) => {\n if (!onNavigate || !isPlainClick(event)) return;\n\n event.preventDefault();\n onNavigate(href, event);\n }}\n >\n {item.label}\n </a>\n )}\n {!isLast && (\n <Icon\n aria-hidden=\"true\"\n icon=\"solar:alt-arrow-right-linear\"\n className=\"shrink-0\"\n />\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n </ScrollableGradientContainer>\n );\n};\n","import type { IBreadcrumbItem } from './Breadcrumb.js';\n\nexport interface IBreadcrumbPathOptions {\n /** What the first item says. @default 'Home' */\n homeLabel?: string;\n /** Where the first item goes. @default '/' */\n homeHref?: string;\n /** Makes the text of a step from its part of the path. The default turns `skin-care` into `skin care`. */\n formatSegment?: (segment: string) => string;\n}\n\nconst safeDecode = (segment: string) => {\n try {\n return decodeURIComponent(segment);\n } catch {\n // a `%` that is not an escape: the text as it is\n return segment;\n }\n};\n\n/** `skin-care` and `skin_care` read `skin care`; `%20` is a space. */\nconst defaultFormat = (segment: string) => safeDecode(segment).replaceAll(/[-_]+/g, ' ');\n\n/**\n * The items of a breadcrumb for an address: `/products/skin-care/serum` is Home, products, skin care\n * and serum, each with the address of the page it goes to. The query string and the hash are left out,\n * and so are empty parts (`//`, a slash at the end).\n */\nexport const getBreadcrumbItems = (\n pathname: string,\n {\n homeLabel = 'Home',\n homeHref = '/',\n formatSegment = defaultFormat,\n }: IBreadcrumbPathOptions = {},\n): IBreadcrumbItem[] => {\n const path = pathname.split(/[?#]/, 1).at(0) ?? '';\n const segments = path.split('/').filter(Boolean);\n\n return [\n { label: homeLabel, href: homeHref },\n ...segments.map((segment, index) => ({\n label: formatSegment(segment),\n href: `/${segments.slice(0, index + 1).join('/')}`,\n })),\n ];\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export { Breadcrumb, type IBreadcrumb, type IBreadcrumbItem } from './Breadcrumb.js';
2
+ export { getBreadcrumbItems, type IBreadcrumbPathOptions } from './getBreadcrumbItems.js';
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/breadcrumb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { Breadcrumb, type IBreadcrumb, type IBreadcrumbItem } from './Breadcrumb.js';
2
+ export { getBreadcrumbItems, type IBreadcrumbPathOptions } from './getBreadcrumbItems.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/breadcrumb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,107 @@
1
+ import { addCollection, Icon } from '@iconify/react';
2
+ import { ScrollableGradientContainer } from '@beautinique/frontend-components/layout';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var createIconRegistry = /* @__PURE__ */ __name((sets) => {
8
+ let registered = false;
9
+ return {
10
+ register: /* @__PURE__ */ __name(() => {
11
+ if (registered) return;
12
+ for (const set of sets) addCollection(set);
13
+ registered = true;
14
+ }, "register"),
15
+ names: sets.flatMap(
16
+ ({ prefix, icons, aliases }) => [...Object.keys(icons), ...Object.keys(aliases ?? {})].map((name) => `${prefix}:${name}`)
17
+ )
18
+ };
19
+ }, "createIconRegistry");
20
+
21
+ // src/breadcrumb/breadcrumb-icons.ts
22
+ var ICON_SETS = [
23
+ {
24
+ prefix: "solar",
25
+ width: 24,
26
+ height: 24,
27
+ icons: {
28
+ "alt-arrow-right-linear": {
29
+ body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M9 5L15 12L9 19"/>'
30
+ }
31
+ }
32
+ }
33
+ ];
34
+ var { register: registerBreadcrumbIcons, names: BREADCRUMB_ICON_NAMES } = createIconRegistry(ICON_SETS);
35
+ var isPlainClick = /* @__PURE__ */ __name((event) => event.button === 0 && !event.defaultPrevented && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey && (event.currentTarget.target === "" || event.currentTarget.target === "_self"), "isPlainClick");
36
+ var Breadcrumb = /* @__PURE__ */ __name(({
37
+ items,
38
+ onNavigate,
39
+ label = "Breadcrumb",
40
+ className = ""
41
+ }) => {
42
+ registerBreadcrumbIcons();
43
+ if (items.length === 0) return null;
44
+ return /* @__PURE__ */ jsx(ScrollableGradientContainer, { direction: "horizontal", className: "[&>div]:justify-start", children: /* @__PURE__ */ jsx("nav", { "aria-label": label, className: `text-secondary ${className}`, children: /* @__PURE__ */ jsx("ol", { className: "flex items-center gap-2", children: items.map((item, index) => {
45
+ const isLast = index === items.length - 1;
46
+ const href = isLast ? void 0 : item.href;
47
+ return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2 truncate", children: [
48
+ href === void 0 ? /* @__PURE__ */ jsx(
49
+ "span",
50
+ {
51
+ "aria-current": isLast ? "page" : void 0,
52
+ className: `truncate capitalize ${isLast ? "opacity-80" : ""}`,
53
+ children: item.label
54
+ }
55
+ ) : /* @__PURE__ */ jsx(
56
+ "a",
57
+ {
58
+ href,
59
+ className: "cursor-pointer truncate capitalize focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c",
60
+ onClick: (event) => {
61
+ if (!onNavigate || !isPlainClick(event)) return;
62
+ event.preventDefault();
63
+ onNavigate(href, event);
64
+ },
65
+ children: item.label
66
+ }
67
+ ),
68
+ !isLast && /* @__PURE__ */ jsx(
69
+ Icon,
70
+ {
71
+ "aria-hidden": "true",
72
+ icon: "solar:alt-arrow-right-linear",
73
+ className: "shrink-0"
74
+ }
75
+ )
76
+ ] }, index);
77
+ }) }) }) });
78
+ }, "Breadcrumb");
79
+
80
+ // src/breadcrumb/getBreadcrumbItems.ts
81
+ var safeDecode = /* @__PURE__ */ __name((segment) => {
82
+ try {
83
+ return decodeURIComponent(segment);
84
+ } catch {
85
+ return segment;
86
+ }
87
+ }, "safeDecode");
88
+ var defaultFormat = /* @__PURE__ */ __name((segment) => safeDecode(segment).replaceAll(/[-_]+/g, " "), "defaultFormat");
89
+ var getBreadcrumbItems = /* @__PURE__ */ __name((pathname, {
90
+ homeLabel = "Home",
91
+ homeHref = "/",
92
+ formatSegment = defaultFormat
93
+ } = {}) => {
94
+ const path = pathname.split(/[?#]/, 1).at(0) ?? "";
95
+ const segments = path.split("/").filter(Boolean);
96
+ return [
97
+ { label: homeLabel, href: homeHref },
98
+ ...segments.map((segment, index) => ({
99
+ label: formatSegment(segment),
100
+ href: `/${segments.slice(0, index + 1).join("/")}`
101
+ }))
102
+ ];
103
+ }, "getBreadcrumbItems");
104
+
105
+ export { Breadcrumb, getBreadcrumbItems };
106
+ //# sourceMappingURL=index.js.map
107
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/icon-registry.ts","../../src/breadcrumb/breadcrumb-icons.ts","../../src/breadcrumb/Breadcrumb.tsx","../../src/breadcrumb/getBreadcrumbItems.ts"],"names":[],"mappings":";;;;;;AAUO,IAAM,kBAAA,2BAAsB,IAAA,KAAiC;AAClE,EAAA,IAAI,UAAA,GAAa,KAAA;AAEjB,EAAA,OAAO;AAAA,IACL,0BAAU,MAAA,CAAA,MAAM;AACd,MAAA,IAAI,UAAA,EAAY;AAEhB,MAAA,KAAA,MAAW,GAAA,IAAO,IAAA,EAAM,aAAA,CAAc,GAAG,CAAA;AACzC,MAAA,UAAA,GAAa,IAAA;AAAA,IACf,CAAA,EAL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AAA,CAAK,GAAG,CAAC,CAAA;AAAA,KAClD,CAAE;AAAA,GACJ;AACF,CAAA,EAlBkC,oBAAA","file":"index.js","sourcesContent":["import { addCollection, type IconifyJSON } from '@iconify/react';\n\n/**\n * Makes the registration of a bundled icon set: `register` puts the sets in Iconify (once, calling it\n * again does nothing) and `names` lists every icon, e.g. `solar:info-circle-linear`.\n *\n * A component calls `register` when it renders, not when its file is imported: an app that never\n * renders the component never runs it, and nothing depends on the bundler keeping an import that is\n * only there for its effect (the build says \"ignored-bare-import\" for those).\n */\nexport const createIconRegistry = (sets: readonly IconifyJSON[]) => {\n let registered = false;\n\n return {\n register: () => {\n if (registered) return;\n\n for (const set of sets) addCollection(set);\n registered = true;\n },\n names: sets.flatMap(({ prefix, icons, aliases }) =>\n [...Object.keys(icons), ...Object.keys(aliases ?? {})].map((name) => `${prefix}:${name}`),\n ),\n };\n};\n","import type { IconifyJSON } from '@iconify/react';\n\nimport { createIconRegistry } from '../lib/icon-registry.js';\n\n/*\n * The icons of the separator of the breadcrumb, bundled so they show without a network and without waiting for the\n * Iconify API (see `toast/toast-icons.ts`). The data is what\n * `https://api.iconify.design/<prefix>.json?icons=<name>` answers.\n */\nconst ICON_SETS: IconifyJSON[] = [\n {\n prefix: 'solar',\n width: 24,\n height: 24,\n icons: {\n 'alt-arrow-right-linear': {\n body: '<path fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" d=\"M9 5L15 12L9 19\"/>',\n },\n },\n },\n];\n\n/**\n * Registers the icons above with Iconify; the components of this entry call it when they render\n * (calling it again is harmless).\n */\nexport const { register: registerBreadcrumbIcons, names: BREADCRUMB_ICON_NAMES } =\n createIconRegistry(ICON_SETS);\n","import { Icon } from '@iconify/react';\nimport type { MouseEvent, ReactNode } from 'react';\n\nimport { ScrollableGradientContainer } from '../layout/index.js';\nimport type { IClassName } from '../types/component.js';\nimport { registerBreadcrumbIcons } from './breadcrumb-icons.js';\n\nexport interface IBreadcrumbItem {\n /** What is written for the item. */\n label: ReactNode;\n /**\n * Where the item goes. Without one it is plain text. The last item is the page the person is on: it\n * is never a link, whatever it has.\n */\n href?: string;\n}\n\nexport interface IBreadcrumb extends IClassName {\n /** The path to the page, from the top: the last one is the page itself. */\n items: readonly IBreadcrumbItem[];\n /**\n * Called when an item is pressed with a plain click, in place of the browser going to the address:\n * the app goes there itself, with its router, without loading the page. A click with a modifier\n * (new tab, new window) and a middle click are left to the browser, so the links keep working as\n * links. Without it the links are plain links.\n */\n onNavigate?: (href: string, event: MouseEvent<HTMLAnchorElement>) => void;\n /** The name of the navigation, for assistive technology. @default 'Breadcrumb' */\n label?: string;\n}\n\nconst isPlainClick = (event: MouseEvent<HTMLAnchorElement>) =>\n event.button === 0 &&\n !event.defaultPrevented &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey &&\n !event.altKey &&\n (event.currentTarget.target === '' || event.currentTarget.target === '_self');\n\n/**\n * Where the person is in the site (Home › Products › Face), each step but the last a link to the page\n * above it. It is a list in a `nav`, the last item is marked as the current page, and the arrows\n * between the items are not read out. A path that is too long for the width scrolls, with a fade.\n *\n * The router is the app's: the links are plain `<a href>`; give `onNavigate` to go there without\n * loading the page. `getBreadcrumbItems()` makes the items from a path.\n */\nexport const Breadcrumb = ({\n items,\n onNavigate,\n label = 'Breadcrumb',\n className = '',\n}: IBreadcrumb) => {\n registerBreadcrumbIcons();\n\n if (items.length === 0) return null;\n\n return (\n <ScrollableGradientContainer direction=\"horizontal\" className=\"[&>div]:justify-start\">\n <nav aria-label={label} className={`text-secondary ${className}`}>\n <ol className=\"flex items-center gap-2\">\n {items.map((item, index) => {\n const isLast = index === items.length - 1;\n const href = isLast ? undefined : item.href;\n\n return (\n <li key={index} className=\"flex items-center gap-2 truncate\">\n {href === undefined ? (\n <span\n aria-current={isLast ? 'page' : undefined}\n className={`truncate capitalize ${isLast ? 'opacity-80' : ''}`}\n >\n {item.label}\n </span>\n ) : (\n <a\n href={href}\n className=\"cursor-pointer truncate capitalize focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-crayola-c\"\n onClick={(event) => {\n if (!onNavigate || !isPlainClick(event)) return;\n\n event.preventDefault();\n onNavigate(href, event);\n }}\n >\n {item.label}\n </a>\n )}\n {!isLast && (\n <Icon\n aria-hidden=\"true\"\n icon=\"solar:alt-arrow-right-linear\"\n className=\"shrink-0\"\n />\n )}\n </li>\n );\n })}\n </ol>\n </nav>\n </ScrollableGradientContainer>\n );\n};\n","import type { IBreadcrumbItem } from './Breadcrumb.js';\n\nexport interface IBreadcrumbPathOptions {\n /** What the first item says. @default 'Home' */\n homeLabel?: string;\n /** Where the first item goes. @default '/' */\n homeHref?: string;\n /** Makes the text of a step from its part of the path. The default turns `skin-care` into `skin care`. */\n formatSegment?: (segment: string) => string;\n}\n\nconst safeDecode = (segment: string) => {\n try {\n return decodeURIComponent(segment);\n } catch {\n // a `%` that is not an escape: the text as it is\n return segment;\n }\n};\n\n/** `skin-care` and `skin_care` read `skin care`; `%20` is a space. */\nconst defaultFormat = (segment: string) => safeDecode(segment).replaceAll(/[-_]+/g, ' ');\n\n/**\n * The items of a breadcrumb for an address: `/products/skin-care/serum` is Home, products, skin care\n * and serum, each with the address of the page it goes to. The query string and the hash are left out,\n * and so are empty parts (`//`, a slash at the end).\n */\nexport const getBreadcrumbItems = (\n pathname: string,\n {\n homeLabel = 'Home',\n homeHref = '/',\n formatSegment = defaultFormat,\n }: IBreadcrumbPathOptions = {},\n): IBreadcrumbItem[] => {\n const path = pathname.split(/[?#]/, 1).at(0) ?? '';\n const segments = path.split('/').filter(Boolean);\n\n return [\n { label: homeLabel, href: homeHref },\n ...segments.map((segment, index) => ({\n label: formatSegment(segment),\n href: `/${segments.slice(0, index + 1).join('/')}`,\n })),\n ];\n};\n"]}
@@ -0,0 +1,33 @@
1
+
2
+ import { type IFieldBase } from '../inputs/index.js';
3
+ import { type TDropdownPlacement } from '../lib/dropdown-position.js';
4
+ export interface IColorInput extends IFieldBase {
5
+ /** The colour, in hexadecimal (`#ff00aa`). Anything else is shown as black. */
6
+ value?: string;
7
+ /** Gets the colour, in hexadecimal, as the person changes it. */
8
+ onChange?: (value: string) => void;
9
+ disabled?: boolean;
10
+ /** What the field says while there is no `value`. */
11
+ placeholder?: string;
12
+ /** The `id` of the field, for something that has to point at it. */
13
+ id?: string;
14
+ /** Which side of the field the picker opens on, unless there is no room there. @default 'bottom' */
15
+ position?: TDropdownPlacement;
16
+ /** Leave out the slider and the field of the alpha (the transparency). @default false */
17
+ hideAlpha?: boolean;
18
+ /** The name of the picker for assistive technology, when the field has no `label`. @default 'Colour picker' */
19
+ pickerLabel?: string;
20
+ }
21
+ /**
22
+ * A field that shows a colour and opens a picker to change it (`react-color-palette`, which this
23
+ * entry needs: install it). The field is one button, so the keyboard reaches it; the picker is a
24
+ * dialog that holds the focus until it is closed (Escape, a press outside, or the field again) and
25
+ * gives it back. The sliders need a mouse or a finger; the fields in the picker (hex, rgb) do not:
26
+ * the colour can be typed.
27
+ *
28
+ * The picker is drawn in `document.body`, so a parent that scrolls or hides what overflows does not
29
+ * cut it; it opens on the other side when there is no room, and follows the field while the page
30
+ * scrolls.
31
+ */
32
+ export declare const ColorInput: ({ label, value, error, disabled, placeholder, onChange, id, containerClassName, className, position, hideAlpha, pickerLabel, }: IColorInput) => import("react").JSX.Element;
33
+ //# sourceMappingURL=ColorInput.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorInput.d.cts","sourceRoot":"","sources":["../../src/color-input/ColorInput.tsx"],"names":[],"mappings":"AAAA,OAAO,8CAA8C,CAAC;AAOtD,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQxF,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+GAA+G;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,gIAaxB,WAAW,gCAuHb,CAAC"}
@@ -0,0 +1,33 @@
1
+
2
+ import { type IFieldBase } from '../inputs/index.js';
3
+ import { type TDropdownPlacement } from '../lib/dropdown-position.js';
4
+ export interface IColorInput extends IFieldBase {
5
+ /** The colour, in hexadecimal (`#ff00aa`). Anything else is shown as black. */
6
+ value?: string;
7
+ /** Gets the colour, in hexadecimal, as the person changes it. */
8
+ onChange?: (value: string) => void;
9
+ disabled?: boolean;
10
+ /** What the field says while there is no `value`. */
11
+ placeholder?: string;
12
+ /** The `id` of the field, for something that has to point at it. */
13
+ id?: string;
14
+ /** Which side of the field the picker opens on, unless there is no room there. @default 'bottom' */
15
+ position?: TDropdownPlacement;
16
+ /** Leave out the slider and the field of the alpha (the transparency). @default false */
17
+ hideAlpha?: boolean;
18
+ /** The name of the picker for assistive technology, when the field has no `label`. @default 'Colour picker' */
19
+ pickerLabel?: string;
20
+ }
21
+ /**
22
+ * A field that shows a colour and opens a picker to change it (`react-color-palette`, which this
23
+ * entry needs: install it). The field is one button, so the keyboard reaches it; the picker is a
24
+ * dialog that holds the focus until it is closed (Escape, a press outside, or the field again) and
25
+ * gives it back. The sliders need a mouse or a finger; the fields in the picker (hex, rgb) do not:
26
+ * the colour can be typed.
27
+ *
28
+ * The picker is drawn in `document.body`, so a parent that scrolls or hides what overflows does not
29
+ * cut it; it opens on the other side when there is no room, and follows the field while the page
30
+ * scrolls.
31
+ */
32
+ export declare const ColorInput: ({ label, value, error, disabled, placeholder, onChange, id, containerClassName, className, position, hideAlpha, pickerLabel, }: IColorInput) => import("react").JSX.Element;
33
+ //# sourceMappingURL=ColorInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorInput.d.ts","sourceRoot":"","sources":["../../src/color-input/ColorInput.tsx"],"names":[],"mappings":"AAAA,OAAO,8CAA8C,CAAC;AAOtD,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAQxF,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+GAA+G;IAC/G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,GAAI,gIAaxB,WAAW,gCAuHb,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Registers the icons above with Iconify; the components of this entry call it when they render
3
+ * (calling it again is harmless).
4
+ */
5
+ export declare const registerColorInputIcons: () => void, COLOR_INPUT_ICON_NAMES: string[];
6
+ //# sourceMappingURL=color-input-icons.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-input-icons.d.cts","sourceRoot":"","sources":["../../src/color-input/color-input-icons.ts"],"names":[],"mappings":"AAmCA;;;GAGG;AACH,eAAO,MAAkB,uBAAuB,cAAS,sBAAsB,UAChD,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Registers the icons above with Iconify; the components of this entry call it when they render
3
+ * (calling it again is harmless).
4
+ */
5
+ export declare const registerColorInputIcons: () => void, COLOR_INPUT_ICON_NAMES: string[];
6
+ //# sourceMappingURL=color-input-icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-input-icons.d.ts","sourceRoot":"","sources":["../../src/color-input/color-input-icons.ts"],"names":[],"mappings":"AAmCA;;;GAGG;AACH,eAAO,MAAkB,uBAAuB,cAAS,sBAAsB,UAChD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type IColor } from 'react-color-palette';
2
+ /** The colour used when there is none, or the text is not a colour. */
3
+ export declare const FALLBACK_COLOR = "#000000";
4
+ /** Whether `value` is a colour written in hexadecimal (`#fff`, `#ff00aa`, `#ff00aa80`). */
5
+ export declare const isHexColor: (value: string | undefined) => value is string;
6
+ /** The colour of a hexadecimal text; black for nothing and for text that is not a colour. */
7
+ export declare const toColor: (value: string | undefined) => IColor;
8
+ /** Two ways to write the same colour (`#FFF` and `#fff`)? Only the case is looked at. */
9
+ export declare const isSameHex: (a: string | undefined, b: string | undefined) => boolean;
10
+ //# sourceMappingURL=color.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.cts","sourceRoot":"","sources":["../../src/color-input/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAKhE,uEAAuE;AACvE,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,2FAA2F;AAC3F,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,KAAK,IAAI,MACxB,CAAC;AAEzC,6FAA6F;AAC7F,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MACqB,CAAC;AAE1E,yFAAyF;AACzF,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG,MAAM,GAAG,SAAS,YAC/B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type IColor } from 'react-color-palette';
2
+ /** The colour used when there is none, or the text is not a colour. */
3
+ export declare const FALLBACK_COLOR = "#000000";
4
+ /** Whether `value` is a colour written in hexadecimal (`#fff`, `#ff00aa`, `#ff00aa80`). */
5
+ export declare const isHexColor: (value: string | undefined) => value is string;
6
+ /** The colour of a hexadecimal text; black for nothing and for text that is not a colour. */
7
+ export declare const toColor: (value: string | undefined) => IColor;
8
+ /** Two ways to write the same colour (`#FFF` and `#fff`)? Only the case is looked at. */
9
+ export declare const isSameHex: (a: string | undefined, b: string | undefined) => boolean;
10
+ //# sourceMappingURL=color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/color-input/color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAKhE,uEAAuE;AACvE,eAAO,MAAM,cAAc,YAAY,CAAC;AAExC,2FAA2F;AAC3F,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,KAAK,IAAI,MACxB,CAAC;AAEzC,6FAA6F;AAC7F,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,GAAG,SAAS,KAAG,MACqB,CAAC;AAE1E,yFAAyF;AACzF,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,GAAG,SAAS,EAAE,GAAG,MAAM,GAAG,SAAS,YAC/B,CAAC"}