@shohojdhara/atomix 0.2.3 → 0.2.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 (225) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1703 -1544
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/index.d.ts +1465 -963
  5. package/dist/index.esm.js +16289 -25908
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15650 -21780
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +15008 -0
  12. package/dist/themes/applemix.min.css +72 -0
  13. package/dist/themes/boomdevs.css +1608 -1450
  14. package/dist/themes/boomdevs.min.css +5 -5
  15. package/dist/themes/esrar.css +1702 -1543
  16. package/dist/themes/esrar.min.css +4 -4
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1699 -1540
  20. package/dist/themes/mashroom.min.css +7 -7
  21. package/dist/themes/shaj-default.css +1693 -1534
  22. package/dist/themes/shaj-default.min.css +4 -4
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +662 -21
  25. package/src/components/Accordion/Accordion.tsx +21 -14
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
  29. package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
  30. package/src/components/AtomixGlass/README.md +124 -2
  31. package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
  32. package/src/components/AtomixGlass/glass-utils.ts +263 -0
  33. package/src/components/AtomixGlass/shader-utils.ts +792 -68
  34. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
  40. package/src/components/AtomixGlass/utils.ts +3 -3
  41. package/src/components/Avatar/Avatar.tsx +3 -0
  42. package/src/components/Avatar/AvatarGroup.tsx +2 -1
  43. package/src/components/Badge/Badge.stories.tsx +76 -55
  44. package/src/components/Badge/Badge.tsx +12 -14
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.stories.tsx +501 -20
  47. package/src/components/Button/Button.tsx +5 -8
  48. package/src/components/Callout/Callout.stories.tsx +86 -35
  49. package/src/components/Callout/Callout.tsx +31 -9
  50. package/src/components/Card/Card.stories.tsx +565 -2
  51. package/src/components/Card/Card.tsx +15 -4
  52. package/src/components/Card/ElevationCard.tsx +2 -0
  53. package/src/components/Chart/AnimatedChart.tsx +179 -156
  54. package/src/components/Chart/AreaChart.tsx +123 -12
  55. package/src/components/Chart/BarChart.tsx +91 -100
  56. package/src/components/Chart/BaseChart.tsx +80 -0
  57. package/src/components/Chart/BubbleChart.tsx +114 -290
  58. package/src/components/Chart/CandlestickChart.tsx +282 -622
  59. package/src/components/Chart/Chart.stories.tsx +576 -179
  60. package/src/components/Chart/Chart.tsx +374 -75
  61. package/src/components/Chart/ChartRenderer.tsx +371 -220
  62. package/src/components/Chart/ChartToolbar.tsx +372 -61
  63. package/src/components/Chart/ChartTooltip.tsx +33 -18
  64. package/src/components/Chart/DonutChart.tsx +172 -254
  65. package/src/components/Chart/FunnelChart.tsx +169 -240
  66. package/src/components/Chart/GaugeChart.tsx +224 -392
  67. package/src/components/Chart/HeatmapChart.tsx +302 -440
  68. package/src/components/Chart/LineChart.tsx +148 -103
  69. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  70. package/src/components/Chart/PieChart.tsx +114 -64
  71. package/src/components/Chart/RadarChart.tsx +202 -218
  72. package/src/components/Chart/ScatterChart.tsx +111 -97
  73. package/src/components/Chart/TreemapChart.tsx +147 -222
  74. package/src/components/Chart/WaterfallChart.tsx +253 -291
  75. package/src/components/Chart/index.ts +11 -9
  76. package/src/components/Chart/types.ts +85 -9
  77. package/src/components/Chart/utils.ts +66 -0
  78. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  79. package/src/components/Countdown/Countdown.tsx +4 -0
  80. package/src/components/DataTable/DataTable.tsx +2 -1
  81. package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
  82. package/src/components/DatePicker/DatePicker.tsx +3 -9
  83. package/src/components/DatePicker/types.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  85. package/src/components/Dropdown/Dropdown.tsx +26 -28
  86. package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
  87. package/src/components/EdgePanel/EdgePanel.tsx +101 -13
  88. package/src/components/Footer/Footer.stories.tsx +187 -60
  89. package/src/components/Footer/Footer.test.tsx +134 -0
  90. package/src/components/Footer/Footer.tsx +133 -34
  91. package/src/components/Footer/FooterLink.tsx +1 -1
  92. package/src/components/Footer/FooterSection.tsx +53 -36
  93. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  94. package/src/components/Footer/README.md +82 -3
  95. package/src/components/Footer/index.ts +1 -1
  96. package/src/components/Form/Checkbox.stories.tsx +13 -5
  97. package/src/components/Form/Checkbox.tsx +3 -6
  98. package/src/components/Form/Form.stories.tsx +10 -3
  99. package/src/components/Form/Form.tsx +2 -0
  100. package/src/components/Form/FormGroup.tsx +2 -1
  101. package/src/components/Form/Input.stories.tsx +12 -11
  102. package/src/components/Form/Input.tsx +97 -95
  103. package/src/components/Form/Radio.stories.tsx +22 -7
  104. package/src/components/Form/Radio.tsx +3 -6
  105. package/src/components/Form/Select.stories.tsx +21 -6
  106. package/src/components/Form/Select.tsx +3 -5
  107. package/src/components/Form/Textarea.stories.tsx +13 -11
  108. package/src/components/Form/Textarea.tsx +88 -86
  109. package/src/components/Hero/Hero.stories.tsx +2 -3
  110. package/src/components/Hero/Hero.tsx +5 -6
  111. package/src/components/Icon/Icon.tsx +12 -1
  112. package/src/components/List/List.tsx +2 -1
  113. package/src/components/List/ListGroup.tsx +2 -1
  114. package/src/components/Messages/Messages.stories.tsx +113 -0
  115. package/src/components/Messages/Messages.tsx +52 -9
  116. package/src/components/Modal/Modal.stories.tsx +48 -32
  117. package/src/components/Modal/Modal.tsx +19 -24
  118. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  119. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  120. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  121. package/src/components/Navigation/Nav/Nav.tsx +22 -4
  122. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  123. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  124. package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
  125. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  126. package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
  127. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  128. package/src/components/Pagination/Pagination.tsx +7 -6
  129. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  130. package/src/components/Popover/Popover.stories.tsx +32 -24
  131. package/src/components/Popover/Popover.tsx +4 -1
  132. package/src/components/ProductReview/ProductReview.tsx +8 -2
  133. package/src/components/Progress/Progress.tsx +19 -3
  134. package/src/components/Rating/Rating.stories.tsx +11 -6
  135. package/src/components/Rating/Rating.tsx +3 -5
  136. package/src/components/River/River.tsx +5 -5
  137. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  138. package/src/components/Slider/Slider.stories.tsx +4 -4
  139. package/src/components/Slider/Slider.tsx +4 -3
  140. package/src/components/Spinner/Spinner.tsx +19 -3
  141. package/src/components/Steps/Steps.stories.tsx +5 -4
  142. package/src/components/Steps/Steps.tsx +8 -5
  143. package/src/components/Tab/Tab.stories.tsx +4 -3
  144. package/src/components/Tab/Tab.tsx +8 -6
  145. package/src/components/Testimonial/Testimonial.tsx +8 -2
  146. package/src/components/Todo/Todo.tsx +2 -1
  147. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  148. package/src/components/Toggle/Toggle.tsx +8 -5
  149. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  150. package/src/components/Tooltip/Tooltip.tsx +9 -2
  151. package/src/components/Upload/Upload.stories.tsx +252 -0
  152. package/src/components/Upload/Upload.tsx +92 -53
  153. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  154. package/src/components/index.ts +0 -4
  155. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  156. package/src/layouts/Grid/Grid.tsx +20 -1
  157. package/src/layouts/Grid/GridCol.tsx +76 -48
  158. package/src/lib/composables/useAtomixGlass.ts +861 -44
  159. package/src/lib/composables/useBarChart.ts +21 -4
  160. package/src/lib/composables/useChart.ts +227 -370
  161. package/src/lib/composables/useChartExport.ts +19 -78
  162. package/src/lib/composables/useChartToolbar.ts +11 -21
  163. package/src/lib/composables/useEdgePanel.ts +125 -71
  164. package/src/lib/composables/useFooter.ts +3 -3
  165. package/src/lib/composables/useGlassContainer.ts +16 -7
  166. package/src/lib/composables/useLineChart.ts +11 -2
  167. package/src/lib/composables/usePieChart.ts +4 -14
  168. package/src/lib/composables/useRiver.ts +5 -0
  169. package/src/lib/composables/useSlider.ts +62 -24
  170. package/src/lib/composables/useVideoPlayer.ts +60 -63
  171. package/src/lib/constants/components.ts +147 -32
  172. package/src/lib/types/components.ts +355 -25
  173. package/src/lib/utils/displacement-generator.ts +55 -49
  174. package/src/lib/utils/icons.ts +1 -1
  175. package/src/lib/utils/index.ts +16 -10
  176. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  177. package/src/styles/01-settings/_settings.animations.scss +5 -5
  178. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  179. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  180. package/src/styles/01-settings/_settings.background.scss +0 -3
  181. package/src/styles/01-settings/_settings.badge.scss +1 -1
  182. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  183. package/src/styles/01-settings/_settings.card.scss +1 -1
  184. package/src/styles/01-settings/_settings.chart.scss +65 -2
  185. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  186. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  187. package/src/styles/01-settings/_settings.footer.scss +35 -42
  188. package/src/styles/01-settings/_settings.input.scss +1 -1
  189. package/src/styles/01-settings/_settings.list.scss +1 -1
  190. package/src/styles/01-settings/_settings.rating.scss +1 -1
  191. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  192. package/src/styles/01-settings/_settings.upload.scss +6 -5
  193. package/src/styles/02-tools/_tools.animations.scss +4 -5
  194. package/src/styles/02-tools/_tools.background.scss +1 -13
  195. package/src/styles/02-tools/_tools.glass.scss +0 -1
  196. package/src/styles/02-tools/_tools.utility-api.scss +91 -48
  197. package/src/styles/03-generic/_generic.root.scss +1 -4
  198. package/src/styles/04-elements/_elements.body.scss +0 -1
  199. package/src/styles/06-components/_components.atomix-glass.scss +249 -0
  200. package/src/styles/06-components/_components.badge.scss +8 -23
  201. package/src/styles/06-components/_components.button.scss +8 -3
  202. package/src/styles/06-components/_components.callout.scss +10 -5
  203. package/src/styles/06-components/_components.card.scss +2 -14
  204. package/src/styles/06-components/_components.chart.scss +969 -1449
  205. package/src/styles/06-components/_components.dropdown.scss +19 -7
  206. package/src/styles/06-components/_components.edge-panel.scss +103 -0
  207. package/src/styles/06-components/_components.footer.scss +166 -85
  208. package/src/styles/06-components/_components.input.scss +8 -9
  209. package/src/styles/06-components/_components.list.scss +1 -0
  210. package/src/styles/06-components/_components.messages.scss +176 -0
  211. package/src/styles/06-components/_components.modal.scss +16 -4
  212. package/src/styles/06-components/_components.navbar.scss +12 -1
  213. package/src/styles/06-components/_components.side-menu.scss +5 -0
  214. package/src/styles/06-components/_components.skeleton.scss +8 -6
  215. package/src/styles/06-components/_components.upload.scss +219 -4
  216. package/src/styles/06-components/old.chart.styles.scss +1 -30
  217. package/src/styles/99-utilities/_index.scss +1 -0
  218. package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
  219. package/src/styles/99-utilities/_utilities.scss +1 -1
  220. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
  221. package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
  222. package/src/components/Chart/AdvancedChart.tsx +0 -624
  223. package/src/components/Chart/LineChartNew.tsx +0 -167
  224. package/src/components/Chart/RealTimeChart.tsx +0 -436
  225. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -0,0 +1,395 @@
1
+ /**
2
+ * ShaderVariants.stories.tsx
3
+ *
4
+ * Professional showcase of Apple-style shader variants with modern design.
5
+ * Features premium liquid glass effects with advanced visual rendering.
6
+ *
7
+ * @package Atomix
8
+ * @component AtomixGlass
9
+ */
10
+
11
+ import React, { useState } from 'react';
12
+ import { Meta, StoryObj } from '@storybook/react';
13
+ import AtomixGlass from '../AtomixGlass';
14
+ import { BackgroundWrapper } from './shared-components';
15
+
16
+ const meta: Meta<typeof AtomixGlass> = {
17
+ title: 'Components/AtomixGlass/Shader Variants',
18
+ component: AtomixGlass,
19
+ parameters: {
20
+ layout: 'fullscreen',
21
+ docs: {
22
+ description: {
23
+ component:
24
+ 'Experience premium Apple-style shader variants with advanced GPU-accelerated effects. Each variant features unique characteristics including time-based animations, organic flow patterns, and sophisticated visual rendering.',
25
+ },
26
+ },
27
+ },
28
+ tags: ['autodocs'],
29
+ };
30
+
31
+ export default meta;
32
+ type Story = StoryObj<typeof AtomixGlass>;
33
+
34
+ /**
35
+ * Liquid Glass Variant
36
+ *
37
+ * Enhanced liquid glass with time-based animations and multi-layered organic distortion.
38
+ * Perfect for hero sections and premium content areas.
39
+ */
40
+ export const LiquidGlass: Story = {
41
+ args: {
42
+ children: (
43
+ <div style={{ padding: '44px 40px', textAlign: 'center', maxWidth: '480px' }}>
44
+ <div
45
+ style={{
46
+ width: '80px',
47
+ height: '80px',
48
+ margin: '0 auto 28px',
49
+ borderRadius: '22px',
50
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
51
+ display: 'flex',
52
+ alignItems: 'center',
53
+ justifyContent: 'center',
54
+ fontSize: '44px',
55
+ boxShadow: '0 20px 48px rgba(102, 126, 234, 0.6)',
56
+ position: 'relative',
57
+ }}
58
+ >
59
+ <div
60
+ style={{
61
+ position: 'absolute',
62
+ inset: '-6px',
63
+ borderRadius: '28px',
64
+ background: 'linear-gradient(135deg, #667eea, #764ba2)',
65
+ opacity: 0.4,
66
+ filter: 'blur(20px)',
67
+ }}
68
+ />
69
+ <span style={{ position: 'relative', zIndex: 1 }}>💧</span>
70
+ </div>
71
+ <h2
72
+ style={{
73
+ margin: '0 0 16px 0',
74
+ fontSize: '36px',
75
+ fontWeight: 700,
76
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
77
+ WebkitBackgroundClip: 'text',
78
+ WebkitTextFillColor: 'transparent',
79
+ backgroundClip: 'text',
80
+ letterSpacing: '-0.5px',
81
+ }}
82
+ >
83
+ Liquid Glass
84
+ </h2>
85
+ <p
86
+ style={{
87
+ margin: '0 0 28px 0',
88
+ fontSize: '17px',
89
+ lineHeight: 1.7,
90
+ color: 'rgba(255, 255, 255, 0.85)',
91
+ }}
92
+ >
93
+ Experience fluid, time-based animations with multi-layered organic distortion and
94
+ chromatic aberration effects that create living glass.
95
+ </p>
96
+ <div
97
+ style={{
98
+ display: 'flex',
99
+ flexWrap: 'wrap',
100
+ gap: '12px',
101
+ justifyContent: 'center',
102
+ }}
103
+ >
104
+ {['Time Animation', 'Multi-Layer', 'Chromatic FX', 'Organic Flow'].map(tag => (
105
+ <div
106
+ key={tag}
107
+ style={{
108
+ padding: '8px 16px',
109
+ borderRadius: '10px',
110
+ background: 'rgba(102, 126, 234, 0.2)',
111
+ border: '1px solid rgba(102, 126, 234, 0.3)',
112
+ fontSize: '13px',
113
+ fontWeight: 600,
114
+ color: '#fff',
115
+ }}
116
+ >
117
+ {tag}
118
+ </div>
119
+ ))}
120
+ </div>
121
+ </div>
122
+ ),
123
+ displacementScale: 25,
124
+ blurAmount: 1.5,
125
+ saturation: 150,
126
+ aberrationIntensity: 2,
127
+ elasticity: 0.2,
128
+ cornerRadius: 32,
129
+ mode: 'shader',
130
+ shaderVariant: 'liquidGlass',
131
+ },
132
+ decorators: [
133
+ Story => (
134
+ <BackgroundWrapper
135
+ backgroundImage="https://images.unsplash.com/photo-1557683316-973673baf926?q=80&w=3029&auto=format&fit=crop"
136
+ height="100vh"
137
+ width="100vw"
138
+ overlayOpacity={0.3}
139
+ borderRadius="0"
140
+ >
141
+ <Story />
142
+ </BackgroundWrapper>
143
+ ),
144
+ ],
145
+ parameters: {
146
+ docs: {
147
+ description: {
148
+ story:
149
+ 'Liquid Glass features time-based animations with multi-layered distortion. Ideal for premium hero sections and feature highlights.',
150
+ },
151
+ },
152
+ },
153
+ };
154
+
155
+ /**
156
+ * Apple Fluid Variant
157
+ *
158
+ * Premium fluid glass inspired by Apple's design language.
159
+ * Features vortex effects and 5-octave noise for organic, flowing visuals.
160
+ */
161
+ export const AppleFluid: Story = {
162
+ args: {
163
+ children: (
164
+ <div style={{ padding: '44px 40px', textAlign: 'center', maxWidth: '480px' }}>
165
+ <div
166
+ style={{
167
+ width: '80px',
168
+ height: '80px',
169
+ margin: '0 auto 28px',
170
+ borderRadius: '22px',
171
+ background: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
172
+ display: 'flex',
173
+ alignItems: 'center',
174
+ justifyContent: 'center',
175
+ fontSize: '44px',
176
+ boxShadow: '0 20px 48px rgba(245, 87, 108, 0.6)',
177
+ position: 'relative',
178
+ }}
179
+ >
180
+ <div
181
+ style={{
182
+ position: 'absolute',
183
+ inset: '-6px',
184
+ borderRadius: '28px',
185
+ background: 'linear-gradient(135deg, #f093fb, #f5576c)',
186
+ opacity: 0.4,
187
+ filter: 'blur(20px)',
188
+ }}
189
+ />
190
+ <span style={{ position: 'relative', zIndex: 1 }}>🌊</span>
191
+ </div>
192
+ <h2
193
+ style={{
194
+ margin: '0 0 16px 0',
195
+ fontSize: '36px',
196
+ fontWeight: 700,
197
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
198
+ WebkitBackgroundClip: 'text',
199
+ WebkitTextFillColor: 'transparent',
200
+ backgroundClip: 'text',
201
+ letterSpacing: '-0.5px',
202
+ }}
203
+ >
204
+ Apple Fluid
205
+ </h2>
206
+ <p
207
+ style={{
208
+ margin: '0 0 28px 0',
209
+ fontSize: '17px',
210
+ lineHeight: 1.7,
211
+ color: 'rgba(255, 255, 255, 0.85)',
212
+ }}
213
+ >
214
+ Apple-inspired fluid dynamics with vortex effects and high-quality 5-octave noise. Mouse
215
+ interactions create mesmerizing flow patterns.
216
+ </p>
217
+ <div
218
+ style={{
219
+ display: 'flex',
220
+ flexWrap: 'wrap',
221
+ gap: '12px',
222
+ justifyContent: 'center',
223
+ }}
224
+ >
225
+ {['Vortex FX', '5-Octave', 'Apple Style', 'Interactive'].map(tag => (
226
+ <div
227
+ key={tag}
228
+ style={{
229
+ padding: '8px 16px',
230
+ borderRadius: '10px',
231
+ background: 'rgba(245, 87, 108, 0.2)',
232
+ border: '1px solid rgba(245, 87, 108, 0.3)',
233
+ fontSize: '13px',
234
+ fontWeight: 600,
235
+ color: '#fff',
236
+ }}
237
+ >
238
+ {tag}
239
+ </div>
240
+ ))}
241
+ </div>
242
+ </div>
243
+ ),
244
+ displacementScale: 25,
245
+ blurAmount: 1.5,
246
+ saturation: 150,
247
+ aberrationIntensity: 2,
248
+ elasticity: 0.2,
249
+ cornerRadius: 32,
250
+ mode: 'shader',
251
+ shaderVariant: 'appleFluid',
252
+ },
253
+ decorators: [
254
+ Story => (
255
+ <BackgroundWrapper
256
+ backgroundImage="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop"
257
+ height="100vh"
258
+ width="100vw"
259
+ overlayOpacity={0.3}
260
+ borderRadius="0"
261
+ >
262
+ <Story />
263
+ </BackgroundWrapper>
264
+ ),
265
+ ],
266
+ parameters: {
267
+ docs: {
268
+ description: {
269
+ story:
270
+ 'Apple Fluid delivers premium vortex effects with 5-octave noise. Mouse interactions create dynamic, flowing patterns inspired by Apple design.',
271
+ },
272
+ },
273
+ },
274
+ };
275
+
276
+ /**
277
+ * Premium Glass Variant
278
+ *
279
+ * High-end glass rendering with advanced refraction and multi-layer depth.
280
+ * Offers the best performance-to-quality ratio among shader variants.
281
+ */
282
+ export const PremiumGlass: Story = {
283
+ args: {
284
+ children: (
285
+ <div style={{ padding: '44px 40px', textAlign: 'center', maxWidth: '480px' }}>
286
+ <div
287
+ style={{
288
+ width: '80px',
289
+ height: '80px',
290
+ margin: '0 auto 28px',
291
+ borderRadius: '22px',
292
+ background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
293
+ display: 'flex',
294
+ alignItems: 'center',
295
+ justifyContent: 'center',
296
+ fontSize: '44px',
297
+ boxShadow: '0 20px 48px rgba(79, 172, 254, 0.6)',
298
+ position: 'relative',
299
+ }}
300
+ >
301
+ <div
302
+ style={{
303
+ position: 'absolute',
304
+ inset: '-6px',
305
+ borderRadius: '28px',
306
+ background: 'linear-gradient(135deg, #4facfe, #00f2fe)',
307
+ opacity: 0.4,
308
+ filter: 'blur(20px)',
309
+ }}
310
+ />
311
+ <span style={{ position: 'relative', zIndex: 1 }}>💎</span>
312
+ </div>
313
+ <h2
314
+ style={{
315
+ margin: '0 0 16px 0',
316
+ fontSize: '36px',
317
+ fontWeight: 700,
318
+ background: 'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
319
+ WebkitBackgroundClip: 'text',
320
+ WebkitTextFillColor: 'transparent',
321
+ backgroundClip: 'text',
322
+ letterSpacing: '-0.5px',
323
+ }}
324
+ >
325
+ Premium Glass
326
+ </h2>
327
+ <p
328
+ style={{
329
+ margin: '0 0 28px 0',
330
+ fontSize: '17px',
331
+ lineHeight: 1.7,
332
+ color: 'rgba(255, 255, 255, 0.85)',
333
+ }}
334
+ >
335
+ Advanced refraction with multi-layer depth effects and edge-aware rendering. The optimal
336
+ balance of quality and performance.
337
+ </p>
338
+ <div
339
+ style={{
340
+ display: 'flex',
341
+ flexWrap: 'wrap',
342
+ gap: '12px',
343
+ justifyContent: 'center',
344
+ }}
345
+ >
346
+ {['Advanced Refraction', 'Multi-Depth', 'Edge-Aware', 'Optimized'].map(tag => (
347
+ <div
348
+ key={tag}
349
+ style={{
350
+ padding: '8px 16px',
351
+ borderRadius: '10px',
352
+ background: 'rgba(79, 172, 254, 0.2)',
353
+ border: '1px solid rgba(79, 172, 254, 0.3)',
354
+ fontSize: '13px',
355
+ fontWeight: 600,
356
+ color: '#fff',
357
+ }}
358
+ >
359
+ {tag}
360
+ </div>
361
+ ))}
362
+ </div>
363
+ </div>
364
+ ),
365
+ displacementScale: 25,
366
+ blurAmount: 1.5,
367
+ saturation: 150,
368
+ aberrationIntensity: 2,
369
+ elasticity: 0.2,
370
+ cornerRadius: 32,
371
+ mode: 'shader',
372
+ shaderVariant: 'premiumGlass',
373
+ },
374
+ decorators: [
375
+ Story => (
376
+ <BackgroundWrapper
377
+ backgroundImage="https://images.unsplash.com/photo-1579546929518-9e396f3cc809?q=80&w=2940&auto=format&fit=crop"
378
+ height="100vh"
379
+ width="100vw"
380
+ overlayOpacity={0.3}
381
+ borderRadius="0"
382
+ >
383
+ <Story />
384
+ </BackgroundWrapper>
385
+ ),
386
+ ],
387
+ parameters: {
388
+ docs: {
389
+ description: {
390
+ story:
391
+ 'Premium Glass offers advanced refraction with optimal performance. Best choice for production applications requiring high-quality shader effects.',
392
+ },
393
+ },
394
+ },
395
+ };
@@ -0,0 +1,301 @@
1
+ /**
2
+ * shared-components.tsx
3
+ *
4
+ * Shared utility components used across AtomixGlass stories.
5
+ * These components provide consistent styling and functionality for showcasing
6
+ * the AtomixGlass component in various scenarios.
7
+ *
8
+ * @package Atomix
9
+ * @component AtomixGlass
10
+ */
11
+
12
+ import React, { useState, useEffect, useCallback, useRef } from 'react';
13
+ import type { RefObject } from 'react';
14
+
15
+ /**
16
+ * Enhanced BackgroundWrapper Component
17
+ *
18
+ * A utility component used throughout the stories to provide consistent background
19
+ * styling and overlay effects. This wrapper creates a visually appealing container
20
+ * for showcasing the AtomixGlass component in various scenarios.
21
+ *
22
+ * @component BackgroundWrapper
23
+ */
24
+ export interface BackgroundWrapperProps {
25
+ /** Child elements to render inside the wrapper */
26
+ children: React.ReactNode;
27
+ /** Background image URL or index from the backgroundImages array */
28
+ backgroundImage?: string;
29
+ /** Background index to use from the predefined array */
30
+ backgroundIndex?: number;
31
+ /** Optional overlay flag for quick overlay application */
32
+ overlay?: boolean;
33
+ /** Custom overlay color in CSS format */
34
+ overlayColor?: string;
35
+ /** Overlay opacity (0-1) */
36
+ overlayOpacity?: number;
37
+ /** Container height */
38
+ height?: string;
39
+ /** Container width */
40
+ width?: string;
41
+ /** Container border radius */
42
+ borderRadius?: string;
43
+ /** Container padding */
44
+ padding?: string;
45
+ /** Additional CSS class names */
46
+ className?: string;
47
+ /** Additional inline styles */
48
+ style?: React.CSSProperties;
49
+ /** Enable interactive background movement */
50
+ interactive?: boolean;
51
+ /** ARIA hidden attribute */
52
+ 'aria-hidden'?: 'true' | 'false' | boolean;
53
+ }
54
+
55
+ /**
56
+ * Interactive Story Container
57
+ *
58
+ * A container that provides mouse tracking and interactive background effects
59
+ * for enhanced storytelling and demonstration purposes.
60
+ */
61
+ export interface StoryContainerProps {
62
+ children: React.ReactNode;
63
+ style?: React.CSSProperties;
64
+ interactive?: boolean;
65
+ }
66
+
67
+ /**
68
+ * Interactive Wrapper Component
69
+ *
70
+ * Provides mouse position tracking and offset calculations for interactive stories
71
+ */
72
+ export interface InteractiveWrapperProps {
73
+ children: (
74
+ mousePos: { x: number; y: number },
75
+ mouseOffset: { x: number; y: number },
76
+ containerRef: RefObject<HTMLDivElement>
77
+ ) => React.ReactNode;
78
+ }
79
+
80
+ /**
81
+ * Collection of high-quality background images for different moods and scenarios
82
+ *
83
+ * This array provides a variety of background options that work well with the
84
+ * AtomixGlass component, showcasing different visual styles and contexts.
85
+ */
86
+ export const backgroundImages = [
87
+ // 0: Modern office interior with natural lighting
88
+ 'https://images.pexels.com/photos/5653101/pexels-photo-5653101.jpeg',
89
+ // 1: Beautiful natural landscape - mountains and lake
90
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
91
+ // 2: Urban cityscape with modern buildings
92
+ 'https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
93
+ // 3: Forest path with sunlight filtering through trees
94
+ 'https://images.unsplash.com/photo-1441974231531-c6227db76b6e?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
95
+ // 4: Ocean waves and beach scene
96
+ 'https://images.unsplash.com/photo-1505142468610-359e7d316be0?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
97
+ // 5: Modern architecture with glass facades
98
+ 'https://images.unsplash.com/photo-1486406146926-c627a92ad1ab?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
99
+ // 6: Cozy café interior with warm lighting
100
+ 'https://images.unsplash.com/photo-1554118811-1e0d58224f24?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
101
+ // 7: Desert landscape with dramatic sky
102
+ 'https://images.unsplash.com/photo-1509316785289-025f5b846b35?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
103
+ // 8: Tropical paradise with palm trees and ocean
104
+ 'https://images.unsplash.com/photo-1506905925346-21bda4d32df4?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
105
+ // 9: Modern library or workspace with natural light
106
+ 'https://images.unsplash.com/photo-1521587760476-6c12a4b040da?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D',
107
+ ];
108
+
109
+ /**
110
+ * Legacy backgrounds object for backward compatibility
111
+ * @deprecated Use backgroundImages array instead
112
+ */
113
+ export const backgrounds = {
114
+ // Office and workspace environments
115
+ blueGradient: backgroundImages[0], // Modern office interior
116
+ purpleGradient: backgroundImages[1], // Mountain landscape
117
+ greenGradient: backgroundImages[3], // Forest path
118
+
119
+ // Apple-inspired natural scenes
120
+ macosWallpaper: backgroundImages[1], // Mountain landscape
121
+ iosWallpaper: backgroundImages[4], // Ocean waves
122
+
123
+ // Nature scenes
124
+ mountains: backgroundImages[1], // Mountain landscape
125
+ ocean: backgroundImages[4], // Ocean waves
126
+
127
+ // Urban environments
128
+ cityNight: backgroundImages[2], // Urban cityscape
129
+ cityDay: backgroundImages[5], // Modern architecture
130
+
131
+ // Interior spaces
132
+ abstract1: backgroundImages[6], // Cozy café interior
133
+ abstract2: backgroundImages[9], // Modern library
134
+
135
+ // Video backgrounds
136
+ videoBackground:
137
+ 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
138
+ };
139
+
140
+ /**
141
+ * BackgroundWrapper Component Implementation
142
+ *
143
+ * Renders a container with a background image and optional overlay,
144
+ * providing a consistent environment for showcasing the AtomixGlass component.
145
+ *
146
+ * @param props - BackgroundWrapperProps
147
+ * @returns JSX.Element
148
+ */
149
+ export const BackgroundWrapper = ({
150
+ children,
151
+ backgroundImage,
152
+ backgroundIndex,
153
+ overlay = false,
154
+ overlayColor = 'rgba(0,0,0,0)',
155
+ overlayOpacity = 0,
156
+ height = '97vh',
157
+ width = '97vw',
158
+ borderRadius = '12px',
159
+ className = '',
160
+ style = {},
161
+ }: BackgroundWrapperProps) => {
162
+ // If backgroundIndex is provided, use it to select from the backgroundImages array
163
+ const bgImage =
164
+ backgroundIndex !== undefined ? backgroundImages[backgroundIndex] : backgroundImage;
165
+
166
+ // Apply default overlay settings if overlay flag is true using nullish coalescing
167
+ const finalOverlayColor = overlay ? 'rgba(0,0,0,0.5)' : (overlayColor ?? 'rgba(0,0,0,0)');
168
+ const finalOverlayOpacity = overlay ? 0.5 : (overlayOpacity ?? 0);
169
+
170
+ return (
171
+ <div
172
+ className={`c-atomix-glass-background ${className}`}
173
+ style={{
174
+ position: 'relative',
175
+ height: height,
176
+ width: width,
177
+ backgroundColor: !bgImage ? '#1a1a2e' : undefined, // Fallback color if no image
178
+ background: bgImage
179
+ ? `url(${bgImage}) ${finalOverlayOpacity && ',' + finalOverlayColor}`
180
+ : undefined,
181
+ backgroundSize: 'cover',
182
+ backgroundPosition: 'center',
183
+ backgroundAttachment: 'fixed',
184
+ display: 'flex',
185
+ alignItems: 'center',
186
+ justifyContent: 'center',
187
+ borderRadius: borderRadius,
188
+ overflow: 'auto',
189
+ ...style,
190
+ }}
191
+ >
192
+
193
+ {children}
194
+ </div>
195
+ );
196
+ };
197
+
198
+ /**
199
+ * Interactive Story Container Component
200
+ *
201
+ * A container that provides mouse tracking and interactive background effects
202
+ * for enhanced storytelling and demonstration purposes.
203
+ */
204
+ export const StoryContainer = ({
205
+ children,
206
+ style = {},
207
+ interactive = false,
208
+ }: StoryContainerProps) => {
209
+ const containerRef = useRef<HTMLDivElement>(null);
210
+ const [backgroundPosition, setBackgroundPosition] = useState({ x: 0, y: 0 });
211
+
212
+ const handleMouseMove = useCallback(
213
+ (e: MouseEvent) => {
214
+ if (containerRef.current && interactive) {
215
+ const rect = containerRef.current.getBoundingClientRect();
216
+ const centerX = rect.left + rect.width / 2;
217
+ const centerY = rect.top + rect.height / 2;
218
+
219
+ // Calculate offset as a percentage
220
+ const offsetX = ((e.clientX - centerX) / rect.width) * 100;
221
+ const offsetY = ((e.clientY - centerY) / rect.height) * 100;
222
+
223
+ setBackgroundPosition({ x: offsetX, y: offsetY });
224
+ }
225
+ },
226
+ [interactive]
227
+ );
228
+
229
+ useEffect(() => {
230
+ const currentRef = containerRef.current;
231
+ if (currentRef && interactive) {
232
+ currentRef.addEventListener('mousemove', handleMouseMove);
233
+ return () => {
234
+ currentRef.removeEventListener('mousemove', handleMouseMove);
235
+ };
236
+ }
237
+ return undefined;
238
+ }, [handleMouseMove, interactive]);
239
+
240
+ return (
241
+ <div
242
+ ref={containerRef}
243
+ style={{
244
+ width: '100vw',
245
+ height: '100vh',
246
+ display: 'flex',
247
+ alignItems: 'center',
248
+ justifyContent: 'center',
249
+ backgroundImage: interactive
250
+ ? 'url(https://images.unsplash.com/photo-1497366216548-37526070297c?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)'
251
+ : undefined,
252
+ backgroundSize: interactive ? '160%' : 'cover',
253
+ backgroundPosition: interactive
254
+ ? `calc(50% + ${backgroundPosition.x}px) calc(50% + ${backgroundPosition.y}px)`
255
+ : 'center',
256
+ ...style,
257
+ }}
258
+ >
259
+ {children}
260
+ </div>
261
+ );
262
+ };
263
+
264
+ /**
265
+ * Interactive Wrapper Component
266
+ *
267
+ * Provides mouse position tracking and offset calculations for interactive stories
268
+ */
269
+ export const InteractiveWrapper = ({ children }: InteractiveWrapperProps) => {
270
+ const containerRef = useRef<HTMLDivElement>(null);
271
+ const [mousePos, setMousePos] = useState({ x: 0, y: 0 });
272
+ const [mouseOffset, setMouseOffset] = useState({ x: 0, y: 0 });
273
+
274
+ const handleMouseMove = useCallback((e: MouseEvent) => {
275
+ if (containerRef.current) {
276
+ const rect = containerRef.current.getBoundingClientRect();
277
+ const centerX = rect.left + rect.width / 2;
278
+ const centerY = rect.top + rect.height / 2;
279
+
280
+ setMouseOffset({
281
+ x: ((e.clientX - centerX) / rect.width) * 100,
282
+ y: ((e.clientY - centerY) / rect.height) * 100,
283
+ });
284
+ }
285
+ setMousePos({ x: e.clientX, y: e.clientY });
286
+ }, []);
287
+
288
+ useEffect(() => {
289
+ const currentRef = containerRef.current;
290
+ currentRef?.addEventListener('mousemove', handleMouseMove);
291
+ return () => {
292
+ currentRef?.removeEventListener('mousemove', handleMouseMove);
293
+ };
294
+ }, [handleMouseMove]);
295
+
296
+ return (
297
+ <div ref={containerRef} style={{ width: '100%', height: '100%' }}>
298
+ {children(mousePos, mouseOffset, containerRef)}
299
+ </div>
300
+ );
301
+ };