@shohojdhara/atomix 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/atomix.css +1266 -1412
- package/dist/atomix.min.css +3 -3
- package/dist/index.d.ts +1232 -876
- package/dist/index.esm.js +16212 -26364
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15652 -22298
- 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/applemix.css +15008 -0
- package/dist/themes/applemix.min.css +72 -0
- package/dist/themes/boomdevs.css +1266 -1413
- package/dist/themes/boomdevs.min.css +3 -3
- package/dist/themes/esrar.css +1267 -1413
- package/dist/themes/esrar.min.css +3 -3
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1264 -1410
- package/dist/themes/mashroom.min.css +5 -5
- package/dist/themes/shaj-default.css +1266 -1412
- package/dist/themes/shaj-default.min.css +3 -3
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +4 -26
- package/src/components/Accordion/Accordion.tsx +21 -12
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +487 -1215
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
- package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
- package/src/components/AtomixGlass/README.md +124 -2
- package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
- package/src/components/AtomixGlass/glass-utils.ts +263 -0
- package/src/components/AtomixGlass/shader-utils.ts +404 -236
- package/src/components/AtomixGlass/{AtomixGlass.stories.tsx → stories/AtomixGlass.stories.tsx} +55 -35
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +57 -89
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +149 -149
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +95 -32
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +0 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +9 -18
- package/src/components/AtomixGlass/utils.ts +3 -3
- package/src/components/Avatar/Avatar.tsx +3 -0
- package/src/components/Avatar/AvatarGroup.tsx +2 -1
- package/src/components/Badge/Badge.stories.tsx +74 -54
- package/src/components/Badge/Badge.tsx +8 -12
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.tsx +3 -5
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +4 -0
- package/src/components/Card/Card.stories.tsx +89 -85
- package/src/components/Card/Card.tsx +15 -4
- package/src/components/Card/ElevationCard.tsx +2 -0
- package/src/components/Chart/AnimatedChart.tsx +179 -156
- package/src/components/Chart/AreaChart.tsx +123 -12
- package/src/components/Chart/BarChart.tsx +91 -100
- package/src/components/Chart/BaseChart.tsx +80 -0
- package/src/components/Chart/BubbleChart.tsx +114 -290
- package/src/components/Chart/CandlestickChart.tsx +282 -622
- package/src/components/Chart/Chart.stories.tsx +576 -179
- package/src/components/Chart/Chart.tsx +374 -75
- package/src/components/Chart/ChartRenderer.tsx +371 -220
- package/src/components/Chart/ChartToolbar.tsx +372 -61
- package/src/components/Chart/ChartTooltip.tsx +33 -18
- package/src/components/Chart/DonutChart.tsx +172 -254
- package/src/components/Chart/FunnelChart.tsx +169 -240
- package/src/components/Chart/GaugeChart.tsx +224 -392
- package/src/components/Chart/HeatmapChart.tsx +302 -440
- package/src/components/Chart/LineChart.tsx +148 -103
- package/src/components/Chart/MultiAxisChart.tsx +267 -395
- package/src/components/Chart/PieChart.tsx +114 -64
- package/src/components/Chart/RadarChart.tsx +202 -218
- package/src/components/Chart/ScatterChart.tsx +111 -97
- package/src/components/Chart/TreemapChart.tsx +147 -222
- package/src/components/Chart/WaterfallChart.tsx +253 -291
- package/src/components/Chart/index.ts +11 -9
- package/src/components/Chart/types.ts +85 -9
- package/src/components/Chart/utils.ts +66 -0
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
- package/src/components/Countdown/Countdown.tsx +4 -0
- package/src/components/DataTable/DataTable.tsx +2 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +0 -11
- package/src/components/DatePicker/DatePicker.tsx +3 -9
- package/src/components/DatePicker/types.ts +5 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
- package/src/components/Dropdown/Dropdown.tsx +26 -28
- package/src/components/EdgePanel/EdgePanel.stories.tsx +13 -15
- package/src/components/EdgePanel/EdgePanel.tsx +20 -5
- package/src/components/Footer/Footer.stories.tsx +187 -60
- package/src/components/Footer/Footer.test.tsx +134 -0
- package/src/components/Footer/Footer.tsx +133 -34
- package/src/components/Footer/FooterLink.tsx +1 -1
- package/src/components/Footer/FooterSection.tsx +53 -36
- package/src/components/Footer/FooterSocialLink.tsx +32 -29
- package/src/components/Footer/README.md +82 -3
- package/src/components/Footer/index.ts +1 -1
- package/src/components/Form/Checkbox.stories.tsx +13 -5
- package/src/components/Form/Checkbox.tsx +3 -6
- package/src/components/Form/Form.stories.tsx +10 -3
- package/src/components/Form/Form.tsx +2 -0
- package/src/components/Form/FormGroup.tsx +2 -1
- package/src/components/Form/Input.stories.tsx +12 -11
- package/src/components/Form/Input.tsx +97 -95
- package/src/components/Form/Radio.stories.tsx +22 -7
- package/src/components/Form/Radio.tsx +3 -6
- package/src/components/Form/Select.stories.tsx +21 -6
- package/src/components/Form/Select.tsx +3 -5
- package/src/components/Form/Textarea.stories.tsx +13 -11
- package/src/components/Form/Textarea.tsx +88 -86
- package/src/components/Hero/Hero.stories.tsx +2 -3
- package/src/components/Hero/Hero.tsx +5 -6
- package/src/components/Icon/Icon.tsx +12 -1
- package/src/components/List/List.tsx +2 -1
- package/src/components/List/ListGroup.tsx +2 -1
- package/src/components/Messages/Messages.tsx +3 -2
- package/src/components/Modal/Modal.stories.tsx +48 -34
- package/src/components/Modal/Modal.tsx +19 -23
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.tsx +6 -1
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.tsx +4 -1
- package/src/components/Navigation/SideMenu/SideMenu.tsx +3 -2
- package/src/components/Pagination/Pagination.stories.tsx +13 -6
- package/src/components/Pagination/Pagination.tsx +7 -6
- package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
- package/src/components/Popover/Popover.stories.tsx +32 -24
- package/src/components/Popover/Popover.tsx +4 -1
- package/src/components/ProductReview/ProductReview.tsx +8 -2
- package/src/components/Progress/Progress.tsx +2 -1
- package/src/components/Rating/Rating.stories.tsx +11 -6
- package/src/components/Rating/Rating.tsx +3 -5
- package/src/components/River/River.tsx +5 -5
- package/src/components/SectionIntro/SectionIntro.tsx +8 -2
- package/src/components/Slider/Slider.stories.tsx +4 -4
- package/src/components/Slider/Slider.tsx +4 -3
- package/src/components/Spinner/Spinner.tsx +2 -1
- package/src/components/Steps/Steps.stories.tsx +5 -4
- package/src/components/Steps/Steps.tsx +8 -5
- package/src/components/Tab/Tab.stories.tsx +4 -3
- package/src/components/Tab/Tab.tsx +8 -6
- package/src/components/Testimonial/Testimonial.tsx +8 -2
- package/src/components/Todo/Todo.tsx +2 -1
- package/src/components/Toggle/Toggle.stories.tsx +5 -4
- package/src/components/Toggle/Toggle.tsx +8 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
- package/src/components/Tooltip/Tooltip.tsx +9 -2
- package/src/components/Upload/Upload.stories.tsx +252 -0
- package/src/components/Upload/Upload.tsx +92 -53
- package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
- package/src/components/index.ts +0 -4
- package/src/layouts/Grid/Grid.stories.tsx +10 -23
- package/src/layouts/Grid/Grid.tsx +20 -1
- package/src/layouts/Grid/GridCol.tsx +76 -48
- package/src/lib/composables/useAtomixGlass.ts +861 -44
- package/src/lib/composables/useBarChart.ts +13 -6
- package/src/lib/composables/useChart.ts +17 -13
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +0 -1
- package/src/lib/composables/useEdgePanel.ts +111 -103
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +8 -1
- package/src/lib/composables/useRiver.ts +5 -0
- package/src/lib/composables/useSlider.ts +62 -24
- package/src/lib/composables/useVideoPlayer.ts +60 -63
- package/src/lib/constants/components.ts +146 -32
- package/src/lib/types/components.ts +258 -10
- package/src/lib/utils/displacement-generator.ts +55 -49
- package/src/lib/utils/icons.ts +1 -1
- package/src/lib/utils/index.ts +16 -10
- package/src/styles/01-settings/_settings.accordion.scss +19 -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 -17
- package/src/styles/01-settings/_settings.background.scss +1 -4
- package/src/styles/01-settings/_settings.badge.scss +1 -1
- package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
- package/src/styles/01-settings/_settings.card.scss +1 -1
- package/src/styles/01-settings/_settings.chart.scss +65 -2
- package/src/styles/01-settings/_settings.dropdown.scss +1 -1
- package/src/styles/01-settings/_settings.footer.scss +35 -42
- package/src/styles/01-settings/_settings.input.scss +1 -1
- package/src/styles/01-settings/_settings.list.scss +1 -1
- package/src/styles/01-settings/_settings.rating.scss +1 -1
- package/src/styles/01-settings/_settings.tabs.scss +1 -1
- package/src/styles/01-settings/_settings.upload.scss +6 -5
- package/src/styles/02-tools/_tools.animations.scss +4 -5
- package/src/styles/02-tools/_tools.background.scss +1 -13
- package/src/styles/02-tools/_tools.glass.scss +0 -1
- package/src/styles/02-tools/_tools.utility-api.scss +42 -34
- package/src/styles/03-generic/_generic.root.scss +1 -4
- package/src/styles/04-elements/_elements.body.scss +0 -1
- package/src/styles/06-components/_components.atomix-glass.scss +216 -39
- package/src/styles/06-components/_components.badge.scss +6 -8
- package/src/styles/06-components/_components.button.scss +8 -3
- package/src/styles/06-components/_components.card.scss +2 -14
- package/src/styles/06-components/_components.chart.scss +969 -1449
- package/src/styles/06-components/_components.dropdown.scss +19 -7
- package/src/styles/06-components/_components.edge-panel.scss +4 -2
- package/src/styles/06-components/_components.footer.scss +166 -85
- package/src/styles/06-components/_components.input.scss +8 -9
- package/src/styles/06-components/_components.list.scss +1 -0
- package/src/styles/06-components/_components.modal.scss +5 -3
- package/src/styles/06-components/_components.skeleton.scss +8 -6
- package/src/styles/06-components/_components.upload.scss +219 -4
- package/src/styles/06-components/old.chart.styles.scss +1 -30
- package/src/styles/99-utilities/_utilities.opacity.scss +1 -1
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/components/Chart/AdvancedChart.tsx +0 -624
- package/src/components/Chart/LineChartNew.tsx +0 -167
- package/src/components/Chart/RealTimeChart.tsx +0 -436
- package/src/components/DatePicker/DatePicker copy.tsx +0 -551
|
@@ -4,6 +4,10 @@ import { useFooter } from '../../lib/composables/useFooter';
|
|
|
4
4
|
import { Button } from '../Button';
|
|
5
5
|
import { Input, Form } from '../Form';
|
|
6
6
|
import { FooterSocialLink } from './FooterSocialLink';
|
|
7
|
+
import { Grid, GridCol } from '../../layouts/Grid';
|
|
8
|
+
import { FooterSection } from './FooterSection';
|
|
9
|
+
import AtomixGlass from '../AtomixGlass/AtomixGlass';
|
|
10
|
+
import { AtomixGlassProps } from '../../lib/types/components';
|
|
7
11
|
|
|
8
12
|
/**
|
|
9
13
|
* Footer component provides a comprehensive footer section with multiple layout options,
|
|
@@ -53,6 +57,7 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
53
57
|
children,
|
|
54
58
|
className = '',
|
|
55
59
|
disabled = false,
|
|
60
|
+
glass,
|
|
56
61
|
...props
|
|
57
62
|
},
|
|
58
63
|
ref
|
|
@@ -79,14 +84,80 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
79
84
|
className,
|
|
80
85
|
});
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
// Calculate grid column sizes based on layout
|
|
88
|
+
const getGridColumnSizes = () => {
|
|
89
|
+
switch (layout) {
|
|
90
|
+
case 'columns':
|
|
91
|
+
// For columns layout, we have 3 columns (brand, content, newsletter)
|
|
92
|
+
return {
|
|
93
|
+
brand: 4,
|
|
94
|
+
content: !showNewsletter ? 8 : 4,
|
|
95
|
+
newsletter: !showNewsletter ? 0 : 4,
|
|
96
|
+
};
|
|
97
|
+
case 'centered':
|
|
98
|
+
// For centered layout, brand takes full width, content and newsletter are centered
|
|
99
|
+
return { brand: 12, content: 12, newsletter: !showNewsletter ? 0 : 12 };
|
|
100
|
+
case 'minimal':
|
|
101
|
+
// For minimal layout, everything takes full width
|
|
102
|
+
return { brand: 12, content: 12, newsletter: !showNewsletter ? 0 : 12 };
|
|
103
|
+
case 'stacked':
|
|
104
|
+
// For stacked layout, everything takes full width but stacked vertically
|
|
105
|
+
return { brand: 12, content: 12, newsletter: !showNewsletter ? 0 : 12 };
|
|
106
|
+
case 'flexible':
|
|
107
|
+
// For flexible layout, adjust based on content
|
|
108
|
+
return { brand: 'auto', content: 'auto', newsletter: 'auto' };
|
|
109
|
+
case 'sidebar':
|
|
110
|
+
// For sidebar layout, brand on left, content and newsletter on right
|
|
111
|
+
return {
|
|
112
|
+
brand: 3,
|
|
113
|
+
content: !showNewsletter ? 9 : 9,
|
|
114
|
+
newsletter: !showNewsletter ? 0 : 9,
|
|
115
|
+
};
|
|
116
|
+
case 'wide':
|
|
117
|
+
// For wide layout, content takes more space
|
|
118
|
+
return {
|
|
119
|
+
brand: 3,
|
|
120
|
+
content: !showNewsletter ? 6 : 6,
|
|
121
|
+
newsletter: !showNewsletter ? 0 : 3,
|
|
122
|
+
};
|
|
123
|
+
default:
|
|
124
|
+
return {
|
|
125
|
+
brand: 4,
|
|
126
|
+
content: !showNewsletter ? 8 : 4,
|
|
127
|
+
newsletter: !showNewsletter ? 0 : 4,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const columnSizes = getGridColumnSizes();
|
|
133
|
+
|
|
134
|
+
// Calculate responsive column sizes
|
|
135
|
+
const getResponsiveColumnProps = (columnType: 'brand' | 'content' | 'newsletter') => {
|
|
136
|
+
const baseMd =
|
|
137
|
+
layout === 'columns' || layout === 'sidebar' || layout === 'wide'
|
|
138
|
+
? columnSizes[columnType]
|
|
139
|
+
: 12;
|
|
140
|
+
|
|
141
|
+
// For flexible layout, we want auto-sizing
|
|
142
|
+
if (layout === 'flexible' && columnSizes[columnType] === 'auto') {
|
|
143
|
+
return { xs: 12, sm: true, md: true };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// For other layouts, we use specific sizes
|
|
147
|
+
return { xs: 12, md: baseMd };
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const footerContent = (
|
|
151
|
+
<div className={containerClass}>
|
|
85
152
|
{/* Main Footer Content */}
|
|
86
|
-
<
|
|
153
|
+
<Grid
|
|
154
|
+
className={sectionsClass}
|
|
155
|
+
alignItems="start"
|
|
156
|
+
justifyContent={layout === 'centered' ? 'center' : undefined}
|
|
157
|
+
>
|
|
87
158
|
{/* Brand Section */}
|
|
88
159
|
{(brand || brandLogo || brandDescription) && (
|
|
89
|
-
<
|
|
160
|
+
<GridCol {...(getResponsiveColumnProps('brand') as any)} className={brandClass}>
|
|
90
161
|
{brandLogo && (
|
|
91
162
|
<div className="c-footer__brand-logo">
|
|
92
163
|
{typeof brandLogo === 'string' ? (
|
|
@@ -102,12 +173,10 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
102
173
|
</div>
|
|
103
174
|
)}
|
|
104
175
|
{brandDescription && (
|
|
105
|
-
<div className="c-footer__brand-description">
|
|
106
|
-
{brandDescription}
|
|
107
|
-
</div>
|
|
176
|
+
<div className="c-footer__brand-description">{brandDescription}</div>
|
|
108
177
|
)}
|
|
109
178
|
{socialLinks.length > 0 && (
|
|
110
|
-
<div className="c-footer__social">
|
|
179
|
+
<div className="c-footer__social" data-testid="footer-social-links">
|
|
111
180
|
{socialLinks.map((link, index) => (
|
|
112
181
|
<FooterSocialLink
|
|
113
182
|
key={`${link.platform}-${index}`}
|
|
@@ -120,29 +189,55 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
120
189
|
))}
|
|
121
190
|
</div>
|
|
122
191
|
)}
|
|
123
|
-
</
|
|
192
|
+
</GridCol>
|
|
124
193
|
)}
|
|
125
194
|
|
|
126
195
|
{/* Footer Sections */}
|
|
127
196
|
{children && (
|
|
128
|
-
<
|
|
129
|
-
{
|
|
130
|
-
|
|
197
|
+
<GridCol
|
|
198
|
+
{...(getResponsiveColumnProps('content') as any)}
|
|
199
|
+
className="c-footer__content"
|
|
200
|
+
>
|
|
201
|
+
<Grid
|
|
202
|
+
className="c-footer__sections"
|
|
203
|
+
alignItems={layout === 'centered' || layout === 'stacked' ? 'center' : undefined}
|
|
204
|
+
>
|
|
205
|
+
{React.Children.map(children, child => {
|
|
206
|
+
// Check if the child is a valid React element
|
|
207
|
+
if (React.isValidElement(child)) {
|
|
208
|
+
console.log(
|
|
209
|
+
'Footer - passing showNewsletter:',
|
|
210
|
+
showNewsletter,
|
|
211
|
+
typeof showNewsletter
|
|
212
|
+
);
|
|
213
|
+
// Clone the element and pass the showNewsletter prop
|
|
214
|
+
return React.cloneElement(child, { showNewsletter } as any);
|
|
215
|
+
}
|
|
216
|
+
return child;
|
|
217
|
+
})}
|
|
218
|
+
</Grid>
|
|
219
|
+
</GridCol>
|
|
131
220
|
)}
|
|
132
221
|
|
|
133
222
|
{/* Newsletter Section */}
|
|
134
223
|
{showNewsletter && (
|
|
135
|
-
<
|
|
224
|
+
<GridCol
|
|
225
|
+
{...(getResponsiveColumnProps('newsletter') as any)}
|
|
226
|
+
className="c-footer__newsletter"
|
|
227
|
+
>
|
|
136
228
|
<h4 className="c-footer__newsletter-title">{newsletterTitle}</h4>
|
|
137
229
|
{newsletterDescription && (
|
|
138
230
|
<p className="c-footer__newsletter-description">{newsletterDescription}</p>
|
|
139
231
|
)}
|
|
140
|
-
<Form
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
232
|
+
<Form
|
|
233
|
+
className="c-footer__newsletter-form"
|
|
234
|
+
onSubmit={e => {
|
|
235
|
+
e.preventDefault();
|
|
236
|
+
const formData = new FormData(e.currentTarget);
|
|
237
|
+
const email = formData.get('email') as string;
|
|
238
|
+
if (email) handleNewsletterSubmit(email);
|
|
239
|
+
}}
|
|
240
|
+
>
|
|
146
241
|
<div className="c-footer__newsletter-input-group">
|
|
147
242
|
<Input
|
|
148
243
|
type="email"
|
|
@@ -156,22 +251,13 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
156
251
|
</Button>
|
|
157
252
|
</div>
|
|
158
253
|
</Form>
|
|
159
|
-
</
|
|
254
|
+
</GridCol>
|
|
160
255
|
)}
|
|
161
|
-
</
|
|
162
|
-
|
|
163
|
-
{/* Footer Bottom */}
|
|
164
|
-
{(copyright || showBackToTop) && showDivider && (
|
|
165
|
-
<hr className="c-footer__divider" />
|
|
166
|
-
)}
|
|
256
|
+
</Grid>
|
|
167
257
|
|
|
168
258
|
{(copyright || showBackToTop) && (
|
|
169
259
|
<div className={bottomClass}>
|
|
170
|
-
{copyright &&
|
|
171
|
-
<div className="c-footer__copyright">
|
|
172
|
-
{copyright}
|
|
173
|
-
</div>
|
|
174
|
-
)}
|
|
260
|
+
{copyright && <div className="c-footer__copyright">{copyright}</div>}
|
|
175
261
|
{showBackToTop && (
|
|
176
262
|
<Button
|
|
177
263
|
variant="ghost"
|
|
@@ -187,9 +273,22 @@ export const Footer = forwardRef<HTMLElement, FooterProps>(
|
|
|
187
273
|
</div>
|
|
188
274
|
)}
|
|
189
275
|
</div>
|
|
190
|
-
</footer>
|
|
191
276
|
);
|
|
192
|
-
|
|
277
|
+
|
|
278
|
+
return (
|
|
279
|
+
<footer ref={ref} className={footerClass + ` c-footer ${glass ? 'c-footer--glass' : ''}`} {...props}>
|
|
280
|
+
{glass ? (
|
|
281
|
+
<AtomixGlass {...(glass as unknown as AtomixGlassProps)} elasticity={0}>
|
|
282
|
+
<div className="c-footer__glass">
|
|
283
|
+
{footerContent}
|
|
284
|
+
</div>
|
|
285
|
+
</AtomixGlass>
|
|
286
|
+
) : (
|
|
287
|
+
footerContent
|
|
288
|
+
)}
|
|
289
|
+
</footer>
|
|
290
|
+
);
|
|
291
|
+
}
|
|
193
292
|
);
|
|
194
293
|
|
|
195
294
|
Footer.displayName = 'Footer';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { FooterSectionProps } from '
|
|
2
|
+
import { FooterSectionProps } from '@/lib/types/components';
|
|
3
|
+
import { GridCol } from '@/layouts';
|
|
4
|
+
import { useFooter } from '@/lib/composables/useFooter';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* FooterSection component provides a section within the footer for organizing links and content.
|
|
@@ -12,13 +14,17 @@ import { FooterSectionProps } from '../../lib/types/components';
|
|
|
12
14
|
* </FooterSection>
|
|
13
15
|
* ```
|
|
14
16
|
*/
|
|
15
|
-
export const FooterSection = forwardRef<
|
|
17
|
+
export const FooterSection = forwardRef<
|
|
18
|
+
HTMLDivElement,
|
|
19
|
+
FooterSectionProps & { showNewsletter?: boolean }
|
|
20
|
+
>(
|
|
16
21
|
(
|
|
17
22
|
{
|
|
18
23
|
title,
|
|
19
24
|
icon,
|
|
20
25
|
collapsible = false,
|
|
21
26
|
defaultCollapsed = false,
|
|
27
|
+
showNewsletter = false,
|
|
22
28
|
children,
|
|
23
29
|
className = '',
|
|
24
30
|
...props
|
|
@@ -27,6 +33,13 @@ export const FooterSection = forwardRef<HTMLDivElement, FooterSectionProps>(
|
|
|
27
33
|
) => {
|
|
28
34
|
const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed);
|
|
29
35
|
|
|
36
|
+
console.log(
|
|
37
|
+
'FooterSection render - showNewsletter:',
|
|
38
|
+
showNewsletter,
|
|
39
|
+
'Type:',
|
|
40
|
+
typeof showNewsletter
|
|
41
|
+
);
|
|
42
|
+
|
|
30
43
|
const handleToggle = () => {
|
|
31
44
|
if (collapsible) {
|
|
32
45
|
setIsCollapsed(!isCollapsed);
|
|
@@ -43,45 +56,49 @@ export const FooterSection = forwardRef<HTMLDivElement, FooterSectionProps>(
|
|
|
43
56
|
.join(' ');
|
|
44
57
|
|
|
45
58
|
return (
|
|
46
|
-
<
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{isCollapsed ? '▼' : '▲'}
|
|
61
|
-
</
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
59
|
+
<GridCol xs={12} md={showNewsletter ? 6 : 3} className="c-footer__section-col">
|
|
60
|
+
<div ref={ref} className={sectionClass} {...props}>
|
|
61
|
+
{title && (
|
|
62
|
+
<div className="c-footer__section-header">
|
|
63
|
+
{collapsible ? (
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
className="c-footer__section-toggle"
|
|
67
|
+
onClick={handleToggle}
|
|
68
|
+
aria-expanded={!isCollapsed}
|
|
69
|
+
aria-controls={`footer-section-${title.toString().toLowerCase().replace(/\s+/g, '-')}`}
|
|
70
|
+
>
|
|
71
|
+
{icon && <span className="c-footer__section-icon">{icon}</span>}
|
|
72
|
+
<h4 className="c-footer__section-title">{title}</h4>
|
|
73
|
+
<span className="c-footer__section-chevron">{isCollapsed ? '▼' : '▲'}</span>
|
|
74
|
+
</button>
|
|
75
|
+
) : (
|
|
76
|
+
<div className="c-footer__section-header-content">
|
|
77
|
+
{icon && <span className="c-footer__section-icon">{icon}</span>}
|
|
78
|
+
<h4 className="c-footer__section-title">{title}</h4>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
<div
|
|
84
|
+
className="c-footer__section-content"
|
|
85
|
+
id={
|
|
86
|
+
title
|
|
87
|
+
? `footer-section-${title.toString().toLowerCase().replace(/\s+/g, '-')}`
|
|
88
|
+
: undefined
|
|
89
|
+
}
|
|
90
|
+
style={{
|
|
91
|
+
display: collapsible && isCollapsed ? 'none' : 'flex',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{children}
|
|
69
95
|
</div>
|
|
70
|
-
)}
|
|
71
|
-
<div
|
|
72
|
-
className="c-footer__section-content"
|
|
73
|
-
id={title ? `footer-section-${title.toString().toLowerCase().replace(/\s+/g, '-')}` : undefined}
|
|
74
|
-
style={{
|
|
75
|
-
display: collapsible && isCollapsed ? 'none' : 'block',
|
|
76
|
-
}}
|
|
77
|
-
>
|
|
78
|
-
{children}
|
|
79
96
|
</div>
|
|
80
|
-
</
|
|
97
|
+
</GridCol>
|
|
81
98
|
);
|
|
82
99
|
}
|
|
83
100
|
);
|
|
84
101
|
|
|
85
102
|
FooterSection.displayName = 'FooterSection';
|
|
86
103
|
|
|
87
|
-
export default FooterSection;
|
|
104
|
+
export default FooterSection;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Icon } from '../Icon/Icon';
|
|
2
3
|
import { FooterSocialLinkProps } from '../../lib/types/components';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -26,29 +27,35 @@ export const FooterSocialLink = forwardRef<HTMLAnchorElement, FooterSocialLinkPr
|
|
|
26
27
|
ref
|
|
27
28
|
) => {
|
|
28
29
|
const getPlatformIcon = (platform: string) => {
|
|
29
|
-
const
|
|
30
|
-
facebook: '
|
|
31
|
-
twitter: '
|
|
32
|
-
instagram: '
|
|
33
|
-
linkedin: '
|
|
34
|
-
youtube: '
|
|
35
|
-
github: '
|
|
36
|
-
discord: '
|
|
37
|
-
tiktok: '
|
|
38
|
-
pinterest: '
|
|
39
|
-
snapchat: '
|
|
40
|
-
whatsapp: '
|
|
41
|
-
telegram: '
|
|
42
|
-
reddit: '
|
|
43
|
-
twitch: '
|
|
44
|
-
spotify: '
|
|
45
|
-
dribbble: '
|
|
46
|
-
behance: '
|
|
47
|
-
medium: '
|
|
48
|
-
dev: '
|
|
49
|
-
codepen: '
|
|
30
|
+
const iconMap: Record<string, string> = {
|
|
31
|
+
facebook: 'FacebookLogo',
|
|
32
|
+
twitter: 'TwitterLogo',
|
|
33
|
+
instagram: 'InstagramLogo',
|
|
34
|
+
linkedin: 'LinkedinLogo',
|
|
35
|
+
youtube: 'YoutubeLogo',
|
|
36
|
+
github: 'GithubLogo',
|
|
37
|
+
discord: 'DiscordLogo',
|
|
38
|
+
tiktok: 'TiktokLogo',
|
|
39
|
+
pinterest: 'PinterestLogo',
|
|
40
|
+
snapchat: 'SnapchatLogo',
|
|
41
|
+
whatsapp: 'WhatsappLogo',
|
|
42
|
+
telegram: 'TelegramLogo',
|
|
43
|
+
reddit: 'RedditLogo',
|
|
44
|
+
twitch: 'TwitchLogo',
|
|
45
|
+
spotify: 'SpotifyLogo',
|
|
46
|
+
dribbble: 'DribbbleLogo',
|
|
47
|
+
behance: 'BehanceLogo',
|
|
48
|
+
medium: 'MediumLogo',
|
|
49
|
+
dev: 'DevToLogo',
|
|
50
|
+
codepen: 'CodepenLogo',
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
+
|
|
53
|
+
const iconName = iconMap[platform];
|
|
54
|
+
if (iconName) {
|
|
55
|
+
return <Icon name={iconName as any} />;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return <Icon name="Link" />;
|
|
52
59
|
};
|
|
53
60
|
|
|
54
61
|
const getPlatformLabel = (platform: string) => {
|
|
@@ -101,12 +108,8 @@ export const FooterSocialLink = forwardRef<HTMLAnchorElement, FooterSocialLinkPr
|
|
|
101
108
|
aria-disabled={disabled}
|
|
102
109
|
{...props}
|
|
103
110
|
>
|
|
104
|
-
<span className="c-footer__social-link-icon">
|
|
105
|
-
|
|
106
|
-
</span>
|
|
107
|
-
<span className="c-footer__social-link-label u-visually-hidden">
|
|
108
|
-
{ariaLabel}
|
|
109
|
-
</span>
|
|
111
|
+
<span className="c-footer__social-link-icon">{icon || getPlatformIcon(platform)}</span>
|
|
112
|
+
<span className="c-footer__social-link-label u-visually-hidden">{ariaLabel}</span>
|
|
110
113
|
</a>
|
|
111
114
|
);
|
|
112
115
|
}
|
|
@@ -114,4 +117,4 @@ export const FooterSocialLink = forwardRef<HTMLAnchorElement, FooterSocialLinkPr
|
|
|
114
117
|
|
|
115
118
|
FooterSocialLink.displayName = 'FooterSocialLink';
|
|
116
119
|
|
|
117
|
-
export default FooterSocialLink;
|
|
120
|
+
export default FooterSocialLink;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Footer Component
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Footer component provides a comprehensive footer section with multiple layout options, social links, newsletter signup, and responsive design.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **Multiple Layouts**: Columns, centered, minimal, and
|
|
7
|
+
- **Multiple Layouts**: Columns, centered, minimal, stacked, flexible, sidebar, and wide layouts
|
|
8
8
|
- **Social Media Integration**: Built-in support for 20+ social platforms
|
|
9
9
|
- **Newsletter Signup**: Optional newsletter subscription form
|
|
10
10
|
- **Responsive Design**: Mobile-first with collapsible sections
|
|
@@ -74,7 +74,7 @@ import { Footer, FooterSection, FooterLink } from '@shohojdhara/atomix';
|
|
|
74
74
|
| `brandLogo` | `string \| ReactNode` | - | Brand logo (image URL or React element) |
|
|
75
75
|
| `brandDescription` | `ReactNode` | - | Brand description text |
|
|
76
76
|
| `copyright` | `ReactNode` | - | Copyright text |
|
|
77
|
-
| `layout` | `'columns' \| 'centered' \| 'minimal' \| 'stacked'` | `'columns'` | Footer layout variant |
|
|
77
|
+
| `layout` | `'columns' \| 'centered' \| 'minimal' \| 'stacked' \| 'flexible' \| 'sidebar' \| 'wide'` | `'columns'` | Footer layout variant |
|
|
78
78
|
| `variant` | `ThemeColor` | `'primary'` | Color variant |
|
|
79
79
|
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size variant |
|
|
80
80
|
| `showNewsletter` | `boolean` | `false` | Whether to show newsletter signup |
|
|
@@ -162,6 +162,36 @@ interface SocialLink {
|
|
|
162
162
|
</Footer>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
### Flexible
|
|
166
|
+
```tsx
|
|
167
|
+
<Footer layout="flexible">
|
|
168
|
+
{/* Flexible layout that adapts to content */}
|
|
169
|
+
</Footer>
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Sidebar
|
|
173
|
+
```tsx
|
|
174
|
+
<Footer layout="sidebar">
|
|
175
|
+
{/* Brand section on left, content on right */}
|
|
176
|
+
</Footer>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Wide
|
|
180
|
+
```tsx
|
|
181
|
+
<Footer layout="wide">
|
|
182
|
+
{/* Wide layout with extended content area */}
|
|
183
|
+
</Footer>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Grid System Integration
|
|
187
|
+
|
|
188
|
+
The Footer component uses the enhanced Grid and GridCol components for responsive layouts:
|
|
189
|
+
|
|
190
|
+
- Grid supports additional props like `direction` and `wrap`
|
|
191
|
+
- GridCol supports additional props like `grow`, `shrink`, `basis`, and `align`
|
|
192
|
+
|
|
193
|
+
These enhancements provide better control over the footer layout for different screen sizes and design requirements.
|
|
194
|
+
|
|
165
195
|
## Styling
|
|
166
196
|
|
|
167
197
|
The Footer component uses CSS custom properties for theming:
|
|
@@ -251,6 +281,55 @@ The Footer component uses CSS custom properties for theming:
|
|
|
251
281
|
</Footer>
|
|
252
282
|
```
|
|
253
283
|
|
|
284
|
+
### Sidebar Layout Example
|
|
285
|
+
|
|
286
|
+
```tsx
|
|
287
|
+
<Footer
|
|
288
|
+
layout="sidebar"
|
|
289
|
+
brand="My Company"
|
|
290
|
+
brandLogo="/logo.png"
|
|
291
|
+
copyright="© 2024 My Company. All rights reserved."
|
|
292
|
+
showNewsletter
|
|
293
|
+
>
|
|
294
|
+
<FooterSection title="Products">
|
|
295
|
+
<FooterLink href="/product1">Product 1</FooterLink>
|
|
296
|
+
<FooterLink href="/product2">Product 2</FooterLink>
|
|
297
|
+
</FooterSection>
|
|
298
|
+
|
|
299
|
+
<FooterSection title="Company">
|
|
300
|
+
<FooterLink href="/about">About Us</FooterLink>
|
|
301
|
+
<FooterLink href="/careers">Careers</FooterLink>
|
|
302
|
+
</FooterSection>
|
|
303
|
+
</Footer>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### Wide Layout with Flexible Design
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
<Footer
|
|
310
|
+
layout="wide"
|
|
311
|
+
brand="Enterprise Solution"
|
|
312
|
+
copyright="© 2024 Enterprise Solution. All rights reserved."
|
|
313
|
+
showNewsletter
|
|
314
|
+
socialLinks={[
|
|
315
|
+
{ platform: 'linkedin', url: 'https://linkedin.com/company' },
|
|
316
|
+
{ platform: 'twitter', url: 'https://twitter.com/company' }
|
|
317
|
+
]}
|
|
318
|
+
>
|
|
319
|
+
<FooterSection title="Solutions">
|
|
320
|
+
<FooterLink href="/cloud">Cloud Services</FooterLink>
|
|
321
|
+
<FooterLink href="/security">Security</FooterLink>
|
|
322
|
+
<FooterLink href="/analytics">Analytics</FooterLink>
|
|
323
|
+
</FooterSection>
|
|
324
|
+
|
|
325
|
+
<FooterSection title="Resources">
|
|
326
|
+
<FooterLink href="/whitepapers">Whitepapers</FooterLink>
|
|
327
|
+
<FooterLink href="/case-studies">Case Studies</FooterLink>
|
|
328
|
+
<FooterLink href="/webinars">Webinars</FooterLink>
|
|
329
|
+
</FooterSection>
|
|
330
|
+
</Footer>
|
|
331
|
+
```
|
|
332
|
+
|
|
254
333
|
## Best Practices
|
|
255
334
|
|
|
256
335
|
1. **Keep it organized**: Group related links in logical sections
|
|
@@ -59,7 +59,7 @@ export const Checked: Story = {
|
|
|
59
59
|
|
|
60
60
|
// Checkbox states
|
|
61
61
|
export const States: Story = {
|
|
62
|
-
render: args => (
|
|
62
|
+
render: (args: any) => (
|
|
63
63
|
<div className="u-d-flex u-flex-column u-gap-3">
|
|
64
64
|
<Checkbox label="Default checkbox" />
|
|
65
65
|
<Checkbox label="Checked checkbox" checked />
|
|
@@ -85,7 +85,7 @@ export const Glass: Story = {
|
|
|
85
85
|
label: 'Glass Checkbox',
|
|
86
86
|
glass: true,
|
|
87
87
|
},
|
|
88
|
-
render: (args) => (
|
|
88
|
+
render: (args: any) => (
|
|
89
89
|
<div
|
|
90
90
|
style={{
|
|
91
91
|
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
@@ -114,10 +114,11 @@ export const GlassCustom: Story = {
|
|
|
114
114
|
cornerRadius: 12,
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
|
-
render: (args) => (
|
|
117
|
+
render: (args: any) => (
|
|
118
118
|
<div
|
|
119
119
|
style={{
|
|
120
|
-
background:
|
|
120
|
+
background:
|
|
121
|
+
'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
|
|
121
122
|
backgroundSize: 'cover',
|
|
122
123
|
backgroundPosition: 'center',
|
|
123
124
|
padding: '2rem',
|
|
@@ -159,7 +160,14 @@ export const GlassStates: Story = {
|
|
|
159
160
|
`}
|
|
160
161
|
</style>
|
|
161
162
|
<div>
|
|
162
|
-
<h3
|
|
163
|
+
<h3
|
|
164
|
+
style={{
|
|
165
|
+
color: 'white',
|
|
166
|
+
marginBottom: '2rem',
|
|
167
|
+
textAlign: 'center',
|
|
168
|
+
textShadow: '0 2px 4px rgba(0,0,0,0.5)',
|
|
169
|
+
}}
|
|
170
|
+
>
|
|
163
171
|
Glass Checkbox States
|
|
164
172
|
</h3>
|
|
165
173
|
<div className="u-d-flex u-flex-column u-gap-3">
|
|
@@ -11,6 +11,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
|
|
|
11
11
|
checked = false,
|
|
12
12
|
onChange,
|
|
13
13
|
className = '',
|
|
14
|
+
style,
|
|
14
15
|
disabled = false,
|
|
15
16
|
required = false,
|
|
16
17
|
id,
|
|
@@ -39,7 +40,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
|
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
const checkboxContent = (
|
|
42
|
-
<div className={checkboxClass}>
|
|
43
|
+
<div className={checkboxClass} style={style}>
|
|
43
44
|
<input
|
|
44
45
|
ref={checkboxRef}
|
|
45
46
|
type="checkbox"
|
|
@@ -76,11 +77,7 @@ export const Checkbox: React.FC<CheckboxProps> = ({
|
|
|
76
77
|
|
|
77
78
|
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
78
79
|
|
|
79
|
-
return
|
|
80
|
-
<AtomixGlass {...glassProps}>
|
|
81
|
-
{checkboxContent}
|
|
82
|
-
</AtomixGlass>
|
|
83
|
-
);
|
|
80
|
+
return <AtomixGlass {...glassProps}>{checkboxContent}</AtomixGlass>;
|
|
84
81
|
}
|
|
85
82
|
|
|
86
83
|
return checkboxContent;
|