@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
|
2
2
|
import { ModalProps } from '../../lib/types/components';
|
|
3
3
|
import { MODAL } from '../../lib/constants/components';
|
|
4
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Hook for managing modal state
|
|
@@ -89,6 +90,7 @@ export const Modal: React.FC<ModalProps> = ({
|
|
|
89
90
|
className = '',
|
|
90
91
|
closeButton = true,
|
|
91
92
|
footer,
|
|
93
|
+
glass,
|
|
92
94
|
...props
|
|
93
95
|
}) => {
|
|
94
96
|
const modalRef = useRef<HTMLDivElement>(null);
|
|
@@ -134,11 +136,50 @@ export const Modal: React.FC<ModalProps> = ({
|
|
|
134
136
|
'c-modal',
|
|
135
137
|
isOpenState ? MODAL.CLASSES.IS_OPEN : '',
|
|
136
138
|
size ? `c-modal--${size}` : '',
|
|
139
|
+
glass ? 'c-modal--glass' : '',
|
|
137
140
|
className,
|
|
138
141
|
]
|
|
139
142
|
.filter(Boolean)
|
|
140
143
|
.join(' ');
|
|
141
144
|
|
|
145
|
+
const modalContent = (
|
|
146
|
+
<div className="c-modal__content">
|
|
147
|
+
{(title || closeButton) && (
|
|
148
|
+
<div className="c-modal__header">
|
|
149
|
+
<div className="c-modal__header-content">
|
|
150
|
+
{title && <h3 className="c-modal__title">{title}</h3>}
|
|
151
|
+
{subtitle && <p className="c-modal__sub">{subtitle}</p>}
|
|
152
|
+
</div>
|
|
153
|
+
{closeButton && (
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
className="c-modal__close c-btn js-modal-close"
|
|
157
|
+
onClick={close}
|
|
158
|
+
aria-label="Close modal"
|
|
159
|
+
>
|
|
160
|
+
<svg
|
|
161
|
+
width="20"
|
|
162
|
+
height="20"
|
|
163
|
+
viewBox="0 0 20 20"
|
|
164
|
+
fill="none"
|
|
165
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
166
|
+
>
|
|
167
|
+
<path
|
|
168
|
+
d="M16.0672 15.1828C16.1253 15.2409 16.1713 15.3098 16.2028 15.3857C16.2342 15.4615 16.2504 15.5429 16.2504 15.625C16.2504 15.7071 16.2342 15.7884 16.2028 15.8643C16.1713 15.9402 16.1253 16.0091 16.0672 16.0672C16.0091 16.1252 15.9402 16.1713 15.8643 16.2027C15.7885 16.2342 15.7071 16.2503 15.625 16.2503C15.5429 16.2503 15.4616 16.2342 15.3857 16.2027C15.3098 16.1713 15.2409 16.1252 15.1828 16.0672L10 10.8836L4.8172 16.0672C4.69992 16.1844 4.54086 16.2503 4.37501 16.2503C4.20916 16.2503 4.0501 16.1844 3.93282 16.0672C3.81555 15.9499 3.74966 15.7908 3.74966 15.625C3.74966 15.4591 3.81555 15.3001 3.93282 15.1828L9.11642 9.99998L3.93282 4.81717C3.81555 4.69989 3.74966 4.54083 3.74966 4.37498C3.74966 4.20913 3.81555 4.05007 3.93282 3.93279C4.0501 3.81552 4.20916 3.74963 4.37501 3.74963C4.54086 3.74963 4.69992 3.81552 4.8172 3.93279L10 9.11639L15.1828 3.93279C15.3001 3.81552 15.4592 3.74963 15.625 3.74963C15.7909 3.74963 15.9499 3.81552 16.0672 3.93279C16.1845 4.05007 16.2504 4.20913 16.2504 4.37498C16.2504 4.54083 16.1845 4.69989 16.0672 4.81717L10.8836 9.99998L16.0672 15.1828Z"
|
|
169
|
+
fill="#141414"
|
|
170
|
+
/>
|
|
171
|
+
</svg>
|
|
172
|
+
</button>
|
|
173
|
+
)}
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
176
|
+
|
|
177
|
+
<div className="c-modal__body">{children}</div>
|
|
178
|
+
|
|
179
|
+
{footer && <div className="c-modal__footer">{footer}</div>}
|
|
180
|
+
</div>
|
|
181
|
+
);
|
|
182
|
+
|
|
142
183
|
return (
|
|
143
184
|
<div
|
|
144
185
|
ref={modalRef}
|
|
@@ -151,41 +192,29 @@ export const Modal: React.FC<ModalProps> = ({
|
|
|
151
192
|
>
|
|
152
193
|
<div ref={backdropRef} className="c-modal__backdrop" onClick={handleBackdropClick} />
|
|
153
194
|
<div ref={dialogRef} className="c-modal__dialog">
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
fill="#141414"
|
|
178
|
-
/>
|
|
179
|
-
</svg>
|
|
180
|
-
</button>
|
|
181
|
-
)}
|
|
182
|
-
</div>
|
|
183
|
-
)}
|
|
184
|
-
|
|
185
|
-
<div className="c-modal__body">{children}</div>
|
|
186
|
-
|
|
187
|
-
{footer && <div className="c-modal__footer">{footer}</div>}
|
|
188
|
-
</div>
|
|
195
|
+
{glass ? (
|
|
196
|
+
// Default glass settings for modals
|
|
197
|
+
(() => {
|
|
198
|
+
const defaultGlassProps = {
|
|
199
|
+
displacementScale: 100,
|
|
200
|
+
blurAmount: 2,
|
|
201
|
+
saturation: 180,
|
|
202
|
+
aberrationIntensity: 1,
|
|
203
|
+
cornerRadius: 16,
|
|
204
|
+
mode: 'shader' as const,
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
208
|
+
|
|
209
|
+
return (
|
|
210
|
+
<AtomixGlass {...glassProps}>
|
|
211
|
+
{modalContent}
|
|
212
|
+
</AtomixGlass>
|
|
213
|
+
);
|
|
214
|
+
})()
|
|
215
|
+
) : (
|
|
216
|
+
modalContent
|
|
217
|
+
)}
|
|
189
218
|
</div>
|
|
190
219
|
</div>
|
|
191
220
|
);
|
|
@@ -42,6 +42,10 @@ export default {
|
|
|
42
42
|
control: 'text',
|
|
43
43
|
description: 'Custom class for the pagination container',
|
|
44
44
|
},
|
|
45
|
+
glass: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'Enable glass morphism effect',
|
|
48
|
+
},
|
|
45
49
|
},
|
|
46
50
|
parameters: {
|
|
47
51
|
docs: {
|
|
@@ -186,3 +190,100 @@ CustomStyling.parameters = {
|
|
|
186
190
|
},
|
|
187
191
|
},
|
|
188
192
|
};
|
|
193
|
+
|
|
194
|
+
export const Glass = {
|
|
195
|
+
args: {
|
|
196
|
+
currentPage: 5,
|
|
197
|
+
totalPages: 15,
|
|
198
|
+
siblingCount: 1,
|
|
199
|
+
showFirstLastButtons: true,
|
|
200
|
+
showPrevNextButtons: true,
|
|
201
|
+
size: 'md',
|
|
202
|
+
glass: true,
|
|
203
|
+
},
|
|
204
|
+
render: (args) => {
|
|
205
|
+
const [currentPage, setCurrentPage] = React.useState(args.currentPage);
|
|
206
|
+
const handlePageChange = (page: number) => {
|
|
207
|
+
setCurrentPage(page);
|
|
208
|
+
args.onPageChange?.(page);
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<div
|
|
213
|
+
style={{
|
|
214
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
215
|
+
padding: '2rem',
|
|
216
|
+
borderRadius: '12px',
|
|
217
|
+
minHeight: '200px',
|
|
218
|
+
display: 'flex',
|
|
219
|
+
alignItems: 'center',
|
|
220
|
+
justifyContent: 'center',
|
|
221
|
+
}}
|
|
222
|
+
>
|
|
223
|
+
<Pagination {...args} currentPage={currentPage} onPageChange={handlePageChange} />
|
|
224
|
+
</div>
|
|
225
|
+
);
|
|
226
|
+
},
|
|
227
|
+
parameters: {
|
|
228
|
+
docs: {
|
|
229
|
+
description: {
|
|
230
|
+
story: 'Pagination with glass morphism effect enabled against a gradient background.',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
export const GlassCustom = {
|
|
237
|
+
args: {
|
|
238
|
+
currentPage: 5,
|
|
239
|
+
totalPages: 15,
|
|
240
|
+
siblingCount: 2,
|
|
241
|
+
showFirstLastButtons: true,
|
|
242
|
+
showPrevNextButtons: true,
|
|
243
|
+
size: 'lg',
|
|
244
|
+
glass: {
|
|
245
|
+
displacementScale: 80,
|
|
246
|
+
blurAmount: 2,
|
|
247
|
+
saturation: 200,
|
|
248
|
+
aberrationIntensity: 0.8,
|
|
249
|
+
cornerRadius: 12,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
render: (args) => {
|
|
253
|
+
const [currentPage, setCurrentPage] = React.useState(args.currentPage);
|
|
254
|
+
const handlePageChange = (page: number) => {
|
|
255
|
+
setCurrentPage(page);
|
|
256
|
+
args.onPageChange?.(page);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
return (
|
|
260
|
+
<div
|
|
261
|
+
style={{
|
|
262
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
263
|
+
backgroundSize: 'cover',
|
|
264
|
+
backgroundPosition: 'center',
|
|
265
|
+
padding: '2rem',
|
|
266
|
+
borderRadius: '12px',
|
|
267
|
+
minHeight: '300px',
|
|
268
|
+
display: 'flex',
|
|
269
|
+
alignItems: 'center',
|
|
270
|
+
justifyContent: 'center',
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
<div style={{ textAlign: 'center' }}>
|
|
274
|
+
<h3 style={{ color: 'white', marginBottom: '2rem', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
275
|
+
Custom Glass Pagination
|
|
276
|
+
</h3>
|
|
277
|
+
<Pagination {...args} currentPage={currentPage} onPageChange={handlePageChange} />
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
);
|
|
281
|
+
},
|
|
282
|
+
parameters: {
|
|
283
|
+
docs: {
|
|
284
|
+
description: {
|
|
285
|
+
story: 'Pagination with custom glass morphism settings against a scenic background.',
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
@@ -3,6 +3,7 @@ import { PaginationProps } from '../../lib/types/components';
|
|
|
3
3
|
import { usePagination, DOTS } from '../../lib/composables/usePagination';
|
|
4
4
|
import { PAGINATION_DEFAULTS } from '../../lib/constants/components';
|
|
5
5
|
import { Icon, IconProps } from '../Icon/Icon';
|
|
6
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
6
7
|
|
|
7
8
|
// @TODO: Add Search functionality for pagination
|
|
8
9
|
|
|
@@ -61,6 +62,7 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
61
62
|
size = PAGINATION_DEFAULTS.size,
|
|
62
63
|
className = '',
|
|
63
64
|
ariaLabel = 'Pagination',
|
|
65
|
+
glass,
|
|
64
66
|
}) => {
|
|
65
67
|
const { paginationRange, goToPage, nextPage, prevPage, firstPage, lastPage } = usePagination({
|
|
66
68
|
currentPage,
|
|
@@ -74,7 +76,7 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
74
76
|
return null;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
const paginationContent = (
|
|
78
80
|
<nav className={`c-pagination c-pagination--${size} ${className}`} aria-label={ariaLabel}>
|
|
79
81
|
<ul className="c-pagination__items">
|
|
80
82
|
{showFirstLastButtons && (
|
|
@@ -153,6 +155,28 @@ export const Pagination: React.FC<PaginationProps> = ({
|
|
|
153
155
|
</ul>
|
|
154
156
|
</nav>
|
|
155
157
|
);
|
|
158
|
+
|
|
159
|
+
if (glass) {
|
|
160
|
+
// Default glass settings for pagination
|
|
161
|
+
const defaultGlassProps = {
|
|
162
|
+
displacementScale: 60,
|
|
163
|
+
blurAmount: 1,
|
|
164
|
+
saturation: 160,
|
|
165
|
+
aberrationIntensity: 0.5,
|
|
166
|
+
cornerRadius: 8,
|
|
167
|
+
mode: 'shader' as const,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
171
|
+
|
|
172
|
+
return (
|
|
173
|
+
<AtomixGlass {...glassProps}>
|
|
174
|
+
{paginationContent}
|
|
175
|
+
</AtomixGlass>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return paginationContent;
|
|
156
180
|
};
|
|
157
181
|
|
|
158
182
|
export type { PaginationProps };
|
|
@@ -42,6 +42,10 @@ export default {
|
|
|
42
42
|
className: {
|
|
43
43
|
control: { type: 'text' },
|
|
44
44
|
},
|
|
45
|
+
glass: {
|
|
46
|
+
control: { type: 'boolean' },
|
|
47
|
+
description: 'Enable glass morphism effect',
|
|
48
|
+
},
|
|
45
49
|
},
|
|
46
50
|
} as Meta<typeof Popover>;
|
|
47
51
|
|
|
@@ -141,3 +145,93 @@ AutoPosition.args = {
|
|
|
141
145
|
position: 'auto',
|
|
142
146
|
defaultOpen: true, // Open by default to showcase auto-positioning
|
|
143
147
|
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Glass morphism popover example.
|
|
151
|
+
*/
|
|
152
|
+
export const GlassPopover = Template.bind({});
|
|
153
|
+
GlassPopover.args = {
|
|
154
|
+
...Default.args,
|
|
155
|
+
glass: true,
|
|
156
|
+
};
|
|
157
|
+
GlassPopover.decorators = [
|
|
158
|
+
(Story) => (
|
|
159
|
+
<div style={{
|
|
160
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
161
|
+
minHeight: '100vh',
|
|
162
|
+
padding: '2rem'
|
|
163
|
+
}}>
|
|
164
|
+
<Story />
|
|
165
|
+
</div>
|
|
166
|
+
),
|
|
167
|
+
];
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Glass popover with custom settings.
|
|
171
|
+
*/
|
|
172
|
+
export const GlassPopoverCustom = Template.bind({});
|
|
173
|
+
GlassPopoverCustom.args = {
|
|
174
|
+
...Default.args,
|
|
175
|
+
glass: {
|
|
176
|
+
displacementScale: 80,
|
|
177
|
+
blurAmount: 2,
|
|
178
|
+
saturation: 200,
|
|
179
|
+
aberrationIntensity: 1,
|
|
180
|
+
cornerRadius: 16,
|
|
181
|
+
mode: 'polar',
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
GlassPopoverCustom.decorators = [
|
|
185
|
+
(Story) => (
|
|
186
|
+
<div style={{
|
|
187
|
+
background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
|
|
188
|
+
minHeight: '100vh',
|
|
189
|
+
padding: '2rem'
|
|
190
|
+
}}>
|
|
191
|
+
<Story />
|
|
192
|
+
</div>
|
|
193
|
+
),
|
|
194
|
+
];
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Glass popover with hover trigger.
|
|
198
|
+
*/
|
|
199
|
+
export const GlassPopoverHover = Template.bind({});
|
|
200
|
+
GlassPopoverHover.args = {
|
|
201
|
+
...Default.args,
|
|
202
|
+
trigger: 'hover',
|
|
203
|
+
delay: 200,
|
|
204
|
+
glass: true,
|
|
205
|
+
};
|
|
206
|
+
GlassPopoverHover.decorators = [
|
|
207
|
+
(Story) => (
|
|
208
|
+
<div style={{
|
|
209
|
+
background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
|
|
210
|
+
minHeight: '100vh',
|
|
211
|
+
padding: '2rem'
|
|
212
|
+
}}>
|
|
213
|
+
<Story />
|
|
214
|
+
</div>
|
|
215
|
+
),
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Glass popover with different positions.
|
|
220
|
+
*/
|
|
221
|
+
export const GlassPopoverPositions = Template.bind({});
|
|
222
|
+
GlassPopoverPositions.args = {
|
|
223
|
+
...Default.args,
|
|
224
|
+
glass: true,
|
|
225
|
+
defaultOpen: true,
|
|
226
|
+
};
|
|
227
|
+
GlassPopoverPositions.decorators = [
|
|
228
|
+
(Story) => (
|
|
229
|
+
<div style={{
|
|
230
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
231
|
+
minHeight: '100vh',
|
|
232
|
+
padding: '2rem'
|
|
233
|
+
}}>
|
|
234
|
+
<Story />
|
|
235
|
+
</div>
|
|
236
|
+
),
|
|
237
|
+
];
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode, forwardRef, createContext } from 'react';
|
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { POPOVER } from '../../lib/constants/components';
|
|
4
4
|
import { usePopover } from '../../lib/composables/usePopover';
|
|
5
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
5
6
|
import type { PopoverProps, PopoverTriggerProps } from '../../lib/types/components';
|
|
6
7
|
|
|
7
8
|
// Context to share popover state between components
|
|
@@ -36,6 +37,7 @@ export const Popover: React.FC<PopoverProps> = ({
|
|
|
36
37
|
closeOnEscape = true,
|
|
37
38
|
id,
|
|
38
39
|
children,
|
|
40
|
+
glass,
|
|
39
41
|
}) => {
|
|
40
42
|
const {
|
|
41
43
|
isOpen,
|
|
@@ -69,14 +71,38 @@ export const Popover: React.FC<PopoverProps> = ({
|
|
|
69
71
|
createPortal(
|
|
70
72
|
<div
|
|
71
73
|
ref={popoverRef}
|
|
72
|
-
className={`c-popover c-popover--${currentPosition} ${isOpen ? POPOVER.CLASSES.IS_OPEN : ''} ${className}`}
|
|
74
|
+
className={`c-popover c-popover--${currentPosition} ${isOpen ? POPOVER.CLASSES.IS_OPEN : ''} ${glass ? 'c-popover--glass' : ''} ${className}`}
|
|
73
75
|
id={popoverId}
|
|
74
76
|
role="tooltip"
|
|
75
77
|
aria-hidden={!isOpen}
|
|
76
78
|
>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
{glass ? (
|
|
80
|
+
// Default glass settings for popovers
|
|
81
|
+
(() => {
|
|
82
|
+
const defaultGlassProps = {
|
|
83
|
+
displacementScale: 50,
|
|
84
|
+
blurAmount: 1,
|
|
85
|
+
saturation: 160,
|
|
86
|
+
aberrationIntensity: 0.5,
|
|
87
|
+
cornerRadius: 8,
|
|
88
|
+
mode: 'shader' as const,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<AtomixGlass {...glassProps}>
|
|
95
|
+
<div className="c-popover__content">
|
|
96
|
+
<div className="c-popover__content-inner">{content}</div>
|
|
97
|
+
</div>
|
|
98
|
+
</AtomixGlass>
|
|
99
|
+
);
|
|
100
|
+
})()
|
|
101
|
+
) : (
|
|
102
|
+
<div className="c-popover__content">
|
|
103
|
+
<div className="c-popover__content-inner">{content}</div>
|
|
104
|
+
</div>
|
|
105
|
+
)}
|
|
80
106
|
<div ref={arrowRef} className="c-popover__arrow"></div>
|
|
81
107
|
</div>,
|
|
82
108
|
document.body
|
|
@@ -21,6 +21,10 @@ export default {
|
|
|
21
21
|
options: ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'light', 'dark'],
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
|
+
glass: {
|
|
25
|
+
control: 'boolean',
|
|
26
|
+
description: 'Enable glass morphism effect',
|
|
27
|
+
},
|
|
24
28
|
},
|
|
25
29
|
parameters: {
|
|
26
30
|
docs: {
|
|
@@ -107,3 +111,111 @@ CustomMaxValue.args = {
|
|
|
107
111
|
readOnly: true,
|
|
108
112
|
size: 'md',
|
|
109
113
|
};
|
|
114
|
+
|
|
115
|
+
export const Glass = {
|
|
116
|
+
args: {
|
|
117
|
+
value: 4,
|
|
118
|
+
maxValue: 5,
|
|
119
|
+
allowHalf: false,
|
|
120
|
+
readOnly: true,
|
|
121
|
+
size: 'md',
|
|
122
|
+
glass: true,
|
|
123
|
+
},
|
|
124
|
+
render: (args) => (
|
|
125
|
+
<div
|
|
126
|
+
style={{
|
|
127
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
128
|
+
padding: '3rem',
|
|
129
|
+
borderRadius: '12px',
|
|
130
|
+
minHeight: '200px',
|
|
131
|
+
display: 'flex',
|
|
132
|
+
alignItems: 'center',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
<Rating {...args} />
|
|
137
|
+
</div>
|
|
138
|
+
),
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export const GlassInteractive = {
|
|
142
|
+
args: {
|
|
143
|
+
value: 3,
|
|
144
|
+
maxValue: 5,
|
|
145
|
+
allowHalf: true,
|
|
146
|
+
readOnly: false,
|
|
147
|
+
size: 'md',
|
|
148
|
+
glass: true,
|
|
149
|
+
},
|
|
150
|
+
render: (args) => (
|
|
151
|
+
<div
|
|
152
|
+
style={{
|
|
153
|
+
background: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
154
|
+
backgroundSize: 'cover',
|
|
155
|
+
backgroundPosition: 'center',
|
|
156
|
+
padding: '3rem',
|
|
157
|
+
borderRadius: '12px',
|
|
158
|
+
minHeight: '200px',
|
|
159
|
+
display: 'flex',
|
|
160
|
+
alignItems: 'center',
|
|
161
|
+
justifyContent: 'center',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
<div style={{ textAlign: 'center' }}>
|
|
165
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
166
|
+
Interactive Glass Rating
|
|
167
|
+
</h3>
|
|
168
|
+
<Rating {...args} />
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
),
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export const GlassCustom = {
|
|
175
|
+
args: {
|
|
176
|
+
value: 4.5,
|
|
177
|
+
maxValue: 5,
|
|
178
|
+
allowHalf: true,
|
|
179
|
+
readOnly: true,
|
|
180
|
+
size: 'lg',
|
|
181
|
+
color: 'warning',
|
|
182
|
+
glass: {
|
|
183
|
+
displacementScale: 80,
|
|
184
|
+
blurAmount: 2,
|
|
185
|
+
saturation: 200,
|
|
186
|
+
aberrationIntensity: 0.8,
|
|
187
|
+
cornerRadius: 12,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
render: (args) => (
|
|
191
|
+
<div
|
|
192
|
+
style={{
|
|
193
|
+
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
194
|
+
backgroundSize: '400% 400%',
|
|
195
|
+
animation: 'gradient 15s ease infinite',
|
|
196
|
+
padding: '3rem',
|
|
197
|
+
borderRadius: '12px',
|
|
198
|
+
minHeight: '200px',
|
|
199
|
+
display: 'flex',
|
|
200
|
+
alignItems: 'center',
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
}}
|
|
203
|
+
>
|
|
204
|
+
<style>
|
|
205
|
+
{`
|
|
206
|
+
@keyframes gradient {
|
|
207
|
+
0% { background-position: 0% 50%; }
|
|
208
|
+
50% { background-position: 100% 50%; }
|
|
209
|
+
100% { background-position: 0% 50%; }
|
|
210
|
+
}
|
|
211
|
+
`}
|
|
212
|
+
</style>
|
|
213
|
+
<div style={{ textAlign: 'center' }}>
|
|
214
|
+
<h3 style={{ color: 'white', marginBottom: '1rem', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
|
|
215
|
+
Custom Glass Rating
|
|
216
|
+
</h3>
|
|
217
|
+
<Rating {...args} />
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
),
|
|
221
|
+
};
|
|
@@ -3,6 +3,7 @@ import { THEME_COLORS, SIZES, RATING } from '../../lib/constants/components';
|
|
|
3
3
|
import { useRating } from '../../lib/composables/useRating';
|
|
4
4
|
import type { RatingProps } from '../../lib/types/components';
|
|
5
5
|
import useForkRef from '../../lib/utils/useForkRef';
|
|
6
|
+
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Rating component for displaying and collecting star ratings
|
|
@@ -34,6 +35,7 @@ export const Rating = forwardRef<HTMLDivElement, RatingProps>(
|
|
|
34
35
|
label,
|
|
35
36
|
id,
|
|
36
37
|
useVanillaJS = false,
|
|
38
|
+
glass,
|
|
37
39
|
...restProps
|
|
38
40
|
},
|
|
39
41
|
ref
|
|
@@ -262,7 +264,7 @@ export const Rating = forwardRef<HTMLDivElement, RatingProps>(
|
|
|
262
264
|
return stars;
|
|
263
265
|
};
|
|
264
266
|
|
|
265
|
-
|
|
267
|
+
const ratingContent = (
|
|
266
268
|
<div
|
|
267
269
|
className={ratingClasses}
|
|
268
270
|
ref={useForkRef(internalRef, ref)}
|
|
@@ -276,6 +278,28 @@ export const Rating = forwardRef<HTMLDivElement, RatingProps>(
|
|
|
276
278
|
{renderStars()}
|
|
277
279
|
</div>
|
|
278
280
|
);
|
|
281
|
+
|
|
282
|
+
if (glass) {
|
|
283
|
+
// Default glass settings for ratings
|
|
284
|
+
const defaultGlassProps = {
|
|
285
|
+
displacementScale: 60,
|
|
286
|
+
blurAmount: 1,
|
|
287
|
+
saturation: 160,
|
|
288
|
+
aberrationIntensity: 0.5,
|
|
289
|
+
cornerRadius: 8,
|
|
290
|
+
mode: 'shader' as const,
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
294
|
+
|
|
295
|
+
return (
|
|
296
|
+
<AtomixGlass {...glassProps}>
|
|
297
|
+
{ratingContent}
|
|
298
|
+
</AtomixGlass>
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return ratingContent;
|
|
279
303
|
}
|
|
280
304
|
);
|
|
281
305
|
|
|
@@ -164,17 +164,15 @@ export const SectionIntro: React.FC<SectionIntroProps> = ({
|
|
|
164
164
|
return (
|
|
165
165
|
<div className={sectionIntroClasses} ref={sectionIntroRef}>
|
|
166
166
|
{renderBackground()}
|
|
167
|
-
<div className="c-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
<
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
)}
|
|
177
|
-
</div>
|
|
167
|
+
{label && <div className="c-sectionintro__label">{label}</div>}
|
|
168
|
+
<h2 className="c-sectionintro__title">{title}</h2>
|
|
169
|
+
{text && <div className="c-sectionintro__text">{text}</div>}
|
|
170
|
+
{actions && <div className="c-sectionintro__actions">{actions}</div>}
|
|
171
|
+
{imageSrc && (
|
|
172
|
+
<div className="c-sectionintro__image-wrapper">
|
|
173
|
+
<img src={imageSrc} alt={imageAlt} className="c-sectionintro__image" />
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
178
176
|
</div>
|
|
179
177
|
);
|
|
180
178
|
};
|