@shohojdhara/atomix 0.5.0 → 0.5.2
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.
- package/atomix.config.ts +12 -0
- package/build-tools/webpack-loader.js +5 -4
- package/dist/atomix.css +230 -83
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/webpack-loader.js +5 -4
- package/dist/charts.d.ts +24 -23
- package/dist/charts.js +271 -369
- package/dist/charts.js.map +1 -1
- package/dist/config.d.ts +624 -0
- package/dist/config.js +59 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +3 -2
- package/dist/core.js +342 -382
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +4 -6
- package/dist/forms.js +233 -334
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +11 -2
- package/dist/heavy.js +406 -445
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +109 -65
- package/dist/index.esm.js +654 -748
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +621 -717
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.js +59 -60
- package/dist/layout.js.map +1 -1
- package/dist/theme.js +4 -4
- package/dist/theme.js.map +1 -1
- package/package.json +24 -9
- package/scripts/atomix-cli.js +15 -1
- package/scripts/cli/__tests__/complexity-utils.test.js +24 -0
- package/scripts/cli/__tests__/detector.test.js +50 -0
- package/scripts/cli/__tests__/template-engine.test.js +23 -0
- package/scripts/cli/__tests__/test-setup.js +1 -133
- package/scripts/cli/commands/doctor.js +15 -3
- package/scripts/cli/commands/generate.js +113 -51
- package/scripts/cli/internal/ai-engine.js +30 -10
- package/scripts/cli/internal/complexity-utils.js +60 -0
- package/scripts/cli/internal/component-validator.js +49 -16
- package/scripts/cli/internal/generator.js +89 -36
- package/scripts/cli/internal/hook-generator.js +5 -2
- package/scripts/cli/internal/itcss-generator.js +16 -12
- package/scripts/cli/templates/next-templates.js +81 -30
- package/scripts/cli/templates/storybook-templates.js +12 -2
- package/scripts/cli/utils/detector.js +45 -7
- package/scripts/cli/utils/diagnostics.js +78 -0
- package/scripts/cli/utils/telemetry.js +13 -0
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +188 -128
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +63 -91
- package/src/components/AtomixGlass/PerformanceDashboard.tsx +153 -201
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +9 -6
- package/src/components/AtomixGlass/glass-utils.ts +51 -1
- package/src/components/AtomixGlass/stories/AnimationFeatures.stories.tsx +52 -46
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +573 -236
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +88 -41
- package/src/components/AtomixGlass/stories/argTypes.ts +19 -19
- package/src/components/AtomixGlass/stories/shared-components.tsx +7 -12
- package/src/components/AtomixGlass/stories/types.ts +3 -3
- package/src/components/Button/Button.tsx +114 -57
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +11 -8
- package/src/components/EdgePanel/EdgePanel.tsx +119 -115
- package/src/components/Form/Select.tsx +4 -4
- package/src/components/List/List.tsx +4 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +6 -6
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +4 -2
- package/src/components/Rating/Rating.tsx +4 -2
- package/src/components/SectionIntro/SectionIntro.tsx +4 -2
- package/src/components/Steps/Steps.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Testimonial/Testimonial.tsx +4 -2
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/layouts/CssGrid/CssGrid.stories.tsx +464 -0
- package/src/layouts/CssGrid/CssGrid.tsx +215 -0
- package/src/layouts/CssGrid/index.ts +8 -0
- package/src/layouts/CssGrid/scripts/CssGrid.js +284 -0
- package/src/layouts/CssGrid/scripts/index.js +43 -0
- package/src/layouts/Grid/scripts/Container.js +139 -0
- package/src/layouts/Grid/scripts/Grid.js +184 -0
- package/src/layouts/Grid/scripts/GridCol.js +273 -0
- package/src/layouts/Grid/scripts/Row.js +154 -0
- package/src/layouts/Grid/scripts/index.js +48 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +71 -59
- package/src/lib/composables/atomix-glass/useGlassSize.ts +1 -1
- package/src/lib/composables/useAccordion.ts +5 -5
- package/src/lib/composables/useAtomixGlass.ts +111 -74
- package/src/lib/composables/useAtomixGlassStyles.ts +0 -2
- package/src/lib/composables/useBarChart.ts +2 -2
- package/src/lib/composables/useChart.ts +3 -2
- package/src/lib/composables/useChartToolbar.ts +48 -66
- package/src/lib/composables/useDataTable.ts +1 -1
- package/src/lib/composables/useDatePicker.ts +2 -2
- package/src/lib/composables/useEdgePanel.ts +45 -54
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -5
- package/src/lib/composables/usePhotoViewer.ts +2 -3
- package/src/lib/composables/usePieChart.ts +1 -1
- package/src/lib/composables/usePopover.ts +151 -139
- package/src/lib/composables/useSideMenu.ts +28 -41
- package/src/lib/composables/useSlider.ts +2 -6
- package/src/lib/composables/useTooltip.ts +2 -2
- package/src/lib/config/index.ts +39 -0
- package/src/lib/constants/components.ts +1 -0
- package/src/lib/theme/devtools/Comparator.tsx +1 -1
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +1 -1
- package/src/lib/theme/runtime/ThemeProvider.tsx +1 -1
- package/src/lib/types/components.ts +1 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.atomix-glass.scss +174 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +42 -6
- package/src/styles/02-tools/_tools.glass.scss +6 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +162 -24
- package/src/styles/06-components/_components.atomix-glass.scss +160 -99
- package/scripts/cli/__tests__/README.md +0 -81
- package/scripts/cli/__tests__/basic.test.js +0 -116
- package/scripts/cli/__tests__/clean.test.js +0 -278
- package/scripts/cli/__tests__/component-generator.test.js +0 -332
- package/scripts/cli/__tests__/component-validator.test.js +0 -433
- package/scripts/cli/__tests__/generator.test.js +0 -613
- package/scripts/cli/__tests__/glass-motion.test.js +0 -256
- package/scripts/cli/__tests__/integration.test.js +0 -938
- package/scripts/cli/__tests__/migrate.test.js +0 -74
- package/scripts/cli/__tests__/security.test.js +0 -206
- package/scripts/cli/__tests__/theme-bridge.test.js +0 -507
- package/scripts/cli/__tests__/token-manager.test.js +0 -251
- package/scripts/cli/__tests__/token-provider.test.js +0 -361
- package/scripts/cli/__tests__/utils.test.js +0 -165
- package/src/components/AtomixGlass/stories/AnimationTests.stories.tsx +0 -95
- package/src/components/AtomixGlass/stories/CardExamples.stories.tsx +0 -212
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +0 -131
- package/src/components/AtomixGlass/stories/DashboardExamples.stories.tsx +0 -348
- package/src/components/AtomixGlass/stories/EcommerceExamples.stories.tsx +0 -410
- package/src/components/AtomixGlass/stories/FormExamples.stories.tsx +0 -436
- package/src/components/AtomixGlass/stories/HeroExamples.stories.tsx +0 -264
- package/src/components/AtomixGlass/stories/InteractivePlayground.stories.tsx +0 -247
- package/src/components/AtomixGlass/stories/MobileUIExamples.stories.tsx +0 -418
- package/src/components/AtomixGlass/stories/ModalExamples.stories.tsx +0 -402
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +0 -1082
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +0 -497
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +0 -103
- package/src/components/AtomixGlass/stories/PresetGallery.stories.tsx +0 -335
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +0 -395
- package/src/components/AtomixGlass/stories/WidgetExamples.stories.tsx +0 -441
- package/src/components/TypedButton/TypedButton.stories.tsx +0 -59
- package/src/components/TypedButton/TypedButton.tsx +0 -39
- package/src/components/TypedButton/index.ts +0 -2
- package/src/lib/composables/useBreadcrumb.ts +0 -81
- package/src/lib/composables/useChartInteractions.ts +0 -123
- package/src/lib/composables/useChartPerformance.ts +0 -347
- package/src/lib/composables/useDropdown.ts +0 -338
- package/src/lib/composables/useModal.ts +0 -110
- package/src/lib/composables/useTypedButton.ts +0 -66
- package/src/lib/hooks/usePerformanceMonitor.ts +0 -148
- package/src/lib/utils/displacement-generator.ts +0 -92
- package/src/lib/utils/memoryMonitor.ts +0 -191
- package/src/styles/01-settings/_settings.testtypecheck.scss +0 -53
- package/src/styles/01-settings/_settings.typedbutton.scss +0 -53
- package/src/styles/06-components/_components.testbutton.scss +0 -212
- package/src/styles/06-components/_components.testtypecheck.scss +0 -212
- package/src/styles/06-components/_components.typedbutton.scss +0 -212
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* EcommerceExamples.stories.tsx
|
|
3
|
-
*
|
|
4
|
-
* E-commerce examples for AtomixGlass including product cards,
|
|
5
|
-
* pricing tables, shopping carts, and checkout flows.
|
|
6
|
-
*
|
|
7
|
-
* @package Atomix
|
|
8
|
-
* @component AtomixGlass
|
|
9
|
-
*/
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { useState } from 'react';
|
|
12
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
13
|
-
import AtomixGlass from '../AtomixGlass';
|
|
14
|
-
import { BackgroundWrapper, backgroundImages, StoryErrorBoundary } from './shared-components';
|
|
15
|
-
import { baseArgTypes } from './argTypes';
|
|
16
|
-
|
|
17
|
-
import { Button } from '../../Button';
|
|
18
|
-
import { Badge } from '../../Badge';
|
|
19
|
-
|
|
20
|
-
const meta: Meta<typeof AtomixGlass> = {
|
|
21
|
-
title: 'Components/AtomixGlass/Examples/E-commerce Examples',
|
|
22
|
-
component: AtomixGlass,
|
|
23
|
-
parameters: {
|
|
24
|
-
layout: 'fullscreen',
|
|
25
|
-
docs: {
|
|
26
|
-
description: {
|
|
27
|
-
component:
|
|
28
|
-
'E-commerce examples demonstrating AtomixGlass for product displays, pricing tables, and shopping experiences.',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
tags: ['!autodocs'],
|
|
33
|
-
argTypes: {
|
|
34
|
-
...baseArgTypes,
|
|
35
|
-
children: { control: false },
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default meta;
|
|
40
|
-
type Story = StoryObj<typeof AtomixGlass>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Pricing Table
|
|
44
|
-
*
|
|
45
|
-
* Three-tier pricing table with monthly/yearly billing toggle and feature comparison.
|
|
46
|
-
*/
|
|
47
|
-
export const PricingTable: Story = {
|
|
48
|
-
render: () => {
|
|
49
|
-
const [billingCycle, setBillingCycle] = useState<'monthly' | 'yearly'>('monthly');
|
|
50
|
-
|
|
51
|
-
const plans = [
|
|
52
|
-
{
|
|
53
|
-
name: 'Starter',
|
|
54
|
-
description: 'Perfect for individuals',
|
|
55
|
-
price: { monthly: 9, yearly: 90 },
|
|
56
|
-
features: ['5 Projects', '10GB Storage', 'Basic Support', 'API Access'],
|
|
57
|
-
popular: false,
|
|
58
|
-
color: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'Professional',
|
|
62
|
-
description: 'For growing teams',
|
|
63
|
-
price: { monthly: 29, yearly: 290 },
|
|
64
|
-
features: ['Unlimited Projects', '100GB Storage', 'Priority Support', 'Analytics'],
|
|
65
|
-
popular: true,
|
|
66
|
-
color: 'linear-gradient(135deg, #f093fb 0%, #f5576c 100%)',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'Enterprise',
|
|
70
|
-
description: 'For large organizations',
|
|
71
|
-
price: { monthly: 99, yearly: 990 },
|
|
72
|
-
features: ['Unlimited Everything', '1TB Storage', 'Dedicated Support', 'SLA'],
|
|
73
|
-
popular: false,
|
|
74
|
-
color: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<StoryErrorBoundary>
|
|
80
|
-
<BackgroundWrapper backgroundImage={backgroundImages[0]} overlay overlayOpacity={0.4}>
|
|
81
|
-
<div style={{ padding: '60px 24px', minHeight: '100vh' }}>
|
|
82
|
-
{/* Header */}
|
|
83
|
-
<div className="u-text-center u-text-white u-mb-5">
|
|
84
|
-
<Badge variant="outline-light" size="lg" className="u-mb-3">
|
|
85
|
-
💎 Pricing Plans
|
|
86
|
-
</Badge>
|
|
87
|
-
<h1 className="u-mt-0 u-text-4xl u-font-bold" style={{ fontSize: '48px' }}>
|
|
88
|
-
Choose Your Plan
|
|
89
|
-
</h1>
|
|
90
|
-
<p className="u-text-lg u-opacity-90">Start free, then scale as you grow</p>
|
|
91
|
-
|
|
92
|
-
{/* Billing Toggle */}
|
|
93
|
-
<div className="u-flex u-items-center u-justify-center u-gap-3 u-mt-4">
|
|
94
|
-
<Button
|
|
95
|
-
variant={billingCycle === 'monthly' ? 'primary' : 'outline-light'}
|
|
96
|
-
glass={{ elasticity: 0 }}
|
|
97
|
-
onClick={() => setBillingCycle('monthly')}
|
|
98
|
-
size="sm"
|
|
99
|
-
>
|
|
100
|
-
Monthly
|
|
101
|
-
</Button>
|
|
102
|
-
<Button
|
|
103
|
-
variant={billingCycle === 'yearly' ? 'primary' : 'outline-light'}
|
|
104
|
-
glass={{ elasticity: 0 }}
|
|
105
|
-
onClick={() => setBillingCycle('yearly')}
|
|
106
|
-
size="sm"
|
|
107
|
-
>
|
|
108
|
-
Yearly <Badge variant="success" className="u-ml-2">Save 17%</Badge>
|
|
109
|
-
</Button>
|
|
110
|
-
</div>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
{/* Pricing Cards */}
|
|
114
|
-
<div
|
|
115
|
-
style={{
|
|
116
|
-
display: 'grid',
|
|
117
|
-
gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))',
|
|
118
|
-
gap: '24px',
|
|
119
|
-
maxWidth: '1200px',
|
|
120
|
-
margin: '0 auto',
|
|
121
|
-
}}
|
|
122
|
-
>
|
|
123
|
-
{plans.map((plan, index) => (
|
|
124
|
-
<AtomixGlass
|
|
125
|
-
key={index}
|
|
126
|
-
displacementScale={plan.popular ? 100 : 40}
|
|
127
|
-
blurAmount={1}
|
|
128
|
-
saturation={plan.popular ? 180 : 130}
|
|
129
|
-
borderRadius={24}
|
|
130
|
-
mode="standard"
|
|
131
|
-
style={{ position: 'relative' }}
|
|
132
|
-
padding="32px"
|
|
133
|
-
>
|
|
134
|
-
{plan.popular && (
|
|
135
|
-
<div
|
|
136
|
-
style={{
|
|
137
|
-
position: 'absolute',
|
|
138
|
-
top: '-12px',
|
|
139
|
-
left: '50%',
|
|
140
|
-
transform: 'translateX(-50%)',
|
|
141
|
-
background: plan.color,
|
|
142
|
-
color: 'white',
|
|
143
|
-
padding: '4px 16px',
|
|
144
|
-
borderRadius: '20px',
|
|
145
|
-
fontSize: '12px',
|
|
146
|
-
fontWeight: 700,
|
|
147
|
-
textTransform: 'uppercase',
|
|
148
|
-
}}
|
|
149
|
-
>
|
|
150
|
-
Most Popular
|
|
151
|
-
</div>
|
|
152
|
-
)}
|
|
153
|
-
|
|
154
|
-
<div className="u-text-white">
|
|
155
|
-
<div
|
|
156
|
-
style={{
|
|
157
|
-
width: '48px',
|
|
158
|
-
height: '48px',
|
|
159
|
-
borderRadius: '16px',
|
|
160
|
-
background: plan.color,
|
|
161
|
-
marginBottom: '16px',
|
|
162
|
-
display: 'flex',
|
|
163
|
-
alignItems: 'center',
|
|
164
|
-
justifyContent: 'center',
|
|
165
|
-
fontSize: '24px',
|
|
166
|
-
}}
|
|
167
|
-
aria-hidden="true"
|
|
168
|
-
>
|
|
169
|
-
{index === 0 ? '🚀' : index === 1 ? '⭐' : '👑'}
|
|
170
|
-
</div>
|
|
171
|
-
|
|
172
|
-
<h3 className="u-m-0 u-text-xl u-font-bold">{plan.name}</h3>
|
|
173
|
-
<p className="u-m-0 u-text-sm u-opacity-80 u-mb-3">{plan.description}</p>
|
|
174
|
-
|
|
175
|
-
<div className="u-mb-4">
|
|
176
|
-
<span className="u-text-4xl u-font-bold">${plan.price[billingCycle]}</span>
|
|
177
|
-
<span className="u-text-sm u-opacity-70">
|
|
178
|
-
/{billingCycle === 'monthly' ? 'month' : 'year'}
|
|
179
|
-
</span>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
<Button
|
|
183
|
-
variant={plan.popular ? 'primary' : 'outline-light'}
|
|
184
|
-
glass={{ elasticity: 0 }}
|
|
185
|
-
className="u-block u-w-full u-mb-4"
|
|
186
|
-
>
|
|
187
|
-
Get Started
|
|
188
|
-
</Button>
|
|
189
|
-
|
|
190
|
-
<div
|
|
191
|
-
style={{
|
|
192
|
-
borderTop: '1px solid rgba(255,255,255,0.1)',
|
|
193
|
-
paddingTop: '16px',
|
|
194
|
-
}}
|
|
195
|
-
>
|
|
196
|
-
<p className="u-text-xs u-font-semibold u-text-uppercase u-mb-2 u-opacity-70">
|
|
197
|
-
What's Included
|
|
198
|
-
</p>
|
|
199
|
-
<ul className="u-m-0 u-p-0" style={{ listStyle: 'none' }}>
|
|
200
|
-
{plan.features.map((feature, idx) => (
|
|
201
|
-
<li key={idx} className="u-flex u-items-center u-gap-2 u-mb-2 u-text-sm">
|
|
202
|
-
<span style={{ color: '#10b981', fontWeight: 700 }}>✓</span>
|
|
203
|
-
{feature}
|
|
204
|
-
</li>
|
|
205
|
-
))}
|
|
206
|
-
</ul>
|
|
207
|
-
</div>
|
|
208
|
-
</div>
|
|
209
|
-
</AtomixGlass>
|
|
210
|
-
))}
|
|
211
|
-
</div>
|
|
212
|
-
</div>
|
|
213
|
-
</BackgroundWrapper>
|
|
214
|
-
</StoryErrorBoundary>
|
|
215
|
-
);
|
|
216
|
-
},
|
|
217
|
-
parameters: {
|
|
218
|
-
docs: {
|
|
219
|
-
description: {
|
|
220
|
-
story:
|
|
221
|
-
'Three-tier pricing table with billing cycle toggle, feature lists, and highlighted popular plan.',
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Product Card
|
|
229
|
-
*
|
|
230
|
-
* Modern product card with image, rating, price, and add to cart functionality.
|
|
231
|
-
*/
|
|
232
|
-
export const ProductCard: Story = {
|
|
233
|
-
render: () => (
|
|
234
|
-
<StoryErrorBoundary>
|
|
235
|
-
<BackgroundWrapper backgroundImage={backgroundImages[6]} overlay overlayOpacity={0.3}>
|
|
236
|
-
<div
|
|
237
|
-
style={{
|
|
238
|
-
display: 'grid',
|
|
239
|
-
gridTemplateColumns: 'repeat(auto-fit, minmax(280px, 1fr))',
|
|
240
|
-
gap: '24px',
|
|
241
|
-
padding: '40px',
|
|
242
|
-
}}
|
|
243
|
-
>
|
|
244
|
-
{[
|
|
245
|
-
{ name: 'Premium Headphones', price: 299, rating: 4.8, reviews: 256, image: '🎧', badge: 'New' },
|
|
246
|
-
{ name: 'Smart Watch Pro', price: 449, rating: 4.9, reviews: 512, image: '⌚', badge: 'Best Seller' },
|
|
247
|
-
{ name: 'Wireless Earbuds', price: 179, rating: 4.7, reviews: 189, image: '🎵', badge: null },
|
|
248
|
-
].map((product, index) => (
|
|
249
|
-
<AtomixGlass
|
|
250
|
-
key={index}
|
|
251
|
-
displacementScale={60}
|
|
252
|
-
blurAmount={0.75}
|
|
253
|
-
saturation={140}
|
|
254
|
-
borderRadius={20}
|
|
255
|
-
mode="standard"
|
|
256
|
-
>
|
|
257
|
-
<div className="u-text-white">
|
|
258
|
-
{product.badge && (
|
|
259
|
-
<Badge variant="primary" className="u-mb-3">
|
|
260
|
-
{product.badge}
|
|
261
|
-
</Badge>
|
|
262
|
-
)}
|
|
263
|
-
|
|
264
|
-
<div
|
|
265
|
-
style={{
|
|
266
|
-
height: '200px',
|
|
267
|
-
borderRadius: '16px',
|
|
268
|
-
background: 'linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05))',
|
|
269
|
-
display: 'flex',
|
|
270
|
-
alignItems: 'center',
|
|
271
|
-
justifyContent: 'center',
|
|
272
|
-
fontSize: '80px',
|
|
273
|
-
marginBottom: '20px',
|
|
274
|
-
}}
|
|
275
|
-
aria-label={product.name}
|
|
276
|
-
>
|
|
277
|
-
{product.image}
|
|
278
|
-
</div>
|
|
279
|
-
|
|
280
|
-
<h3 className="u-m-0 u-text-lg u-font-bold u-mb-2">{product.name}</h3>
|
|
281
|
-
|
|
282
|
-
<div className="u-flex u-items-center u-gap-2 u-mb-3">
|
|
283
|
-
<div style={{ color: '#fbbf24', fontSize: '16px' }}>
|
|
284
|
-
{'★'.repeat(Math.floor(product.rating))}
|
|
285
|
-
{'☆'.repeat(5 - Math.floor(product.rating))}
|
|
286
|
-
</div>
|
|
287
|
-
<span className="u-text-sm u-opacity-80">
|
|
288
|
-
{product.rating} ({product.reviews} reviews)
|
|
289
|
-
</span>
|
|
290
|
-
</div>
|
|
291
|
-
|
|
292
|
-
<div className="u-flex u-items-center u-justify-between">
|
|
293
|
-
<span className="u-text-2xl u-font-bold">${product.price}</span>
|
|
294
|
-
<Button glass size="sm" variant="primary">
|
|
295
|
-
Add to Cart
|
|
296
|
-
</Button>
|
|
297
|
-
</div>
|
|
298
|
-
</div>
|
|
299
|
-
</AtomixGlass>
|
|
300
|
-
))}
|
|
301
|
-
</div>
|
|
302
|
-
</BackgroundWrapper>
|
|
303
|
-
</StoryErrorBoundary>
|
|
304
|
-
),
|
|
305
|
-
parameters: {
|
|
306
|
-
docs: {
|
|
307
|
-
description: {
|
|
308
|
-
story:
|
|
309
|
-
'Product cards with images, ratings, prices, and add to cart buttons in a responsive grid layout.',
|
|
310
|
-
},
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Shopping Cart Summary
|
|
317
|
-
*
|
|
318
|
-
* Cart summary with items, quantities, and total calculation.
|
|
319
|
-
*/
|
|
320
|
-
export const ShoppingCart: Story = {
|
|
321
|
-
render: () => {
|
|
322
|
-
const [items] = useState([
|
|
323
|
-
{ id: 1, name: 'Premium Headphones', price: 299, quantity: 1, image: '🎧' },
|
|
324
|
-
{ id: 2, name: 'USB-C Cable', price: 19, quantity: 2, image: '🔌' },
|
|
325
|
-
{ id: 3, name: 'Phone Case', price: 39, quantity: 1, image: '📱' },
|
|
326
|
-
]);
|
|
327
|
-
|
|
328
|
-
const total = items.reduce((sum, item) => sum + item.price * item.quantity, 0);
|
|
329
|
-
|
|
330
|
-
return (
|
|
331
|
-
<StoryErrorBoundary>
|
|
332
|
-
<BackgroundWrapper backgroundImage={backgroundImages[2]} overlay overlayOpacity={0.4}>
|
|
333
|
-
<div style={{ maxWidth: '500px' }} className="u-mx-auto">
|
|
334
|
-
<AtomixGlass
|
|
335
|
-
displacementScale={65}
|
|
336
|
-
blurAmount={0.75}
|
|
337
|
-
saturation={140}
|
|
338
|
-
borderRadius={24}
|
|
339
|
-
mode="standard"
|
|
340
|
-
padding="32px"
|
|
341
|
-
>
|
|
342
|
-
<div className="u-text-white">
|
|
343
|
-
<h2 className="u-mt-0 u-text-2xl u-font-bold u-mb-4">Shopping Cart</h2>
|
|
344
|
-
|
|
345
|
-
<div className="u-divide-y" style={{ borderColor: 'rgba(255,255,255,0.1)' }}>
|
|
346
|
-
{items.map((item) => (
|
|
347
|
-
<div key={item.id} className="u-py-3 u-flex u-items-center u-gap-3">
|
|
348
|
-
<div
|
|
349
|
-
style={{
|
|
350
|
-
width: '60px',
|
|
351
|
-
height: '60px',
|
|
352
|
-
borderRadius: '12px',
|
|
353
|
-
background: 'rgba(255,255,255,0.1)',
|
|
354
|
-
display: 'flex',
|
|
355
|
-
alignItems: 'center',
|
|
356
|
-
justifyContent: 'center',
|
|
357
|
-
fontSize: '28px',
|
|
358
|
-
flexShrink: 0,
|
|
359
|
-
}}
|
|
360
|
-
aria-hidden="true"
|
|
361
|
-
>
|
|
362
|
-
{item.image}
|
|
363
|
-
</div>
|
|
364
|
-
<div className="u-flex-1">
|
|
365
|
-
<p className="u-m-0 u-font-medium">{item.name}</p>
|
|
366
|
-
<p className="u-m-0 u-text-sm u-opacity-70">
|
|
367
|
-
${item.price} × {item.quantity}
|
|
368
|
-
</p>
|
|
369
|
-
</div>
|
|
370
|
-
<p className="u-m-0 u-font-semibold">
|
|
371
|
-
${(item.price * item.quantity).toFixed(2)}
|
|
372
|
-
</p>
|
|
373
|
-
</div>
|
|
374
|
-
))}
|
|
375
|
-
</div>
|
|
376
|
-
|
|
377
|
-
<div
|
|
378
|
-
style={{
|
|
379
|
-
borderTop: '2px solid rgba(255,255,255,0.1)',
|
|
380
|
-
paddingTop: '20px',
|
|
381
|
-
marginTop: '20px',
|
|
382
|
-
}}
|
|
383
|
-
>
|
|
384
|
-
<div className="u-flex u-items-center u-justify-between u-mb-4">
|
|
385
|
-
<span className="u-text-lg u-font-semibold">Total</span>
|
|
386
|
-
<span className="u-text-3xl u-font-bold">${total.toFixed(2)}</span>
|
|
387
|
-
</div>
|
|
388
|
-
<Button variant="primary" glass={{ elasticity: 0 }} size="lg" className="u-block u-w-full">
|
|
389
|
-
Checkout
|
|
390
|
-
</Button>
|
|
391
|
-
<p className="u-text-center u-text-xs u-opacity-70 u-mt-3">
|
|
392
|
-
Free shipping on orders over $500
|
|
393
|
-
</p>
|
|
394
|
-
</div>
|
|
395
|
-
</div>
|
|
396
|
-
</AtomixGlass>
|
|
397
|
-
</div>
|
|
398
|
-
</BackgroundWrapper>
|
|
399
|
-
</StoryErrorBoundary>
|
|
400
|
-
);
|
|
401
|
-
},
|
|
402
|
-
parameters: {
|
|
403
|
-
docs: {
|
|
404
|
-
description: {
|
|
405
|
-
story:
|
|
406
|
-
'Shopping cart summary with product items, quantities, subtotal calculations, and checkout button.',
|
|
407
|
-
},
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
};
|