@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.
- package/README.md +19 -0
- package/dist/atomix.css +1703 -1544
- package/dist/atomix.min.css +4 -4
- package/dist/index.d.ts +1465 -963
- package/dist/index.esm.js +16289 -25908
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +15650 -21780
- 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 +1608 -1450
- package/dist/themes/boomdevs.min.css +5 -5
- package/dist/themes/esrar.css +1702 -1543
- package/dist/themes/esrar.min.css +4 -4
- package/dist/themes/flashtrade.css +15159 -0
- package/dist/themes/flashtrade.min.css +86 -0
- package/dist/themes/mashroom.css +1699 -1540
- package/dist/themes/mashroom.min.css +7 -7
- package/dist/themes/shaj-default.css +1693 -1534
- package/dist/themes/shaj-default.min.css +4 -4
- package/package.json +6 -17
- package/src/components/Accordion/Accordion.stories.tsx +662 -21
- package/src/components/Accordion/Accordion.tsx +21 -14
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +106 -72
- package/src/components/AtomixGlass/AtomixGlass.tsx +529 -1195
- 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 +792 -68
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1250 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +5768 -0
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1065 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1129 -0
- package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +395 -0
- package/src/components/AtomixGlass/stories/shared-components.tsx +301 -0
- 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 +76 -55
- package/src/components/Badge/Badge.tsx +12 -14
- package/src/components/Breadcrumb/Breadcrumb.tsx +23 -4
- package/src/components/Button/Button.stories.tsx +501 -20
- package/src/components/Button/Button.tsx +5 -8
- package/src/components/Callout/Callout.stories.tsx +86 -35
- package/src/components/Callout/Callout.tsx +31 -9
- package/src/components/Card/Card.stories.tsx +565 -2
- 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 +689 -12
- 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 +473 -2
- package/src/components/EdgePanel/EdgePanel.tsx +101 -13
- 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.stories.tsx +113 -0
- package/src/components/Messages/Messages.tsx +52 -9
- package/src/components/Modal/Modal.stories.tsx +48 -32
- package/src/components/Modal/Modal.tsx +19 -24
- package/src/components/Navigation/Menu/MegaMenu.tsx +2 -2
- package/src/components/Navigation/Menu/Menu.tsx +2 -2
- package/src/components/Navigation/Nav/Nav.stories.tsx +469 -0
- package/src/components/Navigation/Nav/Nav.tsx +22 -4
- package/src/components/Navigation/Nav/NavDropdown.tsx +10 -1
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +413 -0
- package/src/components/Navigation/Navbar/Navbar.tsx +70 -29
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +340 -0
- package/src/components/Navigation/SideMenu/SideMenu.tsx +29 -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 +19 -3
- 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 +19 -3
- 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 +21 -4
- package/src/lib/composables/useChart.ts +227 -370
- package/src/lib/composables/useChartExport.ts +19 -78
- package/src/lib/composables/useChartToolbar.ts +11 -21
- package/src/lib/composables/useEdgePanel.ts +125 -71
- package/src/lib/composables/useFooter.ts +3 -3
- package/src/lib/composables/useGlassContainer.ts +16 -7
- package/src/lib/composables/useLineChart.ts +11 -2
- package/src/lib/composables/usePieChart.ts +4 -14
- 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 +147 -32
- package/src/lib/types/components.ts +355 -25
- 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 +0 -3
- 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.edge-panel.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 +91 -48
- 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 +249 -0
- package/src/styles/06-components/_components.badge.scss +8 -23
- package/src/styles/06-components/_components.button.scss +8 -3
- package/src/styles/06-components/_components.callout.scss +10 -5
- 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 +103 -0
- 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.messages.scss +176 -0
- package/src/styles/06-components/_components.modal.scss +16 -4
- package/src/styles/06-components/_components.navbar.scss +12 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -0
- 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/_index.scss +1 -0
- package/src/styles/99-utilities/_utilities.glass-fixes.scss +1 -0
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/components/AtomixGlass/AtomixGlass.stories.tsx +0 -3011
- package/src/components/AtomixGlass/AtomixGlassComprehensivePreview.stories.tsx +0 -1369
- 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
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
52
|
-
|
|
56
|
+
// Custom styles for glass effect
|
|
57
|
+
const glassStyles = glass ? {} : {};
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
|
|
96
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
92
97
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{textareaElement}
|
|
96
|
-
</AtomixGlass>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
98
|
+
return <AtomixGlass {...glassProps}>{textareaElement}</AtomixGlass>;
|
|
99
|
+
}
|
|
99
100
|
|
|
100
|
-
|
|
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 =
|
|
58
|
-
?
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
317
|
-
The glass effect creates a modern, elegant look that works well over
|
|
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
|
|
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
|
-
|
|
328
|
-
<div
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
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
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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
|
|
396
|
-
The polar mode creates a different visual effect compared to the standard
|
|
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
|
-
|
|
404
|
-
<div
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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>
|
|
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
|
-
|
|
510
|
-
<div
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
),
|