@codecademy/gamut-styles 20.0.3-alpha.1bb0ff.0 → 20.0.3-alpha.212edd.0
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/themes/admin.d.ts +34 -9
- package/dist/themes/core.d.ts +34 -9
- package/dist/themes/core.js +4 -3
- package/dist/themes/lxStudio.d.ts +29 -4
- package/dist/themes/percipio.d.ts +29 -4
- package/dist/themes/platform.d.ts +34 -9
- package/dist/variables/elements.d.ts +4 -3
- package/dist/variables/elements.js +5 -3
- package/dist/variables/index.d.ts +1 -0
- package/dist/variables/index.js +2 -1
- package/dist/variables/zIndices.d.ts +43 -0
- package/dist/variables/zIndices.js +43 -0
- package/dist/variance/config.js +3 -0
- package/package.json +2 -2
package/dist/themes/admin.d.ts
CHANGED
|
@@ -34,13 +34,19 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
34
34
|
md: string;
|
|
35
35
|
lg: string;
|
|
36
36
|
xl: string;
|
|
37
|
-
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"
|
|
38
|
-
readonly
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
readonly
|
|
43
|
-
|
|
37
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
|
|
38
|
+
readonly underlay: -100;
|
|
39
|
+
readonly base: 0;
|
|
40
|
+
readonly foreground: 100;
|
|
41
|
+
readonly portal: 200;
|
|
42
|
+
readonly widget: 300;
|
|
43
|
+
readonly appBar: 400;
|
|
44
|
+
readonly flyout: 500;
|
|
45
|
+
readonly modal: 600;
|
|
46
|
+
readonly popover: 700;
|
|
47
|
+
readonly toaster: 800;
|
|
48
|
+
readonly tooltip: 900;
|
|
49
|
+
}, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
|
|
44
50
|
c_base: string;
|
|
45
51
|
c_xs: string;
|
|
46
52
|
c_sm: string;
|
|
@@ -120,7 +126,20 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
120
126
|
readonly base: "4rem";
|
|
121
127
|
readonly md: "5rem";
|
|
122
128
|
};
|
|
123
|
-
readonly headerZ:
|
|
129
|
+
readonly headerZ: 400;
|
|
130
|
+
};
|
|
131
|
+
zIndices: {
|
|
132
|
+
readonly underlay: -100;
|
|
133
|
+
readonly base: 0;
|
|
134
|
+
readonly foreground: 100;
|
|
135
|
+
readonly portal: 200;
|
|
136
|
+
readonly widget: 300;
|
|
137
|
+
readonly appBar: 400;
|
|
138
|
+
readonly flyout: 500;
|
|
139
|
+
readonly modal: 600;
|
|
140
|
+
readonly popover: 700;
|
|
141
|
+
readonly toaster: 800;
|
|
142
|
+
readonly tooltip: 900;
|
|
124
143
|
};
|
|
125
144
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
126
145
|
readonly beige: "#FFF0E5";
|
|
@@ -544,7 +563,13 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
544
563
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
545
564
|
1: string;
|
|
546
565
|
2: string;
|
|
547
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys
|
|
566
|
+
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
567
|
+
readonly headerHeight: {
|
|
568
|
+
readonly base: "4rem";
|
|
569
|
+
readonly md: "5rem";
|
|
570
|
+
};
|
|
571
|
+
readonly headerZ: 400;
|
|
572
|
+
}, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, {
|
|
548
573
|
colors: import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
549
574
|
primary: {
|
|
550
575
|
_: "blue-500";
|
package/dist/themes/core.d.ts
CHANGED
|
@@ -15,13 +15,19 @@ export declare const coreTheme: Record<"breakpoints", {
|
|
|
15
15
|
md: string;
|
|
16
16
|
lg: string;
|
|
17
17
|
xl: string;
|
|
18
|
-
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"
|
|
19
|
-
readonly
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
readonly
|
|
24
|
-
|
|
18
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
|
|
19
|
+
readonly underlay: -100;
|
|
20
|
+
readonly base: 0;
|
|
21
|
+
readonly foreground: 100;
|
|
22
|
+
readonly portal: 200;
|
|
23
|
+
readonly widget: 300;
|
|
24
|
+
readonly appBar: 400;
|
|
25
|
+
readonly flyout: 500;
|
|
26
|
+
readonly modal: 600;
|
|
27
|
+
readonly popover: 700;
|
|
28
|
+
readonly toaster: 800;
|
|
29
|
+
readonly tooltip: 900;
|
|
30
|
+
}, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
|
|
25
31
|
c_base: string;
|
|
26
32
|
c_xs: string;
|
|
27
33
|
c_sm: string;
|
|
@@ -101,7 +107,20 @@ export declare const coreTheme: Record<"breakpoints", {
|
|
|
101
107
|
readonly base: "4rem";
|
|
102
108
|
readonly md: "5rem";
|
|
103
109
|
};
|
|
104
|
-
readonly headerZ:
|
|
110
|
+
readonly headerZ: 400;
|
|
111
|
+
};
|
|
112
|
+
zIndices: {
|
|
113
|
+
readonly underlay: -100;
|
|
114
|
+
readonly base: 0;
|
|
115
|
+
readonly foreground: 100;
|
|
116
|
+
readonly portal: 200;
|
|
117
|
+
readonly widget: 300;
|
|
118
|
+
readonly appBar: 400;
|
|
119
|
+
readonly flyout: 500;
|
|
120
|
+
readonly modal: 600;
|
|
121
|
+
readonly popover: 700;
|
|
122
|
+
readonly toaster: 800;
|
|
123
|
+
readonly tooltip: 900;
|
|
105
124
|
};
|
|
106
125
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
107
126
|
readonly beige: "#FFF0E5";
|
|
@@ -525,7 +544,13 @@ export declare const coreTheme: Record<"breakpoints", {
|
|
|
525
544
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
526
545
|
1: string;
|
|
527
546
|
2: string;
|
|
528
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys
|
|
547
|
+
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
548
|
+
readonly headerHeight: {
|
|
549
|
+
readonly base: "4rem";
|
|
550
|
+
readonly md: "5rem";
|
|
551
|
+
};
|
|
552
|
+
readonly headerZ: 400;
|
|
553
|
+
}, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
|
|
529
554
|
export type CoreThemeShape = typeof coreTheme;
|
|
530
555
|
export interface CoreTheme extends CoreThemeShape {
|
|
531
556
|
}
|
package/dist/themes/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTheme } from '@codecademy/variance';
|
|
2
|
-
import { borderRadii, containerQueries, corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing } from '../variables';
|
|
2
|
+
import { borderRadii, containerQueries, corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing, zIndices } from '../variables';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @description This is the core theme that all other Codecademy themes are extended from
|
|
@@ -18,7 +18,8 @@ export const coreTheme = createTheme({
|
|
|
18
18
|
lineHeight,
|
|
19
19
|
fontWeight,
|
|
20
20
|
spacing,
|
|
21
|
-
elements
|
|
21
|
+
elements,
|
|
22
|
+
zIndices
|
|
22
23
|
}).addColors(corePalette).addColorModes('light', {
|
|
23
24
|
light: {
|
|
24
25
|
text: {
|
|
@@ -129,4 +130,4 @@ export const coreTheme = createTheme({
|
|
|
129
130
|
}) => ({
|
|
130
131
|
1: `1px solid ${colors['border-primary']}`,
|
|
131
132
|
2: `2px solid ${colors['border-primary']}`
|
|
132
|
-
})).createScaleVariables('elements').addName('core').build();
|
|
133
|
+
})).createScaleVariables('elements').createScaleVariables('zIndices').addName('core').build();
|
|
@@ -78,18 +78,43 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
78
78
|
lg: string;
|
|
79
79
|
xl: string;
|
|
80
80
|
};
|
|
81
|
+
zIndices: Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
|
|
82
|
+
readonly underlay: -100;
|
|
83
|
+
readonly base: 0;
|
|
84
|
+
readonly foreground: 100;
|
|
85
|
+
readonly portal: 200;
|
|
86
|
+
readonly widget: 300;
|
|
87
|
+
readonly appBar: 400;
|
|
88
|
+
readonly flyout: 500;
|
|
89
|
+
readonly modal: 600;
|
|
90
|
+
readonly popover: 700;
|
|
91
|
+
readonly toaster: 800;
|
|
92
|
+
readonly tooltip: 900;
|
|
93
|
+
}, "zIndices">> & {
|
|
94
|
+
readonly underlay: -100;
|
|
95
|
+
readonly base: 0;
|
|
96
|
+
readonly foreground: 100;
|
|
97
|
+
readonly portal: 200;
|
|
98
|
+
readonly widget: 300;
|
|
99
|
+
readonly appBar: 400;
|
|
100
|
+
readonly flyout: 500;
|
|
101
|
+
readonly modal: 600;
|
|
102
|
+
readonly popover: 700;
|
|
103
|
+
readonly toaster: 800;
|
|
104
|
+
readonly tooltip: 900;
|
|
105
|
+
};
|
|
81
106
|
elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
82
107
|
readonly headerHeight: {
|
|
83
108
|
readonly base: "4rem";
|
|
84
109
|
readonly md: "5rem";
|
|
85
110
|
};
|
|
86
|
-
readonly headerZ:
|
|
111
|
+
readonly headerZ: 400;
|
|
87
112
|
}, "elements">> & {
|
|
88
113
|
readonly headerHeight: {
|
|
89
114
|
readonly base: "4rem";
|
|
90
115
|
readonly md: "5rem";
|
|
91
116
|
};
|
|
92
|
-
readonly headerZ:
|
|
117
|
+
readonly headerZ: 400;
|
|
93
118
|
};
|
|
94
119
|
fontSize: {
|
|
95
120
|
readonly 64: string;
|
|
@@ -120,8 +145,8 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
120
145
|
readonly 64: string;
|
|
121
146
|
readonly 96: string;
|
|
122
147
|
};
|
|
123
|
-
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
|
|
124
|
-
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>> & Record<string | number, any>;
|
|
148
|
+
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
|
|
149
|
+
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>>, Record<string | number, any>> & Record<string | number, any>;
|
|
125
150
|
colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
126
151
|
readonly beige: "#FFF0E5";
|
|
127
152
|
readonly blue: "#1557FF";
|
|
@@ -62,18 +62,43 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
62
62
|
lg: string;
|
|
63
63
|
xl: string;
|
|
64
64
|
};
|
|
65
|
+
zIndices: Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
|
|
66
|
+
readonly underlay: -100;
|
|
67
|
+
readonly base: 0;
|
|
68
|
+
readonly foreground: 100;
|
|
69
|
+
readonly portal: 200;
|
|
70
|
+
readonly widget: 300;
|
|
71
|
+
readonly appBar: 400;
|
|
72
|
+
readonly flyout: 500;
|
|
73
|
+
readonly modal: 600;
|
|
74
|
+
readonly popover: 700;
|
|
75
|
+
readonly toaster: 800;
|
|
76
|
+
readonly tooltip: 900;
|
|
77
|
+
}, "zIndices">> & {
|
|
78
|
+
readonly underlay: -100;
|
|
79
|
+
readonly base: 0;
|
|
80
|
+
readonly foreground: 100;
|
|
81
|
+
readonly portal: 200;
|
|
82
|
+
readonly widget: 300;
|
|
83
|
+
readonly appBar: 400;
|
|
84
|
+
readonly flyout: 500;
|
|
85
|
+
readonly modal: 600;
|
|
86
|
+
readonly popover: 700;
|
|
87
|
+
readonly toaster: 800;
|
|
88
|
+
readonly tooltip: 900;
|
|
89
|
+
};
|
|
65
90
|
elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
66
91
|
readonly headerHeight: {
|
|
67
92
|
readonly base: "4rem";
|
|
68
93
|
readonly md: "5rem";
|
|
69
94
|
};
|
|
70
|
-
readonly headerZ:
|
|
95
|
+
readonly headerZ: 400;
|
|
71
96
|
}, "elements">> & {
|
|
72
97
|
readonly headerHeight: {
|
|
73
98
|
readonly base: "4rem";
|
|
74
99
|
readonly md: "5rem";
|
|
75
100
|
};
|
|
76
|
-
readonly headerZ:
|
|
101
|
+
readonly headerZ: 400;
|
|
77
102
|
};
|
|
78
103
|
borderRadii: {
|
|
79
104
|
none: string;
|
|
@@ -112,8 +137,8 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
112
137
|
readonly 64: string;
|
|
113
138
|
readonly 96: string;
|
|
114
139
|
};
|
|
115
|
-
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
|
|
116
|
-
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>> & Record<string | number, any>;
|
|
140
|
+
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
|
|
141
|
+
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>>, Record<string | number, any>> & Record<string | number, any>;
|
|
117
142
|
colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
118
143
|
readonly beige: "#FFF0E5";
|
|
119
144
|
readonly blue: "#1557FF";
|
|
@@ -50,13 +50,19 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
50
50
|
md: string;
|
|
51
51
|
lg: string;
|
|
52
52
|
xl: string;
|
|
53
|
-
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"
|
|
54
|
-
readonly
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
readonly
|
|
59
|
-
|
|
53
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
|
|
54
|
+
readonly underlay: -100;
|
|
55
|
+
readonly base: 0;
|
|
56
|
+
readonly foreground: 100;
|
|
57
|
+
readonly portal: 200;
|
|
58
|
+
readonly widget: 300;
|
|
59
|
+
readonly appBar: 400;
|
|
60
|
+
readonly flyout: 500;
|
|
61
|
+
readonly modal: 600;
|
|
62
|
+
readonly popover: 700;
|
|
63
|
+
readonly toaster: 800;
|
|
64
|
+
readonly tooltip: 900;
|
|
65
|
+
}, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
|
|
60
66
|
c_base: string;
|
|
61
67
|
c_xs: string;
|
|
62
68
|
c_sm: string;
|
|
@@ -136,7 +142,20 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
136
142
|
readonly base: "4rem";
|
|
137
143
|
readonly md: "5rem";
|
|
138
144
|
};
|
|
139
|
-
readonly headerZ:
|
|
145
|
+
readonly headerZ: 400;
|
|
146
|
+
};
|
|
147
|
+
zIndices: {
|
|
148
|
+
readonly underlay: -100;
|
|
149
|
+
readonly base: 0;
|
|
150
|
+
readonly foreground: 100;
|
|
151
|
+
readonly portal: 200;
|
|
152
|
+
readonly widget: 300;
|
|
153
|
+
readonly appBar: 400;
|
|
154
|
+
readonly flyout: 500;
|
|
155
|
+
readonly modal: 600;
|
|
156
|
+
readonly popover: 700;
|
|
157
|
+
readonly toaster: 800;
|
|
158
|
+
readonly tooltip: 900;
|
|
140
159
|
};
|
|
141
160
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
142
161
|
readonly beige: "#FFF0E5";
|
|
@@ -560,7 +579,13 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
560
579
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
561
580
|
1: string;
|
|
562
581
|
2: string;
|
|
563
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys
|
|
582
|
+
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
583
|
+
readonly headerHeight: {
|
|
584
|
+
readonly base: "4rem";
|
|
585
|
+
readonly md: "5rem";
|
|
586
|
+
};
|
|
587
|
+
readonly headerZ: 400;
|
|
588
|
+
}, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
564
589
|
readonly lightBeige: "#FFFBF8";
|
|
565
590
|
readonly gold: "#8A7300";
|
|
566
591
|
readonly teal: "#006D82";
|
|
@@ -4,8 +4,9 @@ export declare const elements: {
|
|
|
4
4
|
readonly md: "5rem";
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* z-index for global page headers. Aliases the `appBar` token from the `zIndices`
|
|
8
|
+
* scale so consumers still reading `elements.headerZ` stay in sync with the scale.
|
|
9
|
+
* Prefer `zIndex="appBar"` in new code.
|
|
9
10
|
*/
|
|
10
|
-
readonly headerZ:
|
|
11
|
+
readonly headerZ: 400;
|
|
11
12
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { zIndices } from './zIndices';
|
|
1
2
|
export const elements = {
|
|
2
3
|
headerHeight: {
|
|
3
4
|
base: '4rem',
|
|
4
5
|
md: '5rem'
|
|
5
6
|
},
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* z-index for global page headers. Aliases the `appBar` token from the `zIndices`
|
|
9
|
+
* scale so consumers still reading `elements.headerZ` stay in sync with the scale.
|
|
10
|
+
* Prefer `zIndex="appBar"` in new code.
|
|
9
11
|
*/
|
|
10
|
-
headerZ:
|
|
12
|
+
headerZ: zIndices.appBar
|
|
11
13
|
};
|
package/dist/variables/index.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic z-index scale. A single scale covers both in-flow layers (low values) and
|
|
3
|
+
* portal layers (≥100). Every z-index in Gamut should reference a token here rather than a
|
|
4
|
+
* magic number.
|
|
5
|
+
*
|
|
6
|
+
* The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
|
|
7
|
+
* tokens are used as `zIndex={zIndices.modal}`. That preserves the escape hatch (a raw
|
|
8
|
+
* in-between number, e.g. `zIndex={605}`) and arithmetic on tokens (e.g. `zIndices.foreground - 2`).
|
|
9
|
+
*
|
|
10
|
+
* Portal-band values are spaced by 100 so in-between escape-hatch numbers are available.
|
|
11
|
+
* `portal` (200) is the floor of the portal band and the default for `BodyPortal`.
|
|
12
|
+
*
|
|
13
|
+
* @remarks PLEASE talk to web platform before adding new z-index tokens.
|
|
14
|
+
*/
|
|
15
|
+
export declare const zIndices: {
|
|
16
|
+
/** Decorative layer behind content (underlines, backdrops, shadows). */
|
|
17
|
+
readonly underlay: -100;
|
|
18
|
+
/** Ground layer — establishes a local stacking context without lifting above siblings. */
|
|
19
|
+
readonly base: 0;
|
|
20
|
+
/**
|
|
21
|
+
* The raised in-flow layer: an element in front of what sits/scrolls behind it, but below
|
|
22
|
+
* all portal overlays. Covers content lifted above an `underlay` (e.g. text over its
|
|
23
|
+
* underline) and sticky content headers (e.g. a sticky table `thead`). Set to 100 so it
|
|
24
|
+
* clears common ad-hoc low z-index values.
|
|
25
|
+
*/
|
|
26
|
+
readonly foreground: 100;
|
|
27
|
+
/** Portal floor / `BodyPortal` default — un-tokenized portal content lands here. */
|
|
28
|
+
readonly portal: 200;
|
|
29
|
+
/** Persistent floating page furniture at rest (e.g. an AI chat launcher, help bubble). */
|
|
30
|
+
readonly widget: 300;
|
|
31
|
+
/** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
|
|
32
|
+
readonly appBar: 400;
|
|
33
|
+
/** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
|
|
34
|
+
readonly flyout: 500;
|
|
35
|
+
/** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
|
|
36
|
+
readonly modal: 600;
|
|
37
|
+
/** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
|
|
38
|
+
readonly popover: 700;
|
|
39
|
+
/** Toasts / notifications — visible above modals. */
|
|
40
|
+
readonly toaster: 800;
|
|
41
|
+
/** Floating tooltips (`FloatingTip`) — highest, so they are never clipped. */
|
|
42
|
+
readonly tooltip: 900;
|
|
43
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic z-index scale. A single scale covers both in-flow layers (low values) and
|
|
3
|
+
* portal layers (≥100). Every z-index in Gamut should reference a token here rather than a
|
|
4
|
+
* magic number.
|
|
5
|
+
*
|
|
6
|
+
* The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
|
|
7
|
+
* tokens are used as `zIndex={zIndices.modal}`. That preserves the escape hatch (a raw
|
|
8
|
+
* in-between number, e.g. `zIndex={605}`) and arithmetic on tokens (e.g. `zIndices.foreground - 2`).
|
|
9
|
+
*
|
|
10
|
+
* Portal-band values are spaced by 100 so in-between escape-hatch numbers are available.
|
|
11
|
+
* `portal` (200) is the floor of the portal band and the default for `BodyPortal`.
|
|
12
|
+
*
|
|
13
|
+
* @remarks PLEASE talk to web platform before adding new z-index tokens.
|
|
14
|
+
*/
|
|
15
|
+
export const zIndices = {
|
|
16
|
+
/** Decorative layer behind content (underlines, backdrops, shadows). */
|
|
17
|
+
underlay: -100,
|
|
18
|
+
/** Ground layer — establishes a local stacking context without lifting above siblings. */
|
|
19
|
+
base: 0,
|
|
20
|
+
/**
|
|
21
|
+
* The raised in-flow layer: an element in front of what sits/scrolls behind it, but below
|
|
22
|
+
* all portal overlays. Covers content lifted above an `underlay` (e.g. text over its
|
|
23
|
+
* underline) and sticky content headers (e.g. a sticky table `thead`). Set to 100 so it
|
|
24
|
+
* clears common ad-hoc low z-index values.
|
|
25
|
+
*/
|
|
26
|
+
foreground: 100,
|
|
27
|
+
/** Portal floor / `BodyPortal` default — un-tokenized portal content lands here. */
|
|
28
|
+
portal: 200,
|
|
29
|
+
/** Persistent floating page furniture at rest (e.g. an AI chat launcher, help bubble). */
|
|
30
|
+
widget: 300,
|
|
31
|
+
/** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
|
|
32
|
+
appBar: 400,
|
|
33
|
+
/** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
|
|
34
|
+
flyout: 500,
|
|
35
|
+
/** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
|
|
36
|
+
modal: 600,
|
|
37
|
+
/** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
|
|
38
|
+
popover: 700,
|
|
39
|
+
/** Toasts / notifications — visible above modals. */
|
|
40
|
+
toaster: 800,
|
|
41
|
+
/** Floating tooltips (`FloatingTip`) — highest, so they are never clipped. */
|
|
42
|
+
tooltip: 900
|
|
43
|
+
};
|
package/dist/variance/config.js
CHANGED
|
@@ -450,6 +450,9 @@ export const positioning = {
|
|
|
450
450
|
resolveProperty: getPropertyMode,
|
|
451
451
|
transform: transformSize
|
|
452
452
|
},
|
|
453
|
+
// Intentionally unscaled: scaled variance props are token-only and reject raw numbers,
|
|
454
|
+
// which would break the numeric escape hatch and Tip's z-index arithmetic. Use the numeric
|
|
455
|
+
// `zIndices` token object instead (e.g. zIndex={zIndices.modal}).
|
|
453
456
|
zIndex: {
|
|
454
457
|
property: 'zIndex'
|
|
455
458
|
},
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/gamut-styles",
|
|
3
3
|
"description": "Styleguide & Component library for codecademy.com",
|
|
4
|
-
"version": "20.0.3-alpha.
|
|
4
|
+
"version": "20.0.3-alpha.212edd.0",
|
|
5
5
|
"author": "Jake Hiller <jake@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@codecademy/variance": "0.26.2-alpha.
|
|
7
|
+
"@codecademy/variance": "0.26.2-alpha.212edd.0",
|
|
8
8
|
"@emotion/is-prop-valid": "^1.1.0",
|
|
9
9
|
"framer-motion": "^11.18.0",
|
|
10
10
|
"get-nonce": "^1.0.0",
|