@arolariu/components 0.0.39 → 0.0.40

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