@shohojdhara/atomix 0.2.2 → 0.2.4

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 (139) hide show
  1. package/dist/atomix.css +714 -646
  2. package/dist/atomix.min.css +5 -5
  3. package/dist/index.d.ts +794 -146
  4. package/dist/index.esm.js +12052 -6091
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/index.js +5133 -2674
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.min.js +1 -1
  9. package/dist/index.min.js.map +1 -1
  10. package/dist/themes/boomdevs.css +662 -594
  11. package/dist/themes/boomdevs.min.css +7 -7
  12. package/dist/themes/esrar.css +714 -646
  13. package/dist/themes/esrar.min.css +6 -6
  14. package/dist/themes/mashroom.css +707 -642
  15. package/dist/themes/mashroom.min.css +7 -7
  16. package/dist/themes/shaj-default.css +707 -642
  17. package/dist/themes/shaj-default.min.css +6 -6
  18. package/package.json +66 -15
  19. package/src/components/Accordion/Accordion.stories.tsx +800 -0
  20. package/src/components/Accordion/Accordion.tsx +33 -5
  21. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +1230 -0
  22. package/src/components/AtomixGlass/AtomixGlass.test.tsx +199 -0
  23. package/src/components/AtomixGlass/AtomixGlass.tsx +1343 -0
  24. package/src/components/AtomixGlass/README.md +134 -0
  25. package/src/components/AtomixGlass/index.ts +10 -0
  26. package/src/components/AtomixGlass/shader-utils.ts +696 -0
  27. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5800 -0
  28. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  29. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1066 -0
  30. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +397 -0
  31. package/src/components/AtomixGlass/stories/shared-components.tsx +310 -0
  32. package/src/components/AtomixGlass/utils.ts +8 -0
  33. package/src/components/Badge/Badge.stories.tsx +170 -0
  34. package/src/components/Badge/Badge.tsx +31 -4
  35. package/src/components/Button/Button.stories.tsx +826 -0
  36. package/src/components/Button/Button.tsx +34 -3
  37. package/src/components/Button/README.md +216 -0
  38. package/src/components/Callout/Callout.stories.tsx +813 -78
  39. package/src/components/Callout/Callout.test.tsx +368 -0
  40. package/src/components/Callout/Callout.tsx +43 -6
  41. package/src/components/Callout/README.md +409 -0
  42. package/src/components/Card/Card.stories.tsx +699 -0
  43. package/src/components/Card/Card.tsx +19 -3
  44. package/src/components/DatePicker/DatePicker copy.tsx +551 -0
  45. package/src/components/DatePicker/DatePicker.stories.tsx +877 -1
  46. package/src/components/DatePicker/DatePicker.tsx +379 -332
  47. package/src/components/DatePicker/readme.md +110 -1
  48. package/src/components/DatePicker/types.ts +8 -0
  49. package/src/components/Dropdown/Dropdown.stories.tsx +145 -0
  50. package/src/components/Dropdown/Dropdown.tsx +34 -5
  51. package/src/components/EdgePanel/EdgePanel.stories.tsx +476 -3
  52. package/src/components/EdgePanel/EdgePanel.tsx +86 -13
  53. package/src/components/Form/Checkbox.stories.tsx +101 -0
  54. package/src/components/Form/Checkbox.tsx +26 -2
  55. package/src/components/Form/Input.stories.tsx +124 -0
  56. package/src/components/Form/Input.tsx +36 -7
  57. package/src/components/Form/Radio.stories.tsx +139 -0
  58. package/src/components/Form/Radio.tsx +26 -2
  59. package/src/components/Form/Select.stories.tsx +110 -0
  60. package/src/components/Form/Select.tsx +26 -2
  61. package/src/components/Form/Textarea.stories.tsx +104 -0
  62. package/src/components/Form/Textarea.tsx +36 -7
  63. package/src/components/Hero/Hero.stories.tsx +54 -1
  64. package/src/components/Hero/Hero.tsx +70 -11
  65. package/src/components/Messages/Messages.stories.tsx +113 -0
  66. package/src/components/Messages/Messages.tsx +51 -9
  67. package/src/components/Modal/Modal.stories.tsx +237 -0
  68. package/src/components/Modal/Modal.tsx +63 -35
  69. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  70. package/src/components/Navigation/Nav/Nav.tsx +17 -4
  71. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  72. package/src/components/Navigation/Navbar/Navbar.tsx +66 -28
  73. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  74. package/src/components/Navigation/SideMenu/SideMenu.tsx +28 -2
  75. package/src/components/Pagination/Pagination.stories.tsx +101 -0
  76. package/src/components/Pagination/Pagination.tsx +25 -1
  77. package/src/components/Popover/Popover.stories.tsx +94 -0
  78. package/src/components/Popover/Popover.tsx +30 -4
  79. package/src/components/Progress/Progress.tsx +17 -2
  80. package/src/components/Rating/Rating.stories.tsx +112 -0
  81. package/src/components/Rating/Rating.tsx +25 -1
  82. package/src/components/Spinner/Spinner.tsx +17 -2
  83. package/src/components/Steps/Steps.stories.tsx +119 -0
  84. package/src/components/Steps/Steps.tsx +32 -1
  85. package/src/components/Tab/Tab.stories.tsx +88 -0
  86. package/src/components/Tab/Tab.tsx +32 -1
  87. package/src/components/Toggle/Toggle.stories.tsx +92 -0
  88. package/src/components/Toggle/Toggle.tsx +32 -1
  89. package/src/components/Tooltip/Tooltip.stories.tsx +131 -0
  90. package/src/components/Tooltip/Tooltip.tsx +43 -7
  91. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +1002 -196
  92. package/src/components/VideoPlayer/VideoPlayer.tsx +161 -4
  93. package/src/components/index.ts +1 -0
  94. package/src/lib/composables/index.ts +4 -0
  95. package/src/lib/composables/useAtomixGlass.ts +71 -0
  96. package/src/lib/composables/useBarChart.ts +14 -4
  97. package/src/lib/composables/useButton.ts +3 -1
  98. package/src/lib/composables/useCallout.ts +4 -1
  99. package/src/lib/composables/useChart.ts +223 -370
  100. package/src/lib/composables/useChartToolbar.ts +11 -20
  101. package/src/lib/composables/useEdgePanel.ts +81 -35
  102. package/src/lib/composables/useGlassContainer.ts +168 -0
  103. package/src/lib/composables/useLineChart.ts +4 -2
  104. package/src/lib/composables/usePieChart.ts +4 -14
  105. package/src/lib/constants/components.ts +89 -0
  106. package/src/lib/types/components.ts +448 -14
  107. package/src/lib/utils/displacement-generator.ts +86 -0
  108. package/src/styles/01-settings/_settings.background.scss +8 -7
  109. package/src/styles/01-settings/_settings.callout.scss +7 -7
  110. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  111. package/src/styles/02-tools/_tools.animations.scss +19 -0
  112. package/src/styles/02-tools/_tools.background.scss +19 -17
  113. package/src/styles/02-tools/_tools.glass.scss +1 -0
  114. package/src/styles/02-tools/_tools.utility-api.scss +62 -27
  115. package/src/styles/03-generic/_generic.root.scss +3 -2
  116. package/src/styles/04-elements/_elements.body.scss +0 -18
  117. package/src/styles/06-components/_components.accordion.scss +16 -0
  118. package/src/styles/06-components/_components.atomix-glass.scss +72 -0
  119. package/src/styles/06-components/_components.badge.scss +21 -0
  120. package/src/styles/06-components/_components.button.scss +10 -0
  121. package/src/styles/06-components/_components.callout.scss +46 -2
  122. package/src/styles/06-components/_components.card.scss +17 -0
  123. package/src/styles/06-components/_components.chart.scss +1 -1
  124. package/src/styles/06-components/_components.datepicker.scss +18 -0
  125. package/src/styles/06-components/_components.dropdown.scss +7 -1
  126. package/src/styles/06-components/_components.edge-panel.scss +101 -0
  127. package/src/styles/06-components/_components.hero.scss +1 -2
  128. package/src/styles/06-components/_components.input.scss +31 -1
  129. package/src/styles/06-components/_components.messages.scss +176 -0
  130. package/src/styles/06-components/_components.modal.scss +13 -3
  131. package/src/styles/06-components/_components.navbar.scss +12 -1
  132. package/src/styles/06-components/_components.side-menu.scss +5 -0
  133. package/src/styles/06-components/_components.video-player.scss +48 -26
  134. package/src/styles/06-components/_index.scss +1 -0
  135. package/src/styles/99-utilities/_index.scss +1 -0
  136. package/src/styles/99-utilities/_utilities.glass-fixes.scss +49 -0
  137. package/src/styles/99-utilities/_utilities.opacity.scss +1 -1
  138. package/dist/themes/yabai.css +0 -15207
  139. package/dist/themes/yabai.min.css +0 -189
@@ -0,0 +1,409 @@
1
+ # Callout Component
2
+
3
+ The Callout component is used to display important messages, notifications, or alerts to users. It provides feedback, warnings, errors, or general information with optional glass morphism effects for enhanced visual appeal.
4
+
5
+ ## Features
6
+
7
+ - **Multiple Variants**: Support for different color themes (primary, success, warning, error, etc.)
8
+ - **Glass Morphism**: Optional glass effect for modern, translucent appearance
9
+ - **Flexible Layout**: Support for one-line mode and toast notifications
10
+ - **Interactive Elements**: Dismissible with close button and action buttons
11
+ - **Accessibility**: Full WCAG 2.1 AA compliance with proper ARIA attributes
12
+ - **TypeScript**: Full type safety with comprehensive prop interfaces
13
+
14
+ ## Basic Usage
15
+
16
+ ```tsx
17
+ import { Callout } from '@atomix/react';
18
+
19
+ // Basic callout
20
+ <Callout
21
+ title="Information"
22
+ variant="primary"
23
+ icon={<InfoIcon />}
24
+ >
25
+ This is a basic callout message.
26
+ </Callout>
27
+
28
+ // Glass morphism variant
29
+ <Callout
30
+ title="Glass Effect"
31
+ variant="primary"
32
+ icon={<InfoIcon />}
33
+ glass={true}
34
+ >
35
+ This callout uses glass morphism for a modern appearance.
36
+ </Callout>
37
+ ```
38
+
39
+ ## Props
40
+
41
+ | Prop | Type | Default | Description |
42
+ |------|------|---------|-------------|
43
+ | `title` | `ReactNode` | - | Callout title |
44
+ | `children` | `ReactNode` | - | Callout content |
45
+ | `icon` | `ReactNode` | - | Optional icon |
46
+ | `variant` | `ThemeColor` | `'primary'` | Color variant |
47
+ | `onClose` | `() => void` | - | Close handler function |
48
+ | `actions` | `ReactNode` | - | Optional action buttons |
49
+ | `oneLine` | `boolean` | `false` | Display in one line mode |
50
+ | `toast` | `boolean` | `false` | Display as toast notification |
51
+ | `glass` | `AtomixGlassProps \| boolean` | `false` | Glass morphism effect |
52
+ | `className` | `string` | - | Additional CSS classes |
53
+
54
+ ## Variants
55
+
56
+ ### Color Variants
57
+
58
+ ```tsx
59
+ // Success message
60
+ <Callout variant="success" title="Success" icon={<SuccessIcon />}>
61
+ Operation completed successfully!
62
+ </Callout>
63
+
64
+ // Warning message
65
+ <Callout variant="warning" title="Warning" icon={<WarningIcon />}>
66
+ Please review your information.
67
+ </Callout>
68
+
69
+ // Error message
70
+ <Callout variant="error" title="Error" icon={<ErrorIcon />}>
71
+ Something went wrong.
72
+ </Callout>
73
+
74
+ // Info message
75
+ <Callout variant="info" title="Information" icon={<InfoIcon />}>
76
+ Here's some useful information.
77
+ </Callout>
78
+ ```
79
+
80
+ ### Glass Morphism
81
+
82
+ Glass morphism adds a modern, translucent appearance with backdrop blur effects:
83
+
84
+ ```tsx
85
+ // Enable glass with default settings
86
+ <Callout glass={true} title="Glass Effect" variant="primary">
87
+ Beautiful glass morphism effect
88
+ </Callout>
89
+
90
+ // Custom glass settings
91
+ <Callout
92
+ glass={{
93
+ displacementScale: 60,
94
+ blurAmount: 2,
95
+ saturation: 180,
96
+ aberrationIntensity: 1.5,
97
+ cornerRadius: 12
98
+ }}
99
+ title="Custom Glass"
100
+ variant="success"
101
+ >
102
+ Custom glass configuration
103
+ </Callout>
104
+ ```
105
+
106
+ #### Default Glass Settings
107
+
108
+ When `glass={true}`, these default settings are used:
109
+
110
+ ```typescript
111
+ {
112
+ displacementScale: 40,
113
+ blurAmount: 0,
114
+ saturation: 160,
115
+ aberrationIntensity: 1,
116
+ cornerRadius: 8,
117
+ overLight: false,
118
+ mode: 'standard'
119
+ }
120
+ ```
121
+
122
+ ## Layout Options
123
+
124
+ ### One Line Mode
125
+
126
+ ```tsx
127
+ <Callout
128
+ title="Quick notification"
129
+ variant="info"
130
+ icon={<InfoIcon />}
131
+ oneLine={true}
132
+ />
133
+ ```
134
+
135
+ ### Toast Notifications
136
+
137
+ ```tsx
138
+ <Callout
139
+ title="Toast Message"
140
+ variant="success"
141
+ icon={<SuccessIcon />}
142
+ toast={true}
143
+ onClose={() => handleClose()}
144
+ >
145
+ This appears as a toast notification
146
+ </Callout>
147
+ ```
148
+
149
+ ### With Actions
150
+
151
+ ```tsx
152
+ <Callout
153
+ title="Update Available"
154
+ variant="info"
155
+ icon={<InfoIcon />}
156
+ actions={
157
+ <>
158
+ <Button label="Update" variant="primary" size="sm" />
159
+ <Button label="Later" variant="outline-primary" size="sm" />
160
+ </>
161
+ }
162
+ >
163
+ A new version is available.
164
+ </Callout>
165
+ ```
166
+
167
+ ### Dismissible
168
+
169
+ ```tsx
170
+ <Callout
171
+ title="Dismissible"
172
+ variant="primary"
173
+ icon={<InfoIcon />}
174
+ onClose={() => console.log('Dismissed')}
175
+ >
176
+ This callout can be closed
177
+ </Callout>
178
+ ```
179
+
180
+ ## Advanced Usage
181
+
182
+ ### Custom Content
183
+
184
+ ```tsx
185
+ <Callout title="Rich Content" variant="primary" icon={<InfoIcon />}>
186
+ <div>
187
+ <p>Callouts support rich content including:</p>
188
+ <ul>
189
+ <li>Lists</li>
190
+ <li>Formatted text</li>
191
+ <li>Custom components</li>
192
+ </ul>
193
+ <code>Code examples</code>
194
+ </div>
195
+ </Callout>
196
+ ```
197
+
198
+ ### Toast Container System
199
+
200
+ For managing multiple toast notifications:
201
+
202
+ ```tsx
203
+ import { useState } from 'react';
204
+
205
+ function ToastManager() {
206
+ const [toasts, setToasts] = useState([]);
207
+
208
+ const addToast = (message, variant) => {
209
+ const id = Date.now();
210
+ setToasts(prev => [...prev, { id, message, variant }]);
211
+
212
+ // Auto-remove after 5 seconds
213
+ setTimeout(() => {
214
+ setToasts(prev => prev.filter(toast => toast.id !== id));
215
+ }, 5000);
216
+ };
217
+
218
+ return (
219
+ <div className="toast-container">
220
+ {toasts.map(toast => (
221
+ <Callout
222
+ key={toast.id}
223
+ title={toast.variant}
224
+ variant={toast.variant}
225
+ toast={true}
226
+ glass={true}
227
+ onClose={() => removeToast(toast.id)}
228
+ >
229
+ {toast.message}
230
+ </Callout>
231
+ ))}
232
+ </div>
233
+ );
234
+ }
235
+ ```
236
+
237
+ ## Styling
238
+
239
+ ### CSS Variables
240
+
241
+ The component uses CSS custom properties for theming:
242
+
243
+ ```scss
244
+ .c-callout {
245
+ --atomix-callout-bg: /* Background color */
246
+ --atomix-callout-border-color: /* Border color */
247
+ --atomix-callout-title-color: /* Title text color */
248
+ --atomix-callout-text-color: /* Content text color */
249
+ --atomix-callout-icon-color: /* Icon color */
250
+ --atomix-callout-border-radius: /* Corner radius */
251
+ }
252
+ ```
253
+
254
+ ### Glass Effect Styling
255
+
256
+ Glass morphism adds these visual effects:
257
+
258
+ - Backdrop blur filter
259
+ - Semi-transparent background
260
+ - Enhanced text shadows for readability
261
+ - Variant-specific saturation adjustments
262
+ - Special handling for light/dark themes
263
+
264
+ ```scss
265
+ .c-callout--glass {
266
+ backdrop-filter: blur(10px);
267
+ background: rgba(background-color, 0.5);
268
+ border-color: rgba(255, 255, 255, 0.2);
269
+
270
+ .c-callout__title,
271
+ .c-callout__text {
272
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
273
+ }
274
+ }
275
+ ```
276
+
277
+ ## Accessibility
278
+
279
+ ### ARIA Attributes
280
+
281
+ The component automatically applies appropriate ARIA attributes:
282
+
283
+ - `role="alert"` for warnings and errors
284
+ - `role="status"` for info and success messages
285
+ - `aria-live="polite"` or `aria-live="assertive"` based on urgency
286
+ - `aria-label` for close button
287
+
288
+ ### Keyboard Support
289
+
290
+ - **Tab**: Focus close button and action buttons
291
+ - **Enter/Space**: Activate focused buttons
292
+ - **Escape**: Close dismissible callouts (when focused)
293
+
294
+ ### Screen Reader Support
295
+
296
+ - Announces content changes appropriately
297
+ - Provides context for different message types
298
+ - Supports high contrast mode detection
299
+
300
+ ## Performance Considerations
301
+
302
+ ### Glass Effect Optimization
303
+
304
+ Glass morphism effects are optimized for performance:
305
+
306
+ - Uses CSS `backdrop-filter` when supported
307
+ - Automatic fallback for older browsers
308
+ - Reduced motion respect via `prefers-reduced-motion`
309
+ - Efficient rendering with CSS transforms
310
+
311
+ ### Toast Management
312
+
313
+ - Automatic cleanup of dismissed toasts
314
+ - Memory-efficient state management
315
+ - Optimized re-renders with proper keys
316
+
317
+ ## Browser Support
318
+
319
+ - **Modern Browsers**: Full feature support including glass effects
320
+ - **Older Browsers**: Graceful fallback without glass effects
321
+ - **Mobile**: Touch-optimized interactions
322
+ - **Accessibility Tools**: Full screen reader and keyboard support
323
+
324
+ ## Examples
325
+
326
+ ### Complete Implementation
327
+
328
+ ```tsx
329
+ import { Callout, Button } from '@atomix/react';
330
+ import { Info, Check, AlertTriangle, X } from 'phosphor-react';
331
+
332
+ function NotificationSystem() {
333
+ return (
334
+ <div className="notification-examples">
335
+ {/* Basic variants */}
336
+ <Callout variant="primary" title="Information" icon={<Info />}>
337
+ This is important information for the user.
338
+ </Callout>
339
+
340
+ {/* Glass variants */}
341
+ <Callout
342
+ variant="success"
343
+ title="Success"
344
+ icon={<Check />}
345
+ glass={true}
346
+ >
347
+ Operation completed with glass effect!
348
+ </Callout>
349
+
350
+ {/* Interactive callout */}
351
+ <Callout
352
+ variant="warning"
353
+ title="Confirm Action"
354
+ icon={<AlertTriangle />}
355
+ glass={true}
356
+ actions={
357
+ <>
358
+ <Button label="Confirm" variant="warning" size="sm" />
359
+ <Button label="Cancel" variant="outline-warning" size="sm" />
360
+ </>
361
+ }
362
+ >
363
+ Are you sure you want to proceed?
364
+ </Callout>
365
+
366
+ {/* Toast notification */}
367
+ <Callout
368
+ variant="error"
369
+ title="Error"
370
+ icon={<X />}
371
+ toast={true}
372
+ glass={true}
373
+ onClose={() => handleErrorClose()}
374
+ >
375
+ Failed to save changes. Please try again.
376
+ </Callout>
377
+ </div>
378
+ );
379
+ }
380
+ ```
381
+
382
+ ## Migration Notes
383
+
384
+ ### From v1.x to v2.x
385
+
386
+ - Glass prop added as optional feature
387
+ - No breaking changes to existing props
388
+ - Enhanced accessibility attributes
389
+ - Improved TypeScript definitions
390
+
391
+ ### Best Practices
392
+
393
+ 1. **Use appropriate variants** for different message types
394
+ 2. **Enable glass effect** for modern interfaces
395
+ 3. **Include icons** for better visual hierarchy
396
+ 4. **Provide close handlers** for dismissible messages
397
+ 5. **Test accessibility** with keyboard and screen readers
398
+ 6. **Consider toast positioning** in your layout
399
+ 7. **Optimize glass usage** for performance on lower-end devices
400
+
401
+ ## Related Components
402
+
403
+ - **Button**: Used for actions within callouts
404
+ - **Icon**: Used for callout icons
405
+ - **AtomixGlass**: Underlying glass effect implementation
406
+ - **Toast**: Alternative toast notification system
407
+ ```
408
+
409
+ Now let me check for any compilation errors and make sure everything is working correctly: