@codecademy/variance 0.22.2-alpha.edc783.0 → 0.23.0-alpha.1d3482.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/types/props.d.ts
CHANGED
|
@@ -8,6 +8,11 @@ interface BreakpointKeys<T = string> {
|
|
|
8
8
|
md: T;
|
|
9
9
|
lg: T;
|
|
10
10
|
xl: T;
|
|
11
|
+
c_xs: T;
|
|
12
|
+
c_sm: T;
|
|
13
|
+
c_md: T;
|
|
14
|
+
c_lg: T;
|
|
15
|
+
c_xl: T;
|
|
11
16
|
}
|
|
12
17
|
export interface BreakpointCache {
|
|
13
18
|
map: BreakpointKeys;
|
|
@@ -23,6 +28,11 @@ export interface MediaQueryArray<T> {
|
|
|
23
28
|
3?: T;
|
|
24
29
|
4?: T;
|
|
25
30
|
5?: T;
|
|
31
|
+
6?: T;
|
|
32
|
+
7?: T;
|
|
33
|
+
8?: T;
|
|
34
|
+
9?: T;
|
|
35
|
+
10?: T;
|
|
26
36
|
}
|
|
27
37
|
export interface MediaQueryMap<T> {
|
|
28
38
|
_?: T;
|
|
@@ -31,6 +41,11 @@ export interface MediaQueryMap<T> {
|
|
|
31
41
|
md?: T;
|
|
32
42
|
lg?: T;
|
|
33
43
|
xl?: T;
|
|
44
|
+
c_xs?: T;
|
|
45
|
+
c_sm?: T;
|
|
46
|
+
c_md?: T;
|
|
47
|
+
c_lg?: T;
|
|
48
|
+
c_xl?: T;
|
|
34
49
|
}
|
|
35
50
|
export type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
|
|
36
51
|
export interface CSSObject {
|
package/dist/types/theme.d.ts
CHANGED
package/dist/utils/responsive.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import intersection from 'lodash/intersection';
|
|
2
2
|
import omit from 'lodash/omit';
|
|
3
|
-
const BREAKPOINT_KEYS = ['_', 'xs', 'sm', 'md', 'lg', 'xl'];
|
|
3
|
+
const BREAKPOINT_KEYS = ['_', 'xs', 'sm', 'md', 'lg', 'xl', 'c_xs', 'c_sm', 'c_md', 'c_lg', 'c_xl'];
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Destructures the themes breakpoints into an ordered structure to traverse
|
|
@@ -12,13 +12,18 @@ export const parseBreakpoints = breakpoints => {
|
|
|
12
12
|
sm,
|
|
13
13
|
md,
|
|
14
14
|
lg,
|
|
15
|
-
xl
|
|
15
|
+
xl,
|
|
16
|
+
c_xs,
|
|
17
|
+
c_sm,
|
|
18
|
+
c_md,
|
|
19
|
+
c_lg,
|
|
20
|
+
c_xl
|
|
16
21
|
} = breakpoints ?? {};
|
|
17
22
|
|
|
18
|
-
// Ensure order for mapping
|
|
23
|
+
// Ensure order for mapping - media queries first, then container queries
|
|
19
24
|
return {
|
|
20
25
|
map: breakpoints,
|
|
21
|
-
array: [xs, sm, md, lg, xl]
|
|
26
|
+
array: [xs, sm, md, lg, xl, c_xs, c_sm, c_md, c_lg, c_xl]
|
|
22
27
|
};
|
|
23
28
|
};
|
|
24
29
|
export const isMediaArray = val => Array.isArray(val);
|
|
@@ -20,9 +20,13 @@ const templateBreakpoints = (value, alias, theme) => {
|
|
|
20
20
|
breakpoints
|
|
21
21
|
} = theme;
|
|
22
22
|
Object.keys(breakpoints).forEach(key => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const breakpointValue = rest[key];
|
|
24
|
+
// Only create CSS rules for breakpoints that have defined values
|
|
25
|
+
if (breakpointValue !== undefined) {
|
|
26
|
+
css[breakpoints[key]] = {
|
|
27
|
+
[alias]: breakpointValue
|
|
28
|
+
};
|
|
29
|
+
}
|
|
26
30
|
});
|
|
27
31
|
}
|
|
28
32
|
return css;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/variance",
|
|
3
3
|
"description": "Constraint based CSS in JS for building scalable design systems",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.23.0-alpha.1d3482.0",
|
|
5
5
|
"author": "codecaaron <aaron@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"csstype": "^3.0.7",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"build": "nx build @codecademy/variance"
|
|
33
33
|
},
|
|
34
34
|
"types": "dist/index.d.ts",
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "e63a36a8e4ce71b6162fc68925a70e3fdd478e2f"
|
|
36
36
|
}
|