@shohojdhara/atomix 0.2.3 → 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 (225) hide show
  1. package/README.md +19 -0
  2. package/dist/atomix.css +1703 -1544
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/index.d.ts +1465 -963
  5. package/dist/index.esm.js +16289 -25908
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +15650 -21780
  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 +1608 -1450
  14. package/dist/themes/boomdevs.min.css +5 -5
  15. package/dist/themes/esrar.css +1702 -1543
  16. package/dist/themes/esrar.min.css +4 -4
  17. package/dist/themes/flashtrade.css +15159 -0
  18. package/dist/themes/flashtrade.min.css +86 -0
  19. package/dist/themes/mashroom.css +1699 -1540
  20. package/dist/themes/mashroom.min.css +7 -7
  21. package/dist/themes/shaj-default.css +1693 -1534
  22. package/dist/themes/shaj-default.min.css +4 -4
  23. package/package.json +6 -17
  24. package/src/components/Accordion/Accordion.stories.tsx +662 -21
  25. package/src/components/Accordion/Accordion.tsx +21 -14
  26. package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
  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 +792 -68
  34. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
  35. package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
  36. package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
  37. package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
  38. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
  39. package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
  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 +76 -55
  44. package/src/components/Badge/Badge.tsx +12 -14
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
  46. package/src/components/Button/Button.stories.tsx +501 -20
  47. package/src/components/Button/Button.tsx +5 -8
  48. package/src/components/Callout/Callout.stories.tsx +86 -35
  49. package/src/components/Callout/Callout.tsx +31 -9
  50. package/src/components/Card/Card.stories.tsx +565 -2
  51. package/src/components/Card/Card.tsx +15 -4
  52. package/src/components/Card/ElevationCard.tsx +2 -0
  53. package/src/components/Chart/AnimatedChart.tsx +179 -156
  54. package/src/components/Chart/AreaChart.tsx +123 -12
  55. package/src/components/Chart/BarChart.tsx +91 -100
  56. package/src/components/Chart/BaseChart.tsx +80 -0
  57. package/src/components/Chart/BubbleChart.tsx +114 -290
  58. package/src/components/Chart/CandlestickChart.tsx +282 -622
  59. package/src/components/Chart/Chart.stories.tsx +576 -179
  60. package/src/components/Chart/Chart.tsx +374 -75
  61. package/src/components/Chart/ChartRenderer.tsx +371 -220
  62. package/src/components/Chart/ChartToolbar.tsx +372 -61
  63. package/src/components/Chart/ChartTooltip.tsx +33 -18
  64. package/src/components/Chart/DonutChart.tsx +172 -254
  65. package/src/components/Chart/FunnelChart.tsx +169 -240
  66. package/src/components/Chart/GaugeChart.tsx +224 -392
  67. package/src/components/Chart/HeatmapChart.tsx +302 -440
  68. package/src/components/Chart/LineChart.tsx +148 -103
  69. package/src/components/Chart/MultiAxisChart.tsx +267 -395
  70. package/src/components/Chart/PieChart.tsx +114 -64
  71. package/src/components/Chart/RadarChart.tsx +202 -218
  72. package/src/components/Chart/ScatterChart.tsx +111 -97
  73. package/src/components/Chart/TreemapChart.tsx +147 -222
  74. package/src/components/Chart/WaterfallChart.tsx +253 -291
  75. package/src/components/Chart/index.ts +11 -9
  76. package/src/components/Chart/types.ts +85 -9
  77. package/src/components/Chart/utils.ts +66 -0
  78. package/src/components/ColorModeToggle/ColorModeToggle.tsx +6 -3
  79. package/src/components/Countdown/Countdown.tsx +4 -0
  80. package/src/components/DataTable/DataTable.tsx +2 -1
  81. package/src/components/DatePicker/DatePicker.stories.tsx +689 -12
  82. package/src/components/DatePicker/DatePicker.tsx +3 -9
  83. package/src/components/DatePicker/types.ts +5 -0
  84. package/src/components/Dropdown/Dropdown.stories.tsx +32 -25
  85. package/src/components/Dropdown/Dropdown.tsx +26 -28
  86. package/src/components/EdgePanel/EdgePanel.stories.tsx +473 -2
  87. package/src/components/EdgePanel/EdgePanel.tsx +101 -13
  88. package/src/components/Footer/Footer.stories.tsx +187 -60
  89. package/src/components/Footer/Footer.test.tsx +134 -0
  90. package/src/components/Footer/Footer.tsx +133 -34
  91. package/src/components/Footer/FooterLink.tsx +1 -1
  92. package/src/components/Footer/FooterSection.tsx +53 -36
  93. package/src/components/Footer/FooterSocialLink.tsx +32 -29
  94. package/src/components/Footer/README.md +82 -3
  95. package/src/components/Footer/index.ts +1 -1
  96. package/src/components/Form/Checkbox.stories.tsx +13 -5
  97. package/src/components/Form/Checkbox.tsx +3 -6
  98. package/src/components/Form/Form.stories.tsx +10 -3
  99. package/src/components/Form/Form.tsx +2 -0
  100. package/src/components/Form/FormGroup.tsx +2 -1
  101. package/src/components/Form/Input.stories.tsx +12 -11
  102. package/src/components/Form/Input.tsx +97 -95
  103. package/src/components/Form/Radio.stories.tsx +22 -7
  104. package/src/components/Form/Radio.tsx +3 -6
  105. package/src/components/Form/Select.stories.tsx +21 -6
  106. package/src/components/Form/Select.tsx +3 -5
  107. package/src/components/Form/Textarea.stories.tsx +13 -11
  108. package/src/components/Form/Textarea.tsx +88 -86
  109. package/src/components/Hero/Hero.stories.tsx +2 -3
  110. package/src/components/Hero/Hero.tsx +5 -6
  111. package/src/components/Icon/Icon.tsx +12 -1
  112. package/src/components/List/List.tsx +2 -1
  113. package/src/components/List/ListGroup.tsx +2 -1
  114. package/src/components/Messages/Messages.stories.tsx +113 -0
  115. package/src/components/Messages/Messages.tsx +52 -9
  116. package/src/components/Modal/Modal.stories.tsx +48 -32
  117. package/src/components/Modal/Modal.tsx +19 -24
  118. package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
  119. package/src/components/Navigation/Menu/Menu.tsx +2 -2
  120. package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
  121. package/src/components/Navigation/Nav/Nav.tsx +22 -4
  122. package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
  123. package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
  124. package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
  125. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
  126. package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -2
  127. package/src/components/Pagination/Pagination.stories.tsx +13 -6
  128. package/src/components/Pagination/Pagination.tsx +7 -6
  129. package/src/components/PhotoViewer/PhotoViewer.tsx +2 -1
  130. package/src/components/Popover/Popover.stories.tsx +32 -24
  131. package/src/components/Popover/Popover.tsx +4 -1
  132. package/src/components/ProductReview/ProductReview.tsx +8 -2
  133. package/src/components/Progress/Progress.tsx +19 -3
  134. package/src/components/Rating/Rating.stories.tsx +11 -6
  135. package/src/components/Rating/Rating.tsx +3 -5
  136. package/src/components/River/River.tsx +5 -5
  137. package/src/components/SectionIntro/SectionIntro.tsx +8 -2
  138. package/src/components/Slider/Slider.stories.tsx +4 -4
  139. package/src/components/Slider/Slider.tsx +4 -3
  140. package/src/components/Spinner/Spinner.tsx +19 -3
  141. package/src/components/Steps/Steps.stories.tsx +5 -4
  142. package/src/components/Steps/Steps.tsx +8 -5
  143. package/src/components/Tab/Tab.stories.tsx +4 -3
  144. package/src/components/Tab/Tab.tsx +8 -6
  145. package/src/components/Testimonial/Testimonial.tsx +8 -2
  146. package/src/components/Todo/Todo.tsx +2 -1
  147. package/src/components/Toggle/Toggle.stories.tsx +5 -4
  148. package/src/components/Toggle/Toggle.tsx +8 -5
  149. package/src/components/Tooltip/Tooltip.stories.tsx +40 -30
  150. package/src/components/Tooltip/Tooltip.tsx +9 -2
  151. package/src/components/Upload/Upload.stories.tsx +252 -0
  152. package/src/components/Upload/Upload.tsx +92 -53
  153. package/src/components/VideoPlayer/VideoPlayer.tsx +3 -1
  154. package/src/components/index.ts +0 -4
  155. package/src/layouts/Grid/Grid.stories.tsx +10 -23
  156. package/src/layouts/Grid/Grid.tsx +20 -1
  157. package/src/layouts/Grid/GridCol.tsx +76 -48
  158. package/src/lib/composables/useAtomixGlass.ts +861 -44
  159. package/src/lib/composables/useBarChart.ts +21 -4
  160. package/src/lib/composables/useChart.ts +227 -370
  161. package/src/lib/composables/useChartExport.ts +19 -78
  162. package/src/lib/composables/useChartToolbar.ts +11 -21
  163. package/src/lib/composables/useEdgePanel.ts +125 -71
  164. package/src/lib/composables/useFooter.ts +3 -3
  165. package/src/lib/composables/useGlassContainer.ts +16 -7
  166. package/src/lib/composables/useLineChart.ts +11 -2
  167. package/src/lib/composables/usePieChart.ts +4 -14
  168. package/src/lib/composables/useRiver.ts +5 -0
  169. package/src/lib/composables/useSlider.ts +62 -24
  170. package/src/lib/composables/useVideoPlayer.ts +60 -63
  171. package/src/lib/constants/components.ts +147 -32
  172. package/src/lib/types/components.ts +355 -25
  173. package/src/lib/utils/displacement-generator.ts +55 -49
  174. package/src/lib/utils/icons.ts +1 -1
  175. package/src/lib/utils/index.ts +16 -10
  176. package/src/styles/01-settings/_settings.accordion.scss +19 -19
  177. package/src/styles/01-settings/_settings.animations.scss +5 -5
  178. package/src/styles/01-settings/_settings.avatar-group.scss +1 -1
  179. package/src/styles/01-settings/_settings.avatar.scss +17 -17
  180. package/src/styles/01-settings/_settings.background.scss +0 -3
  181. package/src/styles/01-settings/_settings.badge.scss +1 -1
  182. package/src/styles/01-settings/_settings.breadcrumb.scss +1 -1
  183. package/src/styles/01-settings/_settings.card.scss +1 -1
  184. package/src/styles/01-settings/_settings.chart.scss +65 -2
  185. package/src/styles/01-settings/_settings.dropdown.scss +1 -1
  186. package/src/styles/01-settings/_settings.edge-panel.scss +1 -1
  187. package/src/styles/01-settings/_settings.footer.scss +35 -42
  188. package/src/styles/01-settings/_settings.input.scss +1 -1
  189. package/src/styles/01-settings/_settings.list.scss +1 -1
  190. package/src/styles/01-settings/_settings.rating.scss +1 -1
  191. package/src/styles/01-settings/_settings.tabs.scss +1 -1
  192. package/src/styles/01-settings/_settings.upload.scss +6 -5
  193. package/src/styles/02-tools/_tools.animations.scss +4 -5
  194. package/src/styles/02-tools/_tools.background.scss +1 -13
  195. package/src/styles/02-tools/_tools.glass.scss +0 -1
  196. package/src/styles/02-tools/_tools.utility-api.scss +91 -48
  197. package/src/styles/03-generic/_generic.root.scss +1 -4
  198. package/src/styles/04-elements/_elements.body.scss +0 -1
  199. package/src/styles/06-components/_components.atomix-glass.scss +249 -0
  200. package/src/styles/06-components/_components.badge.scss +8 -23
  201. package/src/styles/06-components/_components.button.scss +8 -3
  202. package/src/styles/06-components/_components.callout.scss +10 -5
  203. package/src/styles/06-components/_components.card.scss +2 -14
  204. package/src/styles/06-components/_components.chart.scss +969 -1449
  205. package/src/styles/06-components/_components.dropdown.scss +19 -7
  206. package/src/styles/06-components/_components.edge-panel.scss +103 -0
  207. package/src/styles/06-components/_components.footer.scss +166 -85
  208. package/src/styles/06-components/_components.input.scss +8 -9
  209. package/src/styles/06-components/_components.list.scss +1 -0
  210. package/src/styles/06-components/_components.messages.scss +176 -0
  211. package/src/styles/06-components/_components.modal.scss +16 -4
  212. package/src/styles/06-components/_components.navbar.scss +12 -1
  213. package/src/styles/06-components/_components.side-menu.scss +5 -0
  214. package/src/styles/06-components/_components.skeleton.scss +8 -6
  215. package/src/styles/06-components/_components.upload.scss +219 -4
  216. package/src/styles/06-components/old.chart.styles.scss +1 -30
  217. package/src/styles/99-utilities/_index.scss +1 -0
  218. package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
  219. package/src/styles/99-utilities/_utilities.scss +1 -1
  220. package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
  221. package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
  222. package/src/components/Chart/AdvancedChart.tsx +0 -624
  223. package/src/components/Chart/LineChartNew.tsx +0 -167
  224. package/src/components/Chart/RealTimeChart.tsx +0 -436
  225. package/src/components/DatePicker/DatePicker copy.tsx +0 -551
@@ -6,99 +6,101 @@ import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
6
6
  /**
7
7
  * Textarea - A component for multiline text input
8
8
  */
9
- export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(({
10
- value,
11
- onChange,
12
- onBlur,
13
- onFocus,
14
- placeholder,
15
- className = '',
16
- disabled = false,
17
- required = false,
18
- readOnly = false,
19
- id,
20
- name,
21
- rows = 4,
22
- cols,
23
- maxLength,
24
- minLength,
25
- size = 'md',
26
- variant,
27
- invalid = false,
28
- valid = false,
29
- autoFocus = false,
30
- ariaLabel,
31
- ariaDescribedBy,
32
- glass,
33
- }, ref) => {
34
- const { generateTextareaClass } = useTextarea({
35
- size,
36
- variant,
37
- disabled,
38
- invalid,
39
- valid,
40
- });
9
+ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
10
+ (
11
+ {
12
+ value,
13
+ onChange,
14
+ onBlur,
15
+ onFocus,
16
+ placeholder,
17
+ className = '',
18
+ style,
19
+ disabled = false,
20
+ required = false,
21
+ readOnly = false,
22
+ id,
23
+ name,
24
+ rows = 4,
25
+ cols,
26
+ maxLength,
27
+ minLength,
28
+ size = 'md',
29
+ variant,
30
+ invalid = false,
31
+ valid = false,
32
+ autoFocus = false,
33
+ ariaLabel,
34
+ ariaDescribedBy,
35
+ glass,
36
+ },
37
+ ref
38
+ ) => {
39
+ const { generateTextareaClass } = useTextarea({
40
+ size,
41
+ variant,
42
+ disabled,
43
+ invalid,
44
+ valid,
45
+ });
41
46
 
42
- const textareaClass = generateTextareaClass({
43
- className: `${className} ${glass ? 'c-input--glass' : ''}`.trim(),
44
- size,
45
- variant,
46
- disabled,
47
- invalid,
48
- valid,
49
- });
47
+ const textareaClass = generateTextareaClass({
48
+ className: `${className} ${glass ? 'c-input--glass' : ''}`.trim(),
49
+ size,
50
+ variant,
51
+ disabled,
52
+ invalid,
53
+ valid,
54
+ });
50
55
 
51
- // Custom styles for glass effect
52
- const glassStyles = glass ? {} : {};
56
+ // Custom styles for glass effect
57
+ const glassStyles = glass ? {} : {};
53
58
 
54
- const textareaElement = (
55
- <textarea
56
- ref={ref}
57
- className={textareaClass}
58
- value={value}
59
- onChange={onChange}
60
- onBlur={onBlur}
61
- onFocus={onFocus}
62
- placeholder={placeholder}
63
- disabled={disabled}
64
- required={required}
65
- readOnly={readOnly}
66
- id={id}
67
- name={name}
68
- rows={rows}
69
- cols={cols}
70
- maxLength={maxLength}
71
- minLength={minLength}
72
- autoFocus={autoFocus}
73
- aria-label={ariaLabel}
74
- aria-describedby={ariaDescribedBy}
75
- aria-invalid={invalid}
76
- style={glass ? glassStyles : undefined}
77
- />
78
- );
59
+ const textareaElement = (
60
+ <textarea
61
+ ref={ref}
62
+ className={textareaClass}
63
+ value={value}
64
+ onChange={onChange}
65
+ onBlur={onBlur}
66
+ onFocus={onFocus}
67
+ placeholder={placeholder}
68
+ disabled={disabled}
69
+ required={required}
70
+ readOnly={readOnly}
71
+ id={id}
72
+ name={name}
73
+ rows={rows}
74
+ cols={cols}
75
+ maxLength={maxLength}
76
+ minLength={minLength}
77
+ autoFocus={autoFocus}
78
+ aria-label={ariaLabel}
79
+ aria-describedby={ariaDescribedBy}
80
+ aria-invalid={invalid}
81
+ style={glass ? { ...glassStyles, ...style } : style}
82
+ />
83
+ );
79
84
 
80
- if (glass) {
81
- // Default glass settings for textareas
82
- const defaultGlassProps = {
83
- displacementScale: 60,
84
- blurAmount: 1,
85
- saturation: 180,
86
- aberrationIntensity: 1,
87
- cornerRadius: 8,
88
- mode: 'shader' as const,
89
- };
85
+ if (glass) {
86
+ // Default glass settings for textareas
87
+ const defaultGlassProps = {
88
+ displacementScale: 60,
89
+ blurAmount: 1,
90
+ saturation: 180,
91
+ aberrationIntensity: 1,
92
+ cornerRadius: 8,
93
+ mode: 'shader' as const,
94
+ };
90
95
 
91
- const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
96
+ const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
92
97
 
93
- return (
94
- <AtomixGlass {...glassProps}>
95
- {textareaElement}
96
- </AtomixGlass>
97
- );
98
- }
98
+ return <AtomixGlass {...glassProps}>{textareaElement}</AtomixGlass>;
99
+ }
99
100
 
100
- return textareaElement;
101
- });
101
+ return textareaElement;
102
+ }
103
+ );
102
104
 
103
105
  Textarea.displayName = 'Textarea';
104
106
 
@@ -178,7 +178,7 @@ export const WithCustomGlassEffect: Story = {
178
178
  aberrationIntensity: 0,
179
179
  cornerRadius: 45,
180
180
  mode: 'standard',
181
- elasticity: .2,
181
+ elasticity: 0.2,
182
182
  showBorderEffects: true,
183
183
  showHoverEffects: true,
184
184
  onClick: () => {
@@ -190,7 +190,6 @@ export const WithCustomGlassEffect: Story = {
190
190
  },
191
191
  };
192
192
 
193
-
194
193
  /**
195
194
  * Hero with left-aligned content and image on right
196
195
  */
@@ -345,4 +344,4 @@ export const VideoBackgroundWithImage: Story = {
345
344
  imageSrc: 'https://picsum.photos/id/180/712/500',
346
345
  imageAlt: 'Product showcase',
347
346
  },
348
- };
347
+ };
@@ -19,6 +19,7 @@ export const Hero: React.FC<HeroProps> = ({
19
19
  contentColSize = 5,
20
20
  contentWidth,
21
21
  className = '',
22
+ style,
22
23
  parallax = false,
23
24
  parallaxIntensity = 0.5,
24
25
  videoBackground,
@@ -54,11 +55,10 @@ export const Hero: React.FC<HeroProps> = ({
54
55
  });
55
56
 
56
57
  // Create custom style for hero element with content width if provided
57
- const heroStyle: React.CSSProperties | undefined = contentWidth
58
- ? ({
59
- '--atomix-hero-content-width': contentWidth,
60
- } as React.CSSProperties)
61
- : undefined;
58
+ const heroStyle: React.CSSProperties | undefined = {
59
+ ...(contentWidth ? { '--atomix-hero-content-width': contentWidth } : {}),
60
+ ...style,
61
+ };
62
62
 
63
63
  const renderVideoBackground = () => {
64
64
  if (!videoBackground) return null;
@@ -128,7 +128,6 @@ export const Hero: React.FC<HeroProps> = ({
128
128
  cornerRadius={8}
129
129
  overLight={false}
130
130
  mode="standard"
131
-
132
131
  >
133
132
  <div className="u-p-4">
134
133
  {subtitle && <p className={HERO.SELECTORS.SUBTITLE.replace('.', '')}>{subtitle}</p>}
@@ -36,6 +36,11 @@ export interface IconProps {
36
36
  */
37
37
  className?: string;
38
38
 
39
+ /**
40
+ * Custom style
41
+ */
42
+ style?: React.CSSProperties;
43
+
39
44
  /**
40
45
  * Alt text for accessibility
41
46
  */
@@ -60,6 +65,7 @@ export const Icon: React.FC<IconProps> = ({
60
65
  weight = 'regular',
61
66
  color,
62
67
  className = '',
68
+ style,
63
69
  alt,
64
70
  }) => {
65
71
  // Get the icon component from Phosphor
@@ -76,7 +82,12 @@ export const Icon: React.FC<IconProps> = ({
76
82
  const pixelSize = typeof size === 'string' ? sizeMap[size as IconSize] || 24 : size;
77
83
 
78
84
  return (
79
- <span className={`c-icon c-icon--${size} ${className}`} aria-hidden={!alt} title={alt}>
85
+ <span
86
+ className={`c-icon c-icon--${size} ${className}`}
87
+ style={style}
88
+ aria-hidden={!alt}
89
+ title={alt}
90
+ >
80
91
  <IconComponent size={pixelSize} weight={weight} color={color} aria-label={alt} />
81
92
  </span>
82
93
  );
@@ -6,6 +6,7 @@ export const List: React.FC<ListProps> = ({
6
6
  children,
7
7
  variant = 'default',
8
8
  className = '',
9
+ style,
9
10
  ...props
10
11
  }) => {
11
12
  // Generate CSS classes
@@ -17,7 +18,7 @@ export const List: React.FC<ListProps> = ({
17
18
  const ListElement = ['number', 'text'].includes(variant) ? 'ol' : 'ul';
18
19
 
19
20
  return (
20
- <ListElement className={listClasses} {...props}>
21
+ <ListElement className={listClasses} style={style} {...props}>
21
22
  {React.Children.map(children, child => {
22
23
  if (React.isValidElement(child)) {
23
24
  return <li className="c-list__item">{child}</li>;
@@ -7,6 +7,7 @@ import { List } from './List';
7
7
  export const ListGroup: React.FC<ListGroupProps> = ({
8
8
  children,
9
9
  className = '',
10
+ style,
10
11
  variant = 'default',
11
12
  }) => {
12
13
  // Generate CSS classes
@@ -18,7 +19,7 @@ export const ListGroup: React.FC<ListGroupProps> = ({
18
19
  ) as React.ReactElement[];
19
20
 
20
21
  return (
21
- <div className={listGroupClasses}>
22
+ <div className={listGroupClasses} style={style}>
22
23
  {validLists.map((child, index) => {
23
24
  const childProps = child.props as any;
24
25
  return React.cloneElement(child as React.ReactElement<any>, {
@@ -158,3 +158,116 @@ export const Interactive: StoryObj<typeof Messages> = {
158
158
  },
159
159
  },
160
160
  };
161
+
162
+ // Glass morphism variant
163
+ export const Glass: Story = {
164
+ args: {
165
+ ...Default.args,
166
+ glass: true,
167
+ },
168
+ parameters: {
169
+ docs: {
170
+ description: {
171
+ story: 'Messages component with glass morphism effect applied.',
172
+ },
173
+ },
174
+ backgrounds: {
175
+ default: 'image',
176
+ values: [
177
+ {
178
+ name: 'image',
179
+ value:
180
+ 'url(https://images.unsplash.com/photo-1649579037846-bf8c4d19d045?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2070)',
181
+ },
182
+ ],
183
+ },
184
+ },
185
+ };
186
+
187
+ // Glass morphism with custom properties
188
+ export const GlassCustom: Story = {
189
+ args: {
190
+ ...Default.args,
191
+ glass: {
192
+ displacementScale: 30,
193
+ blurAmount: 0,
194
+ cornerRadius: 16,
195
+ elasticity: 0,
196
+ },
197
+ },
198
+ parameters: {
199
+ docs: {
200
+ description: {
201
+ story: 'Messages component with customized glass morphism effect.',
202
+ },
203
+ },
204
+ backgrounds: {
205
+ default: 'image',
206
+ position: 'center',
207
+ values: [
208
+ {
209
+ name: 'image',
210
+ value:
211
+ 'url(https://images.unsplash.com/photo-1760888102496-8ed280c9fc62?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2532)',
212
+ },
213
+ ],
214
+ },
215
+ },
216
+ };
217
+
218
+ // Interactive glass example
219
+ export const InteractiveGlass: StoryObj<typeof Messages> = {
220
+ render: args => {
221
+ const [messages, setMessages] = useState<MessageItem[]>(args.messages || []);
222
+
223
+ const handleSendMessage = (text: string) => {
224
+ const newMessage: MessageItem = {
225
+ id: `msg-${Date.now()}`,
226
+ text,
227
+ time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }),
228
+ isSelf: true,
229
+ };
230
+
231
+ setMessages([...messages, newMessage]);
232
+ };
233
+
234
+ return <Messages {...args} messages={messages} onSendMessage={handleSendMessage} />;
235
+ },
236
+ args: {
237
+ width: '800px',
238
+ bodyHeight: '400px',
239
+ otherName: 'Meghan',
240
+ otherAvatar:
241
+ 'https://images.unsplash.com/photo-1648074074225-16189e7ad8c9?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1935&q=80',
242
+ selfAvatar:
243
+ 'https://images.unsplash.com/photo-1633332755192-727a05c4013d?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1780&q=80',
244
+ messages: [
245
+ {
246
+ id: '1',
247
+ text: 'Hi there! How can I help you today?',
248
+ time: '12:00 PM',
249
+ isSelf: false,
250
+ },
251
+ ],
252
+ placeholder: 'Type your message here...',
253
+ glass: true,
254
+ },
255
+ parameters: {
256
+ docs: {
257
+ description: {
258
+ story:
259
+ 'An interactive glass morphism example where you can send messages and see them appear in the chat.',
260
+ },
261
+ },
262
+ backgrounds: {
263
+ default: 'image',
264
+ values: [
265
+ {
266
+ name: 'image',
267
+ value:
268
+ 'url(https://images.unsplash.com/photo-1760709072133-2472415b05f4?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=987)',
269
+ },
270
+ ],
271
+ },
272
+ },
273
+ };
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Icon } from '../Icon/Icon';
3
3
  import { Avatar } from '../Avatar/Avatar';
4
+ import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
4
5
  import { MESSAGES } from '../../lib/constants/components';
5
6
  import { MessagesProps } from '../../lib/types/components';
6
7
  import { useMessages } from '../../lib/composables/useMessages';
@@ -17,9 +18,11 @@ export const Messages: React.FC<MessagesProps> = ({
17
18
  onSendMessage,
18
19
  placeholder = 'Type a message',
19
20
  className = '',
21
+ style,
20
22
  bodyHeight,
21
23
  disabled = false,
22
24
  id,
25
+ glass,
23
26
  }) => {
24
27
  const { inputValue, handleInputChange, handleSubmit, handleKeyDown } = useMessages({
25
28
  onSendMessage,
@@ -29,15 +32,18 @@ export const Messages: React.FC<MessagesProps> = ({
29
32
  const messagesId = id || `messages-${Math.random().toString(36).substr(2, 9)}`;
30
33
  const inputId = `${messagesId}-input`;
31
34
 
32
- return (
33
- <div
34
- className={`${MESSAGES.CLASSES.BASE} ${disabled ? 'is-disabled' : ''} ${className}`}
35
- style={{ '--atomix-messages-width': width } as React.CSSProperties}
36
- id={messagesId}
37
- aria-label="Chat messages"
38
- role="log"
39
- aria-live="polite"
40
- >
35
+ // Default glass settings for messages
36
+ const defaultGlassProps = {
37
+ displacementScale: 150,
38
+ cornerRadius: 12,
39
+ elasticity: 0,
40
+ aberrationIntensity: 2,
41
+ };
42
+
43
+ const messagesClasses = `${MESSAGES.CLASSES.BASE} ${glass ? 'c-messages--glass' : ''} ${disabled ? 'is-disabled' : ''} ${className}`;
44
+
45
+ const messagesContent = (
46
+ <>
41
47
  <div
42
48
  className={MESSAGES.CLASSES.BODY}
43
49
  style={
@@ -161,6 +167,43 @@ export const Messages: React.FC<MessagesProps> = ({
161
167
  <Icon name="PaperPlaneTilt" aria-hidden="true" size={24} />
162
168
  </button>
163
169
  </form>
170
+ </>
171
+ );
172
+
173
+ if (glass) {
174
+ const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
175
+
176
+ return (
177
+ <div
178
+ className={messagesClasses}
179
+ style={{ '--atomix-messages-width': width, ...style } as React.CSSProperties}
180
+ id={messagesId}
181
+ aria-label="Chat messages"
182
+ role="log"
183
+ aria-live="polite"
184
+ >
185
+ <AtomixGlass {...glassProps}>
186
+ <div
187
+ className="c-messages__glass-content"
188
+ style={{ borderRadius: glassProps.cornerRadius }}
189
+ >
190
+ {messagesContent}
191
+ </div>
192
+ </AtomixGlass>
193
+ </div>
194
+ );
195
+ }
196
+
197
+ return (
198
+ <div
199
+ className={messagesClasses}
200
+ style={{ '--atomix-messages-width': width, ...style } as React.CSSProperties}
201
+ id={messagesId}
202
+ aria-label="Chat messages"
203
+ role="log"
204
+ aria-live="polite"
205
+ >
206
+ {messagesContent}
164
207
  </div>
165
208
  );
166
209
  };
@@ -313,23 +313,27 @@ export const GlassModal: Story = {
313
313
  glass={true}
314
314
  >
315
315
  <p>
316
- This modal demonstrates the glass morphism effect with a translucent, frosted appearance.
317
- The glass effect creates a modern, elegant look that works well over colorful backgrounds.
316
+ This modal demonstrates the glass morphism effect with a translucent, frosted
317
+ appearance. The glass effect creates a modern, elegant look that works well over
318
+ colorful backgrounds.
318
319
  </p>
319
320
  <p>
320
- The glass effect includes displacement, blur, and chromatic aberration for a premium feel.
321
+ The glass effect includes displacement, blur, and chromatic aberration for a premium
322
+ feel.
321
323
  </p>
322
324
  </Modal>
323
325
  </>
324
326
  );
325
327
  },
326
328
  decorators: [
327
- (Story) => (
328
- <div style={{
329
- background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
330
- minHeight: '100vh',
331
- padding: '2rem'
332
- }}>
329
+ Story => (
330
+ <div
331
+ style={{
332
+ background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
333
+ minHeight: '100vh',
334
+ padding: '2rem',
335
+ }}
336
+ >
333
337
  <Story />
334
338
  </div>
335
339
  ),
@@ -359,14 +363,16 @@ export const GlassModalCustom: Story = {
359
363
  onOpenChange={setIsOpen}
360
364
  title="Custom Glass Modal"
361
365
  subtitle="This modal has customized glass effect settings."
362
- glass={{
363
- displacementScale: 120,
364
- blurAmount: 3,
365
- saturation: 200,
366
- aberrationIntensity: 2,
367
- cornerRadius: 20,
368
- mode: 'polar',
369
- }}
366
+ glass={
367
+ {
368
+ displacementScale: 120,
369
+ blurAmount: 3,
370
+ saturation: 200,
371
+ aberrationIntensity: 2,
372
+ cornerRadius: 20,
373
+ mode: 'polar',
374
+ } as any
375
+ }
370
376
  footer={
371
377
  <>
372
378
  <div
@@ -392,20 +398,26 @@ export const GlassModalCustom: Story = {
392
398
  }
393
399
  >
394
400
  <p>
395
- This modal uses custom glass settings with enhanced displacement, blur, and chromatic aberration.
396
- The polar mode creates a different visual effect compared to the standard shader mode.
401
+ This modal uses custom glass settings with enhanced displacement, blur, and chromatic
402
+ aberration. The polar mode creates a different visual effect compared to the standard
403
+ shader mode.
397
404
  </p>
398
405
  </Modal>
399
406
  </>
400
407
  );
401
408
  },
402
409
  decorators: [
403
- (Story) => (
404
- <div style={{
405
- background: 'linear-gradient(45deg, #f093fb 0%, #f5576c 100%)',
406
- minHeight: '100vh',
407
- padding: '2rem'
408
- }}>
410
+ Story => (
411
+ <div
412
+ style={{
413
+ background:
414
+ 'url(https://images.unsplash.com/photo-1744872665943-fd335d371059?q=80&w=3024&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D)',
415
+ height: '100vh',
416
+ width: '100vw',
417
+ backgroundSize: 'cover',
418
+ backgroundPosition: 'center',
419
+ }}
420
+ >
409
421
  <Story />
410
422
  </div>
411
423
  ),
@@ -500,18 +512,22 @@ export const GlassModalSizes: Story = {
500
512
  }
501
513
  >
502
514
  <p>This is a {size.toUpperCase()} sized glass modal.</p>
503
- <p>The glass effect adapts to different modal sizes while maintaining its visual appeal.</p>
515
+ <p>
516
+ The glass effect adapts to different modal sizes while maintaining its visual appeal.
517
+ </p>
504
518
  </Modal>
505
519
  </div>
506
520
  );
507
521
  },
508
522
  decorators: [
509
- (Story) => (
510
- <div style={{
511
- background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
512
- minHeight: '100vh',
513
- padding: '2rem'
514
- }}>
523
+ Story => (
524
+ <div
525
+ style={{
526
+ background: 'linear-gradient(135deg, #4facfe 0%, #00f2fe 100%)',
527
+ minHeight: '100vh',
528
+ padding: '2rem',
529
+ }}
530
+ >
515
531
  <Story />
516
532
  </div>
517
533
  ),