@shohojdhara/atomix 0.3.5 → 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.
Files changed (173) hide show
  1. package/README.md +101 -199
  2. package/atomix.config.ts +241 -0
  3. package/dist/atomix.css +260 -179
  4. package/dist/atomix.css.map +1 -1
  5. package/dist/atomix.min.css +250 -179
  6. package/dist/atomix.min.css.map +1 -1
  7. package/dist/charts.js +61 -66
  8. package/dist/charts.js.map +1 -1
  9. package/dist/core.js +47 -31
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.js +47 -31
  12. package/dist/forms.js.map +1 -1
  13. package/dist/heavy.js +47 -31
  14. package/dist/heavy.js.map +1 -1
  15. package/dist/index.d.ts +1841 -1633
  16. package/dist/index.esm.js +4975 -4113
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +5151 -4290
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.min.js +1 -1
  21. package/dist/index.min.js.map +1 -1
  22. package/dist/theme.d.ts +1572 -1442
  23. package/dist/theme.js +4816 -4080
  24. package/dist/theme.js.map +1 -1
  25. package/package.json +6 -20
  26. package/src/components/Accordion/Accordion.stories.tsx +50 -17
  27. package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
  28. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
  29. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
  30. package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
  31. package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
  32. package/src/components/Avatar/Avatar.stories.tsx +7 -0
  33. package/src/components/Badge/Badge.stories.tsx +91 -13
  34. package/src/components/Block/Block.stories.tsx +7 -23
  35. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
  36. package/src/components/Button/Button.stories.tsx +141 -22
  37. package/src/components/Button/ButtonGroup.stories.tsx +315 -0
  38. package/src/components/Button/ButtonGroup.tsx +67 -0
  39. package/src/components/Button/index.ts +2 -0
  40. package/src/components/Callout/Callout.stories.tsx +8 -6
  41. package/src/components/Card/Card.stories.tsx +82 -28
  42. package/src/components/Chart/AnimatedChart.tsx +0 -1
  43. package/src/components/Chart/AreaChart.tsx +0 -1
  44. package/src/components/Chart/BarChart.tsx +0 -1
  45. package/src/components/Chart/BubbleChart.tsx +0 -1
  46. package/src/components/Chart/CandlestickChart.tsx +0 -1
  47. package/src/components/Chart/Chart.stories.tsx +5 -7
  48. package/src/components/Chart/Chart.tsx +0 -16
  49. package/src/components/Chart/ChartRenderer.tsx +1 -1
  50. package/src/components/Chart/DonutChart.tsx +0 -1
  51. package/src/components/Chart/FunnelChart.tsx +0 -1
  52. package/src/components/Chart/GaugeChart.tsx +0 -1
  53. package/src/components/Chart/HeatmapChart.tsx +0 -1
  54. package/src/components/Chart/LineChart.tsx +0 -1
  55. package/src/components/Chart/MultiAxisChart.tsx +0 -1
  56. package/src/components/Chart/PieChart.tsx +0 -1
  57. package/src/components/Chart/RadarChart.tsx +0 -1
  58. package/src/components/Chart/ScatterChart.tsx +0 -1
  59. package/src/components/Chart/WaterfallChart.tsx +0 -1
  60. package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
  61. package/src/components/DataTable/DataTable.stories.tsx +23 -16
  62. package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
  63. package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
  64. package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
  65. package/src/components/Footer/Footer.stories.tsx +8 -6
  66. package/src/components/Footer/FooterLink.tsx +9 -2
  67. package/src/components/Form/Checkbox.stories.tsx +7 -0
  68. package/src/components/Form/Form.stories.tsx +7 -0
  69. package/src/components/Form/FormGroup.stories.tsx +9 -1
  70. package/src/components/Form/Input.stories.tsx +69 -16
  71. package/src/components/Form/Radio.stories.tsx +9 -1
  72. package/src/components/Form/Select.stories.tsx +9 -1
  73. package/src/components/Form/Textarea.stories.tsx +10 -2
  74. package/src/components/Hero/Hero.stories.tsx +7 -0
  75. package/src/components/List/List.stories.tsx +7 -0
  76. package/src/components/Messages/Messages.stories.tsx +8 -7
  77. package/src/components/Modal/Modal.stories.tsx +17 -6
  78. package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
  79. package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
  80. package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
  81. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
  82. package/src/components/Pagination/Pagination.stories.tsx +188 -111
  83. package/src/components/Pagination/Pagination.tsx +83 -3
  84. package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
  85. package/src/components/Popover/Popover.stories.tsx +191 -115
  86. package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
  87. package/src/components/Progress/Progress.stories.tsx +79 -49
  88. package/src/components/Rating/Rating.stories.tsx +109 -84
  89. package/src/components/River/River.stories.tsx +194 -114
  90. package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
  91. package/src/components/Slider/Slider.stories.tsx +7 -0
  92. package/src/components/Spinner/Spinner.stories.tsx +15 -11
  93. package/src/components/Steps/Steps.stories.tsx +132 -98
  94. package/src/components/Tabs/Tabs.stories.tsx +163 -112
  95. package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
  96. package/src/components/Todo/Todo.stories.tsx +38 -12
  97. package/src/components/Toggle/Toggle.stories.tsx +61 -28
  98. package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
  99. package/src/components/Upload/Upload.stories.tsx +122 -84
  100. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
  101. package/src/components/index.ts +1 -0
  102. package/src/lib/composables/useAtomixGlass.ts +2 -3
  103. package/src/lib/composables/useNavbar.ts +0 -10
  104. package/src/lib/config/loader.ts +2 -1
  105. package/src/lib/constants/components.ts +10 -0
  106. package/src/lib/hooks/useComponentCustomization.ts +1 -1
  107. package/src/lib/theme/README.md +174 -0
  108. package/src/lib/theme/adapters/index.ts +31 -0
  109. package/src/lib/theme/adapters/themeAdapter.ts +287 -0
  110. package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
  111. package/src/lib/theme/config/configLoader.ts +254 -0
  112. package/src/lib/theme/config/loader.ts +37 -48
  113. package/src/lib/theme/config/types.ts +2 -2
  114. package/src/lib/theme/config/validator.ts +15 -91
  115. package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
  116. package/src/lib/theme/constants/index.ts +8 -0
  117. package/src/lib/theme/core/ThemeRegistry.ts +19 -6
  118. package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
  119. package/src/lib/theme/core/composeTheme.ts +155 -0
  120. package/src/lib/theme/core/createTheme.ts +94 -0
  121. package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
  122. package/src/lib/theme/core/index.ts +5 -19
  123. package/src/lib/theme/devtools/Comparator.tsx +346 -22
  124. package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
  125. package/src/lib/theme/devtools/Inspector.tsx +335 -51
  126. package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
  127. package/src/lib/theme/devtools/Preview.tsx +471 -221
  128. package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
  129. package/src/lib/theme/devtools/index.ts +14 -4
  130. package/src/lib/theme/devtools/useHistory.ts +130 -0
  131. package/src/lib/theme/errors/index.ts +12 -0
  132. package/src/lib/theme/generators/cssFile.ts +79 -0
  133. package/src/lib/theme/generators/generateCSS.ts +89 -0
  134. package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
  135. package/src/lib/theme/generators/index.ts +19 -0
  136. package/src/lib/theme/i18n/rtl.ts +5 -6
  137. package/src/lib/theme/index.ts +120 -15
  138. package/src/lib/theme/runtime/ThemeApplicator.ts +52 -111
  139. package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
  140. package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +1 -1
  141. package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
  142. package/src/lib/theme/runtime/index.ts +1 -2
  143. package/src/lib/theme/runtime/useTheme.ts +1 -2
  144. package/src/lib/theme/test/testTheme.ts +385 -0
  145. package/src/lib/theme/tokens/index.ts +12 -0
  146. package/src/lib/theme/tokens/tokens.ts +721 -0
  147. package/src/lib/theme/types.ts +6 -42
  148. package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
  149. package/src/lib/theme/utils/index.ts +11 -0
  150. package/src/lib/theme/utils/injectCSS.ts +90 -0
  151. package/src/lib/theme/utils/themeHelpers.ts +78 -0
  152. package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
  153. package/src/lib/theme-tools.ts +7 -8
  154. package/src/lib/types/components.ts +40 -130
  155. package/src/lib/utils/componentUtils.ts +1 -1
  156. package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
  157. package/src/styles/02-tools/_tools.button.scss +66 -79
  158. package/src/styles/06-components/_components.atomix-glass.scss +13 -3
  159. package/src/styles/06-components/_components.pagination.scss +88 -0
  160. package/scripts/sync-theme-config.js +0 -309
  161. package/src/lib/theme/composeTheme.ts +0 -370
  162. package/src/lib/theme/core/ThemeCache.ts +0 -283
  163. package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
  164. package/src/lib/theme/core/ThemeEngine.ts +0 -665
  165. package/src/lib/theme/createThemeFromConfig.ts +0 -132
  166. package/src/lib/theme/devtools/CLI.ts +0 -364
  167. package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
  168. package/src/lib/theme/runtime/ThemeManager.ts +0 -446
  169. package/src/styles/03-generic/_generated-root.css +0 -26
  170. package/src/themes/README.md +0 -442
  171. package/src/themes/themes.config.js +0 -68
  172. /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
  173. /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
@@ -1,442 +0,0 @@
1
-
2
- # Atomix Design System Themes
3
-
4
- This guide documents how to build SCSS-based themes for the Atomix Design System
5
-
6
- ## Theme Architecture
7
-
8
- - Overview
9
- - Themes follow a layered SCSS architecture mirroring Atomix core styles: `01-settings`, `02-tools`, `03-generic`, `04-elements`, `05-objects`, `06-components`, `99-utilities`.
10
- - Each theme selectively overrides base tokens, utilities, and component styling while reusing the majority of Atomix core styles.
11
-
12
- - File Structure (from `shaj-default`)
13
- - `index.scss` — Entrypoint that wires up local overrides and Atomix base layers.
14
- - `01-settings/` — Theme tokens and configuration (colors, spacing, breakpoints, fonts, typography, component settings).
15
- - `02-tools/` — Optional theme-specific tools; can be empty when only using Atomix tools.
16
- - `03-generic/` — Root-level theme overrides (often minimal).
17
- - `04-elements/`, `05-objects/` — Rarely overridden; keep consistent unless theme requires element/object-level changes.
18
- - `06-components/` — Component overrides specific to the theme’s visual style.
19
- - `99-utilities/` — Utility overrides or additions.
20
-
21
- - Architecture Diagram
22
- ```
23
- Theme Entrypoint (index.scss)
24
- ├─ 01-settings (forward) → overrides base tokens
25
- ├─ 02-tools (use/forward) → theme tools (optional)
26
- ├─ 03-generic (forward) → root/base overrides
27
- ├─ 04-elements (forward) → element-level overrides (rare)
28
- ├─ 05-objects (forward) → layout/object overrides (rare)
29
- ├─ 06-components(forward) → component styling overrides
30
- └─ 99-utilities(forward) → utility overrides (optional)
31
-
32
- Atomix Base Styles (../../styles)
33
- ├─ 01-settings → default tokens
34
- ├─ 02-tools → mixins & functions
35
- ├─ 03-generic → resets and root
36
- ├─ 04-elements → HTML elements
37
- ├─ 05-objects → layout patterns
38
- ├─ 06-components → components
39
- └─ 99-utilities → utility classes
40
- ```
41
-
42
- - Entrypoint Example (from `shaj-default/index.scss`)
43
- ```scss
44
- // Import and forward local theme settings first (these override base settings)
45
- @use '01-settings/index' as *;
46
-
47
- // Import and forward base styles with local overrides
48
- @use '02-tools/index' as *;
49
- @use '../../styles/02-tools/index' as tools;
50
-
51
- @use '03-generic/index' as *;
52
- @use '../../styles/03-generic/index' as generic;
53
-
54
- @use '04-elements/index' as *;
55
- @use '../../styles/04-elements/index' as elements;
56
-
57
- @use '05-objects/index' as *;
58
- @use '../../styles/05-objects/index' as objects;
59
-
60
- @use '06-components/index' as *;
61
- @use '../../styles/06-components/index';
62
-
63
- @use '99-utilities/index' as *;
64
- @use '../../styles/99-utilities/index' as utilities;
65
- ```
66
-
67
- - Core SCSS Files and Purpose
68
- - `01-settings/_settings.config.scss`: global theme config, including `$prefix` to namespace CSS variables.
69
- ```scss
70
- // These variables must act as constants, hence the uppercase
71
- $ENV: 'dev';
72
- $prefix: atomix- !default; // used as var(--#{$prefix}token)
73
- ```
74
- - `01-settings/_settings.colors.scss`: overrides Atomix color tokens by providing a 1–10 scale for each palette.
75
- ```scss
76
- @use '../../../styles/01-settings/settings.colors' with (
77
- $primary-6: #0ea5e9,
78
- $primary-7: #0284c7,
79
- $primary-8: #0369a1,
80
- $gray-1: #f9fafb,
81
- $gray-10: #111827,
82
- // ... full 1–10 scales per color
83
- );
84
- ```
85
- - `01-settings/_settings.typography.scss`: font families, weights, sizes, line-heights, letter spacing.
86
- ```scss
87
- @use '../../../styles/01-settings/settings.typography' with (
88
- $font-family-base: (system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif),
89
- $font-weight-normal: 400,
90
- $h1-font-size: 2.75rem,
91
- $line-height-base: 1.6,
92
- $headings-font-weight: 600,
93
- // ...
94
- );
95
- ```
96
- - `01-settings/_settings.spacing.scss`: spacing scale tied to `px` values.
97
- ```scss
98
- $spacer: 16px !default;
99
- $spacing-sizes: (
100
- 0: 0px, 1: 4px, 2: 8px, 3: 12px,
101
- 4: 16px, 5: 20px, 6: 24px, 8: 32px,
102
- 10: 40px, 12: 48px, 16: 64px, 20: 80px,
103
- // ...
104
- ) !default;
105
- ```
106
- - `01-settings/_settings.breakpoints.scss`: breakpoint map and explicit variables.
107
- ```scss
108
- $breakpoints: (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px, xxl: 1400px) !default;
109
- $breakpoint-sm: 576px !default; // also provided individually
110
- ```
111
- - `01-settings/_settings.fonts.scss`: font imports and loading strategy.
112
- ```scss
113
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
114
- $font-display: swap !default;
115
- ```
116
- - `06-components/*`: component-specific overrides using theme CSS variables.
117
- ```scss
118
- // Button example
119
- @use '../01-settings/settings.config' as *;
120
- .c-btn.c-btn-primary {
121
- background: linear-gradient(135deg, var(--#{$prefix}primary-6), var(--#{$prefix}primary-7));
122
- border-color: var(--#{$prefix}primary-6);
123
- }
124
- ```
125
-
126
- - Variable Naming Conventions and Organization
127
- - SCSS variables: lowercase with hyphenation (e.g., `$primary-6`, `$line-height-base`).
128
- - Constant-like config: uppercase for special cases (e.g., `$ENV`).
129
- - CSS variables: namespaced with `$prefix`, used as `var(--#{$prefix}token-name)` throughout components to enable runtime theming.
130
- - Color scales: 1–10 per palette for predictable gradations.
131
-
132
- - Mixins and Function Implementations
133
- - Atomix provides color utilities and general tools you can reuse; theme overrides are optional.
134
- - Color utilities (from base tools):
135
- ```scss
136
- // _tools.color-functions.scss
137
- @function tint-color($color, $weight) { /* mix with white */ }
138
- @function shade-color($color, $weight) { /* mix with black */ }
139
- @function shift-color($color, $weight) { /* tint if >0, else shade */ }
140
- @function to-rgb($color) { /* returns "r, g, b" or passthrough */ }
141
- ```
142
- - Media, spacing, and utility tools are exposed via `@use '../../styles/02-tools/index' as tools;` and can be applied in components.
143
-
144
- ## Theme Creation Process
145
-
146
- - Step-by-Step Guide
147
- 1. Create a new theme folder: `./src/themes/<your-theme>/`.
148
- 2. Add `index.scss` that forwards local settings first, then uses Atomix base layers:
149
- ```scss
150
- @use '01-settings/index' as *;
151
- @use '02-tools/index' as *;
152
- @use '../../styles/02-tools/index' as tools;
153
- @use '03-generic/index' as *;
154
- @use '../../styles/03-generic/index' as generic;
155
- @use '04-elements/index' as *;
156
- @use '../../styles/04-elements/index' as elements;
157
- @use '05-objects/index' as *;
158
- @use '../../styles/05-objects/index' as objects;
159
- @use '06-components/index' as *;
160
- @use '../../styles/06-components/index';
161
- @use '99-utilities/index' as *;
162
- @use '../../styles/99-utilities/index' as utilities;
163
- ```
164
- 3. Implement `01-settings/_index.scss` and forward needed settings files. Start with colors and config, then add typography, spacing, breakpoints, and any component settings.
165
- 4. Optionally add `02-tools` overrides (often empty if relying on Atomix tools).
166
- 5. Add component overrides under `06-components` as needed to express your unique design.
167
- 6. Keep `03-generic`, `04-elements`, `05-objects`, and `99-utilities` minimal unless your theme needs specific overrides at those layers.
168
-
169
- - Required Base Variables and Defaults
170
- - `$prefix`: CSS variable namespace (default: `atomix-`).
171
- - Colors: provide complete 1–10 scales for `primary`, `red`, `green`, `yellow`, `blue`, and `gray`. Use `shaj-default` values as a starting point.
172
- - Typography: families, weights (300–900), base and heading sizes, line heights, letter spacing.
173
- - Spacing: maintain the Atomix scale (e.g., `$spacer: 16px` and `$spacing-sizes` map) for consistency.
174
- - Breakpoints: keep standard responsive sizes (xs–xxl) to ensure layout fidelity.
175
-
176
- - Color Palette Definition Methodology
177
- - Define each color scale from 1 (lightest) to 10 (darkest) with accessible contrast.
178
- - Prefer balanced hues aligned with UI affordances: primary for action, gray for surfaces, red/green for state.
179
- - Use CSS variables in components: `var(--#{$prefix}primary-6)` for runtime theme flexibility.
180
-
181
- - Typography System Implementation
182
- - Use performant system fonts by default (as in `shaj-default`).
183
- - Scale headings more pronounced than body text; ensure `line-height-base` ≥ 1.5 for readability.
184
- - Adjust letter spacing for large headings to improve optical balance.
185
-
186
- - Spacing and Layout Rules
187
- - Adopt the Atomix spacing map to guarantee consistent padding/margins across components.
188
- - Leverage base grid and breakpoint tools from `../../styles/02-tools` for responsive behaviors.
189
-
190
- - Component-Specific Styling Patterns
191
- - Buttons: use gradients or solid fills with hover transitions; reference `primary-*` variables.
192
- ```scss
193
- .c-btn.c-btn-primary { background: linear-gradient(135deg, var(--#{$prefix}primary-6), var(--#{$prefix}primary-7)); }
194
- ```
195
- - Inputs: emphasize focus states with subtle shadows and color borders; include valid/invalid states.
196
- ```scss
197
- .c-form-control:focus { border-color: var(--#{$prefix}primary-6); box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }
198
- ```
199
- - Cards: use surface and border tokens with hover elevation.
200
- ```scss
201
- .c-card { border: 1px solid var(--#{$prefix}gray-2); &:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12); } }
202
- ```
203
-
204
- ## Best Practices
205
-
206
- - SCSS Organization Strategies
207
- - Mirror Atomix’s layered architecture; keep overrides local to the appropriate layer.
208
- - Forward settings via `01-settings/_index.scss` using `@forward` to keep entry imports clean.
209
- - Minimize changes in `03-generic`, `04-elements`, and `05-objects` unless necessary.
210
-
211
- - Variable Inheritance Patterns
212
- - Override base tokens using `@use '...settings.*' with (...)` to keep diffs scoped.
213
- - Namespace CSS variables via `$prefix`, and access them in components using `var(--#{$prefix}...)`.
214
- - Prefer CSS variables in component styles to allow runtime theming.
215
-
216
- - Theme Extension Techniques
217
- - Start from `shaj-default` and incrementally override only what you need.
218
- - Add component overrides under `06-components` to layer theme-specific visuals without diverging from core semantics.
219
- - Reuse Atomix tools (`../../styles/02-tools`) for consistency and performance.
220
-
221
- - Performance Optimization for Theme SCSS
222
- - Avoid deep selector nesting; keep specificity low.
223
- - Use transition and shadow values sparingly to reduce paint cost.
224
- - Share tokens via CSS variables rather than recomputing values in many places.
225
- - Build settings can compress output; see `themes.config.js` for build formats and Sass options.
226
-
227
- - Browser Compatibility Considerations
228
- - Respect the project `.browserslistrc` for autoprefixing and compatibility.
229
- - Provide sensible fallbacks when using advanced features; CSS vars are widely supported but test in IE11-like environments if necessary (polyfills typically out of scope).
230
-
231
- ## Testing and Validation
232
-
233
- - Visual Regression Testing Procedures
234
- - Use Storybook stories for themed components; compare snapshots across theme changes.
235
- - Consider integrating Chromatic or a screenshot diff tool to catch regressions.
236
-
237
- - Theme Consistency Checks
238
- - Verify all components read tokens from CSS variables (e.g., `var(--#{$prefix}*)`).
239
- - Ensure spacing, typography, and color usage comply with your theme’s `01-settings`.
240
- - Audit hover/focus states for accessibility and consistency.
241
-
242
- - Cross-Browser Testing Requirements
243
- - Test Chrome, Safari, Firefox, and Edge at minimum.
244
- - Validate responsive behavior at breakpoints (`sm`, `md`, `lg`, `xl`, `xxl`).
245
-
246
- - Performance Impact Measurement
247
- - Measure CSS bundle size per theme; prefer compressed outputs for production.
248
- - Use Lighthouse or performance tooling to evaluate paint, layout shifts, and interaction latency.
249
-
250
- ## Maintenance Guidelines
251
-
252
- - Theme Versioning Strategy
253
- - Track theme versions in `themes.config.js` metadata and follow SemVer (MAJOR.MINOR.PATCH).
254
- - Bump versions when changing tokens or component visuals in backward-incompatible ways.
255
-
256
- - Update and Deprecation Policies
257
- - Document breaking changes in `CHANGELOG.md` and migration notes.
258
- - Deprecate tokens or patterns gradually; provide an alias or fallback period.
259
-
260
- - Documentation Standards for New Themes
261
- - Include an overview of your theme’s goals, palette, typography, and component deltas.
262
- - Add code snippets for critical overrides and an architecture diagram.
263
-
264
- - Contribution Guidelines for Theme Development
265
- - Follow repository `CONTRIBUTING.md` and maintain consistent code style.
266
- - Keep PRs focused: token changes separate from component visual changes whenever possible.
267
-
268
- ## Practical Examples (from shaj-default)
269
-
270
- - Config and Prefix
271
- ```scss
272
- // 01-settings/_settings.config.scss
273
- $ENV: 'dev';
274
- $prefix: atomix- !default;
275
- ```
276
-
277
- - Colors Override with Base Integration
278
- ```scss
279
- // 01-settings/_settings.colors.scss
280
- @use '../../../styles/02-tools/tools.to-rgb' as *;
281
- @use '../../../styles/02-tools/tools.color-functions' as *;
282
- @use '../../../styles/01-settings/settings.colors' with (
283
- $primary-1: #f0f9ff,
284
- $primary-6: #0ea5e9,
285
- $primary-7: #0284c7,
286
- $gray-1: #f9fafb,
287
- $gray-10: #111827,
288
- // ... full scales per palette
289
- );
290
- ```
291
-
292
- - Typography System
293
- ```scss
294
- // 01-settings/_settings.typography.scss
295
- @use '../../../styles/01-settings/settings.typography' with (
296
- $font-family-base: (system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif),
297
- $font-size-base: 1rem, // 16px
298
- $h1-font-size: 2.75rem,
299
- $line-height-base: 1.6,
300
- $headings-font-weight: 600,
301
- );
302
- ```
303
-
304
- - Spacing Scale
305
- ```scss
306
- // 01-settings/_settings.spacing.scss
307
- $spacer: 16px !default;
308
- $spacing-sizes: (0: 0px, 1: 4px, 2: 8px, 3: 12px, 4: 16px, 6: 24px, 8: 32px, 10: 40px, 12: 48px, 16: 64px, 20: 80px);
309
- ```
310
-
311
- - Component Overrides (Button)
312
- ```scss
313
- // 06-components/_components.button.scss
314
- @use '../01-settings/settings.config' as *;
315
- .c-btn.c-btn-primary {
316
- background: linear-gradient(135deg, var(--#{$prefix}primary-6), var(--#{$prefix}primary-7));
317
- border-color: var(--#{$prefix}primary-6);
318
- }
319
- ```
320
-
321
- - Component Overrides (Input)
322
- ```scss
323
- // 06-components/_components.input.scss
324
- @use '../01-settings/settings.config' as *;
325
- .c-form-control:focus {
326
- border-color: var(--#{$prefix}primary-6);
327
- box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
328
- }
329
- ```
330
-
331
- ## Theme Registration and Build
332
-
333
- - Theme Metadata and Build Settings (`src/themes/themes.config.js`)
334
- ```js
335
- export const themesConfig = {
336
- metadata: {
337
- 'shaj-default': { name: 'Shaj Default', version: '1.0.0', tags: ['default','light'], supportsDarkMode: true },
338
- // add your theme:
339
- 'my-theme': { name: 'My Theme', version: '0.1.0', tags: ['light'], supportsDarkMode: true }
340
- },
341
- build: { output: { directory: 'themes', formats: { expanded: '.css', compressed: '.min.css' } }, sass: { style: 'expanded', sourceMap: true, loadPaths: ['src'] } },
342
- exports: { './themes/*': './dist/themes/*.css', './themes/*.min': './dist/themes/*.min.css' },
343
- integration: { cssVariables: { colorMode: '--storybook-color-mode' }, classNames: { theme: 'data-theme', colorMode: 'data-color-mode' } }
344
- };
345
- ```
346
-
347
- - Suggested Steps to Add a New Theme
348
- - Create `src/themes/<my-theme>/` with the layered structure shown above.
349
- - Implement tokens in `01-settings` and component overrides in `06-components`.
350
- - Add metadata in `themes.config.js` under `metadata` for discoverability.
351
- - Include your theme CSS in your app by bundling `index.scss` or using the build output under `dist/themes`.
352
-
353
- ---
354
-
355
- By following the patterns and examples in `shaj-default`, you can create highly consistent, maintainable, and performant themes that integrate seamlessly with Atomix core styles while expressing distinct visual identities.
356
-
357
-
358
- This directory contains all the themes for the Atomix Design System. Each theme is a collection of SCSS files that override or extend the base design system styles.
359
-
360
- ## Theme Structure
361
-
362
- Each theme follows the same structure as the main design system:
363
-
364
- ```
365
- theme-name/
366
- ├── 01-settings/
367
- ├── 02-tools/
368
- ├── 03-generic/
369
- ├── 04-elements/
370
- ├── 05-objects/
371
- ├── 06-components/
372
- ├── 99-utilities/
373
- └── index.scss
374
- ```
375
-
376
- ## Available Themes
377
-
378
- - **shaj-default** - The default theme for Atomix Design System
379
- - **boomdevs** - A theme by the BoomDevs team
380
- - **esrar** - A theme by the Esrar team
381
- - **mashroom** - A theme by the Mashroom team
382
- - **yabai** - A theme by the Yabai team
383
-
384
- ## How Themes Work
385
-
386
- Themes work by importing and overriding the base design system styles. Each theme's `index.scss` file:
387
-
388
- 1. Imports local theme settings that override base settings
389
- 2. Imports and forwards base styles with local overrides
390
- 3. Combines theme-specific styles with the base design system
391
-
392
- ## Building Themes
393
-
394
- Themes are automatically built when you run the main build command:
395
-
396
- ```bash
397
- npm run build
398
- ```
399
-
400
- This generates individual CSS files for each theme in the `dist/themes` directory:
401
- - Expanded CSS for development
402
- - Minified CSS for production
403
-
404
- You can also build only the themes with:
405
-
406
- ```bash
407
- npm run build:themes
408
- ```
409
-
410
- ## Using Themes
411
-
412
- To use a theme in your project, import the corresponding CSS file:
413
-
414
- ```scss
415
- // In your SCSS file
416
- @import '~@shohojdhara/atomix/dist/themes/shaj-default.css';
417
- ```
418
-
419
- Or in your JavaScript/TypeScript files:
420
-
421
- ```js
422
- // Import the theme CSS
423
- import '@shohojdhara/atomix/dist/themes/shaj-default.css';
424
- ```
425
-
426
- ## Creating New Themes
427
-
428
- To create a new theme:
429
-
430
- 1. Create a new directory in `src/themes` with your theme name
431
- 2. Follow the same structure as existing themes
432
- 3. Create an `index.scss` file that imports and overrides base styles
433
- 4. Add your theme to the `themes.variants` array in `build.config.js`
434
- 5. Run the build process to generate the theme CSS files
435
-
436
- ## Theme Customization
437
-
438
- Themes can customize any aspect of the design system by overriding variables, mixins, or component styles in their respective directories. For example, to customize button styles in your theme:
439
-
440
- 1. Create a `_buttons.scss` file in `themes/your-theme/06-components/`
441
- 2. Override the button styles as needed
442
- 3. Import and forward the file in `themes/your-theme/06-components/_index.scss`
@@ -1,68 +0,0 @@
1
- /**
2
- * Theme Configuration
3
- *
4
- * This file is auto-generated from atomix.config.ts
5
- * DO NOT EDIT MANUALLY - Edit atomix.config.ts instead
6
- * Run 'npm run sync:config' to regenerate
7
- *
8
- * Generated on: 2025-12-23T09:44:24.454Z
9
- */
10
-
11
- export const themesConfig = {
12
- // CSS variable prefix (from atomix.config.ts)
13
- prefix: 'atomix',
14
-
15
- // Theme metadata
16
- metadata: {},
17
-
18
- // Build configuration
19
- build: {
20
- output: {
21
- directory: 'dist/themes',
22
- formats: {
23
- expanded: '.css',
24
- compressed: '.min.css'
25
- }
26
- },
27
- sass: {
28
- style: 'expanded',
29
- sourceMap: true,
30
- loadPaths: [
31
- 'src'
32
- ]
33
- }
34
- },
35
-
36
- // Export configuration for package.json
37
- exports: {
38
- './themes/*': './dist/themes/*.css',
39
- './themes/*.min': './dist/themes/*.min.css',
40
- },
41
-
42
- // Theme integration settings
43
- integration: {
44
- cssVariables: {
45
- colorMode: '--color-mode'
46
- },
47
- classNames: {
48
- theme: 'data-theme',
49
- colorMode: 'data-color-mode'
50
- }
51
- },
52
-
53
- // Runtime theme loading configuration
54
- runtime: {
55
- basePath: '/themes',
56
- cdnPath: null,
57
- preload: [],
58
- lazy: false,
59
- defaultTheme: null,
60
- storageKey: 'atomix-theme',
61
- dataAttribute: 'data-atomix-theme',
62
- enablePersistence: true,
63
- useMinified: false
64
- },
65
-
66
- // Theme dependencies (if a theme requires another theme to be loaded)
67
- dependencies: {},
68
- };
File without changes