@shohojdhara/atomix 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atomix.css +9 -10
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15108 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6482 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3357 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2450 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4550 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5161 -4990
- package/dist/index.esm.js +1457 -784
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1473 -790
- 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 +1992 -0
- package/dist/theme.js +5348 -0
- package/dist/theme.js.map +1 -0
- package/package.json +66 -20
- 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.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -17
- package/src/components/Chart/AreaChart.tsx +5 -1
- package/src/components/Chart/BarChart.tsx +1 -0
- package/src/components/Chart/BubbleChart.tsx +6 -5
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/FunnelChart.tsx +1 -1
- package/src/components/Chart/RadarChart.tsx +19 -12
- package/src/components/Chart/ScatterChart.tsx +3 -3
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -1
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/List/List.stories.tsx +3 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Pagination/Pagination.tsx +6 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/index.ts +5 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- 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/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/loader.ts +55 -13
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +10 -14
- 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/composeTheme.ts +1 -1
- package/src/lib/theme/core/ThemeEngine.ts +8 -0
- package/src/lib/theme/core/ThemeValidator.ts +5 -2
- package/src/lib/theme/devtools/Inspector.tsx +1 -1
- package/src/lib/theme/devtools/LiveEditor.tsx +11 -5
- package/src/lib/theme/generateCSSVariables.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +2 -1
- package/src/lib/theme/runtime/ThemeApplicator.ts +28 -11
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +3 -3
- package/src/lib/theme/runtime/ThemeManager.ts +4 -0
- package/src/lib/theme-tools.ts +1 -1
- package/src/lib/types/components.ts +183 -34
- package/src/lib/types/partProps.ts +0 -16
- 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.fonts.scss +2 -5
- package/src/styles/03-generic/_generated-root.css +22 -1
- package/src/styles/06-components/_components.navbar.scss +0 -6
- package/src/themes/themes.config.js +37 -4
- package/scripts/build-themes.js +0 -208
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
package/scripts/atomix-cli.js
CHANGED
|
@@ -33,6 +33,14 @@ import {
|
|
|
33
33
|
importTokens
|
|
34
34
|
} from './cli/token-manager.js';
|
|
35
35
|
import { createThemeCLIBridge } from './cli/theme-bridge.js';
|
|
36
|
+
import {
|
|
37
|
+
validatePath,
|
|
38
|
+
validateComponentName,
|
|
39
|
+
validateThemeName,
|
|
40
|
+
sanitizeInput,
|
|
41
|
+
fileExists,
|
|
42
|
+
isDebug as checkDebugMode
|
|
43
|
+
} from './cli/utils.js';
|
|
36
44
|
|
|
37
45
|
const __filename = fileURLToPath(import.meta.url);
|
|
38
46
|
const __dirname = dirname(__filename);
|
|
@@ -771,20 +779,36 @@ program
|
|
|
771
779
|
debug(`Generating ${type} with name: ${name}`, options);
|
|
772
780
|
|
|
773
781
|
// Validate name
|
|
774
|
-
|
|
782
|
+
const nameValidation = validateComponentName(name);
|
|
783
|
+
if (!nameValidation.isValid) {
|
|
775
784
|
throw new AtomixCLIError(
|
|
776
|
-
|
|
785
|
+
nameValidation.error,
|
|
777
786
|
'INVALID_NAME',
|
|
778
787
|
[
|
|
779
788
|
'Use PascalCase naming (e.g., MyComponent)',
|
|
780
789
|
'Start with an uppercase letter',
|
|
781
|
-
'Use only letters and numbers'
|
|
790
|
+
'Use only letters and numbers',
|
|
791
|
+
'Avoid reserved words'
|
|
782
792
|
]
|
|
783
793
|
);
|
|
784
794
|
}
|
|
785
795
|
|
|
786
796
|
if (type === 'component' || type === 'c') {
|
|
787
|
-
|
|
797
|
+
// Validate output path
|
|
798
|
+
const pathValidation = validatePath(options.path);
|
|
799
|
+
if (!pathValidation.isValid) {
|
|
800
|
+
throw new AtomixCLIError(
|
|
801
|
+
pathValidation.error,
|
|
802
|
+
'INVALID_PATH',
|
|
803
|
+
[
|
|
804
|
+
'Ensure the path is within the project directory',
|
|
805
|
+
'Avoid using ".." to navigate outside the project',
|
|
806
|
+
'Check for typos in the path'
|
|
807
|
+
]
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
const componentPath = join(pathValidation.safePath, name);
|
|
788
812
|
|
|
789
813
|
// Check if component already exists
|
|
790
814
|
if (existsSync(componentPath) && !options.force) {
|
|
@@ -878,15 +902,103 @@ program
|
|
|
878
902
|
));
|
|
879
903
|
|
|
880
904
|
} else if (type === 'token' || type === 't') {
|
|
881
|
-
// Token generation
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
'
|
|
888
|
-
|
|
889
|
-
|
|
905
|
+
// Token generation
|
|
906
|
+
const validCategories = ['colors', 'spacing', 'typography', 'shadows', 'radius', 'animations'];
|
|
907
|
+
|
|
908
|
+
if (!validCategories.includes(name.toLowerCase())) {
|
|
909
|
+
throw new AtomixCLIError(
|
|
910
|
+
`Invalid token category: ${name}`,
|
|
911
|
+
'INVALID_TOKEN_CATEGORY',
|
|
912
|
+
[
|
|
913
|
+
`Valid categories: ${validCategories.join(', ')}`,
|
|
914
|
+
'Example: atomix generate token colors',
|
|
915
|
+
'Example: atomix g t spacing'
|
|
916
|
+
]
|
|
917
|
+
);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
const tokenPath = join(process.cwd(), 'src/styles/01-settings');
|
|
921
|
+
|
|
922
|
+
// Check if settings directory exists
|
|
923
|
+
if (!existsSync(tokenPath)) {
|
|
924
|
+
throw new AtomixCLIError(
|
|
925
|
+
'Settings directory not found',
|
|
926
|
+
'MISSING_DIRECTORY',
|
|
927
|
+
[
|
|
928
|
+
'Ensure you are in an Atomix project directory',
|
|
929
|
+
'Create the directory: mkdir -p src/styles/01-settings',
|
|
930
|
+
'Or initialize a new project: atomix init'
|
|
931
|
+
]
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
// Generate token file based on category
|
|
936
|
+
let tokenContent = '';
|
|
937
|
+
let filename = '';
|
|
938
|
+
|
|
939
|
+
switch (name.toLowerCase()) {
|
|
940
|
+
case 'colors':
|
|
941
|
+
filename = '_settings.colors.custom.scss';
|
|
942
|
+
tokenContent = generateColorTokens();
|
|
943
|
+
break;
|
|
944
|
+
case 'spacing':
|
|
945
|
+
filename = '_settings.spacing.custom.scss';
|
|
946
|
+
tokenContent = generateSpacingTokens();
|
|
947
|
+
break;
|
|
948
|
+
case 'typography':
|
|
949
|
+
filename = '_settings.typography.custom.scss';
|
|
950
|
+
tokenContent = generateTypographyTokens();
|
|
951
|
+
break;
|
|
952
|
+
case 'shadows':
|
|
953
|
+
filename = '_settings.box-shadow.custom.scss';
|
|
954
|
+
tokenContent = generateShadowTokens();
|
|
955
|
+
break;
|
|
956
|
+
case 'radius':
|
|
957
|
+
filename = '_settings.border-radius.custom.scss';
|
|
958
|
+
tokenContent = generateRadiusTokens();
|
|
959
|
+
break;
|
|
960
|
+
case 'animations':
|
|
961
|
+
filename = '_settings.animations.custom.scss';
|
|
962
|
+
tokenContent = generateAnimationTokens();
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
const filePath = join(tokenPath, filename);
|
|
967
|
+
|
|
968
|
+
// Check if file already exists
|
|
969
|
+
if (existsSync(filePath) && !options.force) {
|
|
970
|
+
throw new AtomixCLIError(
|
|
971
|
+
`Token file already exists: ${filename}`,
|
|
972
|
+
'FILE_EXISTS',
|
|
973
|
+
[
|
|
974
|
+
'Use --force flag to overwrite',
|
|
975
|
+
`Or edit the existing file: ${filePath}`,
|
|
976
|
+
'Or choose a different category'
|
|
977
|
+
]
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
// Write token file
|
|
982
|
+
await writeFile(filePath, tokenContent, 'utf8');
|
|
983
|
+
spinner.succeed(chalk.green(`✓ Created token file: ${filename}`));
|
|
984
|
+
|
|
985
|
+
// Success message
|
|
986
|
+
console.log(boxen(
|
|
987
|
+
chalk.bold.green(`🎨 ${name} tokens generated successfully!\n\n`) +
|
|
988
|
+
chalk.cyan('Next steps:\n') +
|
|
989
|
+
chalk.gray(`1. Customize your tokens:\n`) +
|
|
990
|
+
chalk.white(` Edit ${filePath}\n\n`) +
|
|
991
|
+
chalk.gray(`2. Import in your theme:\n`) +
|
|
992
|
+
chalk.white(` @use '${filename.replace('.scss', '')}' as *;\n\n`) +
|
|
993
|
+
chalk.gray(`3. Build your styles:\n`) +
|
|
994
|
+
chalk.white(` npm run build`),
|
|
995
|
+
{
|
|
996
|
+
padding: 1,
|
|
997
|
+
margin: 1,
|
|
998
|
+
borderStyle: 'round',
|
|
999
|
+
borderColor: 'green'
|
|
1000
|
+
}
|
|
1001
|
+
));
|
|
890
1002
|
} else {
|
|
891
1003
|
throw new AtomixCLIError(
|
|
892
1004
|
`Unknown generation type: ${type}`,
|
|
@@ -1421,14 +1533,16 @@ themeCommand
|
|
|
1421
1533
|
debug(`Creating theme: ${name}`, options);
|
|
1422
1534
|
|
|
1423
1535
|
// Validate name
|
|
1424
|
-
|
|
1536
|
+
const nameValidation = validateThemeName(name);
|
|
1537
|
+
if (!nameValidation.isValid) {
|
|
1425
1538
|
throw new AtomixCLIError(
|
|
1426
|
-
|
|
1539
|
+
nameValidation.error,
|
|
1427
1540
|
'INVALID_NAME',
|
|
1428
1541
|
[
|
|
1429
1542
|
'Use lowercase letters, numbers, and hyphens',
|
|
1430
1543
|
'Start with a letter',
|
|
1431
|
-
'Example: dark-theme, light-mode, custom-theme'
|
|
1544
|
+
'Example: dark-theme, light-mode, custom-theme',
|
|
1545
|
+
'Avoid consecutive or trailing hyphens'
|
|
1432
1546
|
]
|
|
1433
1547
|
);
|
|
1434
1548
|
}
|
|
@@ -1755,6 +1869,420 @@ program
|
|
|
1755
1869
|
}
|
|
1756
1870
|
});
|
|
1757
1871
|
|
|
1872
|
+
// Token generation functions
|
|
1873
|
+
function generateColorTokens() {
|
|
1874
|
+
return `// Custom Color Tokens
|
|
1875
|
+
// Generated by Atomix CLI
|
|
1876
|
+
// =============================================================================
|
|
1877
|
+
|
|
1878
|
+
// Brand Colors
|
|
1879
|
+
// Customize these to match your brand identity
|
|
1880
|
+
$custom-primary-1: #fff9e6 !default;
|
|
1881
|
+
$custom-primary-2: #fff4cc !default;
|
|
1882
|
+
$custom-primary-3: #ffe699 !default;
|
|
1883
|
+
$custom-primary-4: #ffd966 !default;
|
|
1884
|
+
$custom-primary-5: #ffcc33 !default;
|
|
1885
|
+
$custom-primary-6: #ffb800 !default; // Main brand color
|
|
1886
|
+
$custom-primary-7: #e6a600 !default;
|
|
1887
|
+
$custom-primary-8: #cc9400 !default;
|
|
1888
|
+
$custom-primary-9: #b38200 !default;
|
|
1889
|
+
$custom-primary-10: #997000 !default;
|
|
1890
|
+
|
|
1891
|
+
// Semantic Colors
|
|
1892
|
+
$custom-success: #22c55e !default;
|
|
1893
|
+
$custom-warning: #eab308 !default;
|
|
1894
|
+
$custom-error: #ef4444 !default;
|
|
1895
|
+
$custom-info: #3b82f6 !default;
|
|
1896
|
+
|
|
1897
|
+
// Neutral Colors
|
|
1898
|
+
$custom-gray-1: #f9fafb !default;
|
|
1899
|
+
$custom-gray-2: #f3f4f6 !default;
|
|
1900
|
+
$custom-gray-3: #e5e7eb !default;
|
|
1901
|
+
$custom-gray-4: #d1d5db !default;
|
|
1902
|
+
$custom-gray-5: #9ca3af !default;
|
|
1903
|
+
$custom-gray-6: #6b7280 !default;
|
|
1904
|
+
$custom-gray-7: #4b5563 !default;
|
|
1905
|
+
$custom-gray-8: #374151 !default;
|
|
1906
|
+
$custom-gray-9: #1f2937 !default;
|
|
1907
|
+
$custom-gray-10: #111827 !default;
|
|
1908
|
+
|
|
1909
|
+
// Background Colors
|
|
1910
|
+
$custom-body-bg: #ffffff !default;
|
|
1911
|
+
$custom-body-bg-dark: #1f2937 !default;
|
|
1912
|
+
|
|
1913
|
+
// Text Colors
|
|
1914
|
+
$custom-body-color: $custom-gray-10 !default;
|
|
1915
|
+
$custom-body-color-dark: #ffffff !default;
|
|
1916
|
+
|
|
1917
|
+
// Link Colors
|
|
1918
|
+
$custom-link-color: $custom-primary-6 !default;
|
|
1919
|
+
$custom-link-hover-color: $custom-primary-7 !default;
|
|
1920
|
+
|
|
1921
|
+
// Border Colors
|
|
1922
|
+
$custom-border-color: $custom-gray-3 !default;
|
|
1923
|
+
$custom-border-color-dark: $custom-gray-7 !default;
|
|
1924
|
+
|
|
1925
|
+
// Focus Colors
|
|
1926
|
+
$custom-focus-color: $custom-primary-5 !default;
|
|
1927
|
+
$custom-focus-color-dark: $custom-primary-4 !default;
|
|
1928
|
+
|
|
1929
|
+
// Export custom colors to override defaults
|
|
1930
|
+
$primary: $custom-primary-6 !default;
|
|
1931
|
+
$success: $custom-success !default;
|
|
1932
|
+
$warning: $custom-warning !default;
|
|
1933
|
+
$error: $custom-error !default;
|
|
1934
|
+
$info: $custom-info !default;
|
|
1935
|
+
|
|
1936
|
+
// Dark mode overrides
|
|
1937
|
+
$body-bg-dark: $custom-body-bg-dark !default;
|
|
1938
|
+
$body-color-dark: $custom-body-color-dark !default;
|
|
1939
|
+
$border-color-dark: $custom-border-color-dark !default;
|
|
1940
|
+
`;
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
function generateSpacingTokens() {
|
|
1944
|
+
return `// Custom Spacing Tokens
|
|
1945
|
+
// Generated by Atomix CLI
|
|
1946
|
+
// =============================================================================
|
|
1947
|
+
|
|
1948
|
+
// Base spacing unit (change this to scale all spacing)
|
|
1949
|
+
$custom-spacing-base: 0.25rem !default; // 4px
|
|
1950
|
+
|
|
1951
|
+
// Spacing scale
|
|
1952
|
+
$custom-spacing-0: 0 !default;
|
|
1953
|
+
$custom-spacing-1: $custom-spacing-base !default; // 4px
|
|
1954
|
+
$custom-spacing-2: calc($custom-spacing-base * 2) !default; // 8px
|
|
1955
|
+
$custom-spacing-3: calc($custom-spacing-base * 3) !default; // 12px
|
|
1956
|
+
$custom-spacing-4: calc($custom-spacing-base * 4) !default; // 16px
|
|
1957
|
+
$custom-spacing-5: calc($custom-spacing-base * 5) !default; // 20px
|
|
1958
|
+
$custom-spacing-6: calc($custom-spacing-base * 6) !default; // 24px
|
|
1959
|
+
$custom-spacing-7: calc($custom-spacing-base * 7) !default; // 28px
|
|
1960
|
+
$custom-spacing-8: calc($custom-spacing-base * 8) !default; // 32px
|
|
1961
|
+
$custom-spacing-9: calc($custom-spacing-base * 9) !default; // 36px
|
|
1962
|
+
$custom-spacing-10: calc($custom-spacing-base * 10) !default; // 40px
|
|
1963
|
+
$custom-spacing-11: calc($custom-spacing-base * 11) !default; // 44px
|
|
1964
|
+
$custom-spacing-12: calc($custom-spacing-base * 12) !default; // 48px
|
|
1965
|
+
$custom-spacing-14: calc($custom-spacing-base * 14) !default; // 56px
|
|
1966
|
+
$custom-spacing-16: calc($custom-spacing-base * 16) !default; // 64px
|
|
1967
|
+
$custom-spacing-20: calc($custom-spacing-base * 20) !default; // 80px
|
|
1968
|
+
$custom-spacing-24: calc($custom-spacing-base * 24) !default; // 96px
|
|
1969
|
+
$custom-spacing-28: calc($custom-spacing-base * 28) !default; // 112px
|
|
1970
|
+
$custom-spacing-32: calc($custom-spacing-base * 32) !default; // 128px
|
|
1971
|
+
$custom-spacing-36: calc($custom-spacing-base * 36) !default; // 144px
|
|
1972
|
+
$custom-spacing-40: calc($custom-spacing-base * 40) !default; // 160px
|
|
1973
|
+
$custom-spacing-44: calc($custom-spacing-base * 44) !default; // 176px
|
|
1974
|
+
$custom-spacing-48: calc($custom-spacing-base * 48) !default; // 192px
|
|
1975
|
+
$custom-spacing-52: calc($custom-spacing-base * 52) !default; // 208px
|
|
1976
|
+
$custom-spacing-56: calc($custom-spacing-base * 56) !default; // 224px
|
|
1977
|
+
$custom-spacing-60: calc($custom-spacing-base * 60) !default; // 240px
|
|
1978
|
+
$custom-spacing-64: calc($custom-spacing-base * 64) !default; // 256px
|
|
1979
|
+
|
|
1980
|
+
// Component-specific spacing
|
|
1981
|
+
$custom-button-padding-x: $custom-spacing-4 !default;
|
|
1982
|
+
$custom-button-padding-y: $custom-spacing-2 !default;
|
|
1983
|
+
$custom-card-padding: $custom-spacing-6 !default;
|
|
1984
|
+
$custom-modal-padding: $custom-spacing-8 !default;
|
|
1985
|
+
|
|
1986
|
+
// Layout spacing
|
|
1987
|
+
$custom-container-padding: $custom-spacing-4 !default;
|
|
1988
|
+
$custom-grid-gap: $custom-spacing-6 !default;
|
|
1989
|
+
$custom-section-spacing: $custom-spacing-16 !default;
|
|
1990
|
+
|
|
1991
|
+
// Export to override defaults
|
|
1992
|
+
$spacing-sizes: (
|
|
1993
|
+
0: $custom-spacing-0,
|
|
1994
|
+
1: $custom-spacing-1,
|
|
1995
|
+
2: $custom-spacing-2,
|
|
1996
|
+
3: $custom-spacing-3,
|
|
1997
|
+
4: $custom-spacing-4,
|
|
1998
|
+
5: $custom-spacing-5,
|
|
1999
|
+
6: $custom-spacing-6,
|
|
2000
|
+
7: $custom-spacing-7,
|
|
2001
|
+
8: $custom-spacing-8,
|
|
2002
|
+
9: $custom-spacing-9,
|
|
2003
|
+
10: $custom-spacing-10,
|
|
2004
|
+
12: $custom-spacing-12,
|
|
2005
|
+
16: $custom-spacing-16,
|
|
2006
|
+
20: $custom-spacing-20,
|
|
2007
|
+
24: $custom-spacing-24,
|
|
2008
|
+
32: $custom-spacing-32,
|
|
2009
|
+
40: $custom-spacing-40,
|
|
2010
|
+
48: $custom-spacing-48,
|
|
2011
|
+
56: $custom-spacing-56,
|
|
2012
|
+
64: $custom-spacing-64,
|
|
2013
|
+
) !default;
|
|
2014
|
+
`;
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
function generateTypographyTokens() {
|
|
2018
|
+
return `// Custom Typography Tokens
|
|
2019
|
+
// Generated by Atomix CLI
|
|
2020
|
+
// =============================================================================
|
|
2021
|
+
|
|
2022
|
+
// Font Families
|
|
2023
|
+
$custom-font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default;
|
|
2024
|
+
$custom-font-family-serif: Georgia, "Times New Roman", Times, serif !default;
|
|
2025
|
+
$custom-font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
|
|
2026
|
+
|
|
2027
|
+
// Font Size Scale
|
|
2028
|
+
$custom-font-size-xs: 0.75rem !default; // 12px
|
|
2029
|
+
$custom-font-size-sm: 0.875rem !default; // 14px
|
|
2030
|
+
$custom-font-size-base: 1rem !default; // 16px
|
|
2031
|
+
$custom-font-size-lg: 1.125rem !default; // 18px
|
|
2032
|
+
$custom-font-size-xl: 1.25rem !default; // 20px
|
|
2033
|
+
$custom-font-size-2xl: 1.5rem !default; // 24px
|
|
2034
|
+
$custom-font-size-3xl: 1.875rem !default; // 30px
|
|
2035
|
+
$custom-font-size-4xl: 2.25rem !default; // 36px
|
|
2036
|
+
$custom-font-size-5xl: 3rem !default; // 48px
|
|
2037
|
+
$custom-font-size-6xl: 3.75rem !default; // 60px
|
|
2038
|
+
$custom-font-size-7xl: 4.5rem !default; // 72px
|
|
2039
|
+
$custom-font-size-8xl: 6rem !default; // 96px
|
|
2040
|
+
|
|
2041
|
+
// Line Heights
|
|
2042
|
+
$custom-line-height-tight: 1.2 !default;
|
|
2043
|
+
$custom-line-height-base: 1.5 !default;
|
|
2044
|
+
$custom-line-height-relaxed: 1.75 !default;
|
|
2045
|
+
$custom-line-height-loose: 2 !default;
|
|
2046
|
+
|
|
2047
|
+
// Font Weights
|
|
2048
|
+
$custom-font-weight-light: 300 !default;
|
|
2049
|
+
$custom-font-weight-normal: 400 !default;
|
|
2050
|
+
$custom-font-weight-medium: 500 !default;
|
|
2051
|
+
$custom-font-weight-semibold: 600 !default;
|
|
2052
|
+
$custom-font-weight-bold: 700 !default;
|
|
2053
|
+
$custom-font-weight-heavy: 800 !default;
|
|
2054
|
+
$custom-font-weight-black: 900 !default;
|
|
2055
|
+
|
|
2056
|
+
// Letter Spacing
|
|
2057
|
+
$custom-letter-spacing-tight: -0.05em !default;
|
|
2058
|
+
$custom-letter-spacing-normal: 0 !default;
|
|
2059
|
+
$custom-letter-spacing-wide: 0.025em !default;
|
|
2060
|
+
$custom-letter-spacing-wider: 0.05em !default;
|
|
2061
|
+
$custom-letter-spacing-widest: 0.1em !default;
|
|
2062
|
+
|
|
2063
|
+
// Heading Sizes
|
|
2064
|
+
$custom-h1-font-size: $custom-font-size-5xl !default;
|
|
2065
|
+
$custom-h2-font-size: $custom-font-size-4xl !default;
|
|
2066
|
+
$custom-h3-font-size: $custom-font-size-3xl !default;
|
|
2067
|
+
$custom-h4-font-size: $custom-font-size-2xl !default;
|
|
2068
|
+
$custom-h5-font-size: $custom-font-size-xl !default;
|
|
2069
|
+
$custom-h6-font-size: $custom-font-size-lg !default;
|
|
2070
|
+
|
|
2071
|
+
// Export to override defaults
|
|
2072
|
+
$font-family-base: $custom-font-family-sans !default;
|
|
2073
|
+
$font-family-monospace: $custom-font-family-mono !default;
|
|
2074
|
+
$font-size-base: $custom-font-size-base !default;
|
|
2075
|
+
$font-size-sm: $custom-font-size-sm !default;
|
|
2076
|
+
$font-size-lg: $custom-font-size-lg !default;
|
|
2077
|
+
$line-height-base: $custom-line-height-base !default;
|
|
2078
|
+
$font-weight-base: $custom-font-weight-normal !default;
|
|
2079
|
+
|
|
2080
|
+
// Heading overrides
|
|
2081
|
+
$h1-font-size: $custom-h1-font-size !default;
|
|
2082
|
+
$h2-font-size: $custom-h2-font-size !default;
|
|
2083
|
+
$h3-font-size: $custom-h3-font-size !default;
|
|
2084
|
+
$h4-font-size: $custom-h4-font-size !default;
|
|
2085
|
+
$h5-font-size: $custom-h5-font-size !default;
|
|
2086
|
+
$h6-font-size: $custom-h6-font-size !default;
|
|
2087
|
+
`;
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
function generateShadowTokens() {
|
|
2091
|
+
return `// Custom Box Shadow Tokens
|
|
2092
|
+
// Generated by Atomix CLI
|
|
2093
|
+
// =============================================================================
|
|
2094
|
+
|
|
2095
|
+
// Shadow Colors
|
|
2096
|
+
$custom-shadow-color: rgba(0, 0, 0, 0.1) !default;
|
|
2097
|
+
$custom-shadow-color-dark: rgba(0, 0, 0, 0.2) !default;
|
|
2098
|
+
|
|
2099
|
+
// Shadow Sizes
|
|
2100
|
+
$custom-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !default;
|
|
2101
|
+
$custom-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !default;
|
|
2102
|
+
$custom-shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !default;
|
|
2103
|
+
$custom-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !default;
|
|
2104
|
+
$custom-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !default;
|
|
2105
|
+
$custom-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !default;
|
|
2106
|
+
$custom-shadow-2xl: 0 35px 60px -15px rgba(0, 0, 0, 0.3) !default;
|
|
2107
|
+
$custom-shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06) !default;
|
|
2108
|
+
$custom-shadow-none: none !default;
|
|
2109
|
+
|
|
2110
|
+
// Component-specific shadows
|
|
2111
|
+
$custom-button-shadow: $custom-shadow-sm !default;
|
|
2112
|
+
$custom-button-shadow-hover: $custom-shadow-md !default;
|
|
2113
|
+
$custom-card-shadow: $custom-shadow-base !default;
|
|
2114
|
+
$custom-dropdown-shadow: $custom-shadow-lg !default;
|
|
2115
|
+
$custom-modal-shadow: $custom-shadow-xl !default;
|
|
2116
|
+
$custom-popover-shadow: $custom-shadow-lg !default;
|
|
2117
|
+
$custom-tooltip-shadow: $custom-shadow-md !default;
|
|
2118
|
+
|
|
2119
|
+
// Dark mode shadows
|
|
2120
|
+
$custom-shadow-xs-dark: 0 1px 2px 0 rgba(0, 0, 0, 0.3) !default;
|
|
2121
|
+
$custom-shadow-sm-dark: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3) !default;
|
|
2122
|
+
$custom-shadow-base-dark: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !default;
|
|
2123
|
+
$custom-shadow-lg-dark: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4) !default;
|
|
2124
|
+
$custom-shadow-xl-dark: 0 25px 50px -12px rgba(0, 0, 0, 0.6) !default;
|
|
2125
|
+
|
|
2126
|
+
// Export to override defaults
|
|
2127
|
+
$box-shadow: $custom-shadow-base !default;
|
|
2128
|
+
$box-shadow-xs: $custom-shadow-xs !default;
|
|
2129
|
+
$box-shadow-sm: $custom-shadow-sm !default;
|
|
2130
|
+
$box-shadow-lg: $custom-shadow-lg !default;
|
|
2131
|
+
$box-shadow-xl: $custom-shadow-xl !default;
|
|
2132
|
+
$box-shadow-inset: $custom-shadow-inner !default;
|
|
2133
|
+
|
|
2134
|
+
// Dark mode exports
|
|
2135
|
+
$box-shadow-dark: $custom-shadow-base-dark !default;
|
|
2136
|
+
$box-shadow-xs-dark: $custom-shadow-xs-dark !default;
|
|
2137
|
+
$box-shadow-sm-dark: $custom-shadow-sm-dark !default;
|
|
2138
|
+
$box-shadow-lg-dark: $custom-shadow-lg-dark !default;
|
|
2139
|
+
$box-shadow-xl-dark: $custom-shadow-xl-dark !default;
|
|
2140
|
+
`;
|
|
2141
|
+
}
|
|
2142
|
+
|
|
2143
|
+
function generateRadiusTokens() {
|
|
2144
|
+
return `// Custom Border Radius Tokens
|
|
2145
|
+
// Generated by Atomix CLI
|
|
2146
|
+
// =============================================================================
|
|
2147
|
+
|
|
2148
|
+
// Base radius unit
|
|
2149
|
+
$custom-radius-base: 0.25rem !default; // 4px
|
|
2150
|
+
|
|
2151
|
+
// Radius Scale
|
|
2152
|
+
$custom-radius-none: 0 !default;
|
|
2153
|
+
$custom-radius-sm: calc($custom-radius-base * 0.5) !default; // 2px
|
|
2154
|
+
$custom-radius-base: $custom-radius-base !default; // 4px
|
|
2155
|
+
$custom-radius-md: calc($custom-radius-base * 1.5) !default; // 6px
|
|
2156
|
+
$custom-radius-lg: calc($custom-radius-base * 2) !default; // 8px
|
|
2157
|
+
$custom-radius-xl: calc($custom-radius-base * 3) !default; // 12px
|
|
2158
|
+
$custom-radius-2xl: calc($custom-radius-base * 4) !default; // 16px
|
|
2159
|
+
$custom-radius-3xl: calc($custom-radius-base * 6) !default; // 24px
|
|
2160
|
+
$custom-radius-4xl: calc($custom-radius-base * 8) !default; // 32px
|
|
2161
|
+
$custom-radius-full: 9999px !default; // Fully rounded
|
|
2162
|
+
|
|
2163
|
+
// Component-specific radius
|
|
2164
|
+
$custom-button-radius: $custom-radius-md !default;
|
|
2165
|
+
$custom-button-radius-sm: $custom-radius-sm !default;
|
|
2166
|
+
$custom-button-radius-lg: $custom-radius-lg !default;
|
|
2167
|
+
$custom-card-radius: $custom-radius-lg !default;
|
|
2168
|
+
$custom-input-radius: $custom-radius-md !default;
|
|
2169
|
+
$custom-badge-radius: $custom-radius-full !default;
|
|
2170
|
+
$custom-chip-radius: $custom-radius-full !default;
|
|
2171
|
+
$custom-tooltip-radius: $custom-radius-md !default;
|
|
2172
|
+
$custom-modal-radius: $custom-radius-xl !default;
|
|
2173
|
+
$custom-dropdown-radius: $custom-radius-lg !default;
|
|
2174
|
+
|
|
2175
|
+
// Export to override defaults
|
|
2176
|
+
$border-radius: $custom-radius-md !default;
|
|
2177
|
+
$border-radius-sm: $custom-radius-sm !default;
|
|
2178
|
+
$border-radius-lg: $custom-radius-lg !default;
|
|
2179
|
+
$border-radius-xl: $custom-radius-xl !default;
|
|
2180
|
+
$border-radius-xxl: $custom-radius-2xl !default;
|
|
2181
|
+
$border-radius-3xl: $custom-radius-3xl !default;
|
|
2182
|
+
$border-radius-4xl: $custom-radius-4xl !default;
|
|
2183
|
+
$border-radius-pill: $custom-radius-full !default;
|
|
2184
|
+
|
|
2185
|
+
// Component radius exports
|
|
2186
|
+
$btn-border-radius: $custom-button-radius !default;
|
|
2187
|
+
$btn-border-radius-sm: $custom-button-radius-sm !default;
|
|
2188
|
+
$btn-border-radius-lg: $custom-button-radius-lg !default;
|
|
2189
|
+
$card-border-radius: $custom-card-radius !default;
|
|
2190
|
+
$input-border-radius: $custom-input-radius !default;
|
|
2191
|
+
$badge-border-radius: $custom-badge-radius !default;
|
|
2192
|
+
`;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
function generateAnimationTokens() {
|
|
2196
|
+
return `// Custom Animation Tokens
|
|
2197
|
+
// Generated by Atomix CLI
|
|
2198
|
+
// =============================================================================
|
|
2199
|
+
|
|
2200
|
+
// Transition Durations
|
|
2201
|
+
$custom-duration-instant: 0s !default;
|
|
2202
|
+
$custom-duration-fast: 0.15s !default;
|
|
2203
|
+
$custom-duration-base: 0.3s !default;
|
|
2204
|
+
$custom-duration-slow: 0.5s !default;
|
|
2205
|
+
$custom-duration-slower: 0.7s !default;
|
|
2206
|
+
$custom-duration-slowest: 1s !default;
|
|
2207
|
+
|
|
2208
|
+
// Easing Functions
|
|
2209
|
+
$custom-ease-linear: linear !default;
|
|
2210
|
+
$custom-ease-in: cubic-bezier(0.4, 0, 1, 1) !default;
|
|
2211
|
+
$custom-ease-out: cubic-bezier(0, 0, 0.2, 1) !default;
|
|
2212
|
+
$custom-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1) !default;
|
|
2213
|
+
$custom-ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55) !default;
|
|
2214
|
+
$custom-ease-smooth: cubic-bezier(0.23, 1, 0.32, 1) !default;
|
|
2215
|
+
|
|
2216
|
+
// Transition Properties
|
|
2217
|
+
$custom-transition-all: all $custom-duration-base $custom-ease-smooth !default;
|
|
2218
|
+
$custom-transition-colors: background-color $custom-duration-base $custom-ease-smooth,
|
|
2219
|
+
border-color $custom-duration-base $custom-ease-smooth,
|
|
2220
|
+
color $custom-duration-base $custom-ease-smooth,
|
|
2221
|
+
fill $custom-duration-base $custom-ease-smooth,
|
|
2222
|
+
stroke $custom-duration-base $custom-ease-smooth !default;
|
|
2223
|
+
$custom-transition-opacity: opacity $custom-duration-base $custom-ease-smooth !default;
|
|
2224
|
+
$custom-transition-shadow: box-shadow $custom-duration-base $custom-ease-smooth !default;
|
|
2225
|
+
$custom-transition-transform: transform $custom-duration-base $custom-ease-smooth !default;
|
|
2226
|
+
|
|
2227
|
+
// Component-specific transitions
|
|
2228
|
+
$custom-button-transition: $custom-transition-colors, $custom-transition-shadow, $custom-transition-transform !default;
|
|
2229
|
+
$custom-link-transition: $custom-transition-colors, text-decoration-color $custom-duration-base $custom-ease-smooth !default;
|
|
2230
|
+
$custom-input-transition: $custom-transition-colors, $custom-transition-shadow !default;
|
|
2231
|
+
$custom-card-transition: $custom-transition-shadow, $custom-transition-transform !default;
|
|
2232
|
+
$custom-modal-transition: $custom-transition-opacity, $custom-transition-transform !default;
|
|
2233
|
+
$custom-dropdown-transition: $custom-transition-opacity, $custom-transition-transform !default;
|
|
2234
|
+
|
|
2235
|
+
// Animation Keyframes (examples)
|
|
2236
|
+
@keyframes custom-fade-in {
|
|
2237
|
+
from { opacity: 0; }
|
|
2238
|
+
to { opacity: 1; }
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
@keyframes custom-slide-in-up {
|
|
2242
|
+
from {
|
|
2243
|
+
transform: translateY(10px);
|
|
2244
|
+
opacity: 0;
|
|
2245
|
+
}
|
|
2246
|
+
to {
|
|
2247
|
+
transform: translateY(0);
|
|
2248
|
+
opacity: 1;
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
@keyframes custom-scale-in {
|
|
2253
|
+
from {
|
|
2254
|
+
transform: scale(0.95);
|
|
2255
|
+
opacity: 0;
|
|
2256
|
+
}
|
|
2257
|
+
to {
|
|
2258
|
+
transform: scale(1);
|
|
2259
|
+
opacity: 1;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
@keyframes custom-spin {
|
|
2264
|
+
from { transform: rotate(0deg); }
|
|
2265
|
+
to { transform: rotate(360deg); }
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
// Export to override defaults
|
|
2269
|
+
$transition-fast: $custom-transition-all !default;
|
|
2270
|
+
$transition-base: $custom-transition-all !default;
|
|
2271
|
+
$transition-slow: all $custom-duration-slow $custom-ease-smooth !default;
|
|
2272
|
+
|
|
2273
|
+
// Duration exports
|
|
2274
|
+
$transition-duration-fast: $custom-duration-fast !default;
|
|
2275
|
+
$transition-duration-base: $custom-duration-base !default;
|
|
2276
|
+
$transition-duration-slow: $custom-duration-slow !default;
|
|
2277
|
+
|
|
2278
|
+
// Easing exports
|
|
2279
|
+
$easing-base: $custom-ease-smooth !default;
|
|
2280
|
+
$easing-ease-in-out: $custom-ease-in-out !default;
|
|
2281
|
+
$easing-ease-out: $custom-ease-out !default;
|
|
2282
|
+
$easing-ease-in: $custom-ease-in !default;
|
|
2283
|
+
`;
|
|
2284
|
+
}
|
|
2285
|
+
|
|
1758
2286
|
// Parse arguments
|
|
1759
2287
|
program.parse(process.argv);
|
|
1760
2288
|
|