@codecademy/variance 0.23.0-alpha.fc9d3e.0 → 0.23.1-alpha.203968.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
|
@@ -34,19 +34,23 @@ export interface BreakpointArray<T> {
|
|
|
34
34
|
9?: T;
|
|
35
35
|
10?: T;
|
|
36
36
|
}
|
|
37
|
-
export interface
|
|
37
|
+
export interface MediaQueryMap<T> {
|
|
38
38
|
_?: T;
|
|
39
39
|
xs?: T;
|
|
40
40
|
sm?: T;
|
|
41
41
|
md?: T;
|
|
42
42
|
lg?: T;
|
|
43
43
|
xl?: T;
|
|
44
|
+
}
|
|
45
|
+
export interface ContainerQueryMap<T> {
|
|
46
|
+
c_base?: T;
|
|
44
47
|
c_xs?: T;
|
|
45
48
|
c_sm?: T;
|
|
46
49
|
c_md?: T;
|
|
47
50
|
c_lg?: T;
|
|
48
51
|
c_xl?: T;
|
|
49
52
|
}
|
|
53
|
+
export type BreakpointMap<T> = ContainerQueryMap<T> & MediaQueryMap<T>;
|
|
50
54
|
export type ResponsiveProp<T> = T | BreakpointMap<T> | BreakpointArray<T>;
|
|
51
55
|
export interface CSSObject {
|
|
52
56
|
[key: string]: string | number | CSSObject | undefined;
|
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', 'c_xs', 'c_sm', 'c_md', 'c_lg', 'c_xl'];
|
|
3
|
+
const BREAKPOINT_KEYS = ['_', 'xs', 'sm', 'md', 'lg', 'xl', 'c_base', '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
|
|
@@ -13,6 +13,7 @@ export const parseBreakpoints = breakpoints => {
|
|
|
13
13
|
md,
|
|
14
14
|
lg,
|
|
15
15
|
xl,
|
|
16
|
+
c_base,
|
|
16
17
|
c_xs,
|
|
17
18
|
c_sm,
|
|
18
19
|
c_md,
|
|
@@ -23,7 +24,7 @@ export const parseBreakpoints = breakpoints => {
|
|
|
23
24
|
// Ensure order for mapping - media queries first, then container queries
|
|
24
25
|
return {
|
|
25
26
|
map: breakpoints,
|
|
26
|
-
array: [xs, sm, md, lg, xl, c_xs, c_sm, c_md, c_lg, c_xl]
|
|
27
|
+
array: [xs, sm, md, lg, xl, c_base, c_xs, c_sm, c_md, c_lg, c_xl]
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
export const isMediaArray = val => Array.isArray(val);
|
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.23.
|
|
4
|
+
"version": "0.23.1-alpha.203968.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": "fbd215dfaabc0562f40e14213315320d25d4c682"
|
|
36
36
|
}
|