@codecademy/gamut-styles 20.1.1-alpha.ba3184.0 → 20.1.1-alpha.c9d85c.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/ColorMode.d.ts +0 -6
- package/dist/themes/admin.d.ts +11 -32
- package/dist/themes/core.d.ts +9 -30
- package/dist/themes/core.js +3 -4
- package/dist/themes/lxStudio.d.ts +6 -26
- package/dist/themes/percipio.d.ts +8 -28
- package/dist/themes/percipio.js +2 -2
- package/dist/themes/platform.d.ts +11 -32
- package/dist/variables/elements.d.ts +3 -4
- package/dist/variables/elements.js +3 -5
- package/dist/variables/elevation.d.ts +17 -0
- package/dist/variables/elevation.js +43 -0
- package/dist/variables/index.d.ts +1 -1
- package/dist/variables/index.js +2 -2
- package/dist/variance/config.d.ts +0 -4
- package/dist/variance/config.js +1 -6
- package/dist/variance/props.d.ts +0 -8
- package/package.json +2 -2
- package/dist/variables/zIndexes.d.ts +0 -53
- package/dist/variables/zIndexes.js +0 -52
package/dist/ColorMode.d.ts
CHANGED
|
@@ -350,8 +350,6 @@ export declare const providerProps: import("@codecademy/variance/dist/types/conf
|
|
|
350
350
|
};
|
|
351
351
|
readonly zIndex: {
|
|
352
352
|
readonly property: "zIndex";
|
|
353
|
-
readonly scale: "zIndexes";
|
|
354
|
-
readonly allowRawValue: true;
|
|
355
353
|
};
|
|
356
354
|
readonly opacity: {
|
|
357
355
|
readonly property: "opacity";
|
|
@@ -930,8 +928,6 @@ export declare const VariableProvider: import("@emotion/styled").StyledComponent
|
|
|
930
928
|
}>;
|
|
931
929
|
zIndex?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
932
930
|
readonly property: "zIndex";
|
|
933
|
-
readonly scale: "zIndexes";
|
|
934
|
-
readonly allowRawValue: true;
|
|
935
931
|
}>;
|
|
936
932
|
backgroundPosition?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
937
933
|
readonly property: "backgroundPosition";
|
|
@@ -1565,8 +1561,6 @@ export declare const ColorMode: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
1565
1561
|
}>;
|
|
1566
1562
|
zIndex?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1567
1563
|
readonly property: "zIndex";
|
|
1568
|
-
readonly scale: "zIndexes";
|
|
1569
|
-
readonly allowRawValue: true;
|
|
1570
1564
|
}>;
|
|
1571
1565
|
backgroundPosition?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1572
1566
|
readonly property: "backgroundPosition";
|
package/dist/themes/admin.d.ts
CHANGED
|
@@ -34,17 +34,13 @@ 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
|
-
|
|
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", {
|
|
37
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
38
|
+
readonly headerHeight: {
|
|
39
|
+
readonly base: "4rem";
|
|
40
|
+
readonly md: "5rem";
|
|
41
|
+
};
|
|
42
|
+
readonly headerZ: 15;
|
|
43
|
+
}, "elements">>> & 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", {
|
|
48
44
|
c_base: string;
|
|
49
45
|
c_xs: string;
|
|
50
46
|
c_sm: string;
|
|
@@ -124,18 +120,7 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
124
120
|
readonly base: "4rem";
|
|
125
121
|
readonly md: "5rem";
|
|
126
122
|
};
|
|
127
|
-
readonly headerZ:
|
|
128
|
-
};
|
|
129
|
-
zIndexes: {
|
|
130
|
-
readonly underlay: -100;
|
|
131
|
-
readonly base: 0;
|
|
132
|
-
readonly foreground: 100;
|
|
133
|
-
readonly floating: 200;
|
|
134
|
-
readonly appBar: 300;
|
|
135
|
-
readonly flyout: 400;
|
|
136
|
-
readonly modal: 500;
|
|
137
|
-
readonly popover: 600;
|
|
138
|
-
readonly topmost: 700;
|
|
123
|
+
readonly headerZ: 15;
|
|
139
124
|
};
|
|
140
125
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
141
126
|
readonly beige: "#FFF0E5";
|
|
@@ -559,13 +544,7 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
559
544
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
560
545
|
1: string;
|
|
561
546
|
2: string;
|
|
562
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys
|
|
563
|
-
readonly headerHeight: {
|
|
564
|
-
readonly base: "4rem";
|
|
565
|
-
readonly md: "5rem";
|
|
566
|
-
};
|
|
567
|
-
readonly headerZ: 300;
|
|
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, {
|
|
547
|
+
}, "-">>>, Record<"elevation", import("@codecademy/variance").LiteralPaths<import("..").ElevationScale, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, {
|
|
569
548
|
colors: import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
570
549
|
primary: {
|
|
571
550
|
_: "blue-500";
|
|
@@ -935,7 +914,7 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
935
914
|
}, "-", "_">;
|
|
936
915
|
}>;
|
|
937
916
|
mode: "light" | "dark";
|
|
938
|
-
_getColorValue: (color: import("@codecademy/variance").Path<{
|
|
917
|
+
_getColorValue: (color: "shadow-primary" | "shadow-secondary" | import("@codecademy/variance").Path<{
|
|
939
918
|
readonly beige: "#FFF0E5";
|
|
940
919
|
readonly blue: "#1557FF";
|
|
941
920
|
readonly green: "#008A27";
|
|
@@ -1004,7 +983,7 @@ export declare const adminTheme: Record<"breakpoints", {
|
|
|
1004
983
|
readonly "white-200": string;
|
|
1005
984
|
readonly "white-600": string;
|
|
1006
985
|
readonly "white-700": string;
|
|
1007
|
-
}, "-"> | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "
|
|
986
|
+
}, "-"> | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "danger-hover" | "interface-hover" | "border-disabled" | "border-secondary" | "border-tertiary") => string;
|
|
1008
987
|
}> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
|
|
1009
988
|
export type AdminThemeShape = typeof adminTheme;
|
|
1010
989
|
export interface AdminTheme extends AdminThemeShape {
|
package/dist/themes/core.d.ts
CHANGED
|
@@ -15,17 +15,13 @@ 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
|
-
|
|
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", {
|
|
18
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
19
|
+
readonly headerHeight: {
|
|
20
|
+
readonly base: "4rem";
|
|
21
|
+
readonly md: "5rem";
|
|
22
|
+
};
|
|
23
|
+
readonly headerZ: 15;
|
|
24
|
+
}, "elements">>> & 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", {
|
|
29
25
|
c_base: string;
|
|
30
26
|
c_xs: string;
|
|
31
27
|
c_sm: string;
|
|
@@ -105,18 +101,7 @@ export declare const coreTheme: Record<"breakpoints", {
|
|
|
105
101
|
readonly base: "4rem";
|
|
106
102
|
readonly md: "5rem";
|
|
107
103
|
};
|
|
108
|
-
readonly headerZ:
|
|
109
|
-
};
|
|
110
|
-
zIndexes: {
|
|
111
|
-
readonly underlay: -100;
|
|
112
|
-
readonly base: 0;
|
|
113
|
-
readonly foreground: 100;
|
|
114
|
-
readonly floating: 200;
|
|
115
|
-
readonly appBar: 300;
|
|
116
|
-
readonly flyout: 400;
|
|
117
|
-
readonly modal: 500;
|
|
118
|
-
readonly popover: 600;
|
|
119
|
-
readonly topmost: 700;
|
|
104
|
+
readonly headerZ: 15;
|
|
120
105
|
};
|
|
121
106
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
122
107
|
readonly beige: "#FFF0E5";
|
|
@@ -540,13 +525,7 @@ export declare const coreTheme: Record<"breakpoints", {
|
|
|
540
525
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
541
526
|
1: string;
|
|
542
527
|
2: string;
|
|
543
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys
|
|
544
|
-
readonly headerHeight: {
|
|
545
|
-
readonly base: "4rem";
|
|
546
|
-
readonly md: "5rem";
|
|
547
|
-
};
|
|
548
|
-
readonly headerZ: 300;
|
|
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;
|
|
528
|
+
}, "-">>>, Record<"elevation", import("@codecademy/variance").LiteralPaths<import("../variables").ElevationScale, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
|
|
550
529
|
export type CoreThemeShape = typeof coreTheme;
|
|
551
530
|
export interface CoreTheme extends CoreThemeShape {
|
|
552
531
|
}
|
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, coreElevation, corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing } from '../variables';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @description This is the core theme that all other Codecademy themes are extended from
|
|
@@ -18,8 +18,7 @@ export const coreTheme = createTheme({
|
|
|
18
18
|
lineHeight,
|
|
19
19
|
fontWeight,
|
|
20
20
|
spacing,
|
|
21
|
-
elements
|
|
22
|
-
zIndexes
|
|
21
|
+
elements
|
|
23
22
|
}).addColors(corePalette).addColorModes('light', {
|
|
24
23
|
light: {
|
|
25
24
|
text: {
|
|
@@ -130,4 +129,4 @@ export const coreTheme = createTheme({
|
|
|
130
129
|
}) => ({
|
|
131
130
|
1: `1px solid ${colors['border-primary']}`,
|
|
132
131
|
2: `2px solid ${colors['border-primary']}`
|
|
133
|
-
})).
|
|
132
|
+
})).addScale('elevation', coreElevation).createScaleVariables('elements').addName('core').build();
|
|
@@ -78,39 +78,18 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
78
78
|
lg: string;
|
|
79
79
|
xl: string;
|
|
80
80
|
};
|
|
81
|
-
zIndexes: Record<"zIndexes", import("@codecademy/variance").KeyAsVariable<{
|
|
82
|
-
readonly underlay: -100;
|
|
83
|
-
readonly base: 0;
|
|
84
|
-
readonly foreground: 100;
|
|
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">> & {
|
|
92
|
-
readonly underlay: -100;
|
|
93
|
-
readonly base: 0;
|
|
94
|
-
readonly foreground: 100;
|
|
95
|
-
readonly floating: 200;
|
|
96
|
-
readonly appBar: 300;
|
|
97
|
-
readonly flyout: 400;
|
|
98
|
-
readonly modal: 500;
|
|
99
|
-
readonly popover: 600;
|
|
100
|
-
readonly topmost: 700;
|
|
101
|
-
};
|
|
102
81
|
elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
103
82
|
readonly headerHeight: {
|
|
104
83
|
readonly base: "4rem";
|
|
105
84
|
readonly md: "5rem";
|
|
106
85
|
};
|
|
107
|
-
readonly headerZ:
|
|
86
|
+
readonly headerZ: 15;
|
|
108
87
|
}, "elements">> & {
|
|
109
88
|
readonly headerHeight: {
|
|
110
89
|
readonly base: "4rem";
|
|
111
90
|
readonly md: "5rem";
|
|
112
91
|
};
|
|
113
|
-
readonly headerZ:
|
|
92
|
+
readonly headerZ: 15;
|
|
114
93
|
};
|
|
115
94
|
fontSize: {
|
|
116
95
|
readonly 64: string;
|
|
@@ -141,8 +120,8 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
141
120
|
readonly 64: string;
|
|
142
121
|
readonly 96: string;
|
|
143
122
|
};
|
|
144
|
-
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<
|
|
145
|
-
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<
|
|
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>;
|
|
146
125
|
colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
147
126
|
readonly beige: "#FFF0E5";
|
|
148
127
|
readonly blue: "#1557FF";
|
|
@@ -565,6 +544,7 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
565
544
|
1: string;
|
|
566
545
|
2: string;
|
|
567
546
|
}, "-">;
|
|
547
|
+
elevation: import("@codecademy/variance").LiteralPaths<import("../variables").ElevationScale, "-">;
|
|
568
548
|
name: string;
|
|
569
549
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
570
550
|
lxStudioSuccess: "#06844F";
|
|
@@ -1107,7 +1087,7 @@ export declare const lxStudioTheme: Record<"breakpoints", {
|
|
|
1107
1087
|
}, "-", "_">;
|
|
1108
1088
|
}>;
|
|
1109
1089
|
mode: "light";
|
|
1110
|
-
_getColorValue: (color: "beige" | "blue" | "navy" | "green" | "yellow" | "pink" | "red" | "orange" | "hyper" | "white" | "beige-100" | "blue-0" | "blue-100" | "blue-300" | "blue-400" | "blue-500" | "blue-800" | "navy-100" | "navy-300" | "navy-400" | "navy-500" | "navy-800" | "navy-200" | "navy-600" | "navy-700" | "navy-900" | "green-0" | "green-100" | "green-400" | "green-700" | "green-900" | "yellow-0" | "yellow-400" | "yellow-500" | "yellow-900" | "pink-0" | "pink-400" | "red-0" | "red-300" | "red-400" | "red-500" | "red-600" | "red-900" | "orange-100" | "orange-500" | "hyper-400" | "hyper-500" | "gray-100" | "gray-300" | "gray-800" | "gray-200" | "gray-600" | "gray-900" | "white-100" | "white-300" | "white-400" | "white-500" | "white-200" | "white-600" | "white-700" | "lightBlue" | "lightGreen" | "paleBlue" | "paleGreen" | "palePink" | "paleYellow" | "paleRed" | "black" | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "
|
|
1090
|
+
_getColorValue: (color: "beige" | "blue" | "navy" | "green" | "yellow" | "pink" | "red" | "orange" | "hyper" | "white" | "beige-100" | "blue-0" | "blue-100" | "blue-300" | "blue-400" | "blue-500" | "blue-800" | "navy-100" | "navy-300" | "navy-400" | "navy-500" | "navy-800" | "navy-200" | "navy-600" | "navy-700" | "navy-900" | "green-0" | "green-100" | "green-400" | "green-700" | "green-900" | "yellow-0" | "yellow-400" | "yellow-500" | "yellow-900" | "pink-0" | "pink-400" | "red-0" | "red-300" | "red-400" | "red-500" | "red-600" | "red-900" | "orange-100" | "orange-500" | "hyper-400" | "hyper-500" | "gray-100" | "gray-300" | "gray-800" | "gray-200" | "gray-600" | "gray-900" | "white-100" | "white-300" | "white-400" | "white-500" | "white-200" | "white-600" | "white-700" | "shadow-primary" | "shadow-secondary" | "lightBlue" | "lightGreen" | "paleBlue" | "paleGreen" | "palePink" | "paleYellow" | "paleRed" | "black" | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "danger-hover" | "interface-hover" | "border-disabled" | "border-secondary" | "border-tertiary" | "lxStudioSuccess" | "lxStudioBgPrimary" | "sapphire") => string;
|
|
1111
1091
|
}> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
|
|
1112
1092
|
export type LxStudioThemeShape = typeof lxStudioTheme;
|
|
1113
1093
|
export type LxStudioTheme = LxStudioThemeShape;
|
|
@@ -22,7 +22,7 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
22
22
|
md: string;
|
|
23
23
|
lg: string;
|
|
24
24
|
xl: string;
|
|
25
|
-
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"breakpoints", {
|
|
25
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
|
|
26
26
|
c_base: string;
|
|
27
27
|
c_xs: string;
|
|
28
28
|
c_sm: string;
|
|
@@ -62,39 +62,18 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
62
62
|
lg: string;
|
|
63
63
|
xl: string;
|
|
64
64
|
};
|
|
65
|
-
zIndexes: Record<"zIndexes", import("@codecademy/variance").KeyAsVariable<{
|
|
66
|
-
readonly underlay: -100;
|
|
67
|
-
readonly base: 0;
|
|
68
|
-
readonly foreground: 100;
|
|
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">> & {
|
|
76
|
-
readonly underlay: -100;
|
|
77
|
-
readonly base: 0;
|
|
78
|
-
readonly foreground: 100;
|
|
79
|
-
readonly floating: 200;
|
|
80
|
-
readonly appBar: 300;
|
|
81
|
-
readonly flyout: 400;
|
|
82
|
-
readonly modal: 500;
|
|
83
|
-
readonly popover: 600;
|
|
84
|
-
readonly topmost: 700;
|
|
85
|
-
};
|
|
86
65
|
elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
87
66
|
readonly headerHeight: {
|
|
88
67
|
readonly base: "4rem";
|
|
89
68
|
readonly md: "5rem";
|
|
90
69
|
};
|
|
91
|
-
readonly headerZ:
|
|
70
|
+
readonly headerZ: 15;
|
|
92
71
|
}, "elements">> & {
|
|
93
72
|
readonly headerHeight: {
|
|
94
73
|
readonly base: "4rem";
|
|
95
74
|
readonly md: "5rem";
|
|
96
75
|
};
|
|
97
|
-
readonly headerZ:
|
|
76
|
+
readonly headerZ: 15;
|
|
98
77
|
};
|
|
99
78
|
borderRadii: {
|
|
100
79
|
none: string;
|
|
@@ -133,8 +112,8 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
133
112
|
readonly 64: string;
|
|
134
113
|
readonly 96: string;
|
|
135
114
|
};
|
|
136
|
-
_variables: import("@codecademy/variance/dist/createTheme/types").Assign<
|
|
137
|
-
_tokens: import("@codecademy/variance/dist/createTheme/types").Assign<
|
|
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>;
|
|
138
117
|
colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
139
118
|
readonly beige: "#FFF0E5";
|
|
140
119
|
readonly blue: "#1557FF";
|
|
@@ -557,6 +536,7 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
557
536
|
1: string;
|
|
558
537
|
2: string;
|
|
559
538
|
}, "-">;
|
|
539
|
+
elevation: import("@codecademy/variance").LiteralPaths<import("../variables").ElevationScale, "-">;
|
|
560
540
|
name: string;
|
|
561
541
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
562
542
|
percipioTextPrimary: "#222325";
|
|
@@ -1169,8 +1149,8 @@ export declare const percipioTheme: Record<"breakpoints", {
|
|
|
1169
1149
|
}, "-", "_">;
|
|
1170
1150
|
}>;
|
|
1171
1151
|
mode: "light";
|
|
1172
|
-
_getColorValue: (color: "beige" | "blue" | "navy" | "green" | "yellow" | "pink" | "red" | "orange" | "hyper" | "white" | "beige-100" | "blue-0" | "blue-100" | "blue-300" | "blue-400" | "blue-500" | "blue-800" | "navy-100" | "navy-300" | "navy-400" | "navy-500" | "navy-800" | "navy-200" | "navy-600" | "navy-700" | "navy-900" | "green-0" | "green-100" | "green-400" | "green-700" | "green-900" | "yellow-0" | "yellow-400" | "yellow-500" | "yellow-900" | "pink-0" | "pink-400" | "red-0" | "red-300" | "red-400" | "red-500" | "red-600" | "red-900" | "orange-100" | "orange-500" | "hyper-400" | "hyper-500" | "gray-100" | "gray-300" | "gray-800" | "gray-200" | "gray-600" | "gray-900" | "white-100" | "white-300" | "white-400" | "white-500" | "white-200" | "white-600" | "white-700" | "lightBlue" | "lightGreen" | "paleBlue" | "paleGreen" | "palePink" | "paleYellow" | "paleRed" | "black" | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "
|
|
1173
|
-
}
|
|
1152
|
+
_getColorValue: (color: "beige" | "blue" | "navy" | "green" | "yellow" | "pink" | "red" | "orange" | "hyper" | "white" | "beige-100" | "blue-0" | "blue-100" | "blue-300" | "blue-400" | "blue-500" | "blue-800" | "navy-100" | "navy-300" | "navy-400" | "navy-500" | "navy-800" | "navy-200" | "navy-600" | "navy-700" | "navy-900" | "green-0" | "green-100" | "green-400" | "green-700" | "green-900" | "yellow-0" | "yellow-400" | "yellow-500" | "yellow-900" | "pink-0" | "pink-400" | "red-0" | "red-300" | "red-400" | "red-500" | "red-600" | "red-900" | "orange-100" | "orange-500" | "hyper-400" | "hyper-500" | "gray-100" | "gray-300" | "gray-800" | "gray-200" | "gray-600" | "gray-900" | "white-100" | "white-300" | "white-400" | "white-500" | "white-200" | "white-600" | "white-700" | "shadow-primary" | "shadow-secondary" | "lightBlue" | "lightGreen" | "paleBlue" | "paleGreen" | "palePink" | "paleYellow" | "paleRed" | "black" | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "danger-hover" | "interface-hover" | "border-disabled" | "border-secondary" | "border-tertiary" | "sapphire" | "percipioTextPrimary" | "percipioTextSecondary" | "percipioTextDisabled" | "percipioTextAccent" | "percipioBgPrimary" | "percipioBgSuccess" | "percipioBgWarning" | "percipioBgError" | "percipioActionPrimaryHover" | "percipioActionSecondary" | "percipioActionSecondaryHover" | "percipioActionDangerHover" | "percipioFeedbackSuccess" | "percipioFeedbackWarning" | "percipioDanger") => string;
|
|
1153
|
+
}>, Record<"elevation", import("@codecademy/variance").LiteralPaths<import("../variables").ElevationScale, "-">>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
|
|
1174
1154
|
export type PercipioThemeShape = typeof percipioTheme;
|
|
1175
1155
|
export interface PercipioTheme extends PercipioThemeShape {
|
|
1176
1156
|
}
|
package/dist/themes/percipio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createTheme } from '@codecademy/variance';
|
|
2
|
-
import { fontWeightMediumTitle, percipioFontFamily, percipioPalette } from '../variables';
|
|
2
|
+
import { fontWeightMediumTitle, percipioElevation, percipioFontFamily, percipioPalette } from '../variables';
|
|
3
3
|
import { coreTheme } from './core';
|
|
4
4
|
export const percipioTheme = createTheme({
|
|
5
5
|
...coreTheme,
|
|
@@ -53,4 +53,4 @@ export const percipioTheme = createTheme({
|
|
|
53
53
|
disabled: 'navy-300'
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
}).addName('percipio').build();
|
|
56
|
+
}).addScale('elevation', percipioElevation).addName('percipio').build();
|
|
@@ -50,17 +50,13 @@ 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
|
-
|
|
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", {
|
|
53
|
+
}> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
|
|
54
|
+
readonly headerHeight: {
|
|
55
|
+
readonly base: "4rem";
|
|
56
|
+
readonly md: "5rem";
|
|
57
|
+
};
|
|
58
|
+
readonly headerZ: 15;
|
|
59
|
+
}, "elements">>> & 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", {
|
|
64
60
|
c_base: string;
|
|
65
61
|
c_xs: string;
|
|
66
62
|
c_sm: string;
|
|
@@ -140,18 +136,7 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
140
136
|
readonly base: "4rem";
|
|
141
137
|
readonly md: "5rem";
|
|
142
138
|
};
|
|
143
|
-
readonly headerZ:
|
|
144
|
-
};
|
|
145
|
-
zIndexes: {
|
|
146
|
-
readonly underlay: -100;
|
|
147
|
-
readonly base: 0;
|
|
148
|
-
readonly foreground: 100;
|
|
149
|
-
readonly floating: 200;
|
|
150
|
-
readonly appBar: 300;
|
|
151
|
-
readonly flyout: 400;
|
|
152
|
-
readonly modal: 500;
|
|
153
|
-
readonly popover: 600;
|
|
154
|
-
readonly topmost: 700;
|
|
139
|
+
readonly headerZ: 15;
|
|
155
140
|
};
|
|
156
141
|
} & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
|
|
157
142
|
readonly beige: "#FFF0E5";
|
|
@@ -575,13 +560,7 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
575
560
|
}>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
|
|
576
561
|
1: string;
|
|
577
562
|
2: string;
|
|
578
|
-
}, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"
|
|
579
|
-
readonly headerHeight: {
|
|
580
|
-
readonly base: "4rem";
|
|
581
|
-
readonly md: "5rem";
|
|
582
|
-
};
|
|
583
|
-
readonly headerZ: 300;
|
|
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<{
|
|
563
|
+
}, "-">>>, Record<"elevation", import("@codecademy/variance").LiteralPaths<import("../variables").ElevationScale, "-">>>, 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<{
|
|
585
564
|
readonly lightBeige: "#FFFBF8";
|
|
586
565
|
readonly gold: "#8A7300";
|
|
587
566
|
readonly teal: "#006D82";
|
|
@@ -1105,7 +1084,7 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
1105
1084
|
}, "-", "_">;
|
|
1106
1085
|
}>;
|
|
1107
1086
|
mode: "light" | "dark";
|
|
1108
|
-
_getColorValue: (color: import("@codecademy/variance").Path<{
|
|
1087
|
+
_getColorValue: (color: "shadow-primary" | "shadow-secondary" | import("@codecademy/variance").Path<{
|
|
1109
1088
|
readonly beige: "#FFF0E5";
|
|
1110
1089
|
readonly blue: "#1557FF";
|
|
1111
1090
|
readonly green: "#008A27";
|
|
@@ -1174,7 +1153,7 @@ export declare const platformTheme: Record<"breakpoints", {
|
|
|
1174
1153
|
readonly "white-200": string;
|
|
1175
1154
|
readonly "white-600": string;
|
|
1176
1155
|
readonly "white-700": string;
|
|
1177
|
-
}, "-"> | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "
|
|
1156
|
+
}, "-"> | "text" | "secondary" | "background" | "primary" | "danger" | "interface" | "border-primary" | "text-accent" | "text-disabled" | "text-secondary" | "secondary-hover" | "feedback-error" | "feedback-success" | "feedback-warning" | "background-disabled" | "background-error" | "background-success" | "background-warning" | "background-contrast" | "background-current" | "background-primary" | "background-selected" | "background-hover" | "primary-hover" | "primary-inverse" | "danger-hover" | "interface-hover" | "border-disabled" | "border-secondary" | "border-tertiary" | import("@codecademy/variance").Path<{
|
|
1178
1157
|
readonly lightBeige: "#FFFBF8";
|
|
1179
1158
|
readonly gold: "#8A7300";
|
|
1180
1159
|
readonly teal: "#006D82";
|
|
@@ -4,9 +4,8 @@ export declare const elements: {
|
|
|
4
4
|
readonly md: "5rem";
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* z-index for global page headers.
|
|
8
|
-
*
|
|
9
|
-
* Prefer `zIndex="appBar"` in new code.
|
|
7
|
+
* Semi-arbitrary z-index for global page headers.
|
|
8
|
+
* @remarks PLEASE talk to web platform before adding new z-index constants!
|
|
10
9
|
*/
|
|
11
|
-
readonly headerZ:
|
|
10
|
+
readonly headerZ: 15;
|
|
12
11
|
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { zIndexes } from './zIndexes';
|
|
2
1
|
export const elements = {
|
|
3
2
|
headerHeight: {
|
|
4
3
|
base: '4rem',
|
|
5
4
|
md: '5rem'
|
|
6
5
|
},
|
|
7
6
|
/**
|
|
8
|
-
* z-index for global page headers.
|
|
9
|
-
*
|
|
10
|
-
* Prefer `zIndex="appBar"` in new code.
|
|
7
|
+
* Semi-arbitrary z-index for global page headers.
|
|
8
|
+
* @remarks PLEASE talk to web platform before adding new z-index constants!
|
|
11
9
|
*/
|
|
12
|
-
headerZ:
|
|
10
|
+
headerZ: 15
|
|
13
11
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type ThemeColors = Record<string, string>;
|
|
2
|
+
export type ElevationStateStyles = {
|
|
3
|
+
shadow: string;
|
|
4
|
+
transform: string;
|
|
5
|
+
};
|
|
6
|
+
export type ElevationScale = {
|
|
7
|
+
rest: ElevationStateStyles;
|
|
8
|
+
hover: ElevationStateStyles;
|
|
9
|
+
hoverMirrored: ElevationStateStyles;
|
|
10
|
+
};
|
|
11
|
+
export type ElevationState = keyof ElevationScale;
|
|
12
|
+
export type ElevationScaleFactory = (theme: {
|
|
13
|
+
colors: ThemeColors;
|
|
14
|
+
}) => ElevationScale;
|
|
15
|
+
export declare const coreElevation: ElevationScaleFactory;
|
|
16
|
+
export declare const percipioElevation: ElevationScaleFactory;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const coreElevation = ({
|
|
2
|
+
colors
|
|
3
|
+
}) => {
|
|
4
|
+
const shadowPrimary = colors['shadow-primary'];
|
|
5
|
+
const offset = 8;
|
|
6
|
+
const lift = 4;
|
|
7
|
+
const shadow = x => `${x}px ${offset}px 0 0 ${shadowPrimary}`;
|
|
8
|
+
return {
|
|
9
|
+
rest: {
|
|
10
|
+
shadow: `0 0 0 0 ${shadowPrimary}`,
|
|
11
|
+
transform: 'none'
|
|
12
|
+
},
|
|
13
|
+
hover: {
|
|
14
|
+
shadow: shadow(-offset),
|
|
15
|
+
transform: `translate(${lift}px, -${lift}px)`
|
|
16
|
+
},
|
|
17
|
+
hoverMirrored: {
|
|
18
|
+
shadow: shadow(offset),
|
|
19
|
+
transform: `translate(-${lift}px, -${lift}px)`
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export const percipioElevation = ({
|
|
24
|
+
colors
|
|
25
|
+
}) => {
|
|
26
|
+
const shadowPrimary = colors['shadow-primary'];
|
|
27
|
+
const shadowSecondary = colors['shadow-secondary'];
|
|
28
|
+
const hover = `0 1px 4px 0 ${shadowPrimary}, 0 2px 11px 0 ${shadowSecondary}`;
|
|
29
|
+
return {
|
|
30
|
+
rest: {
|
|
31
|
+
shadow: `0 1px 4px 0 ${shadowPrimary}, 0 2px 7px 0 ${shadowPrimary}`,
|
|
32
|
+
transform: 'none'
|
|
33
|
+
},
|
|
34
|
+
hover: {
|
|
35
|
+
shadow: hover,
|
|
36
|
+
transform: 'none'
|
|
37
|
+
},
|
|
38
|
+
hoverMirrored: {
|
|
39
|
+
shadow: hover,
|
|
40
|
+
transform: 'none'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './borderRadii';
|
|
2
2
|
export * from './colors';
|
|
3
3
|
export * from './elements';
|
|
4
|
+
export * from './elevation';
|
|
4
5
|
export * from './responsive';
|
|
5
6
|
export * from './spacing';
|
|
6
7
|
export * from './timing';
|
|
7
8
|
export * from './typography';
|
|
8
|
-
export * from './zIndexes';
|
package/dist/variables/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './borderRadii';
|
|
2
2
|
export * from './colors';
|
|
3
3
|
export * from './elements';
|
|
4
|
+
export * from './elevation';
|
|
4
5
|
export * from './responsive';
|
|
5
6
|
export * from './spacing';
|
|
6
7
|
export * from './timing';
|
|
7
|
-
export * from './typography';
|
|
8
|
-
export * from './zIndexes';
|
|
8
|
+
export * from './typography';
|
|
@@ -455,8 +455,6 @@ export declare const positioning: {
|
|
|
455
455
|
};
|
|
456
456
|
readonly zIndex: {
|
|
457
457
|
readonly property: "zIndex";
|
|
458
|
-
readonly scale: "zIndexes";
|
|
459
|
-
readonly allowRawValue: true;
|
|
460
458
|
};
|
|
461
459
|
readonly opacity: {
|
|
462
460
|
readonly property: "opacity";
|
|
@@ -1217,8 +1215,6 @@ export declare const all: {
|
|
|
1217
1215
|
};
|
|
1218
1216
|
zIndex: {
|
|
1219
1217
|
readonly property: "zIndex";
|
|
1220
|
-
readonly scale: "zIndexes";
|
|
1221
|
-
readonly allowRawValue: true;
|
|
1222
1218
|
};
|
|
1223
1219
|
opacity: {
|
|
1224
1220
|
readonly property: "opacity";
|
package/dist/variance/config.js
CHANGED
|
@@ -450,13 +450,8 @@ export const positioning = {
|
|
|
450
450
|
resolveProperty: getPropertyMode,
|
|
451
451
|
transform: transformSize
|
|
452
452
|
},
|
|
453
|
-
// `scale: 'zIndexes'` resolves token names (e.g. `zIndex="modal"`) to `var(--zIndexes-*)`.
|
|
454
|
-
// `allowRawValue` keeps the numeric/global escape hatch (e.g. `zIndex={550}`,
|
|
455
|
-
// `zIndex={zIndexes.foreground + 1}`) that scaled props otherwise reject.
|
|
456
453
|
zIndex: {
|
|
457
|
-
property: 'zIndex'
|
|
458
|
-
scale: 'zIndexes',
|
|
459
|
-
allowRawValue: true
|
|
454
|
+
property: 'zIndex'
|
|
460
455
|
},
|
|
461
456
|
opacity: {
|
|
462
457
|
property: 'opacity'
|
package/dist/variance/props.d.ts
CHANGED
|
@@ -324,8 +324,6 @@ export declare const positioning: import("@codecademy/variance/dist/types/config
|
|
|
324
324
|
};
|
|
325
325
|
readonly zIndex: {
|
|
326
326
|
readonly property: "zIndex";
|
|
327
|
-
readonly scale: "zIndexes";
|
|
328
|
-
readonly allowRawValue: true;
|
|
329
327
|
};
|
|
330
328
|
readonly opacity: {
|
|
331
329
|
readonly property: "opacity";
|
|
@@ -1220,8 +1218,6 @@ export declare const css: import("@codecademy/variance/dist/types/config").CSS<i
|
|
|
1220
1218
|
};
|
|
1221
1219
|
zIndex: {
|
|
1222
1220
|
readonly property: "zIndex";
|
|
1223
|
-
readonly scale: "zIndexes";
|
|
1224
|
-
readonly allowRawValue: true;
|
|
1225
1221
|
};
|
|
1226
1222
|
opacity: {
|
|
1227
1223
|
readonly property: "opacity";
|
|
@@ -1899,8 +1895,6 @@ export declare const variant: import("@codecademy/variance/dist/types/config").V
|
|
|
1899
1895
|
};
|
|
1900
1896
|
zIndex: {
|
|
1901
1897
|
readonly property: "zIndex";
|
|
1902
|
-
readonly scale: "zIndexes";
|
|
1903
|
-
readonly allowRawValue: true;
|
|
1904
1898
|
};
|
|
1905
1899
|
opacity: {
|
|
1906
1900
|
readonly property: "opacity";
|
|
@@ -2578,8 +2572,6 @@ export declare const states: import("@codecademy/variance/dist/types/config").St
|
|
|
2578
2572
|
};
|
|
2579
2573
|
zIndex: {
|
|
2580
2574
|
readonly property: "zIndex";
|
|
2581
|
-
readonly scale: "zIndexes";
|
|
2582
|
-
readonly allowRawValue: true;
|
|
2583
2575
|
};
|
|
2584
2576
|
opacity: {
|
|
2585
2577
|
readonly property: "opacity";
|
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.1.1-alpha.
|
|
4
|
+
"version": "20.1.1-alpha.c9d85c.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.c9d85c.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,53 +0,0 @@
|
|
|
1
|
-
import { Globals } from 'csstype';
|
|
2
|
-
/**
|
|
3
|
-
* Semantic z-index scale. Every z-index in Gamut should reference a token here rather than a
|
|
4
|
-
* magic number.
|
|
5
|
-
*
|
|
6
|
-
* The `zIndex` system prop accepts a token name directly (e.g. `zIndex="modal"`), this object's
|
|
7
|
-
* numeric values (e.g. `zIndex={zIndexes.modal}`), a raw in-between number as an escape hatch
|
|
8
|
-
* (e.g. `zIndex={550}`), or arithmetic on a token (e.g. `zIndexes.foreground - 2`).
|
|
9
|
-
*
|
|
10
|
-
* Values are spaced by 100 so in-between escape-hatch numbers are available. `floating` (200) is
|
|
11
|
-
* 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 zIndexes: {
|
|
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`).
|
|
24
|
-
*/
|
|
25
|
-
readonly foreground: 100;
|
|
26
|
-
/**
|
|
27
|
-
* Portal floor: the default for `BodyPortal`, and the layer for persistent floating page
|
|
28
|
-
* furniture at rest (e.g. an AI chat launcher, help bubble). Above page content, below the
|
|
29
|
-
* app nav and all overlays.
|
|
30
|
-
*/
|
|
31
|
-
readonly floating: 200;
|
|
32
|
-
/** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
|
|
33
|
-
readonly appBar: 300;
|
|
34
|
-
/** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
|
|
35
|
-
readonly flyout: 400;
|
|
36
|
-
/** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
|
|
37
|
-
readonly modal: 500;
|
|
38
|
-
/** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
|
|
39
|
-
readonly popover: 600;
|
|
40
|
-
/**
|
|
41
|
-
* Top-most transient overlays that must never be clipped: floating tooltips (`FloatingTip`)
|
|
42
|
-
* and toasts / notifications (`Toaster`). Highest layer — nothing in Gamut sits above it.
|
|
43
|
-
*/
|
|
44
|
-
readonly topmost: 700;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* A `zIndexes` token name (e.g. `'foreground'`), a raw number as an escape hatch
|
|
48
|
-
* (e.g. `550`, or `zIndexes.foreground + 1`), or a CSS global (`'initial'`, `'inherit'`, …).
|
|
49
|
-
* Use this for component `zIndex` props that forward to a `Box`-like `zIndex` system prop or
|
|
50
|
-
* `BodyPortal`. The scale still resolves token names to `var(--zIndexes-*)` at runtime; this
|
|
51
|
-
* type just also permits the numeric/global escape hatches the scale type alone would reject.
|
|
52
|
-
*/
|
|
53
|
-
export type ZIndexType = keyof typeof zIndexes | number | Globals;
|
|
@@ -1,52 +0,0 @@
|
|
|
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` system prop accepts a token name directly (e.g. `zIndex="modal"`), this object's
|
|
6
|
-
* numeric values (e.g. `zIndex={zIndexes.modal}`), a raw in-between number as an escape hatch
|
|
7
|
-
* (e.g. `zIndex={550}`), or arithmetic on a token (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 const zIndexes = {
|
|
15
|
-
/** Decorative layer behind content (underlines, backdrops, shadows). */
|
|
16
|
-
underlay: -100,
|
|
17
|
-
/** Ground layer — establishes a local stacking context without lifting above siblings. */
|
|
18
|
-
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
|
-
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
|
-
floating: 200,
|
|
31
|
-
/** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
|
|
32
|
-
appBar: 300,
|
|
33
|
-
/** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
|
|
34
|
-
flyout: 400,
|
|
35
|
-
/** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
|
|
36
|
-
modal: 500,
|
|
37
|
-
/** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
|
|
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
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* A `zIndexes` token name (e.g. `'foreground'`), a raw number as an escape hatch
|
|
48
|
-
* (e.g. `550`, or `zIndexes.foreground + 1`), or a CSS global (`'initial'`, `'inherit'`, …).
|
|
49
|
-
* Use this for component `zIndex` props that forward to a `Box`-like `zIndex` system prop or
|
|
50
|
-
* `BodyPortal`. The scale still resolves token names to `var(--zIndexes-*)` at runtime; this
|
|
51
|
-
* type just also permits the numeric/global escape hatches the scale type alone would reject.
|
|
52
|
-
*/
|