@shohojdhara/atomix 0.3.5 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -199
- package/atomix.config.ts +241 -0
- package/dist/atomix.css +260 -179
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +250 -179
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.js +69 -166
- package/dist/charts.js.map +1 -1
- package/dist/core.js +184 -263
- package/dist/core.js.map +1 -1
- package/dist/forms.js +55 -131
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +184 -263
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +1831 -1657
- package/dist/index.esm.js +4497 -4318
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4510 -4328
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/theme.d.ts +1431 -1472
- package/dist/theme.js +4175 -4138
- package/dist/theme.js.map +1 -1
- package/package.json +6 -20
- package/src/components/Accordion/Accordion.stories.tsx +50 -17
- package/src/components/AtomixGlass/AtomixGlass.tsx +128 -322
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +12 -5
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Badge/Badge.stories.tsx +91 -13
- package/src/components/Block/Block.stories.tsx +7 -23
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
- package/src/components/Button/Button.stories.tsx +141 -22
- package/src/components/Button/Button.tsx +85 -167
- package/src/components/Button/ButtonGroup.stories.tsx +315 -0
- package/src/components/Button/ButtonGroup.tsx +67 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Callout/Callout.stories.tsx +8 -6
- package/src/components/Card/Card.stories.tsx +82 -28
- package/src/components/Chart/AnimatedChart.tsx +0 -1
- package/src/components/Chart/AreaChart.tsx +0 -1
- package/src/components/Chart/BarChart.tsx +0 -1
- package/src/components/Chart/BubbleChart.tsx +0 -1
- package/src/components/Chart/CandlestickChart.tsx +0 -1
- package/src/components/Chart/Chart.stories.tsx +5 -7
- package/src/components/Chart/Chart.tsx +0 -16
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/DonutChart.tsx +0 -1
- package/src/components/Chart/FunnelChart.tsx +0 -1
- package/src/components/Chart/GaugeChart.tsx +0 -1
- package/src/components/Chart/HeatmapChart.tsx +0 -1
- package/src/components/Chart/LineChart.tsx +0 -1
- package/src/components/Chart/MultiAxisChart.tsx +0 -1
- package/src/components/Chart/PieChart.tsx +0 -1
- package/src/components/Chart/RadarChart.tsx +0 -1
- package/src/components/Chart/ScatterChart.tsx +0 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -1
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
- package/src/components/DataTable/DataTable.stories.tsx +23 -16
- package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
- package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
- package/src/components/Footer/Footer.stories.tsx +8 -6
- package/src/components/Footer/FooterLink.tsx +9 -2
- package/src/components/Form/Checkbox.stories.tsx +7 -0
- package/src/components/Form/Form.stories.tsx +7 -0
- package/src/components/Form/FormGroup.stories.tsx +9 -1
- package/src/components/Form/Input.stories.tsx +69 -16
- package/src/components/Form/Radio.stories.tsx +9 -1
- package/src/components/Form/Select.stories.tsx +9 -1
- package/src/components/Form/Textarea.stories.tsx +10 -2
- package/src/components/Hero/Hero.stories.tsx +7 -0
- package/src/components/List/List.stories.tsx +7 -0
- package/src/components/Messages/Messages.stories.tsx +8 -7
- package/src/components/Modal/Modal.stories.tsx +17 -6
- package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
- package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +188 -111
- package/src/components/Pagination/Pagination.tsx +83 -3
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
- package/src/components/Popover/Popover.stories.tsx +191 -115
- package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
- package/src/components/Progress/Progress.stories.tsx +79 -49
- package/src/components/Rating/Rating.stories.tsx +109 -84
- package/src/components/River/River.stories.tsx +194 -114
- package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
- package/src/components/Slider/Slider.stories.tsx +7 -0
- package/src/components/Spinner/Spinner.stories.tsx +15 -11
- package/src/components/Steps/Steps.stories.tsx +132 -98
- package/src/components/Tabs/Tabs.stories.tsx +163 -112
- package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
- package/src/components/Todo/Todo.stories.tsx +38 -12
- package/src/components/Toggle/Toggle.stories.tsx +61 -28
- package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
- package/src/components/Upload/Upload.stories.tsx +122 -84
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
- package/src/components/index.ts +1 -0
- package/src/lib/composables/useAtomixGlass.ts +9 -10
- package/src/lib/composables/useNavbar.ts +0 -10
- package/src/lib/config/loader.ts +4 -4
- package/src/lib/constants/components.ts +17 -0
- package/src/lib/hooks/useComponentCustomization.ts +1 -1
- package/src/lib/hooks/usePerformanceMonitor.ts +1 -1
- package/src/lib/hooks/useThemeTokens.ts +105 -0
- package/src/lib/theme/README.md +174 -0
- package/src/lib/theme/adapters/index.ts +31 -0
- package/src/lib/theme/adapters/themeAdapter.ts +287 -0
- package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
- package/src/lib/theme/config/configLoader.ts +95 -0
- package/src/lib/theme/config/loader.ts +37 -54
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +15 -91
- package/src/lib/theme/{constants.ts → constants/constants.ts} +1 -19
- package/src/lib/theme/constants/index.ts +8 -0
- package/src/lib/theme/core/ThemeRegistry.ts +75 -266
- package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
- package/src/lib/theme/core/composeTheme.ts +105 -0
- package/src/lib/theme/core/createTheme.ts +108 -0
- package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +12 -8
- package/src/lib/theme/core/index.ts +19 -19
- package/src/lib/theme/devtools/Comparator.tsx +346 -22
- package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
- package/src/lib/theme/devtools/Inspector.tsx +335 -51
- package/src/lib/theme/devtools/LiveEditor.tsx +478 -107
- package/src/lib/theme/devtools/Preview.tsx +471 -221
- package/src/lib/theme/{core → devtools}/ThemeValidator.ts +1 -1
- package/src/lib/theme/devtools/index.ts +14 -4
- package/src/lib/theme/devtools/useHistory.ts +130 -0
- package/src/lib/theme/{errors.ts → errors/errors.ts} +1 -1
- package/src/lib/theme/errors/index.ts +12 -0
- package/src/lib/theme/generators/cssFile.ts +79 -0
- package/src/lib/theme/generators/generateCSS.ts +89 -0
- package/src/lib/theme/generators/generateCSSNested.ts +130 -0
- package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +3 -13
- package/src/lib/theme/generators/index.ts +25 -0
- package/src/lib/theme/i18n/rtl.ts +5 -6
- package/src/lib/theme/index.ts +149 -19
- package/src/lib/theme/runtime/ThemeApplicator.ts +53 -112
- package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +5 -5
- package/src/lib/theme/runtime/ThemeProvider.tsx +266 -282
- package/src/lib/theme/runtime/index.ts +2 -2
- package/src/lib/theme/runtime/useTheme.ts +1 -2
- package/src/lib/theme/runtime/useThemeTokens.ts +131 -0
- package/src/lib/theme/test/testTheme.ts +385 -0
- package/src/lib/theme/tokens/index.ts +12 -0
- package/src/lib/theme/tokens/tokens.ts +721 -0
- package/src/lib/theme/types.ts +6 -42
- package/src/lib/theme/utils/componentTheming.ts +132 -0
- package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
- package/src/lib/theme/utils/index.ts +11 -0
- package/src/lib/theme/utils/injectCSS.ts +90 -0
- package/src/lib/theme/utils/naming.ts +100 -0
- package/src/lib/theme/utils/themeHelpers.ts +78 -0
- package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +7 -7
- package/src/lib/theme-tools.ts +7 -8
- package/src/lib/types/components.ts +40 -130
- package/src/lib/utils/componentUtils.ts +2 -2
- package/src/lib/utils/memoryMonitor.ts +3 -3
- package/src/lib/utils/themeNaming.ts +135 -0
- package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
- package/src/styles/02-tools/_tools.button.scss +66 -79
- package/src/styles/06-components/_components.atomix-glass.scss +13 -3
- package/src/styles/06-components/_components.pagination.scss +88 -0
- package/scripts/sync-theme-config.js +0 -309
- package/src/lib/theme/composeTheme.ts +0 -370
- package/src/lib/theme/core/ThemeCache.ts +0 -283
- package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
- package/src/lib/theme/core/ThemeEngine.ts +0 -665
- package/src/lib/theme/createThemeFromConfig.ts +0 -132
- package/src/lib/theme/devtools/CLI.ts +0 -364
- package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
- package/src/lib/theme/runtime/ThemeManager.ts +0 -446
- package/src/styles/03-generic/_generated-root.css +0 -26
- package/src/themes/README.md +0 -442
- package/src/themes/themes.config.js +0 -68
- /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
|
@@ -560,6 +560,36 @@ export interface ButtonProps extends BaseComponentProps {
|
|
|
560
560
|
style?: React.CSSProperties;
|
|
561
561
|
}
|
|
562
562
|
|
|
563
|
+
/**
|
|
564
|
+
* ButtonGroup component properties
|
|
565
|
+
*/
|
|
566
|
+
export interface ButtonGroupProps extends BaseComponentProps {
|
|
567
|
+
/**
|
|
568
|
+
* ButtonGroup children (should be Button components)
|
|
569
|
+
*/
|
|
570
|
+
children?: ReactNode;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* Additional CSS class names
|
|
574
|
+
*/
|
|
575
|
+
className?: string;
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Inline style for the component root element
|
|
579
|
+
*/
|
|
580
|
+
style?: React.CSSProperties;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* ARIA label for accessibility
|
|
584
|
+
*/
|
|
585
|
+
'aria-label'?: string;
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* ARIA role for the button group
|
|
589
|
+
*/
|
|
590
|
+
role?: string;
|
|
591
|
+
}
|
|
592
|
+
|
|
563
593
|
/**
|
|
564
594
|
* Badge component properties
|
|
565
595
|
*/
|
|
@@ -631,69 +661,6 @@ export interface BadgeProps extends BaseComponentProps {
|
|
|
631
661
|
};
|
|
632
662
|
}
|
|
633
663
|
|
|
634
|
-
/**
|
|
635
|
-
* Block component properties (legacy - use BlockProps from component instead)
|
|
636
|
-
* @deprecated Use BlockProps from '@atomix/components/Block' instead
|
|
637
|
-
*/
|
|
638
|
-
export interface LegacyBlockProps extends BaseComponentProps {
|
|
639
|
-
/**
|
|
640
|
-
* The content to be rendered within the block
|
|
641
|
-
*/
|
|
642
|
-
children: ReactNode;
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* The HTML element to render as
|
|
646
|
-
* @default 'section'
|
|
647
|
-
*/
|
|
648
|
-
as?: 'section' | 'div' | 'article' | 'aside' | 'main';
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* Spacing size for vertical padding
|
|
652
|
-
* @default 'md'
|
|
653
|
-
*/
|
|
654
|
-
spacing?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
655
|
-
|
|
656
|
-
/**
|
|
657
|
-
* Container configuration
|
|
658
|
-
*/
|
|
659
|
-
container?: {
|
|
660
|
-
/**
|
|
661
|
-
* Container type for content width
|
|
662
|
-
*/
|
|
663
|
-
type?: 'sm' | 'md' | 'lg' | 'xl' | 'fluid';
|
|
664
|
-
/**
|
|
665
|
-
* Additional container classes
|
|
666
|
-
*/
|
|
667
|
-
className?: string;
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* Whether to enable full-width content
|
|
672
|
-
* @default false
|
|
673
|
-
*/
|
|
674
|
-
fullWidth?: boolean;
|
|
675
|
-
|
|
676
|
-
/**
|
|
677
|
-
* Background color variant
|
|
678
|
-
*/
|
|
679
|
-
background?:
|
|
680
|
-
| 'primary'
|
|
681
|
-
| 'secondary'
|
|
682
|
-
| 'tertiary'
|
|
683
|
-
| 'invert'
|
|
684
|
-
| 'brand'
|
|
685
|
-
| 'error'
|
|
686
|
-
| 'success'
|
|
687
|
-
| 'warning'
|
|
688
|
-
| 'info'
|
|
689
|
-
| 'light';
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* Custom style for the block
|
|
693
|
-
*/
|
|
694
|
-
style?: React.CSSProperties;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
664
|
/**
|
|
698
665
|
* Callout component properties
|
|
699
666
|
*/
|
|
@@ -1098,42 +1065,6 @@ export type PhosphorIconsType = Exclude<
|
|
|
1098
1065
|
'IconContext' | 'IconBase' | 'createIcon' | 'default' | 'SSR'
|
|
1099
1066
|
>;
|
|
1100
1067
|
|
|
1101
|
-
/**
|
|
1102
|
-
* Icon component properties (legacy - use IconProps from component instead)
|
|
1103
|
-
* @deprecated Use IconProps from '@atomix/components/Icon' instead
|
|
1104
|
-
*/
|
|
1105
|
-
export interface LegacyIconProps extends BaseComponentProps {
|
|
1106
|
-
/**
|
|
1107
|
-
* Icon name from Phosphor Icons
|
|
1108
|
-
*/
|
|
1109
|
-
name: PhosphorIconsType;
|
|
1110
|
-
|
|
1111
|
-
/**
|
|
1112
|
-
* Icon size
|
|
1113
|
-
*/
|
|
1114
|
-
size?: IconSize | number;
|
|
1115
|
-
|
|
1116
|
-
/**
|
|
1117
|
-
* Icon weight/style
|
|
1118
|
-
*/
|
|
1119
|
-
weight?: IconWeight;
|
|
1120
|
-
|
|
1121
|
-
/**
|
|
1122
|
-
* Icon color
|
|
1123
|
-
*/
|
|
1124
|
-
color?: string;
|
|
1125
|
-
|
|
1126
|
-
/**
|
|
1127
|
-
* Alt text for accessibility
|
|
1128
|
-
*/
|
|
1129
|
-
alt?: string;
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* Custom style
|
|
1133
|
-
*/
|
|
1134
|
-
style?: React.CSSProperties;
|
|
1135
|
-
}
|
|
1136
|
-
|
|
1137
1068
|
/**
|
|
1138
1069
|
* Navbar position options
|
|
1139
1070
|
*/
|
|
@@ -1840,6 +1771,16 @@ export interface PaginationProps extends BaseComponentProps {
|
|
|
1840
1771
|
*/
|
|
1841
1772
|
showPrevNextButtons?: boolean;
|
|
1842
1773
|
|
|
1774
|
+
/**
|
|
1775
|
+
* Whether to show search input for jumping to a specific page
|
|
1776
|
+
*/
|
|
1777
|
+
showSearch?: boolean;
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Placeholder text for the search input
|
|
1781
|
+
*/
|
|
1782
|
+
searchPlaceholder?: string;
|
|
1783
|
+
|
|
1843
1784
|
/**
|
|
1844
1785
|
* Custom class for the pagination container
|
|
1845
1786
|
*/
|
|
@@ -2886,37 +2827,6 @@ export interface BreadcrumbItem {
|
|
|
2886
2827
|
className?: string;
|
|
2887
2828
|
}
|
|
2888
2829
|
|
|
2889
|
-
/**
|
|
2890
|
-
* Breadcrumb component properties (legacy - use BreadcrumbProps from component instead)
|
|
2891
|
-
* @deprecated Use BreadcrumbProps from '@atomix/components/Breadcrumb' instead
|
|
2892
|
-
*/
|
|
2893
|
-
export interface LegacyBreadcrumbProps extends BaseComponentProps {
|
|
2894
|
-
/**
|
|
2895
|
-
* Array of breadcrumb items
|
|
2896
|
-
*/
|
|
2897
|
-
items: BreadcrumbItem[];
|
|
2898
|
-
|
|
2899
|
-
/**
|
|
2900
|
-
* Custom divider character or element
|
|
2901
|
-
*/
|
|
2902
|
-
divider?: ReactNode;
|
|
2903
|
-
|
|
2904
|
-
/**
|
|
2905
|
-
* Aria label for the navigation
|
|
2906
|
-
*/
|
|
2907
|
-
ariaLabel?: string;
|
|
2908
|
-
|
|
2909
|
-
/**
|
|
2910
|
-
* Optional custom link component
|
|
2911
|
-
*/
|
|
2912
|
-
LinkComponent?: React.ElementType;
|
|
2913
|
-
|
|
2914
|
-
/**
|
|
2915
|
-
* Custom style for the breadcrumb
|
|
2916
|
-
*/
|
|
2917
|
-
style?: React.CSSProperties;
|
|
2918
|
-
}
|
|
2919
|
-
|
|
2920
2830
|
/**
|
|
2921
2831
|
* Breadcrumb options interface (for vanilla JS)
|
|
2922
2832
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import type { PartStyleProps } from '../types/partProps';
|
|
9
|
-
import { cssVarsToStyle } from '../theme/cssVariableMapper';
|
|
9
|
+
import { cssVarsToStyle } from '../theme/adapters/cssVariableMapper';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Merge multiple class names
|
|
@@ -114,7 +114,7 @@ export function hasCustomization(props: {
|
|
|
114
114
|
* Create data attributes for debugging
|
|
115
115
|
*/
|
|
116
116
|
export function createDebugAttrs(componentName: string, variant?: string): Record<string, string> {
|
|
117
|
-
if (process.env
|
|
117
|
+
if (typeof process === 'undefined' || process.env?.NODE_ENV !== 'development') return {};
|
|
118
118
|
|
|
119
119
|
return {
|
|
120
120
|
'data-component': componentName,
|
|
@@ -34,7 +34,7 @@ export function isMemoryMonitoringAvailable(): boolean {
|
|
|
34
34
|
return (
|
|
35
35
|
typeof performance !== 'undefined' &&
|
|
36
36
|
'memory' in performance &&
|
|
37
|
-
process.env
|
|
37
|
+
(typeof process === 'undefined' || process.env?.NODE_ENV === 'development')
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -133,7 +133,7 @@ export function monitorMemoryUsage(
|
|
|
133
133
|
if (snapshot) {
|
|
134
134
|
if (callback) {
|
|
135
135
|
callback(snapshot);
|
|
136
|
-
} else if (process.env
|
|
136
|
+
} else if (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development') {
|
|
137
137
|
console.log('[Memory Monitor]', {
|
|
138
138
|
used: formatBytes(snapshot.usedJSHeapSize),
|
|
139
139
|
total: formatBytes(snapshot.totalJSHeapSize),
|
|
@@ -175,7 +175,7 @@ export function trackComponentMemory(componentName: string) {
|
|
|
175
175
|
const after = getMemorySnapshot();
|
|
176
176
|
if (before && after) {
|
|
177
177
|
const leakInfo = detectMemoryLeak(before, after);
|
|
178
|
-
if (leakInfo.hasLeak && process.env
|
|
178
|
+
if (leakInfo.hasLeak && (typeof process === 'undefined' || process.env?.NODE_ENV === 'development')) {
|
|
179
179
|
console.warn(
|
|
180
180
|
`[Memory Monitor] Potential memory leak detected in ${componentName}:`,
|
|
181
181
|
leakInfo
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Naming Utility
|
|
3
|
+
*
|
|
4
|
+
* Provides consistent naming conventions for CSS classes, CSS variables,
|
|
5
|
+
* and JavaScript properties throughout the theme system.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export class ThemeNaming {
|
|
9
|
+
private static prefix = 'atomix';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Set the global prefix for all theme tokens
|
|
13
|
+
* @param newPrefix - New prefix to use
|
|
14
|
+
*/
|
|
15
|
+
static setPrefix(newPrefix: string): void {
|
|
16
|
+
this.prefix = newPrefix;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get the current prefix
|
|
21
|
+
*/
|
|
22
|
+
static getPrefix(): string {
|
|
23
|
+
return this.prefix;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Convert camelCase to kebab-case for CSS variables
|
|
28
|
+
* @param str - String to convert
|
|
29
|
+
*/
|
|
30
|
+
static camelToKebab(str: string): string {
|
|
31
|
+
return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Convert kebab-case to camelCase for JavaScript properties
|
|
36
|
+
* @param str - String to convert
|
|
37
|
+
*/
|
|
38
|
+
static kebabToCamel(str: string): string {
|
|
39
|
+
return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Create a CSS variable name
|
|
44
|
+
* @param token - Token name in camelCase
|
|
45
|
+
*/
|
|
46
|
+
static cssVar(token: string): string {
|
|
47
|
+
return `--${this.prefix}-${this.camelToKebab(token)}`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Create a BEM CSS class name
|
|
52
|
+
* @param block - Block name
|
|
53
|
+
* @param element - Element name (optional)
|
|
54
|
+
* @param modifier - Modifier name (optional)
|
|
55
|
+
*/
|
|
56
|
+
static bemClass(block: string, element?: string, modifier?: string): string {
|
|
57
|
+
let className = `c-${block}`;
|
|
58
|
+
|
|
59
|
+
if (element) {
|
|
60
|
+
className += `__${element}`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (modifier) {
|
|
64
|
+
className += `--${modifier}`;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return className;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Create a variant class name
|
|
72
|
+
* @param component - Component name
|
|
73
|
+
* @param variant - Variant name
|
|
74
|
+
*/
|
|
75
|
+
static variantClass(component: string, variant: string): string {
|
|
76
|
+
return `c-${component}--${variant}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Create a size class name
|
|
81
|
+
* @param component - Component name
|
|
82
|
+
* @param size - Size name
|
|
83
|
+
*/
|
|
84
|
+
static sizeClass(component: string, size: string): string {
|
|
85
|
+
return `c-${component}--${size}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Create a state class name
|
|
90
|
+
* @param component - Component name
|
|
91
|
+
* @param state - State name
|
|
92
|
+
*/
|
|
93
|
+
static stateClass(component: string, state: string): string {
|
|
94
|
+
return `c-${component}--${state}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Create a utility class name
|
|
99
|
+
* @param utility - Utility name
|
|
100
|
+
*/
|
|
101
|
+
static utilityClass(utility: string): string {
|
|
102
|
+
return `u-${utility}`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Create a layout class name
|
|
107
|
+
* @param layout - Layout name
|
|
108
|
+
*/
|
|
109
|
+
static layoutClass(layout: string): string {
|
|
110
|
+
return `l-${layout}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Create an object class name
|
|
115
|
+
* @param object - Object name
|
|
116
|
+
*/
|
|
117
|
+
static objectClass(object: string): string {
|
|
118
|
+
return `o-${object}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Export constants for common naming patterns
|
|
123
|
+
export const THEME_NAMING = {
|
|
124
|
+
PREFIX: 'atomix',
|
|
125
|
+
CSS_VAR: ThemeNaming.cssVar,
|
|
126
|
+
BEM_CLASS: ThemeNaming.bemClass,
|
|
127
|
+
VARIANT_CLASS: ThemeNaming.variantClass,
|
|
128
|
+
SIZE_CLASS: ThemeNaming.sizeClass,
|
|
129
|
+
STATE_CLASS: ThemeNaming.stateClass,
|
|
130
|
+
UTILITY_CLASS: ThemeNaming.utilityClass,
|
|
131
|
+
LAYOUT_CLASS: ThemeNaming.layoutClass,
|
|
132
|
+
OBJECT_CLASS: ThemeNaming.objectClass,
|
|
133
|
+
CAMEL_TO_KEBAB: ThemeNaming.camelToKebab,
|
|
134
|
+
KEBAB_TO_CAMEL: ThemeNaming.kebabToCamel,
|
|
135
|
+
};
|
|
@@ -195,7 +195,10 @@ $theme-font-weight: (
|
|
|
195
195
|
|
|
196
196
|
// scss-docs-start utilities-colors
|
|
197
197
|
|
|
198
|
-
//
|
|
198
|
+
// Note: Future enhancement - Consider using CSS custom properties (--atomix-*)
|
|
199
|
+
// generated from $theme-colors instead of SCSS maps for utilities generation.
|
|
200
|
+
// This would enable runtime theme switching for utility classes.
|
|
201
|
+
// Current implementation uses SCSS maps which is correct for build-time generation.
|
|
199
202
|
|
|
200
203
|
$utilities-colors: $theme-colors !default;
|
|
201
204
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@use 'sass:color';
|
|
2
|
+
@use 'sass:map';
|
|
2
3
|
@use '../01-settings/settings.config' as config;
|
|
3
4
|
@use '../01-settings/settings.button' as button;
|
|
4
5
|
@use '../01-settings/settings.colors' as colors;
|
|
6
|
+
@use '../01-settings/settings.design-tokens' as tokens;
|
|
5
7
|
@use '../01-settings/settings.border-radius' as *;
|
|
6
8
|
@use 'tools.to-rgb' as *;
|
|
7
9
|
@use 'tools.border-radius' as *;
|
|
@@ -16,99 +18,84 @@
|
|
|
16
18
|
$active-background: null,
|
|
17
19
|
$active-border: null
|
|
18
20
|
) {
|
|
19
|
-
$btn-text-color: colors.$white;
|
|
20
|
-
$btn-text-hover-color: colors.$white;
|
|
21
|
+
$btn-text-color: var(--#{config.$prefix}white, #{colors.$white});
|
|
22
|
+
$btn-text-hover-color: var(--#{config.$prefix}white, #{colors.$white});
|
|
21
23
|
|
|
22
24
|
@if ($color == 'light') {
|
|
23
|
-
$btn-text-color: var(--#{config.$prefix}dark-text-emphasis);
|
|
24
|
-
$btn-text-hover-color: var(--#{config.$prefix}dark-text-emphasis);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$btn-text-color: var(--#{config.$prefix}dark-text-emphasis);
|
|
29
|
-
$btn-text-hover-color: var(--#{config.$prefix}dark-text-emphasis);
|
|
25
|
+
$btn-text-color: var(--#{config.$prefix}dark-text-emphasis, #{colors.$dark-text});
|
|
26
|
+
$btn-text-hover-color: var(--#{config.$prefix}dark-text-emphasis, #{colors.$dark-text});
|
|
27
|
+
} @else if ($color == 'secondary') {
|
|
28
|
+
$btn-text-color: var(--#{config.$prefix}dark-text-emphasis, #{colors.$dark-text});
|
|
29
|
+
$btn-text-hover-color: var(--#{config.$prefix}dark-text-emphasis, #{colors.$dark-text});
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
--#{config.$prefix}btn-color: #{$btn-text-color};
|
|
33
|
-
--#{config.$prefix}btn-bg: #{$background};
|
|
34
|
-
--#{config.$prefix}btn-border-color: #{$border};
|
|
33
|
+
--#{config.$prefix}btn-bg: var(--#{config.$prefix}#{$color}, #{$background});
|
|
34
|
+
--#{config.$prefix}btn-border-color: var(--#{config.$prefix}#{$color}, #{$border});
|
|
35
35
|
--#{config.$prefix}btn-hover-color: #{$btn-text-hover-color};
|
|
36
|
-
--#{config.$prefix}btn-hover-bg: #{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
--#{config.$prefix}btn-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
color.scale($border, $lightness: -10%)
|
|
45
|
-
)};
|
|
46
|
-
--#{config.$prefix}btn-active-color: #{colors.$white};
|
|
47
|
-
--#{config.$prefix}btn-active-bg: #{if(
|
|
48
|
-
$active-background,
|
|
49
|
-
$active-background,
|
|
50
|
-
color.scale($background, $lightness: -20%)
|
|
51
|
-
)};
|
|
52
|
-
--#{config.$prefix}btn-active-border-color: #{if(
|
|
53
|
-
$active-border,
|
|
54
|
-
$active-border,
|
|
55
|
-
color.scale($border, $lightness: -25%)
|
|
56
|
-
)};
|
|
57
|
-
--#{config.$prefix}btn-disabled-color: #{colors.$white};
|
|
58
|
-
--#{config.$prefix}btn-disabled-bg: #{$background};
|
|
59
|
-
--#{config.$prefix}btn-disabled-border-color: #{$background};
|
|
36
|
+
--#{config.$prefix}btn-hover-bg: var(--#{config.$prefix}#{$color}-hover, #{color.scale($background, $lightness: -15%)});
|
|
37
|
+
--#{config.$prefix}btn-hover-border-color: var(--#{config.$prefix}#{$color}-hover, #{color.scale($border, $lightness: -10%)});
|
|
38
|
+
--#{config.$prefix}btn-active-color: var(--#{config.$prefix}white, #{colors.$white});
|
|
39
|
+
--#{config.$prefix}btn-active-bg: var(--#{config.$prefix}#{$color}-hover, #{color.scale($background, $lightness: -20%)});
|
|
40
|
+
--#{config.$prefix}btn-active-border-color: var(--#{config.$prefix}#{$color}-hover, #{color.scale($border, $lightness: -25%)});
|
|
41
|
+
--#{config.$prefix}btn-disabled-color: var(--#{config.$prefix}white, #{colors.$white});
|
|
42
|
+
--#{config.$prefix}btn-disabled-bg: var(--#{config.$prefix}#{$color}, #{$background});
|
|
43
|
+
--#{config.$prefix}btn-disabled-border-color: var(--#{config.$prefix}#{$color}, #{$border});
|
|
60
44
|
}
|
|
61
45
|
|
|
62
46
|
// Button outline variant mixin
|
|
63
47
|
@mixin btn-outline-variant(
|
|
64
48
|
$color,
|
|
65
|
-
$color-hover:
|
|
66
|
-
$hover-background:
|
|
67
|
-
$hover-border:
|
|
68
|
-
$active-background:
|
|
69
|
-
$active-border:
|
|
49
|
+
$color-hover: null,
|
|
50
|
+
$hover-background: null,
|
|
51
|
+
$hover-border: null,
|
|
52
|
+
$active-background: null,
|
|
53
|
+
$active-border: null
|
|
70
54
|
) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
$hover-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
55
|
+
$btn-color: var(--#{config.$prefix}#{$color}, #{map.get(tokens.$theme-colors, $color)});
|
|
56
|
+
$btn-hover-color: if(
|
|
57
|
+
$color-hover,
|
|
58
|
+
var(--#{config.$prefix}#{$color-hover}, #{map.get(tokens.$theme-colors, $color-hover)}),
|
|
59
|
+
var(--#{config.$prefix}white, #{colors.$white})
|
|
60
|
+
);
|
|
61
|
+
$btn-hover-bg: if(
|
|
62
|
+
$hover-background,
|
|
63
|
+
var(--#{config.$prefix}#{$hover-background}, #{map.get(tokens.$theme-colors, $hover-background)}),
|
|
64
|
+
var(--#{config.$prefix}#{$color}-hover, #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -15%)})
|
|
65
|
+
);
|
|
66
|
+
$btn-hover-border: if(
|
|
67
|
+
$hover-border,
|
|
68
|
+
var(--#{config.$prefix}#{$hover-border}, #{map.get(tokens.$theme-colors, $hover-border)}),
|
|
69
|
+
var(--#{config.$prefix}#{$color}-hover, #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -10%)})
|
|
70
|
+
);
|
|
71
|
+
$btn-active-color: if(
|
|
72
|
+
$color-hover,
|
|
73
|
+
var(--#{config.$prefix}#{$color-hover}, #{map.get(tokens.$theme-colors, $color-hover)}),
|
|
74
|
+
var(--#{config.$prefix}white, #{colors.$white})
|
|
75
|
+
);
|
|
76
|
+
$btn-active-bg: if(
|
|
77
|
+
$active-background,
|
|
78
|
+
var(--#{config.$prefix}#{$active-background}, #{map.get(tokens.$theme-colors, $active-background)}),
|
|
79
|
+
var(--#{config.$prefix}#{$color}-hover, #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -20%)})
|
|
80
|
+
);
|
|
81
|
+
$btn-active-border: if(
|
|
82
|
+
$active-border,
|
|
83
|
+
var(--#{config.$prefix}#{$active-border}, #{map.get(tokens.$theme-colors, $active-border)}),
|
|
84
|
+
var(--#{config.$prefix}#{$color}-hover, #{color.scale(map.get(tokens.$theme-colors, $color), $lightness: -25%)})
|
|
85
|
+
);
|
|
94
86
|
|
|
95
|
-
|
|
96
|
-
$btn-color: 'invert';
|
|
97
|
-
$color-hover: 'invert';
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
--#{config.$prefix}btn-color: var(--#{config.$prefix}#{$btn-color});
|
|
87
|
+
--#{config.$prefix}btn-color: #{$btn-color};
|
|
101
88
|
--#{config.$prefix}btn-bg: transparent;
|
|
102
|
-
--#{config.$prefix}btn-border-color:
|
|
103
|
-
--#{config.$prefix}btn-hover-color:
|
|
104
|
-
--#{config.$prefix}btn-hover-bg:
|
|
105
|
-
--#{config.$prefix}btn-hover-border-color:
|
|
106
|
-
--#{config.$prefix}btn-active-color:
|
|
107
|
-
--#{config.$prefix}btn-active-bg:
|
|
108
|
-
--#{config.$prefix}btn-active-border-color:
|
|
109
|
-
--#{config.$prefix}btn-disabled-color:
|
|
89
|
+
--#{config.$prefix}btn-border-color: #{$btn-color};
|
|
90
|
+
--#{config.$prefix}btn-hover-color: #{$btn-hover-color};
|
|
91
|
+
--#{config.$prefix}btn-hover-bg: #{$btn-hover-bg};
|
|
92
|
+
--#{config.$prefix}btn-hover-border-color: #{$btn-hover-border};
|
|
93
|
+
--#{config.$prefix}btn-active-color: #{$btn-active-color};
|
|
94
|
+
--#{config.$prefix}btn-active-bg: #{$btn-active-bg};
|
|
95
|
+
--#{config.$prefix}btn-active-border-color: #{$btn-active-border};
|
|
96
|
+
--#{config.$prefix}btn-disabled-color: #{$btn-color};
|
|
110
97
|
--#{config.$prefix}btn-disabled-bg: transparent;
|
|
111
|
-
--#{config.$prefix}btn-disabled-border-color:
|
|
98
|
+
--#{config.$prefix}btn-disabled-border-color: #{$btn-color};
|
|
112
99
|
}
|
|
113
100
|
|
|
114
101
|
// Button size mixin
|
|
@@ -117,4 +104,4 @@
|
|
|
117
104
|
--#{config.$prefix}btn-padding-x: #{$padding-x};
|
|
118
105
|
--#{config.$prefix}btn-font-size: #{$font-size};
|
|
119
106
|
--#{config.$prefix}btn-border-radius: #{$border-radius};
|
|
120
|
-
}
|
|
107
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Component: AtomixGlass
|
|
2
2
|
// =============================================================================
|
|
3
3
|
|
|
4
|
+
@use '../02-tools/tools.component' as *;
|
|
5
|
+
|
|
4
6
|
.c-atomix-glass {
|
|
5
7
|
position: relative;
|
|
6
8
|
|
|
@@ -38,19 +40,19 @@
|
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
&__hover-1 {
|
|
41
|
-
transition: opacity 0.
|
|
43
|
+
transition: opacity var(--atomix-transition-duration-fast, 0.15s) ease-out;
|
|
42
44
|
opacity: var(--atomix-glass-hover-1-opacity, 0);
|
|
43
45
|
background: var(--atomix-glass-hover-1-gradient, none);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
&__hover-2 {
|
|
47
|
-
transition: opacity 0.
|
|
49
|
+
transition: opacity var(--atomix-transition-duration-base, 0.3s) ease-out;
|
|
48
50
|
opacity: var(--atomix-glass-hover-2-opacity, 0);
|
|
49
51
|
background: var(--atomix-glass-hover-2-gradient, none);
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
&__hover-3 {
|
|
53
|
-
transition: opacity 0.
|
|
55
|
+
transition: opacity var(--atomix-transition-duration-slow, 0.5s) ease-out;
|
|
54
56
|
opacity: var(--atomix-glass-hover-3-opacity, 0);
|
|
55
57
|
background: var(--atomix-glass-hover-3-gradient, none);
|
|
56
58
|
}
|
|
@@ -91,6 +93,7 @@
|
|
|
91
93
|
box-sizing: border-box;
|
|
92
94
|
overflow: hidden;
|
|
93
95
|
pointer-events: none;
|
|
96
|
+
/* postcss-ignore-start */
|
|
94
97
|
-webkit-mask:
|
|
95
98
|
linear-gradient(var(--atomix-black, #000000) 0 0) content-box,
|
|
96
99
|
linear-gradient(var(--atomix-black, #000000) 0 0);
|
|
@@ -99,6 +102,7 @@
|
|
|
99
102
|
linear-gradient(var(--atomix-black, #000000) 0 0) content-box,
|
|
100
103
|
linear-gradient(var(--atomix-black, #000000) 0 0);
|
|
101
104
|
mask-composite: exclude;
|
|
105
|
+
/* postcss-ignore-end */
|
|
102
106
|
|
|
103
107
|
position: var(--atomix-glass-position);
|
|
104
108
|
top: var(--atomix-glass-top);
|
|
@@ -233,6 +237,12 @@
|
|
|
233
237
|
--atomix-glass-transition: none;
|
|
234
238
|
}
|
|
235
239
|
|
|
240
|
+
// Focus ring for interactive elements (when onClick is provided)
|
|
241
|
+
&[role='button'],
|
|
242
|
+
&[tabindex]:not([tabindex='-1']) {
|
|
243
|
+
@include focus-ring;
|
|
244
|
+
}
|
|
245
|
+
|
|
236
246
|
// Responsive and accessibility
|
|
237
247
|
@media (prefers-reduced-motion: reduce) {
|
|
238
248
|
--atomix-glass-transition: none;
|