@shohojdhara/atomix 0.2.1 → 0.2.3
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/README.md +1 -28
- package/dist/atomix.css +1500 -241
- package/dist/atomix.min.css +6 -6
- package/dist/index.d.ts +1052 -194
- package/dist/index.esm.js +12201 -6066
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5481 -2827
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/themes/boomdevs.css +1500 -301
- package/dist/themes/boomdevs.min.css +60 -8
- package/dist/themes/esrar.css +1500 -241
- package/dist/themes/esrar.min.css +6 -6
- package/dist/themes/mashroom.css +1496 -237
- package/dist/themes/mashroom.min.css +8 -8
- package/dist/themes/shaj-default.css +1451 -192
- package/dist/themes/shaj-default.min.css +6 -6
- package/package.json +66 -15
- package/src/components/Accordion/Accordion.stories.tsx +137 -0
- package/src/components/Accordion/Accordion.tsx +33 -3
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +3011 -0
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +199 -0
- package/src/components/AtomixGlass/AtomixGlass.tsx +1281 -0
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +1369 -0
- package/src/components/AtomixGlass/README.md +134 -0
- package/src/components/AtomixGlass/index.ts +10 -0
- package/src/components/AtomixGlass/shader-utils.ts +140 -0
- package/src/components/AtomixGlass/utils.ts +8 -0
- package/src/components/Badge/Badge.stories.tsx +169 -0
- package/src/components/Badge/Badge.tsx +27 -2
- package/src/components/Button/Button.stories.tsx +345 -0
- package/src/components/Button/Button.tsx +35 -3
- package/src/components/Button/README.md +216 -0
- package/src/components/Callout/Callout.stories.tsx +813 -78
- package/src/components/Callout/Callout.test.tsx +368 -0
- package/src/components/Callout/Callout.tsx +26 -7
- package/src/components/Callout/README.md +409 -0
- package/src/components/Card/Card.stories.tsx +140 -0
- package/src/components/Card/Card.tsx +19 -3
- package/src/components/DatePicker/DatePicker copy.tsx +551 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +188 -0
- package/src/components/DatePicker/DatePicker.tsx +379 -332
- package/src/components/DatePicker/readme.md +110 -1
- package/src/components/DatePicker/types.ts +8 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +145 -0
- package/src/components/Dropdown/Dropdown.tsx +34 -5
- package/src/components/Footer/Footer.stories.tsx +388 -0
- package/src/components/Footer/Footer.tsx +197 -0
- package/src/components/Footer/FooterLink.tsx +72 -0
- package/src/components/Footer/FooterSection.tsx +87 -0
- package/src/components/Footer/FooterSocialLink.tsx +117 -0
- package/src/components/Footer/README.md +261 -0
- package/src/components/Footer/index.ts +13 -0
- package/src/components/Form/Checkbox.stories.tsx +101 -0
- package/src/components/Form/Checkbox.tsx +26 -2
- package/src/components/Form/Input.stories.tsx +124 -0
- package/src/components/Form/Input.tsx +36 -7
- package/src/components/Form/Radio.stories.tsx +139 -0
- package/src/components/Form/Radio.tsx +26 -2
- package/src/components/Form/Select.stories.tsx +110 -0
- package/src/components/Form/Select.tsx +26 -2
- package/src/components/Form/Textarea.stories.tsx +104 -0
- package/src/components/Form/Textarea.tsx +36 -7
- package/src/components/Hero/Hero.stories.tsx +54 -1
- package/src/components/Hero/Hero.tsx +70 -11
- package/src/components/Modal/Modal.stories.tsx +235 -0
- package/src/components/Modal/Modal.tsx +64 -35
- package/src/components/Pagination/Pagination.stories.tsx +101 -0
- package/src/components/Pagination/Pagination.tsx +25 -1
- package/src/components/Popover/Popover.stories.tsx +94 -0
- package/src/components/Popover/Popover.tsx +30 -4
- package/src/components/Rating/Rating.stories.tsx +112 -0
- package/src/components/Rating/Rating.tsx +25 -1
- package/src/components/SectionIntro/SectionIntro.tsx +9 -11
- package/src/components/Slider/Slider.stories.tsx +634 -50
- package/src/components/Slider/Slider.tsx +5 -3
- package/src/components/Steps/Steps.stories.tsx +119 -0
- package/src/components/Steps/Steps.tsx +32 -1
- package/src/components/Tab/Tab.stories.tsx +88 -0
- package/src/components/Tab/Tab.tsx +32 -1
- package/src/components/Toggle/Toggle.stories.tsx +92 -0
- package/src/components/Toggle/Toggle.tsx +32 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +131 -0
- package/src/components/Tooltip/Tooltip.tsx +43 -7
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +1002 -196
- package/src/components/VideoPlayer/VideoPlayer.tsx +161 -4
- package/src/components/index.ts +14 -0
- package/src/layouts/Grid/Grid.stories.tsx +226 -159
- package/src/lib/composables/index.ts +4 -0
- package/src/lib/composables/useAtomixGlass.ts +71 -0
- package/src/lib/composables/useButton.ts +3 -1
- package/src/lib/composables/useCallout.ts +4 -1
- package/src/lib/composables/useFooter.ts +85 -0
- package/src/lib/composables/useGlassContainer.ts +168 -0
- package/src/lib/composables/useSlider.ts +191 -4
- package/src/lib/constants/components.ts +173 -0
- package/src/lib/types/components.ts +622 -0
- package/src/lib/utils/displacement-generator.ts +86 -0
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.accordion.scss +20 -19
- package/src/styles/01-settings/_settings.animations.scss +5 -5
- package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
- package/src/styles/01-settings/_settings.avatar.scss +17 -18
- package/src/styles/01-settings/_settings.background.scss +10 -0
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +8 -2
- package/src/styles/01-settings/_settings.callout.scss +7 -7
- package/src/styles/01-settings/_settings.card.scss +2 -2
- package/src/styles/01-settings/_settings.chart.scss +7 -7
- package/src/styles/01-settings/_settings.checkbox-group.scss +5 -2
- package/src/styles/01-settings/_settings.checkbox.scss +10 -4
- package/src/styles/01-settings/_settings.countdown.scss +6 -4
- package/src/styles/01-settings/_settings.dropdown.scss +9 -7
- package/src/styles/01-settings/_settings.edge-panel.scss +3 -2
- package/src/styles/01-settings/_settings.footer.scss +125 -0
- package/src/styles/01-settings/_settings.form-group.scss +3 -1
- package/src/styles/01-settings/_settings.form.scss +4 -2
- package/src/styles/01-settings/_settings.hero.scss +9 -7
- package/src/styles/01-settings/_settings.input.scss +9 -7
- package/src/styles/01-settings/_settings.list-group.scss +4 -2
- package/src/styles/01-settings/_settings.list.scss +4 -2
- package/src/styles/01-settings/_settings.menu.scss +10 -8
- package/src/styles/01-settings/_settings.messages.scss +19 -17
- package/src/styles/01-settings/_settings.modal.scss +6 -4
- package/src/styles/01-settings/_settings.nav.scss +6 -4
- package/src/styles/01-settings/_settings.navbar.scss +8 -5
- package/src/styles/01-settings/_settings.pagination.scss +5 -3
- package/src/styles/01-settings/_settings.popover.scss +6 -4
- package/src/styles/01-settings/_settings.rating.scss +5 -3
- package/src/styles/01-settings/_settings.river.scss +8 -6
- package/src/styles/01-settings/_settings.sectionintro.scss +8 -6
- package/src/styles/01-settings/_settings.select.scss +7 -5
- package/src/styles/01-settings/_settings.side-menu.scss +15 -13
- package/src/styles/01-settings/_settings.spacing.scss +4 -0
- package/src/styles/01-settings/_settings.steps.scss +7 -5
- package/src/styles/01-settings/_settings.tabs.scss +7 -5
- package/src/styles/01-settings/_settings.testimonials.scss +6 -4
- package/src/styles/01-settings/_settings.toggle.scss +3 -1
- package/src/styles/01-settings/_settings.tooltip.scss +5 -3
- package/src/styles/01-settings/_settings.upload.scss +22 -20
- package/src/styles/02-tools/_tools.animations.scss +19 -0
- package/src/styles/02-tools/_tools.background.scss +87 -0
- package/src/styles/02-tools/_tools.glass.scss +1 -0
- package/src/styles/02-tools/_tools.rem.scss +18 -5
- package/src/styles/02-tools/_tools.utility-api.scss +32 -26
- package/src/styles/03-generic/_generic.root.scss +15 -2
- package/src/styles/04-elements/_elements.body.scss +6 -0
- package/src/styles/06-components/_components.accordion.scss +24 -4
- package/src/styles/06-components/_components.atomix-glass.scss +0 -0
- package/src/styles/06-components/_components.avatar-group.scss +2 -1
- package/src/styles/06-components/_components.avatar.scss +2 -1
- package/src/styles/06-components/_components.badge.scss +36 -1
- package/src/styles/06-components/_components.breadcrumb.scss +2 -1
- package/src/styles/06-components/_components.button.scss +14 -3
- package/src/styles/06-components/_components.callout.scss +44 -4
- package/src/styles/06-components/_components.card.scss +21 -2
- package/src/styles/06-components/_components.chart.scss +3 -2
- package/src/styles/06-components/_components.checkbox.scss +2 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -2
- package/src/styles/06-components/_components.countdown.scss +2 -1
- package/src/styles/06-components/_components.data-table.scss +7 -6
- package/src/styles/06-components/_components.datepicker.scss +20 -1
- package/src/styles/06-components/_components.dropdown.scss +11 -4
- package/src/styles/06-components/_components.edge-panel.scss +4 -3
- package/src/styles/06-components/_components.footer.scss +825 -0
- package/src/styles/06-components/_components.form-group.scss +1 -0
- package/src/styles/06-components/_components.hero.scss +4 -4
- package/src/styles/06-components/_components.image-gallery.scss +1 -0
- package/src/styles/06-components/_components.input.scss +33 -2
- package/src/styles/06-components/_components.list-group.scss +3 -2
- package/src/styles/06-components/_components.list.scss +2 -1
- package/src/styles/06-components/_components.menu.scss +5 -4
- package/src/styles/06-components/_components.messages.scss +8 -7
- package/src/styles/06-components/_components.modal.scss +3 -2
- package/src/styles/06-components/_components.nav.scss +6 -5
- package/src/styles/06-components/_components.navbar.scss +4 -3
- package/src/styles/06-components/_components.pagination.scss +2 -1
- package/src/styles/06-components/_components.photoviewer.scss +4 -3
- package/src/styles/06-components/_components.popover.scss +3 -2
- package/src/styles/06-components/_components.product-review.scss +3 -2
- package/src/styles/06-components/_components.progress.scss +3 -2
- package/src/styles/06-components/_components.river.scss +3 -2
- package/src/styles/06-components/_components.sectionintro.scss +2 -1
- package/src/styles/06-components/_components.select.scss +5 -4
- package/src/styles/06-components/_components.side-menu.scss +8 -7
- package/src/styles/06-components/_components.skeleton.scss +3 -2
- package/src/styles/06-components/_components.slider.scss +7 -6
- package/src/styles/06-components/_components.spinner.scss +1 -0
- package/src/styles/06-components/_components.steps.scss +3 -2
- package/src/styles/06-components/_components.tabs.scss +4 -3
- package/src/styles/06-components/_components.testimonials.scss +2 -1
- package/src/styles/06-components/_components.todo.scss +3 -2
- package/src/styles/06-components/_components.toggle.scss +5 -4
- package/src/styles/06-components/_components.tooltip.scss +3 -2
- package/src/styles/06-components/_components.upload.scss +4 -3
- package/src/styles/06-components/_components.video-player.scss +50 -27
- package/src/styles/06-components/_index.scss +2 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +48 -0
- package/dist/themes/yabai.css +0 -13711
- package/dist/themes/yabai.min.css +0 -189
|
@@ -16,6 +16,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
16
16
|
allowTouchMove = true,
|
|
17
17
|
threshold = 50,
|
|
18
18
|
grabCursor = true,
|
|
19
|
+
autoplay,
|
|
19
20
|
navigation,
|
|
20
21
|
pagination,
|
|
21
22
|
className,
|
|
@@ -41,6 +42,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
41
42
|
speed,
|
|
42
43
|
allowTouchMove,
|
|
43
44
|
threshold,
|
|
45
|
+
autoplay,
|
|
44
46
|
onSlideChange,
|
|
45
47
|
});
|
|
46
48
|
|
|
@@ -82,7 +84,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
82
84
|
|
|
83
85
|
return (
|
|
84
86
|
<div
|
|
85
|
-
ref={ref || containerRef}
|
|
87
|
+
ref={ref || (containerRef as React.RefObject<HTMLDivElement>)}
|
|
86
88
|
className={containerClasses}
|
|
87
89
|
style={{
|
|
88
90
|
height: typeof height === 'number' ? `${height}px` : height,
|
|
@@ -101,7 +103,7 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
101
103
|
onMouseLeave={handleTouchEnd}
|
|
102
104
|
>
|
|
103
105
|
<div
|
|
104
|
-
ref={wrapperRef}
|
|
106
|
+
ref={wrapperRef as React.RefObject<HTMLDivElement>}
|
|
105
107
|
className="c-slider__wrapper"
|
|
106
108
|
style={{
|
|
107
109
|
display: 'flex',
|
|
@@ -222,4 +224,4 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
222
224
|
);
|
|
223
225
|
});
|
|
224
226
|
|
|
225
|
-
Slider.displayName = 'Slider';
|
|
227
|
+
Slider.displayName = 'Slider';
|
|
@@ -16,6 +16,10 @@ export default {
|
|
|
16
16
|
control: { type: 'boolean' },
|
|
17
17
|
defaultValue: false,
|
|
18
18
|
},
|
|
19
|
+
glass: {
|
|
20
|
+
control: 'boolean',
|
|
21
|
+
description: 'Enable glass morphism effect',
|
|
22
|
+
},
|
|
19
23
|
},
|
|
20
24
|
} as Meta<typeof Steps>;
|
|
21
25
|
|
|
@@ -156,3 +160,118 @@ export const Interactive: StoryFn<typeof Steps> = () => (
|
|
|
156
160
|
<InteractiveSteps />
|
|
157
161
|
</div>
|
|
158
162
|
);
|
|
163
|
+
|
|
164
|
+
export const Glass = {
|
|
165
|
+
args: {
|
|
166
|
+
items: [
|
|
167
|
+
{ number: 1, text: 'Glass Step 1' },
|
|
168
|
+
{ number: 2, text: 'Glass Step 2' },
|
|
169
|
+
{ number: 3, text: 'Glass Step 3' },
|
|
170
|
+
{ number: 4, text: 'Glass Step 4' },
|
|
171
|
+
{ number: 5, text: 'Glass Step 5' },
|
|
172
|
+
],
|
|
173
|
+
activeIndex: 1,
|
|
174
|
+
vertical: false,
|
|
175
|
+
glass: true,
|
|
176
|
+
},
|
|
177
|
+
render: (args) => (
|
|
178
|
+
<div
|
|
179
|
+
style={{
|
|
180
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
181
|
+
padding: '2rem',
|
|
182
|
+
borderRadius: '12px',
|
|
183
|
+
minHeight: '300px',
|
|
184
|
+
display: 'flex',
|
|
185
|
+
alignItems: 'center',
|
|
186
|
+
justifyContent: 'center',
|
|
187
|
+
}}
|
|
188
|
+
>
|
|
189
|
+
<div style={{ width: '100%', maxWidth: '800px' }}>
|
|
190
|
+
<Steps {...args} />
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
),
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const GlassVertical = {
|
|
197
|
+
args: {
|
|
198
|
+
items: [
|
|
199
|
+
{ number: 1, text: 'Glass Step 1' },
|
|
200
|
+
{ number: 2, text: 'Glass Step 2' },
|
|
201
|
+
{ number: 3, text: 'Glass Step 3' },
|
|
202
|
+
{ number: 4, text: 'Glass Step 4' },
|
|
203
|
+
{ number: 5, text: 'Glass Step 5' },
|
|
204
|
+
],
|
|
205
|
+
activeIndex: 1,
|
|
206
|
+
vertical: true,
|
|
207
|
+
glass: true,
|
|
208
|
+
},
|
|
209
|
+
render: (args) => (
|
|
210
|
+
<div
|
|
211
|
+
style={{
|
|
212
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
213
|
+
backgroundSize: 'cover',
|
|
214
|
+
backgroundPosition: 'center',
|
|
215
|
+
padding: '2rem',
|
|
216
|
+
borderRadius: '12px',
|
|
217
|
+
minHeight: '500px',
|
|
218
|
+
display: 'flex',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
justifyContent: 'center',
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
<div style={{ width: '100%', maxWidth: '400px' }}>
|
|
224
|
+
<Steps {...args} />
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export const GlassCustom = {
|
|
231
|
+
args: {
|
|
232
|
+
items: [
|
|
233
|
+
{ number: 1, text: 'Custom Glass Step 1' },
|
|
234
|
+
{ number: 2, text: 'Custom Glass Step 2' },
|
|
235
|
+
{ number: 3, text: 'Custom Glass Step 3' },
|
|
236
|
+
{ number: 4, text: 'Custom Glass Step 4' },
|
|
237
|
+
{ number: 5, text: 'Custom Glass Step 5' },
|
|
238
|
+
],
|
|
239
|
+
activeIndex: 1,
|
|
240
|
+
vertical: false,
|
|
241
|
+
glass: {
|
|
242
|
+
displacementScale: 80,
|
|
243
|
+
blurAmount: 2,
|
|
244
|
+
saturation: 200,
|
|
245
|
+
aberrationIntensity: 0.8,
|
|
246
|
+
cornerRadius: 12,
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
render: (args) => (
|
|
250
|
+
<div
|
|
251
|
+
style={{
|
|
252
|
+
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
253
|
+
backgroundSize: '400% 400%',
|
|
254
|
+
animation: 'gradient 15s ease infinite',
|
|
255
|
+
padding: '2rem',
|
|
256
|
+
borderRadius: '12px',
|
|
257
|
+
minHeight: '400px',
|
|
258
|
+
display: 'flex',
|
|
259
|
+
alignItems: 'center',
|
|
260
|
+
justifyContent: 'center',
|
|
261
|
+
}}
|
|
262
|
+
>
|
|
263
|
+
<style>
|
|
264
|
+
{`
|
|
265
|
+
@keyframes gradient {
|
|
266
|
+
0% { background-position: 0% 50%; }
|
|
267
|
+
50% { background-position: 100% 50%; }
|
|
268
|
+
100% { background-position: 0% 50%; }
|
|
269
|
+
}
|
|
270
|
+
`}
|
|
271
|
+
</style>
|
|
272
|
+
<div style={{ width: '100%', maxWidth: '800px' }}>
|
|
273
|
+
<Steps {...args} />
|
|
274
|
+
</div>
|
|
275
|
+
</div>
|
|
276
|
+
),
|
|
277
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState, ReactNode } from 'react';
|
|
2
2
|
import { STEPS } from '../../lib/constants/components';
|
|
3
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
|
+
import { AtomixGlassProps } from '../../lib/types/components';
|
|
3
5
|
|
|
4
6
|
export interface StepItem {
|
|
5
7
|
/**
|
|
@@ -43,6 +45,12 @@ export interface StepsProps {
|
|
|
43
45
|
* Additional CSS class
|
|
44
46
|
*/
|
|
45
47
|
className?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Glass morphism effect for the steps component
|
|
51
|
+
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
52
|
+
*/
|
|
53
|
+
glass?: AtomixGlassProps | boolean;
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
/**
|
|
@@ -54,6 +62,7 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
54
62
|
vertical = false,
|
|
55
63
|
onStepChange,
|
|
56
64
|
className = '',
|
|
65
|
+
glass,
|
|
57
66
|
}) => {
|
|
58
67
|
const [currentStep, setCurrentStep] = useState(activeIndex);
|
|
59
68
|
|
|
@@ -86,7 +95,7 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
86
95
|
}
|
|
87
96
|
};
|
|
88
97
|
|
|
89
|
-
|
|
98
|
+
const stepsContent = (
|
|
90
99
|
<div
|
|
91
100
|
className={`c-steps ${vertical ? STEPS.CLASSES.VERTICAL : ''} ${className}`}
|
|
92
101
|
role="navigation"
|
|
@@ -108,6 +117,28 @@ export const Steps: React.FC<StepsProps> = ({
|
|
|
108
117
|
))}
|
|
109
118
|
</div>
|
|
110
119
|
);
|
|
120
|
+
|
|
121
|
+
if (glass) {
|
|
122
|
+
// Default glass settings for steps
|
|
123
|
+
const defaultGlassProps = {
|
|
124
|
+
displacementScale: 60,
|
|
125
|
+
blurAmount: 1,
|
|
126
|
+
saturation: 160,
|
|
127
|
+
aberrationIntensity: 0.5,
|
|
128
|
+
cornerRadius: 8,
|
|
129
|
+
mode: 'shader' as const,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<AtomixGlass {...glassProps}>
|
|
136
|
+
{stepsContent}
|
|
137
|
+
</AtomixGlass>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return stepsContent;
|
|
111
142
|
};
|
|
112
143
|
|
|
113
144
|
Steps.displayName = 'Steps';
|
|
@@ -11,6 +11,10 @@ export default {
|
|
|
11
11
|
control: { type: 'number' },
|
|
12
12
|
defaultValue: 0,
|
|
13
13
|
},
|
|
14
|
+
glass: {
|
|
15
|
+
control: 'boolean',
|
|
16
|
+
description: 'Enable glass morphism effect',
|
|
17
|
+
},
|
|
14
18
|
},
|
|
15
19
|
} as Meta<typeof Tab>;
|
|
16
20
|
|
|
@@ -127,3 +131,87 @@ WithRichContent.args = {
|
|
|
127
131
|
],
|
|
128
132
|
activeIndex: 0,
|
|
129
133
|
};
|
|
134
|
+
|
|
135
|
+
export const Glass = {
|
|
136
|
+
args: {
|
|
137
|
+
items: [
|
|
138
|
+
{
|
|
139
|
+
label: 'Glass Tab 1',
|
|
140
|
+
content: <p>This is the content for Glass Tab 1 with glass morphism effect.</p>,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: 'Glass Tab 2',
|
|
144
|
+
content: <p>This is the content for Glass Tab 2 with glass morphism effect.</p>,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'Glass Tab 3',
|
|
148
|
+
content: <p>This is the content for Glass Tab 3 with glass morphism effect.</p>,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
activeIndex: 0,
|
|
152
|
+
glass: true,
|
|
153
|
+
},
|
|
154
|
+
render: (args) => (
|
|
155
|
+
<div
|
|
156
|
+
style={{
|
|
157
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
158
|
+
padding: '2rem',
|
|
159
|
+
borderRadius: '12px',
|
|
160
|
+
minHeight: '400px',
|
|
161
|
+
display: 'flex',
|
|
162
|
+
alignItems: 'center',
|
|
163
|
+
justifyContent: 'center',
|
|
164
|
+
}}
|
|
165
|
+
>
|
|
166
|
+
<div style={{ width: '100%', maxWidth: '600px' }}>
|
|
167
|
+
<Tab {...args} />
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const GlassCustom = {
|
|
174
|
+
args: {
|
|
175
|
+
items: [
|
|
176
|
+
{
|
|
177
|
+
label: 'Custom Glass Tab 1',
|
|
178
|
+
content: <p>This tab has custom glass morphism settings.</p>,
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
label: 'Custom Glass Tab 2',
|
|
182
|
+
content: <p>Enhanced glass effect with custom parameters.</p>,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
label: 'Custom Glass Tab 3',
|
|
186
|
+
content: <p>Another tab with the same custom glass settings.</p>,
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
activeIndex: 0,
|
|
190
|
+
glass: {
|
|
191
|
+
displacementScale: 80,
|
|
192
|
+
blurAmount: 2,
|
|
193
|
+
saturation: 200,
|
|
194
|
+
aberrationIntensity: 0.8,
|
|
195
|
+
cornerRadius: 12,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
render: (args) => (
|
|
199
|
+
<div
|
|
200
|
+
style={{
|
|
201
|
+
background: 'url(https://images.unsplash.com/photo-1519904981063-b0cf448d479e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
202
|
+
backgroundSize: 'cover',
|
|
203
|
+
backgroundPosition: 'center',
|
|
204
|
+
padding: '2rem',
|
|
205
|
+
borderRadius: '12px',
|
|
206
|
+
minHeight: '500px',
|
|
207
|
+
display: 'flex',
|
|
208
|
+
alignItems: 'center',
|
|
209
|
+
justifyContent: 'center',
|
|
210
|
+
}}
|
|
211
|
+
>
|
|
212
|
+
<div style={{ width: '100%', maxWidth: '600px' }}>
|
|
213
|
+
<Tab {...args} />
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
),
|
|
217
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useState, ReactNode } from 'react';
|
|
2
2
|
import { TAB } from '../../lib/constants/components';
|
|
3
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
|
+
import { AtomixGlassProps } from '../../lib/types/components';
|
|
3
5
|
|
|
4
6
|
export interface TabItemProps {
|
|
5
7
|
/**
|
|
@@ -43,6 +45,12 @@ export interface TabProps {
|
|
|
43
45
|
* Additional CSS class for the tab component
|
|
44
46
|
*/
|
|
45
47
|
className?: string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Glass morphism effect for the tab component
|
|
51
|
+
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
52
|
+
*/
|
|
53
|
+
glass?: AtomixGlassProps | boolean;
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
/**
|
|
@@ -53,6 +61,7 @@ export const Tab: React.FC<TabProps> = ({
|
|
|
53
61
|
activeIndex = TAB.DEFAULTS.ACTIVE_INDEX,
|
|
54
62
|
onTabChange,
|
|
55
63
|
className = '',
|
|
64
|
+
glass,
|
|
56
65
|
}) => {
|
|
57
66
|
const [currentTab, setCurrentTab] = useState(activeIndex);
|
|
58
67
|
|
|
@@ -64,7 +73,7 @@ export const Tab: React.FC<TabProps> = ({
|
|
|
64
73
|
}
|
|
65
74
|
};
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
const tabContent = (
|
|
68
77
|
<div className={`c-tabs js-atomix-tab ${className}`}>
|
|
69
78
|
<ul className="c-tabs__nav">
|
|
70
79
|
{items.map((item, index) => (
|
|
@@ -104,6 +113,28 @@ export const Tab: React.FC<TabProps> = ({
|
|
|
104
113
|
</div>
|
|
105
114
|
</div>
|
|
106
115
|
);
|
|
116
|
+
|
|
117
|
+
if (glass) {
|
|
118
|
+
// Default glass settings for tabs
|
|
119
|
+
const defaultGlassProps = {
|
|
120
|
+
displacementScale: 60,
|
|
121
|
+
blurAmount: 1,
|
|
122
|
+
saturation: 160,
|
|
123
|
+
aberrationIntensity: 0.5,
|
|
124
|
+
cornerRadius: 8,
|
|
125
|
+
mode: 'shader' as const,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<AtomixGlass {...glassProps}>
|
|
132
|
+
{tabContent}
|
|
133
|
+
</AtomixGlass>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return tabContent;
|
|
107
138
|
};
|
|
108
139
|
|
|
109
140
|
Tab.displayName = 'Tab';
|
|
@@ -15,6 +15,10 @@ export default {
|
|
|
15
15
|
control: { type: 'boolean' },
|
|
16
16
|
defaultValue: false,
|
|
17
17
|
},
|
|
18
|
+
glass: {
|
|
19
|
+
control: 'boolean',
|
|
20
|
+
description: 'Enable glass morphism effect',
|
|
21
|
+
},
|
|
18
22
|
},
|
|
19
23
|
} as Meta<typeof Toggle>;
|
|
20
24
|
|
|
@@ -47,3 +51,91 @@ DisabledOn.args = {
|
|
|
47
51
|
initialOn: true,
|
|
48
52
|
disabled: true,
|
|
49
53
|
};
|
|
54
|
+
|
|
55
|
+
export const Glass = {
|
|
56
|
+
args: {
|
|
57
|
+
initialOn: false,
|
|
58
|
+
disabled: false,
|
|
59
|
+
glass: true,
|
|
60
|
+
},
|
|
61
|
+
render: (args) => (
|
|
62
|
+
<div
|
|
63
|
+
style={{
|
|
64
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
65
|
+
padding: '3rem',
|
|
66
|
+
borderRadius: '12px',
|
|
67
|
+
minHeight: '200px',
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<Toggle {...args} />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const GlassOn = {
|
|
79
|
+
args: {
|
|
80
|
+
initialOn: true,
|
|
81
|
+
disabled: false,
|
|
82
|
+
glass: true,
|
|
83
|
+
},
|
|
84
|
+
render: (args) => (
|
|
85
|
+
<div
|
|
86
|
+
style={{
|
|
87
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
88
|
+
backgroundSize: 'cover',
|
|
89
|
+
backgroundPosition: 'center',
|
|
90
|
+
padding: '3rem',
|
|
91
|
+
borderRadius: '12px',
|
|
92
|
+
minHeight: '200px',
|
|
93
|
+
display: 'flex',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
justifyContent: 'center',
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
<Toggle {...args} />
|
|
99
|
+
</div>
|
|
100
|
+
),
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const GlassCustom = {
|
|
104
|
+
args: {
|
|
105
|
+
initialOn: false,
|
|
106
|
+
disabled: false,
|
|
107
|
+
glass: {
|
|
108
|
+
displacementScale: 80,
|
|
109
|
+
blurAmount: 2,
|
|
110
|
+
saturation: 200,
|
|
111
|
+
aberrationIntensity: 0.8,
|
|
112
|
+
cornerRadius: 12,
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
render: (args) => (
|
|
116
|
+
<div
|
|
117
|
+
style={{
|
|
118
|
+
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
119
|
+
backgroundSize: '400% 400%',
|
|
120
|
+
animation: 'gradient 15s ease infinite',
|
|
121
|
+
padding: '3rem',
|
|
122
|
+
borderRadius: '12px',
|
|
123
|
+
minHeight: '200px',
|
|
124
|
+
display: 'flex',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<style>
|
|
130
|
+
{`
|
|
131
|
+
@keyframes gradient {
|
|
132
|
+
0% { background-position: 0% 50%; }
|
|
133
|
+
50% { background-position: 100% 50%; }
|
|
134
|
+
100% { background-position: 0% 50%; }
|
|
135
|
+
}
|
|
136
|
+
`}
|
|
137
|
+
</style>
|
|
138
|
+
<Toggle {...args} />
|
|
139
|
+
</div>
|
|
140
|
+
),
|
|
141
|
+
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { TOGGLE } from '../../lib/constants/components';
|
|
3
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
|
+
import { AtomixGlassProps } from '../../lib/types/components';
|
|
3
5
|
|
|
4
6
|
export interface ToggleProps {
|
|
5
7
|
/**
|
|
@@ -26,6 +28,12 @@ export interface ToggleProps {
|
|
|
26
28
|
* Additional CSS class for the toggle
|
|
27
29
|
*/
|
|
28
30
|
className?: string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Glass morphism effect for the toggle
|
|
34
|
+
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
35
|
+
*/
|
|
36
|
+
glass?: AtomixGlassProps | boolean;
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -37,6 +45,7 @@ export const Toggle: React.FC<ToggleProps> = ({
|
|
|
37
45
|
onToggleOff,
|
|
38
46
|
disabled = false,
|
|
39
47
|
className = '',
|
|
48
|
+
glass,
|
|
40
49
|
}) => {
|
|
41
50
|
const [isOn, setIsOn] = useState(initialOn);
|
|
42
51
|
|
|
@@ -64,7 +73,7 @@ export const Toggle: React.FC<ToggleProps> = ({
|
|
|
64
73
|
}
|
|
65
74
|
};
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
const toggleContent = (
|
|
68
77
|
<div
|
|
69
78
|
className={`c-toggle ${isOn ? TOGGLE.CLASSES.IS_ON : ''} ${disabled ? 'is-disabled' : ''} ${className}`}
|
|
70
79
|
onClick={handleClick}
|
|
@@ -77,6 +86,28 @@ export const Toggle: React.FC<ToggleProps> = ({
|
|
|
77
86
|
<div className="c-toggle__switch"></div>
|
|
78
87
|
</div>
|
|
79
88
|
);
|
|
89
|
+
|
|
90
|
+
if (glass) {
|
|
91
|
+
// Default glass settings for toggles
|
|
92
|
+
const defaultGlassProps = {
|
|
93
|
+
displacementScale: 60,
|
|
94
|
+
blurAmount: 1,
|
|
95
|
+
saturation: 160,
|
|
96
|
+
aberrationIntensity: 0.5,
|
|
97
|
+
cornerRadius: 8,
|
|
98
|
+
mode: 'shader' as const,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<AtomixGlass {...glassProps}>
|
|
105
|
+
{toggleContent}
|
|
106
|
+
</AtomixGlass>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return toggleContent;
|
|
80
111
|
};
|
|
81
112
|
|
|
82
113
|
Toggle.displayName = 'Toggle';
|
|
@@ -33,6 +33,10 @@ export default {
|
|
|
33
33
|
control: { type: 'number' },
|
|
34
34
|
defaultValue: 10,
|
|
35
35
|
},
|
|
36
|
+
glass: {
|
|
37
|
+
control: { type: 'boolean' },
|
|
38
|
+
description: 'Enable glass morphism effect',
|
|
39
|
+
},
|
|
36
40
|
},
|
|
37
41
|
} as Meta<typeof Tooltip>;
|
|
38
42
|
|
|
@@ -113,3 +117,130 @@ RichContent.args = {
|
|
|
113
117
|
trigger: 'click',
|
|
114
118
|
offset: 15,
|
|
115
119
|
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Glass morphism tooltip example.
|
|
123
|
+
*/
|
|
124
|
+
export const GlassTooltip = Template.bind({});
|
|
125
|
+
GlassTooltip.args = {
|
|
126
|
+
content: <p className="u-mb-0">This is a glass tooltip</p>,
|
|
127
|
+
position: 'top',
|
|
128
|
+
trigger: 'hover',
|
|
129
|
+
glass: true,
|
|
130
|
+
};
|
|
131
|
+
GlassTooltip.decorators = [
|
|
132
|
+
(Story) => (
|
|
133
|
+
<div style={{
|
|
134
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
135
|
+
minHeight: '100vh',
|
|
136
|
+
padding: '2rem'
|
|
137
|
+
}}>
|
|
138
|
+
<Story />
|
|
139
|
+
</div>
|
|
140
|
+
),
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Glass tooltip with custom settings.
|
|
145
|
+
*/
|
|
146
|
+
export const GlassTooltipCustom = Template.bind({});
|
|
147
|
+
GlassTooltipCustom.args = {
|
|
148
|
+
content: <p className="u-mb-0">Custom glass tooltip with enhanced effects</p>,
|
|
149
|
+
position: 'top',
|
|
150
|
+
trigger: 'hover',
|
|
151
|
+
glass: {
|
|
152
|
+
displacementScale: 60,
|
|
153
|
+
blurAmount: 2,
|
|
154
|
+
saturation: 200,
|
|
155
|
+
aberrationIntensity: 1,
|
|
156
|
+
cornerRadius: 12,
|
|
157
|
+
mode: 'polar',
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
GlassTooltipCustom.decorators = [
|
|
161
|
+
(Story) => (
|
|
162
|
+
<div style={{
|
|
163
|
+
background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
|
|
164
|
+
minHeight: '100vh',
|
|
165
|
+
padding: '2rem'
|
|
166
|
+
}}>
|
|
167
|
+
<Story />
|
|
168
|
+
</div>
|
|
169
|
+
),
|
|
170
|
+
];
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Glass tooltip with click trigger.
|
|
174
|
+
*/
|
|
175
|
+
export const GlassTooltipClick = Template.bind({});
|
|
176
|
+
GlassTooltipClick.args = {
|
|
177
|
+
content: <p className="u-mb-0">Click to show glass tooltip</p>,
|
|
178
|
+
position: 'top',
|
|
179
|
+
trigger: 'click',
|
|
180
|
+
glass: true,
|
|
181
|
+
};
|
|
182
|
+
GlassTooltipClick.decorators = [
|
|
183
|
+
(Story) => (
|
|
184
|
+
<div style={{
|
|
185
|
+
background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
|
|
186
|
+
minHeight: '100vh',
|
|
187
|
+
padding: '2rem'
|
|
188
|
+
}}>
|
|
189
|
+
<Story />
|
|
190
|
+
</div>
|
|
191
|
+
),
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Glass tooltip with different positions.
|
|
196
|
+
*/
|
|
197
|
+
export const GlassTooltipPositions = Template.bind({});
|
|
198
|
+
GlassTooltipPositions.args = {
|
|
199
|
+
content: <p className="u-mb-0">Glass tooltip in different positions</p>,
|
|
200
|
+
position: 'top',
|
|
201
|
+
trigger: 'hover',
|
|
202
|
+
glass: true,
|
|
203
|
+
};
|
|
204
|
+
GlassTooltipPositions.decorators = [
|
|
205
|
+
(Story) => (
|
|
206
|
+
<div style={{
|
|
207
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
208
|
+
minHeight: '100vh',
|
|
209
|
+
padding: '2rem'
|
|
210
|
+
}}>
|
|
211
|
+
<Story />
|
|
212
|
+
</div>
|
|
213
|
+
),
|
|
214
|
+
];
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Glass tooltip with rich content.
|
|
218
|
+
*/
|
|
219
|
+
export const GlassTooltipRich = Template.bind({});
|
|
220
|
+
GlassTooltipRich.args = {
|
|
221
|
+
content: (
|
|
222
|
+
<div>
|
|
223
|
+
<h4 style={{ marginTop: 0, marginBottom: '8px' }}>Glass Rich Tooltip</h4>
|
|
224
|
+
<ul style={{ margin: 0, paddingLeft: '16px' }}>
|
|
225
|
+
<li>Beautiful glass effect</li>
|
|
226
|
+
<li>Supports rich content</li>
|
|
227
|
+
<li>Modern design</li>
|
|
228
|
+
</ul>
|
|
229
|
+
</div>
|
|
230
|
+
),
|
|
231
|
+
position: 'bottom',
|
|
232
|
+
trigger: 'click',
|
|
233
|
+
offset: 15,
|
|
234
|
+
glass: true,
|
|
235
|
+
};
|
|
236
|
+
GlassTooltipRich.decorators = [
|
|
237
|
+
(Story) => (
|
|
238
|
+
<div style={{
|
|
239
|
+
background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
|
|
240
|
+
minHeight: '100vh',
|
|
241
|
+
padding: '2rem'
|
|
242
|
+
}}>
|
|
243
|
+
<Story />
|
|
244
|
+
</div>
|
|
245
|
+
),
|
|
246
|
+
];
|