@shohojdhara/atomix 0.3.4 → 0.3.6
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 +101 -199
- package/atomix.config.ts +241 -0
- package/dist/atomix.css +269 -189
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15179 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6477 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3373 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2466 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4566 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5171 -4792
- package/dist/index.esm.js +6098 -4563
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6291 -4747
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.d.ts +300 -0
- package/dist/layout.js +336 -0
- package/dist/layout.js.map +1 -0
- package/dist/theme.d.ts +2122 -0
- package/dist/theme.js +6084 -0
- package/dist/theme.js.map +1 -0
- package/package.json +59 -27
- package/scripts/atomix-cli.js +544 -16
- package/scripts/cli/__tests__/cli-commands.test.js +204 -0
- package/scripts/cli/__tests__/utils.test.js +201 -0
- package/scripts/cli/__tests__/vitest.config.js +26 -0
- package/scripts/cli/interactive-init.js +1 -1
- package/scripts/cli/token-manager.js +32 -7
- package/scripts/cli/utils.js +347 -0
- package/src/components/Accordion/Accordion.stories.tsx +50 -17
- package/src/components/Accordion/Accordion.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.stories.tsx +91 -13
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Block/Block.stories.tsx +7 -23
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Button/Button.stories.tsx +141 -22
- package/src/components/Button/ButtonGroup.stories.tsx +315 -0
- package/src/components/Button/ButtonGroup.tsx +67 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Callout/Callout.stories.tsx +8 -6
- package/src/components/Card/Card.stories.tsx +82 -28
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -18
- package/src/components/Chart/AreaChart.tsx +5 -2
- package/src/components/Chart/BarChart.tsx +1 -1
- package/src/components/Chart/BubbleChart.tsx +6 -6
- package/src/components/Chart/CandlestickChart.tsx +0 -1
- package/src/components/Chart/Chart.stories.tsx +5 -7
- package/src/components/Chart/Chart.tsx +0 -16
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/DonutChart.tsx +0 -1
- package/src/components/Chart/FunnelChart.tsx +1 -2
- package/src/components/Chart/GaugeChart.tsx +0 -1
- package/src/components/Chart/HeatmapChart.tsx +0 -1
- package/src/components/Chart/LineChart.tsx +0 -1
- package/src/components/Chart/MultiAxisChart.tsx +0 -1
- package/src/components/Chart/PieChart.tsx +0 -1
- package/src/components/Chart/RadarChart.tsx +19 -13
- package/src/components/Chart/ScatterChart.tsx +3 -4
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -2
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
- package/src/components/DataTable/DataTable.stories.tsx +23 -16
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
- package/src/components/Footer/Footer.stories.tsx +8 -6
- package/src/components/Footer/FooterLink.tsx +9 -2
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.stories.tsx +7 -0
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Form.stories.tsx +7 -0
- package/src/components/Form/FormGroup.stories.tsx +9 -1
- package/src/components/Form/Input.stories.tsx +69 -16
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.stories.tsx +9 -1
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.stories.tsx +9 -1
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.stories.tsx +10 -2
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/Hero/Hero.stories.tsx +7 -0
- package/src/components/List/List.stories.tsx +10 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Messages/Messages.stories.tsx +8 -7
- package/src/components/Modal/Modal.stories.tsx +17 -6
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +188 -111
- package/src/components/Pagination/Pagination.tsx +88 -7
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.stories.tsx +191 -115
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
- package/src/components/Progress/Progress.stories.tsx +79 -49
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.stories.tsx +109 -84
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/River/River.stories.tsx +194 -114
- package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
- package/src/components/Slider/Slider.stories.tsx +7 -0
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.stories.tsx +15 -11
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Steps/Steps.stories.tsx +132 -98
- package/src/components/Tabs/Tabs.stories.tsx +163 -112
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
- package/src/components/Todo/Todo.stories.tsx +38 -12
- package/src/components/Toggle/Toggle.stories.tsx +61 -28
- package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/Upload/Upload.stories.tsx +122 -84
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
- package/src/components/index.ts +6 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- package/src/lib/composables/useAtomixGlass.ts +2 -3
- package/src/lib/composables/useChartPerformance.ts +102 -78
- package/src/lib/composables/useChartScale.ts +10 -0
- package/src/lib/composables/useHero.ts +9 -2
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
- package/src/lib/composables/useNavbar.ts +0 -10
- package/src/lib/composables/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/loader.ts +57 -14
- package/src/lib/constants/components.ts +10 -0
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -15
- package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
- package/src/lib/patterns/index.ts +2 -2
- package/src/lib/patterns/slots.tsx +2 -2
- package/src/lib/theme/README.md +174 -0
- package/src/lib/theme/adapters/index.ts +31 -0
- package/src/lib/theme/adapters/themeAdapter.ts +287 -0
- package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
- package/src/lib/theme/config/configLoader.ts +254 -0
- package/src/lib/theme/config/loader.ts +37 -48
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +15 -91
- package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
- package/src/lib/theme/constants/index.ts +8 -0
- package/src/lib/theme/core/ThemeRegistry.ts +19 -6
- package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
- package/src/lib/theme/core/composeTheme.ts +155 -0
- package/src/lib/theme/core/createTheme.ts +94 -0
- package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
- package/src/lib/theme/core/index.ts +5 -19
- package/src/lib/theme/devtools/Comparator.tsx +346 -22
- package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
- package/src/lib/theme/devtools/Inspector.tsx +335 -51
- package/src/lib/theme/devtools/LiveEditor.tsx +489 -112
- package/src/lib/theme/devtools/Preview.tsx +471 -221
- package/src/lib/theme/{core → devtools}/ThemeValidator.ts +6 -3
- package/src/lib/theme/devtools/index.ts +14 -4
- package/src/lib/theme/devtools/useHistory.ts +130 -0
- package/src/lib/theme/errors/index.ts +12 -0
- package/src/lib/theme/generators/cssFile.ts +79 -0
- package/src/lib/theme/generators/generateCSS.ts +89 -0
- package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +4 -14
- package/src/lib/theme/generators/index.ts +19 -0
- package/src/lib/theme/i18n/rtl.ts +7 -7
- package/src/lib/theme/index.ts +120 -15
- package/src/lib/theme/runtime/ThemeApplicator.ts +53 -95
- package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +4 -4
- package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
- package/src/lib/theme/runtime/index.ts +1 -2
- package/src/lib/theme/runtime/useTheme.ts +1 -2
- package/src/lib/theme/test/testTheme.ts +385 -0
- package/src/lib/theme/tokens/index.ts +12 -0
- package/src/lib/theme/tokens/tokens.ts +721 -0
- package/src/lib/theme/types.ts +6 -42
- package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
- package/src/lib/theme/utils/index.ts +11 -0
- package/src/lib/theme/utils/injectCSS.ts +90 -0
- package/src/lib/theme/utils/themeHelpers.ts +78 -0
- package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
- package/src/lib/theme-tools.ts +8 -9
- package/src/lib/types/components.ts +93 -34
- package/src/lib/types/partProps.ts +0 -16
- package/src/lib/utils/componentUtils.ts +1 -1
- package/src/lib/utils/fontPreloader.ts +148 -0
- package/src/lib/utils/index.ts +11 -0
- package/src/lib/utils/memoryMonitor.ts +189 -0
- package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
- package/src/styles/01-settings/_settings.fonts.scss +2 -5
- package/src/styles/02-tools/_tools.button.scss +66 -79
- package/src/styles/06-components/_components.atomix-glass.scss +13 -3
- package/src/styles/06-components/_components.navbar.scss +0 -6
- package/src/styles/06-components/_components.pagination.scss +88 -0
- package/scripts/build-themes.js +0 -208
- package/scripts/sync-theme-config.js +0 -309
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
- package/src/lib/theme/composeTheme.ts +0 -370
- package/src/lib/theme/core/ThemeCache.ts +0 -283
- package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
- package/src/lib/theme/core/ThemeEngine.ts +0 -657
- package/src/lib/theme/createThemeFromConfig.ts +0 -132
- package/src/lib/theme/devtools/CLI.ts +0 -364
- package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
- package/src/lib/theme/runtime/ThemeManager.ts +0 -442
- package/src/styles/03-generic/_generated-root.css +0 -5
- package/src/themes/README.md +0 -442
- package/src/themes/themes.config.js +0 -35
- /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
- /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import { RadioProps } from '../../lib/types/components';
|
|
3
3
|
import { useRadio } from '../../lib/composables/useRadio';
|
|
4
4
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
@@ -6,7 +6,7 @@ import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
|
6
6
|
/**
|
|
7
7
|
* Radio - A component for radio button inputs
|
|
8
8
|
*/
|
|
9
|
-
export const Radio: React.FC<RadioProps> = ({
|
|
9
|
+
export const Radio: React.FC<RadioProps> = memo(({
|
|
10
10
|
label,
|
|
11
11
|
checked = false,
|
|
12
12
|
onChange,
|
|
@@ -77,7 +77,7 @@ export const Radio: React.FC<RadioProps> = ({
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return radioContent;
|
|
80
|
-
};
|
|
80
|
+
});
|
|
81
81
|
|
|
82
82
|
export type { RadioProps };
|
|
83
83
|
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Select } from './Select';
|
|
4
|
+
import { SIZES } from '../../lib/constants/components';
|
|
4
5
|
|
|
5
6
|
const meta = {
|
|
6
7
|
title: 'Components/Form/Select',
|
|
7
8
|
component: Select,
|
|
8
9
|
parameters: {
|
|
9
10
|
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'The Select component provides a dropdown menu for selecting one or more options from a list. It supports single and multiple selection modes, validation states, and can be customized with different sizes. Select components are essential for forms requiring user choice from predefined options.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
10
17
|
},
|
|
18
|
+
tags: ['autodocs'],
|
|
11
19
|
argTypes: {
|
|
12
20
|
size: {
|
|
13
21
|
control: { type: 'select' },
|
|
14
|
-
options:
|
|
22
|
+
options: SIZES,
|
|
15
23
|
description: 'Size of the select',
|
|
16
24
|
},
|
|
17
25
|
disabled: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from 'react';
|
|
1
|
+
import React, { useRef, useEffect, useState, memo } from 'react';
|
|
2
2
|
import { SelectProps } from '../../lib/types/components';
|
|
3
3
|
import { useSelect } from '../../lib/composables';
|
|
4
4
|
import { SELECT } from '../../lib/constants/components';
|
|
@@ -7,7 +7,7 @@ import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
|
7
7
|
/**
|
|
8
8
|
* Select - A component for dropdown selection
|
|
9
9
|
*/
|
|
10
|
-
export const Select: React.FC<SelectProps> = ({
|
|
10
|
+
export const Select: React.FC<SelectProps> = memo(({
|
|
11
11
|
options = [],
|
|
12
12
|
value,
|
|
13
13
|
onChange,
|
|
@@ -204,7 +204,7 @@ export const Select: React.FC<SelectProps> = ({
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
return selectContent;
|
|
207
|
-
};
|
|
207
|
+
});
|
|
208
208
|
|
|
209
209
|
export type { SelectProps };
|
|
210
210
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Textarea } from './Textarea';
|
|
3
|
+
import { SIZES, THEME_COLORS } from '../../lib/constants/components';
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Components/Form/Textarea',
|
|
6
7
|
component: Textarea,
|
|
7
8
|
parameters: {
|
|
8
9
|
layout: 'centered',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'The Textarea component provides a multi-line text input field for longer content. It supports various sizes, validation states, and can be customized with different variants. Textareas are ideal for comments, descriptions, or any content requiring multiple lines of input.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
9
16
|
},
|
|
17
|
+
tags: ['autodocs'],
|
|
10
18
|
argTypes: {
|
|
11
19
|
value: {
|
|
12
20
|
control: 'text',
|
|
@@ -26,12 +34,12 @@ const meta = {
|
|
|
26
34
|
},
|
|
27
35
|
size: {
|
|
28
36
|
control: { type: 'select' },
|
|
29
|
-
options:
|
|
37
|
+
options: SIZES,
|
|
30
38
|
description: 'Size of the textarea',
|
|
31
39
|
},
|
|
32
40
|
variant: {
|
|
33
41
|
control: { type: 'select' },
|
|
34
|
-
options:
|
|
42
|
+
options: THEME_COLORS,
|
|
35
43
|
description: 'Color variant of the textarea',
|
|
36
44
|
},
|
|
37
45
|
disabled: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react';
|
|
1
|
+
import React, { forwardRef, memo } from 'react';
|
|
2
2
|
import { TextareaProps } from '../../lib/types/components';
|
|
3
3
|
import { useTextarea } from '../../lib/composables/useTextarea';
|
|
4
4
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
@@ -6,7 +6,8 @@ import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
|
6
6
|
/**
|
|
7
7
|
* Textarea - A component for multiline text input
|
|
8
8
|
*/
|
|
9
|
-
export const Textarea =
|
|
9
|
+
export const Textarea = memo(
|
|
10
|
+
forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
10
11
|
(
|
|
11
12
|
{
|
|
12
13
|
value,
|
|
@@ -100,6 +101,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
100
101
|
|
|
101
102
|
return textareaElement;
|
|
102
103
|
}
|
|
104
|
+
)
|
|
103
105
|
);
|
|
104
106
|
|
|
105
107
|
Textarea.displayName = 'Textarea';
|
|
@@ -27,7 +27,14 @@ const meta = {
|
|
|
27
27
|
component: Hero,
|
|
28
28
|
parameters: {
|
|
29
29
|
layout: 'padded',
|
|
30
|
+
docs: {
|
|
31
|
+
description: {
|
|
32
|
+
component:
|
|
33
|
+
'The Hero component creates prominent banner sections typically used at the top of pages. It provides a flexible layout for titles, subtitles, text content, call-to-action buttons, and images. Heroes are ideal for landing pages, marketing sections, or any area requiring prominent visual presentation.',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
30
36
|
},
|
|
37
|
+
tags: ['autodocs'],
|
|
31
38
|
argTypes: {
|
|
32
39
|
title: {
|
|
33
40
|
control: 'text',
|
|
@@ -8,7 +8,14 @@ const meta = {
|
|
|
8
8
|
component: List,
|
|
9
9
|
parameters: {
|
|
10
10
|
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'The List component provides a flexible way to display ordered or unordered lists of items. It supports multiple style variants including default, dashed, numbered, and text styles. Lists can be used for navigation, content organization, or any scenario requiring structured item display.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
11
17
|
},
|
|
18
|
+
tags: ['autodocs'],
|
|
12
19
|
argTypes: {
|
|
13
20
|
variant: {
|
|
14
21
|
control: { type: 'select' },
|
|
@@ -44,8 +51,8 @@ const ListItems = ({ variant }: { variant: string }) => (
|
|
|
44
51
|
</>
|
|
45
52
|
);
|
|
46
53
|
|
|
47
|
-
const createListSection = (title: string, variant: string) => (
|
|
48
|
-
<div style={sectionStyle}>
|
|
54
|
+
const createListSection = (title: string, variant: string, key?: string) => (
|
|
55
|
+
<div key={key} style={sectionStyle}>
|
|
49
56
|
<h3 style={titleStyle}>{title}</h3>
|
|
50
57
|
<List variant={variant as any}>
|
|
51
58
|
<ListItems variant={variant} />
|
|
@@ -67,7 +74,7 @@ export const VariantsShowcase: Story = {
|
|
|
67
74
|
<div className="u-d-flex u-flex-column u-gap-8">
|
|
68
75
|
{['Default', 'Dash', 'Number', 'Text'].map((title, index) => {
|
|
69
76
|
const variant = index === 0 ? 'default' : title.toLowerCase();
|
|
70
|
-
return createListSection(`${title} List`, variant);
|
|
77
|
+
return createListSection(`${title} List`, variant, variant);
|
|
71
78
|
})}
|
|
72
79
|
</div>
|
|
73
80
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import { ListProps } from '../../lib/types/components';
|
|
3
3
|
import { LIST } from '../../lib/constants/components';
|
|
4
4
|
|
|
5
|
-
export const List: React.FC<ListProps> = ({
|
|
5
|
+
export const List: React.FC<ListProps> = memo(({
|
|
6
6
|
children,
|
|
7
7
|
variant = 'default',
|
|
8
8
|
className = '',
|
|
@@ -27,7 +27,7 @@ export const List: React.FC<ListProps> = ({
|
|
|
27
27
|
})}
|
|
28
28
|
</ListElement>
|
|
29
29
|
);
|
|
30
|
-
};
|
|
30
|
+
});
|
|
31
31
|
|
|
32
32
|
export type { ListProps };
|
|
33
33
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ListGroupProps } from '../../lib/types/components';
|
|
2
|
+
import { ListGroupProps as ListGroupPropsType } from '../../lib/types/components';
|
|
3
3
|
import { LIST_GROUP } from '../../lib/constants/components';
|
|
4
4
|
import { List } from './List';
|
|
5
5
|
|
|
6
|
+
export type ListGroupProps = ListGroupPropsType;
|
|
7
|
+
|
|
6
8
|
export const ListGroup: React.FC<ListGroupProps> = ({
|
|
7
9
|
children,
|
|
8
10
|
className = '',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { MessageItem } from '../../lib/types/components';
|
|
4
4
|
import { Messages } from './Messages';
|
|
5
5
|
|
|
6
|
-
const meta
|
|
6
|
+
const meta = {
|
|
7
7
|
title: 'Components/Messages',
|
|
8
8
|
component: Messages,
|
|
9
9
|
parameters: {
|
|
@@ -11,10 +11,11 @@ const meta: Meta<typeof Messages> = {
|
|
|
11
11
|
docs: {
|
|
12
12
|
description: {
|
|
13
13
|
component:
|
|
14
|
-
'Messages component for displaying
|
|
14
|
+
'The Messages component provides a complete chat interface for displaying conversations. It supports text messages, images, file attachments, timestamps, and user avatars. Messages are ideal for chat applications, support systems, or any scenario requiring real-time or historical message display.',
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
|
+
tags: ['autodocs'],
|
|
18
19
|
argTypes: {
|
|
19
20
|
messages: { control: 'object' },
|
|
20
21
|
width: { control: 'text' },
|
|
@@ -23,13 +24,13 @@ const meta: Meta<typeof Messages> = {
|
|
|
23
24
|
otherName: { control: 'text' },
|
|
24
25
|
otherAvatar: { control: 'text' },
|
|
25
26
|
selfAvatar: { control: 'text' },
|
|
26
|
-
placeholder: { control: 'text' },
|
|
27
|
-
disabled: { control: 'boolean' },
|
|
27
|
+
placeholder: { control: 'text', description: 'Placeholder text for the input field' },
|
|
28
|
+
disabled: { control: 'boolean', description: 'Whether the messages component is disabled' },
|
|
28
29
|
},
|
|
29
|
-
}
|
|
30
|
+
} satisfies Meta<typeof Messages>;
|
|
30
31
|
|
|
31
32
|
export default meta;
|
|
32
|
-
type Story = StoryObj<typeof
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
33
34
|
|
|
34
35
|
export const Default: Story = {
|
|
35
36
|
args: {
|
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
+
import type { AtomixGlassProps } from '../../lib/types/components';
|
|
3
4
|
import Modal from './Modal';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
// Helper type for glass props in stories (without children requirement)
|
|
7
|
+
type GlassProps = boolean | Omit<AtomixGlassProps, 'children'>;
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
6
10
|
title: 'Components/Modal',
|
|
7
11
|
component: Modal,
|
|
8
12
|
parameters: {
|
|
9
13
|
layout: 'centered',
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component:
|
|
17
|
+
'The Modal component displays content in a focused overlay dialog. It provides a way to present important information or actions that require user attention. Modals support various sizes, can include headers and footers, and support glass morphism effects.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
10
20
|
},
|
|
21
|
+
tags: ['autodocs'],
|
|
11
22
|
argTypes: {
|
|
12
23
|
size: {
|
|
13
|
-
control: 'select',
|
|
24
|
+
control: { type: 'select' },
|
|
14
25
|
options: ['sm', 'md', 'lg', 'xl'],
|
|
15
26
|
description: 'Size of the modal',
|
|
16
27
|
defaultValue: 'md',
|
|
@@ -35,10 +46,10 @@ const meta: Meta<typeof Modal> = {
|
|
|
35
46
|
description: 'Enable glass morphism effect',
|
|
36
47
|
},
|
|
37
48
|
},
|
|
38
|
-
}
|
|
49
|
+
} satisfies Meta<typeof Modal>;
|
|
39
50
|
|
|
40
51
|
export default meta;
|
|
41
|
-
type Story = StoryObj<typeof
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
42
53
|
|
|
43
54
|
/**
|
|
44
55
|
* Basic modal example with a button to trigger opening.
|
|
@@ -377,7 +388,7 @@ export const GlassModalCustom: Story = {
|
|
|
377
388
|
aberrationIntensity: 2,
|
|
378
389
|
cornerRadius: 20,
|
|
379
390
|
mode: 'polar',
|
|
380
|
-
} as
|
|
391
|
+
} as GlassProps
|
|
381
392
|
}
|
|
382
393
|
footer={
|
|
383
394
|
<>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState, useCallback } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState, useCallback, memo } from 'react';
|
|
2
2
|
import { ModalProps } from '../../lib/types/components';
|
|
3
3
|
import { MODAL } from '../../lib/constants/components';
|
|
4
4
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
@@ -76,7 +76,7 @@ function useModal({
|
|
|
76
76
|
/**
|
|
77
77
|
* Modal component for displaying overlay content
|
|
78
78
|
*/
|
|
79
|
-
export const Modal: React.FC<ModalProps> = ({
|
|
79
|
+
export const Modal: React.FC<ModalProps> = memo(({
|
|
80
80
|
children,
|
|
81
81
|
isOpen = false,
|
|
82
82
|
onOpenChange,
|
|
@@ -213,7 +213,7 @@ export const Modal: React.FC<ModalProps> = ({
|
|
|
213
213
|
</div>
|
|
214
214
|
</div>
|
|
215
215
|
);
|
|
216
|
-
};
|
|
216
|
+
});
|
|
217
217
|
|
|
218
218
|
Modal.displayName = 'Modal';
|
|
219
219
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { Icon } from '../../Icon/Icon';
|
|
8
8
|
import { mapIconName } from './Menu'; // Import the mapping function
|
|
9
9
|
|
|
10
|
-
export const MegaMenu
|
|
10
|
+
export const MegaMenu = forwardRef<HTMLDivElement, MegaMenuProps>(
|
|
11
11
|
({ children, className = '', style, disabled = false }, ref) => {
|
|
12
12
|
return (
|
|
13
13
|
<div ref={ref} className={`c-menu c-menu--mega ${className}`} style={style}>
|
|
@@ -31,7 +31,9 @@ export const MegaMenu: React.FC<MegaMenuProps> = forwardRef<HTMLDivElement, Mega
|
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
MegaMenu.displayName = 'MegaMenu';
|
|
35
|
+
|
|
36
|
+
export const MegaMenuColumn = forwardRef<
|
|
35
37
|
HTMLDivElement,
|
|
36
38
|
MegaMenuColumnProps
|
|
37
39
|
>(({ title, icon, children, width = 'auto', className = '', disabled = false }, ref) => {
|
|
@@ -80,7 +82,9 @@ export const MegaMenuColumn: React.FC<MegaMenuColumnProps> = forwardRef<
|
|
|
80
82
|
);
|
|
81
83
|
});
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
MegaMenuColumn.displayName = 'MegaMenuColumn';
|
|
86
|
+
|
|
87
|
+
export const MegaMenuLink = forwardRef<
|
|
84
88
|
HTMLAnchorElement,
|
|
85
89
|
MegaMenuLinkProps
|
|
86
90
|
>(({ href, children, className = '', disabled = false, onClick }, ref) => {
|
|
@@ -107,3 +111,5 @@ export const MegaMenuLink: React.FC<MegaMenuLinkProps> = forwardRef<
|
|
|
107
111
|
</a>
|
|
108
112
|
);
|
|
109
113
|
});
|
|
114
|
+
|
|
115
|
+
MegaMenuLink.displayName = 'MegaMenuLink';
|
|
@@ -6,7 +6,14 @@ const meta = {
|
|
|
6
6
|
component: Menu,
|
|
7
7
|
parameters: {
|
|
8
8
|
layout: 'centered',
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component:
|
|
12
|
+
'The Menu component provides a vertical list of menu items, typically used in dropdowns, sidebars, or context menus. It supports dividers, icons, and can be nested. Menus are ideal for organizing navigation options, actions, or any hierarchical list of choices.',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
9
15
|
},
|
|
16
|
+
tags: ['autodocs'],
|
|
10
17
|
argTypes: {
|
|
11
18
|
disabled: {
|
|
12
19
|
control: 'boolean',
|
|
@@ -2,7 +2,7 @@ import React, { forwardRef, ReactNode } from 'react';
|
|
|
2
2
|
import { MenuProps, MenuItemProps } from '../../../lib/types/components';
|
|
3
3
|
import { Icon } from '../../Icon/Icon';
|
|
4
4
|
|
|
5
|
-
export const Menu
|
|
5
|
+
export const Menu = forwardRef<HTMLDivElement, MenuProps>(
|
|
6
6
|
({ children, className = '', style, disabled = false }, ref) => {
|
|
7
7
|
return (
|
|
8
8
|
<div ref={ref} className={`c-menu ${className}`} style={style}>
|
|
@@ -24,6 +24,8 @@ export const Menu: React.FC<MenuProps> = forwardRef<HTMLDivElement, MenuProps>(
|
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
|
|
27
|
+
Menu.displayName = 'Menu';
|
|
28
|
+
|
|
27
29
|
export type { MenuProps, MenuItemProps, MenuDividerProps };
|
|
28
30
|
|
|
29
31
|
export default Menu;
|
|
@@ -35,7 +37,7 @@ interface MenuDividerProps {
|
|
|
35
37
|
className?: string;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
export const MenuItem
|
|
40
|
+
export const MenuItem = forwardRef<HTMLLIElement, MenuItemProps>(
|
|
39
41
|
(
|
|
40
42
|
{ children, href = '#', icon, active = false, disabled = false, onClick, className = '' },
|
|
41
43
|
ref
|
|
@@ -83,6 +85,8 @@ export const MenuItem: React.FC<MenuItemProps> = forwardRef<HTMLLIElement, MenuI
|
|
|
83
85
|
}
|
|
84
86
|
);
|
|
85
87
|
|
|
88
|
+
MenuItem.displayName = 'MenuItem';
|
|
89
|
+
|
|
86
90
|
// Map icon-lux names to Phosphor icon names
|
|
87
91
|
export const mapIconName = (luxIconName: string): any => {
|
|
88
92
|
const iconMap: Record<string, any> = {
|
|
@@ -104,8 +108,10 @@ export const mapIconName = (luxIconName: string): any => {
|
|
|
104
108
|
return iconMap[luxIconName] || 'Circle'; // Default to Circle if no mapping found
|
|
105
109
|
};
|
|
106
110
|
|
|
107
|
-
export const MenuDivider
|
|
111
|
+
export const MenuDivider = forwardRef<HTMLLIElement, MenuDividerProps>(
|
|
108
112
|
({ className = '' }, ref) => {
|
|
109
113
|
return <li ref={ref} className={`c-menu__divider ${className}`} role="separator"></li>;
|
|
110
114
|
}
|
|
111
115
|
);
|
|
116
|
+
|
|
117
|
+
MenuDivider.displayName = 'MenuDivider';
|
|
@@ -9,7 +9,14 @@ const meta = {
|
|
|
9
9
|
component: Nav,
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: 'centered',
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
'The Nav component provides a horizontal navigation bar for organizing links and menu items. It supports various alignment options, can include dropdowns, and provides a clean interface for site navigation. Nav components are essential for primary site navigation and work seamlessly with NavItem and NavDropdown components.',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
12
18
|
},
|
|
19
|
+
tags: ['autodocs'],
|
|
13
20
|
argTypes: {
|
|
14
21
|
alignment: {
|
|
15
22
|
control: { type: 'select' },
|
|
@@ -138,7 +138,7 @@ The SideMenu component provides a collapsible navigation menu with title and men
|
|
|
138
138
|
} satisfies Meta<typeof SideMenu>;
|
|
139
139
|
|
|
140
140
|
export default meta;
|
|
141
|
-
type Story = StoryObj<typeof
|
|
141
|
+
type Story = StoryObj<typeof meta>;
|
|
142
142
|
|
|
143
143
|
// Default SideMenu
|
|
144
144
|
export const Default: Story = {
|