@arolariu/components 1.1.0 → 2.0.0

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 (325) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/components/ui/accordion.js +3 -3
  3. package/dist/components/ui/accordion.js.map +1 -1
  4. package/dist/components/ui/accordion_module.css.map +1 -1
  5. package/dist/components/ui/alert-dialog.js +8 -8
  6. package/dist/components/ui/alert-dialog.js.map +1 -1
  7. package/dist/components/ui/alert-dialog_module.css +1 -1
  8. package/dist/components/ui/alert-dialog_module.css.map +1 -1
  9. package/dist/components/ui/alert.js +4 -4
  10. package/dist/components/ui/alert.js.map +1 -1
  11. package/dist/components/ui/alert_module.css.map +1 -1
  12. package/dist/components/ui/aspect-ratio.js +2 -2
  13. package/dist/components/ui/aspect-ratio.js.map +1 -1
  14. package/dist/components/ui/aspect-ratio_module.css.map +1 -1
  15. package/dist/components/ui/async-boundary.js +2 -2
  16. package/dist/components/ui/async-boundary.js.map +1 -1
  17. package/dist/components/ui/avatar.js +4 -4
  18. package/dist/components/ui/avatar.js.map +1 -1
  19. package/dist/components/ui/avatar_module.css.map +1 -1
  20. package/dist/components/ui/background-beams.js +3 -3
  21. package/dist/components/ui/background-beams.js.map +1 -1
  22. package/dist/components/ui/background-beams_module.css.map +1 -1
  23. package/dist/components/ui/badge.js +2 -2
  24. package/dist/components/ui/badge.js.map +1 -1
  25. package/dist/components/ui/badge_module.css.map +1 -1
  26. package/dist/components/ui/breadcrumb.js +10 -10
  27. package/dist/components/ui/breadcrumb.js.map +1 -1
  28. package/dist/components/ui/breadcrumb_module.css.map +1 -1
  29. package/dist/components/ui/bubble-background.js +5 -5
  30. package/dist/components/ui/bubble-background.js.map +1 -1
  31. package/dist/components/ui/bubble-background_module.css.map +1 -1
  32. package/dist/components/ui/button-group.js +6 -6
  33. package/dist/components/ui/button-group.js.map +1 -1
  34. package/dist/components/ui/button-group_module.css.map +1 -1
  35. package/dist/components/ui/button.js +4 -4
  36. package/dist/components/ui/button.js.map +1 -1
  37. package/dist/components/ui/button_module.css.map +1 -1
  38. package/dist/components/ui/calendar.d.ts +2 -1
  39. package/dist/components/ui/calendar.d.ts.map +1 -1
  40. package/dist/components/ui/calendar.js +4 -4
  41. package/dist/components/ui/calendar.js.map +1 -1
  42. package/dist/components/ui/calendar_module.css.map +1 -1
  43. package/dist/components/ui/card-skeleton.js +2 -2
  44. package/dist/components/ui/card-skeleton.js.map +1 -1
  45. package/dist/components/ui/card-skeleton_module.css.map +1 -1
  46. package/dist/components/ui/card.js +8 -8
  47. package/dist/components/ui/card.js.map +1 -1
  48. package/dist/components/ui/card_module.css.map +1 -1
  49. package/dist/components/ui/carousel.js +16 -16
  50. package/dist/components/ui/carousel.js.map +1 -1
  51. package/dist/components/ui/carousel_module.css +1 -1
  52. package/dist/components/ui/carousel_module.css.map +1 -1
  53. package/dist/components/ui/chart.d.ts +6 -3
  54. package/dist/components/ui/chart.d.ts.map +1 -1
  55. package/dist/components/ui/chart.js +70 -136
  56. package/dist/components/ui/chart.js.map +1 -1
  57. package/dist/components/ui/chart_module.css.map +1 -1
  58. package/dist/components/ui/checkbox-group.js +2 -2
  59. package/dist/components/ui/checkbox-group.js.map +1 -1
  60. package/dist/components/ui/checkbox-group_module.css.map +1 -1
  61. package/dist/components/ui/checkbox.js +2 -2
  62. package/dist/components/ui/checkbox.js.map +1 -1
  63. package/dist/components/ui/checkbox_module.css.map +1 -1
  64. package/dist/components/ui/collapsible.js +4 -4
  65. package/dist/components/ui/collapsible.js.map +1 -1
  66. package/dist/components/ui/collapsible_module.css.map +1 -1
  67. package/dist/components/ui/combobox.js +13 -13
  68. package/dist/components/ui/combobox.js.map +1 -1
  69. package/dist/components/ui/combobox_module.css.map +1 -1
  70. package/dist/components/ui/command.js +40 -40
  71. package/dist/components/ui/command.js.map +1 -1
  72. package/dist/components/ui/command_module.css +1 -1
  73. package/dist/components/ui/command_module.css.map +1 -1
  74. package/dist/components/ui/context-menu.js +6 -6
  75. package/dist/components/ui/context-menu.js.map +1 -1
  76. package/dist/components/ui/context-menu_module.css.map +1 -1
  77. package/dist/components/ui/copy-button.js +6 -6
  78. package/dist/components/ui/copy-button.js.map +1 -1
  79. package/dist/components/ui/copy-button_module.css.map +1 -1
  80. package/dist/components/ui/counting-number.js +6 -6
  81. package/dist/components/ui/counting-number.js.map +1 -1
  82. package/dist/components/ui/counting-number_module.css.map +1 -1
  83. package/dist/components/ui/dialog.js +6 -6
  84. package/dist/components/ui/dialog.js.map +1 -1
  85. package/dist/components/ui/dialog_module.css +1 -1
  86. package/dist/components/ui/dialog_module.css.map +1 -1
  87. package/dist/components/ui/dot-background_module.css.map +1 -1
  88. package/dist/components/ui/drawer.js +5 -5
  89. package/dist/components/ui/drawer.js.map +1 -1
  90. package/dist/components/ui/drawer_module.css.map +1 -1
  91. package/dist/components/ui/dropdown-menu.js +6 -6
  92. package/dist/components/ui/dropdown-menu.js.map +1 -1
  93. package/dist/components/ui/dropdown-menu_module.css.map +1 -1
  94. package/dist/components/ui/dropdrawer.js +52 -52
  95. package/dist/components/ui/dropdrawer.js.map +1 -1
  96. package/dist/components/ui/dropdrawer_module.css.map +1 -1
  97. package/dist/components/ui/empty.js +7 -7
  98. package/dist/components/ui/empty.js.map +1 -1
  99. package/dist/components/ui/empty_module.css.map +1 -1
  100. package/dist/components/ui/error-boundary.js +2 -2
  101. package/dist/components/ui/error-boundary.js.map +1 -1
  102. package/dist/components/ui/error-boundary_module.css.map +1 -1
  103. package/dist/components/ui/field.js +12 -12
  104. package/dist/components/ui/field.js.map +1 -1
  105. package/dist/components/ui/field_module.css.map +1 -1
  106. package/dist/components/ui/fireworks-background.js +6 -6
  107. package/dist/components/ui/fireworks-background.js.map +1 -1
  108. package/dist/components/ui/fireworks-background_module.css.map +1 -1
  109. package/dist/components/ui/flip-button.js +5 -5
  110. package/dist/components/ui/flip-button.js.map +1 -1
  111. package/dist/components/ui/flip-button_module.css.map +1 -1
  112. package/dist/components/ui/focus-scope.js +6 -6
  113. package/dist/components/ui/focus-scope.js.map +1 -1
  114. package/dist/components/ui/focus-scope_module.css.map +1 -1
  115. package/dist/components/ui/form-skeleton.js +2 -2
  116. package/dist/components/ui/form-skeleton.js.map +1 -1
  117. package/dist/components/ui/form-skeleton_module.css.map +1 -1
  118. package/dist/components/ui/form.d.ts +3 -3
  119. package/dist/components/ui/form.d.ts.map +1 -1
  120. package/dist/components/ui/form.js +13 -13
  121. package/dist/components/ui/form.js.map +1 -1
  122. package/dist/components/ui/form_module.css.map +1 -1
  123. package/dist/components/ui/gradient-background.js +2 -2
  124. package/dist/components/ui/gradient-background.js.map +1 -1
  125. package/dist/components/ui/gradient-background_module.css.map +1 -1
  126. package/dist/components/ui/gradient-text.js +2 -2
  127. package/dist/components/ui/gradient-text.js.map +1 -1
  128. package/dist/components/ui/gradient-text_module.css.map +1 -1
  129. package/dist/components/ui/highlight-text.js +4 -4
  130. package/dist/components/ui/highlight-text.js.map +1 -1
  131. package/dist/components/ui/highlight-text_module.css.map +1 -1
  132. package/dist/components/ui/hole-background.js +21 -21
  133. package/dist/components/ui/hole-background.js.map +1 -1
  134. package/dist/components/ui/hole-background_module.css.map +1 -1
  135. package/dist/components/ui/hover-card.js +3 -3
  136. package/dist/components/ui/hover-card.js.map +1 -1
  137. package/dist/components/ui/hover-card_module.css.map +1 -1
  138. package/dist/components/ui/input-group.js +7 -7
  139. package/dist/components/ui/input-group.js.map +1 -1
  140. package/dist/components/ui/input-group_module.css.map +1 -1
  141. package/dist/components/ui/input-otp.d.ts +3 -3
  142. package/dist/components/ui/input-otp.d.ts.map +1 -1
  143. package/dist/components/ui/input-otp.js +6 -6
  144. package/dist/components/ui/input-otp.js.map +1 -1
  145. package/dist/components/ui/input-otp_module.css.map +1 -1
  146. package/dist/components/ui/input.js +2 -2
  147. package/dist/components/ui/input.js.map +1 -1
  148. package/dist/components/ui/input_module.css.map +1 -1
  149. package/dist/components/ui/item.js +13 -13
  150. package/dist/components/ui/item.js.map +1 -1
  151. package/dist/components/ui/item_module.css.map +1 -1
  152. package/dist/components/ui/kbd.js +3 -3
  153. package/dist/components/ui/kbd.js.map +1 -1
  154. package/dist/components/ui/kbd_module.css.map +1 -1
  155. package/dist/components/ui/label.js +2 -2
  156. package/dist/components/ui/label.js.map +1 -1
  157. package/dist/components/ui/label_module.css.map +1 -1
  158. package/dist/components/ui/list-skeleton.js +2 -2
  159. package/dist/components/ui/list-skeleton.js.map +1 -1
  160. package/dist/components/ui/list-skeleton_module.css.map +1 -1
  161. package/dist/components/ui/loading-overlay.js +2 -2
  162. package/dist/components/ui/loading-overlay.js.map +1 -1
  163. package/dist/components/ui/loading-overlay_module.css.map +1 -1
  164. package/dist/components/ui/menubar.js +4 -4
  165. package/dist/components/ui/menubar.js.map +1 -1
  166. package/dist/components/ui/menubar_module.css.map +1 -1
  167. package/dist/components/ui/meter.js +5 -5
  168. package/dist/components/ui/meter.js.map +1 -1
  169. package/dist/components/ui/meter_module.css.map +1 -1
  170. package/dist/components/ui/navigation-menu.js +5 -5
  171. package/dist/components/ui/navigation-menu.js.map +1 -1
  172. package/dist/components/ui/navigation-menu_module.css +1 -1
  173. package/dist/components/ui/navigation-menu_module.css.map +1 -1
  174. package/dist/components/ui/number-field.js +3 -3
  175. package/dist/components/ui/number-field.js.map +1 -1
  176. package/dist/components/ui/number-field_module.css.map +1 -1
  177. package/dist/components/ui/pagination.js +8 -8
  178. package/dist/components/ui/pagination.js.map +1 -1
  179. package/dist/components/ui/pagination_module.css.map +1 -1
  180. package/dist/components/ui/popover.js +5 -5
  181. package/dist/components/ui/popover.js.map +1 -1
  182. package/dist/components/ui/popover_module.css.map +1 -1
  183. package/dist/components/ui/progress.js +2 -2
  184. package/dist/components/ui/progress.js.map +1 -1
  185. package/dist/components/ui/progress_module.css.map +1 -1
  186. package/dist/components/ui/radio-group.js +3 -3
  187. package/dist/components/ui/radio-group.js.map +1 -1
  188. package/dist/components/ui/radio-group_module.css.map +1 -1
  189. package/dist/components/ui/resizable.d.ts +13 -29
  190. package/dist/components/ui/resizable.d.ts.map +1 -1
  191. package/dist/components/ui/resizable.js +8 -7
  192. package/dist/components/ui/resizable.js.map +1 -1
  193. package/dist/components/ui/resizable_module.css.map +1 -1
  194. package/dist/components/ui/ripple-button.js +9 -9
  195. package/dist/components/ui/ripple-button.js.map +1 -1
  196. package/dist/components/ui/ripple-button_module.css.map +1 -1
  197. package/dist/components/ui/scratcher_module.css.map +1 -1
  198. package/dist/components/ui/scroll-area.js +2 -2
  199. package/dist/components/ui/scroll-area.js.map +1 -1
  200. package/dist/components/ui/scroll-area_module.css.map +1 -1
  201. package/dist/components/ui/select.js +4 -4
  202. package/dist/components/ui/select.js.map +1 -1
  203. package/dist/components/ui/select_module.css.map +1 -1
  204. package/dist/components/ui/separator.js +2 -2
  205. package/dist/components/ui/separator.js.map +1 -1
  206. package/dist/components/ui/separator_module.css.map +1 -1
  207. package/dist/components/ui/sheet.js +6 -6
  208. package/dist/components/ui/sheet.js.map +1 -1
  209. package/dist/components/ui/sheet_module.css.map +1 -1
  210. package/dist/components/ui/sidebar.js +36 -36
  211. package/dist/components/ui/sidebar.js.map +1 -1
  212. package/dist/components/ui/sidebar_module.css.map +1 -1
  213. package/dist/components/ui/skeleton.js +2 -2
  214. package/dist/components/ui/skeleton.js.map +1 -1
  215. package/dist/components/ui/skeleton_module.css.map +1 -1
  216. package/dist/components/ui/slider.js +2 -2
  217. package/dist/components/ui/slider.js.map +1 -1
  218. package/dist/components/ui/slider_module.css.map +1 -1
  219. package/dist/components/ui/spinner.js +2 -2
  220. package/dist/components/ui/spinner.js.map +1 -1
  221. package/dist/components/ui/spinner_module.css.map +1 -1
  222. package/dist/components/ui/stepper.js +2 -2
  223. package/dist/components/ui/stepper.js.map +1 -1
  224. package/dist/components/ui/stepper_module.css.map +1 -1
  225. package/dist/components/ui/switch.js +2 -2
  226. package/dist/components/ui/switch.js.map +1 -1
  227. package/dist/components/ui/switch_module.css.map +1 -1
  228. package/dist/components/ui/table-skeleton.js +2 -2
  229. package/dist/components/ui/table-skeleton.js.map +1 -1
  230. package/dist/components/ui/table-skeleton_module.css.map +1 -1
  231. package/dist/components/ui/table.js +9 -9
  232. package/dist/components/ui/table.js.map +1 -1
  233. package/dist/components/ui/table_module.css.map +1 -1
  234. package/dist/components/ui/tabs.js +3 -3
  235. package/dist/components/ui/tabs.js.map +1 -1
  236. package/dist/components/ui/tabs_module.css.map +1 -1
  237. package/dist/components/ui/textarea.js +2 -2
  238. package/dist/components/ui/textarea.js.map +1 -1
  239. package/dist/components/ui/textarea_module.css.map +1 -1
  240. package/dist/components/ui/timeline.js +5 -5
  241. package/dist/components/ui/timeline.js.map +1 -1
  242. package/dist/components/ui/timeline_module.css.map +1 -1
  243. package/dist/components/ui/{sonner.d.ts → toast.d.ts} +10 -2
  244. package/dist/components/ui/toast.d.ts.map +1 -0
  245. package/dist/components/ui/{sonner.js → toast.js} +40 -40
  246. package/dist/components/ui/toast.js.map +1 -0
  247. package/dist/components/ui/toast.module.js +34 -0
  248. package/dist/components/ui/toast.module.js.map +1 -0
  249. package/dist/components/ui/{sonner_module.css → toast_module.css} +35 -35
  250. package/dist/components/ui/toast_module.css.map +1 -0
  251. package/dist/components/ui/toggle-group.js +5 -5
  252. package/dist/components/ui/toggle-group.js.map +1 -1
  253. package/dist/components/ui/toggle-group_module.css.map +1 -1
  254. package/dist/components/ui/toggle.js +2 -2
  255. package/dist/components/ui/toggle.js.map +1 -1
  256. package/dist/components/ui/toggle_module.css.map +1 -1
  257. package/dist/components/ui/toolbar.js +6 -6
  258. package/dist/components/ui/toolbar.js.map +1 -1
  259. package/dist/components/ui/toolbar_module.css.map +1 -1
  260. package/dist/components/ui/tooltip.js +4 -4
  261. package/dist/components/ui/tooltip.js.map +1 -1
  262. package/dist/components/ui/tooltip_module.css.map +1 -1
  263. package/dist/components/ui/typewriter.js +4 -4
  264. package/dist/components/ui/typewriter.js.map +1 -1
  265. package/dist/components/ui/typewriter_module.css.map +1 -1
  266. package/dist/components/ui/visually-hidden.js +2 -2
  267. package/dist/components/ui/visually-hidden.js.map +1 -1
  268. package/dist/components/ui/visually-hidden_module.css.map +1 -1
  269. package/dist/hooks/useAnnounce.js +5 -5
  270. package/dist/hooks/useAnnounce.js.map +1 -1
  271. package/dist/hooks/useClipboard.js +6 -6
  272. package/dist/hooks/useClipboard.js.map +1 -1
  273. package/dist/hooks/useControllableState.js +3 -3
  274. package/dist/hooks/useControllableState.js.map +1 -1
  275. package/dist/hooks/useDebounce.js +3 -3
  276. package/dist/hooks/useDebounce.js.map +1 -1
  277. package/dist/hooks/useEventCallback.js +4 -4
  278. package/dist/hooks/useEventCallback.js.map +1 -1
  279. package/dist/hooks/useFocusManager.js +6 -6
  280. package/dist/hooks/useFocusManager.js.map +1 -1
  281. package/dist/hooks/useFocusVisible.js +5 -5
  282. package/dist/hooks/useFocusVisible.js.map +1 -1
  283. package/dist/hooks/useId.js +4 -4
  284. package/dist/hooks/useId.js.map +1 -1
  285. package/dist/hooks/useIntersectionObserver.js +3 -3
  286. package/dist/hooks/useIntersectionObserver.js.map +1 -1
  287. package/dist/hooks/useInterval.js +4 -4
  288. package/dist/hooks/useInterval.js.map +1 -1
  289. package/dist/hooks/useLocalStorage.js +4 -4
  290. package/dist/hooks/useLocalStorage.js.map +1 -1
  291. package/dist/hooks/useMediaQuery.js +3 -3
  292. package/dist/hooks/useMediaQuery.js.map +1 -1
  293. package/dist/hooks/useMergedRefs.js +2 -2
  294. package/dist/hooks/useMergedRefs.js.map +1 -1
  295. package/dist/hooks/useOnClickOutside.js +2 -2
  296. package/dist/hooks/useOnClickOutside.js.map +1 -1
  297. package/dist/hooks/usePrevious.js +3 -3
  298. package/dist/hooks/usePrevious.js.map +1 -1
  299. package/dist/hooks/useThrottle.js +7 -7
  300. package/dist/hooks/useThrottle.js.map +1 -1
  301. package/dist/hooks/useTimeout.js +4 -4
  302. package/dist/hooks/useTimeout.js.map +1 -1
  303. package/dist/index.css.map +1 -1
  304. package/dist/index.d.ts +3 -3
  305. package/dist/index.d.ts.map +1 -1
  306. package/dist/index.js +1 -1
  307. package/dist/motion/Collapse.js +2 -2
  308. package/dist/motion/Collapse.js.map +1 -1
  309. package/dist/motion/Collapse_module.css.map +1 -1
  310. package/package.json +7 -8
  311. package/src/components/ui/calendar.tsx +2 -1
  312. package/src/components/ui/chart.tsx +2 -2
  313. package/src/components/ui/form.tsx +28 -3
  314. package/src/components/ui/input-otp.tsx +3 -3
  315. package/src/components/ui/resizable.tsx +15 -18
  316. package/src/components/ui/{sonner.module.css → toast.module.css} +1 -1
  317. package/src/components/ui/{sonner.tsx → toast.tsx} +2 -2
  318. package/src/index.ts +4 -4
  319. package/dist/components/ui/sonner.d.ts.map +0 -1
  320. package/dist/components/ui/sonner.js.map +0 -1
  321. package/dist/components/ui/sonner.module.js +0 -34
  322. package/dist/components/ui/sonner.module.js.map +0 -1
  323. package/dist/components/ui/sonner_module.css.map +0 -1
  324. package/dist/rslib-runtime.js +0 -39
  325. package/dist/rslib-runtime.js.map +0 -1
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { motion, stagger, useAnimate, useInView } from "motion/react";
4
- import { forwardRef, useEffect } from "react";
5
4
  import { cn } from "../../lib/utilities.js";
6
5
  import typewriter_module from "./typewriter.module.js";
7
- const TypewriterText = /*#__PURE__*/ forwardRef(({ words, className, cursorClassName }, ref)=>{
6
+ import * as __rspack_external_react from "react";
7
+ const TypewriterText = /*#__PURE__*/ __rspack_external_react.forwardRef(({ words, className, cursorClassName }, ref)=>{
8
8
  const wordsArray = words.map((word)=>({
9
9
  ...word,
10
10
  text: [
@@ -13,7 +13,7 @@ const TypewriterText = /*#__PURE__*/ forwardRef(({ words, className, cursorClass
13
13
  }));
14
14
  const [scope, animate] = useAnimate();
15
15
  const isInView = useInView(scope);
16
- useEffect(()=>{
16
+ __rspack_external_react.useEffect(()=>{
17
17
  if (!isInView) return;
18
18
  animate("span", {
19
19
  display: "inline-block",
@@ -65,7 +65,7 @@ const TypewriterText = /*#__PURE__*/ forwardRef(({ words, className, cursorClass
65
65
  });
66
66
  });
67
67
  TypewriterText.displayName = "TypewriterText";
68
- const TypewriterTextSmooth = /*#__PURE__*/ forwardRef(({ words, className, cursorClassName }, ref)=>{
68
+ const TypewriterTextSmooth = /*#__PURE__*/ __rspack_external_react.forwardRef(({ words, className, cursorClassName }, ref)=>{
69
69
  const wordsArray = words.map((word)=>({
70
70
  ...word,
71
71
  text: [
@@ -1 +1 @@
1
- {"version":3,"file":"components/ui/typewriter.js","sources":["../../../src/components/ui/typewriter.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {motion, stagger, useAnimate, useInView} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./typewriter.module.css\";\r\n\r\n/** Single word definition consumed by the typewriter components. */\r\nexport interface TypewriterWord {\r\n /** Word content split into animated characters at render time. @default undefined */\r\n text: string;\r\n /** Additional CSS classes merged with each rendered character. @default undefined */\r\n className?: string;\r\n}\r\n\r\n/** Props accepted by {@link TypewriterText} and {@link TypewriterTextSmooth}. */\r\nexport interface TypewriterTextProps {\r\n /** Ordered list of words rendered by the typewriter animation. @default undefined */\r\n words: ReadonlyArray<TypewriterWord>;\r\n /** Additional CSS classes merged with the outer container. @default undefined */\r\n className?: string;\r\n /** Additional CSS classes merged with the blinking cursor element. @default undefined */\r\n cursorClassName?: string;\r\n}\r\n\r\n/**\r\n * Reveals text one character at a time with a stepped typewriter animation.\r\n *\r\n * @remarks\r\n * - Animated component using the `motion` library\r\n * - Renders a `<div>` element\r\n * - Styling via CSS Modules with `--ac-*` custom properties\r\n * - Client-side only (`\"use client\"` directive)\r\n *\r\n * @example\r\n * ```tsx\r\n * <TypewriterText words={[{text: \"Hello\"}, {text: \"world\"}]} />\r\n * ```\r\n *\r\n * @see {@link TypewriterTextProps} for available props\r\n */\r\nconst TypewriterText = React.forwardRef<HTMLDivElement, TypewriterTextProps>(\r\n ({words, className, cursorClassName}: Readonly<TypewriterTextProps>, ref): React.JSX.Element => {\r\n const wordsArray = words.map((word) => ({\r\n ...word,\r\n text: [...word.text],\r\n }));\r\n\r\n const [scope, animate] = useAnimate();\r\n const isInView = useInView(scope);\r\n\r\n React.useEffect(() => {\r\n if (!isInView) {\r\n return;\r\n }\r\n\r\n animate(\r\n \"span\",\r\n {\r\n display: \"inline-block\",\r\n opacity: 1,\r\n width: \"fit-content\",\r\n },\r\n {\r\n duration: 0.3,\r\n delay: stagger(0.1),\r\n ease: \"easeInOut\",\r\n },\r\n );\r\n }, [animate, isInView]);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.root, className)}>\r\n <motion.div\r\n ref={scope}\r\n className={styles.inline}>\r\n {wordsArray.map((word, wordIndex) => (\r\n <div\r\n key={`word-${wordIndex}`}\r\n className={styles.word}>\r\n {word.text.map((character, characterIndex) => (\r\n <motion.span\r\n initial={{}}\r\n key={`char-${characterIndex}`}\r\n className={cn(styles.hiddenCharacter, word.className)}>\r\n {character}\r\n </motion.span>\r\n ))}\r\n &nbsp;\r\n </div>\r\n ))}\r\n </motion.div>\r\n <motion.span\r\n initial={{opacity: 0}}\r\n animate={{opacity: 1}}\r\n transition={{duration: 0.8, repeat: Infinity, repeatType: \"reverse\"}}\r\n className={cn(styles.cursor, cursorClassName)}\r\n />\r\n </div>\r\n );\r\n },\r\n);\r\nTypewriterText.displayName = \"TypewriterText\";\r\n\r\n/**\r\n * Reveals text with a continuous width-based typewriter sweep animation.\r\n *\r\n * @remarks\r\n * - Animated component using the `motion` library\r\n * - Renders a `<div>` element\r\n * - Styling via CSS Modules with `--ac-*` custom properties\r\n * - Client-side only (`\"use client\"` directive)\r\n *\r\n * @example\r\n * ```tsx\r\n * <TypewriterTextSmooth words={[{text: \"Smooth\"}, {text: \"typing\"}]} />\r\n * ```\r\n *\r\n * @see {@link TypewriterTextProps} for available props\r\n */\r\nconst TypewriterTextSmooth = React.forwardRef<HTMLDivElement, TypewriterTextProps>(\r\n ({words, className, cursorClassName}: Readonly<TypewriterTextProps>, ref): React.JSX.Element => {\r\n const wordsArray = words.map((word) => ({\r\n ...word,\r\n text: [...word.text],\r\n }));\r\n\r\n const renderWords = (): React.JSX.Element => {\r\n return (\r\n <div>\r\n {wordsArray.map((word, wordIndex) => (\r\n <div\r\n key={`word-${wordIndex}`}\r\n className={styles.word}>\r\n {word.text.map((character, characterIndex) => (\r\n <span\r\n key={`char-${characterIndex}`}\r\n className={cn(styles.visibleCharacter, word.className)}>\r\n {character}\r\n </span>\r\n ))}\r\n &nbsp;\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.smoothRoot, className)}>\r\n <motion.div\r\n className={styles.smoothViewport}\r\n initial={{width: \"0%\"}}\r\n whileInView={{width: \"fit-content\"}}\r\n transition={{duration: 2, ease: \"linear\", delay: 1}}>\r\n <div className={styles.smoothText}>{renderWords()}</div>\r\n </motion.div>\r\n <motion.span\r\n initial={{opacity: 0}}\r\n animate={{opacity: 1}}\r\n transition={{duration: 0.8, repeat: Infinity, repeatType: \"reverse\"}}\r\n className={cn(styles.smoothCursor, cursorClassName)}\r\n />\r\n </div>\r\n );\r\n },\r\n);\r\nTypewriterTextSmooth.displayName = \"TypewriterTextSmooth\";\r\n\r\nexport {TypewriterText, TypewriterTextSmooth};\r\n"],"names":["TypewriterText","React","words","className","cursorClassName","ref","wordsArray","word","scope","animate","useAnimate","isInView","useInView","stagger","cn","styles","motion","wordIndex","character","characterIndex","Infinity","TypewriterTextSmooth","renderWords"],"mappings":";;;;;;AA0CA,MAAMA,iBAAiB,WAAHA,GAAGC,WACrB,CAAC,EAACC,KAAK,EAAEC,SAAS,EAAEC,eAAe,EAAgC,EAAEC;IACnE,MAAMC,aAAaJ,MAAM,GAAG,CAAC,CAACK,OAAU;YACtC,GAAGA,IAAI;YACP,MAAM;mBAAIA,KAAK,IAAI;aAAC;QACtB;IAEA,MAAM,CAACC,OAAOC,QAAQ,GAAGC;IACzB,MAAMC,WAAWC,UAAUJ;IAE3BP,UAAgB;QACd,IAAI,CAACU,UACH;QAGFF,QACE,QACA;YACE,SAAS;YACT,SAAS;YACT,OAAO;QACT,GACA;YACE,UAAU;YACV,OAAOI,QAAQ;YACf,MAAM;QACR;IAEJ,GAAG;QAACJ;QAASE;KAAS;IAEtB,OAAO,WAAP,GACE,KAAC;QACC,KAAKN;QACL,WAAWS,GAAGC,kBAAAA,IAAW,EAAEZ;;0BAC3B,IAACa,OAAO,GAAG;gBACT,KAAKR;gBACL,WAAWO,kBAAAA,MAAa;0BACvBT,WAAW,GAAG,CAAC,CAACC,MAAMU,YAAAA,WAAAA,GACrB,KAAC;wBAEC,WAAWF,kBAAAA,IAAW;;4BACrBR,KAAK,IAAI,CAAC,GAAG,CAAC,CAACW,WAAWC,iBAAAA,WAAAA,GACzB,IAACH,OAAO,IAAI;oCACV,SAAS,CAAC;oCAEV,WAAWF,GAAGC,kBAAAA,eAAsB,EAAER,KAAK,SAAS;8CACnDW;mCAFI,CAAC,KAAK,EAAEC,gBAAgB;4BAI9B;;uBATE,CAAC,KAAK,EAAEF,WAAW;;0BAc9B,IAACD,OAAO,IAAI;gBACV,SAAS;oBAAC,SAAS;gBAAC;gBACpB,SAAS;oBAAC,SAAS;gBAAC;gBACpB,YAAY;oBAAC,UAAU;oBAAK,QAAQI;oBAAU,YAAY;gBAAS;gBACnE,WAAWN,GAAGC,kBAAAA,MAAa,EAAEX;;;;AAIrC;AAEFJ,eAAe,WAAW,GAAG;AAkB7B,MAAMqB,uBAAuB,WAAHA,GAAGpB,WAC3B,CAAC,EAACC,KAAK,EAAEC,SAAS,EAAEC,eAAe,EAAgC,EAAEC;IACnE,MAAMC,aAAaJ,MAAM,GAAG,CAAC,CAACK,OAAU;YACtC,GAAGA,IAAI;YACP,MAAM;mBAAIA,KAAK,IAAI;aAAC;QACtB;IAEA,MAAMe,cAAc,IACX,WAAP,GACE,IAAC;sBACEhB,WAAW,GAAG,CAAC,CAACC,MAAMU,YAAAA,WAAAA,GACrB,KAAC;oBAEC,WAAWF,kBAAAA,IAAW;;wBACrBR,KAAK,IAAI,CAAC,GAAG,CAAC,CAACW,WAAWC,iBAAAA,WAAAA,GACzB,IAAC;gCAEC,WAAWL,GAAGC,kBAAAA,gBAAuB,EAAER,KAAK,SAAS;0CACpDW;+BAFI,CAAC,KAAK,EAAEC,gBAAgB;wBAI9B;;mBARE,CAAC,KAAK,EAAEF,WAAW;;IAgBlC,OAAO,WAAP,GACE,KAAC;QACC,KAAKZ;QACL,WAAWS,GAAGC,kBAAAA,UAAiB,EAAEZ;;0BACjC,IAACa,OAAO,GAAG;gBACT,WAAWD,kBAAAA,cAAqB;gBAChC,SAAS;oBAAC,OAAO;gBAAI;gBACrB,aAAa;oBAAC,OAAO;gBAAa;gBAClC,YAAY;oBAAC,UAAU;oBAAG,MAAM;oBAAU,OAAO;gBAAC;0BAClD,kBAAC;oBAAI,WAAWA,kBAAAA,UAAiB;8BAAGO;;;0BAEtC,IAACN,OAAO,IAAI;gBACV,SAAS;oBAAC,SAAS;gBAAC;gBACpB,SAAS;oBAAC,SAAS;gBAAC;gBACpB,YAAY;oBAAC,UAAU;oBAAK,QAAQI;oBAAU,YAAY;gBAAS;gBACnE,WAAWN,GAAGC,kBAAAA,YAAmB,EAAEX;;;;AAI3C;AAEFiB,qBAAqB,WAAW,GAAG"}
1
+ {"version":3,"file":"components/ui/typewriter.js","sources":["../../../src/components/ui/typewriter.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport {motion, stagger, useAnimate, useInView} from \"motion/react\";\r\nimport * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./typewriter.module.css\";\r\n\r\n/** Single word definition consumed by the typewriter components. */\r\nexport interface TypewriterWord {\r\n /** Word content split into animated characters at render time. @default undefined */\r\n text: string;\r\n /** Additional CSS classes merged with each rendered character. @default undefined */\r\n className?: string;\r\n}\r\n\r\n/** Props accepted by {@link TypewriterText} and {@link TypewriterTextSmooth}. */\r\nexport interface TypewriterTextProps {\r\n /** Ordered list of words rendered by the typewriter animation. @default undefined */\r\n words: ReadonlyArray<TypewriterWord>;\r\n /** Additional CSS classes merged with the outer container. @default undefined */\r\n className?: string;\r\n /** Additional CSS classes merged with the blinking cursor element. @default undefined */\r\n cursorClassName?: string;\r\n}\r\n\r\n/**\r\n * Reveals text one character at a time with a stepped typewriter animation.\r\n *\r\n * @remarks\r\n * - Animated component using the `motion` library\r\n * - Renders a `<div>` element\r\n * - Styling via CSS Modules with `--ac-*` custom properties\r\n * - Client-side only (`\"use client\"` directive)\r\n *\r\n * @example\r\n * ```tsx\r\n * <TypewriterText words={[{text: \"Hello\"}, {text: \"world\"}]} />\r\n * ```\r\n *\r\n * @see {@link TypewriterTextProps} for available props\r\n */\r\nconst TypewriterText = React.forwardRef<HTMLDivElement, TypewriterTextProps>(\r\n ({words, className, cursorClassName}: Readonly<TypewriterTextProps>, ref): React.JSX.Element => {\r\n const wordsArray = words.map((word) => ({\r\n ...word,\r\n text: [...word.text],\r\n }));\r\n\r\n const [scope, animate] = useAnimate();\r\n const isInView = useInView(scope);\r\n\r\n React.useEffect(() => {\r\n if (!isInView) {\r\n return;\r\n }\r\n\r\n animate(\r\n \"span\",\r\n {\r\n display: \"inline-block\",\r\n opacity: 1,\r\n width: \"fit-content\",\r\n },\r\n {\r\n duration: 0.3,\r\n delay: stagger(0.1),\r\n ease: \"easeInOut\",\r\n },\r\n );\r\n }, [animate, isInView]);\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.root, className)}>\r\n <motion.div\r\n ref={scope}\r\n className={styles.inline}>\r\n {wordsArray.map((word, wordIndex) => (\r\n <div\r\n key={`word-${wordIndex}`}\r\n className={styles.word}>\r\n {word.text.map((character, characterIndex) => (\r\n <motion.span\r\n initial={{}}\r\n key={`char-${characterIndex}`}\r\n className={cn(styles.hiddenCharacter, word.className)}>\r\n {character}\r\n </motion.span>\r\n ))}\r\n &nbsp;\r\n </div>\r\n ))}\r\n </motion.div>\r\n <motion.span\r\n initial={{opacity: 0}}\r\n animate={{opacity: 1}}\r\n transition={{duration: 0.8, repeat: Infinity, repeatType: \"reverse\"}}\r\n className={cn(styles.cursor, cursorClassName)}\r\n />\r\n </div>\r\n );\r\n },\r\n);\r\nTypewriterText.displayName = \"TypewriterText\";\r\n\r\n/**\r\n * Reveals text with a continuous width-based typewriter sweep animation.\r\n *\r\n * @remarks\r\n * - Animated component using the `motion` library\r\n * - Renders a `<div>` element\r\n * - Styling via CSS Modules with `--ac-*` custom properties\r\n * - Client-side only (`\"use client\"` directive)\r\n *\r\n * @example\r\n * ```tsx\r\n * <TypewriterTextSmooth words={[{text: \"Smooth\"}, {text: \"typing\"}]} />\r\n * ```\r\n *\r\n * @see {@link TypewriterTextProps} for available props\r\n */\r\nconst TypewriterTextSmooth = React.forwardRef<HTMLDivElement, TypewriterTextProps>(\r\n ({words, className, cursorClassName}: Readonly<TypewriterTextProps>, ref): React.JSX.Element => {\r\n const wordsArray = words.map((word) => ({\r\n ...word,\r\n text: [...word.text],\r\n }));\r\n\r\n const renderWords = (): React.JSX.Element => {\r\n return (\r\n <div>\r\n {wordsArray.map((word, wordIndex) => (\r\n <div\r\n key={`word-${wordIndex}`}\r\n className={styles.word}>\r\n {word.text.map((character, characterIndex) => (\r\n <span\r\n key={`char-${characterIndex}`}\r\n className={cn(styles.visibleCharacter, word.className)}>\r\n {character}\r\n </span>\r\n ))}\r\n &nbsp;\r\n </div>\r\n ))}\r\n </div>\r\n );\r\n };\r\n\r\n return (\r\n <div\r\n ref={ref}\r\n className={cn(styles.smoothRoot, className)}>\r\n <motion.div\r\n className={styles.smoothViewport}\r\n initial={{width: \"0%\"}}\r\n whileInView={{width: \"fit-content\"}}\r\n transition={{duration: 2, ease: \"linear\", delay: 1}}>\r\n <div className={styles.smoothText}>{renderWords()}</div>\r\n </motion.div>\r\n <motion.span\r\n initial={{opacity: 0}}\r\n animate={{opacity: 1}}\r\n transition={{duration: 0.8, repeat: Infinity, repeatType: \"reverse\"}}\r\n className={cn(styles.smoothCursor, cursorClassName)}\r\n />\r\n </div>\r\n );\r\n },\r\n);\r\nTypewriterTextSmooth.displayName = \"TypewriterTextSmooth\";\r\n\r\nexport {TypewriterText, TypewriterTextSmooth};\r\n"],"names":["TypewriterText","React","words","className","cursorClassName","ref","wordsArray","word","scope","animate","useAnimate","isInView","useInView","stagger","cn","styles","motion","wordIndex","character","characterIndex","Infinity","TypewriterTextSmooth","renderWords"],"mappings":";;;;;;AA0CA,MAAMA,iBAAiB,WAAHA,GAAGC,wBAAAA,UAAgB,CACrC,CAAC,EAACC,KAAK,EAAEC,SAAS,EAAEC,eAAe,EAAgC,EAAEC;IACnE,MAAMC,aAAaJ,MAAM,GAAG,CAAC,CAACK,OAAU;YACtC,GAAGA,IAAI;YACP,MAAM;mBAAIA,KAAK,IAAI;aAAC;QACtB;IAEA,MAAM,CAACC,OAAOC,QAAQ,GAAGC;IACzB,MAAMC,WAAWC,UAAUJ;IAE3BP,wBAAAA,SAAe,CAAC;QACd,IAAI,CAACU,UACH;QAGFF,QACE,QACA;YACE,SAAS;YACT,SAAS;YACT,OAAO;QACT,GACA;YACE,UAAU;YACV,OAAOI,QAAQ;YACf,MAAM;QACR;IAEJ,GAAG;QAACJ;QAASE;KAAS;IAEtB,OAAO,WAAP,GACE,KAAC;QACC,KAAKN;QACL,WAAWS,GAAGC,kBAAAA,IAAW,EAAEZ;;0BAC3B,IAACa,OAAO,GAAG;gBACT,KAAKR;gBACL,WAAWO,kBAAAA,MAAa;0BACvBT,WAAW,GAAG,CAAC,CAACC,MAAMU,YAAAA,WAAAA,GACrB,KAAC;wBAEC,WAAWF,kBAAAA,IAAW;;4BACrBR,KAAK,IAAI,CAAC,GAAG,CAAC,CAACW,WAAWC,iBAAAA,WAAAA,GACzB,IAACH,OAAO,IAAI;oCACV,SAAS,CAAC;oCAEV,WAAWF,GAAGC,kBAAAA,eAAsB,EAAER,KAAK,SAAS;8CACnDW;mCAFI,CAAC,KAAK,EAAEC,gBAAgB;4BAI9B;;uBATE,CAAC,KAAK,EAAEF,WAAW;;0BAc9B,IAACD,OAAO,IAAI;gBACV,SAAS;oBAAC,SAAS;gBAAC;gBACpB,SAAS;oBAAC,SAAS;gBAAC;gBACpB,YAAY;oBAAC,UAAU;oBAAK,QAAQI;oBAAU,YAAY;gBAAS;gBACnE,WAAWN,GAAGC,kBAAAA,MAAa,EAAEX;;;;AAIrC;AAEFJ,eAAe,WAAW,GAAG;AAkB7B,MAAMqB,uBAAuB,WAAHA,GAAGpB,wBAAAA,UAAgB,CAC3C,CAAC,EAACC,KAAK,EAAEC,SAAS,EAAEC,eAAe,EAAgC,EAAEC;IACnE,MAAMC,aAAaJ,MAAM,GAAG,CAAC,CAACK,OAAU;YACtC,GAAGA,IAAI;YACP,MAAM;mBAAIA,KAAK,IAAI;aAAC;QACtB;IAEA,MAAMe,cAAc,IACX,WAAP,GACE,IAAC;sBACEhB,WAAW,GAAG,CAAC,CAACC,MAAMU,YAAAA,WAAAA,GACrB,KAAC;oBAEC,WAAWF,kBAAAA,IAAW;;wBACrBR,KAAK,IAAI,CAAC,GAAG,CAAC,CAACW,WAAWC,iBAAAA,WAAAA,GACzB,IAAC;gCAEC,WAAWL,GAAGC,kBAAAA,gBAAuB,EAAER,KAAK,SAAS;0CACpDW;+BAFI,CAAC,KAAK,EAAEC,gBAAgB;wBAI9B;;mBARE,CAAC,KAAK,EAAEF,WAAW;;IAgBlC,OAAO,WAAP,GACE,KAAC;QACC,KAAKZ;QACL,WAAWS,GAAGC,kBAAAA,UAAiB,EAAEZ;;0BACjC,IAACa,OAAO,GAAG;gBACT,WAAWD,kBAAAA,cAAqB;gBAChC,SAAS;oBAAC,OAAO;gBAAI;gBACrB,aAAa;oBAAC,OAAO;gBAAa;gBAClC,YAAY;oBAAC,UAAU;oBAAG,MAAM;oBAAU,OAAO;gBAAC;0BAClD,kBAAC;oBAAI,WAAWA,kBAAAA,UAAiB;8BAAGO;;;0BAEtC,IAACN,OAAO,IAAI;gBACV,SAAS;oBAAC,SAAS;gBAAC;gBACpB,SAAS;oBAAC,SAAS;gBAAC;gBACpB,YAAY;oBAAC,UAAU;oBAAK,QAAQI;oBAAU,YAAY;gBAAS;gBACnE,WAAWN,GAAGC,kBAAAA,YAAmB,EAAEX;;;;AAI3C;AAEFiB,qBAAqB,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./home/runner/work/arolariu.ro/arolariu.ro/packages/components/src/components/ui/typewriter.module.css","webpack://./src/components/ui/typewriter.module.css"],"names":[],"mappings":"AADA;ECEE,kBAAkB;EAClB,eAAe;EACf,gBAAgB;AAClB;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,UAAU;EACV,aAAa;AACf;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE,kCAAkC;EAClC,mBAAmB;EACnB,UAAU;EACV,qBAAqB;AACvB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,WAAW;EACX,gBAAgB;EAChB,aAAa;AACf;;AAEA;EACE,qBAAqB;EACrB,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;EACnB,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,cAAc;AAChB;;AAEA;EACE;IACE,kBAAkB;EACpB;;EAEA;IACE,cAAc;EAChB;;EAEA;IACE,eAAe;EACjB;;EAEA;IACE,cAAc;EAChB;AACF;;AAEA;EACE;IACE,mBAAmB;EACrB;AACF;;AAEA;EACE;IACE,eAAe;EACjB;;EAEA;IACE,cAAc;EAChB;AACF;;AAEA;EACE;IACE,eAAe;EACjB;;EAEA;IACE,YAAY;EACd;AACF","sourcesContent":[".root{font-size:1rem;font-weight:700;text-align:center}.inline{display:inline}.word{display:inline-block}.hiddenCharacter{display:none;opacity:0}.hiddenCharacter,.visibleCharacter{color:var(--ac-foreground)}.cursor,.smoothCursor{background:#3b82f6;border-radius:var(--ac-radius-xs);display:inline-block;width:4px}.cursor{height:1rem}.smoothRoot{display:flex;gap:.25rem;margin:1.5rem 0}.smoothViewport{overflow:hidden;padding-bottom:.5rem}.smoothText{font-size:.75rem;font-weight:700;white-space:nowrap}.smoothCursor{display:block;height:1rem}@media (min-width:640px){.root{font-size:1.25rem}.cursor{height:1.5rem}.smoothText{font-size:1rem}.smoothCursor{height:1.5rem}}@media (min-width:768px){.root{font-size:1.875rem}}@media (min-width:1024px){.root{font-size:3rem}.cursor{height:2.5rem}}@media (min-width:1280px){.smoothText{font-size:3rem}.smoothCursor{height:3rem}}",".root {\n text-align: center;\n font-size: 1rem;\n font-weight: 700;\n}\n\n.inline {\n display: inline;\n}\n\n.word {\n display: inline-block;\n}\n\n.hiddenCharacter {\n opacity: 0;\n display: none;\n}\n\n.hiddenCharacter, .visibleCharacter {\n color: var(--ac-foreground);\n}\n\n.cursor, .smoothCursor {\n border-radius: var(--ac-radius-xs);\n background: #3b82f6;\n width: 4px;\n display: inline-block;\n}\n\n.cursor {\n height: 1rem;\n}\n\n.smoothRoot {\n gap: .25rem;\n margin: 1.5rem 0;\n display: flex;\n}\n\n.smoothViewport {\n padding-bottom: .5rem;\n overflow: hidden;\n}\n\n.smoothText {\n white-space: nowrap;\n font-size: .75rem;\n font-weight: 700;\n}\n\n.smoothCursor {\n height: 1rem;\n display: block;\n}\n\n@media (width >= 640px) {\n .root {\n font-size: 1.25rem;\n }\n\n .cursor {\n height: 1.5rem;\n }\n\n .smoothText {\n font-size: 1rem;\n }\n\n .smoothCursor {\n height: 1.5rem;\n }\n}\n\n@media (width >= 768px) {\n .root {\n font-size: 1.875rem;\n }\n}\n\n@media (width >= 1024px) {\n .root {\n font-size: 3rem;\n }\n\n .cursor {\n height: 2.5rem;\n }\n}\n\n@media (width >= 1280px) {\n .smoothText {\n font-size: 3rem;\n }\n\n .smoothCursor {\n height: 3rem;\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./../../node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[2].use[2]!/home/runner/work/arolariu.ro/arolariu.ro/node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[3]!/home/runner/work/arolariu.ro/arolariu.ro/packages/components/src/components/ui/typewriter.module.css","webpack://./src/components/ui/typewriter.module.css"],"names":[],"mappings":"AAAA;ECCE,kBAAkB;EAClB,eAAe;EACf,gBAAgB;AAClB;;ADJuD;ECOrD,eAAe;AACjB;;ADR8E;ECW5E,qBAAqB;AACvB;;ADZyG;ECevG,UAAU;EACV,aAAa;AACf;;ADjBiJ;ECoB/I,2BAA2B;AAC7B;;ADrB+M;ECwB7M,kCAAkC;EAClC,mBAAmB;EACnB,UAAU;EACV,qBAAqB;AACvB;;AD5ByT;EC+BvT,YAAY;AACd;;ADhC6U;ECmC3U,WAAW;EACX,gBAAgB;EAChB,aAAa;AACf;;ADtCiY;ECyC/X,qBAAqB;EACrB,gBAAgB;AAClB;;AD3Csb;EC8Cpb,mBAAmB;EACnB,iBAAiB;EACjB,gBAAgB;AAClB;;ADjDsf;ECoDpf,YAAY;EACZ,cAAc;AAChB;;ADtD8hB;EAAyB;IC0DnjB,kBAAkB;EACpB;;ED3D6kB;IC8D3kB,cAAc;EAChB;;ED/DmmB;ICkEjmB,eAAe;EACjB;;EDnE8nB;ICsE5nB,cAAc;EAChB;AACF;;ADxE6pB;EAAyB;IC4ElrB,mBAAmB;EACrB;AACF;;AD9EgtB;EAA0B;ICkFtuB,eAAe;EACjB;;EDnF6vB;ICsF3vB,cAAc;EAChB;AACF;;ADxFsxB;EAA0B;IC4F5yB,eAAe;EACjB;;ED7Fy0B;ICgGv0B,YAAY;EACd;AACF","sourcesContent":[".root{font-size:1rem;font-weight:700;text-align:center}.inline{display:inline}.word{display:inline-block}.hiddenCharacter{display:none;opacity:0}.hiddenCharacter,.visibleCharacter{color:var(--ac-foreground)}.cursor,.smoothCursor{background:#3b82f6;border-radius:var(--ac-radius-xs);display:inline-block;width:4px}.cursor{height:1rem}.smoothRoot{display:flex;gap:.25rem;margin:1.5rem 0}.smoothViewport{overflow:hidden;padding-bottom:.5rem}.smoothText{font-size:.75rem;font-weight:700;white-space:nowrap}.smoothCursor{display:block;height:1rem}@media (min-width:640px){.root{font-size:1.25rem}.cursor{height:1.5rem}.smoothText{font-size:1rem}.smoothCursor{height:1.5rem}}@media (min-width:768px){.root{font-size:1.875rem}}@media (min-width:1024px){.root{font-size:3rem}.cursor{height:2.5rem}}@media (min-width:1280px){.smoothText{font-size:3rem}.smoothCursor{height:3rem}}",".root {\n text-align: center;\n font-size: 1rem;\n font-weight: 700;\n}\n\n.inline {\n display: inline;\n}\n\n.word {\n display: inline-block;\n}\n\n.hiddenCharacter {\n opacity: 0;\n display: none;\n}\n\n.hiddenCharacter, .visibleCharacter {\n color: var(--ac-foreground);\n}\n\n.cursor, .smoothCursor {\n border-radius: var(--ac-radius-xs);\n background: #3b82f6;\n width: 4px;\n display: inline-block;\n}\n\n.cursor {\n height: 1rem;\n}\n\n.smoothRoot {\n gap: .25rem;\n margin: 1.5rem 0;\n display: flex;\n}\n\n.smoothViewport {\n padding-bottom: .5rem;\n overflow: hidden;\n}\n\n.smoothText {\n white-space: nowrap;\n font-size: .75rem;\n font-weight: 700;\n}\n\n.smoothCursor {\n height: 1rem;\n display: block;\n}\n\n@media (width >= 640px) {\n .root {\n font-size: 1.25rem;\n }\n\n .cursor {\n height: 1.5rem;\n }\n\n .smoothText {\n font-size: 1rem;\n }\n\n .smoothCursor {\n height: 1.5rem;\n }\n}\n\n@media (width >= 768px) {\n .root {\n font-size: 1.875rem;\n }\n}\n\n@media (width >= 1024px) {\n .root {\n font-size: 3rem;\n }\n\n .cursor {\n height: 2.5rem;\n }\n}\n\n@media (width >= 1280px) {\n .smoothText {\n font-size: 3rem;\n }\n\n .smoothCursor {\n height: 3rem;\n }\n}\n"],"sourceRoot":""}
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { cn } from "../../lib/utilities.js";
4
3
  import visually_hidden_module from "./visually-hidden.module.js";
5
- const VisuallyHidden = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("span", {
4
+ import * as __rspack_external_react from "react";
5
+ const VisuallyHidden = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("span", {
6
6
  ref: ref,
7
7
  className: cn(visually_hidden_module.visuallyHidden, className),
8
8
  ...props
@@ -1 +1 @@
1
- {"version":3,"file":"components/ui/visually-hidden.js","sources":["../../../src/components/ui/visually-hidden.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./visually-hidden.module.css\";\r\n\r\n/**\r\n * Represents the configurable props for the {@link VisuallyHidden} component.\r\n *\r\n * @remarks\r\n * Extends native `<span>` attributes so hidden assistive text can carry ARIA metadata,\r\n * testing hooks, and composed class overrides while remaining available to screen readers.\r\n */\r\ninterface VisuallyHiddenProps extends React.HTMLAttributes<HTMLSpanElement> {\r\n /**\r\n * Content that is hidden visually but remains accessible to assistive technology.\r\n */\r\n children: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Hides content visually while keeping it accessible to screen readers.\r\n *\r\n * @remarks\r\n * **Rendering Context**: Server- and client-compatible presentational component.\r\n *\r\n * Renders a `<span>` that uses the classic clipping technique to remove content from the\r\n * visual flow without removing it from the accessibility tree. Use it to provide labels\r\n * for icon-only controls, clarify status changes, or add extra context for assistive tech.\r\n *\r\n * @example\r\n * ```tsx\r\n * <button type=\"button\">\r\n * <TrashIcon aria-hidden=\"true\" />\r\n * <VisuallyHidden>Delete item</VisuallyHidden>\r\n * </button>\r\n * ```\r\n *\r\n * @see {@link https://www.w3.org/WAI/tutorials/forms/labels/#note-on-hiding-elements | W3C hiding elements guidance}\r\n */\r\nconst VisuallyHidden = React.forwardRef<HTMLSpanElement, VisuallyHiddenProps>(({className, ...props}, ref) => (\r\n <span\r\n ref={ref}\r\n className={cn(styles.visuallyHidden, className)}\r\n {...props}\r\n />\r\n));\r\nVisuallyHidden.displayName = \"VisuallyHidden\";\r\n\r\nexport {VisuallyHidden};\r\nexport type {VisuallyHiddenProps};\r\n"],"names":["VisuallyHidden","React","className","props","ref","cn","styles"],"mappings":";;;;AAuCA,MAAMA,iBAAiB,WAAHA,GAAGC,WAAuD,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACpG,IAAC;QACC,KAAKA;QACL,WAAWC,GAAGC,uBAAAA,cAAqB,EAAEJ;QACpC,GAAGC,KAAK;;AAGbH,eAAe,WAAW,GAAG"}
1
+ {"version":3,"file":"components/ui/visually-hidden.js","sources":["../../../src/components/ui/visually-hidden.tsx"],"sourcesContent":["import * as React from \"react\";\r\n\r\nimport {cn} from \"@/lib/utilities\";\r\nimport styles from \"./visually-hidden.module.css\";\r\n\r\n/**\r\n * Represents the configurable props for the {@link VisuallyHidden} component.\r\n *\r\n * @remarks\r\n * Extends native `<span>` attributes so hidden assistive text can carry ARIA metadata,\r\n * testing hooks, and composed class overrides while remaining available to screen readers.\r\n */\r\ninterface VisuallyHiddenProps extends React.HTMLAttributes<HTMLSpanElement> {\r\n /**\r\n * Content that is hidden visually but remains accessible to assistive technology.\r\n */\r\n children: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Hides content visually while keeping it accessible to screen readers.\r\n *\r\n * @remarks\r\n * **Rendering Context**: Server- and client-compatible presentational component.\r\n *\r\n * Renders a `<span>` that uses the classic clipping technique to remove content from the\r\n * visual flow without removing it from the accessibility tree. Use it to provide labels\r\n * for icon-only controls, clarify status changes, or add extra context for assistive tech.\r\n *\r\n * @example\r\n * ```tsx\r\n * <button type=\"button\">\r\n * <TrashIcon aria-hidden=\"true\" />\r\n * <VisuallyHidden>Delete item</VisuallyHidden>\r\n * </button>\r\n * ```\r\n *\r\n * @see {@link https://www.w3.org/WAI/tutorials/forms/labels/#note-on-hiding-elements | W3C hiding elements guidance}\r\n */\r\nconst VisuallyHidden = React.forwardRef<HTMLSpanElement, VisuallyHiddenProps>(({className, ...props}, ref) => (\r\n <span\r\n ref={ref}\r\n className={cn(styles.visuallyHidden, className)}\r\n {...props}\r\n />\r\n));\r\nVisuallyHidden.displayName = \"VisuallyHidden\";\r\n\r\nexport {VisuallyHidden};\r\nexport type {VisuallyHiddenProps};\r\n"],"names":["VisuallyHidden","React","className","props","ref","cn","styles"],"mappings":";;;;AAuCA,MAAMA,iBAAiB,WAAHA,GAAGC,wBAAAA,UAAgB,CAAuC,CAAC,EAACC,SAAS,EAAE,GAAGC,OAAM,EAAEC,MAAAA,WAAAA,GACpG,IAAC;QACC,KAAKA;QACL,WAAWC,GAAGC,uBAAAA,cAAqB,EAAEJ;QACpC,GAAGC,KAAK;;AAGbH,eAAe,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./home/runner/work/arolariu.ro/arolariu.ro/packages/components/src/components/ui/visually-hidden.module.css","webpack://./src/components/ui/visually-hidden.module.css"],"names":[],"mappings":"AADA;ECEE,mBAAmB;EACnB,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,WAAW;EACX,YAAY;EACZ,UAAU;EACV,kBAAkB;EAClB,gBAAgB;AAClB","sourcesContent":[".visuallyHidden{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border:0;white-space:nowrap}",".visuallyHidden {\n clip: rect(0,0,0,0);\n white-space: nowrap;\n border: 0;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n position: absolute;\n overflow: hidden;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./../../node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/css-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[1]!builtin:lightningcss-loader??ruleSet[1].rules[1].oneOf[2].use[2]!/home/runner/work/arolariu.ro/arolariu.ro/node_modules/@rslib/core/node_modules/@rsbuild/core/compiled/postcss-loader/index.js??ruleSet[1].rules[1].oneOf[2].use[3]!/home/runner/work/arolariu.ro/arolariu.ro/packages/components/src/components/ui/visually-hidden.module.css","webpack://./src/components/ui/visually-hidden.module.css"],"names":[],"mappings":"AAAA;ECCE,mBAAmB;EACnB,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,WAAW;EACX,YAAY;EACZ,UAAU;EACV,kBAAkB;EAClB,gBAAgB;AAClB","sourcesContent":[".visuallyHidden{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border:0;white-space:nowrap}",".visuallyHidden {\n clip: rect(0,0,0,0);\n white-space: nowrap;\n border: 0;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n position: absolute;\n overflow: hidden;\n}\n"],"sourceRoot":""}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { useCallback, useEffect, useRef } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useAnnounce() {
4
- const politeRef = useRef(null);
5
- const assertiveRef = useRef(null);
6
- useEffect(()=>{
4
+ const politeRef = __rspack_external_react.useRef(null);
5
+ const assertiveRef = __rspack_external_react.useRef(null);
6
+ __rspack_external_react.useEffect(()=>{
7
7
  const createRegion = (politeness)=>{
8
8
  const element = document.createElement("div");
9
9
  element.setAttribute("role", "status");
@@ -32,7 +32,7 @@ function useAnnounce() {
32
32
  assertiveRef.current = null;
33
33
  };
34
34
  }, []);
35
- return useCallback((message, politeness = "polite")=>{
35
+ return __rspack_external_react.useCallback((message, politeness = "polite")=>{
36
36
  const region = "assertive" === politeness ? assertiveRef.current : politeRef.current;
37
37
  if (!region) return;
38
38
  region.textContent = "";
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useAnnounce.js","sources":["../../src/hooks/useAnnounce.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\ntype Politeness = \"polite\" | \"assertive\";\r\n\r\n/**\r\n * Creates off-screen ARIA live regions and returns an announcement function for screen readers.\r\n *\r\n * @returns A callback that announces a message using the requested politeness level.\r\n *\r\n * @example\r\n * ```tsx\r\n * const announce = useAnnounce();\r\n *\r\n * announce(\"Item deleted successfully\");\r\n * announce(\"Error: invalid input\", \"assertive\");\r\n * ```\r\n */\r\nexport function useAnnounce(): (message: string, politeness?: Politeness) => void {\r\n const politeRef = React.useRef<HTMLDivElement | null>(null);\r\n const assertiveRef = React.useRef<HTMLDivElement | null>(null);\r\n\r\n React.useEffect(() => {\r\n const createRegion = (politeness: Politeness): HTMLDivElement => {\r\n const element = document.createElement(\"div\");\r\n\r\n element.setAttribute(\"role\", \"status\");\r\n element.setAttribute(\"aria-live\", politeness);\r\n element.setAttribute(\"aria-atomic\", \"true\");\r\n\r\n Object.assign(element.style, {\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: \"0\",\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0,0,0,0)\",\r\n whiteSpace: \"nowrap\",\r\n border: \"0\",\r\n });\r\n\r\n document.body.append(element);\r\n\r\n return element;\r\n };\r\n\r\n politeRef.current = createRegion(\"polite\");\r\n assertiveRef.current = createRegion(\"assertive\");\r\n\r\n return () => {\r\n politeRef.current?.remove();\r\n assertiveRef.current?.remove();\r\n politeRef.current = null;\r\n assertiveRef.current = null;\r\n };\r\n }, []);\r\n\r\n return React.useCallback((message: string, politeness: Politeness = \"polite\") => {\r\n const region = politeness === \"assertive\" ? assertiveRef.current : politeRef.current;\r\n\r\n if (!region) {\r\n return;\r\n }\r\n\r\n region.textContent = \"\";\r\n\r\n requestAnimationFrame(() => {\r\n region.textContent = message;\r\n });\r\n }, []);\r\n}\r\n"],"names":["useAnnounce","politeRef","React","assertiveRef","createRegion","politeness","element","document","Object","message","region","requestAnimationFrame"],"mappings":";;AAmBO,SAASA;IACd,MAAMC,YAAYC,OAAoC;IACtD,MAAMC,eAAeD,OAAoC;IAEzDA,UAAgB;QACd,MAAME,eAAe,CAACC;YACpB,MAAMC,UAAUC,SAAS,aAAa,CAAC;YAEvCD,QAAQ,YAAY,CAAC,QAAQ;YAC7BA,QAAQ,YAAY,CAAC,aAAaD;YAClCC,QAAQ,YAAY,CAAC,eAAe;YAEpCE,OAAO,MAAM,CAACF,QAAQ,KAAK,EAAE;gBAC3B,UAAU;gBACV,OAAO;gBACP,QAAQ;gBACR,SAAS;gBACT,QAAQ;gBACR,UAAU;gBACV,MAAM;gBACN,YAAY;gBACZ,QAAQ;YACV;YAEAC,SAAS,IAAI,CAAC,MAAM,CAACD;YAErB,OAAOA;QACT;QAEAL,UAAU,OAAO,GAAGG,aAAa;QACjCD,aAAa,OAAO,GAAGC,aAAa;QAEpC,OAAO;YACLH,UAAU,OAAO,EAAE;YACnBE,aAAa,OAAO,EAAE;YACtBF,UAAU,OAAO,GAAG;YACpBE,aAAa,OAAO,GAAG;QACzB;IACF,GAAG,EAAE;IAEL,OAAOD,YAAkB,CAACO,SAAiBJ,aAAyB,QAAQ;QAC1E,MAAMK,SAASL,AAAe,gBAAfA,aAA6BF,aAAa,OAAO,GAAGF,UAAU,OAAO;QAEpF,IAAI,CAACS,QACH;QAGFA,OAAO,WAAW,GAAG;QAErBC,sBAAsB;YACpBD,OAAO,WAAW,GAAGD;QACvB;IACF,GAAG,EAAE;AACP"}
1
+ {"version":3,"file":"hooks/useAnnounce.js","sources":["../../src/hooks/useAnnounce.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\ntype Politeness = \"polite\" | \"assertive\";\r\n\r\n/**\r\n * Creates off-screen ARIA live regions and returns an announcement function for screen readers.\r\n *\r\n * @returns A callback that announces a message using the requested politeness level.\r\n *\r\n * @example\r\n * ```tsx\r\n * const announce = useAnnounce();\r\n *\r\n * announce(\"Item deleted successfully\");\r\n * announce(\"Error: invalid input\", \"assertive\");\r\n * ```\r\n */\r\nexport function useAnnounce(): (message: string, politeness?: Politeness) => void {\r\n const politeRef = React.useRef<HTMLDivElement | null>(null);\r\n const assertiveRef = React.useRef<HTMLDivElement | null>(null);\r\n\r\n React.useEffect(() => {\r\n const createRegion = (politeness: Politeness): HTMLDivElement => {\r\n const element = document.createElement(\"div\");\r\n\r\n element.setAttribute(\"role\", \"status\");\r\n element.setAttribute(\"aria-live\", politeness);\r\n element.setAttribute(\"aria-atomic\", \"true\");\r\n\r\n Object.assign(element.style, {\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: \"0\",\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0,0,0,0)\",\r\n whiteSpace: \"nowrap\",\r\n border: \"0\",\r\n });\r\n\r\n document.body.append(element);\r\n\r\n return element;\r\n };\r\n\r\n politeRef.current = createRegion(\"polite\");\r\n assertiveRef.current = createRegion(\"assertive\");\r\n\r\n return () => {\r\n politeRef.current?.remove();\r\n assertiveRef.current?.remove();\r\n politeRef.current = null;\r\n assertiveRef.current = null;\r\n };\r\n }, []);\r\n\r\n return React.useCallback((message: string, politeness: Politeness = \"polite\") => {\r\n const region = politeness === \"assertive\" ? assertiveRef.current : politeRef.current;\r\n\r\n if (!region) {\r\n return;\r\n }\r\n\r\n region.textContent = \"\";\r\n\r\n requestAnimationFrame(() => {\r\n region.textContent = message;\r\n });\r\n }, []);\r\n}\r\n"],"names":["useAnnounce","politeRef","React","assertiveRef","createRegion","politeness","element","document","Object","message","region","requestAnimationFrame"],"mappings":";;AAmBO,SAASA;IACd,MAAMC,YAAYC,wBAAAA,MAAY,CAAwB;IACtD,MAAMC,eAAeD,wBAAAA,MAAY,CAAwB;IAEzDA,wBAAAA,SAAe,CAAC;QACd,MAAME,eAAe,CAACC;YACpB,MAAMC,UAAUC,SAAS,aAAa,CAAC;YAEvCD,QAAQ,YAAY,CAAC,QAAQ;YAC7BA,QAAQ,YAAY,CAAC,aAAaD;YAClCC,QAAQ,YAAY,CAAC,eAAe;YAEpCE,OAAO,MAAM,CAACF,QAAQ,KAAK,EAAE;gBAC3B,UAAU;gBACV,OAAO;gBACP,QAAQ;gBACR,SAAS;gBACT,QAAQ;gBACR,UAAU;gBACV,MAAM;gBACN,YAAY;gBACZ,QAAQ;YACV;YAEAC,SAAS,IAAI,CAAC,MAAM,CAACD;YAErB,OAAOA;QACT;QAEAL,UAAU,OAAO,GAAGG,aAAa;QACjCD,aAAa,OAAO,GAAGC,aAAa;QAEpC,OAAO;YACLH,UAAU,OAAO,EAAE;YACnBE,aAAa,OAAO,EAAE;YACtBF,UAAU,OAAO,GAAG;YACpBE,aAAa,OAAO,GAAG;QACzB;IACF,GAAG,EAAE;IAEL,OAAOD,wBAAAA,WAAiB,CAAC,CAACO,SAAiBJ,aAAyB,QAAQ;QAC1E,MAAMK,SAASL,AAAe,gBAAfA,aAA6BF,aAAa,OAAO,GAAGF,UAAU,OAAO;QAEpF,IAAI,CAACS,QACH;QAGFA,OAAO,WAAW,GAAG;QAErBC,sBAAsB;YACpBD,OAAO,WAAW,GAAGD;QACvB;IACF,GAAG,EAAE;AACP"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { useCallback, useEffect, useRef, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useClipboard(options = {}) {
4
4
  const { timeout = 2000 } = options;
5
- const [copied, setCopied] = useState(false);
6
- const [error, setError] = useState(null);
7
- const timeoutRef = useRef(null);
8
- const copy = useCallback(async (text)=>{
5
+ const [copied, setCopied] = __rspack_external_react.useState(false);
6
+ const [error, setError] = __rspack_external_react.useState(null);
7
+ const timeoutRef = __rspack_external_react.useRef(null);
8
+ const copy = __rspack_external_react.useCallback(async (text)=>{
9
9
  if (null !== timeoutRef.current) {
10
10
  clearTimeout(timeoutRef.current);
11
11
  timeoutRef.current = null;
@@ -28,7 +28,7 @@ function useClipboard(options = {}) {
28
28
  }, [
29
29
  timeout
30
30
  ]);
31
- useEffect(()=>()=>{
31
+ __rspack_external_react.useEffect(()=>()=>{
32
32
  if (null !== timeoutRef.current) clearTimeout(timeoutRef.current);
33
33
  }, []);
34
34
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useClipboard.js","sources":["../../src/hooks/useClipboard.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Options for the `useClipboard` hook.\r\n */\r\nexport interface UseClipboardOptions {\r\n /**\r\n * The duration in milliseconds after which the `copied` state resets to `false`.\r\n *\r\n * @defaultValue 2000\r\n */\r\n timeout?: number;\r\n}\r\n\r\n/**\r\n * Return type for the `useClipboard` hook.\r\n */\r\nexport interface UseClipboardReturn {\r\n /**\r\n * Whether the text was successfully copied to the clipboard.\r\n */\r\n copied: boolean;\r\n\r\n /**\r\n * Copies the provided text to the clipboard.\r\n *\r\n * @param text - The text to copy.\r\n * @returns A promise that resolves when the copy operation completes.\r\n */\r\n copy: (text: string) => Promise<void>;\r\n\r\n /**\r\n * The error that occurred during the copy operation, or `null` if no error occurred.\r\n */\r\n error: Error | null;\r\n}\r\n\r\n/**\r\n * Copies text to the clipboard with success/error state management.\r\n *\r\n * @remarks\r\n * This hook provides a simple interface for copying text to the clipboard using\r\n * the Clipboard API. It manages the `copied` state that automatically resets\r\n * after a configurable timeout, and handles errors gracefully when the Clipboard\r\n * API is unavailable or the operation fails.\r\n *\r\n * The hook is SSR-safe and will handle the case where `navigator.clipboard` is\r\n * not available (e.g., in non-secure contexts or older browsers).\r\n *\r\n * @param options - Configuration options for the hook.\r\n * @returns An object containing the copied state, copy function, and any error.\r\n *\r\n * @example\r\n * ```tsx\r\n * function CopyButton({textToCopy}: {textToCopy: string}) {\r\n * const {copied, copy, error} = useClipboard({timeout: 3000});\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={() => copy(textToCopy)}>\r\n * {copied ? \"Copied!\" : \"Copy to clipboard\"}\r\n * </button>\r\n * {error && <span>Failed to copy: {error.message}</span>}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function ShareLink({url}: {url: string}) {\r\n * const {copied, copy} = useClipboard();\r\n *\r\n * return (\r\n * <button onClick={() => copy(url)} disabled={copied}>\r\n * {copied ? \"✓ Copied\" : \"Share link\"}\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useClipboard(options: UseClipboardOptions = {}): UseClipboardReturn {\r\n const {timeout = 2000} = options;\r\n\r\n const [copied, setCopied] = React.useState(false);\r\n const [error, setError] = React.useState<Error | null>(null);\r\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n const copy = React.useCallback(\r\n async (text: string): Promise<void> => {\r\n // Clear any existing timeout\r\n if (timeoutRef.current !== null) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n\r\n // Reset error state\r\n setError(null);\r\n\r\n try {\r\n // Check if Clipboard API is available\r\n if (typeof globalThis.navigator === \"undefined\" || !globalThis.navigator.clipboard) {\r\n throw new Error(\"Clipboard API is not available\");\r\n }\r\n\r\n await globalThis.navigator.clipboard.writeText(text);\r\n setCopied(true);\r\n\r\n // Reset copied state after timeout\r\n timeoutRef.current = setTimeout(() => {\r\n setCopied(false);\r\n timeoutRef.current = null;\r\n }, timeout);\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err : new Error(\"Failed to copy to clipboard\");\r\n\r\n setError(errorMessage);\r\n setCopied(false);\r\n console.error(\"Copy to clipboard failed:\", errorMessage);\r\n }\r\n },\r\n [timeout],\r\n );\r\n\r\n // Cleanup timeout on unmount\r\n React.useEffect(() => {\r\n return () => {\r\n if (timeoutRef.current !== null) {\r\n clearTimeout(timeoutRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n return {copied, copy, error};\r\n}\r\n"],"names":["useClipboard","options","timeout","copied","setCopied","React","error","setError","timeoutRef","copy","text","clearTimeout","globalThis","Error","setTimeout","err","errorMessage","console"],"mappings":";;AAmFO,SAASA,aAAaC,UAA+B,CAAC,CAAC;IAC5D,MAAM,EAACC,UAAU,IAAI,EAAC,GAAGD;IAEzB,MAAM,CAACE,QAAQC,UAAU,GAAGC,SAAe;IAC3C,MAAM,CAACC,OAAOC,SAAS,GAAGF,SAA6B;IACvD,MAAMG,aAAaH,OAAmD;IAEtE,MAAMI,OAAOJ,YACX,OAAOK;QAEL,IAAIF,AAAuB,SAAvBA,WAAW,OAAO,EAAW;YAC/BG,aAAaH,WAAW,OAAO;YAC/BA,WAAW,OAAO,GAAG;QACvB;QAGAD,SAAS;QAET,IAAI;YAEF,IAAI,AAAgC,WAAzBK,WAAW,SAAS,IAAoB,CAACA,WAAW,SAAS,CAAC,SAAS,EAChF,MAAM,IAAIC,MAAM;YAGlB,MAAMD,WAAW,SAAS,CAAC,SAAS,CAAC,SAAS,CAACF;YAC/CN,UAAU;YAGVI,WAAW,OAAO,GAAGM,WAAW;gBAC9BV,UAAU;gBACVI,WAAW,OAAO,GAAG;YACvB,GAAGN;QACL,EAAE,OAAOa,KAAK;YACZ,MAAMC,eAAeD,eAAeF,QAAQE,MAAM,IAAIF,MAAM;YAE5DN,SAASS;YACTZ,UAAU;YACVa,QAAQ,KAAK,CAAC,6BAA6BD;QAC7C;IACF,GACA;QAACd;KAAQ;IAIXG,UAAgB,IACP;YACL,IAAIG,AAAuB,SAAvBA,WAAW,OAAO,EACpBG,aAAaH,WAAW,OAAO;QAEnC,GACC,EAAE;IAEL,OAAO;QAACL;QAAQM;QAAMH;IAAK;AAC7B"}
1
+ {"version":3,"file":"hooks/useClipboard.js","sources":["../../src/hooks/useClipboard.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Options for the `useClipboard` hook.\r\n */\r\nexport interface UseClipboardOptions {\r\n /**\r\n * The duration in milliseconds after which the `copied` state resets to `false`.\r\n *\r\n * @defaultValue 2000\r\n */\r\n timeout?: number;\r\n}\r\n\r\n/**\r\n * Return type for the `useClipboard` hook.\r\n */\r\nexport interface UseClipboardReturn {\r\n /**\r\n * Whether the text was successfully copied to the clipboard.\r\n */\r\n copied: boolean;\r\n\r\n /**\r\n * Copies the provided text to the clipboard.\r\n *\r\n * @param text - The text to copy.\r\n * @returns A promise that resolves when the copy operation completes.\r\n */\r\n copy: (text: string) => Promise<void>;\r\n\r\n /**\r\n * The error that occurred during the copy operation, or `null` if no error occurred.\r\n */\r\n error: Error | null;\r\n}\r\n\r\n/**\r\n * Copies text to the clipboard with success/error state management.\r\n *\r\n * @remarks\r\n * This hook provides a simple interface for copying text to the clipboard using\r\n * the Clipboard API. It manages the `copied` state that automatically resets\r\n * after a configurable timeout, and handles errors gracefully when the Clipboard\r\n * API is unavailable or the operation fails.\r\n *\r\n * The hook is SSR-safe and will handle the case where `navigator.clipboard` is\r\n * not available (e.g., in non-secure contexts or older browsers).\r\n *\r\n * @param options - Configuration options for the hook.\r\n * @returns An object containing the copied state, copy function, and any error.\r\n *\r\n * @example\r\n * ```tsx\r\n * function CopyButton({textToCopy}: {textToCopy: string}) {\r\n * const {copied, copy, error} = useClipboard({timeout: 3000});\r\n *\r\n * return (\r\n * <div>\r\n * <button onClick={() => copy(textToCopy)}>\r\n * {copied ? \"Copied!\" : \"Copy to clipboard\"}\r\n * </button>\r\n * {error && <span>Failed to copy: {error.message}</span>}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function ShareLink({url}: {url: string}) {\r\n * const {copied, copy} = useClipboard();\r\n *\r\n * return (\r\n * <button onClick={() => copy(url)} disabled={copied}>\r\n * {copied ? \"✓ Copied\" : \"Share link\"}\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useClipboard(options: UseClipboardOptions = {}): UseClipboardReturn {\r\n const {timeout = 2000} = options;\r\n\r\n const [copied, setCopied] = React.useState(false);\r\n const [error, setError] = React.useState<Error | null>(null);\r\n const timeoutRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n const copy = React.useCallback(\r\n async (text: string): Promise<void> => {\r\n // Clear any existing timeout\r\n if (timeoutRef.current !== null) {\r\n clearTimeout(timeoutRef.current);\r\n timeoutRef.current = null;\r\n }\r\n\r\n // Reset error state\r\n setError(null);\r\n\r\n try {\r\n // Check if Clipboard API is available\r\n if (typeof globalThis.navigator === \"undefined\" || !globalThis.navigator.clipboard) {\r\n throw new Error(\"Clipboard API is not available\");\r\n }\r\n\r\n await globalThis.navigator.clipboard.writeText(text);\r\n setCopied(true);\r\n\r\n // Reset copied state after timeout\r\n timeoutRef.current = setTimeout(() => {\r\n setCopied(false);\r\n timeoutRef.current = null;\r\n }, timeout);\r\n } catch (err) {\r\n const errorMessage = err instanceof Error ? err : new Error(\"Failed to copy to clipboard\");\r\n\r\n setError(errorMessage);\r\n setCopied(false);\r\n console.error(\"Copy to clipboard failed:\", errorMessage);\r\n }\r\n },\r\n [timeout],\r\n );\r\n\r\n // Cleanup timeout on unmount\r\n React.useEffect(() => {\r\n return () => {\r\n if (timeoutRef.current !== null) {\r\n clearTimeout(timeoutRef.current);\r\n }\r\n };\r\n }, []);\r\n\r\n return {copied, copy, error};\r\n}\r\n"],"names":["useClipboard","options","timeout","copied","setCopied","React","error","setError","timeoutRef","copy","text","clearTimeout","globalThis","Error","setTimeout","err","errorMessage","console"],"mappings":";;AAmFO,SAASA,aAAaC,UAA+B,CAAC,CAAC;IAC5D,MAAM,EAACC,UAAU,IAAI,EAAC,GAAGD;IAEzB,MAAM,CAACE,QAAQC,UAAU,GAAGC,wBAAAA,QAAc,CAAC;IAC3C,MAAM,CAACC,OAAOC,SAAS,GAAGF,wBAAAA,QAAc,CAAe;IACvD,MAAMG,aAAaH,wBAAAA,MAAY,CAAuC;IAEtE,MAAMI,OAAOJ,wBAAAA,WAAiB,CAC5B,OAAOK;QAEL,IAAIF,AAAuB,SAAvBA,WAAW,OAAO,EAAW;YAC/BG,aAAaH,WAAW,OAAO;YAC/BA,WAAW,OAAO,GAAG;QACvB;QAGAD,SAAS;QAET,IAAI;YAEF,IAAI,AAAgC,WAAzBK,WAAW,SAAS,IAAoB,CAACA,WAAW,SAAS,CAAC,SAAS,EAChF,MAAM,IAAIC,MAAM;YAGlB,MAAMD,WAAW,SAAS,CAAC,SAAS,CAAC,SAAS,CAACF;YAC/CN,UAAU;YAGVI,WAAW,OAAO,GAAGM,WAAW;gBAC9BV,UAAU;gBACVI,WAAW,OAAO,GAAG;YACvB,GAAGN;QACL,EAAE,OAAOa,KAAK;YACZ,MAAMC,eAAeD,eAAeF,QAAQE,MAAM,IAAIF,MAAM;YAE5DN,SAASS;YACTZ,UAAU;YACVa,QAAQ,KAAK,CAAC,6BAA6BD;QAC7C;IACF,GACA;QAACd;KAAQ;IAIXG,wBAAAA,SAAe,CAAC,IACP;YACL,IAAIG,AAAuB,SAAvBA,WAAW,OAAO,EACpBG,aAAaH,WAAW,OAAO;QAEnC,GACC,EAAE;IAEL,OAAO;QAACL;QAAQM;QAAMH;IAAK;AAC7B"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { useCallback, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useControllableState(options) {
4
4
  const { controlled, defaultValue, onChange } = options;
5
- const [uncontrolledState, setUncontrolledState] = useState(defaultValue);
5
+ const [uncontrolledState, setUncontrolledState] = __rspack_external_react.useState(defaultValue);
6
6
  const isControlled = void 0 !== controlled;
7
7
  const value = isControlled ? controlled : uncontrolledState;
8
- const setValue = useCallback((nextValue)=>{
8
+ const setValue = __rspack_external_react.useCallback((nextValue)=>{
9
9
  if (isControlled) {
10
10
  const resolvedValue = "function" == typeof nextValue ? nextValue(controlled) : nextValue;
11
11
  onChange?.(resolvedValue);
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useControllableState.js","sources":["../../src/hooks/useControllableState.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Options for configuring controllable state behavior.\r\n *\r\n * @typeParam T - The type of the state value.\r\n */\r\nexport interface UseControllableStateOptions<T> {\r\n /**\r\n * The controlled value from props. When provided, the component operates in controlled mode.\r\n */\r\n controlled?: T;\r\n /**\r\n * The default value used when the component is uncontrolled.\r\n */\r\n defaultValue: T;\r\n /**\r\n * Callback fired when the internal state changes in controlled mode.\r\n *\r\n * @param value - The new state value.\r\n */\r\n onChange?: (value: T) => void;\r\n}\r\n\r\n/**\r\n * Manages state that can be either controlled or uncontrolled.\r\n *\r\n * @remarks\r\n * This hook enables components to support both controlled and uncontrolled patterns\r\n * seamlessly. When a `controlled` value is provided, it takes precedence; otherwise,\r\n * the hook manages internal state initialized with `defaultValue`.\r\n *\r\n * @typeParam T - The type of the state value.\r\n * @param options - Configuration object for controllable state.\r\n * @returns A tuple containing the current state value and a setter function.\r\n *\r\n * @example\r\n * ```tsx\r\n * function CustomInput({value, defaultValue = \"\", onChange}) {\r\n * const [internalValue, setValue] = useControllableState({\r\n * controlled: value,\r\n * defaultValue,\r\n * onChange,\r\n * });\r\n *\r\n * return (\r\n * <input\r\n * type=\"text\"\r\n * value={internalValue}\r\n * onChange={(e) => setValue(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useControllableState<T>(options: UseControllableStateOptions<T>): [T, (value: T | ((prev: T) => T)) => void] {\r\n const {controlled, defaultValue, onChange} = options;\r\n const [uncontrolledState, setUncontrolledState] = React.useState<T>(defaultValue);\r\n const isControlled = controlled !== undefined;\r\n const value = isControlled ? controlled : uncontrolledState;\r\n\r\n const setValue = React.useCallback(\r\n (nextValue: T | ((prev: T) => T)) => {\r\n if (!isControlled) {\r\n setUncontrolledState((currentValue) => {\r\n const resolvedValue = typeof nextValue === \"function\" ? (nextValue as (prev: T) => T)(currentValue) : nextValue;\r\n onChange?.(resolvedValue);\r\n return resolvedValue;\r\n });\r\n } else {\r\n const resolvedValue = typeof nextValue === \"function\" ? (nextValue as (prev: T) => T)(controlled as T) : nextValue;\r\n onChange?.(resolvedValue);\r\n }\r\n },\r\n [isControlled, onChange, controlled],\r\n );\r\n\r\n return [value, setValue];\r\n}\r\n"],"names":["useControllableState","options","controlled","defaultValue","onChange","uncontrolledState","setUncontrolledState","React","isControlled","undefined","value","setValue","nextValue","resolvedValue","currentValue"],"mappings":";;AAyDO,SAASA,qBAAwBC,OAAuC;IAC7E,MAAM,EAACC,UAAU,EAAEC,YAAY,EAAEC,QAAQ,EAAC,GAAGH;IAC7C,MAAM,CAACI,mBAAmBC,qBAAqB,GAAGC,SAAkBJ;IACpE,MAAMK,eAAeN,AAAeO,WAAfP;IACrB,MAAMQ,QAAQF,eAAeN,aAAaG;IAE1C,MAAMM,WAAWJ,YACf,CAACK;QACC,IAAKJ,cAME;YACL,MAAMK,gBAAgB,AAAqB,cAArB,OAAOD,YAA4BA,UAA6BV,cAAmBU;YACzGR,WAAWS;QACb,OAREP,qBAAqB,CAACQ;YACpB,MAAMD,gBAAgB,AAAqB,cAArB,OAAOD,YAA4BA,UAA6BE,gBAAgBF;YACtGR,WAAWS;YACX,OAAOA;QACT;IAKJ,GACA;QAACL;QAAcJ;QAAUF;KAAW;IAGtC,OAAO;QAACQ;QAAOC;KAAS;AAC1B"}
1
+ {"version":3,"file":"hooks/useControllableState.js","sources":["../../src/hooks/useControllableState.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Options for configuring controllable state behavior.\r\n *\r\n * @typeParam T - The type of the state value.\r\n */\r\nexport interface UseControllableStateOptions<T> {\r\n /**\r\n * The controlled value from props. When provided, the component operates in controlled mode.\r\n */\r\n controlled?: T;\r\n /**\r\n * The default value used when the component is uncontrolled.\r\n */\r\n defaultValue: T;\r\n /**\r\n * Callback fired when the internal state changes in controlled mode.\r\n *\r\n * @param value - The new state value.\r\n */\r\n onChange?: (value: T) => void;\r\n}\r\n\r\n/**\r\n * Manages state that can be either controlled or uncontrolled.\r\n *\r\n * @remarks\r\n * This hook enables components to support both controlled and uncontrolled patterns\r\n * seamlessly. When a `controlled` value is provided, it takes precedence; otherwise,\r\n * the hook manages internal state initialized with `defaultValue`.\r\n *\r\n * @typeParam T - The type of the state value.\r\n * @param options - Configuration object for controllable state.\r\n * @returns A tuple containing the current state value and a setter function.\r\n *\r\n * @example\r\n * ```tsx\r\n * function CustomInput({value, defaultValue = \"\", onChange}) {\r\n * const [internalValue, setValue] = useControllableState({\r\n * controlled: value,\r\n * defaultValue,\r\n * onChange,\r\n * });\r\n *\r\n * return (\r\n * <input\r\n * type=\"text\"\r\n * value={internalValue}\r\n * onChange={(e) => setValue(e.target.value)}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useControllableState<T>(options: UseControllableStateOptions<T>): [T, (value: T | ((prev: T) => T)) => void] {\r\n const {controlled, defaultValue, onChange} = options;\r\n const [uncontrolledState, setUncontrolledState] = React.useState<T>(defaultValue);\r\n const isControlled = controlled !== undefined;\r\n const value = isControlled ? controlled : uncontrolledState;\r\n\r\n const setValue = React.useCallback(\r\n (nextValue: T | ((prev: T) => T)) => {\r\n if (!isControlled) {\r\n setUncontrolledState((currentValue) => {\r\n const resolvedValue = typeof nextValue === \"function\" ? (nextValue as (prev: T) => T)(currentValue) : nextValue;\r\n onChange?.(resolvedValue);\r\n return resolvedValue;\r\n });\r\n } else {\r\n const resolvedValue = typeof nextValue === \"function\" ? (nextValue as (prev: T) => T)(controlled as T) : nextValue;\r\n onChange?.(resolvedValue);\r\n }\r\n },\r\n [isControlled, onChange, controlled],\r\n );\r\n\r\n return [value, setValue];\r\n}\r\n"],"names":["useControllableState","options","controlled","defaultValue","onChange","uncontrolledState","setUncontrolledState","React","isControlled","undefined","value","setValue","nextValue","resolvedValue","currentValue"],"mappings":";;AAyDO,SAASA,qBAAwBC,OAAuC;IAC7E,MAAM,EAACC,UAAU,EAAEC,YAAY,EAAEC,QAAQ,EAAC,GAAGH;IAC7C,MAAM,CAACI,mBAAmBC,qBAAqB,GAAGC,wBAAAA,QAAc,CAAIJ;IACpE,MAAMK,eAAeN,AAAeO,WAAfP;IACrB,MAAMQ,QAAQF,eAAeN,aAAaG;IAE1C,MAAMM,WAAWJ,wBAAAA,WAAiB,CAChC,CAACK;QACC,IAAKJ,cAME;YACL,MAAMK,gBAAgB,AAAqB,cAArB,OAAOD,YAA4BA,UAA6BV,cAAmBU;YACzGR,WAAWS;QACb,OAREP,qBAAqB,CAACQ;YACpB,MAAMD,gBAAgB,AAAqB,cAArB,OAAOD,YAA4BA,UAA6BE,gBAAgBF;YACtGR,WAAWS;YACX,OAAOA;QACT;IAKJ,GACA;QAACL;QAAcJ;QAAUF;KAAW;IAGtC,OAAO;QAACQ;QAAOC;KAAS;AAC1B"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { useEffect, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useDebounce(value, delay) {
4
- const [debouncedValue, setDebouncedValue] = useState(value);
5
- useEffect(()=>{
4
+ const [debouncedValue, setDebouncedValue] = __rspack_external_react.useState(value);
5
+ __rspack_external_react.useEffect(()=>{
6
6
  const timeoutId = globalThis.setTimeout(()=>{
7
7
  setDebouncedValue(value);
8
8
  }, delay);
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useDebounce.js","sources":["../../src/hooks/useDebounce.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Debounces a value, delaying updates until after the specified delay has elapsed.\r\n *\r\n * @remarks\r\n * This hook returns a debounced version of the provided value that only updates\r\n * after the value has stopped changing for the specified delay. Useful for optimizing\r\n * performance in scenarios like search inputs, where you want to avoid triggering\r\n * expensive operations on every keystroke.\r\n *\r\n * The debounce timer resets on every value change and cleans up automatically on unmount.\r\n *\r\n * @typeParam T - The type of the value being debounced.\r\n * @param value - The value to debounce.\r\n * @param delay - The delay in milliseconds before the debounced value updates.\r\n * @returns The debounced value.\r\n *\r\n * @example\r\n * ```tsx\r\n * function SearchInput() {\r\n * const [searchTerm, setSearchTerm] = useState(\"\");\r\n * const debouncedSearchTerm = useDebounce(searchTerm, 500);\r\n *\r\n * useEffect(() => {\r\n * // Expensive search operation\r\n * performSearch(debouncedSearchTerm);\r\n * }, [debouncedSearchTerm]);\r\n *\r\n * return <input value={searchTerm} onChange={(e) => setSearchTerm(e.target.value)} />;\r\n * }\r\n * ```\r\n */\r\nexport function useDebounce<T>(value: T, delay: number): T {\r\n const [debouncedValue, setDebouncedValue] = React.useState<T>(value);\r\n\r\n React.useEffect(() => {\r\n const timeoutId = globalThis.setTimeout(() => {\r\n setDebouncedValue(value);\r\n }, delay);\r\n\r\n return () => {\r\n globalThis.clearTimeout(timeoutId);\r\n };\r\n }, [value, delay]);\r\n\r\n return debouncedValue;\r\n}\r\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","React","timeoutId","globalThis"],"mappings":";;AAmCO,SAASA,YAAeC,KAAQ,EAAEC,KAAa;IACpD,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,SAAkBJ;IAE9DI,UAAgB;QACd,MAAMC,YAAYC,WAAW,UAAU,CAAC;YACtCH,kBAAkBH;QACpB,GAAGC;QAEH,OAAO;YACLK,WAAW,YAAY,CAACD;QAC1B;IACF,GAAG;QAACL;QAAOC;KAAM;IAEjB,OAAOC;AACT"}
1
+ {"version":3,"file":"hooks/useDebounce.js","sources":["../../src/hooks/useDebounce.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Debounces a value, delaying updates until after the specified delay has elapsed.\r\n *\r\n * @remarks\r\n * This hook returns a debounced version of the provided value that only updates\r\n * after the value has stopped changing for the specified delay. Useful for optimizing\r\n * performance in scenarios like search inputs, where you want to avoid triggering\r\n * expensive operations on every keystroke.\r\n *\r\n * The debounce timer resets on every value change and cleans up automatically on unmount.\r\n *\r\n * @typeParam T - The type of the value being debounced.\r\n * @param value - The value to debounce.\r\n * @param delay - The delay in milliseconds before the debounced value updates.\r\n * @returns The debounced value.\r\n *\r\n * @example\r\n * ```tsx\r\n * function SearchInput() {\r\n * const [searchTerm, setSearchTerm] = useState(\"\");\r\n * const debouncedSearchTerm = useDebounce(searchTerm, 500);\r\n *\r\n * useEffect(() => {\r\n * // Expensive search operation\r\n * performSearch(debouncedSearchTerm);\r\n * }, [debouncedSearchTerm]);\r\n *\r\n * return <input value={searchTerm} onChange={(e) => setSearchTerm(e.target.value)} />;\r\n * }\r\n * ```\r\n */\r\nexport function useDebounce<T>(value: T, delay: number): T {\r\n const [debouncedValue, setDebouncedValue] = React.useState<T>(value);\r\n\r\n React.useEffect(() => {\r\n const timeoutId = globalThis.setTimeout(() => {\r\n setDebouncedValue(value);\r\n }, delay);\r\n\r\n return () => {\r\n globalThis.clearTimeout(timeoutId);\r\n };\r\n }, [value, delay]);\r\n\r\n return debouncedValue;\r\n}\r\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","React","timeoutId","globalThis"],"mappings":";;AAmCO,SAASA,YAAeC,KAAQ,EAAEC,KAAa;IACpD,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,wBAAAA,QAAc,CAAIJ;IAE9DI,wBAAAA,SAAe,CAAC;QACd,MAAMC,YAAYC,WAAW,UAAU,CAAC;YACtCH,kBAAkBH;QACpB,GAAGC;QAEH,OAAO;YACLK,WAAW,YAAY,CAACD;QAC1B;IACF,GAAG;QAACL;QAAOC;KAAM;IAEjB,OAAOC;AACT"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
- import { useCallback, useLayoutEffect, useRef } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useEventCallback(callback) {
4
- const callbackRef = useRef(callback);
5
- useLayoutEffect(()=>{
4
+ const callbackRef = __rspack_external_react.useRef(callback);
5
+ __rspack_external_react.useLayoutEffect(()=>{
6
6
  callbackRef.current = callback;
7
7
  });
8
- return useCallback((...args)=>callbackRef.current(...args), []);
8
+ return __rspack_external_react.useCallback((...args)=>callbackRef.current(...args), []);
9
9
  }
10
10
  export { useEventCallback };
11
11
 
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useEventCallback.js","sources":["../../src/hooks/useEventCallback.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Creates a stable callback reference that always calls the latest version of the provided function.\r\n *\r\n * @remarks\r\n * Unlike `useCallback`, this hook returns a stable function reference that never changes,\r\n * but always invokes the most recent version of the callback. This is useful when you need\r\n * to pass callbacks to optimized child components or effects without triggering re-renders\r\n * when dependencies change.\r\n *\r\n * The returned function is safe to use in dependency arrays because its identity never changes.\r\n *\r\n * @typeParam Args - The tuple type of the callback's arguments.\r\n * @typeParam Return - The return type of the callback.\r\n * @param callback - The function to wrap with a stable reference.\r\n * @returns A stable function reference that invokes the latest callback.\r\n *\r\n * @example\r\n * ```tsx\r\n * function SearchInput({onSearch}) {\r\n * const [query, setQuery] = useState(\"\");\r\n * // stableOnSearch never changes identity, but always calls the latest onSearch\r\n * const stableOnSearch = useEventCallback(onSearch);\r\n *\r\n * useEffect(() => {\r\n * const timer = setTimeout(() => stableOnSearch(query), 500);\r\n * return () => clearTimeout(timer);\r\n * }, [query, stableOnSearch]); // Safe to include in deps\r\n *\r\n * return <input value={query} onChange={(e) => setQuery(e.target.value)} />;\r\n * }\r\n * ```\r\n */\r\nexport function useEventCallback<Args extends unknown[], Return>(callback: (...args: Args) => Return): (...args: Args) => Return {\r\n const callbackRef = React.useRef(callback);\r\n\r\n React.useLayoutEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n return React.useCallback((...args: Args) => {\r\n return callbackRef.current(...args);\r\n }, []);\r\n}\r\n"],"names":["useEventCallback","callback","callbackRef","React","args"],"mappings":";;AAoCO,SAASA,iBAAiDC,QAAmC;IAClG,MAAMC,cAAcC,OAAaF;IAEjCE,gBAAsB;QACpBD,YAAY,OAAO,GAAGD;IACxB;IAEA,OAAOE,YAAkB,CAAC,GAAGC,OACpBF,YAAY,OAAO,IAAIE,OAC7B,EAAE;AACP"}
1
+ {"version":3,"file":"hooks/useEventCallback.js","sources":["../../src/hooks/useEventCallback.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Creates a stable callback reference that always calls the latest version of the provided function.\r\n *\r\n * @remarks\r\n * Unlike `useCallback`, this hook returns a stable function reference that never changes,\r\n * but always invokes the most recent version of the callback. This is useful when you need\r\n * to pass callbacks to optimized child components or effects without triggering re-renders\r\n * when dependencies change.\r\n *\r\n * The returned function is safe to use in dependency arrays because its identity never changes.\r\n *\r\n * @typeParam Args - The tuple type of the callback's arguments.\r\n * @typeParam Return - The return type of the callback.\r\n * @param callback - The function to wrap with a stable reference.\r\n * @returns A stable function reference that invokes the latest callback.\r\n *\r\n * @example\r\n * ```tsx\r\n * function SearchInput({onSearch}) {\r\n * const [query, setQuery] = useState(\"\");\r\n * // stableOnSearch never changes identity, but always calls the latest onSearch\r\n * const stableOnSearch = useEventCallback(onSearch);\r\n *\r\n * useEffect(() => {\r\n * const timer = setTimeout(() => stableOnSearch(query), 500);\r\n * return () => clearTimeout(timer);\r\n * }, [query, stableOnSearch]); // Safe to include in deps\r\n *\r\n * return <input value={query} onChange={(e) => setQuery(e.target.value)} />;\r\n * }\r\n * ```\r\n */\r\nexport function useEventCallback<Args extends unknown[], Return>(callback: (...args: Args) => Return): (...args: Args) => Return {\r\n const callbackRef = React.useRef(callback);\r\n\r\n React.useLayoutEffect(() => {\r\n callbackRef.current = callback;\r\n });\r\n\r\n return React.useCallback((...args: Args) => {\r\n return callbackRef.current(...args);\r\n }, []);\r\n}\r\n"],"names":["useEventCallback","callback","callbackRef","React","args"],"mappings":";;AAoCO,SAASA,iBAAiDC,QAAmC;IAClG,MAAMC,cAAcC,wBAAAA,MAAY,CAACF;IAEjCE,wBAAAA,eAAqB,CAAC;QACpBD,YAAY,OAAO,GAAGD;IACxB;IAEA,OAAOE,wBAAAA,WAAiB,CAAC,CAAC,GAAGC,OACpBF,YAAY,OAAO,IAAIE,OAC7B,EAAE;AACP"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { useCallback } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  const FOCUSABLE_SELECTOR = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]), [contenteditable]';
4
4
  function useFocusManager(containerRef) {
5
- const getFocusable = useCallback(()=>{
5
+ const getFocusable = __rspack_external_react.useCallback(()=>{
6
6
  if (!containerRef.current) return [];
7
7
  return [
8
8
  ...containerRef.current.querySelectorAll(FOCUSABLE_SELECTOR)
@@ -10,18 +10,18 @@ function useFocusManager(containerRef) {
10
10
  }, [
11
11
  containerRef
12
12
  ]);
13
- const focusFirst = useCallback(()=>{
13
+ const focusFirst = __rspack_external_react.useCallback(()=>{
14
14
  getFocusable()[0]?.focus();
15
15
  }, [
16
16
  getFocusable
17
17
  ]);
18
- const focusLast = useCallback(()=>{
18
+ const focusLast = __rspack_external_react.useCallback(()=>{
19
19
  const items = getFocusable();
20
20
  items.at(-1)?.focus();
21
21
  }, [
22
22
  getFocusable
23
23
  ]);
24
- const focusNext = useCallback(()=>{
24
+ const focusNext = __rspack_external_react.useCallback(()=>{
25
25
  const items = getFocusable();
26
26
  const current = document.activeElement;
27
27
  const index = items.indexOf(current);
@@ -30,7 +30,7 @@ function useFocusManager(containerRef) {
30
30
  }, [
31
31
  getFocusable
32
32
  ]);
33
- const focusPrevious = useCallback(()=>{
33
+ const focusPrevious = __rspack_external_react.useCallback(()=>{
34
34
  const items = getFocusable();
35
35
  const current = document.activeElement;
36
36
  const index = items.indexOf(current);
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useFocusManager.js","sources":["../../src/hooks/useFocusManager.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\nconst FOCUSABLE_SELECTOR = [\r\n \"a[href]\",\r\n \"button:not(:disabled)\",\r\n \"input:not(:disabled)\",\r\n \"select:not(:disabled)\",\r\n \"textarea:not(:disabled)\",\r\n '[tabindex]:not([tabindex=\"-1\"])',\r\n \"[contenteditable]\",\r\n].join(\", \");\r\n\r\n/**\r\n * Represents the focus movement helpers returned by {@link useFocusManager}.\r\n */\r\ninterface FocusManager {\r\n /**\r\n * Focuses the first focusable element in the container.\r\n */\r\n focusFirst: () => void;\r\n /**\r\n * Focuses the last focusable element in the container.\r\n */\r\n focusLast: () => void;\r\n /**\r\n * Focuses the next focusable element after the currently focused one.\r\n */\r\n focusNext: () => void;\r\n /**\r\n * Focuses the previous focusable element before the currently focused one.\r\n */\r\n focusPrevious: () => void;\r\n}\r\n\r\n/**\r\n * Provides programmatic focus movement helpers for a container element.\r\n *\r\n * @param containerRef - Ref pointing to the container whose focusable descendants should be managed.\r\n * @returns Focus helpers for moving to the first, last, next, or previous focusable descendant.\r\n *\r\n * @example\r\n * ```tsx\r\n * const containerRef = React.useRef<HTMLDivElement>(null);\r\n * const {focusNext, focusPrevious} = useFocusManager(containerRef);\r\n * ```\r\n */\r\nexport function useFocusManager(containerRef: React.RefObject<HTMLElement | null>): FocusManager {\r\n const getFocusable = React.useCallback((): HTMLElement[] => {\r\n if (!containerRef.current) {\r\n return [];\r\n }\r\n\r\n return [...containerRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)].filter(\r\n (element) => !element.hasAttribute(\"disabled\") && element.tabIndex >= 0,\r\n );\r\n }, [containerRef]);\r\n\r\n const focusFirst = React.useCallback(() => {\r\n getFocusable()[0]?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusLast = React.useCallback(() => {\r\n const items = getFocusable();\r\n\r\n items.at(-1)?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusNext = React.useCallback(() => {\r\n const items = getFocusable();\r\n const current = document.activeElement;\r\n const index = items.indexOf(current as HTMLElement);\r\n const next = items[index + 1] ?? items[0];\r\n\r\n next?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusPrevious = React.useCallback(() => {\r\n const items = getFocusable();\r\n const current = document.activeElement;\r\n const index = items.indexOf(current as HTMLElement);\r\n const previous = items[index - 1] ?? items.at(-1);\r\n\r\n previous?.focus();\r\n }, [getFocusable]);\r\n\r\n return {focusFirst, focusLast, focusNext, focusPrevious};\r\n}\r\n"],"names":["FOCUSABLE_SELECTOR","useFocusManager","containerRef","getFocusable","React","element","focusFirst","focusLast","items","focusNext","current","document","index","next","focusPrevious","previous"],"mappings":";;AAIA,MAAMA,qBAAqB;AA4CpB,SAASC,gBAAgBC,YAAiD;IAC/E,MAAMC,eAAeC,YAAkB;QACrC,IAAI,CAACF,aAAa,OAAO,EACvB,OAAO,EAAE;QAGX,OAAO;eAAIA,aAAa,OAAO,CAAC,gBAAgB,CAAcF;SAAoB,CAAC,MAAM,CACvF,CAACK,UAAY,CAACA,QAAQ,YAAY,CAAC,eAAeA,QAAQ,QAAQ,IAAI;IAE1E,GAAG;QAACH;KAAa;IAEjB,MAAMI,aAAaF,YAAkB;QACnCD,cAAc,CAAC,EAAE,EAAE;IACrB,GAAG;QAACA;KAAa;IAEjB,MAAMI,YAAYH,YAAkB;QAClC,MAAMI,QAAQL;QAEdK,MAAM,EAAE,CAAC,KAAK;IAChB,GAAG;QAACL;KAAa;IAEjB,MAAMM,YAAYL,YAAkB;QAClC,MAAMI,QAAQL;QACd,MAAMO,UAAUC,SAAS,aAAa;QACtC,MAAMC,QAAQJ,MAAM,OAAO,CAACE;QAC5B,MAAMG,OAAOL,KAAK,CAACI,QAAQ,EAAE,IAAIJ,KAAK,CAAC,EAAE;QAEzCK,MAAM;IACR,GAAG;QAACV;KAAa;IAEjB,MAAMW,gBAAgBV,YAAkB;QACtC,MAAMI,QAAQL;QACd,MAAMO,UAAUC,SAAS,aAAa;QACtC,MAAMC,QAAQJ,MAAM,OAAO,CAACE;QAC5B,MAAMK,WAAWP,KAAK,CAACI,QAAQ,EAAE,IAAIJ,MAAM,EAAE,CAAC;QAE9CO,UAAU;IACZ,GAAG;QAACZ;KAAa;IAEjB,OAAO;QAACG;QAAYC;QAAWE;QAAWK;IAAa;AACzD"}
1
+ {"version":3,"file":"hooks/useFocusManager.js","sources":["../../src/hooks/useFocusManager.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\nconst FOCUSABLE_SELECTOR = [\r\n \"a[href]\",\r\n \"button:not(:disabled)\",\r\n \"input:not(:disabled)\",\r\n \"select:not(:disabled)\",\r\n \"textarea:not(:disabled)\",\r\n '[tabindex]:not([tabindex=\"-1\"])',\r\n \"[contenteditable]\",\r\n].join(\", \");\r\n\r\n/**\r\n * Represents the focus movement helpers returned by {@link useFocusManager}.\r\n */\r\ninterface FocusManager {\r\n /**\r\n * Focuses the first focusable element in the container.\r\n */\r\n focusFirst: () => void;\r\n /**\r\n * Focuses the last focusable element in the container.\r\n */\r\n focusLast: () => void;\r\n /**\r\n * Focuses the next focusable element after the currently focused one.\r\n */\r\n focusNext: () => void;\r\n /**\r\n * Focuses the previous focusable element before the currently focused one.\r\n */\r\n focusPrevious: () => void;\r\n}\r\n\r\n/**\r\n * Provides programmatic focus movement helpers for a container element.\r\n *\r\n * @param containerRef - Ref pointing to the container whose focusable descendants should be managed.\r\n * @returns Focus helpers for moving to the first, last, next, or previous focusable descendant.\r\n *\r\n * @example\r\n * ```tsx\r\n * const containerRef = React.useRef<HTMLDivElement>(null);\r\n * const {focusNext, focusPrevious} = useFocusManager(containerRef);\r\n * ```\r\n */\r\nexport function useFocusManager(containerRef: React.RefObject<HTMLElement | null>): FocusManager {\r\n const getFocusable = React.useCallback((): HTMLElement[] => {\r\n if (!containerRef.current) {\r\n return [];\r\n }\r\n\r\n return [...containerRef.current.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)].filter(\r\n (element) => !element.hasAttribute(\"disabled\") && element.tabIndex >= 0,\r\n );\r\n }, [containerRef]);\r\n\r\n const focusFirst = React.useCallback(() => {\r\n getFocusable()[0]?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusLast = React.useCallback(() => {\r\n const items = getFocusable();\r\n\r\n items.at(-1)?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusNext = React.useCallback(() => {\r\n const items = getFocusable();\r\n const current = document.activeElement;\r\n const index = items.indexOf(current as HTMLElement);\r\n const next = items[index + 1] ?? items[0];\r\n\r\n next?.focus();\r\n }, [getFocusable]);\r\n\r\n const focusPrevious = React.useCallback(() => {\r\n const items = getFocusable();\r\n const current = document.activeElement;\r\n const index = items.indexOf(current as HTMLElement);\r\n const previous = items[index - 1] ?? items.at(-1);\r\n\r\n previous?.focus();\r\n }, [getFocusable]);\r\n\r\n return {focusFirst, focusLast, focusNext, focusPrevious};\r\n}\r\n"],"names":["FOCUSABLE_SELECTOR","useFocusManager","containerRef","getFocusable","React","element","focusFirst","focusLast","items","focusNext","current","document","index","next","focusPrevious","previous"],"mappings":";;AAIA,MAAMA,qBAAqB;AA4CpB,SAASC,gBAAgBC,YAAiD;IAC/E,MAAMC,eAAeC,wBAAAA,WAAiB,CAAC;QACrC,IAAI,CAACF,aAAa,OAAO,EACvB,OAAO,EAAE;QAGX,OAAO;eAAIA,aAAa,OAAO,CAAC,gBAAgB,CAAcF;SAAoB,CAAC,MAAM,CACvF,CAACK,UAAY,CAACA,QAAQ,YAAY,CAAC,eAAeA,QAAQ,QAAQ,IAAI;IAE1E,GAAG;QAACH;KAAa;IAEjB,MAAMI,aAAaF,wBAAAA,WAAiB,CAAC;QACnCD,cAAc,CAAC,EAAE,EAAE;IACrB,GAAG;QAACA;KAAa;IAEjB,MAAMI,YAAYH,wBAAAA,WAAiB,CAAC;QAClC,MAAMI,QAAQL;QAEdK,MAAM,EAAE,CAAC,KAAK;IAChB,GAAG;QAACL;KAAa;IAEjB,MAAMM,YAAYL,wBAAAA,WAAiB,CAAC;QAClC,MAAMI,QAAQL;QACd,MAAMO,UAAUC,SAAS,aAAa;QACtC,MAAMC,QAAQJ,MAAM,OAAO,CAACE;QAC5B,MAAMG,OAAOL,KAAK,CAACI,QAAQ,EAAE,IAAIJ,KAAK,CAAC,EAAE;QAEzCK,MAAM;IACR,GAAG;QAACV;KAAa;IAEjB,MAAMW,gBAAgBV,wBAAAA,WAAiB,CAAC;QACtC,MAAMI,QAAQL;QACd,MAAMO,UAAUC,SAAS,aAAa;QACtC,MAAMC,QAAQJ,MAAM,OAAO,CAACE;QAC5B,MAAMK,WAAWP,KAAK,CAACI,QAAQ,EAAE,IAAIJ,MAAM,EAAE,CAAC;QAE9CO,UAAU;IACZ,GAAG;QAACZ;KAAa;IAEjB,OAAO;QAACG;QAAYC;QAAWE;QAAWK;IAAa;AACzD"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { useEffect, useMemo, useRef, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useFocusVisible() {
4
- const [isFocusVisible, setIsFocusVisible] = useState(false);
5
- const isKeyboardRef = useRef(false);
6
- useEffect(()=>{
4
+ const [isFocusVisible, setIsFocusVisible] = __rspack_external_react.useState(false);
5
+ const isKeyboardRef = __rspack_external_react.useRef(false);
6
+ __rspack_external_react.useEffect(()=>{
7
7
  const onKeyDown = ()=>{
8
8
  isKeyboardRef.current = true;
9
9
  };
@@ -17,7 +17,7 @@ function useFocusVisible() {
17
17
  globalThis.document.removeEventListener("pointerdown", onPointerDown, true);
18
18
  };
19
19
  }, []);
20
- const focusProps = useMemo(()=>({
20
+ const focusProps = __rspack_external_react.useMemo(()=>({
21
21
  onFocus: (_event)=>{
22
22
  if (isKeyboardRef.current) setIsFocusVisible(true);
23
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useFocusVisible.js","sources":["../../src/hooks/useFocusVisible.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Represents the focus handlers returned by {@link useFocusVisible}.\r\n *\r\n * @remarks\r\n * Spread these handlers onto the interactive element that should respond to keyboard\r\n * focus visibility. They coordinate transient focus styling without owning rendering.\r\n */\r\ninterface FocusVisibleProps {\r\n /**\r\n * Called when the target receives focus.\r\n */\r\n onFocus: (event: React.FocusEvent) => void;\r\n /**\r\n * Called when the target loses focus.\r\n */\r\n onBlur: () => void;\r\n}\r\n\r\n/**\r\n * Detects whether the current focus originated from keyboard navigation.\r\n *\r\n * @remarks\r\n * Tracks global keyboard and pointer input so consumers can render focus rings only when\r\n * users are tabbing through the interface. This mirrors the intent of `:focus-visible`\r\n * while remaining available to JavaScript-driven components and custom states.\r\n *\r\n * @returns An object containing the current focus-visible state and focus handlers to spread on the target element.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {isFocusVisible, focusProps} = useFocusVisible();\r\n *\r\n * return (\r\n * <button\r\n * type=\"button\"\r\n * {...focusProps}\r\n * className={isFocusVisible ? \"ring\" : undefined}>\r\n * Click\r\n * </button>\r\n * );\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible | MDN :focus-visible}\r\n */\r\nexport function useFocusVisible(): {\r\n isFocusVisible: boolean;\r\n focusProps: FocusVisibleProps;\r\n} {\r\n const [isFocusVisible, setIsFocusVisible] = React.useState(false);\r\n const isKeyboardRef = React.useRef(false);\r\n\r\n React.useEffect(() => {\r\n const onKeyDown = () => {\r\n isKeyboardRef.current = true;\r\n };\r\n const onPointerDown = () => {\r\n isKeyboardRef.current = false;\r\n };\r\n\r\n globalThis.document.addEventListener(\"keydown\", onKeyDown, true);\r\n globalThis.document.addEventListener(\"pointerdown\", onPointerDown, true);\r\n\r\n return () => {\r\n globalThis.document.removeEventListener(\"keydown\", onKeyDown, true);\r\n globalThis.document.removeEventListener(\"pointerdown\", onPointerDown, true);\r\n };\r\n }, []);\r\n\r\n const focusProps = React.useMemo<FocusVisibleProps>(\r\n () => ({\r\n onFocus: (_event: React.FocusEvent) => {\r\n if (isKeyboardRef.current) {\r\n setIsFocusVisible(true);\r\n }\r\n },\r\n onBlur: () => {\r\n setIsFocusVisible(false);\r\n },\r\n }),\r\n [],\r\n );\r\n\r\n return {isFocusVisible, focusProps};\r\n}\r\n"],"names":["useFocusVisible","isFocusVisible","setIsFocusVisible","React","isKeyboardRef","onKeyDown","onPointerDown","globalThis","focusProps","_event"],"mappings":";;AAgDO,SAASA;IAId,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,SAAe;IAC3D,MAAMC,gBAAgBD,OAAa;IAEnCA,UAAgB;QACd,MAAME,YAAY;YAChBD,cAAc,OAAO,GAAG;QAC1B;QACA,MAAME,gBAAgB;YACpBF,cAAc,OAAO,GAAG;QAC1B;QAEAG,WAAW,QAAQ,CAAC,gBAAgB,CAAC,WAAWF,WAAW;QAC3DE,WAAW,QAAQ,CAAC,gBAAgB,CAAC,eAAeD,eAAe;QAEnE,OAAO;YACLC,WAAW,QAAQ,CAAC,mBAAmB,CAAC,WAAWF,WAAW;YAC9DE,WAAW,QAAQ,CAAC,mBAAmB,CAAC,eAAeD,eAAe;QACxE;IACF,GAAG,EAAE;IAEL,MAAME,aAAaL,QACjB,IAAO;YACL,SAAS,CAACM;gBACR,IAAIL,cAAc,OAAO,EACvBF,kBAAkB;YAEtB;YACA,QAAQ;gBACNA,kBAAkB;YACpB;QACF,IACA,EAAE;IAGJ,OAAO;QAACD;QAAgBO;IAAU;AACpC"}
1
+ {"version":3,"file":"hooks/useFocusVisible.js","sources":["../../src/hooks/useFocusVisible.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Represents the focus handlers returned by {@link useFocusVisible}.\r\n *\r\n * @remarks\r\n * Spread these handlers onto the interactive element that should respond to keyboard\r\n * focus visibility. They coordinate transient focus styling without owning rendering.\r\n */\r\ninterface FocusVisibleProps {\r\n /**\r\n * Called when the target receives focus.\r\n */\r\n onFocus: (event: React.FocusEvent) => void;\r\n /**\r\n * Called when the target loses focus.\r\n */\r\n onBlur: () => void;\r\n}\r\n\r\n/**\r\n * Detects whether the current focus originated from keyboard navigation.\r\n *\r\n * @remarks\r\n * Tracks global keyboard and pointer input so consumers can render focus rings only when\r\n * users are tabbing through the interface. This mirrors the intent of `:focus-visible`\r\n * while remaining available to JavaScript-driven components and custom states.\r\n *\r\n * @returns An object containing the current focus-visible state and focus handlers to spread on the target element.\r\n *\r\n * @example\r\n * ```tsx\r\n * const {isFocusVisible, focusProps} = useFocusVisible();\r\n *\r\n * return (\r\n * <button\r\n * type=\"button\"\r\n * {...focusProps}\r\n * className={isFocusVisible ? \"ring\" : undefined}>\r\n * Click\r\n * </button>\r\n * );\r\n * ```\r\n *\r\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible | MDN :focus-visible}\r\n */\r\nexport function useFocusVisible(): {\r\n isFocusVisible: boolean;\r\n focusProps: FocusVisibleProps;\r\n} {\r\n const [isFocusVisible, setIsFocusVisible] = React.useState(false);\r\n const isKeyboardRef = React.useRef(false);\r\n\r\n React.useEffect(() => {\r\n const onKeyDown = () => {\r\n isKeyboardRef.current = true;\r\n };\r\n const onPointerDown = () => {\r\n isKeyboardRef.current = false;\r\n };\r\n\r\n globalThis.document.addEventListener(\"keydown\", onKeyDown, true);\r\n globalThis.document.addEventListener(\"pointerdown\", onPointerDown, true);\r\n\r\n return () => {\r\n globalThis.document.removeEventListener(\"keydown\", onKeyDown, true);\r\n globalThis.document.removeEventListener(\"pointerdown\", onPointerDown, true);\r\n };\r\n }, []);\r\n\r\n const focusProps = React.useMemo<FocusVisibleProps>(\r\n () => ({\r\n onFocus: (_event: React.FocusEvent) => {\r\n if (isKeyboardRef.current) {\r\n setIsFocusVisible(true);\r\n }\r\n },\r\n onBlur: () => {\r\n setIsFocusVisible(false);\r\n },\r\n }),\r\n [],\r\n );\r\n\r\n return {isFocusVisible, focusProps};\r\n}\r\n"],"names":["useFocusVisible","isFocusVisible","setIsFocusVisible","React","isKeyboardRef","onKeyDown","onPointerDown","globalThis","focusProps","_event"],"mappings":";;AAgDO,SAASA;IAId,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,wBAAAA,QAAc,CAAC;IAC3D,MAAMC,gBAAgBD,wBAAAA,MAAY,CAAC;IAEnCA,wBAAAA,SAAe,CAAC;QACd,MAAME,YAAY;YAChBD,cAAc,OAAO,GAAG;QAC1B;QACA,MAAME,gBAAgB;YACpBF,cAAc,OAAO,GAAG;QAC1B;QAEAG,WAAW,QAAQ,CAAC,gBAAgB,CAAC,WAAWF,WAAW;QAC3DE,WAAW,QAAQ,CAAC,gBAAgB,CAAC,eAAeD,eAAe;QAEnE,OAAO;YACLC,WAAW,QAAQ,CAAC,mBAAmB,CAAC,WAAWF,WAAW;YAC9DE,WAAW,QAAQ,CAAC,mBAAmB,CAAC,eAAeD,eAAe;QACxE;IACF,GAAG,EAAE;IAEL,MAAME,aAAaL,wBAAAA,OAAa,CAC9B,IAAO;YACL,SAAS,CAACM;gBACR,IAAIL,cAAc,OAAO,EACvBF,kBAAkB;YAEtB;YACA,QAAQ;gBACNA,kBAAkB;YACpB;QACF,IACA,EAAE;IAGJ,OAAO;QAACD;QAAgBO;IAAU;AACpC"}
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { useId } from "react";
3
- function useId_useId(prefix) {
4
- const reactId = useId();
2
+ import * as __rspack_external_react from "react";
3
+ function useId(prefix) {
4
+ const reactId = __rspack_external_react.useId();
5
5
  return prefix ? `${prefix}-${reactId}` : reactId;
6
6
  }
7
- export { useId_useId as useId };
7
+ export { useId };
8
8
 
9
9
  //# sourceMappingURL=useId.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useId.js","sources":["../../src/hooks/useId.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Generates a unique, stable identifier that is safe for server-side rendering.\r\n *\r\n * @remarks\r\n * This hook wraps React's `useId` and optionally prepends a custom prefix.\r\n * The generated ID remains stable across re-renders and matches between server\r\n * and client, making it ideal for associating form labels with inputs or\r\n * managing accessible ARIA relationships.\r\n *\r\n * @param prefix - Optional string to prepend to the generated ID.\r\n * @returns A unique identifier string.\r\n *\r\n * @example\r\n * ```tsx\r\n * function FormField({label}) {\r\n * const id = useId(\"field\");\r\n *\r\n * return (\r\n * <div>\r\n * <label htmlFor={id}>{label}</label>\r\n * <input id={id} type=\"text\" />\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useId | React useId}\r\n */\r\nexport function useId(prefix?: string): string {\r\n const reactId = React.useId();\r\n return prefix ? `${prefix}-${reactId}` : reactId;\r\n}\r\n"],"names":["useId","prefix","reactId","React"],"mappings":";;AAgCO,SAASA,YAAMC,MAAe;IACnC,MAAMC,UAAUC;IAChB,OAAOF,SAAS,GAAGA,OAAO,CAAC,EAAEC,SAAS,GAAGA;AAC3C"}
1
+ {"version":3,"file":"hooks/useId.js","sources":["../../src/hooks/useId.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Generates a unique, stable identifier that is safe for server-side rendering.\r\n *\r\n * @remarks\r\n * This hook wraps React's `useId` and optionally prepends a custom prefix.\r\n * The generated ID remains stable across re-renders and matches between server\r\n * and client, making it ideal for associating form labels with inputs or\r\n * managing accessible ARIA relationships.\r\n *\r\n * @param prefix - Optional string to prepend to the generated ID.\r\n * @returns A unique identifier string.\r\n *\r\n * @example\r\n * ```tsx\r\n * function FormField({label}) {\r\n * const id = useId(\"field\");\r\n *\r\n * return (\r\n * <div>\r\n * <label htmlFor={id}>{label}</label>\r\n * <input id={id} type=\"text\" />\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @see {@link https://react.dev/reference/react/useId | React useId}\r\n */\r\nexport function useId(prefix?: string): string {\r\n const reactId = React.useId();\r\n return prefix ? `${prefix}-${reactId}` : reactId;\r\n}\r\n"],"names":["useId","prefix","reactId","React"],"mappings":";;AAgCO,SAASA,MAAMC,MAAe;IACnC,MAAMC,UAAUC,wBAAAA,KAAW;IAC3B,OAAOF,SAAS,GAAGA,OAAO,CAAC,EAAEC,SAAS,GAAGA;AAC3C"}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { useEffect, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useIntersectionObserver(ref, options) {
4
- const [entry, setEntry] = useState(null);
5
- useEffect(()=>{
4
+ const [entry, setEntry] = __rspack_external_react.useState(null);
5
+ __rspack_external_react.useEffect(()=>{
6
6
  const element = ref.current;
7
7
  if (void 0 === globalThis.IntersectionObserver || !element) return;
8
8
  const observer = new globalThis.IntersectionObserver(([observerEntry])=>{
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useIntersectionObserver.js","sources":["../../src/hooks/useIntersectionObserver.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Observes element visibility using the Intersection Observer API.\r\n *\r\n * @remarks\r\n * This hook creates an IntersectionObserver that watches the provided element\r\n * reference and returns the latest `IntersectionObserverEntry`. It's useful\r\n * for implementing lazy loading, infinite scroll, animations on scroll, and\r\n * tracking element visibility.\r\n *\r\n * The observer automatically disconnects when the component unmounts or when\r\n * the element reference changes. The hook is SSR-safe and returns `null` when\r\n * running on the server or when the observer is not yet initialized.\r\n *\r\n * @param ref - A React ref object pointing to the element to observe.\r\n * @param options - Optional IntersectionObserver configuration (threshold, root, rootMargin).\r\n * @returns The latest IntersectionObserverEntry or null if not intersecting yet.\r\n *\r\n * @example\r\n * ```tsx\r\n * function LazyImage({src, alt}: {src: string; alt: string}) {\r\n * const imageRef = useRef<HTMLImageElement>(null);\r\n * const entry = useIntersectionObserver(imageRef, {threshold: 0.1});\r\n *\r\n * return (\r\n * <img\r\n * ref={imageRef}\r\n * src={entry?.isIntersecting ? src : undefined}\r\n * alt={alt}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function AnimateOnScroll({children}: {children: React.ReactNode}) {\r\n * const ref = useRef<HTMLDivElement>(null);\r\n * const entry = useIntersectionObserver(ref, {threshold: 0.5});\r\n * const isVisible = entry?.isIntersecting ?? false;\r\n *\r\n * return (\r\n * <div ref={ref} className={isVisible ? \"fade-in\" : \"hidden\"}>\r\n * {children}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useIntersectionObserver(\r\n ref: React.RefObject<Element | null>,\r\n options?: IntersectionObserverInit,\r\n): IntersectionObserverEntry | null {\r\n const [entry, setEntry] = React.useState<IntersectionObserverEntry | null>(null);\r\n\r\n React.useEffect(() => {\r\n const element = ref.current;\r\n\r\n // SSR safety: IntersectionObserver is not available on server\r\n if (typeof globalThis.IntersectionObserver === \"undefined\" || !element) {\r\n return;\r\n }\r\n\r\n const observer = new globalThis.IntersectionObserver(([observerEntry]) => {\r\n if (observerEntry) {\r\n setEntry(observerEntry);\r\n }\r\n }, options);\r\n\r\n observer.observe(element);\r\n\r\n return () => {\r\n observer.disconnect();\r\n };\r\n }, [ref, options?.threshold, options?.root, options?.rootMargin]);\r\n\r\n return entry;\r\n}\r\n"],"names":["useIntersectionObserver","ref","options","entry","setEntry","React","element","globalThis","observer","observerEntry"],"mappings":";;AAoDO,SAASA,wBACdC,GAAoC,EACpCC,OAAkC;IAElC,MAAM,CAACC,OAAOC,SAAS,GAAGC,SAAiD;IAE3EA,UAAgB;QACd,MAAMC,UAAUL,IAAI,OAAO;QAG3B,IAAI,AAA2C,WAApCM,WAAW,oBAAoB,IAAoB,CAACD,SAC7D;QAGF,MAAME,WAAW,IAAID,WAAW,oBAAoB,CAAC,CAAC,CAACE,cAAc;YACnE,IAAIA,eACFL,SAASK;QAEb,GAAGP;QAEHM,SAAS,OAAO,CAACF;QAEjB,OAAO;YACLE,SAAS,UAAU;QACrB;IACF,GAAG;QAACP;QAAKC,SAAS;QAAWA,SAAS;QAAMA,SAAS;KAAW;IAEhE,OAAOC;AACT"}
1
+ {"version":3,"file":"hooks/useIntersectionObserver.js","sources":["../../src/hooks/useIntersectionObserver.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Observes element visibility using the Intersection Observer API.\r\n *\r\n * @remarks\r\n * This hook creates an IntersectionObserver that watches the provided element\r\n * reference and returns the latest `IntersectionObserverEntry`. It's useful\r\n * for implementing lazy loading, infinite scroll, animations on scroll, and\r\n * tracking element visibility.\r\n *\r\n * The observer automatically disconnects when the component unmounts or when\r\n * the element reference changes. The hook is SSR-safe and returns `null` when\r\n * running on the server or when the observer is not yet initialized.\r\n *\r\n * @param ref - A React ref object pointing to the element to observe.\r\n * @param options - Optional IntersectionObserver configuration (threshold, root, rootMargin).\r\n * @returns The latest IntersectionObserverEntry or null if not intersecting yet.\r\n *\r\n * @example\r\n * ```tsx\r\n * function LazyImage({src, alt}: {src: string; alt: string}) {\r\n * const imageRef = useRef<HTMLImageElement>(null);\r\n * const entry = useIntersectionObserver(imageRef, {threshold: 0.1});\r\n *\r\n * return (\r\n * <img\r\n * ref={imageRef}\r\n * src={entry?.isIntersecting ? src : undefined}\r\n * alt={alt}\r\n * />\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function AnimateOnScroll({children}: {children: React.ReactNode}) {\r\n * const ref = useRef<HTMLDivElement>(null);\r\n * const entry = useIntersectionObserver(ref, {threshold: 0.5});\r\n * const isVisible = entry?.isIntersecting ?? false;\r\n *\r\n * return (\r\n * <div ref={ref} className={isVisible ? \"fade-in\" : \"hidden\"}>\r\n * {children}\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useIntersectionObserver(\r\n ref: React.RefObject<Element | null>,\r\n options?: IntersectionObserverInit,\r\n): IntersectionObserverEntry | null {\r\n const [entry, setEntry] = React.useState<IntersectionObserverEntry | null>(null);\r\n\r\n React.useEffect(() => {\r\n const element = ref.current;\r\n\r\n // SSR safety: IntersectionObserver is not available on server\r\n if (typeof globalThis.IntersectionObserver === \"undefined\" || !element) {\r\n return;\r\n }\r\n\r\n const observer = new globalThis.IntersectionObserver(([observerEntry]) => {\r\n if (observerEntry) {\r\n setEntry(observerEntry);\r\n }\r\n }, options);\r\n\r\n observer.observe(element);\r\n\r\n return () => {\r\n observer.disconnect();\r\n };\r\n }, [ref, options?.threshold, options?.root, options?.rootMargin]);\r\n\r\n return entry;\r\n}\r\n"],"names":["useIntersectionObserver","ref","options","entry","setEntry","React","element","globalThis","observer","observerEntry"],"mappings":";;AAoDO,SAASA,wBACdC,GAAoC,EACpCC,OAAkC;IAElC,MAAM,CAACC,OAAOC,SAAS,GAAGC,wBAAAA,QAAc,CAAmC;IAE3EA,wBAAAA,SAAe,CAAC;QACd,MAAMC,UAAUL,IAAI,OAAO;QAG3B,IAAI,AAA2C,WAApCM,WAAW,oBAAoB,IAAoB,CAACD,SAC7D;QAGF,MAAME,WAAW,IAAID,WAAW,oBAAoB,CAAC,CAAC,CAACE,cAAc;YACnE,IAAIA,eACFL,SAASK;QAEb,GAAGP;QAEHM,SAAS,OAAO,CAACF;QAEjB,OAAO;YACLE,SAAS,UAAU;QACrB;IACF,GAAG;QAACP;QAAKC,SAAS;QAAWA,SAAS;QAAMA,SAAS;KAAW;IAEhE,OAAOC;AACT"}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
- import { useEffect, useRef } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useInterval(callback, delay) {
4
- const savedCallback = useRef(callback);
5
- useEffect(()=>{
4
+ const savedCallback = __rspack_external_react.useRef(callback);
5
+ __rspack_external_react.useEffect(()=>{
6
6
  savedCallback.current = callback;
7
7
  }, [
8
8
  callback
9
9
  ]);
10
- useEffect(()=>{
10
+ __rspack_external_react.useEffect(()=>{
11
11
  if (null === delay) return;
12
12
  const intervalId = globalThis.setInterval(()=>{
13
13
  savedCallback.current();
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useInterval.js","sources":["../../src/hooks/useInterval.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Executes a callback function at specified intervals with automatic cleanup.\r\n *\r\n * @remarks\r\n * This hook provides a declarative interface for `setInterval` that automatically\r\n * handles cleanup on unmount and ensures the latest callback is always invoked\r\n * (preventing stale closures). Setting the delay to `null` pauses the interval,\r\n * which is useful for implementing play/pause functionality.\r\n *\r\n * Unlike raw `setInterval`, this hook guarantees that the interval is cleared\r\n * when the component unmounts or when the delay changes, preventing memory leaks\r\n * and unexpected behavior.\r\n *\r\n * @param callback - The function to execute at each interval.\r\n * @param delay - The interval delay in milliseconds, or `null` to pause the interval.\r\n *\r\n * @example\r\n * ```tsx\r\n * function Timer() {\r\n * const [count, setCount] = useState(0);\r\n *\r\n * useInterval(() => {\r\n * setCount((c) => c + 1);\r\n * }, 1000);\r\n *\r\n * return <div>Count: {count}</div>;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function PausableTimer() {\r\n * const [count, setCount] = useState(0);\r\n * const [isRunning, setIsRunning] = useState(true);\r\n *\r\n * useInterval(\r\n * () => {\r\n * setCount((c) => c + 1);\r\n * },\r\n * isRunning ? 1000 : null,\r\n * );\r\n *\r\n * return (\r\n * <div>\r\n * <div>Count: {count}</div>\r\n * <button onClick={() => setIsRunning(!isRunning)}>\r\n * {isRunning ? \"Pause\" : \"Resume\"}\r\n * </button>\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useInterval(callback: () => void, delay: number | null): void {\r\n const savedCallback = React.useRef(callback);\r\n\r\n // Update ref to latest callback on every render to avoid stale closures\r\n React.useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n React.useEffect(() => {\r\n // Don't schedule if delay is null\r\n if (delay === null) {\r\n return;\r\n }\r\n\r\n const intervalId = globalThis.setInterval(() => {\r\n savedCallback.current();\r\n }, delay);\r\n\r\n return () => {\r\n globalThis.clearInterval(intervalId);\r\n };\r\n }, [delay]);\r\n}\r\n"],"names":["useInterval","callback","delay","savedCallback","React","intervalId","globalThis"],"mappings":";;AAyDO,SAASA,YAAYC,QAAoB,EAAEC,KAAoB;IACpE,MAAMC,gBAAgBC,OAAaH;IAGnCG,UAAgB;QACdD,cAAc,OAAO,GAAGF;IAC1B,GAAG;QAACA;KAAS;IAEbG,UAAgB;QAEd,IAAIF,AAAU,SAAVA,OACF;QAGF,MAAMG,aAAaC,WAAW,WAAW,CAAC;YACxCH,cAAc,OAAO;QACvB,GAAGD;QAEH,OAAO;YACLI,WAAW,aAAa,CAACD;QAC3B;IACF,GAAG;QAACH;KAAM;AACZ"}
1
+ {"version":3,"file":"hooks/useInterval.js","sources":["../../src/hooks/useInterval.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Executes a callback function at specified intervals with automatic cleanup.\r\n *\r\n * @remarks\r\n * This hook provides a declarative interface for `setInterval` that automatically\r\n * handles cleanup on unmount and ensures the latest callback is always invoked\r\n * (preventing stale closures). Setting the delay to `null` pauses the interval,\r\n * which is useful for implementing play/pause functionality.\r\n *\r\n * Unlike raw `setInterval`, this hook guarantees that the interval is cleared\r\n * when the component unmounts or when the delay changes, preventing memory leaks\r\n * and unexpected behavior.\r\n *\r\n * @param callback - The function to execute at each interval.\r\n * @param delay - The interval delay in milliseconds, or `null` to pause the interval.\r\n *\r\n * @example\r\n * ```tsx\r\n * function Timer() {\r\n * const [count, setCount] = useState(0);\r\n *\r\n * useInterval(() => {\r\n * setCount((c) => c + 1);\r\n * }, 1000);\r\n *\r\n * return <div>Count: {count}</div>;\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function PausableTimer() {\r\n * const [count, setCount] = useState(0);\r\n * const [isRunning, setIsRunning] = useState(true);\r\n *\r\n * useInterval(\r\n * () => {\r\n * setCount((c) => c + 1);\r\n * },\r\n * isRunning ? 1000 : null,\r\n * );\r\n *\r\n * return (\r\n * <div>\r\n * <div>Count: {count}</div>\r\n * <button onClick={() => setIsRunning(!isRunning)}>\r\n * {isRunning ? \"Pause\" : \"Resume\"}\r\n * </button>\r\n * </div>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useInterval(callback: () => void, delay: number | null): void {\r\n const savedCallback = React.useRef(callback);\r\n\r\n // Update ref to latest callback on every render to avoid stale closures\r\n React.useEffect(() => {\r\n savedCallback.current = callback;\r\n }, [callback]);\r\n\r\n React.useEffect(() => {\r\n // Don't schedule if delay is null\r\n if (delay === null) {\r\n return;\r\n }\r\n\r\n const intervalId = globalThis.setInterval(() => {\r\n savedCallback.current();\r\n }, delay);\r\n\r\n return () => {\r\n globalThis.clearInterval(intervalId);\r\n };\r\n }, [delay]);\r\n}\r\n"],"names":["useInterval","callback","delay","savedCallback","React","intervalId","globalThis"],"mappings":";;AAyDO,SAASA,YAAYC,QAAoB,EAAEC,KAAoB;IACpE,MAAMC,gBAAgBC,wBAAAA,MAAY,CAACH;IAGnCG,wBAAAA,SAAe,CAAC;QACdD,cAAc,OAAO,GAAGF;IAC1B,GAAG;QAACA;KAAS;IAEbG,wBAAAA,SAAe,CAAC;QAEd,IAAIF,AAAU,SAAVA,OACF;QAGF,MAAMG,aAAaC,WAAW,WAAW,CAAC;YACxCH,cAAc,OAAO;QACvB,GAAGD;QAEH,OAAO;YACLI,WAAW,aAAa,CAACD;QAC3B;IACF,GAAG;QAACH;KAAM;AACZ"}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
- import { useCallback, useEffect, useState } from "react";
2
+ import * as __rspack_external_react from "react";
3
3
  function useLocalStorage(key, initialValue) {
4
- const [storedValue, setStoredValue] = useState(()=>{
4
+ const [storedValue, setStoredValue] = __rspack_external_react.useState(()=>{
5
5
  if (void 0 === globalThis.window) return initialValue;
6
6
  try {
7
7
  const item = globalThis.window.localStorage.getItem(key);
@@ -11,7 +11,7 @@ function useLocalStorage(key, initialValue) {
11
11
  return initialValue;
12
12
  }
13
13
  });
14
- const setValue = useCallback((value)=>{
14
+ const setValue = __rspack_external_react.useCallback((value)=>{
15
15
  try {
16
16
  setStoredValue((currentValue)=>{
17
17
  const valueToStore = value instanceof Function ? value(currentValue) : value;
@@ -24,7 +24,7 @@ function useLocalStorage(key, initialValue) {
24
24
  }, [
25
25
  key
26
26
  ]);
27
- useEffect(()=>{
27
+ __rspack_external_react.useEffect(()=>{
28
28
  if (void 0 === globalThis.window) return;
29
29
  const handleStorageChange = (event)=>{
30
30
  if (event.key !== key || event.storageArea !== globalThis.window.localStorage) return;
@@ -1 +1 @@
1
- {"version":3,"file":"hooks/useLocalStorage.js","sources":["../../src/hooks/useLocalStorage.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Persists state to localStorage with SSR safety and JSON serialization.\r\n *\r\n * @remarks\r\n * This hook synchronizes state with localStorage, allowing data to persist\r\n * across page refreshes and browser sessions. It is SSR-safe and returns the\r\n * initial value on the server until hydration completes. The hook also syncs\r\n * state across tabs/windows via the `storage` event and handles JSON parse\r\n * errors gracefully by falling back to the initial value.\r\n *\r\n * @typeParam T - The type of the value being stored.\r\n * @param key - The localStorage key to store the value under.\r\n * @param initialValue - The default value to use if no value is found in localStorage.\r\n * @returns A tuple containing the current value and a setter function.\r\n *\r\n * @example\r\n * ```tsx\r\n * function UserSettings() {\r\n * const [theme, setTheme] = useLocalStorage(\"theme\", \"light\");\r\n *\r\n * return (\r\n * <button onClick={() => setTheme(theme === \"light\" ? \"dark\" : \"light\")}>\r\n * Toggle theme (current: {theme})\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function ShoppingCart() {\r\n * const [cart, setCart] = useLocalStorage<Product[]>(\"cart\", []);\r\n *\r\n * return (\r\n * <button onClick={() => setCart((prev) => [...prev, newProduct])}>\r\n * Add to cart ({cart.length} items)\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void] {\r\n const [storedValue, setStoredValue] = React.useState<T>(() => {\r\n // SSR safety: return initial value on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return initialValue;\r\n }\r\n\r\n try {\r\n const item = globalThis.window.localStorage.getItem(key);\r\n\r\n return item !== null ? (JSON.parse(item) as T) : initialValue;\r\n } catch (error) {\r\n console.error(`Error reading localStorage key \"${key}\":`, error);\r\n\r\n return initialValue;\r\n }\r\n });\r\n\r\n const setValue = React.useCallback(\r\n (value: T | ((prev: T) => T)) => {\r\n try {\r\n setStoredValue((currentValue) => {\r\n const valueToStore = value instanceof Function ? value(currentValue) : value;\r\n\r\n if (typeof globalThis.window !== \"undefined\") {\r\n globalThis.window.localStorage.setItem(key, JSON.stringify(valueToStore));\r\n }\r\n\r\n return valueToStore;\r\n });\r\n } catch (error) {\r\n console.error(`Error setting localStorage key \"${key}\":`, error);\r\n }\r\n },\r\n [key],\r\n );\r\n\r\n React.useEffect(() => {\r\n // SSR safety: window is not available on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return;\r\n }\r\n\r\n const handleStorageChange = (event: StorageEvent) => {\r\n if (event.key !== key || event.storageArea !== globalThis.window.localStorage) {\r\n return;\r\n }\r\n\r\n try {\r\n const newValue = event.newValue !== null ? (JSON.parse(event.newValue) as T) : initialValue;\r\n\r\n setStoredValue(newValue);\r\n } catch (error) {\r\n console.error(`Error parsing storage event for key \"${key}\":`, error);\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"storage\", handleStorageChange);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"storage\", handleStorageChange);\r\n };\r\n }, [key, initialValue]);\r\n\r\n return [storedValue, setValue];\r\n}\r\n"],"names":["useLocalStorage","key","initialValue","storedValue","setStoredValue","React","globalThis","item","JSON","error","console","setValue","value","currentValue","valueToStore","Function","handleStorageChange","event","newValue"],"mappings":";;AA6CO,SAASA,gBAAmBC,GAAW,EAAEC,YAAe;IAC7D,MAAM,CAACC,aAAaC,eAAe,GAAGC,SAAkB;QAEtD,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B,OAAOJ;QAGT,IAAI;YACF,MAAMK,OAAOD,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL;YAEpD,OAAOM,AAAS,SAATA,OAAiBC,KAAK,KAAK,CAACD,QAAcL;QACnD,EAAE,OAAOO,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YAE1D,OAAOP;QACT;IACF;IAEA,MAAMS,WAAWN,YACf,CAACO;QACC,IAAI;YACFR,eAAe,CAACS;gBACd,MAAMC,eAAeF,iBAAiBG,WAAWH,MAAMC,gBAAgBD;gBAEvE,IAAI,AAA6B,WAAtBN,WAAW,MAAM,EAC1BA,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL,KAAKO,KAAK,SAAS,CAACM;gBAG7D,OAAOA;YACT;QACF,EAAE,OAAOL,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;QAC5D;IACF,GACA;QAACR;KAAI;IAGPI,UAAgB;QAEd,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B;QAGF,MAAMU,sBAAsB,CAACC;YAC3B,IAAIA,MAAM,GAAG,KAAKhB,OAAOgB,MAAM,WAAW,KAAKX,WAAW,MAAM,CAAC,YAAY,EAC3E;YAGF,IAAI;gBACF,MAAMY,WAAWD,AAAmB,SAAnBA,MAAM,QAAQ,GAAaT,KAAK,KAAK,CAACS,MAAM,QAAQ,IAAUf;gBAE/EE,eAAec;YACjB,EAAE,OAAOT,OAAO;gBACdC,QAAQ,KAAK,CAAC,CAAC,qCAAqC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YACjE;QACF;QAEAH,WAAW,MAAM,CAAC,gBAAgB,CAAC,WAAWU;QAE9C,OAAO;YACLV,WAAW,MAAM,CAAC,mBAAmB,CAAC,WAAWU;QACnD;IACF,GAAG;QAACf;QAAKC;KAAa;IAEtB,OAAO;QAACC;QAAaQ;KAAS;AAChC"}
1
+ {"version":3,"file":"hooks/useLocalStorage.js","sources":["../../src/hooks/useLocalStorage.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport * as React from \"react\";\r\n\r\n/**\r\n * Persists state to localStorage with SSR safety and JSON serialization.\r\n *\r\n * @remarks\r\n * This hook synchronizes state with localStorage, allowing data to persist\r\n * across page refreshes and browser sessions. It is SSR-safe and returns the\r\n * initial value on the server until hydration completes. The hook also syncs\r\n * state across tabs/windows via the `storage` event and handles JSON parse\r\n * errors gracefully by falling back to the initial value.\r\n *\r\n * @typeParam T - The type of the value being stored.\r\n * @param key - The localStorage key to store the value under.\r\n * @param initialValue - The default value to use if no value is found in localStorage.\r\n * @returns A tuple containing the current value and a setter function.\r\n *\r\n * @example\r\n * ```tsx\r\n * function UserSettings() {\r\n * const [theme, setTheme] = useLocalStorage(\"theme\", \"light\");\r\n *\r\n * return (\r\n * <button onClick={() => setTheme(theme === \"light\" ? \"dark\" : \"light\")}>\r\n * Toggle theme (current: {theme})\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n *\r\n * @example\r\n * ```tsx\r\n * function ShoppingCart() {\r\n * const [cart, setCart] = useLocalStorage<Product[]>(\"cart\", []);\r\n *\r\n * return (\r\n * <button onClick={() => setCart((prev) => [...prev, newProduct])}>\r\n * Add to cart ({cart.length} items)\r\n * </button>\r\n * );\r\n * }\r\n * ```\r\n */\r\nexport function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void] {\r\n const [storedValue, setStoredValue] = React.useState<T>(() => {\r\n // SSR safety: return initial value on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return initialValue;\r\n }\r\n\r\n try {\r\n const item = globalThis.window.localStorage.getItem(key);\r\n\r\n return item !== null ? (JSON.parse(item) as T) : initialValue;\r\n } catch (error) {\r\n console.error(`Error reading localStorage key \"${key}\":`, error);\r\n\r\n return initialValue;\r\n }\r\n });\r\n\r\n const setValue = React.useCallback(\r\n (value: T | ((prev: T) => T)) => {\r\n try {\r\n setStoredValue((currentValue) => {\r\n const valueToStore = value instanceof Function ? value(currentValue) : value;\r\n\r\n if (typeof globalThis.window !== \"undefined\") {\r\n globalThis.window.localStorage.setItem(key, JSON.stringify(valueToStore));\r\n }\r\n\r\n return valueToStore;\r\n });\r\n } catch (error) {\r\n console.error(`Error setting localStorage key \"${key}\":`, error);\r\n }\r\n },\r\n [key],\r\n );\r\n\r\n React.useEffect(() => {\r\n // SSR safety: window is not available on server\r\n if (typeof globalThis.window === \"undefined\") {\r\n return;\r\n }\r\n\r\n const handleStorageChange = (event: StorageEvent) => {\r\n if (event.key !== key || event.storageArea !== globalThis.window.localStorage) {\r\n return;\r\n }\r\n\r\n try {\r\n const newValue = event.newValue !== null ? (JSON.parse(event.newValue) as T) : initialValue;\r\n\r\n setStoredValue(newValue);\r\n } catch (error) {\r\n console.error(`Error parsing storage event for key \"${key}\":`, error);\r\n }\r\n };\r\n\r\n globalThis.window.addEventListener(\"storage\", handleStorageChange);\r\n\r\n return () => {\r\n globalThis.window.removeEventListener(\"storage\", handleStorageChange);\r\n };\r\n }, [key, initialValue]);\r\n\r\n return [storedValue, setValue];\r\n}\r\n"],"names":["useLocalStorage","key","initialValue","storedValue","setStoredValue","React","globalThis","item","JSON","error","console","setValue","value","currentValue","valueToStore","Function","handleStorageChange","event","newValue"],"mappings":";;AA6CO,SAASA,gBAAmBC,GAAW,EAAEC,YAAe;IAC7D,MAAM,CAACC,aAAaC,eAAe,GAAGC,wBAAAA,QAAc,CAAI;QAEtD,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B,OAAOJ;QAGT,IAAI;YACF,MAAMK,OAAOD,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL;YAEpD,OAAOM,AAAS,SAATA,OAAiBC,KAAK,KAAK,CAACD,QAAcL;QACnD,EAAE,OAAOO,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YAE1D,OAAOP;QACT;IACF;IAEA,MAAMS,WAAWN,wBAAAA,WAAiB,CAChC,CAACO;QACC,IAAI;YACFR,eAAe,CAACS;gBACd,MAAMC,eAAeF,iBAAiBG,WAAWH,MAAMC,gBAAgBD;gBAEvE,IAAI,AAA6B,WAAtBN,WAAW,MAAM,EAC1BA,WAAW,MAAM,CAAC,YAAY,CAAC,OAAO,CAACL,KAAKO,KAAK,SAAS,CAACM;gBAG7D,OAAOA;YACT;QACF,EAAE,OAAOL,OAAO;YACdC,QAAQ,KAAK,CAAC,CAAC,gCAAgC,EAAET,IAAI,EAAE,CAAC,EAAEQ;QAC5D;IACF,GACA;QAACR;KAAI;IAGPI,wBAAAA,SAAe,CAAC;QAEd,IAAI,AAA6B,WAAtBC,WAAW,MAAM,EAC1B;QAGF,MAAMU,sBAAsB,CAACC;YAC3B,IAAIA,MAAM,GAAG,KAAKhB,OAAOgB,MAAM,WAAW,KAAKX,WAAW,MAAM,CAAC,YAAY,EAC3E;YAGF,IAAI;gBACF,MAAMY,WAAWD,AAAmB,SAAnBA,MAAM,QAAQ,GAAaT,KAAK,KAAK,CAACS,MAAM,QAAQ,IAAUf;gBAE/EE,eAAec;YACjB,EAAE,OAAOT,OAAO;gBACdC,QAAQ,KAAK,CAAC,CAAC,qCAAqC,EAAET,IAAI,EAAE,CAAC,EAAEQ;YACjE;QACF;QAEAH,WAAW,MAAM,CAAC,gBAAgB,CAAC,WAAWU;QAE9C,OAAO;YACLV,WAAW,MAAM,CAAC,mBAAmB,CAAC,WAAWU;QACnD;IACF,GAAG;QAACf;QAAKC;KAAa;IAEtB,OAAO;QAACC;QAAaQ;KAAS;AAChC"}