@regardio/react 0.3.3 → 0.4.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 (334) hide show
  1. package/dist/components/background-slideshow.d.ts +7 -5
  2. package/dist/components/background-slideshow.js +172 -74
  3. package/dist/components/blurry-gradient.d.ts +11 -4
  4. package/dist/components/blurry-gradient.js +121 -5
  5. package/dist/components/box.d.ts +12 -9
  6. package/dist/components/box.js +48 -23
  7. package/dist/components/carousel.d.ts +12 -10
  8. package/dist/components/carousel.js +146 -66
  9. package/dist/components/countdown.d.ts +5 -2
  10. package/dist/components/countdown.js +55 -21
  11. package/dist/components/definition-list.d.ts +19 -16
  12. package/dist/components/definition-list.js +83 -51
  13. package/dist/components/generic-error.d.ts +25 -5
  14. package/dist/components/generic-error.js +42 -34
  15. package/dist/components/heading.d.ts +14 -11
  16. package/dist/components/heading.js +114 -25
  17. package/dist/components/highlight.d.ts +11 -8
  18. package/dist/components/highlight.js +65 -17
  19. package/dist/components/icon-button.d.ts +7 -4
  20. package/dist/components/icon-button.js +16 -5
  21. package/dist/components/if.d.ts +6 -4
  22. package/dist/components/if.js +22 -14
  23. package/dist/components/iframe.d.ts +6 -4
  24. package/dist/components/iframe.js +26 -3
  25. package/dist/components/item.d.ts +18 -15
  26. package/dist/components/item.js +504 -301
  27. package/dist/components/leaflet-map.d.ts +5 -4
  28. package/dist/components/leaflet-map.js +192 -186
  29. package/dist/components/link.d.ts +24 -16
  30. package/dist/components/link.js +191 -102
  31. package/dist/components/list-item.d.ts +11 -8
  32. package/dist/components/list-item.js +35 -17
  33. package/dist/components/maptiler-map.d.ts +5 -4
  34. package/dist/components/maptiler-map.js +125 -112
  35. package/dist/components/markdown-container.d.ts +10 -8
  36. package/dist/components/markdown-container.js +181 -82
  37. package/dist/components/password-input.d.ts +7 -5
  38. package/dist/components/password-input.js +50 -8
  39. package/dist/components/picture.d.ts +19 -7
  40. package/dist/components/picture.js +75 -34
  41. package/dist/components/protected-email.d.ts +14 -3
  42. package/dist/components/protected-email.js +29 -15
  43. package/dist/components/text.d.ts +12 -9
  44. package/dist/components/text.js +42 -24
  45. package/dist/components/unordered-list.d.ts +11 -8
  46. package/dist/components/unordered-list.js +37 -19
  47. package/dist/hooks/use-current-route-data.d.ts +7 -2
  48. package/dist/hooks/use-current-route-data.js +13 -9
  49. package/dist/hooks/use-focus-search.d.ts +6 -3
  50. package/dist/hooks/use-focus-search.js +17 -13
  51. package/dist/hooks/use-matches-data.d.ts +9 -2
  52. package/dist/hooks/use-matches-data.js +12 -8
  53. package/dist/hooks/use-media-query.d.ts +8 -2
  54. package/dist/hooks/use-media-query.js +19 -15
  55. package/dist/hooks/use-mobile.d.ts +3 -2
  56. package/dist/hooks/use-mobile.js +18 -14
  57. package/dist/hooks/use-nonce.d.ts +12 -5
  58. package/dist/hooks/use-nonce.js +11 -7
  59. package/dist/hooks/use-orientation.d.ts +11 -3
  60. package/dist/hooks/use-orientation.js +28 -24
  61. package/dist/hooks/use-user.d.ts +43 -8
  62. package/dist/hooks/use-user.js +21 -13
  63. package/dist/utils/author.d.ts +4 -4
  64. package/dist/utils/author.js +49 -31
  65. package/dist/utils/cn.d.ts +8 -4
  66. package/dist/utils/cn.js +12 -8
  67. package/dist/utils/is-route-active.d.ts +19 -3
  68. package/dist/utils/is-route-active.js +45 -43
  69. package/dist/utils/locale.d.ts +66 -4
  70. package/dist/utils/locale.js +33 -22
  71. package/dist/utils/text.d.ts +24 -7
  72. package/dist/utils/text.js +114 -89
  73. package/package.json +5 -4
  74. package/dist/components/background-slideshow.d.ts.map +0 -1
  75. package/dist/components/blurry-gradient.d.ts.map +0 -1
  76. package/dist/components/box.d.ts.map +0 -1
  77. package/dist/components/carousel.d.ts.map +0 -1
  78. package/dist/components/countdown.d.ts.map +0 -1
  79. package/dist/components/definition-list.d.ts.map +0 -1
  80. package/dist/components/generic-error.d.ts.map +0 -1
  81. package/dist/components/heading.d.ts.map +0 -1
  82. package/dist/components/highlight.d.ts.map +0 -1
  83. package/dist/components/icon-button.d.ts.map +0 -1
  84. package/dist/components/if.d.ts.map +0 -1
  85. package/dist/components/iframe.d.ts.map +0 -1
  86. package/dist/components/item.d.ts.map +0 -1
  87. package/dist/components/leaflet-map.d.ts.map +0 -1
  88. package/dist/components/link.d.ts.map +0 -1
  89. package/dist/components/link.test.d.ts +0 -2
  90. package/dist/components/link.test.d.ts.map +0 -1
  91. package/dist/components/link.test.js +0 -204
  92. package/dist/components/list-item.d.ts.map +0 -1
  93. package/dist/components/maptiler-map.d.ts.map +0 -1
  94. package/dist/components/markdown-container.d.ts.map +0 -1
  95. package/dist/components/password-input.d.ts.map +0 -1
  96. package/dist/components/picture.d.ts.map +0 -1
  97. package/dist/components/protected-email.d.ts.map +0 -1
  98. package/dist/components/text.d.ts.map +0 -1
  99. package/dist/components/unordered-list.d.ts.map +0 -1
  100. package/dist/hooks/use-current-route-data.d.ts.map +0 -1
  101. package/dist/hooks/use-focus-search.d.ts.map +0 -1
  102. package/dist/hooks/use-matches-data.d.ts.map +0 -1
  103. package/dist/hooks/use-media-query.d.ts.map +0 -1
  104. package/dist/hooks/use-mobile.d.ts.map +0 -1
  105. package/dist/hooks/use-nonce.d.ts.map +0 -1
  106. package/dist/hooks/use-nonce.test.d.ts +0 -2
  107. package/dist/hooks/use-nonce.test.d.ts.map +0 -1
  108. package/dist/hooks/use-nonce.test.js +0 -27
  109. package/dist/hooks/use-orientation.d.ts.map +0 -1
  110. package/dist/hooks/use-user.d.ts.map +0 -1
  111. package/dist/shadcn/accordion.d.ts +0 -25
  112. package/dist/shadcn/accordion.d.ts.map +0 -1
  113. package/dist/shadcn/accordion.js +0 -45
  114. package/dist/shadcn/alert-dialog.d.ts +0 -73
  115. package/dist/shadcn/alert-dialog.d.ts.map +0 -1
  116. package/dist/shadcn/alert-dialog.js +0 -93
  117. package/dist/shadcn/alert.d.ts +0 -34
  118. package/dist/shadcn/alert.d.ts.map +0 -1
  119. package/dist/shadcn/alert.js +0 -42
  120. package/dist/shadcn/aspect-ratio.d.ts +0 -6
  121. package/dist/shadcn/aspect-ratio.d.ts.map +0 -1
  122. package/dist/shadcn/aspect-ratio.js +0 -7
  123. package/dist/shadcn/avatar.d.ts +0 -16
  124. package/dist/shadcn/avatar.d.ts.map +0 -1
  125. package/dist/shadcn/avatar.js +0 -27
  126. package/dist/shadcn/badge.d.ts +0 -29
  127. package/dist/shadcn/badge.d.ts.map +0 -1
  128. package/dist/shadcn/badge.js +0 -29
  129. package/dist/shadcn/breadcrumb.d.ts +0 -42
  130. package/dist/shadcn/breadcrumb.d.ts.map +0 -1
  131. package/dist/shadcn/breadcrumb.js +0 -74
  132. package/dist/shadcn/button.d.ts +0 -38
  133. package/dist/shadcn/button.d.ts.map +0 -1
  134. package/dist/shadcn/button.js +0 -38
  135. package/dist/shadcn/calendar.d.ts +0 -23
  136. package/dist/shadcn/calendar.d.ts.map +0 -1
  137. package/dist/shadcn/calendar.js +0 -163
  138. package/dist/shadcn/card.d.ts +0 -31
  139. package/dist/shadcn/card.d.ts.map +0 -1
  140. package/dist/shadcn/card.js +0 -55
  141. package/dist/shadcn/carousel.d.ts +0 -51
  142. package/dist/shadcn/carousel.d.ts.map +0 -1
  143. package/dist/shadcn/carousel.js +0 -161
  144. package/dist/shadcn/chart.d.ts +0 -103
  145. package/dist/shadcn/chart.d.ts.map +0 -1
  146. package/dist/shadcn/chart.js +0 -248
  147. package/dist/shadcn/checkbox.d.ts +0 -8
  148. package/dist/shadcn/checkbox.d.ts.map +0 -1
  149. package/dist/shadcn/checkbox.js +0 -22
  150. package/dist/shadcn/collapsible.d.ts +0 -16
  151. package/dist/shadcn/collapsible.d.ts.map +0 -1
  152. package/dist/shadcn/collapsible.js +0 -19
  153. package/dist/shadcn/command.d.ts +0 -61
  154. package/dist/shadcn/command.d.ts.map +0 -1
  155. package/dist/shadcn/command.js +0 -123
  156. package/dist/shadcn/context-menu.d.ts +0 -107
  157. package/dist/shadcn/context-menu.d.ts.map +0 -1
  158. package/dist/shadcn/context-menu.js +0 -151
  159. package/dist/shadcn/dialog.d.ts +0 -57
  160. package/dist/shadcn/dialog.d.ts.map +0 -1
  161. package/dist/shadcn/dialog.js +0 -96
  162. package/dist/shadcn/drawer.d.ts +0 -54
  163. package/dist/shadcn/drawer.d.ts.map +0 -1
  164. package/dist/shadcn/drawer.js +0 -96
  165. package/dist/shadcn/dropdown-menu.d.ts +0 -110
  166. package/dist/shadcn/dropdown-menu.d.ts.map +0 -1
  167. package/dist/shadcn/dropdown-menu.js +0 -152
  168. package/dist/shadcn/form.d.ts +0 -59
  169. package/dist/shadcn/form.d.ts.map +0 -1
  170. package/dist/shadcn/form.js +0 -99
  171. package/dist/shadcn/hover-card.d.ts +0 -20
  172. package/dist/shadcn/hover-card.d.ts.map +0 -1
  173. package/dist/shadcn/hover-card.js +0 -26
  174. package/dist/shadcn/input-otp.d.ts +0 -25
  175. package/dist/shadcn/input-otp.d.ts.map +0 -1
  176. package/dist/shadcn/input-otp.js +0 -54
  177. package/dist/shadcn/input.d.ts +0 -14
  178. package/dist/shadcn/input.d.ts.map +0 -1
  179. package/dist/shadcn/input.js +0 -48
  180. package/dist/shadcn/label.d.ts +0 -8
  181. package/dist/shadcn/label.d.ts.map +0 -1
  182. package/dist/shadcn/label.js +0 -16
  183. package/dist/shadcn/menubar.d.ts +0 -108
  184. package/dist/shadcn/menubar.d.ts.map +0 -1
  185. package/dist/shadcn/menubar.js +0 -174
  186. package/dist/shadcn/navigation-menu.d.ts +0 -79
  187. package/dist/shadcn/navigation-menu.d.ts.map +0 -1
  188. package/dist/shadcn/navigation-menu.js +0 -108
  189. package/dist/shadcn/pagination.d.ts +0 -45
  190. package/dist/shadcn/pagination.d.ts.map +0 -1
  191. package/dist/shadcn/pagination.js +0 -83
  192. package/dist/shadcn/popover.d.ts +0 -19
  193. package/dist/shadcn/popover.d.ts.map +0 -1
  194. package/dist/shadcn/popover.js +0 -29
  195. package/dist/shadcn/progress.d.ts +0 -9
  196. package/dist/shadcn/progress.d.ts.map +0 -1
  197. package/dist/shadcn/progress.js +0 -17
  198. package/dist/shadcn/radio-group.d.ts +0 -12
  199. package/dist/shadcn/radio-group.d.ts.map +0 -1
  200. package/dist/shadcn/radio-group.js +0 -32
  201. package/dist/shadcn/resizable.d.ts +0 -20
  202. package/dist/shadcn/resizable.d.ts.map +0 -1
  203. package/dist/shadcn/resizable.js +0 -32
  204. package/dist/shadcn/scroll-area.d.ts +0 -16
  205. package/dist/shadcn/scroll-area.d.ts.map +0 -1
  206. package/dist/shadcn/scroll-area.js +0 -40
  207. package/dist/shadcn/select.d.ts +0 -63
  208. package/dist/shadcn/select.d.ts.map +0 -1
  209. package/dist/shadcn/select.js +0 -120
  210. package/dist/shadcn/separator.d.ts +0 -10
  211. package/dist/shadcn/separator.d.ts.map +0 -1
  212. package/dist/shadcn/separator.js +0 -18
  213. package/dist/shadcn/sheet.d.ts +0 -48
  214. package/dist/shadcn/sheet.d.ts.map +0 -1
  215. package/dist/shadcn/sheet.js +0 -99
  216. package/dist/shadcn/sidebar.d.ts +0 -200
  217. package/dist/shadcn/sidebar.d.ts.map +0 -1
  218. package/dist/shadcn/sidebar.js +0 -528
  219. package/dist/shadcn/skeleton.d.ts +0 -6
  220. package/dist/shadcn/skeleton.d.ts.map +0 -1
  221. package/dist/shadcn/skeleton.js +0 -11
  222. package/dist/shadcn/slider.d.ts +0 -12
  223. package/dist/shadcn/slider.d.ts.map +0 -1
  224. package/dist/shadcn/slider.js +0 -50
  225. package/dist/shadcn/sonner.d.ts +0 -7
  226. package/dist/shadcn/sonner.d.ts.map +0 -1
  227. package/dist/shadcn/sonner.js +0 -20
  228. package/dist/shadcn/switch.d.ts +0 -8
  229. package/dist/shadcn/switch.d.ts.map +0 -1
  230. package/dist/shadcn/switch.js +0 -22
  231. package/dist/shadcn/table.d.ts +0 -35
  232. package/dist/shadcn/table.d.ts.map +0 -1
  233. package/dist/shadcn/table.js +0 -73
  234. package/dist/shadcn/tabs.d.ts +0 -20
  235. package/dist/shadcn/tabs.d.ts.map +0 -1
  236. package/dist/shadcn/tabs.js +0 -40
  237. package/dist/shadcn/textarea.d.ts +0 -7
  238. package/dist/shadcn/textarea.d.ts.map +0 -1
  239. package/dist/shadcn/textarea.js +0 -14
  240. package/dist/shadcn/toggle-group.d.ts +0 -22
  241. package/dist/shadcn/toggle-group.d.ts.map +0 -1
  242. package/dist/shadcn/toggle-group.js +0 -43
  243. package/dist/shadcn/toggle.d.ts +0 -29
  244. package/dist/shadcn/toggle.d.ts.map +0 -1
  245. package/dist/shadcn/toggle.js +0 -31
  246. package/dist/shadcn/tooltip.d.ts +0 -20
  247. package/dist/shadcn/tooltip.d.ts.map +0 -1
  248. package/dist/shadcn/tooltip.js +0 -40
  249. package/dist/stories/BackgroundSlideshow.stories.d.ts +0 -9
  250. package/dist/stories/BackgroundSlideshow.stories.d.ts.map +0 -1
  251. package/dist/stories/BackgroundSlideshow.stories.js +0 -60
  252. package/dist/stories/BlurryGradient.stories.d.ts +0 -11
  253. package/dist/stories/BlurryGradient.stories.d.ts.map +0 -1
  254. package/dist/stories/BlurryGradient.stories.js +0 -53
  255. package/dist/stories/Box.stories.d.ts +0 -13
  256. package/dist/stories/Box.stories.d.ts.map +0 -1
  257. package/dist/stories/Box.stories.js +0 -50
  258. package/dist/stories/Carousel.stories.d.ts +0 -9
  259. package/dist/stories/Carousel.stories.d.ts.map +0 -1
  260. package/dist/stories/Carousel.stories.js +0 -30
  261. package/dist/stories/Countdown.stories.d.ts +0 -7
  262. package/dist/stories/Countdown.stories.d.ts.map +0 -1
  263. package/dist/stories/Countdown.stories.js +0 -11
  264. package/dist/stories/DefinitionList.stories.d.ts +0 -9
  265. package/dist/stories/DefinitionList.stories.d.ts.map +0 -1
  266. package/dist/stories/DefinitionList.stories.js +0 -20
  267. package/dist/stories/GenericError.stories.d.ts +0 -9
  268. package/dist/stories/GenericError.stories.d.ts.map +0 -1
  269. package/dist/stories/GenericError.stories.js +0 -39
  270. package/dist/stories/Heading.stories.d.ts +0 -15
  271. package/dist/stories/Heading.stories.d.ts.map +0 -1
  272. package/dist/stories/Heading.stories.js +0 -61
  273. package/dist/stories/Highlight.stories.d.ts +0 -8
  274. package/dist/stories/Highlight.stories.d.ts.map +0 -1
  275. package/dist/stories/Highlight.stories.js +0 -19
  276. package/dist/stories/IconButton.stories.d.ts +0 -10
  277. package/dist/stories/IconButton.stories.d.ts.map +0 -1
  278. package/dist/stories/IconButton.stories.js +0 -32
  279. package/dist/stories/If.stories.d.ts +0 -13
  280. package/dist/stories/If.stories.d.ts.map +0 -1
  281. package/dist/stories/If.stories.js +0 -54
  282. package/dist/stories/Iframe.stories.d.ts +0 -8
  283. package/dist/stories/Iframe.stories.d.ts.map +0 -1
  284. package/dist/stories/Iframe.stories.js +0 -23
  285. package/dist/stories/Item.stories.d.ts +0 -10
  286. package/dist/stories/Item.stories.d.ts.map +0 -1
  287. package/dist/stories/Item.stories.js +0 -32
  288. package/dist/stories/Link.stories.d.ts +0 -10
  289. package/dist/stories/Link.stories.d.ts.map +0 -1
  290. package/dist/stories/Link.stories.js +0 -36
  291. package/dist/stories/ListItem.stories.d.ts +0 -9
  292. package/dist/stories/ListItem.stories.d.ts.map +0 -1
  293. package/dist/stories/ListItem.stories.js +0 -26
  294. package/dist/stories/MarkdownContainer.stories.d.ts +0 -11
  295. package/dist/stories/MarkdownContainer.stories.d.ts.map +0 -1
  296. package/dist/stories/MarkdownContainer.stories.js +0 -66
  297. package/dist/stories/PasswordInput.stories.d.ts +0 -9
  298. package/dist/stories/PasswordInput.stories.d.ts.map +0 -1
  299. package/dist/stories/PasswordInput.stories.js +0 -27
  300. package/dist/stories/Picture.stories.d.ts +0 -10
  301. package/dist/stories/Picture.stories.d.ts.map +0 -1
  302. package/dist/stories/Picture.stories.js +0 -46
  303. package/dist/stories/ProtectedEmail.stories.d.ts +0 -10
  304. package/dist/stories/ProtectedEmail.stories.d.ts.map +0 -1
  305. package/dist/stories/ProtectedEmail.stories.js +0 -34
  306. package/dist/stories/Text.stories.d.ts +0 -10
  307. package/dist/stories/Text.stories.d.ts.map +0 -1
  308. package/dist/stories/Text.stories.js +0 -31
  309. package/dist/stories/UnorderedList.stories.d.ts +0 -10
  310. package/dist/stories/UnorderedList.stories.d.ts.map +0 -1
  311. package/dist/stories/UnorderedList.stories.js +0 -24
  312. package/dist/test-setup.d.ts +0 -2
  313. package/dist/test-setup.d.ts.map +0 -1
  314. package/dist/test-setup.js +0 -1
  315. package/dist/utils/author.d.ts.map +0 -1
  316. package/dist/utils/author.test.d.ts +0 -2
  317. package/dist/utils/author.test.d.ts.map +0 -1
  318. package/dist/utils/author.test.js +0 -46
  319. package/dist/utils/cn.d.ts.map +0 -1
  320. package/dist/utils/cn.test.d.ts +0 -2
  321. package/dist/utils/cn.test.d.ts.map +0 -1
  322. package/dist/utils/cn.test.js +0 -33
  323. package/dist/utils/is-route-active.d.ts.map +0 -1
  324. package/dist/utils/is-route-active.test.d.ts +0 -2
  325. package/dist/utils/is-route-active.test.d.ts.map +0 -1
  326. package/dist/utils/is-route-active.test.js +0 -61
  327. package/dist/utils/locale.d.ts.map +0 -1
  328. package/dist/utils/locale.test.d.ts +0 -2
  329. package/dist/utils/locale.test.d.ts.map +0 -1
  330. package/dist/utils/locale.test.js +0 -99
  331. package/dist/utils/text.d.ts.map +0 -1
  332. package/dist/utils/text.test.d.ts +0 -2
  333. package/dist/utils/text.test.d.ts.map +0 -1
  334. package/dist/utils/text.test.js +0 -122
@@ -1,87 +1,167 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
1
  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 />');
2
+ import { createContext, forwardRef, useState, useCallback, useEffect, useContext } from 'react';
3
+ import { defineConfig, cx } from 'cva';
4
+ import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ // src/components/carousel.tsx
8
+ var { cva, compose } = defineConfig({
9
+ hooks: {
10
+ onComplete: (className) => {
11
+ return twMerge(className);
10
12
  }
11
- return context;
13
+ }
14
+ });
15
+ var cn = (...inputs) => twMerge(cx(inputs));
16
+ var CarouselContext = createContext(null);
17
+ function useCarousel() {
18
+ const context = useContext(CarouselContext);
19
+ if (!context) {
20
+ throw new Error("useCarousel must be used within a <Carousel />");
21
+ }
22
+ return context;
12
23
  }
13
- const Carousel = forwardRef(({ children, className, opts, orientation = 'horizontal', setApi, ...props }, ref) => {
24
+ var Carousel = forwardRef(
25
+ ({ children, className, opts, orientation = "horizontal", setApi, ...props }, ref) => {
14
26
  const [emblaRef, emblaApi] = useEmblaCarousel({
15
- ...opts,
16
- axis: orientation === 'horizontal' ? 'x' : 'y',
27
+ ...opts,
28
+ axis: orientation === "horizontal" ? "x" : "y"
17
29
  });
18
30
  const [canScrollPrev, setCanScrollPrev] = useState(false);
19
31
  const [canScrollNext, setCanScrollNext] = useState(false);
20
32
  const onSelect = useCallback((api) => {
21
- if (!api) {
22
- return;
23
- }
24
- setCanScrollPrev(api.canScrollPrev());
25
- setCanScrollNext(api.canScrollNext());
33
+ if (!api) {
34
+ return;
35
+ }
36
+ setCanScrollPrev(api.canScrollPrev());
37
+ setCanScrollNext(api.canScrollNext());
26
38
  }, []);
27
39
  const scrollPrev = useCallback(() => {
28
- emblaApi?.scrollPrev();
40
+ emblaApi?.scrollPrev();
29
41
  }, [emblaApi]);
30
42
  const scrollNext = useCallback(() => {
31
- emblaApi?.scrollNext();
43
+ emblaApi?.scrollNext();
32
44
  }, [emblaApi]);
33
- const handleKeyDown = useCallback((event) => {
34
- if (event.key === 'ArrowLeft') {
35
- event.preventDefault();
36
- scrollPrev();
45
+ const handleKeyDown = useCallback(
46
+ (event) => {
47
+ if (event.key === "ArrowLeft") {
48
+ event.preventDefault();
49
+ scrollPrev();
50
+ } else if (event.key === "ArrowRight") {
51
+ event.preventDefault();
52
+ scrollNext();
37
53
  }
38
- else if (event.key === 'ArrowRight') {
39
- event.preventDefault();
40
- scrollNext();
41
- }
42
- }, [scrollPrev, scrollNext]);
54
+ },
55
+ [scrollPrev, scrollNext]
56
+ );
43
57
  useEffect(() => {
44
- if (!emblaApi || !setApi) {
45
- return;
46
- }
47
- setApi(emblaApi);
58
+ if (!emblaApi || !setApi) {
59
+ return;
60
+ }
61
+ setApi(emblaApi);
48
62
  }, [emblaApi, setApi]);
49
63
  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
- };
64
+ if (!emblaApi) {
65
+ return;
66
+ }
67
+ onSelect(emblaApi);
68
+ emblaApi.on("reInit", onSelect);
69
+ emblaApi.on("select", onSelect);
70
+ return () => {
71
+ emblaApi?.off("select", onSelect);
72
+ };
59
73
  }, [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) => {
74
+ return /* @__PURE__ */ jsx(
75
+ CarouselContext.Provider,
76
+ {
77
+ value: {
78
+ api: emblaApi,
79
+ canScrollNext,
80
+ canScrollPrev,
81
+ scrollNext,
82
+ scrollPrev
83
+ },
84
+ children: /* @__PURE__ */ jsx(
85
+ "section",
86
+ {
87
+ "aria-label": "Carousel",
88
+ "aria-roledescription": "carousel",
89
+ className: cn("relative", className),
90
+ onKeyDownCapture: handleKeyDown,
91
+ ref,
92
+ ...props,
93
+ children: /* @__PURE__ */ jsx("div", { ref: emblaRef, children: /* @__PURE__ */ jsx("div", { children }) })
94
+ }
95
+ )
96
+ }
97
+ );
98
+ }
99
+ );
100
+ Carousel.displayName = "Carousel";
101
+ var CarouselContent = forwardRef(
102
+ ({ className, ...props }, ref) => {
103
+ return /* @__PURE__ */ jsx(
104
+ "div",
105
+ {
106
+ className: cn("flex", className),
107
+ ref,
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ );
113
+ CarouselContent.displayName = "CarouselContent";
114
+ var CarouselItem = forwardRef(
115
+ ({ className, ...props }, ref) => {
116
+ return (
117
+ // biome-ignore lint/a11y/useSemanticElements: False positive
118
+ /* @__PURE__ */ jsx(
119
+ "div",
120
+ {
121
+ "aria-roledescription": "slide",
122
+ className: cn("min-w-0 shrink-0 grow-0", className),
123
+ ref,
124
+ role: "group",
125
+ ...props
126
+ }
127
+ )
128
+ );
129
+ }
130
+ );
131
+ CarouselItem.displayName = "CarouselItem";
132
+ var CarouselPrevious = forwardRef(
133
+ ({ className, ...props }, ref) => {
78
134
  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) => {
135
+ return /* @__PURE__ */ jsx(
136
+ "button",
137
+ {
138
+ className: cn("disabled:opacity-50", className),
139
+ disabled: !canScrollPrev,
140
+ onClick: scrollPrev,
141
+ ref,
142
+ type: "button",
143
+ ...props
144
+ }
145
+ );
146
+ }
147
+ );
148
+ CarouselPrevious.displayName = "CarouselPrevious";
149
+ var CarouselNext = forwardRef(
150
+ ({ className, ...props }, ref) => {
83
151
  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';
152
+ return /* @__PURE__ */ jsx(
153
+ "button",
154
+ {
155
+ className: cn("disabled:opacity-50", className),
156
+ disabled: !canScrollNext,
157
+ onClick: scrollNext,
158
+ ref,
159
+ type: "button",
160
+ ...props
161
+ }
162
+ );
163
+ }
164
+ );
165
+ CarouselNext.displayName = "CarouselNext";
166
+
87
167
  export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
@@ -1,2 +1,5 @@
1
- export declare function Countdown(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=countdown.d.ts.map
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare function Countdown(): react_jsx_runtime.JSX.Element;
4
+
5
+ export { Countdown };
@@ -1,22 +1,51 @@
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(
1
+ import { useState, useEffect } from 'react';
2
+ import { defineConfig, cx } from 'cva';
3
+ import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ // src/components/countdown.tsx
7
+ var { cva, compose } = defineConfig({
8
+ hooks: {
9
+ onComplete: (className) => {
10
+ return twMerge(className);
11
+ }
12
+ }
13
+ });
14
+ var cn = (...inputs) => twMerge(cx(inputs));
15
+ function Countdown() {
16
+ const [timerValue, setTimerValue] = useState(0);
17
+ const [isMounted, setIsMounted] = useState(false);
18
+ useEffect(() => {
19
+ setIsMounted(true);
20
+ const intervalId = setInterval(() => {
21
+ setTimerValue((prevValue) => {
22
+ return prevValue + 1;
23
+ });
24
+ }, 1e3);
25
+ return () => {
26
+ return clearInterval(intervalId);
27
+ };
28
+ }, []);
29
+ return /* @__PURE__ */ jsx(
30
+ "div",
31
+ {
32
+ className: cn(
33
+ "before:absolute",
34
+ "before:bg-white",
35
+ 'before:content-[""]',
36
+ "before:h-[180px]",
37
+ "before:rounded-full",
38
+ "before:w-[180px]",
39
+ "flex",
40
+ "h-[240px]",
41
+ "items-center",
42
+ "justify-center",
43
+ "relative",
44
+ "rounded-full",
45
+ "w-[240px]"
46
+ ),
47
+ style: {
48
+ background: `conic-gradient(
20
49
  transparent ${6 * (isMounted ? timerValue : 0)}deg,
21
50
  hsl(var(--red-500)) 0deg,
22
51
  hsl(var(--red-500)) 15deg,
@@ -43,6 +72,11 @@ export function Countdown() {
43
72
  hsl(var(--pink-500)) 315deg,
44
73
  hsl(var(--pink-500)) 345deg,
45
74
  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 }) }));
75
+ )`
76
+ },
77
+ children: /* @__PURE__ */ jsx("span", { className: cn("text-foreground", "relative", "text-3xl", "font-bold"), children: isMounted ? timerValue < 10 ? `0${timerValue}` : timerValue : 0 })
78
+ }
79
+ );
48
80
  }
81
+
82
+ export { Countdown };
@@ -1,40 +1,43 @@
1
- import type { ComponentProps } from 'react';
2
- import { type VariantProps } from '../utils/cn';
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as cva from 'cva';
3
+ import { VariantProps } from 'cva';
4
+ import { ComponentProps } from 'react';
5
+
3
6
  declare const dl: (props?: ({
4
7
  variant?: "primary" | "unstyled" | undefined;
5
8
  } & ({
6
- class?: import("cva").ClassValue;
9
+ class?: cva.ClassValue;
7
10
  className?: never;
8
11
  } | {
9
12
  class?: never;
10
- className?: import("cva").ClassValue;
13
+ className?: cva.ClassValue;
11
14
  })) | undefined) => string;
12
15
  declare const dt: (props?: ({
13
16
  variant?: "primary" | undefined;
14
17
  } & ({
15
- class?: import("cva").ClassValue;
18
+ class?: cva.ClassValue;
16
19
  className?: never;
17
20
  } | {
18
21
  class?: never;
19
- className?: import("cva").ClassValue;
22
+ className?: cva.ClassValue;
20
23
  })) | undefined) => string;
21
24
  declare const dd: (props?: ({
22
25
  variant?: "primary" | undefined;
23
26
  } & ({
24
- class?: import("cva").ClassValue;
27
+ class?: cva.ClassValue;
25
28
  className?: never;
26
29
  } | {
27
30
  class?: never;
28
- className?: import("cva").ClassValue;
31
+ className?: cva.ClassValue;
29
32
  })) | undefined) => string;
30
- export interface DefinitionListProps extends ComponentProps<'dl'>, VariantProps<typeof dl> {
33
+ interface DefinitionListProps extends ComponentProps<'dl'>, VariantProps<typeof dl> {
31
34
  }
32
- export interface DtProps extends ComponentProps<'dt'>, VariantProps<typeof dt> {
35
+ interface DtProps extends ComponentProps<'dt'>, VariantProps<typeof dt> {
33
36
  }
34
- export interface DdProps extends ComponentProps<'dd'>, VariantProps<typeof dd> {
37
+ interface DdProps extends ComponentProps<'dd'>, VariantProps<typeof dd> {
35
38
  }
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
39
+ declare const DefinitionList: (props: DefinitionListProps) => react_jsx_runtime.JSX.Element;
40
+ declare const Dt: (props: DtProps) => react_jsx_runtime.JSX.Element;
41
+ declare const Dd: (props: DdProps) => react_jsx_runtime.JSX.Element;
42
+
43
+ export { Dd, type DdProps, DefinitionList, type DefinitionListProps, Dt, type DtProps };
@@ -1,57 +1,89 @@
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
- },
1
+ import { defineConfig } from 'cva';
2
+ import { twMerge } from 'fluid-tailwindcss/tailwind-merge';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/utils/cn.ts
6
+ var { cva, compose } = defineConfig({
7
+ hooks: {
8
+ onComplete: (className) => {
9
+ return twMerge(className);
10
+ }
11
+ }
14
12
  });
15
- const dt = cva({
16
- base: [],
17
- defaultVariants: {
18
- variant: 'primary',
19
- },
20
- variants: {
21
- variant: {
22
- primary: ['uppercase', 'tracking-wide'],
23
- },
24
- },
13
+ var dl = cva({
14
+ base: ["grid"],
15
+ defaultVariants: {
16
+ variant: "primary"
17
+ },
18
+ variants: {
19
+ variant: {
20
+ primary: ["grid-cols-[auto,1fr]", "gap-x-s", "gap-y-2xs"],
21
+ // Two-column grid with gap
22
+ unstyled: ["list-none", "p-0", "grid-cols-1"]
23
+ // Unstyled, single column
24
+ }
25
+ }
25
26
  });
26
- const dd = cva({
27
- base: ['mb-xs'],
28
- defaultVariants: {
29
- variant: 'primary',
30
- },
31
- variants: {
32
- variant: {
33
- primary: [],
34
- },
35
- },
27
+ var dt = cva({
28
+ base: [],
29
+ defaultVariants: {
30
+ variant: "primary"
31
+ },
32
+ variants: {
33
+ variant: {
34
+ primary: ["uppercase", "tracking-wide"]
35
+ }
36
+ }
36
37
  });
37
- export const DefinitionList = (props) => {
38
- const { children, className, variant } = props;
39
- return (_jsx("dl", { className: dl({
40
- className,
41
- variant,
42
- }), children: children }));
38
+ var dd = cva({
39
+ base: ["mb-xs"],
40
+ defaultVariants: {
41
+ variant: "primary"
42
+ },
43
+ variants: {
44
+ variant: {
45
+ primary: []
46
+ }
47
+ }
48
+ });
49
+ var DefinitionList = (props) => {
50
+ const { children, className, variant } = props;
51
+ return /* @__PURE__ */ jsx(
52
+ "dl",
53
+ {
54
+ className: dl({
55
+ className,
56
+ variant
57
+ }),
58
+ children
59
+ }
60
+ );
43
61
  };
44
- export const Dt = (props) => {
45
- const { children, className, variant } = props;
46
- return (_jsx("dt", { className: dt({
47
- className,
48
- variant,
49
- }), children: children }));
62
+ var Dt = (props) => {
63
+ const { children, className, variant } = props;
64
+ return /* @__PURE__ */ jsx(
65
+ "dt",
66
+ {
67
+ className: dt({
68
+ className,
69
+ variant
70
+ }),
71
+ children
72
+ }
73
+ );
50
74
  };
51
- export const Dd = (props) => {
52
- const { children, className, variant } = props;
53
- return (_jsx("dd", { className: dd({
54
- className,
55
- variant,
56
- }), children: children }));
75
+ var Dd = (props) => {
76
+ const { children, className, variant } = props;
77
+ return /* @__PURE__ */ jsx(
78
+ "dd",
79
+ {
80
+ className: dd({
81
+ className,
82
+ variant
83
+ }),
84
+ children
85
+ }
86
+ );
57
87
  };
88
+
89
+ export { Dd, DefinitionList, Dt };
@@ -1,5 +1,9 @@
1
- import type { ReactElement } from 'react';
2
- export type ErrorDescriptor = {
1
+ import { ReactElement } from 'react';
2
+
3
+ /**
4
+ * Descriptor returned from getErrorDescriptor to help apps localize messages.
5
+ */
6
+ type ErrorDescriptor = {
3
7
  type: 'http';
4
8
  status: number;
5
9
  statusText: string;
@@ -16,8 +20,24 @@ export type ErrorDescriptor = {
16
20
  defaultId: string;
17
21
  defaultMessage: string;
18
22
  };
19
- export declare function getErrorDescriptor(error: unknown): ErrorDescriptor;
20
- export declare function GenericError({ renderMessage, }?: {
23
+ /**
24
+ * Compute a normalized error descriptor from a React Router error.
25
+ * Apps can use this to map to i18n keys.
26
+ */
27
+ declare function getErrorDescriptor(error: unknown): ErrorDescriptor;
28
+ /**
29
+ * GenericError
30
+ *
31
+ * A reusable error boundary component for React Router apps.
32
+ * - Displays status-based messages for route responses
33
+ * - Shows stack traces in development for non-response errors
34
+ *
35
+ * For localization, apps may either:
36
+ * - Wrap this component and use `getErrorDescriptor(useRouteError())` to map to i18n keys
37
+ * - Or provide a custom `renderMessage` to override the displayed details
38
+ */
39
+ declare function GenericError({ renderMessage, }?: {
21
40
  renderMessage?: (descriptor: ErrorDescriptor) => ReactElement;
22
41
  }): ReactElement;
23
- //# sourceMappingURL=generic-error.d.ts.map
42
+
43
+ export { type ErrorDescriptor, GenericError, getErrorDescriptor };
@@ -1,39 +1,47 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import { isRouteErrorResponse, useRouteError } from 'react-router';
3
- export function getErrorDescriptor(error) {
4
- if (isRouteErrorResponse(error)) {
5
- const status = error.status;
6
- const statusText = error.statusText || 'Error';
7
- return {
8
- defaultId: status === 404 ? 'errors.404' : 'errors.http',
9
- defaultMessage: status === 404 ? 'Not found' : `Error ${status}`,
10
- status,
11
- statusText,
12
- type: 'http',
13
- };
14
- }
15
- if (error instanceof Error) {
16
- return {
17
- defaultId: 'errors.runtime',
18
- defaultMessage: 'An unexpected error occurred.',
19
- message: error.message,
20
- type: 'error',
21
- ...(error.stack ? { stack: error.stack } : {}),
22
- };
23
- }
2
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+
4
+ // src/components/generic-error.tsx
5
+ function getErrorDescriptor(error) {
6
+ if (isRouteErrorResponse(error)) {
7
+ const status = error.status;
8
+ const statusText = error.statusText || "Error";
24
9
  return {
25
- defaultId: 'errors.unknown',
26
- defaultMessage: 'An unexpected error occurred.',
27
- type: 'unknown',
10
+ defaultId: status === 404 ? "errors.404" : "errors.http",
11
+ defaultMessage: status === 404 ? "Not found" : `Error ${status}`,
12
+ status,
13
+ statusText,
14
+ type: "http"
28
15
  };
16
+ }
17
+ if (error instanceof Error) {
18
+ return {
19
+ defaultId: "errors.runtime",
20
+ defaultMessage: "An unexpected error occurred.",
21
+ message: error.message,
22
+ type: "error",
23
+ ...error.stack ? { stack: error.stack } : {}
24
+ };
25
+ }
26
+ return {
27
+ defaultId: "errors.unknown",
28
+ defaultMessage: "An unexpected error occurred.",
29
+ type: "unknown"
30
+ };
29
31
  }
30
- export function GenericError({ renderMessage, } = {}) {
31
- const error = useRouteError();
32
- const descriptor = getErrorDescriptor(error);
33
- const title = descriptor.type === 'http' ? `Error ${descriptor.status}` : 'Error';
34
- return (_jsxs("main", { className: "pt-2xl p-sm container mx-auto", children: [_jsx("h1", { children: title }), renderMessage ? (renderMessage(descriptor)) : (_jsxs(_Fragment, { children: [_jsx("p", { children: descriptor.type === 'http'
35
- ? descriptor.defaultMessage
36
- : descriptor.type === 'error'
37
- ? descriptor.message || descriptor.defaultMessage
38
- : descriptor.defaultMessage }), import.meta.env.DEV && descriptor.type === 'error' && descriptor.stack && (_jsx("pre", { className: "w-full p-sm overflow-x-auto", children: _jsx("code", { children: descriptor.stack }) }))] }))] }));
32
+ function GenericError({
33
+ renderMessage
34
+ } = {}) {
35
+ const error = useRouteError();
36
+ const descriptor = getErrorDescriptor(error);
37
+ const title = descriptor.type === "http" ? `Error ${descriptor.status}` : "Error";
38
+ return /* @__PURE__ */ jsxs("main", { className: "pt-2xl p-sm container mx-auto", children: [
39
+ /* @__PURE__ */ jsx("h1", { children: title }),
40
+ renderMessage ? renderMessage(descriptor) : /* @__PURE__ */ jsxs(Fragment, { children: [
41
+ /* @__PURE__ */ jsx("p", { children: descriptor.type === "http" ? descriptor.defaultMessage : descriptor.type === "error" ? descriptor.message || descriptor.defaultMessage : descriptor.defaultMessage }),
42
+ import.meta.env.DEV && descriptor.type === "error" && descriptor.stack && /* @__PURE__ */ jsx("pre", { className: "w-full p-sm overflow-x-auto", children: /* @__PURE__ */ jsx("code", { children: descriptor.stack }) })
43
+ ] })
44
+ ] });
39
45
  }
46
+
47
+ export { GenericError, getErrorDescriptor };