@codecademy/gamut-styles 20.0.3-alpha.d0aedd.0 → 20.0.3-alpha.d20b57.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.
@@ -350,6 +350,8 @@ 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;
353
355
  };
354
356
  readonly opacity: {
355
357
  readonly property: "opacity";
@@ -928,6 +930,8 @@ export declare const VariableProvider: import("@emotion/styled").StyledComponent
928
930
  }>;
929
931
  zIndex?: import("@codecademy/variance/dist/types/config").Scale<{
930
932
  readonly property: "zIndex";
933
+ readonly scale: "zIndexes";
934
+ readonly allowRawValue: true;
931
935
  }>;
932
936
  backgroundPosition?: import("@codecademy/variance/dist/types/config").Scale<{
933
937
  readonly property: "backgroundPosition";
@@ -1561,6 +1565,8 @@ export declare const ColorMode: import("react").ForwardRefExoticComponent<Omit<O
1561
1565
  }>;
1562
1566
  zIndex?: import("@codecademy/variance/dist/types/config").Scale<{
1563
1567
  readonly property: "zIndex";
1568
+ readonly scale: "zIndexes";
1569
+ readonly allowRawValue: true;
1564
1570
  }>;
1565
1571
  backgroundPosition?: import("@codecademy/variance/dist/types/config").Scale<{
1566
1572
  readonly property: "backgroundPosition";
@@ -1,10 +1,11 @@
1
+ import { Globals } from 'csstype';
1
2
  /**
2
3
  * Semantic z-index scale. Every z-index in Gamut should reference a token here rather than a
3
4
  * magic number.
4
5
  *
5
- * The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
6
- * tokens are used as `zIndex={zIndexes.modal}`. That preserves the escape hatch (a raw
7
- * in-between number, e.g. `zIndex={550}`) and arithmetic on tokens (e.g. `zIndexes.foreground - 2`).
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`).
8
9
  *
9
10
  * Values are spaced by 100 so in-between escape-hatch numbers are available. `floating` (200) is
10
11
  * the floor of the portal band and the default for `BodyPortal`.
@@ -42,3 +43,11 @@ export declare const zIndexes: {
42
43
  */
43
44
  readonly 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
+ */
53
+ export type ZIndexType = keyof typeof zIndexes | number | Globals;
@@ -2,9 +2,9 @@
2
2
  * Semantic z-index scale. Every z-index in Gamut should reference a token here rather than a
3
3
  * magic number.
4
4
  *
5
- * The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
6
- * tokens are used as `zIndex={zIndexes.modal}`. That preserves the escape hatch (a raw
7
- * in-between number, e.g. `zIndex={550}`) and arithmetic on tokens (e.g. `zIndexes.foreground - 2`).
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
8
  *
9
9
  * Values are spaced by 100 so in-between escape-hatch numbers are available. `floating` (200) is
10
10
  * the floor of the portal band and the default for `BodyPortal`.
@@ -41,4 +41,12 @@ export const zIndexes = {
41
41
  * and toasts / notifications (`Toaster`). Highest layer — nothing in Gamut sits above it.
42
42
  */
43
43
  topmost: 700
44
- };
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
+ */
@@ -455,6 +455,8 @@ export declare const positioning: {
455
455
  };
456
456
  readonly zIndex: {
457
457
  readonly property: "zIndex";
458
+ readonly scale: "zIndexes";
459
+ readonly allowRawValue: true;
458
460
  };
459
461
  readonly opacity: {
460
462
  readonly property: "opacity";
@@ -1215,6 +1217,8 @@ export declare const all: {
1215
1217
  };
1216
1218
  zIndex: {
1217
1219
  readonly property: "zIndex";
1220
+ readonly scale: "zIndexes";
1221
+ readonly allowRawValue: true;
1218
1222
  };
1219
1223
  opacity: {
1220
1224
  readonly property: "opacity";
@@ -450,11 +450,13 @@ export const positioning = {
450
450
  resolveProperty: getPropertyMode,
451
451
  transform: transformSize
452
452
  },
453
- // Intentionally unscaled: scaled variance props are token-only and reject raw numbers,
454
- // which would break the numeric escape hatch and Tip's z-index arithmetic. Use the numeric
455
- // `zIndexes` token object instead (e.g. zIndex={zIndexes.modal}).
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
456
  zIndex: {
457
- property: 'zIndex'
457
+ property: 'zIndex',
458
+ scale: 'zIndexes',
459
+ allowRawValue: true
458
460
  },
459
461
  opacity: {
460
462
  property: 'opacity'
@@ -324,6 +324,8 @@ 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;
327
329
  };
328
330
  readonly opacity: {
329
331
  readonly property: "opacity";
@@ -1218,6 +1220,8 @@ export declare const css: import("@codecademy/variance/dist/types/config").CSS<i
1218
1220
  };
1219
1221
  zIndex: {
1220
1222
  readonly property: "zIndex";
1223
+ readonly scale: "zIndexes";
1224
+ readonly allowRawValue: true;
1221
1225
  };
1222
1226
  opacity: {
1223
1227
  readonly property: "opacity";
@@ -1895,6 +1899,8 @@ export declare const variant: import("@codecademy/variance/dist/types/config").V
1895
1899
  };
1896
1900
  zIndex: {
1897
1901
  readonly property: "zIndex";
1902
+ readonly scale: "zIndexes";
1903
+ readonly allowRawValue: true;
1898
1904
  };
1899
1905
  opacity: {
1900
1906
  readonly property: "opacity";
@@ -2572,6 +2578,8 @@ export declare const states: import("@codecademy/variance/dist/types/config").St
2572
2578
  };
2573
2579
  zIndex: {
2574
2580
  readonly property: "zIndex";
2581
+ readonly scale: "zIndexes";
2582
+ readonly allowRawValue: true;
2575
2583
  };
2576
2584
  opacity: {
2577
2585
  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.0.3-alpha.d0aedd.0",
4
+ "version": "20.0.3-alpha.d20b57.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/variance": "0.26.2-alpha.d0aedd.0",
7
+ "@codecademy/variance": "0.26.2-alpha.d20b57.0",
8
8
  "@emotion/is-prop-valid": "^1.1.0",
9
9
  "framer-motion": "^11.18.0",
10
10
  "get-nonce": "^1.0.0",