@shohojdhara/atomix 0.5.1 → 0.5.4
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/atomix.config.ts +45 -33
- package/build-tools/webpack-loader.js +5 -4
- package/dist/atomix.css +138 -17
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +1 -1
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/webpack-loader.js +5 -4
- package/dist/charts.d.ts +23 -23
- package/dist/charts.js +40 -37
- package/dist/charts.js.map +1 -1
- package/dist/config.d.ts +699 -0
- package/dist/config.js +17 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +2 -2
- package/dist/core.js +111 -50
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +3 -6
- package/dist/forms.js +2 -2
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +173 -111
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +1881 -790
- package/dist/index.esm.js +2713 -816
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2693 -780
- 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.js +59 -60
- package/dist/layout.js.map +1 -1
- package/dist/theme.d.ts +1390 -276
- package/dist/theme.js +2133 -625
- package/dist/theme.js.map +1 -1
- package/package.json +14 -9
- package/scripts/atomix-cli.js +15 -1
- package/scripts/cli/__tests__/complexity-utils.test.js +24 -0
- package/scripts/cli/__tests__/detector.test.js +50 -0
- package/scripts/cli/__tests__/template-engine.test.js +23 -0
- package/scripts/cli/__tests__/test-setup.js +3 -0
- package/scripts/cli/commands/doctor.js +15 -3
- package/scripts/cli/commands/generate.js +113 -51
- package/scripts/cli/internal/ai-engine.js +30 -10
- package/scripts/cli/internal/complexity-utils.js +60 -0
- package/scripts/cli/internal/component-validator.js +49 -16
- package/scripts/cli/internal/config-loader.js +30 -20
- package/scripts/cli/internal/generator.js +89 -36
- package/scripts/cli/internal/hook-generator.js +5 -2
- package/scripts/cli/internal/itcss-generator.js +16 -12
- package/scripts/cli/templates/next-templates.js +81 -30
- package/scripts/cli/templates/storybook-templates.js +12 -2
- package/scripts/cli/utils/detector.js +45 -7
- package/scripts/cli/utils/diagnostics.js +78 -0
- package/scripts/cli/utils/telemetry.js +13 -0
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +1 -1
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +219 -0
- package/src/components/AtomixGlass/glass-utils.ts +1 -1
- package/src/components/Button/Button.tsx +114 -57
- package/src/components/Callout/Callout.tsx +4 -4
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +11 -8
- package/src/components/EdgePanel/EdgePanel.tsx +119 -115
- package/src/components/Form/Select.tsx +4 -4
- package/src/components/List/List.tsx +4 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +6 -6
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +4 -2
- package/src/components/Rating/Rating.tsx +4 -2
- package/src/components/SectionIntro/SectionIntro.tsx +4 -2
- package/src/components/Steps/Steps.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +5 -5
- package/src/components/Testimonial/Testimonial.tsx +4 -2
- package/src/components/VideoPlayer/VideoPlayer.tsx +4 -2
- package/src/layouts/CssGrid/CssGrid.stories.tsx +464 -0
- package/src/layouts/CssGrid/CssGrid.tsx +215 -0
- package/src/layouts/CssGrid/index.ts +8 -0
- package/src/layouts/CssGrid/scripts/CssGrid.js +284 -0
- package/src/layouts/CssGrid/scripts/index.js +43 -0
- package/src/layouts/Grid/scripts/Container.js +139 -0
- package/src/layouts/Grid/scripts/Grid.js +184 -0
- package/src/layouts/Grid/scripts/GridCol.js +273 -0
- package/src/layouts/Grid/scripts/Row.js +154 -0
- package/src/layouts/Grid/scripts/index.js +48 -0
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +71 -59
- package/src/lib/composables/atomix-glass/useGlassSize.ts +1 -1
- package/src/lib/composables/useAccordion.ts +5 -5
- package/src/lib/composables/useAtomixGlass.ts +3 -3
- package/src/lib/composables/useBarChart.ts +2 -2
- package/src/lib/composables/useChart.ts +3 -2
- package/src/lib/composables/useChartToolbar.ts +48 -66
- package/src/lib/composables/useDataTable.ts +1 -1
- package/src/lib/composables/useDatePicker.ts +2 -2
- package/src/lib/composables/useEdgePanel.ts +45 -54
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -5
- package/src/lib/composables/usePhotoViewer.ts +2 -3
- package/src/lib/composables/usePieChart.ts +1 -1
- package/src/lib/composables/usePopover.ts +151 -139
- package/src/lib/composables/useSideMenu.ts +28 -41
- package/src/lib/composables/useSlider.ts +2 -6
- package/src/lib/composables/useTooltip.ts +2 -2
- package/src/lib/config/index.ts +38 -323
- package/src/lib/config/loader.ts +419 -0
- package/src/lib/config/public-api.ts +43 -0
- package/src/lib/config/types.ts +389 -0
- package/src/lib/config/validator.ts +305 -0
- package/src/lib/theme/adapters/index.ts +1 -1
- package/src/lib/theme/adapters/themeAdapter.ts +358 -229
- package/src/lib/theme/components/ThemeToggle.tsx +276 -0
- package/src/lib/theme/config/configLoader.ts +351 -0
- package/src/lib/theme/config/loader.ts +221 -0
- package/src/lib/theme/core/createTheme.ts +126 -50
- package/src/lib/theme/core/createThemeObject.ts +7 -4
- package/src/lib/theme/devtools/Comparator.tsx +1 -1
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +1 -1
- package/src/lib/theme/hooks/useThemeSwitcher.ts +164 -0
- package/src/lib/theme/index.ts +322 -38
- package/src/lib/theme/runtime/ThemeProvider.tsx +45 -11
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +44 -393
- package/src/lib/theme/runtime/useTheme.ts +1 -0
- package/src/lib/theme/tokens/tokens.ts +101 -1
- package/src/lib/theme/types.ts +91 -0
- package/src/lib/theme/utils/performanceMonitor.ts +315 -0
- package/src/lib/theme/utils/responsive.ts +280 -0
- package/src/lib/theme/utils/themeUtils.ts +531 -117
- package/src/styles/01-settings/_index.scss +1 -0
- package/src/styles/01-settings/_settings.atomix-glass.scss +174 -0
- package/src/styles/01-settings/_settings.masonry-grid.scss +42 -6
- package/src/styles/02-tools/_tools.glass.scss +6 -0
- package/src/styles/05-objects/_objects.masonry-grid.scss +162 -24
- package/src/styles/06-components/_components.atomix-glass.scss +4 -4
- package/src/lib/composables/useBreadcrumb.ts +0 -81
- package/src/lib/composables/useChartInteractions.ts +0 -123
- package/src/lib/composables/useChartPerformance.ts +0 -347
- package/src/lib/composables/useDropdown.ts +0 -338
- package/src/lib/composables/useModal.ts +0 -110
- package/src/lib/hooks/usePerformanceMonitor.ts +0 -148
- package/src/lib/utils/displacement-generator.ts +0 -92
- package/src/lib/utils/memoryMonitor.ts +0 -191
- package/src/styles/01-settings/_settings.testtypecheck.scss +0 -53
- package/src/styles/01-settings/_settings.typedbutton.scss +0 -53
- package/src/styles/06-components/_components.testbutton.scss +0 -212
- package/src/styles/06-components/_components.testtypecheck.scss +0 -212
- package/src/styles/06-components/_components.typedbutton.scss +0 -212
|
@@ -8,20 +8,18 @@ import { SIDE_MENU } from '../constants/components';
|
|
|
8
8
|
* @returns SideMenu state and methods
|
|
9
9
|
*/
|
|
10
10
|
export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
11
|
+
const {
|
|
12
|
+
collapsible = true,
|
|
13
|
+
collapsibleDesktop = false,
|
|
14
|
+
defaultCollapsedDesktop = false,
|
|
15
|
+
isOpen,
|
|
16
|
+
onToggle,
|
|
17
|
+
disabled = false,
|
|
18
|
+
} = initialProps || {};
|
|
19
19
|
|
|
20
20
|
// Local open state for when not controlled externally
|
|
21
21
|
const [isOpenState, setIsOpenState] = useState(
|
|
22
|
-
|
|
23
|
-
? !defaultProps.defaultCollapsedDesktop
|
|
24
|
-
: defaultProps.isOpen || false
|
|
22
|
+
defaultCollapsedDesktop !== undefined ? !defaultCollapsedDesktop : isOpen || false
|
|
25
23
|
);
|
|
26
24
|
|
|
27
25
|
// Refs for managing responsive behavior
|
|
@@ -31,19 +29,18 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
31
29
|
|
|
32
30
|
// Update local state when external state changes
|
|
33
31
|
useEffect(() => {
|
|
34
|
-
if (typeof
|
|
35
|
-
setIsOpenState(
|
|
36
|
-
} else if (
|
|
37
|
-
setIsOpenState(!
|
|
32
|
+
if (typeof isOpen !== 'undefined') {
|
|
33
|
+
setIsOpenState(isOpen);
|
|
34
|
+
} else if (defaultCollapsedDesktop !== undefined) {
|
|
35
|
+
setIsOpenState(!defaultCollapsedDesktop);
|
|
38
36
|
}
|
|
39
|
-
}, [
|
|
37
|
+
}, [isOpen, defaultCollapsedDesktop]);
|
|
40
38
|
|
|
41
39
|
// Set initial height on mount
|
|
42
40
|
useEffect(() => {
|
|
43
41
|
const isMobile = window.innerWidth < 768;
|
|
44
|
-
const shouldCollapse = isMobile ?
|
|
45
|
-
const currentOpen =
|
|
46
|
-
typeof defaultProps.isOpen !== 'undefined' ? defaultProps.isOpen : isOpenState;
|
|
42
|
+
const shouldCollapse = isMobile ? collapsible : collapsibleDesktop;
|
|
43
|
+
const currentOpen = typeof isOpen !== 'undefined' ? isOpen : isOpenState;
|
|
47
44
|
|
|
48
45
|
if (shouldCollapse && wrapperRef.current && innerRef.current) {
|
|
49
46
|
// Use setTimeout to ensure DOM is fully rendered
|
|
@@ -62,13 +59,13 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
62
59
|
wrapperRef.current.style.height = 'auto';
|
|
63
60
|
}
|
|
64
61
|
return undefined;
|
|
65
|
-
}, []);
|
|
62
|
+
}, [collapsible, collapsibleDesktop, isOpen, isOpenState]);
|
|
66
63
|
|
|
67
64
|
// Handle responsive behavior - vertical collapse for both mobile and desktop
|
|
68
65
|
useEffect(() => {
|
|
69
66
|
const handleResize = () => {
|
|
70
67
|
const isMobile = window.innerWidth < 768; // MD breakpoint
|
|
71
|
-
const shouldCollapse = isMobile ?
|
|
68
|
+
const shouldCollapse = isMobile ? collapsible : collapsibleDesktop;
|
|
72
69
|
|
|
73
70
|
if (!shouldCollapse) {
|
|
74
71
|
// Not collapsible - always show content
|
|
@@ -77,8 +74,7 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
77
74
|
}
|
|
78
75
|
} else if (wrapperRef.current && innerRef.current) {
|
|
79
76
|
// Set proper height for vertical animation (both mobile and desktop)
|
|
80
|
-
const currentOpen =
|
|
81
|
-
typeof defaultProps.isOpen !== 'undefined' ? defaultProps.isOpen : isOpenState;
|
|
77
|
+
const currentOpen = typeof isOpen !== 'undefined' ? isOpen : isOpenState;
|
|
82
78
|
|
|
83
79
|
// Use requestAnimationFrame to ensure DOM is ready
|
|
84
80
|
requestAnimationFrame(() => {
|
|
@@ -101,22 +97,15 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
101
97
|
clearTimeout(timeoutId);
|
|
102
98
|
window.removeEventListener('resize', handleResize);
|
|
103
99
|
};
|
|
104
|
-
}, [
|
|
105
|
-
defaultProps.collapsible,
|
|
106
|
-
defaultProps.collapsibleDesktop,
|
|
107
|
-
defaultProps.isOpen,
|
|
108
|
-
defaultProps.onToggle,
|
|
109
|
-
isOpenState,
|
|
110
|
-
]);
|
|
100
|
+
}, [collapsible, collapsibleDesktop, isOpen, onToggle, isOpenState]);
|
|
111
101
|
|
|
112
102
|
// Update wrapper height when open state changes (both mobile and desktop)
|
|
113
103
|
useEffect(() => {
|
|
114
104
|
const isMobile = window.innerWidth < 768;
|
|
115
|
-
const shouldCollapse = isMobile ?
|
|
105
|
+
const shouldCollapse = isMobile ? collapsible : collapsibleDesktop;
|
|
116
106
|
|
|
117
107
|
if (shouldCollapse && wrapperRef.current && innerRef.current) {
|
|
118
|
-
const currentOpen =
|
|
119
|
-
typeof defaultProps.isOpen !== 'undefined' ? defaultProps.isOpen : isOpenState;
|
|
108
|
+
const currentOpen = typeof isOpen !== 'undefined' ? isOpen : isOpenState;
|
|
120
109
|
|
|
121
110
|
// Use requestAnimationFrame to ensure DOM is ready
|
|
122
111
|
requestAnimationFrame(() => {
|
|
@@ -132,7 +121,7 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
132
121
|
// Not collapsible - always show content
|
|
133
122
|
wrapperRef.current.style.height = 'auto';
|
|
134
123
|
}
|
|
135
|
-
}, [
|
|
124
|
+
}, [isOpen, isOpenState, collapsible, collapsibleDesktop]);
|
|
136
125
|
|
|
137
126
|
/**
|
|
138
127
|
* Generate side menu class based on properties
|
|
@@ -159,14 +148,13 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
159
148
|
* Handle toggle click (mobile)
|
|
160
149
|
*/
|
|
161
150
|
const handleToggle = () => {
|
|
162
|
-
if (
|
|
151
|
+
if (disabled) return;
|
|
163
152
|
|
|
164
|
-
const newState =
|
|
165
|
-
typeof defaultProps.isOpen !== 'undefined' ? !defaultProps.isOpen : !isOpenState;
|
|
153
|
+
const newState = typeof isOpen !== 'undefined' ? !isOpen : !isOpenState;
|
|
166
154
|
|
|
167
|
-
if (typeof
|
|
155
|
+
if (typeof onToggle === 'function') {
|
|
168
156
|
// Controlled component
|
|
169
|
-
|
|
157
|
+
onToggle(newState);
|
|
170
158
|
} else {
|
|
171
159
|
// Uncontrolled component
|
|
172
160
|
setIsOpenState(newState);
|
|
@@ -185,11 +173,10 @@ export function useSideMenu(initialProps?: Partial<SideMenuProps>) {
|
|
|
185
173
|
* @returns Current open state
|
|
186
174
|
*/
|
|
187
175
|
const getCurrentOpenState = (): boolean => {
|
|
188
|
-
return typeof
|
|
176
|
+
return typeof isOpen !== 'undefined' ? isOpen : isOpenState;
|
|
189
177
|
};
|
|
190
178
|
|
|
191
179
|
return {
|
|
192
|
-
defaultProps,
|
|
193
180
|
isOpenState: getCurrentOpenState(),
|
|
194
181
|
wrapperRef,
|
|
195
182
|
innerRef,
|
|
@@ -39,7 +39,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
39
39
|
onSlideChange,
|
|
40
40
|
} = options;
|
|
41
41
|
|
|
42
|
-
const slides = Array.isArray(rawSlides) ? rawSlides : [];
|
|
42
|
+
const slides = useMemo(() => (Array.isArray(rawSlides) ? rawSlides : []), [rawSlides]);
|
|
43
43
|
|
|
44
44
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
45
45
|
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -364,8 +364,6 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
364
364
|
isTransitioning,
|
|
365
365
|
speed,
|
|
366
366
|
onSlideChange,
|
|
367
|
-
allSlides.length,
|
|
368
|
-
loopedSlides,
|
|
369
367
|
autoplay,
|
|
370
368
|
]);
|
|
371
369
|
|
|
@@ -426,8 +424,6 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
426
424
|
isTransitioning,
|
|
427
425
|
speed,
|
|
428
426
|
onSlideChange,
|
|
429
|
-
allSlides.length,
|
|
430
|
-
loopedSlides,
|
|
431
427
|
autoplay,
|
|
432
428
|
]);
|
|
433
429
|
|
|
@@ -458,7 +454,7 @@ export function useSlider(options: UseSliderOptions): UseSliderReturn {
|
|
|
458
454
|
onSlideChange?.(index);
|
|
459
455
|
}, speed);
|
|
460
456
|
},
|
|
461
|
-
[realIndex, isTransitioning, speed, onSlideChange, loop,
|
|
457
|
+
[realIndex, isTransitioning, speed, onSlideChange, loop, slides.length, autoplay]
|
|
462
458
|
);
|
|
463
459
|
|
|
464
460
|
const handleTouchStart = useCallback(
|
|
@@ -28,8 +28,8 @@ interface UseTooltipResult {
|
|
|
28
28
|
isVisible: boolean;
|
|
29
29
|
isPositioned: boolean;
|
|
30
30
|
tooltipId: string;
|
|
31
|
-
triggerRef: RefObject<HTMLDivElement>;
|
|
32
|
-
tooltipRef: RefObject<HTMLDivElement>;
|
|
31
|
+
triggerRef: RefObject<HTMLDivElement | null>;
|
|
32
|
+
tooltipRef: RefObject<HTMLDivElement | null>;
|
|
33
33
|
tooltipStyle: React.CSSProperties;
|
|
34
34
|
arrowStyle: React.CSSProperties;
|
|
35
35
|
showTooltip: () => void;
|
package/src/lib/config/index.ts
CHANGED
|
@@ -5,328 +5,43 @@
|
|
|
5
5
|
*
|
|
6
6
|
* External developers can create `atomix.config.ts` in their project root
|
|
7
7
|
* to customize design tokens, similar to Tailwind's tailwind.config.js
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* // atomix.config.ts (in your project)
|
|
12
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
13
|
-
*
|
|
14
|
-
* export default defineConfig({
|
|
15
|
-
* theme: {
|
|
16
|
-
* extend: {
|
|
17
|
-
* colors: {
|
|
18
|
-
* primary: { main: '#7AFFD7' },
|
|
19
|
-
* },
|
|
20
|
-
* },
|
|
21
|
-
* },
|
|
22
|
-
* });
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
import type { Theme } from '../theme/types';
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Color Scale (1-10)
|
|
30
|
-
*/
|
|
31
|
-
export interface ColorScale {
|
|
32
|
-
1?: string;
|
|
33
|
-
2?: string;
|
|
34
|
-
3?: string;
|
|
35
|
-
4?: string;
|
|
36
|
-
5?: string;
|
|
37
|
-
6?: string;
|
|
38
|
-
7?: string;
|
|
39
|
-
8?: string;
|
|
40
|
-
9?: string;
|
|
41
|
-
10?: string;
|
|
42
|
-
[key: string]: string | undefined;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Palette Color Options
|
|
47
|
-
*/
|
|
48
|
-
export interface PaletteColorOptions {
|
|
49
|
-
main: string;
|
|
50
|
-
light?: string;
|
|
51
|
-
dark?: string;
|
|
52
|
-
contrastText?: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Design Tokens Schema (Tailwind-like)
|
|
57
|
-
*/
|
|
58
|
-
export interface ThemeTokens {
|
|
59
|
-
/** Color palette */
|
|
60
|
-
colors?: Record<string, string | PaletteColorOptions | ColorScale | Record<string, string>>;
|
|
61
|
-
/** Spacing scale */
|
|
62
|
-
spacing?: Record<string, string>;
|
|
63
|
-
/** Border radius scale */
|
|
64
|
-
borderRadius?: Record<string, string>;
|
|
65
|
-
/** Typography scale and settings */
|
|
66
|
-
typography?: {
|
|
67
|
-
fontFamilies?: Record<string, string>;
|
|
68
|
-
fontSizes?: Record<string, string>;
|
|
69
|
-
fontWeights?: Record<string, string | number>;
|
|
70
|
-
lineHeights?: Record<string, string | number>;
|
|
71
|
-
letterSpacings?: Record<string, string>;
|
|
72
|
-
};
|
|
73
|
-
/** Shadow scale */
|
|
74
|
-
shadows?: Record<string, string>;
|
|
75
|
-
/** Z-index scale */
|
|
76
|
-
zIndex?: Record<string, string | number>;
|
|
77
|
-
/** Breakpoints scale */
|
|
78
|
-
breakpoints?: Record<string, string | number>;
|
|
79
|
-
/** Transitions settings */
|
|
80
|
-
transitions?: {
|
|
81
|
-
durations?: Record<string, string>;
|
|
82
|
-
easings?: Record<string, string>;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* CSS Theme Definition
|
|
88
|
-
*/
|
|
89
|
-
export interface CSSThemeDefinition {
|
|
90
|
-
type: 'css';
|
|
91
|
-
name: string;
|
|
92
|
-
class?: string;
|
|
93
|
-
description?: string;
|
|
94
|
-
author?: string;
|
|
95
|
-
version?: string;
|
|
96
|
-
tags?: string[];
|
|
97
|
-
supportsDarkMode?: boolean;
|
|
98
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
99
|
-
a11y?: {
|
|
100
|
-
contrastTarget?: number;
|
|
101
|
-
modes?: string[];
|
|
102
|
-
};
|
|
103
|
-
color?: string;
|
|
104
|
-
features?: string[];
|
|
105
|
-
dependencies?: string[];
|
|
106
|
-
cssPath?: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* JavaScript Theme Definition
|
|
111
|
-
*/
|
|
112
|
-
export interface JSThemeDefinition {
|
|
113
|
-
type: 'js';
|
|
114
|
-
name: string;
|
|
115
|
-
class?: string;
|
|
116
|
-
description?: string;
|
|
117
|
-
author?: string;
|
|
118
|
-
version?: string;
|
|
119
|
-
tags?: string[];
|
|
120
|
-
supportsDarkMode?: boolean;
|
|
121
|
-
status?: 'stable' | 'beta' | 'experimental' | 'deprecated';
|
|
122
|
-
a11y?: {
|
|
123
|
-
contrastTarget?: number;
|
|
124
|
-
modes?: string[];
|
|
125
|
-
};
|
|
126
|
-
color?: string;
|
|
127
|
-
features?: string[];
|
|
128
|
-
dependencies?: string[];
|
|
129
|
-
createTheme: () => Theme;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Theme Definition (CSS or JS)
|
|
134
|
-
*/
|
|
135
|
-
export type ThemeDefinition = CSSThemeDefinition | JSThemeDefinition;
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Build configuration (migrated from theme.config.ts)
|
|
139
|
-
*/
|
|
140
|
-
export interface BuildConfig {
|
|
141
|
-
output?: {
|
|
142
|
-
directory?: string;
|
|
143
|
-
formats?: {
|
|
144
|
-
expanded?: string;
|
|
145
|
-
compressed?: string;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
sass?: {
|
|
149
|
-
style?: 'expanded' | 'compressed';
|
|
150
|
-
sourceMap?: boolean;
|
|
151
|
-
loadPaths?: string[];
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Runtime configuration (migrated from theme.config.ts)
|
|
157
|
-
*/
|
|
158
|
-
export interface RuntimeConfig {
|
|
159
|
-
basePath?: string;
|
|
160
|
-
cdnPath?: string | null;
|
|
161
|
-
preload?: string[];
|
|
162
|
-
lazy?: boolean;
|
|
163
|
-
defaultTheme?: string;
|
|
164
|
-
storageKey?: string;
|
|
165
|
-
dataAttribute?: string;
|
|
166
|
-
enablePersistence?: boolean;
|
|
167
|
-
useMinified?: boolean;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* Integration settings (migrated from theme.config.ts)
|
|
172
8
|
*/
|
|
173
|
-
export interface IntegrationConfig {
|
|
174
|
-
cssVariables?: Record<string, string>;
|
|
175
|
-
classNames?: {
|
|
176
|
-
theme?: string;
|
|
177
|
-
colorMode?: string;
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
9
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
type
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
* Change this to customize all CSS variable names.
|
|
220
|
-
* Example: prefix: 'myapp' → --myapp-primary instead of --atomix-primary
|
|
221
|
-
*/
|
|
222
|
-
prefix?: string;
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Plugins to extend CLI functionality
|
|
226
|
-
*/
|
|
227
|
-
plugins?: (string | PluginConfig)[];
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Universal Token Engine configuration
|
|
231
|
-
*/
|
|
232
|
-
tokenEngine?: TokenEngineConfig;
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* AI-Assisted Scaffolding configuration
|
|
236
|
-
*/
|
|
237
|
-
ai?: {
|
|
238
|
-
/** AI provider (default: 'openai') */
|
|
239
|
-
provider?: 'openai' | 'anthropic';
|
|
240
|
-
/** LLM model to use */
|
|
241
|
-
model?: string;
|
|
242
|
-
/** API key for the provider */
|
|
243
|
-
apiKey?: string;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Performance & Telemetry (Phase 4)
|
|
248
|
-
*/
|
|
249
|
-
telemetry?: {
|
|
250
|
-
/** Enable local telemetry logging (default: false) */
|
|
251
|
-
enabled?: boolean;
|
|
252
|
-
/** Output path for telemetry logs (default: '.atomix/telemetry.json') */
|
|
253
|
-
path?: string;
|
|
254
|
-
/** Anonymize telemetry data (default: true) */
|
|
255
|
-
anonymize?: boolean;
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Theme customization (Tailwind-like)
|
|
260
|
-
*
|
|
261
|
-
* Use `extend` to add or override design tokens.
|
|
262
|
-
* Use `tokens` to completely replace the default token system (advanced).
|
|
263
|
-
*/
|
|
264
|
-
theme?: {
|
|
265
|
-
/**
|
|
266
|
-
* Extend the default design tokens
|
|
267
|
-
*
|
|
268
|
-
* This is the recommended way to customize Atomix.
|
|
269
|
-
* Your values will override or extend the base tokens.
|
|
270
|
-
*/
|
|
271
|
-
extend?: ThemeTokens;
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Override the default tokens entirely (advanced)
|
|
275
|
-
*
|
|
276
|
-
* Use with caution - this replaces the entire token system.
|
|
277
|
-
* Most users should use `extend` instead.
|
|
278
|
-
*/
|
|
279
|
-
tokens?: ThemeTokens;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Register custom themes (optional)
|
|
283
|
-
*
|
|
284
|
-
* Define CSS or JavaScript themes that can be loaded dynamically.
|
|
285
|
-
*/
|
|
286
|
-
themes?: Record<string, ThemeDefinition>;
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
// Internal configurations (for library development only)
|
|
290
|
-
// These are not needed for external developers
|
|
291
|
-
/** @internal Build configuration (internal use only) */
|
|
292
|
-
build?: BuildConfig;
|
|
293
|
-
/** @internal Runtime configuration (internal use only) */
|
|
294
|
-
runtime?: RuntimeConfig;
|
|
295
|
-
/** @internal Integration settings (internal use only) */
|
|
296
|
-
integration?: IntegrationConfig;
|
|
297
|
-
/** @internal Theme dependencies mapping (internal use only) */
|
|
298
|
-
dependencies?: Record<string, string[]>;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Helper function to define Atomix configuration with type safety
|
|
303
|
-
*
|
|
304
|
-
* @param config - Atomix configuration object
|
|
305
|
-
* @returns The configuration object
|
|
306
|
-
*/
|
|
307
|
-
/**
|
|
308
|
-
* Helper function to define Atomix configuration with type safety
|
|
309
|
-
*
|
|
310
|
-
* Similar to Tailwind's defineConfig, provides autocomplete and type checking.
|
|
311
|
-
*
|
|
312
|
-
* @param config - Atomix configuration object
|
|
313
|
-
* @returns The configuration object
|
|
314
|
-
*
|
|
315
|
-
* @example
|
|
316
|
-
* ```typescript
|
|
317
|
-
* import { defineConfig } from '@shohojdhara/atomix/config';
|
|
318
|
-
*
|
|
319
|
-
* export default defineConfig({
|
|
320
|
-
* theme: {
|
|
321
|
-
* extend: {
|
|
322
|
-
* colors: {
|
|
323
|
-
* primary: { main: '#7AFFD7' },
|
|
324
|
-
* },
|
|
325
|
-
* },
|
|
326
|
-
* },
|
|
327
|
-
* });
|
|
328
|
-
* ```
|
|
329
|
-
*/
|
|
330
|
-
export function defineConfig(config: AtomixConfig): AtomixConfig {
|
|
331
|
-
return config;
|
|
332
|
-
}
|
|
10
|
+
export {
|
|
11
|
+
defineConfig,
|
|
12
|
+
type AtomixConfig,
|
|
13
|
+
type ThemeTokens,
|
|
14
|
+
type ThemeDefinition,
|
|
15
|
+
type CSSThemeDefinition,
|
|
16
|
+
type JSThemeDefinition,
|
|
17
|
+
type ColorScale,
|
|
18
|
+
type PaletteColorOptions,
|
|
19
|
+
type InteractiveEffectsConfig,
|
|
20
|
+
type OptimizationConfig,
|
|
21
|
+
type VisualPolishConfig,
|
|
22
|
+
type BuildConfig,
|
|
23
|
+
type RuntimeConfig,
|
|
24
|
+
type IntegrationConfig,
|
|
25
|
+
type PluginConfig,
|
|
26
|
+
type TokenProviderConfig,
|
|
27
|
+
type TokenEngineConfig,
|
|
28
|
+
type GeneratorConfig,
|
|
29
|
+
type DesignTokenCategory,
|
|
30
|
+
type DesignTokenValue
|
|
31
|
+
} from './types';
|
|
32
|
+
|
|
33
|
+
// Export the config loader functions
|
|
34
|
+
export {
|
|
35
|
+
loadAtomixConfig,
|
|
36
|
+
resolveConfigPath
|
|
37
|
+
} from './loader';
|
|
38
|
+
|
|
39
|
+
// Export the validator
|
|
40
|
+
export {
|
|
41
|
+
validateConfiguration,
|
|
42
|
+
printConfigReport,
|
|
43
|
+
type ValidationResult
|
|
44
|
+
} from './validator';
|
|
45
|
+
|
|
46
|
+
// Export convenience functions from the public API
|
|
47
|
+
export { loadConfig, validateConfig } from './public-api';
|