@codecademy/gamut-styles 20.0.3-alpha.487323.0 → 20.0.3-alpha.4994b7.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.
@@ -34,13 +34,20 @@ export declare const adminTheme: Record<"breakpoints", {
34
34
  md: string;
35
35
  lg: string;
36
36
  xl: string;
37
- }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
38
- readonly headerHeight: {
39
- readonly base: "4rem";
40
- readonly md: "5rem";
41
- };
42
- readonly headerZ: 15;
43
- }, "elements">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
37
+ }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
38
+ readonly underlay: -1;
39
+ readonly base: 0;
40
+ readonly foreground: 1;
41
+ readonly stickyHeader: 100;
42
+ readonly portal: 200;
43
+ readonly widget: 300;
44
+ readonly appBar: 400;
45
+ readonly flyout: 500;
46
+ readonly modal: 600;
47
+ readonly popover: 700;
48
+ readonly toaster: 800;
49
+ readonly tooltip: 900;
50
+ }, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
44
51
  c_base: string;
45
52
  c_xs: string;
46
53
  c_sm: string;
@@ -120,7 +127,21 @@ export declare const adminTheme: Record<"breakpoints", {
120
127
  readonly base: "4rem";
121
128
  readonly md: "5rem";
122
129
  };
123
- readonly headerZ: 15;
130
+ readonly headerZ: 400;
131
+ };
132
+ zIndices: {
133
+ readonly underlay: -1;
134
+ readonly base: 0;
135
+ readonly foreground: 1;
136
+ readonly stickyHeader: 100;
137
+ readonly portal: 200;
138
+ readonly widget: 300;
139
+ readonly appBar: 400;
140
+ readonly flyout: 500;
141
+ readonly modal: 600;
142
+ readonly popover: 700;
143
+ readonly toaster: 800;
144
+ readonly tooltip: 900;
124
145
  };
125
146
  } & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
126
147
  readonly beige: "#FFF0E5";
@@ -544,7 +565,13 @@ export declare const adminTheme: Record<"breakpoints", {
544
565
  }>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
545
566
  1: string;
546
567
  2: string;
547
- }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, {
568
+ }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
569
+ readonly headerHeight: {
570
+ readonly base: "4rem";
571
+ readonly md: "5rem";
572
+ };
573
+ readonly headerZ: 400;
574
+ }, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, {
548
575
  colors: import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
549
576
  primary: {
550
577
  _: "blue-500";
@@ -15,13 +15,20 @@ export declare const coreTheme: Record<"breakpoints", {
15
15
  md: string;
16
16
  lg: string;
17
17
  xl: string;
18
- }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
19
- readonly headerHeight: {
20
- readonly base: "4rem";
21
- readonly md: "5rem";
22
- };
23
- readonly headerZ: 15;
24
- }, "elements">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
18
+ }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
19
+ readonly underlay: -1;
20
+ readonly base: 0;
21
+ readonly foreground: 1;
22
+ readonly stickyHeader: 100;
23
+ readonly portal: 200;
24
+ readonly widget: 300;
25
+ readonly appBar: 400;
26
+ readonly flyout: 500;
27
+ readonly modal: 600;
28
+ readonly popover: 700;
29
+ readonly toaster: 800;
30
+ readonly tooltip: 900;
31
+ }, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
25
32
  c_base: string;
26
33
  c_xs: string;
27
34
  c_sm: string;
@@ -101,7 +108,21 @@ export declare const coreTheme: Record<"breakpoints", {
101
108
  readonly base: "4rem";
102
109
  readonly md: "5rem";
103
110
  };
104
- readonly headerZ: 15;
111
+ readonly headerZ: 400;
112
+ };
113
+ zIndices: {
114
+ readonly underlay: -1;
115
+ readonly base: 0;
116
+ readonly foreground: 1;
117
+ readonly stickyHeader: 100;
118
+ readonly portal: 200;
119
+ readonly widget: 300;
120
+ readonly appBar: 400;
121
+ readonly flyout: 500;
122
+ readonly modal: 600;
123
+ readonly popover: 700;
124
+ readonly toaster: 800;
125
+ readonly tooltip: 900;
105
126
  };
106
127
  } & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
107
128
  readonly beige: "#FFF0E5";
@@ -525,7 +546,13 @@ export declare const coreTheme: Record<"breakpoints", {
525
546
  }>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
526
547
  1: string;
527
548
  2: string;
528
- }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
549
+ }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
550
+ readonly headerHeight: {
551
+ readonly base: "4rem";
552
+ readonly md: "5rem";
553
+ };
554
+ readonly headerZ: 400;
555
+ }, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys;
529
556
  export type CoreThemeShape = typeof coreTheme;
530
557
  export interface CoreTheme extends CoreThemeShape {
531
558
  }
@@ -1,5 +1,5 @@
1
1
  import { createTheme } from '@codecademy/variance';
2
- import { borderRadii, containerQueries, corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing } from '../variables';
2
+ import { borderRadii, containerQueries, corePalette, elements, fontFamily, fontSize, fontWeight, lineHeight, mediaQueries, spacing, zIndices } from '../variables';
3
3
 
4
4
  /**
5
5
  * @description This is the core theme that all other Codecademy themes are extended from
@@ -18,7 +18,8 @@ export const coreTheme = createTheme({
18
18
  lineHeight,
19
19
  fontWeight,
20
20
  spacing,
21
- elements
21
+ elements,
22
+ zIndices
22
23
  }).addColors(corePalette).addColorModes('light', {
23
24
  light: {
24
25
  text: {
@@ -129,4 +130,4 @@ export const coreTheme = createTheme({
129
130
  }) => ({
130
131
  1: `1px solid ${colors['border-primary']}`,
131
132
  2: `2px solid ${colors['border-primary']}`
132
- })).createScaleVariables('elements').addName('core').build();
133
+ })).createScaleVariables('elements').createScaleVariables('zIndices').addName('core').build();
@@ -78,18 +78,45 @@ export declare const lxStudioTheme: Record<"breakpoints", {
78
78
  lg: string;
79
79
  xl: string;
80
80
  };
81
+ zIndices: Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
82
+ readonly underlay: -1;
83
+ readonly base: 0;
84
+ readonly foreground: 1;
85
+ readonly stickyHeader: 100;
86
+ readonly portal: 200;
87
+ readonly widget: 300;
88
+ readonly appBar: 400;
89
+ readonly flyout: 500;
90
+ readonly modal: 600;
91
+ readonly popover: 700;
92
+ readonly toaster: 800;
93
+ readonly tooltip: 900;
94
+ }, "zIndices">> & {
95
+ readonly underlay: -1;
96
+ readonly base: 0;
97
+ readonly foreground: 1;
98
+ readonly stickyHeader: 100;
99
+ readonly portal: 200;
100
+ readonly widget: 300;
101
+ readonly appBar: 400;
102
+ readonly flyout: 500;
103
+ readonly modal: 600;
104
+ readonly popover: 700;
105
+ readonly toaster: 800;
106
+ readonly tooltip: 900;
107
+ };
81
108
  elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
82
109
  readonly headerHeight: {
83
110
  readonly base: "4rem";
84
111
  readonly md: "5rem";
85
112
  };
86
- readonly headerZ: 15;
113
+ readonly headerZ: 400;
87
114
  }, "elements">> & {
88
115
  readonly headerHeight: {
89
116
  readonly base: "4rem";
90
117
  readonly md: "5rem";
91
118
  };
92
- readonly headerZ: 15;
119
+ readonly headerZ: 400;
93
120
  };
94
121
  fontSize: {
95
122
  readonly 64: string;
@@ -120,8 +147,8 @@ export declare const lxStudioTheme: Record<"breakpoints", {
120
147
  readonly 64: string;
121
148
  readonly 96: string;
122
149
  };
123
- _variables: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
124
- _tokens: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>> & Record<string | number, any>;
150
+ _variables: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
151
+ _tokens: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>>, Record<string | number, any>> & Record<string | number, any>;
125
152
  colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
126
153
  readonly beige: "#FFF0E5";
127
154
  readonly blue: "#1557FF";
@@ -62,18 +62,45 @@ export declare const percipioTheme: Record<"breakpoints", {
62
62
  lg: string;
63
63
  xl: string;
64
64
  };
65
+ zIndices: Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
66
+ readonly underlay: -1;
67
+ readonly base: 0;
68
+ readonly foreground: 1;
69
+ readonly stickyHeader: 100;
70
+ readonly portal: 200;
71
+ readonly widget: 300;
72
+ readonly appBar: 400;
73
+ readonly flyout: 500;
74
+ readonly modal: 600;
75
+ readonly popover: 700;
76
+ readonly toaster: 800;
77
+ readonly tooltip: 900;
78
+ }, "zIndices">> & {
79
+ readonly underlay: -1;
80
+ readonly base: 0;
81
+ readonly foreground: 1;
82
+ readonly stickyHeader: 100;
83
+ readonly portal: 200;
84
+ readonly widget: 300;
85
+ readonly appBar: 400;
86
+ readonly flyout: 500;
87
+ readonly modal: 600;
88
+ readonly popover: 700;
89
+ readonly toaster: 800;
90
+ readonly tooltip: 900;
91
+ };
65
92
  elements: Record<"elements", import("@codecademy/variance").KeyAsVariable<{
66
93
  readonly headerHeight: {
67
94
  readonly base: "4rem";
68
95
  readonly md: "5rem";
69
96
  };
70
- readonly headerZ: 15;
97
+ readonly headerZ: 400;
71
98
  }, "elements">> & {
72
99
  readonly headerHeight: {
73
100
  readonly base: "4rem";
74
101
  readonly md: "5rem";
75
102
  };
76
- readonly headerZ: 15;
103
+ readonly headerZ: 400;
77
104
  };
78
105
  borderRadii: {
79
106
  none: string;
@@ -112,8 +139,8 @@ export declare const percipioTheme: Record<"breakpoints", {
112
139
  readonly 64: string;
113
140
  readonly 96: string;
114
141
  };
115
- _variables: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
116
- _tokens: import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>> & Record<string | number, any>;
142
+ _variables: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string, import("@codecademy/variance").CSSObject>, Record<string, import("@codecademy/variance").CSSObject>>, Record<string, import("@codecademy/variance").CSSObject>> & Record<string, import("@codecademy/variance").CSSObject>;
143
+ _tokens: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance/dist/createTheme/types").Assign<Record<string | number, any>, Record<string | number, any>>, Record<string | number, any>> & Record<string | number, any>;
117
144
  colors: import("@codecademy/variance/dist/createTheme/types").Assign<import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
118
145
  readonly beige: "#FFF0E5";
119
146
  readonly blue: "#1557FF";
@@ -50,13 +50,20 @@ export declare const platformTheme: Record<"breakpoints", {
50
50
  md: string;
51
51
  lg: string;
52
52
  xl: string;
53
- }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
54
- readonly headerHeight: {
55
- readonly base: "4rem";
56
- readonly md: "5rem";
57
- };
58
- readonly headerZ: 15;
59
- }, "elements">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
53
+ }> & import("@codecademy/variance/dist/createTheme/types").Merge<Record<"zIndices", Record<"zIndices", import("@codecademy/variance").KeyAsVariable<{
54
+ readonly underlay: -1;
55
+ readonly base: 0;
56
+ readonly foreground: 1;
57
+ readonly stickyHeader: 100;
58
+ readonly portal: 200;
59
+ readonly widget: 300;
60
+ readonly appBar: 400;
61
+ readonly flyout: 500;
62
+ readonly modal: 600;
63
+ readonly popover: 700;
64
+ readonly toaster: 800;
65
+ readonly tooltip: 900;
66
+ }, "zIndices">>> & import("@codecademy/variance/dist/createTheme/types").Merge<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<import("@codecademy/variance/dist/createTheme/types").MergeTheme<Record<"breakpoints", {
60
67
  c_base: string;
61
68
  c_xs: string;
62
69
  c_sm: string;
@@ -136,7 +143,21 @@ export declare const platformTheme: Record<"breakpoints", {
136
143
  readonly base: "4rem";
137
144
  readonly md: "5rem";
138
145
  };
139
- readonly headerZ: 15;
146
+ readonly headerZ: 400;
147
+ };
148
+ zIndices: {
149
+ readonly underlay: -1;
150
+ readonly base: 0;
151
+ readonly foreground: 1;
152
+ readonly stickyHeader: 100;
153
+ readonly portal: 200;
154
+ readonly widget: 300;
155
+ readonly appBar: 400;
156
+ readonly flyout: 500;
157
+ readonly modal: 600;
158
+ readonly popover: 700;
159
+ readonly toaster: 800;
160
+ readonly tooltip: 900;
140
161
  };
141
162
  } & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
142
163
  readonly beige: "#FFF0E5";
@@ -560,7 +581,13 @@ export declare const platformTheme: Record<"breakpoints", {
560
581
  }>, Record<"borders", import("@codecademy/variance").LiteralPaths<{
561
582
  1: string;
562
583
  2: string;
563
- }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
584
+ }, "-">>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"elements", Record<"elements", import("@codecademy/variance").KeyAsVariable<{
585
+ readonly headerHeight: {
586
+ readonly base: "4rem";
587
+ readonly md: "5rem";
588
+ };
589
+ readonly headerZ: 400;
590
+ }, "elements">>>>, import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"name", string>> & import("@codecademy/variance/dist/createTheme/types").PrivateThemeKeys, Record<"colors", import("@codecademy/variance").KeyAsVariable<import("@codecademy/variance").LiteralPaths<{
564
591
  readonly lightBeige: "#FFFBF8";
565
592
  readonly gold: "#8A7300";
566
593
  readonly teal: "#006D82";
@@ -4,8 +4,9 @@ export declare const elements: {
4
4
  readonly md: "5rem";
5
5
  };
6
6
  /**
7
- * Semi-arbitrary z-index for global page headers.
8
- * @remarks PLEASE talk to web platform before adding new z-index constants!
7
+ * z-index for global page headers. Aliases the `appBar` token from the `zIndices`
8
+ * scale so consumers still reading `elements.headerZ` stay in sync with the scale.
9
+ * Prefer `zIndex="appBar"` in new code.
9
10
  */
10
- readonly headerZ: 15;
11
+ readonly headerZ: 400;
11
12
  };
@@ -1,11 +1,13 @@
1
+ import { zIndices } from './zIndices';
1
2
  export const elements = {
2
3
  headerHeight: {
3
4
  base: '4rem',
4
5
  md: '5rem'
5
6
  },
6
7
  /**
7
- * Semi-arbitrary z-index for global page headers.
8
- * @remarks PLEASE talk to web platform before adding new z-index constants!
8
+ * z-index for global page headers. Aliases the `appBar` token from the `zIndices`
9
+ * scale so consumers still reading `elements.headerZ` stay in sync with the scale.
10
+ * Prefer `zIndex="appBar"` in new code.
9
11
  */
10
- headerZ: 15
12
+ headerZ: zIndices.appBar
11
13
  };
@@ -5,3 +5,4 @@ export * from './responsive';
5
5
  export * from './spacing';
6
6
  export * from './timing';
7
7
  export * from './typography';
8
+ export * from './zIndices';
@@ -4,4 +4,5 @@ export * from './elements';
4
4
  export * from './responsive';
5
5
  export * from './spacing';
6
6
  export * from './timing';
7
- export * from './typography';
7
+ export * from './typography';
8
+ export * from './zIndices';
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Semantic z-index scale. A single scale covers both in-flow layers (low values) and
3
+ * portal layers (≥100). Every z-index in Gamut should reference a token here rather than a
4
+ * magic number.
5
+ *
6
+ * The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
7
+ * tokens are used as `zIndex={zIndices.modal}`. That preserves the escape hatch (a raw
8
+ * in-between number, e.g. `zIndex={605}`) and arithmetic on tokens (e.g. `zIndices.foreground - 2`).
9
+ *
10
+ * Portal-band values are spaced by 100 so in-between escape-hatch numbers are available.
11
+ * `portal` (200) is the floor of the portal band and the default for `BodyPortal`.
12
+ *
13
+ * @remarks PLEASE talk to web platform before adding new z-index tokens.
14
+ */
15
+ export declare const zIndices: {
16
+ /** Decorative layer behind content (underlines, backdrops, shadows). */
17
+ readonly underlay: -1;
18
+ /** Ground layer — establishes a local stacking context without lifting above siblings. */
19
+ readonly base: 0;
20
+ /** Content lifted just above a sibling underlay/base. */
21
+ readonly foreground: 1;
22
+ /**
23
+ * In-flow sticky content headers (e.g. a sticky table `thead`). Below the portal band,
24
+ * so every overlay and the app nav cover it. Not a portal layer.
25
+ */
26
+ readonly stickyHeader: 100;
27
+ /** Portal floor / `BodyPortal` default — un-tokenized portal content lands here. */
28
+ readonly portal: 200;
29
+ /** Persistent floating page furniture at rest (e.g. an AI chat launcher, help bubble). */
30
+ readonly widget: 300;
31
+ /** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
32
+ readonly appBar: 400;
33
+ /** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
34
+ readonly flyout: 500;
35
+ /** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
36
+ readonly modal: 600;
37
+ /** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
38
+ readonly popover: 700;
39
+ /** Toasts / notifications — visible above modals. */
40
+ readonly toaster: 800;
41
+ /** Floating tooltips (`FloatingTip`) — highest, so they are never clipped. */
42
+ readonly tooltip: 900;
43
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Semantic z-index scale. A single scale covers both in-flow layers (low values) and
3
+ * portal layers (≥100). Every z-index in Gamut should reference a token here rather than a
4
+ * magic number.
5
+ *
6
+ * The `zIndex` prop is intentionally left numeric/unscaled, and this object is numeric, so
7
+ * tokens are used as `zIndex={zIndices.modal}`. That preserves the escape hatch (a raw
8
+ * in-between number, e.g. `zIndex={605}`) and arithmetic on tokens (e.g. `zIndices.foreground - 2`).
9
+ *
10
+ * Portal-band values are spaced by 100 so in-between escape-hatch numbers are available.
11
+ * `portal` (200) is the floor of the portal band and the default for `BodyPortal`.
12
+ *
13
+ * @remarks PLEASE talk to web platform before adding new z-index tokens.
14
+ */
15
+ export const zIndices = {
16
+ /** Decorative layer behind content (underlines, backdrops, shadows). */
17
+ underlay: -1,
18
+ /** Ground layer — establishes a local stacking context without lifting above siblings. */
19
+ base: 0,
20
+ /** Content lifted just above a sibling underlay/base. */
21
+ foreground: 1,
22
+ /**
23
+ * In-flow sticky content headers (e.g. a sticky table `thead`). Below the portal band,
24
+ * so every overlay and the app nav cover it. Not a portal layer.
25
+ */
26
+ stickyHeader: 100,
27
+ /** Portal floor / `BodyPortal` default — un-tokenized portal content lands here. */
28
+ portal: 200,
29
+ /** Persistent floating page furniture at rest (e.g. an AI chat launcher, help bubble). */
30
+ widget: 300,
31
+ /** Global app header / nav bar. Aliased by the legacy `elements.headerZ` constant. */
32
+ appBar: 400,
33
+ /** Portaled side panel (the `Flyout` component = `Drawer` inside `Overlay`). */
34
+ flyout: 500,
35
+ /** `Overlay`, `Modal`, and `Dialog` (they share one portal primitive). */
36
+ modal: 600,
37
+ /** Portal-mode `Popover` and the portaled `SelectDropdown` menu — above modal. */
38
+ popover: 700,
39
+ /** Toasts / notifications — visible above modals. */
40
+ toaster: 800,
41
+ /** Floating tooltips (`FloatingTip`) — highest, so they are never clipped. */
42
+ tooltip: 900
43
+ };
@@ -450,6 +450,9 @@ 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
+ // `zIndices` token object instead (e.g. zIndex={zIndices.modal}).
453
456
  zIndex: {
454
457
  property: 'zIndex'
455
458
  },
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.487323.0",
4
+ "version": "20.0.3-alpha.4994b7.0",
5
5
  "author": "Jake Hiller <jake@codecademy.com>",
6
6
  "dependencies": {
7
- "@codecademy/variance": "0.26.2-alpha.487323.0",
7
+ "@codecademy/variance": "0.26.2-alpha.4994b7.0",
8
8
  "@emotion/is-prop-valid": "^1.1.0",
9
9
  "framer-motion": "^11.18.0",
10
10
  "get-nonce": "^1.0.0",