@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.
Files changed (211) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1266 -1412
  3. package/dist/atomix.min.css +3 -3
  4. package/dist/index.d.ts +1232 -876
  5. package/dist/index.esm.js +16212 -26364
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15652 -22298
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +15008 -0
  12. package/dist/themes/applemix.min.css +72 -0
  13. package/dist/themes/boomdevs.css +1266 -1413
  14. package/dist/themes/boomdevs.min.css +3 -3
  15. package/dist/themes/esrar.css +1267 -1413
  16. package/dist/themes/esrar.min.css +3 -3
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1264 -1410
  20. package/dist/themes/mashroom.min.css +5 -5
  21. package/dist/themes/shaj-default.css +1266 -1412
  22. package/dist/themes/shaj-default.min.css +3 -3
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +4 -26
  25. package/src/components/Accordion/Accordion.tsx +21 -12
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +487 -1215
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +400 -0
  29. package/src/components/AtomixGlass/GlassFilter.tsx +156 -0
  30. package/src/components/AtomixGlass/README.md +124 -2
  31. package/src/components/AtomixGlass/atomixGLass.old.tsx +1266 -0
  32. package/src/components/AtomixGlass/glass-utils.ts +263 -0
  33. package/src/components/AtomixGlass/shader-utils.ts +404 -236
  34. package/src/components/AtomixGlass/{AtomixGlass.stories.tsx → stories/AtomixGlass.stories.tsx} +55 -35
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +57 -89
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +149 -149
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +95 -32
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +0 -2
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +9 -18
  40. package/src/components/AtomixGlass/utils.ts +3 -3
  41. package/src/components/Avatar/Avatar.tsx +3 -0
  42. package/src/components/Avatar/AvatarGroup.tsx +2 -1
  43. package/src/components/Badge/Badge.stories.tsx +74 -54
  44. package/src/components/Badge/Badge.tsx +8 -12
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.tsx +3 -5
  47. package/src/components/Callout/Callout.stories.tsx +86 -35
  48. package/src/components/Callout/Callout.tsx +4 -0
  49. package/src/components/Card/Card.stories.tsx +89 -85
  50. package/src/components/Card/Card.tsx +15 -4
  51. package/src/components/Card/ElevationCard.tsx +2 -0
  52. package/src/components/Chart/AnimatedChart.tsx +179 -156
  53. package/src/components/Chart/AreaChart.tsx +123 -12
  54. package/src/components/Chart/BarChart.tsx +91 -100
  55. package/src/components/Chart/BaseChart.tsx +80 -0
  56. package/src/components/Chart/BubbleChart.tsx +114 -290
  57. package/src/components/Chart/CandlestickChart.tsx +282 -622
  58. package/src/components/Chart/Chart.stories.tsx +576 -179
  59. package/src/components/Chart/Chart.tsx +374 -75
  60. package/src/components/Chart/ChartRenderer.tsx +371 -220
  61. package/src/components/Chart/ChartToolbar.tsx +372 -61
  62. package/src/components/Chart/ChartTooltip.tsx +33 -18
  63. package/src/components/Chart/DonutChart.tsx +172 -254
  64. package/src/components/Chart/FunnelChart.tsx +169 -240
  65. package/src/components/Chart/GaugeChart.tsx +224 -392
  66. package/src/components/Chart/HeatmapChart.tsx +302 -440
  67. package/src/components/Chart/LineChart.tsx +148 -103
  68. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  69. package/src/components/Chart/PieChart.tsx +114 -64
  70. package/src/components/Chart/RadarChart.tsx +202 -218
  71. package/src/components/Chart/ScatterChart.tsx +111 -97
  72. package/src/components/Chart/TreemapChart.tsx +147 -222
  73. package/src/components/Chart/WaterfallChart.tsx +253 -291
  74. package/src/components/Chart/index.ts +11 -9
  75. package/src/components/Chart/types.ts +85 -9
  76. package/src/components/Chart/utils.ts +66 -0
  77. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  78. package/src/components/Countdown/Countdown.tsx +4 -0
  79. package/src/components/DataTable/DataTable.tsx +2 -1
  80. package/src/components/DatePicker/DatePicker.stories.tsx +0 -11
  81. package/src/components/DatePicker/DatePicker.tsx +3 -9
  82. package/src/components/DatePicker/types.ts +5 -0
  83. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  84. package/src/components/Dropdown/Dropdown.tsx +26 -28
  85. package/src/components/EdgePanel/EdgePanel.stories.tsx +13 -15
  86. package/src/components/EdgePanel/EdgePanel.tsx +20 -5
  87. package/src/components/Footer/Footer.stories.tsx +187 -60
  88. package/src/components/Footer/Footer.test.tsx +134 -0
  89. package/src/components/Footer/Footer.tsx +133 -34
  90. package/src/components/Footer/FooterLink.tsx +1 -1
  91. package/src/components/Footer/FooterSection.tsx +53 -36
  92. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  93. package/src/components/Footer/README.md +82 -3
  94. package/src/components/Footer/index.ts +1 -1
  95. package/src/components/Form/Checkbox.stories.tsx +13 -5
  96. package/src/components/Form/Checkbox.tsx +3 -6
  97. package/src/components/Form/Form.stories.tsx +10 -3
  98. package/src/components/Form/Form.tsx +2 -0
  99. package/src/components/Form/FormGroup.tsx +2 -1
  100. package/src/components/Form/Input.stories.tsx +12 -11
  101. package/src/components/Form/Input.tsx +97 -95
  102. package/src/components/Form/Radio.stories.tsx +22 -7
  103. package/src/components/Form/Radio.tsx +3 -6
  104. package/src/components/Form/Select.stories.tsx +21 -6
  105. package/src/components/Form/Select.tsx +3 -5
  106. package/src/components/Form/Textarea.stories.tsx +13 -11
  107. package/src/components/Form/Textarea.tsx +88 -86
  108. package/src/components/Hero/Hero.stories.tsx +2 -3
  109. package/src/components/Hero/Hero.tsx +5 -6
  110. package/src/components/Icon/Icon.tsx +12 -1
  111. package/src/components/List/List.tsx +2 -1
  112. package/src/components/List/ListGroup.tsx +2 -1
  113. package/src/components/Messages/Messages.tsx +3 -2
  114. package/src/components/Modal/Modal.stories.tsx +48 -34
  115. package/src/components/Modal/Modal.tsx +19 -23
  116. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  117. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  118. package/src/components/Navigation/Nav/Nav.tsx +6 -1
  119. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  120. package/src/components/Navigation/Navbar/Navbar.tsx +4 -1
  121. package/src/components/Navigation/SideMenu/SideMenu.tsx +3 -2
  122. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  123. package/src/components/Pagination/Pagination.tsx +7 -6
  124. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  125. package/src/components/Popover/Popover.stories.tsx +32 -24
  126. package/src/components/Popover/Popover.tsx +4 -1
  127. package/src/components/ProductReview/ProductReview.tsx +8 -2
  128. package/src/components/Progress/Progress.tsx +2 -1
  129. package/src/components/Rating/Rating.stories.tsx +11 -6
  130. package/src/components/Rating/Rating.tsx +3 -5
  131. package/src/components/River/River.tsx +5 -5
  132. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  133. package/src/components/Slider/Slider.stories.tsx +4 -4
  134. package/src/components/Slider/Slider.tsx +4 -3
  135. package/src/components/Spinner/Spinner.tsx +2 -1
  136. package/src/components/Steps/Steps.stories.tsx +5 -4
  137. package/src/components/Steps/Steps.tsx +8 -5
  138. package/src/components/Tab/Tab.stories.tsx +4 -3
  139. package/src/components/Tab/Tab.tsx +8 -6
  140. package/src/components/Testimonial/Testimonial.tsx +8 -2
  141. package/src/components/Todo/Todo.tsx +2 -1
  142. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  143. package/src/components/Toggle/Toggle.tsx +8 -5
  144. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  145. package/src/components/Tooltip/Tooltip.tsx +9 -2
  146. package/src/components/Upload/Upload.stories.tsx +252 -0
  147. package/src/components/Upload/Upload.tsx +92 -53
  148. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  149. package/src/components/index.ts +0 -4
  150. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  151. package/src/layouts/Grid/Grid.tsx +20 -1
  152. package/src/layouts/Grid/GridCol.tsx +76 -48
  153. package/src/lib/composables/useAtomixGlass.ts +861 -44
  154. package/src/lib/composables/useBarChart.ts +13 -6
  155. package/src/lib/composables/useChart.ts +17 -13
  156. package/src/lib/composables/useChartExport.ts +19 -78
  157. package/src/lib/composables/useChartToolbar.ts +0 -1
  158. package/src/lib/composables/useEdgePanel.ts +111 -103
  159. package/src/lib/composables/useFooter.ts +3 -3
  160. package/src/lib/composables/useGlassContainer.ts +16 -7
  161. package/src/lib/composables/useLineChart.ts +8 -1
  162. package/src/lib/composables/useRiver.ts +5 -0
  163. package/src/lib/composables/useSlider.ts +62 -24
  164. package/src/lib/composables/useVideoPlayer.ts +60 -63
  165. package/src/lib/constants/components.ts +146 -32
  166. package/src/lib/types/components.ts +258 -10
  167. package/src/lib/utils/displacement-generator.ts +55 -49
  168. package/src/lib/utils/icons.ts +1 -1
  169. package/src/lib/utils/index.ts +16 -10
  170. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  171. package/src/styles/01-settings/_settings.animations.scss +5 -5
  172. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  173. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  174. package/src/styles/01-settings/_settings.background.scss +1 -4
  175. package/src/styles/01-settings/_settings.badge.scss +1 -1
  176. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  177. package/src/styles/01-settings/_settings.card.scss +1 -1
  178. package/src/styles/01-settings/_settings.chart.scss +65 -2
  179. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  180. package/src/styles/01-settings/_settings.footer.scss +35 -42
  181. package/src/styles/01-settings/_settings.input.scss +1 -1
  182. package/src/styles/01-settings/_settings.list.scss +1 -1
  183. package/src/styles/01-settings/_settings.rating.scss +1 -1
  184. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  185. package/src/styles/01-settings/_settings.upload.scss +6 -5
  186. package/src/styles/02-tools/_tools.animations.scss +4 -5
  187. package/src/styles/02-tools/_tools.background.scss +1 -13
  188. package/src/styles/02-tools/_tools.glass.scss +0 -1
  189. package/src/styles/02-tools/_tools.utility-api.scss +42 -34
  190. package/src/styles/03-generic/_generic.root.scss +1 -4
  191. package/src/styles/04-elements/_elements.body.scss +0 -1
  192. package/src/styles/06-components/_components.atomix-glass.scss +216 -39
  193. package/src/styles/06-components/_components.badge.scss +6 -8
  194. package/src/styles/06-components/_components.button.scss +8 -3
  195. package/src/styles/06-components/_components.card.scss +2 -14
  196. package/src/styles/06-components/_components.chart.scss +969 -1449
  197. package/src/styles/06-components/_components.dropdown.scss +19 -7
  198. package/src/styles/06-components/_components.edge-panel.scss +4 -2
  199. package/src/styles/06-components/_components.footer.scss +166 -85
  200. package/src/styles/06-components/_components.input.scss +8 -9
  201. package/src/styles/06-components/_components.list.scss +1 -0
  202. package/src/styles/06-components/_components.modal.scss +5 -3
  203. package/src/styles/06-components/_components.skeleton.scss +8 -6
  204. package/src/styles/06-components/_components.upload.scss +219 -4
  205. package/src/styles/06-components/old.chart.styles.scss +1 -30
  206. package/src/styles/99-utilities/_utilities.opacity.scss +1 -1
  207. package/src/styles/99-utilities/_utilities.scss +1 -1
  208. package/src/components/Chart/AdvancedChart.tsx +0 -624
  209. package/src/components/Chart/LineChartNew.tsx +0 -167
  210. package/src/components/Chart/RealTimeChart.tsx +0 -436
  211. 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
- return (
83
- <footer ref={ref} className={footerClass} {...props}>
84
- <div className={containerClass}>
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
- <div className={sectionsClass}>
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
- <div className={brandClass}>
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
- </div>
192
+ </GridCol>
124
193
  )}
125
194
 
126
195
  {/* Footer Sections */}
127
196
  {children && (
128
- <div className="c-footer__sections">
129
- {children}
130
- </div>
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
- <div className="c-footer__newsletter">
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 className="c-footer__newsletter-form" onSubmit={(e) => {
141
- e.preventDefault();
142
- const formData = new FormData(e.currentTarget);
143
- const email = formData.get('email') as string;
144
- if (email) handleNewsletterSubmit(email);
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
- </div>
254
+ </GridCol>
160
255
  )}
161
- </div>
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';
@@ -69,4 +69,4 @@ export const FooterLink = forwardRef<HTMLAnchorElement, FooterLinkProps>(
69
69
 
70
70
  FooterLink.displayName = 'FooterLink';
71
71
 
72
- export default FooterLink;
72
+ export default FooterLink;
@@ -1,5 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { FooterSectionProps } from '../../lib/types/components';
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<HTMLDivElement, FooterSectionProps>(
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
- <div ref={ref} className={sectionClass} {...props}>
47
- {title && (
48
- <div className="c-footer__section-header">
49
- {collapsible ? (
50
- <button
51
- type="button"
52
- className="c-footer__section-toggle"
53
- onClick={handleToggle}
54
- aria-expanded={!isCollapsed}
55
- aria-controls={`footer-section-${title.toString().toLowerCase().replace(/\s+/g, '-')}`}
56
- >
57
- {icon && <span className="c-footer__section-icon">{icon}</span>}
58
- <h4 className="c-footer__section-title">{title}</h4>
59
- <span className="c-footer__section-chevron">
60
- {isCollapsed ? '▼' : '▲'}
61
- </span>
62
- </button>
63
- ) : (
64
- <div className="c-footer__section-header-content">
65
- {icon && <span className="c-footer__section-icon">{icon}</span>}
66
- <h4 className="c-footer__section-title">{title}</h4>
67
- </div>
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
- </div>
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 icons: Record<string, string> = {
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
- return icons[platform] || '🔗';
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
- {icon || getPlatformIcon(platform)}
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
- A comprehensive footer component with multiple layout options, social links, newsletter signup, and responsive design.
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 stacked layouts
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
@@ -10,4 +10,4 @@ export type {
10
10
  FooterLayout,
11
11
  SocialPlatform,
12
12
  SocialLink,
13
- } from '../../lib/types/components';
13
+ } from '../../lib/types/components';
@@ -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: 'url(https://images.unsplash.com/photo-1506905925346-21bda4d32df4?ixlib=rb-4.0.3&auto=format&fit=crop&w=1000&q=80)',
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 style={{ color: 'white', marginBottom: '2rem', textAlign: 'center', textShadow: '0 2px 4px rgba(0,0,0,0.5)' }}>
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;