@codecademy/variance 0.23.0-alpha.e24bd5.0 → 0.23.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.
@@ -21,7 +21,7 @@ export interface BreakpointCache {
21
21
  export type ThemeProps<Props = {}> = Props & {
22
22
  theme?: Theme;
23
23
  };
24
- export interface MediaQueryArray<T> {
24
+ export interface BreakpointArray<T> {
25
25
  0?: T;
26
26
  1?: T;
27
27
  2?: T;
@@ -41,13 +41,16 @@ export interface MediaQueryMap<T> {
41
41
  md?: T;
42
42
  lg?: T;
43
43
  xl?: T;
44
+ }
45
+ export interface ContainerQueryMap<T> {
44
46
  c_xs?: T;
45
47
  c_sm?: T;
46
48
  c_md?: T;
47
49
  c_lg?: T;
48
50
  c_xl?: T;
49
51
  }
50
- export type ResponsiveProp<T> = T | MediaQueryMap<T> | MediaQueryArray<T>;
52
+ export type BreakpointMap<T> = ContainerQueryMap<T> & MediaQueryMap<T>;
53
+ export type ResponsiveProp<T> = T | BreakpointMap<T> | BreakpointArray<T>;
51
54
  export interface CSSObject {
52
55
  [key: string]: string | number | CSSObject | undefined;
53
56
  }
@@ -1,16 +1,16 @@
1
1
  import { AbstractPropTransformer } from '../types/config';
2
- import { BreakpointCache, CSSObject, MediaQueryMap, ThemeProps } from '../types/props';
2
+ import { BreakpointCache, BreakpointMap, CSSObject, ThemeProps } from '../types/props';
3
3
  import { Breakpoints } from '../types/theme';
4
4
  /**
5
5
  * Destructures the themes breakpoints into an ordered structure to traverse
6
6
  */
7
7
  export declare const parseBreakpoints: (breakpoints?: Breakpoints | undefined) => BreakpointCache | null;
8
8
  export declare const isMediaArray: (val: unknown) => val is (string | number)[];
9
- export declare const isMediaMap: (val: object) => val is MediaQueryMap<string | number>;
10
- interface ResponsiveParser<Bp extends MediaQueryMap<string | number> | (string | number)[]> {
9
+ export declare const isMediaMap: (val: object) => val is BreakpointMap<string | number>;
10
+ interface ResponsiveParser<Bp extends BreakpointMap<string | number> | (string | number)[]> {
11
11
  <C extends AbstractPropTransformer>(value: Bp, props: ThemeProps, config: C, breakpoints: Bp): CSSObject;
12
12
  }
13
- export declare const objectParser: ResponsiveParser<MediaQueryMap<string | number>>;
13
+ export declare const objectParser: ResponsiveParser<BreakpointMap<string | number>>;
14
14
  export declare const arrayParser: ResponsiveParser<(string | number)[]>;
15
15
  export declare const orderBreakpoints: (styles: CSSObject, breakpoints: string[]) => CSSObject;
16
16
  export {};
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.0-alpha.e24bd5.0",
4
+ "version": "0.23.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": "bd0bc48501afd33ff32bf3a50afde7e03c80a35c"
35
+ "gitHead": "69e39c0d35e0f90db5d72a520af6f97275b12d65"
36
36
  }