@arolariu/components 0.1.2 → 0.2.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 (323) hide show
  1. package/DEBUGGING.md +396 -396
  2. package/LICENSE.md +21 -21
  3. package/changelog.md +109 -118
  4. package/dist/components/ui/accordion.d.ts +2 -2
  5. package/dist/components/ui/accordion.d.ts.map +1 -1
  6. package/dist/components/ui/accordion.js +4 -4
  7. package/dist/components/ui/accordion.js.map +1 -1
  8. package/dist/components/ui/alert-dialog.d.ts +13 -13
  9. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  10. package/dist/components/ui/alert-dialog.js +4 -4
  11. package/dist/components/ui/alert-dialog.js.map +1 -1
  12. package/dist/components/ui/alert.d.ts +5 -5
  13. package/dist/components/ui/alert.d.ts.map +1 -1
  14. package/dist/components/ui/alert.js +3 -3
  15. package/dist/components/ui/alert.js.map +1 -1
  16. package/dist/components/ui/aspect-ratio.d.ts +1 -1
  17. package/dist/components/ui/aspect-ratio.d.ts.map +1 -1
  18. package/dist/components/ui/aspect-ratio.js +1 -1
  19. package/dist/components/ui/aspect-ratio.js.map +1 -1
  20. package/dist/components/ui/avatar.d.ts +2 -2
  21. package/dist/components/ui/avatar.d.ts.map +1 -1
  22. package/dist/components/ui/avatar.js +3 -3
  23. package/dist/components/ui/avatar.js.map +1 -1
  24. package/dist/components/ui/background-beams.d.ts.map +1 -1
  25. package/dist/components/ui/background-beams.js +6 -6
  26. package/dist/components/ui/background-beams.js.map +1 -1
  27. package/dist/components/ui/badge.d.ts +4 -4
  28. package/dist/components/ui/badge.d.ts.map +1 -1
  29. package/dist/components/ui/badge.js +2 -2
  30. package/dist/components/ui/badge.js.map +1 -1
  31. package/dist/components/ui/breadcrumb.d.ts +6 -6
  32. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  33. package/dist/components/ui/breadcrumb.js +5 -5
  34. package/dist/components/ui/breadcrumb.js.map +1 -1
  35. package/dist/components/ui/bubble-background.d.ts +1 -1
  36. package/dist/components/ui/bubble-background.d.ts.map +1 -1
  37. package/dist/components/ui/bubble-background.js +13 -13
  38. package/dist/components/ui/bubble-background.js.map +1 -1
  39. package/dist/components/ui/button.d.ts +5 -5
  40. package/dist/components/ui/button.d.ts.map +1 -1
  41. package/dist/components/ui/button.js +2 -2
  42. package/dist/components/ui/button.js.map +1 -1
  43. package/dist/components/ui/calendar.d.ts.map +1 -1
  44. package/dist/components/ui/calendar.js +4 -4
  45. package/dist/components/ui/calendar.js.map +1 -1
  46. package/dist/components/ui/card.d.ts +1 -1
  47. package/dist/components/ui/card.d.ts.map +1 -1
  48. package/dist/components/ui/card.js +3 -3
  49. package/dist/components/ui/card.js.map +1 -1
  50. package/dist/components/ui/carousel.d.ts +2 -2
  51. package/dist/components/ui/carousel.d.ts.map +1 -1
  52. package/dist/components/ui/carousel.js +3 -3
  53. package/dist/components/ui/carousel.js.map +1 -1
  54. package/dist/components/ui/chart.d.ts +4 -4
  55. package/dist/components/ui/chart.d.ts.map +1 -1
  56. package/dist/components/ui/chart.js +1 -1
  57. package/dist/components/ui/chart.js.map +1 -1
  58. package/dist/components/ui/checkbox.d.ts +1 -1
  59. package/dist/components/ui/checkbox.d.ts.map +1 -1
  60. package/dist/components/ui/checkbox.js +3 -3
  61. package/dist/components/ui/checkbox.js.map +1 -1
  62. package/dist/components/ui/collapsible.d.ts +2 -2
  63. package/dist/components/ui/collapsible.d.ts.map +1 -1
  64. package/dist/components/ui/collapsible.js +1 -1
  65. package/dist/components/ui/collapsible.js.map +1 -1
  66. package/dist/components/ui/command.d.ts +2 -2
  67. package/dist/components/ui/command.d.ts.map +1 -1
  68. package/dist/components/ui/command.js +9 -9
  69. package/dist/components/ui/command.js.map +1 -1
  70. package/dist/components/ui/context-menu.d.ts +2 -2
  71. package/dist/components/ui/context-menu.d.ts.map +1 -1
  72. package/dist/components/ui/context-menu.js +11 -11
  73. package/dist/components/ui/context-menu.js.map +1 -1
  74. package/dist/components/ui/counting-number.d.ts +1 -1
  75. package/dist/components/ui/counting-number.d.ts.map +1 -1
  76. package/dist/components/ui/counting-number.js +4 -3
  77. package/dist/components/ui/counting-number.js.map +1 -1
  78. package/dist/components/ui/dialog.d.ts +1 -1
  79. package/dist/components/ui/dialog.d.ts.map +1 -1
  80. package/dist/components/ui/dialog.js +6 -6
  81. package/dist/components/ui/dialog.js.map +1 -1
  82. package/dist/components/ui/dot-background.d.ts +10 -17
  83. package/dist/components/ui/dot-background.d.ts.map +1 -1
  84. package/dist/components/ui/dot-background.js +2 -2
  85. package/dist/components/ui/dot-background.js.map +1 -1
  86. package/dist/components/ui/drawer.d.ts +1 -1
  87. package/dist/components/ui/drawer.d.ts.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/dropdown-menu.d.ts +2 -2
  91. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  92. package/dist/components/ui/dropdown-menu.js +10 -10
  93. package/dist/components/ui/dropdown-menu.js.map +1 -1
  94. package/dist/components/ui/dropdrawer.d.ts +2 -2
  95. package/dist/components/ui/dropdrawer.d.ts.map +1 -1
  96. package/dist/components/ui/dropdrawer.js +12 -12
  97. package/dist/components/ui/dropdrawer.js.map +1 -1
  98. package/dist/components/ui/fireworks-background.d.ts.map +1 -1
  99. package/dist/components/ui/fireworks-background.js +1 -1
  100. package/dist/components/ui/fireworks-background.js.map +1 -1
  101. package/dist/components/ui/flip-button.d.ts +1 -1
  102. package/dist/components/ui/flip-button.d.ts.map +1 -1
  103. package/dist/components/ui/flip-button.js +3 -3
  104. package/dist/components/ui/flip-button.js.map +1 -1
  105. package/dist/components/ui/form.d.ts +3 -3
  106. package/dist/components/ui/form.d.ts.map +1 -1
  107. package/dist/components/ui/form.js +4 -4
  108. package/dist/components/ui/form.js.map +1 -1
  109. package/dist/components/ui/gradient-background.d.ts +1 -1
  110. package/dist/components/ui/gradient-background.d.ts.map +1 -1
  111. package/dist/components/ui/gradient-background.js +2 -2
  112. package/dist/components/ui/gradient-background.js.map +1 -1
  113. package/dist/components/ui/gradient-text.d.ts +1 -1
  114. package/dist/components/ui/gradient-text.d.ts.map +1 -1
  115. package/dist/components/ui/gradient-text.js +5 -5
  116. package/dist/components/ui/gradient-text.js.map +1 -1
  117. package/dist/components/ui/highlight-text.d.ts +1 -1
  118. package/dist/components/ui/highlight-text.d.ts.map +1 -1
  119. package/dist/components/ui/highlight-text.js +3 -3
  120. package/dist/components/ui/highlight-text.js.map +1 -1
  121. package/dist/components/ui/hole-background.d.ts.map +1 -1
  122. package/dist/components/ui/hole-background.js +11 -10
  123. package/dist/components/ui/hole-background.js.map +1 -1
  124. package/dist/components/ui/hover-card.d.ts +2 -2
  125. package/dist/components/ui/hover-card.d.ts.map +1 -1
  126. package/dist/components/ui/hover-card.js +3 -3
  127. package/dist/components/ui/hover-card.js.map +1 -1
  128. package/dist/components/ui/input-otp.d.ts +2 -2
  129. package/dist/components/ui/input-otp.d.ts.map +1 -1
  130. package/dist/components/ui/input-otp.js +5 -5
  131. package/dist/components/ui/input-otp.js.map +1 -1
  132. package/dist/components/ui/input.d.ts.map +1 -1
  133. package/dist/components/ui/input.js +2 -2
  134. package/dist/components/ui/input.js.map +1 -1
  135. package/dist/components/ui/label.d.ts +1 -1
  136. package/dist/components/ui/label.d.ts.map +1 -1
  137. package/dist/components/ui/label.js +2 -2
  138. package/dist/components/ui/label.js.map +1 -1
  139. package/dist/components/ui/menubar.d.ts +2 -2
  140. package/dist/components/ui/menubar.d.ts.map +1 -1
  141. package/dist/components/ui/menubar.js +12 -12
  142. package/dist/components/ui/menubar.js.map +1 -1
  143. package/dist/components/ui/navigation-menu.d.ts +3 -3
  144. package/dist/components/ui/navigation-menu.d.ts.map +1 -1
  145. package/dist/components/ui/navigation-menu.js +6 -7
  146. package/dist/components/ui/navigation-menu.js.map +1 -1
  147. package/dist/components/ui/pagination.d.ts +2 -2
  148. package/dist/components/ui/pagination.d.ts.map +1 -1
  149. package/dist/components/ui/pagination.js +8 -4
  150. package/dist/components/ui/pagination.js.map +1 -1
  151. package/dist/components/ui/popover.d.ts +2 -2
  152. package/dist/components/ui/popover.d.ts.map +1 -1
  153. package/dist/components/ui/popover.js +3 -3
  154. package/dist/components/ui/popover.js.map +1 -1
  155. package/dist/components/ui/progress.d.ts +1 -1
  156. package/dist/components/ui/progress.d.ts.map +1 -1
  157. package/dist/components/ui/progress.js +4 -4
  158. package/dist/components/ui/progress.js.map +1 -1
  159. package/dist/components/ui/radio-group.d.ts +1 -1
  160. package/dist/components/ui/radio-group.d.ts.map +1 -1
  161. package/dist/components/ui/radio-group.js +3 -3
  162. package/dist/components/ui/radio-group.js.map +1 -1
  163. package/dist/components/ui/resizable.d.ts +1 -1
  164. package/dist/components/ui/resizable.d.ts.map +1 -1
  165. package/dist/components/ui/resizable.js +5 -5
  166. package/dist/components/ui/resizable.js.map +1 -1
  167. package/dist/components/ui/ripple-button.d.ts +1 -1
  168. package/dist/components/ui/ripple-button.d.ts.map +1 -1
  169. package/dist/components/ui/ripple-button.js +4 -4
  170. package/dist/components/ui/ripple-button.js.map +1 -1
  171. package/dist/components/ui/scratcher.d.ts.map +1 -1
  172. package/dist/components/ui/scratcher.js +7 -5
  173. package/dist/components/ui/scratcher.js.map +1 -1
  174. package/dist/components/ui/scroll-area.d.ts +1 -1
  175. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  176. package/dist/components/ui/scroll-area.js +4 -4
  177. package/dist/components/ui/scroll-area.js.map +1 -1
  178. package/dist/components/ui/select.d.ts +1 -1
  179. package/dist/components/ui/select.d.ts.map +1 -1
  180. package/dist/components/ui/select.js +7 -7
  181. package/dist/components/ui/select.js.map +1 -1
  182. package/dist/components/ui/separator.d.ts +1 -1
  183. package/dist/components/ui/separator.d.ts.map +1 -1
  184. package/dist/components/ui/separator.js +3 -3
  185. package/dist/components/ui/separator.js.map +1 -1
  186. package/dist/components/ui/sheet.d.ts +2 -2
  187. package/dist/components/ui/sheet.d.ts.map +1 -1
  188. package/dist/components/ui/sheet.js +6 -6
  189. package/dist/components/ui/sheet.js.map +1 -1
  190. package/dist/components/ui/sidebar.d.ts +5 -5
  191. package/dist/components/ui/sidebar.d.ts.map +1 -1
  192. package/dist/components/ui/sidebar.js +5 -5
  193. package/dist/components/ui/sidebar.js.map +1 -1
  194. package/dist/components/ui/skeleton.d.ts.map +1 -1
  195. package/dist/components/ui/skeleton.js +2 -2
  196. package/dist/components/ui/skeleton.js.map +1 -1
  197. package/dist/components/ui/slider.d.ts +1 -1
  198. package/dist/components/ui/slider.d.ts.map +1 -1
  199. package/dist/components/ui/slider.js +5 -5
  200. package/dist/components/ui/slider.js.map +1 -1
  201. package/dist/components/ui/sonner.d.ts +1 -1
  202. package/dist/components/ui/sonner.d.ts.map +1 -1
  203. package/dist/components/ui/sonner.js +1 -1
  204. package/dist/components/ui/sonner.js.map +1 -1
  205. package/dist/components/ui/switch.d.ts +1 -1
  206. package/dist/components/ui/switch.d.ts.map +1 -1
  207. package/dist/components/ui/switch.js +4 -4
  208. package/dist/components/ui/switch.js.map +1 -1
  209. package/dist/components/ui/table.d.ts +1 -1
  210. package/dist/components/ui/table.d.ts.map +1 -1
  211. package/dist/components/ui/table.js +5 -5
  212. package/dist/components/ui/table.js.map +1 -1
  213. package/dist/components/ui/tabs.d.ts +2 -2
  214. package/dist/components/ui/tabs.d.ts.map +1 -1
  215. package/dist/components/ui/tabs.js +4 -4
  216. package/dist/components/ui/tabs.js.map +1 -1
  217. package/dist/components/ui/textarea.d.ts +1 -1
  218. package/dist/components/ui/textarea.d.ts.map +1 -1
  219. package/dist/components/ui/textarea.js +2 -2
  220. package/dist/components/ui/textarea.js.map +1 -1
  221. package/dist/components/ui/toggle-group.d.ts +3 -3
  222. package/dist/components/ui/toggle-group.d.ts.map +1 -1
  223. package/dist/components/ui/toggle-group.js +2 -2
  224. package/dist/components/ui/toggle-group.js.map +1 -1
  225. package/dist/components/ui/toggle.d.ts +6 -6
  226. package/dist/components/ui/toggle.d.ts.map +1 -1
  227. package/dist/components/ui/toggle.js +2 -2
  228. package/dist/components/ui/toggle.js.map +1 -1
  229. package/dist/components/ui/tooltip.d.ts +6 -6
  230. package/dist/components/ui/tooltip.d.ts.map +1 -1
  231. package/dist/components/ui/tooltip.js +4 -4
  232. package/dist/components/ui/tooltip.js.map +1 -1
  233. package/dist/components/ui/typewriter.d.ts.map +1 -1
  234. package/dist/components/ui/typewriter.js +15 -11
  235. package/dist/components/ui/typewriter.js.map +1 -1
  236. package/dist/hooks/useIsMobile.d.ts +2 -5
  237. package/dist/hooks/useIsMobile.d.ts.map +1 -1
  238. package/dist/hooks/useIsMobile.js +1 -1
  239. package/dist/hooks/useIsMobile.js.map +1 -1
  240. package/dist/hooks/useWindowSize.d.ts +0 -1
  241. package/dist/hooks/useWindowSize.d.ts.map +1 -1
  242. package/dist/hooks/useWindowSize.js +1 -1
  243. package/dist/hooks/useWindowSize.js.map +1 -1
  244. package/dist/index.css +2 -2
  245. package/dist/index.css.map +1 -1
  246. package/dist/index.d.ts +37 -37
  247. package/dist/index.d.ts.map +1 -1
  248. package/dist/index.js +2 -2
  249. package/dist/lib/utilities.d.ts +9 -0
  250. package/dist/lib/utilities.d.ts.map +1 -0
  251. package/dist/lib/{utils.js → utilities.js} +1 -1
  252. package/dist/lib/utilities.js.map +1 -0
  253. package/package.json +85 -89
  254. package/{README.md → readme.md} +627 -627
  255. package/src/components/ui/accordion.tsx +56 -66
  256. package/src/components/ui/alert-dialog.tsx +135 -160
  257. package/src/components/ui/alert.tsx +58 -69
  258. package/src/components/ui/aspect-ratio.tsx +15 -12
  259. package/src/components/ui/avatar.tsx +38 -53
  260. package/src/components/ui/background-beams.tsx +145 -142
  261. package/src/components/ui/badge.tsx +47 -48
  262. package/src/components/ui/breadcrumb.tsx +97 -117
  263. package/src/components/ui/bubble-background.tsx +170 -189
  264. package/src/components/ui/button.tsx +61 -61
  265. package/src/components/ui/calendar.tsx +177 -216
  266. package/src/components/ui/card.tsx +83 -97
  267. package/src/components/ui/carousel.tsx +204 -241
  268. package/src/components/ui/chart.tsx +303 -385
  269. package/src/components/ui/checkbox.tsx +27 -32
  270. package/src/components/ui/collapsible.tsx +33 -34
  271. package/src/components/ui/command.tsx +137 -184
  272. package/src/components/ui/context-menu.tsx +229 -255
  273. package/src/components/ui/counting-number.tsx +92 -108
  274. package/src/components/ui/dialog.tsx +141 -146
  275. package/src/components/ui/dot-background.tsx +153 -158
  276. package/src/components/ui/drawer.tsx +133 -141
  277. package/src/components/ui/dropdown-menu.tsx +235 -260
  278. package/src/components/ui/dropdrawer.tsx +870 -973
  279. package/src/components/ui/fireworks-background.tsx +325 -378
  280. package/src/components/ui/flip-button.tsx +89 -110
  281. package/src/components/ui/form.tsx +145 -174
  282. package/src/components/ui/gradient-background.tsx +30 -43
  283. package/src/components/ui/gradient-text.tsx +62 -65
  284. package/src/components/ui/highlight-text.tsx +54 -71
  285. package/src/components/ui/hole-background.tsx +326 -361
  286. package/src/components/ui/hover-card.tsx +48 -44
  287. package/src/components/ui/input-otp.tsx +76 -77
  288. package/src/components/ui/input.tsx +22 -22
  289. package/src/components/ui/label.tsx +21 -24
  290. package/src/components/ui/menubar.tsx +256 -279
  291. package/src/components/ui/navigation-menu.tsx +135 -171
  292. package/src/components/ui/pagination.tsx +103 -129
  293. package/src/components/ui/popover.tsx +52 -48
  294. package/src/components/ui/progress.tsx +23 -31
  295. package/src/components/ui/radio-group.tsx +37 -45
  296. package/src/components/ui/resizable.tsx +52 -56
  297. package/src/components/ui/ripple-button.tsx +90 -111
  298. package/src/components/ui/scratcher.tsx +167 -171
  299. package/src/components/ui/scroll-area.tsx +45 -58
  300. package/src/components/ui/select.tsx +160 -191
  301. package/src/components/ui/separator.tsx +28 -28
  302. package/src/components/ui/sheet.tsx +133 -145
  303. package/src/components/ui/sidebar.tsx +673 -729
  304. package/src/components/ui/skeleton.tsx +16 -19
  305. package/src/components/ui/slider.tsx +49 -63
  306. package/src/components/ui/sonner.tsx +30 -26
  307. package/src/components/ui/switch.tsx +27 -31
  308. package/src/components/ui/table.tsx +98 -119
  309. package/src/components/ui/tabs.tsx +54 -66
  310. package/src/components/ui/textarea.tsx +20 -20
  311. package/src/components/ui/toggle-group.tsx +66 -73
  312. package/src/components/ui/toggle.tsx +46 -47
  313. package/src/components/ui/tooltip.tsx +56 -61
  314. package/src/components/ui/typewriter.tsx +174 -188
  315. package/src/hooks/useIsMobile.tsx +42 -45
  316. package/src/hooks/useWindowSize.tsx +66 -72
  317. package/src/index.css +73 -73
  318. package/src/index.ts +303 -408
  319. package/src/lib/utilities.ts +12 -0
  320. package/dist/lib/utils.d.ts +0 -7
  321. package/dist/lib/utils.d.ts.map +0 -1
  322. package/dist/lib/utils.js.map +0 -1
  323. package/src/lib/utils.ts +0 -10
package/DEBUGGING.md CHANGED
@@ -1,396 +1,396 @@
1
- # 🔍 Debugging Guide for @arolariu/components
2
-
3
- This guide provides comprehensive information on debugging and troubleshooting the `@arolariu/components` package in your projects.
4
-
5
- ## 📋 Table of Contents
6
-
7
- - [Source Maps](#source-maps)
8
- - [TypeScript Support](#typescript-support)
9
- - [Browser DevTools Setup](#browser-devtools-setup)
10
- - [IDE Configuration](#ide-configuration)
11
- - [Common Issues](#common-issues)
12
- - [Performance Debugging](#performance-debugging)
13
- - [Component Introspection](#component-introspection)
14
- - [Build Analysis](#build-analysis)
15
-
16
- ## 🗺️ Source Maps
17
-
18
- All distribution files include source maps for optimal debugging experience:
19
-
20
- ### JavaScript Source Maps
21
-
22
- ```
23
- dist/
24
- ├── button.js
25
- ├── button.js.map ✅ ESM source map
26
- └── ...
27
- ```
28
-
29
- ### Benefits
30
-
31
- - **Accurate stack traces** pointing to original TypeScript source
32
- - **Breakpoint debugging** in original source files
33
- - **CSS debugging** with original Tailwind source locations
34
- - **Better error messages** with precise line numbers
35
-
36
- ## 📝 TypeScript Support
37
-
38
- ### Declaration Files
39
-
40
- Every component includes comprehensive TypeScript declarations:
41
-
42
- ```
43
- dist/types/
44
- ├── button.d.ts ✅ Type definitions
45
- ├── card.d.ts ✅ Component props
46
- ├── form.d.ts ✅ Form utilities
47
- └── ...
48
- ```
49
-
50
- ### Source Access
51
-
52
- Original TypeScript source is included for reference:
53
-
54
- ```
55
- src/
56
- ├── components/ui/
57
- │ ├── button.tsx ✅ Original source
58
- │ ├── card.tsx ✅ Implementation details
59
- │ └── ...
60
- ├── hooks/
61
- │ ├── use-mobile.ts ✅ Custom hooks
62
- │ └── ...
63
- └── lib/
64
- ├── utils.ts ✅ Utility functions
65
- └── ...
66
- ```
67
-
68
- ## 🌐 Browser DevTools Setup
69
-
70
- ### Chrome DevTools
71
-
72
- 1. Open DevTools (F12)
73
- 2. Go to **Settings** (⚙️)
74
- 3. Navigate to **Preferences** → **Sources**
75
- 4. Enable **"Enable JavaScript source maps"**
76
- 5. Enable **"Enable CSS source maps"**
77
-
78
- ### Firefox DevTools
79
-
80
- 1. Open DevTools (F12)
81
- 2. Go to **Settings** (⚙️)
82
- 3. Navigate to **Advanced Settings**
83
- 4. Check **"Enable Source Maps"**
84
-
85
- ### Safari DevTools
86
-
87
- 1. Open Web Inspector (⌘⌥I)
88
- 2. Go to **Web Inspector** → **Preferences**
89
- 3. Navigate to **Sources**
90
- 4. Enable **"Enable source maps"**
91
-
92
- ## 🛠️ IDE Configuration
93
-
94
- ### VS Code Setup
95
-
96
- #### Launch Configuration
97
-
98
- Create `.vscode/launch.json`:
99
-
100
- ```json
101
- {
102
- "version": "0.2.0",
103
- "configurations": [
104
- {
105
- "type": "chrome",
106
- "request": "launch",
107
- "name": "Debug React App",
108
- "url": "http://localhost:3000",
109
- "webRoot": "${workspaceFolder}/src",
110
- "sourceMapPathOverrides": {
111
- "*": "${webRoot}/*",
112
- "webpack:///src/*": "${webRoot}/*",
113
- "webpack:///./*": "${webRoot}/*",
114
- "webpack:///./~/*": "${webRoot}/node_modules/*",
115
- "node_modules/@arolariu/components/src/*": "${webRoot}/node_modules/@arolariu/components/src/*"
116
- },
117
- "skipFiles": ["<node_internals>/**"]
118
- }
119
- ]
120
- }
121
- ```
122
-
123
- #### Recommended Extensions
124
-
125
- ```json
126
- // .vscode/extensions.json
127
- {
128
- "recommendations": [
129
- "ms-vscode.vscode-typescript-next",
130
- "bradlc.vscode-tailwindcss",
131
- "ms-vscode.vscode-json",
132
- "esbenp.prettier-vscode",
133
- "wix.vscode-import-cost"
134
- ]
135
- }
136
- ```
137
-
138
- ### JetBrains IDEs (WebStorm, IntelliJ)
139
-
140
- 1. Go to **Settings** → **Build, Execution, Deployment** → **Debugger**
141
- 2. Enable **"Use JavaScript source maps"**
142
- 3. Configure **Source Maps** section:
143
- - Check **"Process TypeScript files"**
144
- - Set source map search locations
145
-
146
- ## 🐛 Common Issues
147
-
148
- ### Issue: Components Not Rendering
149
-
150
- **Symptoms:**
151
-
152
- - Components appear as empty divs
153
- - No styling applied
154
- - TypeScript errors about missing props
155
-
156
- **Debugging Steps:**
157
-
158
- ```tsx
159
- // 1. Check component import
160
- import { Button } from "@arolariu/components/button";
161
-
162
- // 2. Verify component props
163
- <Button variant="default" size="md">
164
- Click me
165
- </Button>;
166
-
167
- // 3. Inspect with React DevTools
168
- // Look for component in React tree
169
- ```
170
-
171
- **Solution:**
172
-
173
- ```tsx
174
- // ✅ Correct import and usage
175
- import { Button } from "@arolariu/components/button";
176
-
177
- export function MyComponent() {
178
- return (
179
- <Button variant="default" onClick={() => console.log("Clicked!")}>
180
- My Button
181
- </Button>
182
- );
183
- }
184
- ```
185
-
186
- ### Issue: Styling Conflicts
187
-
188
- **Symptoms:**
189
-
190
- - Components look different than expected
191
- - CSS classes being overridden
192
- - Tailwind styles not applying
193
-
194
- **Debugging Steps:**
195
-
196
- 1. Open browser DevTools
197
- 2. Inspect component element
198
- 3. Check CSS cascade in **Styles** panel
199
- 4. Look for conflicting CSS rules
200
-
201
- **Solutions:**
202
-
203
- ```css
204
- /* Option 1: Use CSS specificity */
205
- .my-custom-button {
206
- @apply bg-blue-500 hover:bg-blue-600 !important;
207
- }
208
-
209
- /* Option 2: Use CSS layers */
210
- @layer components {
211
- .my-button-override {
212
- background-color: theme("colors.blue.500");
213
- }
214
- }
215
- ```
216
-
217
- ### Issue: TypeScript Errors
218
-
219
- **Symptoms:**
220
-
221
- - Red squiggly lines in IDE
222
- - Type checking failures
223
- - Missing prop definitions
224
-
225
- **Debugging Steps:**
226
-
227
- ```tsx
228
- // 1. Hover over component in IDE to see type info
229
- import { Button } from "@arolariu/components/button";
230
-
231
- // 2. Check available props
232
- const buttonProps: React.ComponentProps<typeof Button> = {
233
- variant: "default",
234
- size: "md",
235
- // ... other props
236
- };
237
-
238
- // 3. Use TypeScript utility types
239
- type ButtonVariant = React.ComponentProps<typeof Button>["variant"];
240
- ```
241
-
242
- ## ⚡ Performance Debugging
243
-
244
- ### Bundle Analysis
245
-
246
- #### Webpack Bundle Analyzer
247
-
248
- ```bash
249
- # Install analyzer
250
- npm install --save-dev webpack-bundle-analyzer
251
-
252
- # Analyze your bundle
253
- npx webpack-bundle-analyzer build/static/js/*.js
254
- ```
255
-
256
- #### Import Cost Analysis
257
-
258
- Install the "Import Cost" VS Code extension to see real-time import sizes:
259
-
260
- ```tsx
261
- import { Button } from "@arolariu/components/button"; // ~3.2KB
262
- import { Dialog } from "@arolariu/components/dialog"; // ~6.1KB
263
- import { Chart } from "@arolariu/components/chart"; // ~12.4KB
264
- ```
265
-
266
- ### Tree Shaking Verification
267
-
268
- ```tsx
269
- // ✅ Good: Tree-shakeable imports
270
- import { Button } from "@arolariu/components/button";
271
- import { Card } from "@arolariu/components/card";
272
-
273
- // ❌ Avoid: Imports entire library
274
- import { Button, Card } from "@arolariu/components";
275
- ```
276
-
277
- ### Performance Monitoring
278
-
279
- ```tsx
280
- import { Profiler } from "react";
281
- import { Button } from "@arolariu/components/button";
282
-
283
- function onRenderCallback(id, phase, actualDuration) {
284
- console.log(`${id} ${phase} took ${actualDuration}ms`);
285
- }
286
-
287
- function App() {
288
- return (
289
- <Profiler id="Button" onRender={onRenderCallback}>
290
- <Button>Click me</Button>
291
- </Profiler>
292
- );
293
- }
294
- ```
295
-
296
- ## 🔍 Component Introspection
297
-
298
- ### Component Metadata
299
-
300
- ```tsx
301
- import { Button } from "@arolariu/components/button";
302
-
303
- // Check component display name
304
- console.log(Button.displayName); // "Button"
305
-
306
- // Access default props (if any)
307
- console.log(Button.defaultProps);
308
-
309
- // Check if component is forwardRef
310
- console.log(Button.$$typeof); // Symbol(react.forward_ref)
311
- ```
312
-
313
- ### Variant Inspection
314
-
315
- ```tsx
316
- import { buttonVariants } from "@arolariu/components/button";
317
-
318
- // Inspect available variants
319
- console.log("Button variants:", {
320
- variant: Object.keys(buttonVariants.variants.variant),
321
- size: Object.keys(buttonVariants.variants.size),
322
- });
323
-
324
- // Get computed classes for specific variant
325
- const classes = buttonVariants({
326
- variant: "destructive",
327
- size: "lg",
328
- });
329
- console.log("Button classes:", classes);
330
- ```
331
-
332
- ### Props Validation
333
-
334
- ```tsx
335
- import { Button } from "@arolariu/components/button";
336
- import type { ButtonProps } from "@arolariu/components/button";
337
-
338
- // Create type-safe props object
339
- const buttonProps: ButtonProps = {
340
- variant: "default",
341
- size: "md",
342
- disabled: false,
343
- // TypeScript will validate these props
344
- };
345
-
346
- // Use props with component
347
- <Button {...buttonProps}>My Button</Button>;
348
- ```
349
-
350
- ## 📊 Build Analysis
351
-
352
- ### Development Build Analysis
353
-
354
- ```bash
355
- # Build with analysis
356
- npm run build -- --analyze
357
-
358
- # Or use webpack-bundle-analyzer directly
359
- npx webpack-bundle-analyzer build/static/js/*.js
360
- ```
361
-
362
- ### Production Optimization Check
363
-
364
- ```tsx
365
- // Check if components are properly optimized
366
- import { Button } from "@arolariu/components/button";
367
-
368
- // This should only include Button-related code
369
- // Use browser DevTools Network tab to verify
370
- ```
371
-
372
- ### Source Map Validation
373
-
374
- ```bash
375
- # Check if source maps are present
376
- ls node_modules/@arolariu/components/dist/**/*.map
377
-
378
- # Validate source map content
379
- cat node_modules/@arolariu/components/dist/esm/button.js.map
380
- ```
381
-
382
- ## 🆘 Getting Help
383
-
384
- If you encounter issues not covered in this guide:
385
-
386
- 1. **Check the source code**: Browse `node_modules/@arolariu/components/src/`
387
- 2. **Inspect the built files**: Look at `node_modules/@arolariu/components/dist/`
388
- 3. **Use browser DevTools**: Leverage source maps for debugging
389
- 4. **Create an issue**: [GitHub Issues](https://github.com/arolariu/arolariu.ro/issues)
390
-
391
- ## 📚 Additional Resources
392
-
393
- - [React DevTools](https://reactjs.org/blog/2019/08/15/new-react-devtools.html)
394
- - [Chrome DevTools Source Maps](https://developer.chrome.com/docs/devtools/javascript/source-maps/)
395
- - [TypeScript Debugging](https://code.visualstudio.com/docs/typescript/typescript-debugging)
396
- - [Webpack Bundle Analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer)
1
+ # 🔍 Debugging Guide for @arolariu/components
2
+
3
+ This guide provides comprehensive information on debugging and troubleshooting the `@arolariu/components` package in your projects.
4
+
5
+ ## 📋 Table of Contents
6
+
7
+ - [Source Maps](#source-maps)
8
+ - [TypeScript Support](#typescript-support)
9
+ - [Browser DevTools Setup](#browser-devtools-setup)
10
+ - [IDE Configuration](#ide-configuration)
11
+ - [Common Issues](#common-issues)
12
+ - [Performance Debugging](#performance-debugging)
13
+ - [Component Introspection](#component-introspection)
14
+ - [Build Analysis](#build-analysis)
15
+
16
+ ## 🗺️ Source Maps
17
+
18
+ All distribution files include source maps for optimal debugging experience:
19
+
20
+ ### JavaScript Source Maps
21
+
22
+ ```
23
+ dist/
24
+ ├── button.js
25
+ ├── button.js.map ✅ ESM source map
26
+ └── ...
27
+ ```
28
+
29
+ ### Benefits
30
+
31
+ - **Accurate stack traces** pointing to original TypeScript source
32
+ - **Breakpoint debugging** in original source files
33
+ - **CSS debugging** with original Tailwind source locations
34
+ - **Better error messages** with precise line numbers
35
+
36
+ ## 📝 TypeScript Support
37
+
38
+ ### Declaration Files
39
+
40
+ Every component includes comprehensive TypeScript declarations:
41
+
42
+ ```
43
+ dist/types/
44
+ ├── button.d.ts ✅ Type definitions
45
+ ├── card.d.ts ✅ Component props
46
+ ├── form.d.ts ✅ Form utilities
47
+ └── ...
48
+ ```
49
+
50
+ ### Source Access
51
+
52
+ Original TypeScript source is included for reference:
53
+
54
+ ```
55
+ src/
56
+ ├── components/ui/
57
+ │ ├── button.tsx ✅ Original source
58
+ │ ├── card.tsx ✅ Implementation details
59
+ │ └── ...
60
+ ├── hooks/
61
+ │ ├── use-mobile.ts ✅ Custom hooks
62
+ │ └── ...
63
+ └── lib/
64
+ ├── utils.ts ✅ Utility functions
65
+ └── ...
66
+ ```
67
+
68
+ ## 🌐 Browser DevTools Setup
69
+
70
+ ### Chrome DevTools
71
+
72
+ 1. Open DevTools (F12)
73
+ 2. Go to **Settings** (⚙️)
74
+ 3. Navigate to **Preferences** → **Sources**
75
+ 4. Enable **"Enable JavaScript source maps"**
76
+ 5. Enable **"Enable CSS source maps"**
77
+
78
+ ### Firefox DevTools
79
+
80
+ 1. Open DevTools (F12)
81
+ 2. Go to **Settings** (⚙️)
82
+ 3. Navigate to **Advanced Settings**
83
+ 4. Check **"Enable Source Maps"**
84
+
85
+ ### Safari DevTools
86
+
87
+ 1. Open Web Inspector (⌘⌥I)
88
+ 2. Go to **Web Inspector** → **Preferences**
89
+ 3. Navigate to **Sources**
90
+ 4. Enable **"Enable source maps"**
91
+
92
+ ## 🛠️ IDE Configuration
93
+
94
+ ### VS Code Setup
95
+
96
+ #### Launch Configuration
97
+
98
+ Create `.vscode/launch.json`:
99
+
100
+ ```json
101
+ {
102
+ "version": "0.2.0",
103
+ "configurations": [
104
+ {
105
+ "type": "chrome",
106
+ "request": "launch",
107
+ "name": "Debug React App",
108
+ "url": "http://localhost:3000",
109
+ "webRoot": "${workspaceFolder}/src",
110
+ "sourceMapPathOverrides": {
111
+ "*": "${webRoot}/*",
112
+ "webpack:///src/*": "${webRoot}/*",
113
+ "webpack:///./*": "${webRoot}/*",
114
+ "webpack:///./~/*": "${webRoot}/node_modules/*",
115
+ "node_modules/@arolariu/components/src/*": "${webRoot}/node_modules/@arolariu/components/src/*"
116
+ },
117
+ "skipFiles": ["<node_internals>/**"]
118
+ }
119
+ ]
120
+ }
121
+ ```
122
+
123
+ #### Recommended Extensions
124
+
125
+ ```json
126
+ // .vscode/extensions.json
127
+ {
128
+ "recommendations": [
129
+ "ms-vscode.vscode-typescript-next",
130
+ "bradlc.vscode-tailwindcss",
131
+ "ms-vscode.vscode-json",
132
+ "esbenp.prettier-vscode",
133
+ "wix.vscode-import-cost"
134
+ ]
135
+ }
136
+ ```
137
+
138
+ ### JetBrains IDEs (WebStorm, IntelliJ)
139
+
140
+ 1. Go to **Settings** → **Build, Execution, Deployment** → **Debugger**
141
+ 2. Enable **"Use JavaScript source maps"**
142
+ 3. Configure **Source Maps** section:
143
+ - Check **"Process TypeScript files"**
144
+ - Set source map search locations
145
+
146
+ ## 🐛 Common Issues
147
+
148
+ ### Issue: Components Not Rendering
149
+
150
+ **Symptoms:**
151
+
152
+ - Components appear as empty divs
153
+ - No styling applied
154
+ - TypeScript errors about missing props
155
+
156
+ **Debugging Steps:**
157
+
158
+ ```tsx
159
+ // 1. Check component import
160
+ import { Button } from "@arolariu/components/button";
161
+
162
+ // 2. Verify component props
163
+ <Button variant="default" size="md">
164
+ Click me
165
+ </Button>;
166
+
167
+ // 3. Inspect with React DevTools
168
+ // Look for component in React tree
169
+ ```
170
+
171
+ **Solution:**
172
+
173
+ ```tsx
174
+ // ✅ Correct import and usage
175
+ import { Button } from "@arolariu/components/button";
176
+
177
+ export function MyComponent() {
178
+ return (
179
+ <Button variant="default" onClick={() => console.log("Clicked!")}>
180
+ My Button
181
+ </Button>
182
+ );
183
+ }
184
+ ```
185
+
186
+ ### Issue: Styling Conflicts
187
+
188
+ **Symptoms:**
189
+
190
+ - Components look different than expected
191
+ - CSS classes being overridden
192
+ - Tailwind styles not applying
193
+
194
+ **Debugging Steps:**
195
+
196
+ 1. Open browser DevTools
197
+ 2. Inspect component element
198
+ 3. Check CSS cascade in **Styles** panel
199
+ 4. Look for conflicting CSS rules
200
+
201
+ **Solutions:**
202
+
203
+ ```css
204
+ /* Option 1: Use CSS specificity */
205
+ .my-custom-button {
206
+ @apply bg-blue-500 hover:bg-blue-600 !important;
207
+ }
208
+
209
+ /* Option 2: Use CSS layers */
210
+ @layer components {
211
+ .my-button-override {
212
+ background-color: theme("colors.blue.500");
213
+ }
214
+ }
215
+ ```
216
+
217
+ ### Issue: TypeScript Errors
218
+
219
+ **Symptoms:**
220
+
221
+ - Red squiggly lines in IDE
222
+ - Type checking failures
223
+ - Missing prop definitions
224
+
225
+ **Debugging Steps:**
226
+
227
+ ```tsx
228
+ // 1. Hover over component in IDE to see type info
229
+ import { Button } from "@arolariu/components/button";
230
+
231
+ // 2. Check available props
232
+ const buttonProps: React.ComponentProps<typeof Button> = {
233
+ variant: "default",
234
+ size: "md",
235
+ // ... other props
236
+ };
237
+
238
+ // 3. Use TypeScript utility types
239
+ type ButtonVariant = React.ComponentProps<typeof Button>["variant"];
240
+ ```
241
+
242
+ ## ⚡ Performance Debugging
243
+
244
+ ### Bundle Analysis
245
+
246
+ #### Webpack Bundle Analyzer
247
+
248
+ ```bash
249
+ # Install analyzer
250
+ npm install --save-dev webpack-bundle-analyzer
251
+
252
+ # Analyze your bundle
253
+ npx webpack-bundle-analyzer build/static/js/*.js
254
+ ```
255
+
256
+ #### Import Cost Analysis
257
+
258
+ Install the "Import Cost" VS Code extension to see real-time import sizes:
259
+
260
+ ```tsx
261
+ import { Button } from "@arolariu/components/button"; // ~3.2KB
262
+ import { Dialog } from "@arolariu/components/dialog"; // ~6.1KB
263
+ import { Chart } from "@arolariu/components/chart"; // ~12.4KB
264
+ ```
265
+
266
+ ### Tree Shaking Verification
267
+
268
+ ```tsx
269
+ // ✅ Good: Tree-shakeable imports
270
+ import { Button } from "@arolariu/components/button";
271
+ import { Card } from "@arolariu/components/card";
272
+
273
+ // ❌ Avoid: Imports entire library
274
+ import { Button, Card } from "@arolariu/components";
275
+ ```
276
+
277
+ ### Performance Monitoring
278
+
279
+ ```tsx
280
+ import { Profiler } from "react";
281
+ import { Button } from "@arolariu/components/button";
282
+
283
+ function onRenderCallback(id, phase, actualDuration) {
284
+ console.log(`${id} ${phase} took ${actualDuration}ms`);
285
+ }
286
+
287
+ function App() {
288
+ return (
289
+ <Profiler id="Button" onRender={onRenderCallback}>
290
+ <Button>Click me</Button>
291
+ </Profiler>
292
+ );
293
+ }
294
+ ```
295
+
296
+ ## 🔍 Component Introspection
297
+
298
+ ### Component Metadata
299
+
300
+ ```tsx
301
+ import { Button } from "@arolariu/components/button";
302
+
303
+ // Check component display name
304
+ console.log(Button.displayName); // "Button"
305
+
306
+ // Access default props (if any)
307
+ console.log(Button.defaultProps);
308
+
309
+ // Check if component is forwardRef
310
+ console.log(Button.$$typeof); // Symbol(react.forward_ref)
311
+ ```
312
+
313
+ ### Variant Inspection
314
+
315
+ ```tsx
316
+ import { buttonVariants } from "@arolariu/components/button";
317
+
318
+ // Inspect available variants
319
+ console.log("Button variants:", {
320
+ variant: Object.keys(buttonVariants.variants.variant),
321
+ size: Object.keys(buttonVariants.variants.size),
322
+ });
323
+
324
+ // Get computed classes for specific variant
325
+ const classes = buttonVariants({
326
+ variant: "destructive",
327
+ size: "lg",
328
+ });
329
+ console.log("Button classes:", classes);
330
+ ```
331
+
332
+ ### Props Validation
333
+
334
+ ```tsx
335
+ import { Button } from "@arolariu/components/button";
336
+ import type { ButtonProps } from "@arolariu/components/button";
337
+
338
+ // Create type-safe props object
339
+ const buttonProps: ButtonProps = {
340
+ variant: "default",
341
+ size: "md",
342
+ disabled: false,
343
+ // TypeScript will validate these props
344
+ };
345
+
346
+ // Use props with component
347
+ <Button {...buttonProps}>My Button</Button>;
348
+ ```
349
+
350
+ ## 📊 Build Analysis
351
+
352
+ ### Development Build Analysis
353
+
354
+ ```bash
355
+ # Build with analysis
356
+ npm run build -- --analyze
357
+
358
+ # Or use webpack-bundle-analyzer directly
359
+ npx webpack-bundle-analyzer build/static/js/*.js
360
+ ```
361
+
362
+ ### Production Optimization Check
363
+
364
+ ```tsx
365
+ // Check if components are properly optimized
366
+ import { Button } from "@arolariu/components/button";
367
+
368
+ // This should only include Button-related code
369
+ // Use browser DevTools Network tab to verify
370
+ ```
371
+
372
+ ### Source Map Validation
373
+
374
+ ```bash
375
+ # Check if source maps are present
376
+ ls node_modules/@arolariu/components/dist/**/*.map
377
+
378
+ # Validate source map content
379
+ cat node_modules/@arolariu/components/dist/esm/button.js.map
380
+ ```
381
+
382
+ ## 🆘 Getting Help
383
+
384
+ If you encounter issues not covered in this guide:
385
+
386
+ 1. **Check the source code**: Browse `node_modules/@arolariu/components/src/`
387
+ 2. **Inspect the built files**: Look at `node_modules/@arolariu/components/dist/`
388
+ 3. **Use browser DevTools**: Leverage source maps for debugging
389
+ 4. **Create an issue**: [GitHub Issues](https://github.com/arolariu/arolariu.ro/issues)
390
+
391
+ ## 📚 Additional Resources
392
+
393
+ - [React DevTools](https://reactjs.org/blog/2019/08/15/new-react-devtools.html)
394
+ - [Chrome DevTools Source Maps](https://developer.chrome.com/docs/devtools/javascript/source-maps/)
395
+ - [TypeScript Debugging](https://code.visualstudio.com/docs/typescript/typescript-debugging)
396
+ - [Webpack Bundle Analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer)