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