@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
|
@@ -39,6 +39,10 @@ const meta = {
|
|
|
39
39
|
control: 'text',
|
|
40
40
|
description: 'Placeholder text',
|
|
41
41
|
},
|
|
42
|
+
glass: {
|
|
43
|
+
control: 'boolean',
|
|
44
|
+
description: 'Enable glass morphism effect',
|
|
45
|
+
},
|
|
42
46
|
},
|
|
43
47
|
} satisfies Meta<typeof Input>;
|
|
44
48
|
|
|
@@ -104,3 +108,123 @@ export const States: Story = {
|
|
|
104
108
|
</div>
|
|
105
109
|
),
|
|
106
110
|
};
|
|
111
|
+
|
|
112
|
+
// Glass Effect
|
|
113
|
+
export const Glass: Story = {
|
|
114
|
+
args: {
|
|
115
|
+
placeholder: 'Glass Input',
|
|
116
|
+
glass: true,
|
|
117
|
+
},
|
|
118
|
+
render: (args) => (
|
|
119
|
+
<div
|
|
120
|
+
style={{
|
|
121
|
+
background: 'url(https://cdn.pixabay.com/photo/2021/11/13/08/50/athens-6790780_1280.jpg)',
|
|
122
|
+
padding: '2rem',
|
|
123
|
+
borderRadius: '12px',
|
|
124
|
+
backgroundSize: 'cover',
|
|
125
|
+
backgroundPosition: 'center',
|
|
126
|
+
minHeight: '200px',
|
|
127
|
+
display: 'flex',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
justifyContent: 'center',
|
|
130
|
+
}}
|
|
131
|
+
>
|
|
132
|
+
<Input {...args} />
|
|
133
|
+
</div>
|
|
134
|
+
),
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Glass Variants
|
|
138
|
+
export const GlassVariants: Story = {
|
|
139
|
+
render: () => (
|
|
140
|
+
<div
|
|
141
|
+
style={{
|
|
142
|
+
background: 'url(https://cdn.pixabay.com/photo/2021/11/13/08/50/athens-6790780_1280.jpg)',
|
|
143
|
+
padding: '2rem',
|
|
144
|
+
borderRadius: '12px',
|
|
145
|
+
backgroundSize: 'cover',
|
|
146
|
+
backgroundPosition: 'center',
|
|
147
|
+
minHeight: '200px',
|
|
148
|
+
display: 'flex',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
justifyContent: 'center',
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
|
|
154
|
+
Glass Input Variants
|
|
155
|
+
</h3>
|
|
156
|
+
<div className="u-d-flex u-flex-column u-gap-3" style={{ width: '300px' }}>
|
|
157
|
+
<Input placeholder="Small Glass" size="sm" glass />
|
|
158
|
+
<Input placeholder="Medium Glass" size="md" glass />
|
|
159
|
+
<Input placeholder="Large Glass" size="lg" glass />
|
|
160
|
+
<Input placeholder="Primary Glass" variant="primary" glass />
|
|
161
|
+
<Input placeholder="Success Glass" variant="success" glass />
|
|
162
|
+
<Input placeholder="Custom Glass" glass={{
|
|
163
|
+
displacementScale: 80,
|
|
164
|
+
blurAmount: 2,
|
|
165
|
+
saturation: 200,
|
|
166
|
+
aberrationIntensity: 2,
|
|
167
|
+
cornerRadius: 12,
|
|
168
|
+
}} />
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
),
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
// Glass Showcase
|
|
175
|
+
export const GlassShowcase: Story = {
|
|
176
|
+
render: () => (
|
|
177
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
|
|
178
|
+
{/* Basic Glass */}
|
|
179
|
+
<div
|
|
180
|
+
style={{
|
|
181
|
+
background: 'url(https://cdn.pixabay.com/photo/2021/11/13/08/50/athens-6790780_1280.jpg)',
|
|
182
|
+
backgroundSize: 'cover',
|
|
183
|
+
backgroundPosition: 'center',
|
|
184
|
+
padding: '2rem',
|
|
185
|
+
borderRadius: '12px',
|
|
186
|
+
backgroundSize: 'cover',
|
|
187
|
+
backgroundPosition: 'center',
|
|
188
|
+
minHeight: '200px',
|
|
189
|
+
display: 'flex',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'center',
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
|
|
195
|
+
Glass Input on Background
|
|
196
|
+
</h3>
|
|
197
|
+
<div className="u-d-flex u-flex-column u-gap-3" style={{ width: '300px' }}>
|
|
198
|
+
<Input placeholder="Enter your name" glass />
|
|
199
|
+
<Input type="email" placeholder="Enter your email" glass />
|
|
200
|
+
<Input type="password" placeholder="Enter password" glass />
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
{/* Different Glass Modes */}
|
|
205
|
+
<div
|
|
206
|
+
style={{
|
|
207
|
+
background: 'url(https://cdn.pixabay.com/photo/2021/11/13/08/50/athens-6790780_1280.jpg)',
|
|
208
|
+
padding: '2rem',
|
|
209
|
+
borderRadius: '12px',
|
|
210
|
+
backgroundSize: 'cover',
|
|
211
|
+
backgroundPosition: 'center',
|
|
212
|
+
minHeight: '200px',
|
|
213
|
+
display: 'flex',
|
|
214
|
+
alignItems: 'center',
|
|
215
|
+
justifyContent: 'center',
|
|
216
|
+
}}
|
|
217
|
+
>
|
|
218
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', fontSize: '1.2rem' }}>
|
|
219
|
+
Glass Modes
|
|
220
|
+
</h3>
|
|
221
|
+
<div className="u-d-flex u-flex-column u-gap-3" style={{ width: '300px' }}>
|
|
222
|
+
<Input placeholder="Standard Mode" glass={{ mode: 'standard' }} />
|
|
223
|
+
<Input placeholder="Polar Mode" glass={{ mode: 'polar' }} />
|
|
224
|
+
<Input placeholder="Prominent Mode" glass={{ mode: 'prominent' }} />
|
|
225
|
+
<Input placeholder="Shader Mode" glass={{ mode: 'shader' }} />
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
),
|
|
230
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import { InputProps } from '../../lib/types/components';
|
|
3
3
|
import { useInput } from '../../lib/composables/useInput';
|
|
4
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Input - A component for text input fields
|
|
7
8
|
*/
|
|
8
|
-
export const Input
|
|
9
|
+
export const Input = forwardRef<HTMLInputElement, InputProps>(({
|
|
9
10
|
type = 'text',
|
|
10
11
|
value,
|
|
11
12
|
onChange,
|
|
@@ -32,7 +33,8 @@ export const Input: React.FC<InputProps> = ({
|
|
|
32
33
|
step,
|
|
33
34
|
ariaLabel,
|
|
34
35
|
ariaDescribedBy,
|
|
35
|
-
|
|
36
|
+
glass,
|
|
37
|
+
}, ref) => {
|
|
36
38
|
const { generateInputClass } = useInput({
|
|
37
39
|
size,
|
|
38
40
|
variant,
|
|
@@ -42,7 +44,7 @@ export const Input: React.FC<InputProps> = ({
|
|
|
42
44
|
});
|
|
43
45
|
|
|
44
46
|
const inputClass = generateInputClass({
|
|
45
|
-
className,
|
|
47
|
+
className: `${className} ${glass ? 'c-input--glass' : ''}`.trim(),
|
|
46
48
|
size,
|
|
47
49
|
variant,
|
|
48
50
|
disabled,
|
|
@@ -51,8 +53,12 @@ export const Input: React.FC<InputProps> = ({
|
|
|
51
53
|
type,
|
|
52
54
|
});
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
// Custom styles for glass effect
|
|
57
|
+
const glassStyles = glass ? {} : {};
|
|
58
|
+
|
|
59
|
+
const inputElement = (
|
|
55
60
|
<input
|
|
61
|
+
ref={ref}
|
|
56
62
|
type={type}
|
|
57
63
|
className={inputClass}
|
|
58
64
|
value={value}
|
|
@@ -76,12 +82,35 @@ export const Input: React.FC<InputProps> = ({
|
|
|
76
82
|
aria-label={ariaLabel}
|
|
77
83
|
aria-describedby={ariaDescribedBy}
|
|
78
84
|
aria-invalid={invalid}
|
|
85
|
+
style={glass ? glassStyles : undefined}
|
|
79
86
|
/>
|
|
80
87
|
);
|
|
81
|
-
};
|
|
82
88
|
|
|
83
|
-
|
|
89
|
+
if (glass) {
|
|
90
|
+
// Default glass settings for inputs
|
|
91
|
+
const defaultGlassProps = {
|
|
92
|
+
displacementScale: 60,
|
|
93
|
+
blurAmount: 1,
|
|
94
|
+
saturation: 180,
|
|
95
|
+
aberrationIntensity: 0.2,
|
|
96
|
+
cornerRadius: 12,
|
|
97
|
+
mode: 'shader' as const,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
101
|
+
|
|
102
|
+
return (
|
|
103
|
+
<AtomixGlass {...glassProps}>
|
|
104
|
+
{inputElement}
|
|
105
|
+
</AtomixGlass>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return inputElement;
|
|
110
|
+
});
|
|
84
111
|
|
|
85
112
|
Input.displayName = 'Input';
|
|
86
113
|
|
|
114
|
+
export type { InputProps };
|
|
115
|
+
|
|
87
116
|
export default Input;
|
|
@@ -28,6 +28,10 @@ const meta = {
|
|
|
28
28
|
control: 'boolean',
|
|
29
29
|
description: 'Whether the radio button is valid',
|
|
30
30
|
},
|
|
31
|
+
glass: {
|
|
32
|
+
control: 'boolean',
|
|
33
|
+
description: 'Enable glass morphism effect',
|
|
34
|
+
},
|
|
31
35
|
},
|
|
32
36
|
} satisfies Meta<typeof Radio>;
|
|
33
37
|
|
|
@@ -92,3 +96,138 @@ export const WithoutLabel: Story = {
|
|
|
92
96
|
ariaLabel: 'Radio button without visible label',
|
|
93
97
|
},
|
|
94
98
|
};
|
|
99
|
+
|
|
100
|
+
// Glass variant
|
|
101
|
+
export const Glass: Story = {
|
|
102
|
+
args: {
|
|
103
|
+
label: 'Glass Radio',
|
|
104
|
+
name: 'glass',
|
|
105
|
+
value: 'glass',
|
|
106
|
+
glass: true,
|
|
107
|
+
},
|
|
108
|
+
render: (args) => (
|
|
109
|
+
<div
|
|
110
|
+
style={{
|
|
111
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
112
|
+
padding: '2rem',
|
|
113
|
+
borderRadius: '12px',
|
|
114
|
+
minHeight: '200px',
|
|
115
|
+
display: 'flex',
|
|
116
|
+
alignItems: 'center',
|
|
117
|
+
justifyContent: 'center',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<Radio {...args} />
|
|
121
|
+
</div>
|
|
122
|
+
),
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
// Glass with custom settings
|
|
126
|
+
export const GlassCustom: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
label: 'Custom Glass Radio',
|
|
129
|
+
name: 'glassCustom',
|
|
130
|
+
value: 'glassCustom',
|
|
131
|
+
glass: {
|
|
132
|
+
displacementScale: 80,
|
|
133
|
+
blurAmount: 2,
|
|
134
|
+
saturation: 200,
|
|
135
|
+
aberrationIntensity: 0.8,
|
|
136
|
+
cornerRadius: 12,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
render: (args) => (
|
|
140
|
+
<div
|
|
141
|
+
style={{
|
|
142
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
143
|
+
backgroundSize: 'cover',
|
|
144
|
+
backgroundPosition: 'center',
|
|
145
|
+
padding: '2rem',
|
|
146
|
+
borderRadius: '12px',
|
|
147
|
+
minHeight: '200px',
|
|
148
|
+
display: 'flex',
|
|
149
|
+
alignItems: 'center',
|
|
150
|
+
justifyContent: 'center',
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
<Radio {...args} />
|
|
154
|
+
</div>
|
|
155
|
+
),
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Glass radio group
|
|
159
|
+
export const GlassGroup: Story = {
|
|
160
|
+
render: () => (
|
|
161
|
+
<div
|
|
162
|
+
style={{
|
|
163
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
164
|
+
padding: '2rem',
|
|
165
|
+
borderRadius: '12px',
|
|
166
|
+
minHeight: '300px',
|
|
167
|
+
display: 'flex',
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
justifyContent: 'center',
|
|
170
|
+
}}
|
|
171
|
+
>
|
|
172
|
+
<div>
|
|
173
|
+
<h3 style={{ color: 'white', marginBottom: '2rem', textAlign: 'center', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
174
|
+
Glass Radio Group
|
|
175
|
+
</h3>
|
|
176
|
+
<div className="u-d-flex u-flex-column u-gap-2">
|
|
177
|
+
<Radio label="Glass Option 1" name="glassGroup" value="option1" checked glass />
|
|
178
|
+
<Radio label="Glass Option 2" name="glassGroup" value="option2" glass />
|
|
179
|
+
<Radio label="Glass Option 3" name="glassGroup" value="option3" glass />
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
),
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// Glass states
|
|
187
|
+
export const GlassStates: Story = {
|
|
188
|
+
render: () => (
|
|
189
|
+
<div
|
|
190
|
+
style={{
|
|
191
|
+
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
192
|
+
backgroundSize: '400% 400%',
|
|
193
|
+
animation: 'gradient 15s ease infinite',
|
|
194
|
+
padding: '2rem',
|
|
195
|
+
borderRadius: '12px',
|
|
196
|
+
minHeight: '500px',
|
|
197
|
+
display: 'flex',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
justifyContent: 'center',
|
|
200
|
+
}}
|
|
201
|
+
>
|
|
202
|
+
<style>
|
|
203
|
+
{`
|
|
204
|
+
@keyframes gradient {
|
|
205
|
+
0% { background-position: 0% 50%; }
|
|
206
|
+
50% { background-position: 100% 50%; }
|
|
207
|
+
100% { background-position: 0% 50%; }
|
|
208
|
+
}
|
|
209
|
+
`}
|
|
210
|
+
</style>
|
|
211
|
+
<div>
|
|
212
|
+
<h3 style={{ color: 'white', marginBottom: '2rem', textAlign: 'center', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
213
|
+
Glass Radio States
|
|
214
|
+
</h3>
|
|
215
|
+
<div className="u-d-flex u-flex-column u-gap-2">
|
|
216
|
+
<Radio label="Glass Default" name="glassStates" value="default" glass />
|
|
217
|
+
<Radio label="Glass Checked" name="glassStates" value="checked" checked glass />
|
|
218
|
+
<Radio label="Glass Disabled" name="glassStates" value="disabled" disabled glass />
|
|
219
|
+
<Radio
|
|
220
|
+
label="Glass Disabled and Checked"
|
|
221
|
+
name="glassStates"
|
|
222
|
+
value="disabledChecked"
|
|
223
|
+
disabled
|
|
224
|
+
checked
|
|
225
|
+
glass
|
|
226
|
+
/>
|
|
227
|
+
<Radio label="Glass Valid" name="glassStates" value="valid" valid checked glass />
|
|
228
|
+
<Radio label="Glass Invalid" name="glassStates" value="invalid" invalid glass />
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
),
|
|
233
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RadioProps } from '../../lib/types/components';
|
|
3
3
|
import { useRadio } from '../../lib/composables/useRadio';
|
|
4
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Radio - A component for radio button inputs
|
|
@@ -19,6 +20,7 @@ export const Radio: React.FC<RadioProps> = ({
|
|
|
19
20
|
valid = false,
|
|
20
21
|
ariaLabel,
|
|
21
22
|
ariaDescribedBy,
|
|
23
|
+
glass,
|
|
22
24
|
}) => {
|
|
23
25
|
const { generateRadioClass } = useRadio({
|
|
24
26
|
disabled,
|
|
@@ -27,13 +29,13 @@ export const Radio: React.FC<RadioProps> = ({
|
|
|
27
29
|
});
|
|
28
30
|
|
|
29
31
|
const radioClass = generateRadioClass({
|
|
30
|
-
className,
|
|
32
|
+
className: `${className} ${glass ? 'c-radio--glass' : ''}`.trim(),
|
|
31
33
|
disabled,
|
|
32
34
|
invalid,
|
|
33
35
|
valid,
|
|
34
36
|
});
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
const radioContent = (
|
|
37
39
|
<div className={radioClass}>
|
|
38
40
|
<input
|
|
39
41
|
type="radio"
|
|
@@ -56,6 +58,28 @@ export const Radio: React.FC<RadioProps> = ({
|
|
|
56
58
|
)}
|
|
57
59
|
</div>
|
|
58
60
|
);
|
|
61
|
+
|
|
62
|
+
if (glass) {
|
|
63
|
+
// Default glass settings for radio buttons
|
|
64
|
+
const defaultGlassProps = {
|
|
65
|
+
displacementScale: 40,
|
|
66
|
+
blurAmount: 1,
|
|
67
|
+
saturation: 160,
|
|
68
|
+
aberrationIntensity: 0.3,
|
|
69
|
+
cornerRadius: 6,
|
|
70
|
+
mode: 'shader' as const,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<AtomixGlass {...glassProps}>
|
|
77
|
+
{radioContent}
|
|
78
|
+
</AtomixGlass>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return radioContent;
|
|
59
83
|
};
|
|
60
84
|
|
|
61
85
|
export type { RadioProps };
|
|
@@ -34,6 +34,10 @@ const meta = {
|
|
|
34
34
|
control: 'boolean',
|
|
35
35
|
description: 'Whether multiple options can be selected',
|
|
36
36
|
},
|
|
37
|
+
glass: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Enable glass morphism effect',
|
|
40
|
+
},
|
|
37
41
|
},
|
|
38
42
|
} satisfies Meta<typeof Select>;
|
|
39
43
|
|
|
@@ -149,3 +153,109 @@ export const DisabledOptions: Story = {
|
|
|
149
153
|
placeholder: 'Select a country',
|
|
150
154
|
},
|
|
151
155
|
};
|
|
156
|
+
|
|
157
|
+
// Glass variant
|
|
158
|
+
export const Glass: Story = {
|
|
159
|
+
args: {
|
|
160
|
+
options: countries,
|
|
161
|
+
placeholder: 'Glass Select',
|
|
162
|
+
glass: true,
|
|
163
|
+
},
|
|
164
|
+
render: (args) => (
|
|
165
|
+
<div
|
|
166
|
+
style={{
|
|
167
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
168
|
+
padding: '2rem',
|
|
169
|
+
borderRadius: '12px',
|
|
170
|
+
minHeight: '200px',
|
|
171
|
+
display: 'flex',
|
|
172
|
+
alignItems: 'center',
|
|
173
|
+
justifyContent: 'center',
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
<div style={{ width: '100%', maxWidth: '300px' }}>
|
|
177
|
+
<Select {...args} />
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
),
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Glass with custom settings
|
|
184
|
+
export const GlassCustom: Story = {
|
|
185
|
+
args: {
|
|
186
|
+
options: countries,
|
|
187
|
+
placeholder: 'Custom Glass Select',
|
|
188
|
+
glass: {
|
|
189
|
+
displacementScale: 80,
|
|
190
|
+
blurAmount: 2,
|
|
191
|
+
saturation: 200,
|
|
192
|
+
aberrationIntensity: 0.8,
|
|
193
|
+
cornerRadius: 12,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
render: (args) => (
|
|
197
|
+
<div
|
|
198
|
+
style={{
|
|
199
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
200
|
+
backgroundSize: 'cover',
|
|
201
|
+
backgroundPosition: 'center',
|
|
202
|
+
padding: '2rem',
|
|
203
|
+
borderRadius: '12px',
|
|
204
|
+
minHeight: '300px',
|
|
205
|
+
display: 'flex',
|
|
206
|
+
alignItems: 'center',
|
|
207
|
+
justifyContent: 'center',
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
<div style={{ width: '100%', maxWidth: '300px' }}>
|
|
211
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', textAlign: 'center', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
212
|
+
Custom Glass Select
|
|
213
|
+
</h3>
|
|
214
|
+
<Select {...args} />
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
),
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
// Glass states
|
|
221
|
+
export const GlassStates: Story = {
|
|
222
|
+
args: {
|
|
223
|
+
options: countries,
|
|
224
|
+
},
|
|
225
|
+
render: (args) => (
|
|
226
|
+
<div
|
|
227
|
+
style={{
|
|
228
|
+
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
229
|
+
backgroundSize: '400% 400%',
|
|
230
|
+
animation: 'gradient 15s ease infinite',
|
|
231
|
+
padding: '2rem',
|
|
232
|
+
borderRadius: '12px',
|
|
233
|
+
minHeight: '400px',
|
|
234
|
+
display: 'flex',
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
justifyContent: 'center',
|
|
237
|
+
}}
|
|
238
|
+
>
|
|
239
|
+
<style>
|
|
240
|
+
{`
|
|
241
|
+
@keyframes gradient {
|
|
242
|
+
0% { background-position: 0% 50%; }
|
|
243
|
+
50% { background-position: 100% 50%; }
|
|
244
|
+
100% { background-position: 0% 50%; }
|
|
245
|
+
}
|
|
246
|
+
`}
|
|
247
|
+
</style>
|
|
248
|
+
<div style={{ width: '100%', maxWidth: '300px' }}>
|
|
249
|
+
<h3 style={{ color: 'white', marginBottom: '2rem', textAlign: 'center', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
250
|
+
Glass Select States
|
|
251
|
+
</h3>
|
|
252
|
+
<div className="u-d-flex u-flex-column u-gap-3">
|
|
253
|
+
<Select options={args.options} placeholder="Glass Select" glass />
|
|
254
|
+
<Select options={args.options} placeholder="Glass Disabled" disabled glass />
|
|
255
|
+
<Select options={args.options} placeholder="Glass Valid" valid value="us" glass />
|
|
256
|
+
<Select options={args.options} placeholder="Glass Invalid" invalid glass />
|
|
257
|
+
</div>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
),
|
|
261
|
+
};
|
|
@@ -2,6 +2,7 @@ import React, { useRef, useEffect, useState } from 'react';
|
|
|
2
2
|
import { SelectProps } from '../../lib/types/components';
|
|
3
3
|
import { useSelect } from '../../lib/composables';
|
|
4
4
|
import { SELECT } from '../../lib/constants/components';
|
|
5
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Select - A component for dropdown selection
|
|
@@ -24,6 +25,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
24
25
|
multiple = false,
|
|
25
26
|
ariaLabel,
|
|
26
27
|
ariaDescribedBy,
|
|
28
|
+
glass,
|
|
27
29
|
}) => {
|
|
28
30
|
const { generateSelectClass } = useSelect({
|
|
29
31
|
size,
|
|
@@ -33,7 +35,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
33
35
|
});
|
|
34
36
|
|
|
35
37
|
const selectClass = generateSelectClass({
|
|
36
|
-
className,
|
|
38
|
+
className: `${className} ${glass ? 'c-select--glass' : ''}`.trim(),
|
|
37
39
|
size,
|
|
38
40
|
disabled,
|
|
39
41
|
invalid,
|
|
@@ -112,7 +114,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
112
114
|
}
|
|
113
115
|
};
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
const selectContent = (
|
|
116
118
|
<div
|
|
117
119
|
className={`${selectClass} ${isOpen ? SELECT.CLASSES.IS_OPEN : ''}`}
|
|
118
120
|
ref={dropdownRef}
|
|
@@ -182,6 +184,28 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
182
184
|
</div>
|
|
183
185
|
</div>
|
|
184
186
|
);
|
|
187
|
+
|
|
188
|
+
if (glass) {
|
|
189
|
+
// Default glass settings for select components
|
|
190
|
+
const defaultGlassProps = {
|
|
191
|
+
displacementScale: 60,
|
|
192
|
+
blurAmount: 1,
|
|
193
|
+
saturation: 180,
|
|
194
|
+
aberrationIntensity: 0.2,
|
|
195
|
+
cornerRadius: 12,
|
|
196
|
+
mode: 'shader' as const,
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<AtomixGlass {...glassProps}>
|
|
203
|
+
{selectContent}
|
|
204
|
+
</AtomixGlass>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
return selectContent;
|
|
185
209
|
};
|
|
186
210
|
|
|
187
211
|
export type { SelectProps };
|