@idealyst/theme 1.0.24 → 1.0.26

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/src/variants.ts CHANGED
@@ -1,56 +1,56 @@
1
- /**
2
- * Theme Variant Types
3
- *
4
- * This file defines the type system for component styling:
5
- * - IntentVariant: For action-oriented components (buttons, inputs, alerts, etc.)
6
- * - ColorVariant: For display components (text, badges, avatars, etc.)
7
- */
8
-
9
- // Intent variants for action-oriented components
10
- // These map to semantic meanings and have contextual colors (main, on, container, etc.)
11
- export type IntentVariant =
12
- | 'primary'
13
- | 'success'
14
- | 'error'
15
- | 'warning'
16
- | 'neutral'
17
- | 'info';
18
-
19
- // Base color names - Standard color palette
20
- type BaseColors = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'black' | 'gray' | 'white';
21
-
22
- // Color shades available in the palette
23
- type ColorShades = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
24
-
25
- // Generate color variants with shades using template literal types
26
- type ColorWithShades<T extends string> = T | `${T}.${ColorShades}`;
27
-
28
- // Color variants for display components
29
- // These map directly to color palette entries
30
- // Automatically generates: 'blue' | 'blue.50' | 'blue.100' | ... | 'cyan.900'
31
- export type ColorVariant = ColorWithShades<BaseColors>;
32
-
33
- // Semantic color variants for text and other display elements
34
- export type SemanticColorVariant =
35
- | 'primary' // Main text color
36
- | 'secondary' // Secondary text color
37
- | 'disabled' // Disabled text color
38
- | 'inverse' // Inverse text color
39
- | 'muted'; // Muted text color
40
-
41
- // Combined color variant type that includes both palette colors and semantic colors
42
- export type DisplayColorVariant = ColorVariant | SemanticColorVariant;
43
-
44
- // Helper types for theme integration
45
- export type IntentMapping = {
46
- palette: ColorVariant;
47
- main: number;
48
- on: string;
49
- container: number;
50
- onContainer: number;
51
- light: number;
52
- dark: number;
53
- border: number;
54
- };
55
-
1
+ /**
2
+ * Theme Variant Types
3
+ *
4
+ * This file defines the type system for component styling:
5
+ * - IntentVariant: For action-oriented components (buttons, inputs, alerts, etc.)
6
+ * - ColorVariant: For display components (text, badges, avatars, etc.)
7
+ */
8
+
9
+ // Intent variants for action-oriented components
10
+ // These map to semantic meanings and have contextual colors (main, on, container, etc.)
11
+ export type IntentVariant =
12
+ | 'primary'
13
+ | 'success'
14
+ | 'error'
15
+ | 'warning'
16
+ | 'neutral'
17
+ | 'info';
18
+
19
+ // Base color names - Standard color palette
20
+ type BaseColors = 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'purple' | 'black' | 'gray' | 'white';
21
+
22
+ // Color shades available in the palette
23
+ type ColorShades = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
24
+
25
+ // Generate color variants with shades using template literal types
26
+ type ColorWithShades<T extends string> = T | `${T}.${ColorShades}`;
27
+
28
+ // Color variants for display components
29
+ // These map directly to color palette entries
30
+ // Automatically generates: 'blue' | 'blue.50' | 'blue.100' | ... | 'cyan.900'
31
+ export type ColorVariant = ColorWithShades<BaseColors>;
32
+
33
+ // Semantic color variants for text and other display elements
34
+ export type SemanticColorVariant =
35
+ | 'primary' // Main text color
36
+ | 'secondary' // Secondary text color
37
+ | 'disabled' // Disabled text color
38
+ | 'inverse' // Inverse text color
39
+ | 'muted'; // Muted text color
40
+
41
+ // Combined color variant type that includes both palette colors and semantic colors
42
+ export type DisplayColorVariant = ColorVariant | SemanticColorVariant;
43
+
44
+ // Helper types for theme integration
45
+ export type IntentMapping = {
46
+ palette: ColorVariant;
47
+ main: number;
48
+ on: string;
49
+ container: number;
50
+ onContainer: number;
51
+ light: number;
52
+ dark: number;
53
+ border: number;
54
+ };
55
+
56
56
  export type ColorPaletteShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;