@codecademy/gamut-styles 20.1.1-alpha.39981f.0 → 20.1.1-alpha.4b0af5.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.
|
@@ -1,36 +1,14 @@
|
|
|
1
1
|
type ThemeColors = Record<string, string>;
|
|
2
|
-
/**
|
|
3
|
-
* The visual treatment of a surface at a single elevation state.
|
|
4
|
-
* These are type aliases rather than interfaces so they keep the implicit
|
|
5
|
-
* index signatures `addScale`'s constraint requires.
|
|
6
|
-
*/
|
|
7
2
|
export type ElevationStateStyles = {
|
|
8
3
|
shadow: string;
|
|
9
4
|
transform: string;
|
|
10
5
|
};
|
|
11
|
-
/**
|
|
12
|
-
* State keys are camelCase: variance's `LiteralPaths` splits token paths on
|
|
13
|
-
* `-`, so a hyphenated key like `hover-mirrored` would resolve to `never` and
|
|
14
|
-
* drop out of the theme type. `hoverMirrored` is for surfaces that cast their
|
|
15
|
-
* shadow to the opposite side (e.g. Card's `patternRight` shadow).
|
|
16
|
-
*/
|
|
17
6
|
export type ElevationScale = {
|
|
18
7
|
rest: ElevationStateStyles;
|
|
19
8
|
hover: ElevationStateStyles;
|
|
20
9
|
hoverMirrored: ElevationStateStyles;
|
|
21
10
|
};
|
|
22
11
|
export type ElevationState = keyof ElevationScale;
|
|
23
|
-
/**
|
|
24
|
-
* Elevation scales describe how a surface renders shadow and lift at rest and
|
|
25
|
-
* on hover. Each theme provides its own scale via
|
|
26
|
-
* `.addScale('elevation', ...)`, which passes in that theme's `colors` — so
|
|
27
|
-
* `colors['shadow-primary']` resolves per theme and per color mode without
|
|
28
|
-
* this file ever importing a theme (which would be a circular dependency).
|
|
29
|
-
*
|
|
30
|
-
* The shared return type guarantees every theme emits the same elevation
|
|
31
|
-
* tokens, so lookups like `theme.elevation['hover-shadow']` are safe under
|
|
32
|
-
* any theme.
|
|
33
|
-
*/
|
|
34
12
|
export type ElevationScaleFactory = (theme: {
|
|
35
13
|
colors: ThemeColors;
|
|
36
14
|
}) => ElevationScale;
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The visual treatment of a surface at a single elevation state.
|
|
3
|
-
* These are type aliases rather than interfaces so they keep the implicit
|
|
4
|
-
* index signatures `addScale`'s constraint requires.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* State keys are camelCase: variance's `LiteralPaths` splits token paths on
|
|
9
|
-
* `-`, so a hyphenated key like `hover-mirrored` would resolve to `never` and
|
|
10
|
-
* drop out of the theme type. `hoverMirrored` is for surfaces that cast their
|
|
11
|
-
* shadow to the opposite side (e.g. Card's `patternRight` shadow).
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Elevation scales describe how a surface renders shadow and lift at rest and
|
|
16
|
-
* on hover. Each theme provides its own scale via
|
|
17
|
-
* `.addScale('elevation', ...)`, which passes in that theme's `colors` — so
|
|
18
|
-
* `colors['shadow-primary']` resolves per theme and per color mode without
|
|
19
|
-
* this file ever importing a theme (which would be a circular dependency).
|
|
20
|
-
*
|
|
21
|
-
* The shared return type guarantees every theme emits the same elevation
|
|
22
|
-
* tokens, so lookups like `theme.elevation['hover-shadow']` are safe under
|
|
23
|
-
* any theme.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
1
|
export const coreElevation = ({
|
|
27
2
|
colors
|
|
28
3
|
}) => {
|
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.4b0af5.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.4b0af5.0",
|
|
8
8
|
"@emotion/is-prop-valid": "^1.1.0",
|
|
9
9
|
"framer-motion": "^11.18.0",
|
|
10
10
|
"get-nonce": "^1.0.0",
|