@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
package/README.md
CHANGED
|
@@ -1,250 +1,152 @@
|
|
|
1
1
|
# Atomix Design System
|
|
2
2
|
|
|
3
|
-
> A modern,
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@shohojdhara/atomix)
|
|
6
|
-
[](
|
|
7
|
-
[](https://www.npmjs.com/package/@shohojdhara/atomix)
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
> A modern, extensible design system for building scalable web applications
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@shohojdhara/atomix)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://www.npmjs.com/package/@shohojdhara/atomix)
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Features](#features)
|
|
12
|
+
- [Installation](#installation)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [Basic Usage](#basic-usage)
|
|
15
|
+
- [Theming](#theming)
|
|
16
|
+
- [React Integration](#react-integration)
|
|
17
|
+
- [Components](#components)
|
|
18
|
+
- [API](#api)
|
|
19
|
+
- [Contributing](#contributing)
|
|
20
|
+
- [License](#license)
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- 🚀 **Fast & Lightweight** - Tree-shaking ready with minimal bundle impact
|
|
25
|
+
- 🎨 **Themeable** - Advanced theme system with CSS variable support
|
|
26
|
+
- ♿ **Accessible** - Built with WCAG accessibility standards in mind
|
|
27
|
+
- 📱 **Responsive** - Mobile-first responsive design
|
|
28
|
+
- 🔧 **Customizable** - Easy to customize and extend
|
|
29
|
+
- 🧩 **Modular** - Pick only the components you need
|
|
30
|
+
- 🔒 **TypeScript** - Full TypeScript support with definitions
|
|
31
|
+
- 🛠 **Framework Agnostic** - Works with React, Vue, vanilla JS, etc.
|
|
24
32
|
|
|
25
33
|
## Installation
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
36
|
npm install @shohojdhara/atomix
|
|
37
|
+
# or
|
|
38
|
+
yarn add @shohojdhara/atomix
|
|
39
|
+
# or
|
|
40
|
+
pnpm add @shohojdhara/atomix
|
|
29
41
|
```
|
|
30
42
|
|
|
31
43
|
## Usage
|
|
32
44
|
|
|
33
|
-
###
|
|
45
|
+
### Basic Usage
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
import '@shohojdhara/atomix/
|
|
47
|
+
```tsx
|
|
48
|
+
import { Button } from '@shohojdhara/atomix/components';
|
|
49
|
+
import '@shohojdhara/atomix/styles/index.css';
|
|
37
50
|
|
|
38
51
|
function App() {
|
|
39
|
-
return
|
|
52
|
+
return (
|
|
53
|
+
<Button variant="primary" onClick={() => console.log('Hello Atomix!')}>
|
|
54
|
+
Click me
|
|
55
|
+
</Button>
|
|
56
|
+
);
|
|
40
57
|
}
|
|
41
58
|
```
|
|
42
59
|
|
|
43
|
-
###
|
|
44
|
-
|
|
45
|
-
Atomix provides a powerful, developer-friendly theming system with **Tailwind-like configuration**:
|
|
46
|
-
|
|
47
|
-
#### Tailwind-like Configuration (Recommended)
|
|
60
|
+
### Theming
|
|
48
61
|
|
|
49
|
-
|
|
62
|
+
Atomix provides a flexible theme system that supports both CSS and JavaScript themes:
|
|
50
63
|
|
|
51
|
-
```
|
|
52
|
-
import {
|
|
64
|
+
```tsx
|
|
65
|
+
import { ThemeProvider, createTheme } from '@shohojdhara/atomix/theme';
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
// Create a custom theme
|
|
68
|
+
const customTheme = createTheme({
|
|
69
|
+
palette: {
|
|
70
|
+
primary: { main: '#7AFFD7' },
|
|
71
|
+
secondary: { main: '#FF5733' },
|
|
72
|
+
},
|
|
73
|
+
spacing: 8,
|
|
74
|
+
breakpoints: {
|
|
75
|
+
values: {
|
|
76
|
+
xs: 0,
|
|
77
|
+
sm: 600,
|
|
78
|
+
md: 960,
|
|
79
|
+
lg: 1280,
|
|
80
|
+
xl: 1920,
|
|
61
81
|
},
|
|
62
82
|
},
|
|
63
83
|
});
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Use it in your app:
|
|
67
|
-
|
|
68
|
-
```tsx
|
|
69
|
-
import { loadAtomixConfig } from '@shohojdhara/atomix/config';
|
|
70
|
-
import { createThemeFromConfig, ThemeProvider } from '@shohojdhara/atomix/theme';
|
|
71
|
-
|
|
72
|
-
const config = loadAtomixConfig();
|
|
73
|
-
const theme = createThemeFromConfig(config);
|
|
74
84
|
|
|
75
85
|
function App() {
|
|
76
86
|
return (
|
|
77
|
-
<ThemeProvider
|
|
87
|
+
<ThemeProvider
|
|
88
|
+
themes={{
|
|
89
|
+
'custom-theme': { name: 'Custom Theme', class: 'custom-theme' }
|
|
90
|
+
}}
|
|
91
|
+
defaultTheme="custom-theme"
|
|
92
|
+
>
|
|
78
93
|
<YourApp />
|
|
79
94
|
</ThemeProvider>
|
|
80
95
|
);
|
|
81
96
|
}
|
|
82
97
|
```
|
|
83
98
|
|
|
84
|
-
|
|
99
|
+
### React Integration
|
|
85
100
|
|
|
86
|
-
|
|
87
|
-
import { ThemeProvider, useTheme } from '@shohojdhara/atomix/theme';
|
|
101
|
+
For React applications, we provide a complete set of hooks and context providers:
|
|
88
102
|
|
|
89
|
-
|
|
103
|
+
```tsx
|
|
104
|
+
import { useTheme } from '@shohojdhara/atomix/theme';
|
|
105
|
+
|
|
106
|
+
function MyComponent() {
|
|
107
|
+
const { theme, setTheme, availableThemes } = useTheme();
|
|
108
|
+
|
|
90
109
|
return (
|
|
91
|
-
<
|
|
92
|
-
<
|
|
93
|
-
|
|
110
|
+
<div>
|
|
111
|
+
<p>Current theme: {theme}</p>
|
|
112
|
+
<select
|
|
113
|
+
value={theme}
|
|
114
|
+
onChange={(e) => setTheme(e.target.value)}
|
|
115
|
+
>
|
|
116
|
+
{availableThemes.map(t => (
|
|
117
|
+
<option key={t.class} value={t.class}>
|
|
118
|
+
{t.name}
|
|
119
|
+
</option>
|
|
120
|
+
))}
|
|
121
|
+
</select>
|
|
122
|
+
</div>
|
|
94
123
|
);
|
|
95
124
|
}
|
|
96
125
|
```
|
|
97
126
|
|
|
98
|
-
#### Programmatic Theme Creation
|
|
99
|
-
|
|
100
|
-
```jsx
|
|
101
|
-
import { createTheme, ThemeProvider } from '@shohojdhara/atomix/theme';
|
|
102
|
-
|
|
103
|
-
const myTheme = createTheme({
|
|
104
|
-
palette: {
|
|
105
|
-
primary: { main: '#7AFFD7' },
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
<ThemeProvider defaultTheme={myTheme}>
|
|
110
|
-
<App />
|
|
111
|
-
</ThemeProvider>
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
For complete documentation, see:
|
|
115
|
-
- [Getting Started - Theme System](docs/getting-started/theme-system.md) - Quick start guide
|
|
116
|
-
- [Theme System Guide](docs/THEME_SYSTEM.md) - Complete reference (includes guides for both external developers and library developers)
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
## Styles
|
|
120
|
-
|
|
121
|
-
Atomix provides comprehensive styling through CSS or SCSS:
|
|
122
|
-
|
|
123
|
-
### CSS
|
|
124
|
-
|
|
125
|
-
```js
|
|
126
|
-
// Import the main CSS file
|
|
127
|
-
import '@shohojdhara/atomix/css';
|
|
128
|
-
|
|
129
|
-
// Or import the minified version
|
|
130
|
-
import '@shohojdhara/atomix/css/min';
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### SCSS
|
|
134
|
-
|
|
135
|
-
```scss
|
|
136
|
-
// Import the main SCSS file
|
|
137
|
-
@use '~@shohojdhara/atomix/scss' as atomix;
|
|
138
|
-
|
|
139
|
-
// Or import individual modules
|
|
140
|
-
@use '~@shohojdhara/atomix/scss/settings' as settings;
|
|
141
|
-
@use '~@shohojdhara/atomix/scss/tools' as tools;
|
|
142
|
-
@use '~@shohojdhara/atomix/scss/components' as components;
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## Build Process
|
|
146
|
-
|
|
147
|
-
The Atomix Design System uses a comprehensive build process to generate optimized assets:
|
|
148
|
-
|
|
149
|
-
### Main Build
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
npm run build
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
This command will:
|
|
156
|
-
1. Build the main JavaScript library (ESM and CJS formats)
|
|
157
|
-
2. Generate TypeScript definitions
|
|
158
|
-
3. Build the main CSS styles (`dist/atomix.css` and `dist/atomix.min.css`)
|
|
159
|
-
|
|
160
|
-
### Individual Builds
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# Build only the main styles
|
|
164
|
-
npm run build:styles
|
|
165
|
-
|
|
166
|
-
# Build only the themes
|
|
167
|
-
npm run build:themes
|
|
168
|
-
|
|
169
|
-
# Build only the main library
|
|
170
|
-
npm run rollup -c
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Development
|
|
174
|
-
|
|
175
|
-
```bash
|
|
176
|
-
# Start Storybook for component development
|
|
177
|
-
npm run dev
|
|
178
|
-
|
|
179
|
-
# Run tests
|
|
180
|
-
npm test
|
|
181
|
-
|
|
182
|
-
# Run tests in watch mode
|
|
183
|
-
npm run test:watch
|
|
184
|
-
|
|
185
|
-
# Generate test coverage
|
|
186
|
-
npm run test:coverage
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### Storybook styles convention
|
|
190
|
-
|
|
191
|
-
To keep visual docs and any snapshots stable, choose one of the following and stick to it:
|
|
192
|
-
|
|
193
|
-
- Preferred: load the built CSS from dist.
|
|
194
|
-
- In your Storybook preview (e.g., .storybook/preview.ts/preview.js), import the bundled CSS once:
|
|
195
|
-
import '@shohojdhara/atomix/css'
|
|
196
|
-
- Before taking snapshots or publishing Storybook, ensure styles are compiled:
|
|
197
|
-
yarn build:styles
|
|
198
|
-
|
|
199
|
-
- Alternative (for live theming/dev): load the source SCSS.
|
|
200
|
-
- Import from the SCSS entry point:
|
|
201
|
-
import '@shohojdhara/atomix/scss'
|
|
202
|
-
- This relies on your builder's SCSS pipeline; avoid mixing SCSS and built CSS in the same Storybook to prevent drift.
|
|
203
|
-
|
|
204
|
-
Notes:
|
|
205
|
-
- CSS bundles produced by the styles build are deterministic: dist/atomix.css and dist/atomix.min.css.
|
|
206
|
-
- CI should run yarn attw to validate package exports and types after changes.
|
|
207
|
-
|
|
208
127
|
## Components
|
|
209
128
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
- **Actions**: [Button](src/components/Button), [Dropdown](src/components/Dropdown), [Pagination](src/components/Pagination)
|
|
213
|
-
- **Data Display**: [Badge](src/components/Badge), [Card](src/components/Card), [DataTable](src/components/DataTable)
|
|
214
|
-
- **Feedback**: [Callout](src/components/Callout), [Spinner](src/components/Spinner), [Progress](src/components/Progress)
|
|
215
|
-
- **Forms**: [Checkbox](src/components/Checkbox), [Input](src/components/Input), [Select](src/components/Select)
|
|
216
|
-
- **Navigation**: [Breadcrumb](src/components/Breadcrumb), [Navbar](src/components/Navbar), [Tabs](src/components/Tabs)
|
|
217
|
-
- **Surfaces**: [Accordion](src/components/Accordion), [Callout](src/components/Callout), [Modal](src/components/Modal)
|
|
218
|
-
- **Utilities**: [ColorModeToggle](src/components/ColorModeToggle), [Icon](src/components/Icon), [AtomixGlass](src/components/AtomixGlass), [AtomixLogo](src/components/AtomixLogo)
|
|
219
|
-
|
|
220
|
-
## Design Tokens
|
|
221
|
-
|
|
222
|
-
Atomix uses design tokens for consistent design language:
|
|
223
|
-
|
|
224
|
-
- **Colors**: Consistent color palette with light and dark mode variants
|
|
225
|
-
- **Spacing**: Consistent spacing scale based on 4px grid
|
|
226
|
-
- **Typography**: Consistent typography scale with responsive adjustments
|
|
227
|
-
- **Borders**: Consistent border radius and width system
|
|
228
|
-
- **Shadows**: Consistent shadow system for depth and elevation
|
|
229
|
-
|
|
230
|
-
## Accessibility
|
|
129
|
+
The library includes over 50+ components including:
|
|
231
130
|
|
|
232
|
-
|
|
131
|
+
- **Layout**: Grid, Container, Section
|
|
132
|
+
- **Navigation**: Navbar, Breadcrumb, Pagination
|
|
133
|
+
- **Forms**: Input, Button, Select, Checkbox, Radio
|
|
134
|
+
- **Feedback**: Alert, Modal, Tooltip, Toast
|
|
135
|
+
- **Data Display**: Table, Card, Badge, Avatar
|
|
136
|
+
- **Surfaces**: Accordion, Tabs, Expansion Panel
|
|
233
137
|
|
|
234
|
-
|
|
235
|
-
- **Keyboard Navigation**: Full keyboard navigation support
|
|
236
|
-
- **Screen Reader Support**: Proper ARIA attributes and semantic HTML
|
|
237
|
-
- **Focus Management**: Consistent focus indicators and management
|
|
238
|
-
- **Color Contrast**: Proper color contrast ratios for readability
|
|
138
|
+
For a complete list, see [components documentation](./src/components/).
|
|
239
139
|
|
|
240
|
-
##
|
|
140
|
+
## API
|
|
241
141
|
|
|
242
|
-
|
|
142
|
+
- [Components API](./docs/COMPONENTS_API.md)
|
|
143
|
+
- [Theme API](./docs/THEME_API.md)
|
|
144
|
+
- [Configuration](./docs/CONFIGURATION.md)
|
|
243
145
|
|
|
244
146
|
## Contributing
|
|
245
147
|
|
|
246
|
-
|
|
148
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for more details.
|
|
247
149
|
|
|
248
150
|
## License
|
|
249
151
|
|
|
250
|
-
|
|
152
|
+
MIT © [Shohojdhara](https://github.com/shohojdhara)
|
package/atomix.config.ts
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Atomix Configuration
|
|
3
|
+
*
|
|
4
|
+
* This file is for external developers to customize the Atomix Design System.
|
|
5
|
+
*
|
|
6
|
+
* External developers can create this file in their project root to customize
|
|
7
|
+
* design tokens, colors, spacing, typography, and more. The theme system will
|
|
8
|
+
* automatically load this configuration when using `createTheme()`.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* // atomix.config.ts (in your project)
|
|
13
|
+
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
14
|
+
*
|
|
15
|
+
* export default defineConfig({
|
|
16
|
+
* prefix: 'myapp',
|
|
17
|
+
* theme: {
|
|
18
|
+
* extend: {
|
|
19
|
+
* colors: {
|
|
20
|
+
* primary: { main: '#7AFFD7' },
|
|
21
|
+
* },
|
|
22
|
+
* },
|
|
23
|
+
* },
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // In your application code
|
|
30
|
+
* import { createTheme, injectTheme } from '@shohojdhara/atomix/theme';
|
|
31
|
+
*
|
|
32
|
+
* // Automatically loads from atomix.config.ts
|
|
33
|
+
* const css = createTheme();
|
|
34
|
+
* injectTheme(css);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @see https://atomix.design/docs/configuration for full documentation
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
// For library development, use local import
|
|
41
|
+
// For external developers, use: import { defineConfig } from '@shohojdhara/atomix/config';
|
|
42
|
+
import { defineConfig } from './src/lib/config';
|
|
43
|
+
|
|
44
|
+
export default defineConfig({
|
|
45
|
+
/**
|
|
46
|
+
* CSS Variable Prefix
|
|
47
|
+
*
|
|
48
|
+
* Change this to customize all CSS variable names.
|
|
49
|
+
* Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
|
|
50
|
+
*
|
|
51
|
+
* This prefix is automatically used by createTheme() when loading from config.
|
|
52
|
+
*/
|
|
53
|
+
prefix: 'atomix',
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Theme Customization
|
|
57
|
+
*
|
|
58
|
+
* Tailwind-like configuration for customizing design tokens.
|
|
59
|
+
* Use `extend` to override or extend base tokens (recommended).
|
|
60
|
+
* Use `tokens` to completely replace the token system (advanced).
|
|
61
|
+
*/
|
|
62
|
+
theme: {
|
|
63
|
+
/**
|
|
64
|
+
* Extend Default Design Tokens
|
|
65
|
+
*
|
|
66
|
+
* These values will override or extend the base Atomix tokens.
|
|
67
|
+
* This is the recommended approach for customization.
|
|
68
|
+
*/
|
|
69
|
+
extend: {
|
|
70
|
+
/**
|
|
71
|
+
* Color Customization
|
|
72
|
+
*
|
|
73
|
+
* You can customize colors in multiple ways:
|
|
74
|
+
*
|
|
75
|
+
* 1. Simple main color:
|
|
76
|
+
* primary: { main: '#7AFFD7' }
|
|
77
|
+
*
|
|
78
|
+
* 2. With light/dark variants:
|
|
79
|
+
* primary: { main: '#7AFFD7', light: '#B3FFE8', dark: '#4DFFC4' }
|
|
80
|
+
*
|
|
81
|
+
* 3. Full color scale (1-10):
|
|
82
|
+
* primary: { 1: '#f0f9ff', 2: '#dbeafe', ..., 10: '#1e3a8a' }
|
|
83
|
+
*
|
|
84
|
+
* 4. Main color (maps to step 6):
|
|
85
|
+
* primary: { main: '#3b82f6', 6: '#3b82f6' }
|
|
86
|
+
*/
|
|
87
|
+
colors: {
|
|
88
|
+
primary: {
|
|
89
|
+
main: '#3b82f6', // Your brand primary color
|
|
90
|
+
// Optional: provide full color scale (1-10)
|
|
91
|
+
// 1: '#f0f9ff', // lightest
|
|
92
|
+
// 2: '#dbeafe',
|
|
93
|
+
// 3: '#bfdbfe',
|
|
94
|
+
// 4: '#93c5fd',
|
|
95
|
+
// 5: '#60a5fa',
|
|
96
|
+
// 6: '#3b82f6', // main (default)
|
|
97
|
+
// 7: '#2563eb',
|
|
98
|
+
// 8: '#1d4ed8',
|
|
99
|
+
// 9: '#1e40af',
|
|
100
|
+
// 10: '#1e3a8a', // darkest
|
|
101
|
+
},
|
|
102
|
+
// Customize other semantic colors
|
|
103
|
+
// secondary: { main: '#10b981' },
|
|
104
|
+
// success: { main: '#22c55e' },
|
|
105
|
+
// error: { main: '#ef4444' },
|
|
106
|
+
// warning: { main: '#eab308' },
|
|
107
|
+
// info: { main: '#3b82f6' },
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Spacing Scale
|
|
112
|
+
*
|
|
113
|
+
* Customize spacing values used throughout the design system.
|
|
114
|
+
* These map to tokens like 'spacing-4', 'spacing-8', etc.
|
|
115
|
+
*/
|
|
116
|
+
// spacing: {
|
|
117
|
+
// '1': '0.25rem', // 4px
|
|
118
|
+
// '2': '0.5rem', // 8px
|
|
119
|
+
// '3': '0.75rem', // 12px
|
|
120
|
+
// '4': '1rem', // 16px
|
|
121
|
+
// '5': '1.25rem', // 20px
|
|
122
|
+
// '6': '1.5rem', // 24px
|
|
123
|
+
// '8': '2rem', // 32px
|
|
124
|
+
// '10': '2.5rem', // 40px
|
|
125
|
+
// '12': '3rem', // 48px
|
|
126
|
+
// '16': '4rem', // 64px
|
|
127
|
+
// '20': '5rem', // 80px
|
|
128
|
+
// },
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Typography Customization
|
|
132
|
+
*
|
|
133
|
+
* Customize fonts, sizes, weights, and line heights.
|
|
134
|
+
*/
|
|
135
|
+
// typography: {
|
|
136
|
+
// // Font families
|
|
137
|
+
// fontFamilies: {
|
|
138
|
+
// sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
139
|
+
// serif: ['Georgia', 'serif'],
|
|
140
|
+
// mono: ['Fira Code', 'monospace'],
|
|
141
|
+
// },
|
|
142
|
+
// // Font sizes
|
|
143
|
+
// fontSizes: {
|
|
144
|
+
// 'xs': '0.75rem', // 12px
|
|
145
|
+
// 'sm': '0.875rem', // 14px
|
|
146
|
+
// 'base': '1rem', // 16px
|
|
147
|
+
// 'lg': '1.125rem', // 18px
|
|
148
|
+
// 'xl': '1.25rem', // 20px
|
|
149
|
+
// '2xl': '1.5rem', // 24px
|
|
150
|
+
// '3xl': '1.875rem', // 30px
|
|
151
|
+
// '4xl': '2.25rem', // 36px
|
|
152
|
+
// },
|
|
153
|
+
// // Font weights
|
|
154
|
+
// fontWeights: {
|
|
155
|
+
// 'light': 300,
|
|
156
|
+
// 'normal': 400,
|
|
157
|
+
// 'medium': 500,
|
|
158
|
+
// 'semibold': 600,
|
|
159
|
+
// 'bold': 700,
|
|
160
|
+
// },
|
|
161
|
+
// // Line heights
|
|
162
|
+
// lineHeights: {
|
|
163
|
+
// 'tight': 1.2,
|
|
164
|
+
// 'normal': 1.5,
|
|
165
|
+
// 'relaxed': 1.75,
|
|
166
|
+
// },
|
|
167
|
+
// },
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Border Radius
|
|
171
|
+
*
|
|
172
|
+
* Customize border radius values.
|
|
173
|
+
*/
|
|
174
|
+
// borderRadius: {
|
|
175
|
+
// 'sm': '0.25rem', // 4px
|
|
176
|
+
// 'md': '0.5rem', // 8px (default)
|
|
177
|
+
// 'lg': '0.75rem', // 12px
|
|
178
|
+
// 'xl': '1rem', // 16px
|
|
179
|
+
// 'full': '9999px', // Fully rounded
|
|
180
|
+
// },
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Shadows
|
|
184
|
+
*
|
|
185
|
+
* Customize box shadow values.
|
|
186
|
+
*/
|
|
187
|
+
// shadows: {
|
|
188
|
+
// 'sm': '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
189
|
+
// 'md': '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
|
|
190
|
+
// 'lg': '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
|
191
|
+
// 'xl': '0 20px 25px -5px rgba(0, 0, 0, 0.1)',
|
|
192
|
+
// },
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Z-Index Scale
|
|
196
|
+
*
|
|
197
|
+
* Customize z-index values for layering.
|
|
198
|
+
*/
|
|
199
|
+
// zIndex: {
|
|
200
|
+
// 'base': 0,
|
|
201
|
+
// 'dropdown': 1000,
|
|
202
|
+
// 'sticky': 1020,
|
|
203
|
+
// 'fixed': 1030,
|
|
204
|
+
// 'modal-backdrop': 1040,
|
|
205
|
+
// 'modal': 1050,
|
|
206
|
+
// 'popover': 1060,
|
|
207
|
+
// 'tooltip': 1070,
|
|
208
|
+
// },
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Transitions
|
|
212
|
+
*
|
|
213
|
+
* Customize transition durations and easings.
|
|
214
|
+
*/
|
|
215
|
+
// transitions: {
|
|
216
|
+
// durations: {
|
|
217
|
+
// 'fast': '150ms',
|
|
218
|
+
// 'base': '200ms',
|
|
219
|
+
// 'slow': '300ms',
|
|
220
|
+
// },
|
|
221
|
+
// easings: {
|
|
222
|
+
// 'ease-in': 'cubic-bezier(0.4, 0, 1, 1)',
|
|
223
|
+
// 'ease-out': 'cubic-bezier(0, 0, 0.2, 1)',
|
|
224
|
+
// 'ease-in-out': 'cubic-bezier(0.4, 0, 0.2, 1)',
|
|
225
|
+
// },
|
|
226
|
+
// },
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Complete Token Override (Advanced)
|
|
231
|
+
*
|
|
232
|
+
* Use with caution - this replaces the entire token system.
|
|
233
|
+
* Most users should use `extend` instead.
|
|
234
|
+
*/
|
|
235
|
+
// tokens: {
|
|
236
|
+
// colors: { /* your full color system */ },
|
|
237
|
+
// spacing: { /* your full spacing scale */ },
|
|
238
|
+
// // ... other token categories
|
|
239
|
+
// },
|
|
240
|
+
},
|
|
241
|
+
});
|