@vritti/quantum-ui 0.1.3 → 0.1.5

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 (64) hide show
  1. package/dist/Button.d.ts +47 -0
  2. package/dist/{Button-CQn3Mpx0.js → Button.js} +3 -3
  3. package/dist/Button.js.map +1 -0
  4. package/dist/Card.d.ts +44 -0
  5. package/dist/{Card-C5V_kLq7.js → Card.js} +2 -2
  6. package/dist/Card.js.map +1 -0
  7. package/dist/TextField.d.ts +13 -0
  8. package/dist/{TextField-CBAo3cUz.js → TextField.js} +26 -26
  9. package/dist/TextField.js.map +1 -0
  10. package/dist/ThemeToggle.d.ts +10 -0
  11. package/dist/{ThemeToggle-C8VWQYpc.js → ThemeToggle.js} +3 -3
  12. package/dist/ThemeToggle.js.map +1 -0
  13. package/dist/{lib/components/Typography/Typography.d.ts → Typography.d.ts} +13 -10
  14. package/dist/{Typography-BCxuB5sP.js → Typography.js} +2 -2
  15. package/dist/Typography.js.map +1 -0
  16. package/dist/components/Button.d.ts +2 -0
  17. package/dist/components/Button.js +1 -1
  18. package/dist/components/Card.d.ts +2 -0
  19. package/dist/components/Card.js +1 -1
  20. package/dist/components/TextField.d.ts +2 -0
  21. package/dist/components/TextField.js +1 -1
  22. package/dist/components/ThemeToggle.d.ts +2 -0
  23. package/dist/components/ThemeToggle.js +1 -1
  24. package/dist/components/Typography.d.ts +2 -0
  25. package/dist/components/Typography.js +1 -1
  26. package/dist/index.d.ts +128 -0
  27. package/dist/index.js +108 -6
  28. package/dist/index.js.map +1 -1
  29. package/dist/{index-B_dX4wQk.js → index2.js} +1 -1
  30. package/dist/index2.js.map +1 -0
  31. package/dist/{utils-BLJyPY44.js → utils.js} +1 -1
  32. package/dist/utils.js.map +1 -0
  33. package/package.json +10 -13
  34. package/dist/Button-CQn3Mpx0.js.map +0 -1
  35. package/dist/Card-C5V_kLq7.js.map +0 -1
  36. package/dist/TextField-CBAo3cUz.js.map +0 -1
  37. package/dist/ThemeToggle-C8VWQYpc.js.map +0 -1
  38. package/dist/Typography-BCxuB5sP.js.map +0 -1
  39. package/dist/index-B_dX4wQk.js.map +0 -1
  40. package/dist/lib/components/Button/Button.d.ts +0 -2
  41. package/dist/lib/components/Button/Button.d.ts.map +0 -1
  42. package/dist/lib/components/Button/index.d.ts +0 -2
  43. package/dist/lib/components/Button/index.d.ts.map +0 -1
  44. package/dist/lib/components/Card/Card.d.ts +0 -2
  45. package/dist/lib/components/Card/Card.d.ts.map +0 -1
  46. package/dist/lib/components/Card/index.d.ts +0 -2
  47. package/dist/lib/components/Card/index.d.ts.map +0 -1
  48. package/dist/lib/components/TextField/TextField.d.ts +0 -9
  49. package/dist/lib/components/TextField/TextField.d.ts.map +0 -1
  50. package/dist/lib/components/TextField/index.d.ts +0 -2
  51. package/dist/lib/components/TextField/index.d.ts.map +0 -1
  52. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts +0 -7
  53. package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts.map +0 -1
  54. package/dist/lib/components/ThemeToggle/index.d.ts +0 -2
  55. package/dist/lib/components/ThemeToggle/index.d.ts.map +0 -1
  56. package/dist/lib/components/Typography/Typography.d.ts.map +0 -1
  57. package/dist/lib/components/Typography/index.d.ts +0 -2
  58. package/dist/lib/components/Typography/index.d.ts.map +0 -1
  59. package/dist/lib/components/index.d.ts +0 -6
  60. package/dist/lib/components/index.d.ts.map +0 -1
  61. package/dist/lib/index.d.ts +0 -3
  62. package/dist/lib/index.d.ts.map +0 -1
  63. package/dist/utils-BLJyPY44.js.map +0 -1
  64. package/readme.md +0 -472
package/readme.md DELETED
@@ -1,472 +0,0 @@
1
- # Quantum UI
2
-
3
- A production-ready React component library built with TypeScript, Material-UI, and semantic design tokens. Quantum UI provides intent-based components with advanced theming, SSR-safe implementation, and zero-flickering user experience across all major React frameworks.
4
-
5
- ## Features
6
-
7
- ✨ **Intent-Based Components** - Business-focused APIs (`intent="primary"` vs `color="blue"`)
8
- 🎨 **Dual Font System** - Space Grotesk (display) + Quicksand/Inter (body text)
9
- 🌓 **Zero-Flickering SSR** - Advanced theme script prevents hydration flashes
10
- 📱 **Mobile-First Responsive** - Sophisticated breakpoint system (mobile/tablet/desktop)
11
- ⚡ **Performance Optimized** - Tree-shakeable imports (~0.5-1KB per component)
12
- 🚀 **Framework Agnostic** - Next.js, Remix, Vite, CRA support out of the box
13
- 🎭 **Advanced Animations** - Confidence energy fields with reduced motion support
14
- 🔮 **Glassmorphism Effects** - Backdrop blur and sophisticated visual effects
15
- 📍 **Comprehensive Storybook** - Interactive component documentation
16
- 🔧 **Full TypeScript** - Complete type safety with intelligent autocomplete
17
-
18
- ## Installation
19
-
20
- ```bash
21
- npm install quantum-ui
22
- # or
23
- yarn add quantum-ui
24
- # or
25
- pnpm add quantum-ui
26
- ```
27
-
28
- ## Quick Start
29
-
30
- ### Basic Setup (Vite/CRA)
31
-
32
- ```tsx
33
- import React from 'react';
34
- import { ThemeScript, ThemeProvider, Button, Typography, Paper } from 'quantum-ui';
35
-
36
- function App() {
37
- return (
38
- <>
39
- {/* Add ThemeScript to prevent flickering */}
40
- <ThemeScript defaultColorScheme='light' />
41
-
42
- <ThemeProvider defaultColorScheme='light'>
43
- <Paper variant='elevated'>
44
- <Typography variant='h1'>Welcome to Quantum UI</Typography>
45
- <Typography variant='body1' intent='secondary'>
46
- A modern component library for business applications
47
- </Typography>
48
- <Button intent='primary'>Get Started</Button>
49
- </Paper>
50
- </ThemeProvider>
51
- </>
52
- );
53
- }
54
- ```
55
-
56
- ### Performance-Optimized Imports
57
-
58
- ```tsx
59
- // ✅ Tree-shakeable direct imports (recommended for optimal performance)
60
- import { Button } from 'quantum-ui/Button';
61
- import { TextField } from 'quantum-ui/TextField';
62
- import { Paper } from 'quantum-ui/Paper';
63
- import { Typography } from 'quantum-ui/Typography';
64
-
65
- // ✅ Theme utilities (barrel import acceptable - small bundle impact)
66
- import { ThemeProvider, ThemeScript, useTheme } from 'quantum-ui';
67
- ```
68
-
69
- ## Framework Integration
70
-
71
- ### Next.js Setup
72
-
73
- #### App Router (app/layout.tsx)
74
-
75
- ```tsx
76
- import { ThemeScript } from 'quantum-ui';
77
-
78
- export default function RootLayout({ children }: { children: React.ReactNode }) {
79
- return (
80
- <html lang='en'>
81
- <head>
82
- <ThemeScript defaultColorScheme='light' />
83
- </head>
84
- <body>{children}</body>
85
- </html>
86
- );
87
- }
88
- ```
89
-
90
- #### Pages Router (\_document.tsx)
91
-
92
- ```tsx
93
- import { Html, Head, Main, NextScript } from 'next/document';
94
- import { ThemeScript } from 'quantum-ui';
95
-
96
- export default function Document() {
97
- return (
98
- <Html>
99
- <Head />
100
- <body>
101
- <ThemeScript defaultColorScheme='light' />
102
- <Main />
103
- <NextScript />
104
- </body>
105
- </Html>
106
- );
107
- }
108
- ```
109
-
110
- #### App Component (\_app.tsx or layout.tsx)
111
-
112
- ```tsx
113
- import { ThemeProvider } from 'quantum-ui';
114
-
115
- export default function App({ Component, pageProps }) {
116
- return (
117
- <ThemeProvider defaultColorScheme='light'>
118
- <Component {...pageProps} />
119
- </ThemeProvider>
120
- );
121
- }
122
- ```
123
-
124
- ### Vite Setup
125
-
126
- #### index.html
127
-
128
- ```html
129
- <!DOCTYPE html>
130
- <html lang="en" data-theme="light">
131
- <head>
132
- <meta charset="UTF-8" />
133
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
134
- <title>Your App</title>
135
- </head>
136
- <body>
137
- <div id="root"></div>
138
- <script type="module">
139
- // Add theme script before app loads
140
- import { getThemeScript } from 'quantum-ui';
141
- const script = document.createElement('script');
142
- script.innerHTML = getThemeScript({ defaultColorScheme: 'light' });
143
- document.head.appendChild(script);
144
- </script>
145
- <script type="module" src="/src/main.tsx"></script>
146
- </body>
147
- </html>
148
- ```
149
-
150
- #### main.tsx
151
-
152
- ```tsx
153
- import React from 'react';
154
- import ReactDOM from 'react-dom/client';
155
- import { ThemeProvider } from 'quantum-ui';
156
- import App from './App';
157
-
158
- ReactDOM.createRoot(document.getElementById('root')!).render(
159
- <React.StrictMode>
160
- <ThemeProvider defaultColorScheme='light'>
161
- <App />
162
- </ThemeProvider>
163
- </React.StrictMode>
164
- );
165
- ```
166
-
167
- ### Webpack/CRA Setup
168
-
169
- #### public/index.html
170
-
171
- ```html
172
- <!DOCTYPE html>
173
- <html lang="en" data-theme="light">
174
- <head>
175
- <meta charset="utf-8" />
176
- <meta name="viewport" content="width=device-width, initial-scale=1" />
177
- <title>Your App</title>
178
- <script>
179
- // Add theme script manually (copy from getThemeScript() output)
180
- (function () {
181
- document.documentElement.classList.add('no-transition');
182
- try {
183
- const savedScheme = localStorage.getItem('quantum-color-scheme');
184
- const validSchemes = ['light', 'dark'];
185
- const themeToApply = savedScheme && validSchemes.includes(savedScheme) ? savedScheme : 'light';
186
- document.documentElement.setAttribute('data-theme', themeToApply);
187
- } catch (e) {
188
- document.documentElement.setAttribute('data-theme', 'light');
189
- }
190
-
191
- function enableTransitions() {
192
- document.documentElement.classList.remove('no-transition');
193
- document.documentElement.classList.add('loaded');
194
- }
195
-
196
- if (document.readyState === 'loading') {
197
- window.addEventListener('DOMContentLoaded', function () {
198
- setTimeout(enableTransitions, 100);
199
- });
200
- } else {
201
- setTimeout(enableTransitions, 100);
202
- }
203
- })();
204
- </script>
205
- </head>
206
- <body>
207
- <div id="root"></div>
208
- </body>
209
- </html>
210
- ```
211
-
212
- #### src/App.tsx
213
-
214
- ```tsx
215
- import React from 'react';
216
- import { ThemeProvider } from 'quantum-ui';
217
- import YourComponents from './components';
218
-
219
- function App() {
220
- return (
221
- <ThemeProvider defaultColorScheme='light'>
222
- <YourComponents />
223
- </ThemeProvider>
224
- );
225
- }
226
-
227
- export default App;
228
- ```
229
-
230
- ### Remix Setup
231
-
232
- #### app/root.tsx
233
-
234
- ```tsx
235
- import { ThemeScript, ThemeProvider } from 'quantum-ui';
236
-
237
- export default function App() {
238
- return (
239
- <html lang='en'>
240
- <head>
241
- <Meta />
242
- <Links />
243
- <ThemeScript defaultColorScheme='light' />
244
- </head>
245
- <body>
246
- <ThemeProvider defaultColorScheme='light'>
247
- <Outlet />
248
- </ThemeProvider>
249
- <ScrollRestoration />
250
- <Scripts />
251
- <LiveReload />
252
- </body>
253
- </html>
254
- );
255
- }
256
- ```
257
-
258
- ## Components
259
-
260
- ### Core Components (Production Ready)
261
-
262
- - **Button** - Intent-based variants (`primary`, `secondary`, `destructive`, `ghost`) with advanced animations
263
- - **Typography** - Complete text system with semantic intents and responsive scaling
264
- - **TextField** - State-driven inputs (`normal`, `error`, `success`, `warning`) with glassmorphism styling
265
- - **Paper** - Surface containers with variants (`standard`, `glass`, `elevated`, `subtle`)
266
-
267
- ### Theme System
268
-
269
- - **ThemeProvider** - Global theme and color scheme management
270
- - **ThemeScript** - Prevents theme flickering (add before React loads)
271
- - **useTheme** - Hook for accessing theme context and toggling modes
272
- - **useIsClient** - Utility hook for client-only components
273
-
274
- ## Theming API
275
-
276
- ### ThemeScript Configuration
277
-
278
- ```tsx
279
- <ThemeScript
280
- defaultColorScheme='dark' // Default: "light"
281
- storageKey='my-theme-key' // Default: "quantum-color-scheme"
282
- attribute='data-color-mode' // Default: "data-theme"
283
- preventFlickering={false} // Default: true
284
- />
285
- ```
286
-
287
- ### ThemeProvider Configuration
288
-
289
- ```tsx
290
- <ThemeProvider
291
- defaultColorScheme='dark' // Must match ThemeScript
292
- storageKey='my-theme-key' // Must match ThemeScript
293
- attribute='data-color-mode' // Must match ThemeScript
294
- >
295
- <App />
296
- </ThemeProvider>
297
- ```
298
-
299
- ### useTheme Hook
300
-
301
- ```tsx
302
- function ThemeToggle() {
303
- const {
304
- colorScheme, // Current theme: "light" | "dark"
305
- toggleColorScheme, // Toggle between themes
306
- setTheme, // Set specific theme
307
- isHydrated, // Whether React has hydrated
308
- } = useTheme();
309
-
310
- return <button onClick={toggleColorScheme}>Current: {colorScheme}</button>;
311
- }
312
- ```
313
-
314
- ## Component APIs
315
-
316
- ### Button
317
-
318
- ```tsx
319
- import { Button } from 'quantum-ui/Button';
320
- import type { ButtonProps } from 'quantum-ui/Button';
321
-
322
- interface ButtonProps {
323
- intent?: 'primary' | 'secondary' | 'destructive' | 'ghost';
324
- size?: 'small' | 'medium' | 'large';
325
- fullWidth?: boolean;
326
- disabled?: boolean;
327
- }
328
- ```
329
-
330
- ### Typography
331
-
332
- ```tsx
333
- import { Typography } from 'quantum-ui/Typography';
334
- import type { TypographyProps } from 'quantum-ui/Typography';
335
-
336
- interface TypographyProps {
337
- intent?: 'primary' | 'secondary' | 'disabled';
338
- variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'button' | 'caption' | 'overline';
339
- }
340
- ```
341
-
342
- ### TextField
343
-
344
- ```tsx
345
- import { TextField } from 'quantum-ui/TextField';
346
- import type { TextFieldProps } from 'quantum-ui/TextField';
347
-
348
- interface TextFieldProps {
349
- state?: 'normal' | 'error' | 'success' | 'warning';
350
- label?: string;
351
- message?: string;
352
- fullWidth?: boolean;
353
- }
354
- ```
355
-
356
- ### Paper
357
-
358
- ```tsx
359
- import { Paper } from 'quantum-ui/Paper';
360
- import type { PaperProps } from 'quantum-ui/Paper';
361
-
362
- interface PaperProps {
363
- variant?: 'standard' | 'glass' | 'elevated' | 'subtle';
364
- }
365
- ```
366
-
367
- ## Development
368
-
369
- ```bash
370
- # Install dependencies
371
- npm install
372
-
373
- # Start development server
374
- npm run dev
375
-
376
- # Run Storybook
377
- npm run storybook
378
-
379
- # Build library
380
- npm run build
381
-
382
- # Run linting
383
- npm run lint
384
- ```
385
-
386
- ## Performance Best Practices
387
-
388
- ### Import Strategy
389
-
390
- ```tsx
391
- // ✅ BEST: Direct component imports (optimal tree-shaking)
392
- import { Button } from 'quantum-ui/Button';
393
- import { TextField } from 'quantum-ui/TextField';
394
-
395
- // ✅ GOOD: Theme utilities barrel import (small bundle impact)
396
- import { ThemeProvider, useTheme } from 'quantum-ui';
397
-
398
- // ❌ AVOID: Component barrel imports (larger bundles)
399
- import { Button, TextField } from 'quantum-ui';
400
- ```
401
-
402
- ### Bundle Size Optimization
403
-
404
- - **Individual components**: ~0.5-1KB gzipped each
405
- - **Theme system**: ~8KB gzipped (includes MUI theme)
406
- - **Full library**: Import only what you use for optimal performance
407
-
408
- ## SSR Considerations
409
-
410
- ### Zero Flickering Setup
411
-
412
- 1. **Add ThemeScript** before React loads (prevents flickering)
413
- 2. **Configure ThemeProvider** with matching settings
414
- 3. **Use consistent defaults** across script and provider
415
-
416
- ### Hydration Safety
417
-
418
- - ThemeProvider ensures no hydration mismatches
419
- - `isHydrated` flag available for client-only features
420
- - `useIsClient` hook for conditional rendering
421
-
422
- ## Design System
423
-
424
- Quantum UI is built on a sophisticated design token system:
425
-
426
- - **Colors**: Semantic color system with light/dark mode support
427
- - **Typography**: Responsive font scaling with dual font approach
428
- - **Spacing**: Consistent spacing scale across all breakpoints
429
- - **Shadows**: Elevated and glass morphism effects
430
- - **Animations**: Smooth transitions with reduced motion support
431
-
432
- ## Architecture Highlights
433
-
434
- ### Design Philosophy
435
-
436
- - **Intent over Style** - Components use semantic intents rather than style props
437
- - **Theme-First Architecture** - Everything uses CSS variables, zero hardcoded values
438
- - **Progressive Enhancement** - Mobile-first with desktop refinements
439
- - **Performance by Design** - React.memo, constant lookups, zero runtime CSS-in-JS
440
-
441
- ### Advanced Features
442
-
443
- - **Blue Brand Theming** - Universal blue (#0066CC) with subtle input backgrounds
444
- - **Sophisticated Shadows** - Theme-aware with different opacity for light/dark modes
445
- - **Animation System** - Confidence animations with accessibility considerations
446
- - **SSR Excellence** - Zero hydration mismatches across all supported frameworks
447
-
448
- ### Bundle Optimization
449
-
450
- ```bash
451
- # Individual component sizes (gzipped)
452
- Button: ~0.7KB
453
- TextField: ~0.9KB
454
- Paper: ~0.5KB
455
- Typography: ~0.6KB
456
- Theme System: ~8KB (includes MUI theme)
457
- ```
458
-
459
- ## Browser Support
460
-
461
- - Chrome 90+ (Backdrop filter support)
462
- - Firefox 88+ (CSS custom properties)
463
- - Safari 14+ (Modern CSS features)
464
- - Edge 90+ (Chromium-based)
465
-
466
- ## License
467
-
468
- MIT License - see LICENSE file for details.
469
-
470
- ---
471
-
472
- **Status**: All components are production-ready and fully implemented. The codebase represents a mature, sophisticated design system with excellent architecture and performance characteristics.