@regardio/react 0.3.2

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 (404) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +133 -0
  3. package/dist/components/background-slideshow.d.ts +22 -0
  4. package/dist/components/background-slideshow.d.ts.map +1 -0
  5. package/dist/components/background-slideshow.js +76 -0
  6. package/dist/components/blurry-gradient.d.ts +9 -0
  7. package/dist/components/blurry-gradient.d.ts.map +1 -0
  8. package/dist/components/blurry-gradient.js +6 -0
  9. package/dist/components/box.d.ts +17 -0
  10. package/dist/components/box.d.ts.map +1 -0
  11. package/dist/components/box.js +25 -0
  12. package/dist/components/carousel.d.ts +26 -0
  13. package/dist/components/carousel.d.ts.map +1 -0
  14. package/dist/components/carousel.js +87 -0
  15. package/dist/components/countdown.d.ts +2 -0
  16. package/dist/components/countdown.d.ts.map +1 -0
  17. package/dist/components/countdown.js +48 -0
  18. package/dist/components/definition-list.d.ts +40 -0
  19. package/dist/components/definition-list.d.ts.map +1 -0
  20. package/dist/components/definition-list.js +57 -0
  21. package/dist/components/generic-error.d.ts +23 -0
  22. package/dist/components/generic-error.d.ts.map +1 -0
  23. package/dist/components/generic-error.js +39 -0
  24. package/dist/components/heading.d.ts +24 -0
  25. package/dist/components/heading.d.ts.map +1 -0
  26. package/dist/components/heading.js +29 -0
  27. package/dist/components/highlight.d.ts +16 -0
  28. package/dist/components/highlight.d.ts.map +1 -0
  29. package/dist/components/highlight.js +19 -0
  30. package/dist/components/icon-button.d.ts +6 -0
  31. package/dist/components/icon-button.d.ts.map +1 -0
  32. package/dist/components/icon-button.js +6 -0
  33. package/dist/components/if.d.ts +8 -0
  34. package/dist/components/if.d.ts.map +1 -0
  35. package/dist/components/if.js +16 -0
  36. package/dist/components/iframe.d.ts +8 -0
  37. package/dist/components/iframe.d.ts.map +1 -0
  38. package/dist/components/iframe.js +3 -0
  39. package/dist/components/item.d.ts +67 -0
  40. package/dist/components/item.d.ts.map +1 -0
  41. package/dist/components/item.js +309 -0
  42. package/dist/components/leaflet-map.d.ts +33 -0
  43. package/dist/components/leaflet-map.d.ts.map +1 -0
  44. package/dist/components/leaflet-map.js +195 -0
  45. package/dist/components/link.d.ts +41 -0
  46. package/dist/components/link.d.ts.map +1 -0
  47. package/dist/components/link.js +111 -0
  48. package/dist/components/link.test.d.ts +2 -0
  49. package/dist/components/link.test.d.ts.map +1 -0
  50. package/dist/components/link.test.js +204 -0
  51. package/dist/components/list-item.d.ts +16 -0
  52. package/dist/components/list-item.d.ts.map +1 -0
  53. package/dist/components/list-item.js +19 -0
  54. package/dist/components/maptiler-map.d.ts +26 -0
  55. package/dist/components/maptiler-map.d.ts.map +1 -0
  56. package/dist/components/maptiler-map.js +116 -0
  57. package/dist/components/markdown-container.d.ts +20 -0
  58. package/dist/components/markdown-container.d.ts.map +1 -0
  59. package/dist/components/markdown-container.js +93 -0
  60. package/dist/components/password-input.d.ts +9 -0
  61. package/dist/components/password-input.d.ts.map +1 -0
  62. package/dist/components/password-input.js +13 -0
  63. package/dist/components/picture.d.ts +26 -0
  64. package/dist/components/picture.d.ts.map +1 -0
  65. package/dist/components/picture.js +36 -0
  66. package/dist/components/protected-email.d.ts +9 -0
  67. package/dist/components/protected-email.d.ts.map +1 -0
  68. package/dist/components/protected-email.js +16 -0
  69. package/dist/components/text.d.ts +17 -0
  70. package/dist/components/text.d.ts.map +1 -0
  71. package/dist/components/text.js +27 -0
  72. package/dist/components/unordered-list.d.ts +16 -0
  73. package/dist/components/unordered-list.d.ts.map +1 -0
  74. package/dist/components/unordered-list.js +21 -0
  75. package/dist/hooks/use-current-route-data.d.ts +2 -0
  76. package/dist/hooks/use-current-route-data.d.ts.map +1 -0
  77. package/dist/hooks/use-current-route-data.js +12 -0
  78. package/dist/hooks/use-focus-search.d.ts +3 -0
  79. package/dist/hooks/use-focus-search.d.ts.map +1 -0
  80. package/dist/hooks/use-focus-search.js +15 -0
  81. package/dist/hooks/use-matches-data.d.ts +2 -0
  82. package/dist/hooks/use-matches-data.d.ts.map +1 -0
  83. package/dist/hooks/use-matches-data.js +11 -0
  84. package/dist/hooks/use-media-query.d.ts +2 -0
  85. package/dist/hooks/use-media-query.d.ts.map +1 -0
  86. package/dist/hooks/use-media-query.js +16 -0
  87. package/dist/hooks/use-mobile.d.ts +2 -0
  88. package/dist/hooks/use-mobile.d.ts.map +1 -0
  89. package/dist/hooks/use-mobile.js +15 -0
  90. package/dist/hooks/use-nonce.d.ts +5 -0
  91. package/dist/hooks/use-nonce.d.ts.map +1 -0
  92. package/dist/hooks/use-nonce.js +9 -0
  93. package/dist/hooks/use-nonce.test.d.ts +2 -0
  94. package/dist/hooks/use-nonce.test.d.ts.map +1 -0
  95. package/dist/hooks/use-nonce.test.js +27 -0
  96. package/dist/hooks/use-orientation.d.ts +3 -0
  97. package/dist/hooks/use-orientation.d.ts.map +1 -0
  98. package/dist/hooks/use-orientation.js +25 -0
  99. package/dist/hooks/use-user.d.ts +15 -0
  100. package/dist/hooks/use-user.d.ts.map +1 -0
  101. package/dist/hooks/use-user.js +17 -0
  102. package/dist/shadcn/accordion.d.ts +25 -0
  103. package/dist/shadcn/accordion.d.ts.map +1 -0
  104. package/dist/shadcn/accordion.js +45 -0
  105. package/dist/shadcn/alert-dialog.d.ts +73 -0
  106. package/dist/shadcn/alert-dialog.d.ts.map +1 -0
  107. package/dist/shadcn/alert-dialog.js +93 -0
  108. package/dist/shadcn/alert.d.ts +34 -0
  109. package/dist/shadcn/alert.d.ts.map +1 -0
  110. package/dist/shadcn/alert.js +42 -0
  111. package/dist/shadcn/aspect-ratio.d.ts +6 -0
  112. package/dist/shadcn/aspect-ratio.d.ts.map +1 -0
  113. package/dist/shadcn/aspect-ratio.js +7 -0
  114. package/dist/shadcn/avatar.d.ts +16 -0
  115. package/dist/shadcn/avatar.d.ts.map +1 -0
  116. package/dist/shadcn/avatar.js +27 -0
  117. package/dist/shadcn/badge.d.ts +29 -0
  118. package/dist/shadcn/badge.d.ts.map +1 -0
  119. package/dist/shadcn/badge.js +29 -0
  120. package/dist/shadcn/breadcrumb.d.ts +42 -0
  121. package/dist/shadcn/breadcrumb.d.ts.map +1 -0
  122. package/dist/shadcn/breadcrumb.js +74 -0
  123. package/dist/shadcn/button.d.ts +38 -0
  124. package/dist/shadcn/button.d.ts.map +1 -0
  125. package/dist/shadcn/button.js +38 -0
  126. package/dist/shadcn/calendar.d.ts +23 -0
  127. package/dist/shadcn/calendar.d.ts.map +1 -0
  128. package/dist/shadcn/calendar.js +163 -0
  129. package/dist/shadcn/card.d.ts +31 -0
  130. package/dist/shadcn/card.d.ts.map +1 -0
  131. package/dist/shadcn/card.js +55 -0
  132. package/dist/shadcn/carousel.d.ts +51 -0
  133. package/dist/shadcn/carousel.d.ts.map +1 -0
  134. package/dist/shadcn/carousel.js +161 -0
  135. package/dist/shadcn/chart.d.ts +103 -0
  136. package/dist/shadcn/chart.d.ts.map +1 -0
  137. package/dist/shadcn/chart.js +248 -0
  138. package/dist/shadcn/checkbox.d.ts +8 -0
  139. package/dist/shadcn/checkbox.d.ts.map +1 -0
  140. package/dist/shadcn/checkbox.js +22 -0
  141. package/dist/shadcn/collapsible.d.ts +16 -0
  142. package/dist/shadcn/collapsible.d.ts.map +1 -0
  143. package/dist/shadcn/collapsible.js +19 -0
  144. package/dist/shadcn/command.d.ts +61 -0
  145. package/dist/shadcn/command.d.ts.map +1 -0
  146. package/dist/shadcn/command.js +123 -0
  147. package/dist/shadcn/context-menu.d.ts +107 -0
  148. package/dist/shadcn/context-menu.d.ts.map +1 -0
  149. package/dist/shadcn/context-menu.js +151 -0
  150. package/dist/shadcn/dialog.d.ts +57 -0
  151. package/dist/shadcn/dialog.d.ts.map +1 -0
  152. package/dist/shadcn/dialog.js +96 -0
  153. package/dist/shadcn/drawer.d.ts +54 -0
  154. package/dist/shadcn/drawer.d.ts.map +1 -0
  155. package/dist/shadcn/drawer.js +96 -0
  156. package/dist/shadcn/dropdown-menu.d.ts +110 -0
  157. package/dist/shadcn/dropdown-menu.d.ts.map +1 -0
  158. package/dist/shadcn/dropdown-menu.js +152 -0
  159. package/dist/shadcn/form.d.ts +59 -0
  160. package/dist/shadcn/form.d.ts.map +1 -0
  161. package/dist/shadcn/form.js +99 -0
  162. package/dist/shadcn/hover-card.d.ts +20 -0
  163. package/dist/shadcn/hover-card.d.ts.map +1 -0
  164. package/dist/shadcn/hover-card.js +26 -0
  165. package/dist/shadcn/input-otp.d.ts +25 -0
  166. package/dist/shadcn/input-otp.d.ts.map +1 -0
  167. package/dist/shadcn/input-otp.js +54 -0
  168. package/dist/shadcn/input.d.ts +14 -0
  169. package/dist/shadcn/input.d.ts.map +1 -0
  170. package/dist/shadcn/input.js +48 -0
  171. package/dist/shadcn/label.d.ts +8 -0
  172. package/dist/shadcn/label.d.ts.map +1 -0
  173. package/dist/shadcn/label.js +16 -0
  174. package/dist/shadcn/menubar.d.ts +108 -0
  175. package/dist/shadcn/menubar.d.ts.map +1 -0
  176. package/dist/shadcn/menubar.js +174 -0
  177. package/dist/shadcn/navigation-menu.d.ts +79 -0
  178. package/dist/shadcn/navigation-menu.d.ts.map +1 -0
  179. package/dist/shadcn/navigation-menu.js +108 -0
  180. package/dist/shadcn/pagination.d.ts +45 -0
  181. package/dist/shadcn/pagination.d.ts.map +1 -0
  182. package/dist/shadcn/pagination.js +83 -0
  183. package/dist/shadcn/popover.d.ts +19 -0
  184. package/dist/shadcn/popover.d.ts.map +1 -0
  185. package/dist/shadcn/popover.js +29 -0
  186. package/dist/shadcn/progress.d.ts +9 -0
  187. package/dist/shadcn/progress.d.ts.map +1 -0
  188. package/dist/shadcn/progress.js +17 -0
  189. package/dist/shadcn/radio-group.d.ts +12 -0
  190. package/dist/shadcn/radio-group.d.ts.map +1 -0
  191. package/dist/shadcn/radio-group.js +32 -0
  192. package/dist/shadcn/resizable.d.ts +20 -0
  193. package/dist/shadcn/resizable.d.ts.map +1 -0
  194. package/dist/shadcn/resizable.js +32 -0
  195. package/dist/shadcn/scroll-area.d.ts +16 -0
  196. package/dist/shadcn/scroll-area.d.ts.map +1 -0
  197. package/dist/shadcn/scroll-area.js +40 -0
  198. package/dist/shadcn/select.d.ts +63 -0
  199. package/dist/shadcn/select.d.ts.map +1 -0
  200. package/dist/shadcn/select.js +120 -0
  201. package/dist/shadcn/separator.d.ts +10 -0
  202. package/dist/shadcn/separator.d.ts.map +1 -0
  203. package/dist/shadcn/separator.js +18 -0
  204. package/dist/shadcn/sheet.d.ts +48 -0
  205. package/dist/shadcn/sheet.d.ts.map +1 -0
  206. package/dist/shadcn/sheet.js +99 -0
  207. package/dist/shadcn/sidebar.d.ts +200 -0
  208. package/dist/shadcn/sidebar.d.ts.map +1 -0
  209. package/dist/shadcn/sidebar.js +528 -0
  210. package/dist/shadcn/skeleton.d.ts +6 -0
  211. package/dist/shadcn/skeleton.d.ts.map +1 -0
  212. package/dist/shadcn/skeleton.js +11 -0
  213. package/dist/shadcn/slider.d.ts +12 -0
  214. package/dist/shadcn/slider.d.ts.map +1 -0
  215. package/dist/shadcn/slider.js +50 -0
  216. package/dist/shadcn/sonner.d.ts +7 -0
  217. package/dist/shadcn/sonner.d.ts.map +1 -0
  218. package/dist/shadcn/sonner.js +20 -0
  219. package/dist/shadcn/switch.d.ts +8 -0
  220. package/dist/shadcn/switch.d.ts.map +1 -0
  221. package/dist/shadcn/switch.js +22 -0
  222. package/dist/shadcn/table.d.ts +35 -0
  223. package/dist/shadcn/table.d.ts.map +1 -0
  224. package/dist/shadcn/table.js +73 -0
  225. package/dist/shadcn/tabs.d.ts +20 -0
  226. package/dist/shadcn/tabs.d.ts.map +1 -0
  227. package/dist/shadcn/tabs.js +40 -0
  228. package/dist/shadcn/textarea.d.ts +7 -0
  229. package/dist/shadcn/textarea.d.ts.map +1 -0
  230. package/dist/shadcn/textarea.js +14 -0
  231. package/dist/shadcn/toggle-group.d.ts +22 -0
  232. package/dist/shadcn/toggle-group.d.ts.map +1 -0
  233. package/dist/shadcn/toggle-group.js +43 -0
  234. package/dist/shadcn/toggle.d.ts +29 -0
  235. package/dist/shadcn/toggle.d.ts.map +1 -0
  236. package/dist/shadcn/toggle.js +31 -0
  237. package/dist/shadcn/tooltip.d.ts +20 -0
  238. package/dist/shadcn/tooltip.d.ts.map +1 -0
  239. package/dist/shadcn/tooltip.js +40 -0
  240. package/dist/stories/BackgroundSlideshow.stories.d.ts +9 -0
  241. package/dist/stories/BackgroundSlideshow.stories.d.ts.map +1 -0
  242. package/dist/stories/BackgroundSlideshow.stories.js +60 -0
  243. package/dist/stories/BlurryGradient.stories.d.ts +11 -0
  244. package/dist/stories/BlurryGradient.stories.d.ts.map +1 -0
  245. package/dist/stories/BlurryGradient.stories.js +53 -0
  246. package/dist/stories/Box.stories.d.ts +13 -0
  247. package/dist/stories/Box.stories.d.ts.map +1 -0
  248. package/dist/stories/Box.stories.js +50 -0
  249. package/dist/stories/Carousel.stories.d.ts +9 -0
  250. package/dist/stories/Carousel.stories.d.ts.map +1 -0
  251. package/dist/stories/Carousel.stories.js +30 -0
  252. package/dist/stories/Countdown.stories.d.ts +7 -0
  253. package/dist/stories/Countdown.stories.d.ts.map +1 -0
  254. package/dist/stories/Countdown.stories.js +11 -0
  255. package/dist/stories/DefinitionList.stories.d.ts +9 -0
  256. package/dist/stories/DefinitionList.stories.d.ts.map +1 -0
  257. package/dist/stories/DefinitionList.stories.js +20 -0
  258. package/dist/stories/GenericError.stories.d.ts +9 -0
  259. package/dist/stories/GenericError.stories.d.ts.map +1 -0
  260. package/dist/stories/GenericError.stories.js +39 -0
  261. package/dist/stories/Heading.stories.d.ts +15 -0
  262. package/dist/stories/Heading.stories.d.ts.map +1 -0
  263. package/dist/stories/Heading.stories.js +61 -0
  264. package/dist/stories/Highlight.stories.d.ts +8 -0
  265. package/dist/stories/Highlight.stories.d.ts.map +1 -0
  266. package/dist/stories/Highlight.stories.js +19 -0
  267. package/dist/stories/IconButton.stories.d.ts +10 -0
  268. package/dist/stories/IconButton.stories.d.ts.map +1 -0
  269. package/dist/stories/IconButton.stories.js +32 -0
  270. package/dist/stories/If.stories.d.ts +13 -0
  271. package/dist/stories/If.stories.d.ts.map +1 -0
  272. package/dist/stories/If.stories.js +54 -0
  273. package/dist/stories/Iframe.stories.d.ts +8 -0
  274. package/dist/stories/Iframe.stories.d.ts.map +1 -0
  275. package/dist/stories/Iframe.stories.js +23 -0
  276. package/dist/stories/Item.stories.d.ts +10 -0
  277. package/dist/stories/Item.stories.d.ts.map +1 -0
  278. package/dist/stories/Item.stories.js +32 -0
  279. package/dist/stories/Link.stories.d.ts +10 -0
  280. package/dist/stories/Link.stories.d.ts.map +1 -0
  281. package/dist/stories/Link.stories.js +36 -0
  282. package/dist/stories/ListItem.stories.d.ts +9 -0
  283. package/dist/stories/ListItem.stories.d.ts.map +1 -0
  284. package/dist/stories/ListItem.stories.js +25 -0
  285. package/dist/stories/MarkdownContainer.stories.d.ts +11 -0
  286. package/dist/stories/MarkdownContainer.stories.d.ts.map +1 -0
  287. package/dist/stories/MarkdownContainer.stories.js +66 -0
  288. package/dist/stories/PasswordInput.stories.d.ts +9 -0
  289. package/dist/stories/PasswordInput.stories.d.ts.map +1 -0
  290. package/dist/stories/PasswordInput.stories.js +27 -0
  291. package/dist/stories/Picture.stories.d.ts +10 -0
  292. package/dist/stories/Picture.stories.d.ts.map +1 -0
  293. package/dist/stories/Picture.stories.js +46 -0
  294. package/dist/stories/ProtectedEmail.stories.d.ts +10 -0
  295. package/dist/stories/ProtectedEmail.stories.d.ts.map +1 -0
  296. package/dist/stories/ProtectedEmail.stories.js +34 -0
  297. package/dist/stories/Text.stories.d.ts +10 -0
  298. package/dist/stories/Text.stories.d.ts.map +1 -0
  299. package/dist/stories/Text.stories.js +31 -0
  300. package/dist/stories/UnorderedList.stories.d.ts +10 -0
  301. package/dist/stories/UnorderedList.stories.d.ts.map +1 -0
  302. package/dist/stories/UnorderedList.stories.js +24 -0
  303. package/dist/test-setup.d.ts +2 -0
  304. package/dist/test-setup.d.ts.map +1 -0
  305. package/dist/test-setup.js +1 -0
  306. package/dist/utils/author.d.ts +9 -0
  307. package/dist/utils/author.d.ts.map +1 -0
  308. package/dist/utils/author.js +37 -0
  309. package/dist/utils/author.test.d.ts +2 -0
  310. package/dist/utils/author.test.d.ts.map +1 -0
  311. package/dist/utils/author.test.js +46 -0
  312. package/dist/utils/cn.d.ts +5 -0
  313. package/dist/utils/cn.d.ts.map +1 -0
  314. package/dist/utils/cn.js +10 -0
  315. package/dist/utils/cn.test.d.ts +2 -0
  316. package/dist/utils/cn.test.d.ts.map +1 -0
  317. package/dist/utils/cn.test.js +33 -0
  318. package/dist/utils/is-route-active.d.ts +3 -0
  319. package/dist/utils/is-route-active.d.ts.map +1 -0
  320. package/dist/utils/is-route-active.js +54 -0
  321. package/dist/utils/is-route-active.test.d.ts +2 -0
  322. package/dist/utils/is-route-active.test.d.ts.map +1 -0
  323. package/dist/utils/is-route-active.test.js +61 -0
  324. package/dist/utils/locale.d.ts +22 -0
  325. package/dist/utils/locale.d.ts.map +1 -0
  326. package/dist/utils/locale.js +25 -0
  327. package/dist/utils/locale.test.d.ts +2 -0
  328. package/dist/utils/locale.test.d.ts.map +1 -0
  329. package/dist/utils/locale.test.js +99 -0
  330. package/dist/utils/text.d.ts +7 -0
  331. package/dist/utils/text.d.ts.map +1 -0
  332. package/dist/utils/text.js +102 -0
  333. package/dist/utils/text.test.d.ts +2 -0
  334. package/dist/utils/text.test.d.ts.map +1 -0
  335. package/dist/utils/text.test.js +122 -0
  336. package/package.json +117 -0
  337. package/src/components/background-slideshow.tsx +172 -0
  338. package/src/components/blurry-gradient.tsx +97 -0
  339. package/src/components/box.tsx +45 -0
  340. package/src/components/carousel.tsx +197 -0
  341. package/src/components/countdown.tsx +82 -0
  342. package/src/components/definition-list.tsx +90 -0
  343. package/src/components/generic-error.tsx +104 -0
  344. package/src/components/heading.tsx +60 -0
  345. package/src/components/highlight.tsx +53 -0
  346. package/src/components/icon-button.tsx +20 -0
  347. package/src/components/if.tsx +29 -0
  348. package/src/components/iframe.tsx +19 -0
  349. package/src/components/item.tsx +340 -0
  350. package/src/components/leaflet-map.tsx +294 -0
  351. package/src/components/link.test.tsx +387 -0
  352. package/src/components/link.tsx +206 -0
  353. package/src/components/list-item.tsx +30 -0
  354. package/src/components/maptiler-map.tsx +181 -0
  355. package/src/components/markdown-container.tsx +153 -0
  356. package/src/components/password-input.tsx +49 -0
  357. package/src/components/picture.tsx +107 -0
  358. package/src/components/protected-email.tsx +49 -0
  359. package/src/components/text.tsx +38 -0
  360. package/src/components/unordered-list.tsx +32 -0
  361. package/src/hooks/use-current-route-data.ts +18 -0
  362. package/src/hooks/use-focus-search.ts +20 -0
  363. package/src/hooks/use-matches-data.ts +19 -0
  364. package/src/hooks/use-media-query.ts +33 -0
  365. package/src/hooks/use-mobile.ts +19 -0
  366. package/src/hooks/use-nonce.test.ts +35 -0
  367. package/src/hooks/use-nonce.ts +20 -0
  368. package/src/hooks/use-orientation.ts +48 -0
  369. package/src/hooks/use-user.tsx +72 -0
  370. package/src/stories/BackgroundSlideshow.stories.tsx +68 -0
  371. package/src/stories/BlurryGradient.stories.tsx +62 -0
  372. package/src/stories/Box.stories.tsx +83 -0
  373. package/src/stories/Carousel.stories.tsx +95 -0
  374. package/src/stories/Countdown.stories.tsx +16 -0
  375. package/src/stories/DefinitionList.stories.tsx +51 -0
  376. package/src/stories/GenericError.stories.tsx +58 -0
  377. package/src/stories/Heading.stories.tsx +82 -0
  378. package/src/stories/Highlight.stories.tsx +28 -0
  379. package/src/stories/IconButton.stories.tsx +90 -0
  380. package/src/stories/If.stories.tsx +72 -0
  381. package/src/stories/Iframe.stories.tsx +29 -0
  382. package/src/stories/Item.stories.tsx +79 -0
  383. package/src/stories/Link.stories.tsx +58 -0
  384. package/src/stories/ListItem.stories.tsx +37 -0
  385. package/src/stories/MarkdownContainer.stories.tsx +76 -0
  386. package/src/stories/PasswordInput.stories.tsx +34 -0
  387. package/src/stories/Picture.stories.tsx +54 -0
  388. package/src/stories/ProtectedEmail.stories.tsx +57 -0
  389. package/src/stories/Text.stories.tsx +44 -0
  390. package/src/stories/UnorderedList.stories.tsx +73 -0
  391. package/src/styles/storybook.css +1 -0
  392. package/src/styles/tailwind.css +7 -0
  393. package/src/test-setup.ts +1 -0
  394. package/src/utils/author.test.ts +54 -0
  395. package/src/utils/author.tsx +73 -0
  396. package/src/utils/cn.test.ts +48 -0
  397. package/src/utils/cn.ts +14 -0
  398. package/src/utils/is-route-active.test.ts +80 -0
  399. package/src/utils/is-route-active.ts +100 -0
  400. package/src/utils/locale.test.ts +148 -0
  401. package/src/utils/locale.ts +127 -0
  402. package/src/utils/text.test.ts +152 -0
  403. package/src/utils/text.tsx +209 -0
  404. package/src/vite-env.d.ts +1 -0
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ # The MIT License (MIT)
2
+
3
+ Copyright © 2025 Regardio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # @regardio/react
2
+
3
+ > Reusable React components from Regardio's projects, released into the wild.
4
+
5
+ Part of Regardio's ongoing mission to provide valuable building blocks for achieving personal and shared aims. We build reusable tools, and commonly used React components from our projects live here for everyone to use.
6
+
7
+ ## ⚠️ Pre-release Notice
8
+
9
+ **This package is currently in pre-release (v0.x).** While we use these components in production across our own projects, the API may still change between minor versions. We recommend:
10
+
11
+ - Pinning to exact versions in your `package.json`
12
+ - Reviewing changelogs before upgrading
13
+ - Expecting potential breaking changes until v1.0
14
+
15
+ ## Why This Package?
16
+
17
+ We created `@regardio/react` to:
18
+
19
+ - **Share battle-tested components** — These components power real Regardio projects and have been refined through actual use
20
+ - **Reduce duplication** — Instead of copying components between projects, we maintain them in one place
21
+ - **Provide sensible defaults** — Components come pre-configured with accessibility, responsive design, and TailwindCSS integration
22
+ - **Enable tree-shaking** — Import only what you need; unused components won't bloat your bundle
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pnpm add @regardio/react
28
+ ```
29
+
30
+ ### Peer Dependencies
31
+
32
+ This package requires:
33
+
34
+ - `react` >= 19.0.0
35
+ - `react-dom` >= 19.0.0
36
+ - `react-router` >= 7.0.0 (for routing components)
37
+ - `tailwindcss` >= 4.0.0 (for styling)
38
+
39
+ ## Usage
40
+
41
+ Import components, hooks, and utilities directly from their paths for optimal tree-shaking:
42
+
43
+ ```tsx
44
+ import { Box } from '@regardio/react/components/box';
45
+ import { Link } from '@regardio/react/components/link';
46
+ import { useNonce } from '@regardio/react/hooks/use-nonce';
47
+ import { cn } from '@regardio/react/utils/cn';
48
+ ```
49
+
50
+ ### TailwindCSS Integration
51
+
52
+ Components use TailwindCSS for styling. Import the base styles in your app:
53
+
54
+ ```tsx
55
+ import '@regardio/react/styles/tailwind.css';
56
+ ```
57
+
58
+ ## What's Included
59
+
60
+ ### Components
61
+
62
+ | Component | Description |
63
+ |-----------|-------------|
64
+ | `BackgroundSlideshow` | Animated background image carousel with crossfade transitions |
65
+ | `BlurryGradient` | SVG-based decorative gradient backgrounds |
66
+ | `Box` | Flexible container with variant-based styling |
67
+ | `Carousel` | Embla-powered carousel with navigation controls |
68
+ | `Countdown` | Dynamic countdown timer display |
69
+ | `DefinitionList` | Semantic `<dl>` with `Dt` and `Dd` sub-components |
70
+ | `GenericError` | React Router error boundary with i18n support |
71
+ | `Heading` | Semantic headings (h1-h6) with consistent styling |
72
+ | `Highlight` | Text highlighting with customizable styles |
73
+ | `IconButton` | Button optimized for icon-only content |
74
+ | `If` | Conditional rendering utility component |
75
+ | `Iframe` | Responsive iframe with sensible defaults |
76
+ | `Item` | Grid item with theme colors and link support |
77
+ | `LeafletMap` | Leaflet map integration |
78
+ | `Link` | React Router link with external URL detection |
79
+ | `ListItem` | Styled list item component |
80
+ | `MaptilerMap` | MapTiler SDK integration |
81
+ | `MarkdownContainer` | MDX/Markdown renderer with typography processing |
82
+ | `PasswordInput` | Password field with visibility toggle |
83
+ | `Picture` | Responsive images with srcset generation |
84
+ | `ProtectedEmail` | Email obfuscation for spam protection |
85
+ | `Text` | Typography component with variants |
86
+ | `UnorderedList` | Styled unordered list with variants |
87
+
88
+ ### Hooks
89
+
90
+ | Hook | Description |
91
+ |------|-------------|
92
+ | `useCurrentRouteData` | Access current route loader data |
93
+ | `useFocusSearch` | Focus management for search inputs |
94
+ | `useMatchesData` | Access matched route data |
95
+ | `useMediaQuery` | Reactive media query matching |
96
+ | `useMobile` | Mobile device detection |
97
+ | `useNonce` | CSP nonce access for inline styles |
98
+ | `useOrientation` | Device orientation detection |
99
+ | `useUser` | User context from Supabase auth |
100
+
101
+ ### Utilities
102
+
103
+ | Utility | Description |
104
+ |---------|-------------|
105
+ | `cn` | TailwindCSS class name merging (tailwind-merge + cva) |
106
+ | `author` | Author/contributor data formatting |
107
+ | `isRouteActive` | Route matching utilities |
108
+ | `locale` | Locale detection and formatting |
109
+ | `text` | Typography processing (quotes, special chars) |
110
+
111
+ ## Documentation
112
+
113
+ See the [docs](./docs) folder for detailed documentation on each component, hook, and utility.
114
+
115
+ ## Storybook
116
+
117
+ Run Storybook to explore components interactively:
118
+
119
+ ```bash
120
+ pnpm storybook
121
+ ```
122
+
123
+ ## Contributing
124
+
125
+ This package is primarily maintained for Regardio's internal use, but we welcome:
126
+
127
+ - Bug reports and fixes
128
+ - Documentation improvements
129
+ - Feature suggestions (though we may not implement all requests)
130
+
131
+ ## License
132
+
133
+ **MIT License** — Free to use in commercial and open source projects.
@@ -0,0 +1,22 @@
1
+ import type { ReactElement } from 'react';
2
+ export type ImageData = {
3
+ at: Record<string, string>;
4
+ fn: string;
5
+ hu: number;
6
+ id: string;
7
+ po: boolean;
8
+ };
9
+ export interface BackgroundSlideshowProps {
10
+ baseUrl: string;
11
+ className?: string;
12
+ imgClassName?: string;
13
+ locale: string;
14
+ pictureClassName?: string;
15
+ images: ImageData[];
16
+ filter?: (image: ImageData) => boolean;
17
+ slideshow?: boolean;
18
+ slideshowInterval?: number;
19
+ transitionDuration?: number;
20
+ }
21
+ export declare function BackgroundSlideshow({ baseUrl, className, imgClassName, locale, pictureClassName, images, slideshow, slideshowInterval, transitionDuration, filter, }: BackgroundSlideshowProps): ReactElement;
22
+ //# sourceMappingURL=background-slideshow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-slideshow.d.ts","sourceRoot":"","sources":["../../src/components/background-slideshow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;CACb,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,SAAc,EACd,YAAiB,EACjB,MAAM,EACN,gBAAqB,EACrB,MAAW,EACX,SAAgB,EAChB,iBAAwB,EACxB,kBAAyB,EACzB,MAAM,GACP,EAAE,wBAAwB,GAAG,YAAY,CAuIzC"}
@@ -0,0 +1,76 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef, useState } from 'react';
3
+ import { Picture } from './picture';
4
+ export function BackgroundSlideshow({ baseUrl, className = '', imgClassName = '', locale, pictureClassName = '', images = [], slideshow = true, slideshowInterval = 6000, transitionDuration = 6000, filter, }) {
5
+ const validatedImages = useMemo(() => {
6
+ return images
7
+ .map((img) => {
8
+ if (typeof img !== 'object' || img === null)
9
+ return null;
10
+ return {
11
+ at: img.at || {},
12
+ fn: img.fn || '',
13
+ hu: img.hu || 0,
14
+ id: img.id || '',
15
+ po: img.po || false,
16
+ };
17
+ })
18
+ .filter((img) => img !== null);
19
+ }, [images]);
20
+ const availableImages = useMemo(() => {
21
+ const filtered = filter ? validatedImages.filter(filter) : validatedImages;
22
+ return filtered.length > 0 ? filtered : validatedImages;
23
+ }, [validatedImages, filter]);
24
+ const firstImage = availableImages[0] || null;
25
+ const [slideshowStarted, setSlideshowStarted] = useState(false);
26
+ const [overlayImage, setOverlayImage] = useState(null);
27
+ const [overlayVisible, setOverlayVisible] = useState(false);
28
+ const [currentIndex, setCurrentIndex] = useState(0);
29
+ const timerRef = useRef(undefined);
30
+ const isTransitioning = useRef(false);
31
+ useEffect(() => {
32
+ if (!slideshow || availableImages.length <= 1)
33
+ return;
34
+ const timeout = window.setTimeout(() => {
35
+ setSlideshowStarted(true);
36
+ }, slideshowInterval);
37
+ return () => window.clearTimeout(timeout);
38
+ }, [slideshow, availableImages.length, slideshowInterval]);
39
+ useEffect(() => {
40
+ if (!slideshowStarted || availableImages.length <= 1)
41
+ return;
42
+ if (timerRef.current)
43
+ window.clearTimeout(timerRef.current);
44
+ const cycleImages = () => {
45
+ if (isTransitioning.current)
46
+ return;
47
+ isTransitioning.current = true;
48
+ const nextIdx = (currentIndex + 1) % availableImages.length;
49
+ const nextImage = availableImages[nextIdx];
50
+ if (!nextImage) {
51
+ isTransitioning.current = false;
52
+ return;
53
+ }
54
+ setOverlayImage(nextImage);
55
+ window.setTimeout(() => {
56
+ setOverlayVisible(true);
57
+ window.setTimeout(() => {
58
+ setCurrentIndex(nextIdx);
59
+ setOverlayVisible(false);
60
+ isTransitioning.current = false;
61
+ timerRef.current = window.setTimeout(cycleImages, slideshowInterval);
62
+ }, transitionDuration);
63
+ }, 100);
64
+ };
65
+ cycleImages();
66
+ return () => {
67
+ if (timerRef.current)
68
+ window.clearTimeout(timerRef.current);
69
+ };
70
+ }, [slideshowStarted, availableImages, currentIndex, slideshowInterval, transitionDuration]);
71
+ if (validatedImages.length === 0 || !firstImage) {
72
+ return _jsx("div", { className: className });
73
+ }
74
+ const baseImage = availableImages[currentIndex] || firstImage;
75
+ return (_jsxs("div", { className: className, children: [_jsx("div", { className: "absolute inset-0 w-full h-full", children: _jsx(Picture, { alt: baseImage.at[locale] || '', baseUrl: baseUrl.replace('{id}', baseImage.id).replace('{fn}', baseImage.fn), className: pictureClassName, formats: [{ size: '', width: 1080 }], imgClassName: imgClassName, placeholder: "" }) }), overlayImage && (_jsx("div", { className: `absolute inset-0 w-full h-full transition-opacity ${overlayVisible ? 'opacity-100' : 'opacity-0'} ${transitionDuration <= 3000 ? 'duration-3000' : transitionDuration <= 4000 ? 'duration-4000' : transitionDuration <= 5000 ? 'duration-5000' : 'duration-6000'}`, children: _jsx(Picture, { alt: overlayImage.at[locale] || '', baseUrl: baseUrl.replace('{id}', overlayImage.id).replace('{fn}', overlayImage.fn), className: pictureClassName, formats: [{ size: '', width: 1080 }], imgClassName: imgClassName, placeholder: "" }) }))] }));
76
+ }
@@ -0,0 +1,9 @@
1
+ import type { SVGProps } from 'react';
2
+ export interface BlurryGradientProps extends SVGProps<SVGSVGElement> {
3
+ primaryColor: string;
4
+ secondaryColor: string;
5
+ neutralColor: string;
6
+ description?: string;
7
+ }
8
+ export declare const BlurryGradient: (props: BlurryGradientProps) => import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=blurry-gradient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blurry-gradient.d.ts","sourceRoot":"","sources":["../../src/components/blurry-gradient.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEtC,MAAM,WAAW,mBAAoB,SAAQ,QAAQ,CAAC,aAAa,CAAC;IAClE,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IAKrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,4CAmFxD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const BlurryGradient = (props) => {
3
+ const { description = 'Decorative blurry gradient', ...svgProps } = props;
4
+ const titleId = 'blurryGradientTitle';
5
+ return (_jsxs("svg", { "aria-labelledby": titleId, preserveAspectRatio: "none", role: "img", viewBox: "0 0 1000 1000", ...svgProps, children: [_jsx("title", { id: titleId, children: description }), _jsx("defs", { children: _jsxs("filter", { colorInterpolationFilters: "sRGB", filterUnits: "userSpaceOnUse", height: "120%", width: "120%", x: "-10%", y: "-10%", children: [_jsx("feFlood", { floodOpacity: "0", result: "BackgroundImageFix" }), _jsx("feBlend", { in: "SourceGraphic", in2: "BackgroundImageFix", mode: "normal", result: "shape" }), _jsx("feGaussianBlur", { result: "effect1_foregroundBlur", stdDeviation: "161" })] }) }), _jsx("rect", { fill: props.primaryColor, height: "1000", width: "1000" }), _jsxs("g", { filter: "url(#blurryGradient)", children: [_jsx("circle", { cx: "730", cy: "559", fill: props.secondaryColor, r: "357" }), _jsx("circle", { cx: "316", cy: "248", fill: props.primaryColor, r: "357" }), _jsx("circle", { cx: "509", cy: "410", fill: props.neutralColor, r: "357" }), _jsx("circle", { cx: "633", cy: "232", fill: props.secondaryColor, r: "357" }), _jsx("circle", { cx: "156", cy: "82", fill: props.primaryColor, r: "357" }), _jsx("circle", { cx: "150", cy: "389", fill: props.neutralColor, r: "357" })] })] }));
6
+ };
@@ -0,0 +1,17 @@
1
+ import type { ComponentProps, ElementType } from 'react';
2
+ import { type VariantProps } from '../utils/cn';
3
+ declare const box: (props?: ({
4
+ variant?: "code" | "aside" | "main" | "section" | "grid" | "primary" | "container" | "flex" | undefined;
5
+ } & ({
6
+ class?: import("cva").ClassValue;
7
+ className?: never;
8
+ } | {
9
+ class?: never;
10
+ className?: import("cva").ClassValue;
11
+ })) | undefined) => string;
12
+ export interface BoxProps extends ComponentProps<'div'>, VariantProps<typeof box> {
13
+ as?: ElementType;
14
+ }
15
+ export declare const Box: ({ as: Component, children, className, variant, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/components/box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,QAAA,MAAM,GAAG;;;;;;;;0BAgBP,CAAC;AAEH,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,GAAG,CAAC;IAC/E,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB;AAED,eAAO,MAAM,GAAG,GAAI,2DAMjB,QAAQ,4CAYV,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from '../utils/cn';
3
+ const box = cva({
4
+ defaultVariants: {
5
+ variant: 'primary',
6
+ },
7
+ variants: {
8
+ variant: {
9
+ aside: [],
10
+ code: ['font-monospace', 'overflow-scroll'],
11
+ container: ['u-container'],
12
+ flex: ['flex'],
13
+ grid: ['u-grid'],
14
+ main: [],
15
+ primary: [],
16
+ section: ['u-grid', 'content-start'],
17
+ },
18
+ },
19
+ });
20
+ export const Box = ({ as: Component = 'div', children, className, variant, ...props }) => {
21
+ return (_jsx(Component, { className: box({
22
+ className,
23
+ variant,
24
+ }), ...props, children: children }));
25
+ };
@@ -0,0 +1,26 @@
1
+ import type { EmblaCarouselType, EmblaOptionsType } from 'embla-carousel';
2
+ import { type HTMLAttributes } from 'react';
3
+ export type CarouselApi = EmblaCarouselType;
4
+ interface CarouselContextValue {
5
+ api: CarouselApi | undefined;
6
+ scrollPrev: () => void;
7
+ scrollNext: () => void;
8
+ canScrollPrev: boolean;
9
+ canScrollNext: boolean;
10
+ }
11
+ declare function useCarousel(): CarouselContextValue;
12
+ interface CarouselProps extends HTMLAttributes<HTMLDivElement> {
13
+ opts?: EmblaOptionsType;
14
+ setApi?: (api: CarouselApi) => void;
15
+ orientation?: 'horizontal' | 'vertical';
16
+ }
17
+ declare const Carousel: import("react").ForwardRefExoticComponent<CarouselProps & import("react").RefAttributes<HTMLDivElement>>;
18
+ declare const CarouselContent: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
19
+ interface CarouselItemProps extends HTMLAttributes<HTMLDivElement> {
20
+ 'aria-label'?: string;
21
+ }
22
+ declare const CarouselItem: import("react").ForwardRefExoticComponent<CarouselItemProps & import("react").RefAttributes<HTMLDivElement>>;
23
+ declare const CarouselPrevious: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
24
+ declare const CarouselNext: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLButtonElement> & import("react").RefAttributes<HTMLButtonElement>>;
25
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
26
+ //# sourceMappingURL=carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../src/components/carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAGL,KAAK,cAAc,EAMpB,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C,UAAU,oBAAoB;IAC5B,GAAG,EAAE,WAAW,GAAG,SAAS,CAAC;IAC7B,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;IACvB,aAAa,EAAE,OAAO,CAAC;CACxB;AAID,iBAAS,WAAW,yBAMnB;AAED,UAAU,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC5D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;CACzC;AAED,QAAA,MAAM,QAAQ,0GAoFb,CAAC;AAGF,QAAA,MAAM,eAAe,2HAUpB,CAAC;AAGF,UAAU,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,YAAY,8GAajB,CAAC;AAGF,QAAA,MAAM,gBAAgB,iIAerB,CAAC;AAGF,QAAA,MAAM,YAAY,iIAejB,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,87 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import useEmblaCarousel from 'embla-carousel-react';
3
+ import { createContext, forwardRef, useCallback, useContext, useEffect, useState, } from 'react';
4
+ import { cn } from '../utils/cn';
5
+ const CarouselContext = createContext(null);
6
+ function useCarousel() {
7
+ const context = useContext(CarouselContext);
8
+ if (!context) {
9
+ throw new Error('useCarousel must be used within a <Carousel />');
10
+ }
11
+ return context;
12
+ }
13
+ const Carousel = forwardRef(({ children, className, opts, orientation = 'horizontal', setApi, ...props }, ref) => {
14
+ const [emblaRef, emblaApi] = useEmblaCarousel({
15
+ ...opts,
16
+ axis: orientation === 'horizontal' ? 'x' : 'y',
17
+ });
18
+ const [canScrollPrev, setCanScrollPrev] = useState(false);
19
+ const [canScrollNext, setCanScrollNext] = useState(false);
20
+ const onSelect = useCallback((api) => {
21
+ if (!api) {
22
+ return;
23
+ }
24
+ setCanScrollPrev(api.canScrollPrev());
25
+ setCanScrollNext(api.canScrollNext());
26
+ }, []);
27
+ const scrollPrev = useCallback(() => {
28
+ emblaApi?.scrollPrev();
29
+ }, [emblaApi]);
30
+ const scrollNext = useCallback(() => {
31
+ emblaApi?.scrollNext();
32
+ }, [emblaApi]);
33
+ const handleKeyDown = useCallback((event) => {
34
+ if (event.key === 'ArrowLeft') {
35
+ event.preventDefault();
36
+ scrollPrev();
37
+ }
38
+ else if (event.key === 'ArrowRight') {
39
+ event.preventDefault();
40
+ scrollNext();
41
+ }
42
+ }, [scrollPrev, scrollNext]);
43
+ useEffect(() => {
44
+ if (!emblaApi || !setApi) {
45
+ return;
46
+ }
47
+ setApi(emblaApi);
48
+ }, [emblaApi, setApi]);
49
+ useEffect(() => {
50
+ if (!emblaApi) {
51
+ return;
52
+ }
53
+ onSelect(emblaApi);
54
+ emblaApi.on('reInit', onSelect);
55
+ emblaApi.on('select', onSelect);
56
+ return () => {
57
+ emblaApi?.off('select', onSelect);
58
+ };
59
+ }, [emblaApi, onSelect]);
60
+ return (_jsx(CarouselContext.Provider, { value: {
61
+ api: emblaApi,
62
+ canScrollNext,
63
+ canScrollPrev,
64
+ scrollNext,
65
+ scrollPrev,
66
+ }, children: _jsx("section", { "aria-label": "Carousel", "aria-roledescription": "carousel", className: cn('relative', className), onKeyDownCapture: handleKeyDown, ref: ref, ...props, children: _jsx("div", { ref: emblaRef, children: _jsx("div", { children: children }) }) }) }));
67
+ });
68
+ Carousel.displayName = 'Carousel';
69
+ const CarouselContent = forwardRef(({ className, ...props }, ref) => {
70
+ return (_jsx("div", { className: cn('flex', className), ref: ref, ...props }));
71
+ });
72
+ CarouselContent.displayName = 'CarouselContent';
73
+ const CarouselItem = forwardRef(({ className, ...props }, ref) => {
74
+ return (_jsx("div", { "aria-roledescription": "slide", className: cn('min-w-0 shrink-0 grow-0', className), ref: ref, role: "group", ...props }));
75
+ });
76
+ CarouselItem.displayName = 'CarouselItem';
77
+ const CarouselPrevious = forwardRef(({ className, ...props }, ref) => {
78
+ const { canScrollPrev, scrollPrev } = useCarousel();
79
+ return (_jsx("button", { className: cn('disabled:opacity-50', className), disabled: !canScrollPrev, onClick: scrollPrev, ref: ref, type: "button", ...props }));
80
+ });
81
+ CarouselPrevious.displayName = 'CarouselPrevious';
82
+ const CarouselNext = forwardRef(({ className, ...props }, ref) => {
83
+ const { canScrollNext, scrollNext } = useCarousel();
84
+ return (_jsx("button", { className: cn('disabled:opacity-50', className), disabled: !canScrollNext, onClick: scrollNext, ref: ref, type: "button", ...props }));
85
+ });
86
+ CarouselNext.displayName = 'CarouselNext';
87
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
@@ -0,0 +1,2 @@
1
+ export declare function Countdown(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=countdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"countdown.d.ts","sourceRoot":"","sources":["../../src/components/countdown.tsx"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,4CA8ExB"}
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { cn } from '../utils/cn';
4
+ export function Countdown() {
5
+ const [timerValue, setTimerValue] = useState(0);
6
+ const [isMounted, setIsMounted] = useState(false);
7
+ useEffect(() => {
8
+ setIsMounted(true);
9
+ const intervalId = setInterval(() => {
10
+ setTimerValue((prevValue) => {
11
+ return prevValue + 1;
12
+ });
13
+ }, 1000);
14
+ return () => {
15
+ return clearInterval(intervalId);
16
+ };
17
+ }, []);
18
+ return (_jsx("div", { className: cn('before:absolute', 'before:bg-white', 'before:content-[""]', 'before:h-[180px]', 'before:rounded-full', 'before:w-[180px]', 'flex', 'h-[240px]', 'items-center', 'justify-center', 'relative', 'rounded-full', 'w-[240px]'), style: {
19
+ background: `conic-gradient(
20
+ transparent ${6 * (isMounted ? timerValue : 0)}deg,
21
+ hsl(var(--red-500)) 0deg,
22
+ hsl(var(--red-500)) 15deg,
23
+ hsl(var(--coral-500)) 15deg,
24
+ hsl(var(--coral-500)) 45deg,
25
+ hsl(var(--orange-500)) 45deg,
26
+ hsl(var(--orange-500)) 75deg,
27
+ hsl(var(--yellow-500)) 75deg,
28
+ hsl(var(--yellow-500)) 105deg,
29
+ hsl(var(--olive-500)) 105deg,
30
+ hsl(var(--olive-500)) 135deg,
31
+ hsl(var(--lime-500)) 135deg,
32
+ hsl(var(--lime-500)) 165deg,
33
+ hsl(var(--green-500)) 165deg,
34
+ hsl(var(--green-500)) 195deg,
35
+ hsl(var(--teal-500)) 195deg,
36
+ hsl(var(--teal-500)) 225deg,
37
+ hsl(var(--cyan-500)) 225deg,
38
+ hsl(var(--cyan-500)) 255deg,
39
+ hsl(var(--blue-500)) 255deg,
40
+ hsl(var(--blue-500)) 285deg,
41
+ hsl(var(--purple-500)) 285deg,
42
+ hsl(var(--purple-500)) 315deg,
43
+ hsl(var(--pink-500)) 315deg,
44
+ hsl(var(--pink-500)) 345deg,
45
+ hsl(var(--red-500)) 345deg
46
+ )`,
47
+ }, children: _jsx("span", { className: cn('text-foreground', 'relative', 'text-3xl', 'font-bold'), children: isMounted ? (timerValue < 10 ? `0${timerValue}` : timerValue) : 0 }) }));
48
+ }
@@ -0,0 +1,40 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { type VariantProps } from '../utils/cn';
3
+ declare const dl: (props?: ({
4
+ variant?: "primary" | "unstyled" | undefined;
5
+ } & ({
6
+ class?: import("cva").ClassValue;
7
+ className?: never;
8
+ } | {
9
+ class?: never;
10
+ className?: import("cva").ClassValue;
11
+ })) | undefined) => string;
12
+ declare const dt: (props?: ({
13
+ variant?: "primary" | undefined;
14
+ } & ({
15
+ class?: import("cva").ClassValue;
16
+ className?: never;
17
+ } | {
18
+ class?: never;
19
+ className?: import("cva").ClassValue;
20
+ })) | undefined) => string;
21
+ declare const dd: (props?: ({
22
+ variant?: "primary" | undefined;
23
+ } & ({
24
+ class?: import("cva").ClassValue;
25
+ className?: never;
26
+ } | {
27
+ class?: never;
28
+ className?: import("cva").ClassValue;
29
+ })) | undefined) => string;
30
+ export interface DefinitionListProps extends ComponentProps<'dl'>, VariantProps<typeof dl> {
31
+ }
32
+ export interface DtProps extends ComponentProps<'dt'>, VariantProps<typeof dt> {
33
+ }
34
+ export interface DdProps extends ComponentProps<'dd'>, VariantProps<typeof dd> {
35
+ }
36
+ export declare const DefinitionList: (props: DefinitionListProps) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const Dt: (props: DtProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const Dd: (props: DdProps) => import("react/jsx-runtime").JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=definition-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definition-list.d.ts","sourceRoot":"","sources":["../../src/components/definition-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAErD,QAAA,MAAM,EAAE;;;;;;;;0BAWN,CAAC;AAEH,QAAA,MAAM,EAAE;;;;;;;;0BAUN,CAAC;AAEH,QAAA,MAAM,EAAE;;;;;;;;0BAUN,CAAC;AAEH,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;CAAG;AAE7F,MAAM,WAAW,OAAQ,SAAQ,cAAc,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;CAAG;AAEjF,MAAM,WAAW,OAAQ,SAAQ,cAAc,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC;CAAG;AAEjF,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,4CAaxD,CAAC;AAEF,eAAO,MAAM,EAAE,GAAI,OAAO,OAAO,4CAahC,CAAC;AAEF,eAAO,MAAM,EAAE,GAAI,OAAO,OAAO,4CAahC,CAAC"}
@@ -0,0 +1,57 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cva } from '../utils/cn';
3
+ const dl = cva({
4
+ base: ['grid'],
5
+ defaultVariants: {
6
+ variant: 'primary',
7
+ },
8
+ variants: {
9
+ variant: {
10
+ primary: ['grid-cols-[auto,1fr]', 'gap-x-s', 'gap-y-2xs'],
11
+ unstyled: ['list-none', 'p-0', 'grid-cols-1'],
12
+ },
13
+ },
14
+ });
15
+ const dt = cva({
16
+ base: [],
17
+ defaultVariants: {
18
+ variant: 'primary',
19
+ },
20
+ variants: {
21
+ variant: {
22
+ primary: ['uppercase', 'tracking-wide'],
23
+ },
24
+ },
25
+ });
26
+ const dd = cva({
27
+ base: ['mb-xs'],
28
+ defaultVariants: {
29
+ variant: 'primary',
30
+ },
31
+ variants: {
32
+ variant: {
33
+ primary: [],
34
+ },
35
+ },
36
+ });
37
+ export const DefinitionList = (props) => {
38
+ const { children, className, variant } = props;
39
+ return (_jsx("dl", { className: dl({
40
+ className,
41
+ variant,
42
+ }), children: children }));
43
+ };
44
+ export const Dt = (props) => {
45
+ const { children, className, variant } = props;
46
+ return (_jsx("dt", { className: dt({
47
+ className,
48
+ variant,
49
+ }), children: children }));
50
+ };
51
+ export const Dd = (props) => {
52
+ const { children, className, variant } = props;
53
+ return (_jsx("dd", { className: dd({
54
+ className,
55
+ variant,
56
+ }), children: children }));
57
+ };
@@ -0,0 +1,23 @@
1
+ import type { ReactElement } from 'react';
2
+ export type ErrorDescriptor = {
3
+ type: 'http';
4
+ status: number;
5
+ statusText: string;
6
+ defaultId: string;
7
+ defaultMessage: string;
8
+ } | {
9
+ type: 'error';
10
+ defaultId: string;
11
+ defaultMessage: string;
12
+ message?: string;
13
+ stack?: string;
14
+ } | {
15
+ type: 'unknown';
16
+ defaultId: string;
17
+ defaultMessage: string;
18
+ };
19
+ export declare function getErrorDescriptor(error: unknown): ErrorDescriptor;
20
+ export declare function GenericError({ renderMessage, }?: {
21
+ renderMessage?: (descriptor: ErrorDescriptor) => ReactElement;
22
+ }): ReactElement;
23
+ //# sourceMappingURL=generic-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generic-error.d.ts","sourceRoot":"","sources":["../../src/components/generic-error.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAM1C,MAAM,MAAM,eAAe,GACvB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAMN,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,CA0BlE;AAaD,wBAAgB,YAAY,CAAC,EAC3B,aAAa,GACd,GAAE;IACD,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,YAAY,CAAC;CAC1D,GAAG,YAAY,CA6BpB"}