pixelize-design-library 2.4.2-beta.1 → 2.4.2-beta.3

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.
Files changed (43) hide show
  1. package/dist/Components/Header/HeaderActions.d.ts +3 -1
  2. package/dist/Components/Header/HeaderActions.js +7 -3
  3. package/dist/Components/PlanPill/PlanPill.js +1 -1
  4. package/dist/Theme/chakra/Menu.styles.d.ts +6 -6
  5. package/dist/Theme/chakra/Menu.styles.js +6 -5
  6. package/dist/Theme/chakra/Popover.styles.d.ts +3 -3
  7. package/dist/Theme/chakra/Popover.styles.js +7 -6
  8. package/dist/Theme/chakra/Switch.styles.d.ts +1 -1
  9. package/dist/Theme/chakra/Switch.styles.js +7 -9
  10. package/dist/Theme/chakra/componentStyles.d.ts +9 -9
  11. package/dist/Theme/provider/PixelizeThemeProvider.js +18 -20
  12. package/dist/Theme/provider/ThemeSwitcher.js +10 -20
  13. package/dist/Theme/tokens/brands/emerald/palette.light.js +5 -7
  14. package/dist/Theme/tokens/brands/lavender/palette.light.js +5 -116
  15. package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
  16. package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
  17. package/dist/Theme/tokens/brands/neutrals.js +119 -0
  18. package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
  19. package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
  20. package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
  21. package/dist/Theme/tokens/brands/slate/palette.light.js +6 -12
  22. package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
  23. package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
  24. package/dist/Theme/tokens/builders/brandInk.js +106 -0
  25. package/dist/Theme/tokens/types.d.ts +5 -0
  26. package/dist/esm/Components/Header/HeaderActions.js +8 -4
  27. package/dist/esm/Components/PlanPill/PlanPill.js +2 -2
  28. package/dist/esm/Theme/chakra/Menu.styles.js +6 -5
  29. package/dist/esm/Theme/chakra/Popover.styles.js +7 -6
  30. package/dist/esm/Theme/chakra/Switch.styles.js +7 -9
  31. package/dist/esm/Theme/provider/PixelizeThemeProvider.js +18 -20
  32. package/dist/esm/Theme/provider/ThemeSwitcher.js +10 -20
  33. package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
  34. package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +5 -116
  35. package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
  36. package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
  37. package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
  38. package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
  39. package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
  40. package/dist/esm/Theme/tokens/brands/slate/palette.light.js +6 -9
  41. package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
  42. package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
  43. package/package.json +1 -1
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.neutralTokens = exports.sharedBoxShadow = void 0;
4
+ const semantic = {
5
+ success: {
6
+ 50: "#e9f8ef",
7
+ 100: "#bbe9cc",
8
+ 200: "#9adeb4",
9
+ 300: "#6ccf92",
10
+ 400: "#4fc67d",
11
+ 500: "#23b85c",
12
+ 600: "#20a754",
13
+ 700: "#198341",
14
+ 800: "#136533",
15
+ 900: "#0f4d27",
16
+ },
17
+ error: {
18
+ 50: "#feedeb",
19
+ 100: "#fbc6c2",
20
+ 200: "#f9aaa4",
21
+ 300: "#f6837b",
22
+ 400: "#f56b61",
23
+ 500: "#f2463a",
24
+ 600: "#dc4035",
25
+ 700: "#ac3229",
26
+ 800: "#852720",
27
+ 900: "#661d18",
28
+ },
29
+ warning: {
30
+ 50: "#fff4ef",
31
+ 100: "#ffddce",
32
+ 200: "#ffccb7",
33
+ 300: "#ffb596",
34
+ 400: "#ffa781",
35
+ 500: "#ff9162",
36
+ 600: "#e88459",
37
+ 700: "#b56746",
38
+ 800: "#8c5036",
39
+ 900: "#6b3d29",
40
+ },
41
+ info: {
42
+ 50: "#eff9fc",
43
+ 100: "#cdedf5",
44
+ 200: "#b5e4f0",
45
+ 300: "#94d7e9",
46
+ 400: "#7fd0e5",
47
+ 500: "#5fc4de",
48
+ 600: "#56b2ea",
49
+ 700: "#438b9e",
50
+ 800: "#346c78",
51
+ 900: "#28525d",
52
+ },
53
+ };
54
+ const red = {
55
+ 50: "#feedeb", 100: "#fbc6c2", 200: "#f9aaa4", 300: "#f6837b",
56
+ 400: "#f56b61", 500: "#f2463a", 600: "#dc4035", 700: "#ac3229",
57
+ 800: "#852720", 900: "#661d18",
58
+ };
59
+ const orange = {
60
+ 50: "#fff4ef", 100: "#ffddce", 200: "#ffccb7", 300: "#ffb596",
61
+ 400: "#ffa781", 500: "#ff9162", 600: "#e88459", 700: "#b56746",
62
+ 800: "#8c5036", 900: "#6b3d29",
63
+ };
64
+ const yellow = {
65
+ 50: "#fefbec", 100: "#fdf1c5", 200: "#fbeba9", 300: "#fae281",
66
+ 400: "#f9dc69", 500: "#f7d343", 600: "#e1c03d", 700: "#af9630",
67
+ 800: "#887425", 900: "#68591c",
68
+ };
69
+ const green = {
70
+ 50: "#e9f8ef", 100: "#bbe9cc", 200: "#9adeb4", 300: "#6ccf92",
71
+ 400: "#4fc67d", 500: "#23b85c", 600: "#20a754", 700: "#198341",
72
+ 800: "#136533", 900: "#0f4d27",
73
+ };
74
+ const teal = {
75
+ 50: "#eff9fc", 100: "#cdedf5", 200: "#b5e4f0", 300: "#94d7e9",
76
+ 400: "#7fd0e5", 500: "#5fc4de", 600: "#56b2ea", 700: "#438b9e",
77
+ 800: "#346c78", 900: "#28525d",
78
+ };
79
+ const blue = {
80
+ 50: "#ebf8ff", 100: "#bee3f8", 200: "#90cdf4", 300: "#63b3ed",
81
+ 400: "#4299e1", 500: "#3182ce", 600: "#2b6cb0", 700: "#2c5282",
82
+ 800: "#2a4365", 900: "#1a365d",
83
+ };
84
+ const cyan = {
85
+ 50: "#edfdfd", 100: "#c4f1f9", 200: "#9decf9", 300: "#76e4f7",
86
+ 400: "#0bc5ea", 500: "#00b5d8", 600: "#00a3c4", 700: "#0987a0",
87
+ 800: "#086f83", 900: "#065666",
88
+ };
89
+ const purple = {
90
+ 50: "#faf5ff", 100: "#e9d8fd", 200: "#d6bcfa", 300: "#b794f4",
91
+ 400: "#9f7aea", 500: "#805ad5", 600: "#6b46c1", 700: "#553c9a",
92
+ 800: "#44337a", 900: "#322659",
93
+ };
94
+ const pink = {
95
+ 50: "#fff5f7", 100: "#fed7e2", 200: "#fbb6ce", 300: "#f687b3",
96
+ 400: "#ed64a6", 500: "#d53f8c", 600: "#b83280", 700: "#97266d",
97
+ 800: "#702459", 900: "#521b41",
98
+ };
99
+ /** Non-brand shadow tints. Only `primary` is brand-derived. */
100
+ exports.sharedBoxShadow = {
101
+ error: "#F2463A47",
102
+ default: "#00000033",
103
+ };
104
+ /** Utility scales shared by every brand — never theme-specific. */
105
+ exports.neutralTokens = {
106
+ transparent: "transparent",
107
+ black: "#000",
108
+ white: "#fff",
109
+ semantic,
110
+ red,
111
+ orange,
112
+ yellow,
113
+ green,
114
+ teal,
115
+ blue,
116
+ cyan,
117
+ purple,
118
+ pink,
119
+ };
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const palette_light_1 = __importDefault(require("../lavender/palette.light"));
3
+ const neutrals_1 = require("../neutrals");
7
4
  const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
5
+ const brandInk_1 = require("../../builders/brandInk");
8
6
  const PRIMARY_500 = "#cf4e3a"; // warm red (terracotta leaning)
9
7
  const primary = {
10
8
  50: "#fdf1ee",
@@ -20,7 +18,8 @@ const primary = {
20
18
  opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
21
19
  };
22
20
  const palette = {
23
- ...palette_light_1.default,
21
+ ...neutrals_1.neutralTokens,
22
+ ...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
24
23
  // Stops retuned so white gradient-button text (onGradient, accentText.ts) clears AA at both
25
24
  // ends — the original pair let white drop to 4.37/2.15 against from/to. Same hue, darker.
26
25
  // Both nudged one step further (4.509/4.502 -> 4.601/4.617): the first pass cleared AA by
@@ -128,8 +127,7 @@ const palette = {
128
127
  },
129
128
  boxShadow: {
130
129
  primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
131
- error: palette_light_1.default.boxShadow.error,
132
- default: palette_light_1.default.boxShadow.default,
130
+ ...neutrals_1.sharedBoxShadow,
133
131
  },
134
132
  };
135
133
  exports.default = palette;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const palette_light_1 = __importDefault(require("../lavender/palette.light"));
3
+ const neutrals_1 = require("../neutrals");
7
4
  const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
5
+ const brandInk_1 = require("../../builders/brandInk");
8
6
  const PRIMARY_500 = "#d16a7e"; // muted warm rose (not neon pink)
9
7
  const primary = {
10
8
  50: "#fdf2f5",
@@ -20,7 +18,8 @@ const primary = {
20
18
  opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
21
19
  };
22
20
  const palette = {
23
- ...palette_light_1.default,
21
+ ...neutrals_1.neutralTokens,
22
+ ...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
24
23
  // Stops retuned so white gradient-button text (onGradient, accentText.ts) clears AA at both
25
24
  // ends — the original pair let white drop to 3.46/2.69 against from/to. Same hue, darker.
26
25
  // Both nudged one step further (4.520/4.505 -> 4.609/4.607): the first pass cleared AA by
@@ -132,8 +131,7 @@ const palette = {
132
131
  },
133
132
  boxShadow: {
134
133
  primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
135
- error: palette_light_1.default.boxShadow.error,
136
- default: palette_light_1.default.boxShadow.default,
134
+ ...neutrals_1.sharedBoxShadow,
137
135
  },
138
136
  };
139
137
  exports.default = palette;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const palette_light_1 = __importDefault(require("../lavender/palette.light"));
3
+ const neutrals_1 = require("../neutrals");
7
4
  const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
5
+ const brandInk_1 = require("../../builders/brandInk");
8
6
  const PRIMARY_500 = "#1a3a6b"; // was #0088cc — deep navy
9
7
  const primary = {
10
8
  50: "#e8ecf4",
@@ -20,7 +18,8 @@ const primary = {
20
18
  opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
21
19
  };
22
20
  const palette = {
23
- ...palette_light_1.default,
21
+ ...neutrals_1.neutralTokens,
22
+ ...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
24
23
  // `to` stop retuned so white gradient-button text (onGradient, accentText.ts) clears AA — the
25
24
  // original let white drop to 2.14 there (`from` already passed at 11.28, unchanged).
26
25
  // Nudged one step further (4.515 -> 4.600): the first pass cleared AA by <0.02, too thin a
@@ -126,8 +125,7 @@ const palette = {
126
125
  },
127
126
  boxShadow: {
128
127
  primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
129
- error: palette_light_1.default.boxShadow.error,
130
- default: palette_light_1.default.boxShadow.default,
128
+ ...neutrals_1.sharedBoxShadow,
131
129
  },
132
130
  };
133
131
  exports.default = palette;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const palette_light_1 = __importDefault(require("../lavender/palette.light"));
3
+ const neutrals_1 = require("../neutrals");
7
4
  const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
5
+ const brandInk_1 = require("../../builders/brandInk");
8
6
  const PRIMARY_500 = "#6b7280"; // was #475569 — pure neutral gray, no blue cast
9
7
  const primary = {
10
8
  50: "#f9fafb",
@@ -20,12 +18,9 @@ const primary = {
20
18
  opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
21
19
  };
22
20
  const palette = {
23
- ...palette_light_1.default,
24
- // `to` stop retuned so white gradient-button text (onGradient, accentText.ts) clears AA — the
25
- // original let white drop to 2.98 there (`from` already passed at 4.83, unchanged).
26
- // Nudged one step further (4.520 -> 4.608): the first pass cleared AA by <0.02, too thin a
27
- // margin to trust against rounding/rendering variance.
28
- gradient: { from: "#6b7280", to: "#5664f6" }, // slate gray → indigo
21
+ ...neutrals_1.neutralTokens,
22
+ ...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
23
+ gradient: { from: "#666d7a", to: "#4a4e59" },
29
24
  primary,
30
25
  tertiary: { ...primary },
31
26
  gray: {
@@ -130,8 +125,7 @@ const palette = {
130
125
  },
131
126
  boxShadow: {
132
127
  primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
133
- error: palette_light_1.default.boxShadow.error,
134
- default: palette_light_1.default.boxShadow.default,
128
+ ...neutrals_1.sharedBoxShadow,
135
129
  },
136
130
  };
137
131
  exports.default = palette;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const palette_light_1 = __importDefault(require("../lavender/palette.light"));
3
+ const neutrals_1 = require("../neutrals");
7
4
  const buildBrandTokens_1 = require("../../builders/buildBrandTokens");
5
+ const brandInk_1 = require("../../builders/brandInk");
8
6
  const PRIMARY_500 = "#004f4b"; // deep spruce teal — storefront/retail brand anchor
9
7
  const primary = {
10
8
  50: "#eafaf9",
@@ -20,7 +18,8 @@ const primary = {
20
18
  opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(PRIMARY_500),
21
19
  };
22
20
  const palette = {
23
- ...palette_light_1.default,
21
+ ...neutrals_1.neutralTokens,
22
+ ...(0, brandInk_1.buildBrandInk)(PRIMARY_500),
24
23
  // Same hue as primary, darker stop for the "to" end — mirrors emerald's gradient pattern.
25
24
  // White gradient-button text verified AA at both stops (4.98 / 6.96).
26
25
  gradient: { from: "#0c7d77", to: "#095e90" }, // spruce teal → deep blue
@@ -120,8 +119,7 @@ const palette = {
120
119
  },
121
120
  boxShadow: {
122
121
  primary: (0, buildBrandTokens_1.buildPrimaryShadowTint)(PRIMARY_500),
123
- error: palette_light_1.default.boxShadow.error,
124
- default: palette_light_1.default.boxShadow.default,
122
+ ...neutrals_1.sharedBoxShadow,
125
123
  },
126
124
  };
127
125
  exports.default = palette;
@@ -0,0 +1,11 @@
1
+ import type { BrandScale, ColorScale } from "../types";
2
+ export type BrandInkRamps = {
3
+ secondary: BrandScale;
4
+ tertiary: BrandScale;
5
+ text: ColorScale;
6
+ header: ColorScale;
7
+ placeholder: ColorScale;
8
+ disabled: ColorScale;
9
+ };
10
+ /** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
11
+ export declare function buildBrandInk(primary500: string): BrandInkRamps;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBrandInk = buildBrandInk;
4
+ const buildBrandTokens_1 = require("./buildBrandTokens");
5
+ const color_1 = require("./color");
6
+ const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
7
+ // Lavender's primary saturation. Each brand's ramps scale away from it.
8
+ const REFERENCE_SATURATION = 55.5;
9
+ const SECONDARY = {
10
+ 50: [39.4, 0.8231],
11
+ 100: [41.0, 0.61132],
12
+ 200: [37.7, 0.39479],
13
+ 300: [27.4, 0.18614],
14
+ 400: [28.4, 0.10269],
15
+ 500: [52.4, 0.00831],
16
+ 600: [55.1, 0.00573],
17
+ 700: [55.6, 0.00386],
18
+ 800: [60.0, 0.00245],
19
+ 900: [57.1, 0.00141],
20
+ };
21
+ const TEXT = {
22
+ 50: [25.9, 0.86267],
23
+ 100: [32.4, 0.63853],
24
+ 200: [32.7, 0.48344],
25
+ 300: [30.6, 0.30607],
26
+ 400: [29.2, 0.21515],
27
+ 500: [26.3, 0.10787],
28
+ 600: [26.6, 0.08786],
29
+ 700: [26.7, 0.05281],
30
+ 800: [27.4, 0.03145],
31
+ 900: [29.0, 0.01826],
32
+ };
33
+ const HEADER = {
34
+ 50: [31.3, 0.83382],
35
+ 100: [31.0, 0.59779],
36
+ 200: [30.6, 0.44729],
37
+ 300: [29.3, 0.27622],
38
+ 400: [30.0, 0.19238],
39
+ 500: [29.9, 0.10467],
40
+ 600: [29.9, 0.08682],
41
+ 700: [29.7, 0.05281],
42
+ 800: [29.1, 0.0319],
43
+ 900: [29.9, 0.01915],
44
+ };
45
+ const PLACEHOLDER = {
46
+ 50: [30.4, 0.87913],
47
+ 100: [35.4, 0.67128],
48
+ 200: [36.1, 0.53513],
49
+ 300: [34.7, 0.37333],
50
+ 400: [31.4, 0.30462],
51
+ 500: [28.2, 0.19307],
52
+ 600: [22.8, 0.15818],
53
+ 700: [22.0, 0.09196],
54
+ 800: [21.5, 0.05448],
55
+ 900: [22.3, 0.03206],
56
+ };
57
+ const DISABLED = {
58
+ 50: [33.3, 0.90353],
59
+ 100: [38.9, 0.80618],
60
+ 200: [40.7, 0.71546],
61
+ 300: [41.0, 0.60545],
62
+ 400: [39.6, 0.53328],
63
+ 500: [40.5, 0.43688],
64
+ 600: [28.2, 0.35566],
65
+ 700: [13.4, 0.20289],
66
+ 800: [11.4, 0.1171],
67
+ 900: [11.2, 0.06724],
68
+ };
69
+ // Lightness is monotonic in luminance for a fixed hue/saturation, so bisection converges.
70
+ const atLuminance = (anchor, saturation, target) => {
71
+ let low = 0;
72
+ let high = 100;
73
+ for (let i = 0; i < 30; i += 1) {
74
+ const mid = (low + high) / 2;
75
+ if ((0, color_1.relativeLuminance)((0, color_1.withLightness)(anchor, mid, saturation)) < target)
76
+ low = mid;
77
+ else
78
+ high = mid;
79
+ }
80
+ return (0, color_1.withLightness)(anchor, (low + high) / 2, saturation);
81
+ };
82
+ const ramp = (anchor, profile) => {
83
+ const ratio = (0, color_1.hexToHsl)(anchor).s / REFERENCE_SATURATION;
84
+ const scale = {};
85
+ for (const rung of RUNGS) {
86
+ const [saturation, luminance] = profile[rung];
87
+ scale[rung] = atLuminance(anchor, Math.min(100, saturation * ratio), luminance);
88
+ }
89
+ return scale;
90
+ };
91
+ const brandRamp = (anchor, profile) => {
92
+ const scale = ramp(anchor, profile);
93
+ return { ...scale, opacity: (0, buildBrandTokens_1.buildPrimaryOpacity)(scale[500]) };
94
+ };
95
+ /** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
96
+ function buildBrandInk(primary500) {
97
+ const secondary = brandRamp(primary500, SECONDARY);
98
+ return {
99
+ secondary,
100
+ tertiary: { ...secondary },
101
+ text: ramp(primary500, TEXT),
102
+ header: ramp(primary500, HEADER),
103
+ placeholder: ramp(primary500, PLACEHOLDER),
104
+ disabled: ramp(primary500, DISABLED),
105
+ };
106
+ }
@@ -130,6 +130,11 @@ export type BrandPaletteSource = Omit<PaletteProps, "accentText" | "textMuted" |
130
130
  background: ColorScale;
131
131
  };
132
132
  };
133
+ /** Utility scales carrying no brand identity. The only tokens a brand may inherit. */
134
+ export type NeutralPaletteKey = "transparent" | "black" | "white" | "semantic" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink";
135
+ export type NeutralPaletteTokens = Pick<BrandPaletteSource, NeutralPaletteKey>;
136
+ /** Everything a brand must state itself — never by spreading another brand. */
137
+ export type BrandIdentityTokens = Omit<BrandPaletteSource, NeutralPaletteKey>;
133
138
  /** Brand identities shipped by the library. */
134
139
  export type ThemeName = "lavender" | "meadow" | "radiant" | "skyline" | "slate" | "emerald" | "rosewood" | "storefront" | "zinc";
135
140
  /** User-selectable color mode. `system` follows the OS setting. */
@@ -3,21 +3,25 @@ import { Box, Text } from "@chakra-ui/react";
3
3
  import React from "react";
4
4
  import { CirclePlus, SquarePen } from "lucide-react";
5
5
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
6
- import { accentTextOnCanvas } from "../../Theme/tokens/builders/accentText.js";
6
+ import { AA_NORMAL_TEXT } from "../../Theme/tokens/builders/accentText.js";
7
+ import { AA_NON_TEXT, liftToContrast } from "../../Theme/tokens/builders/outlineRung.js";
7
8
  import Select from "../Select/Select.js";
8
9
  import VeritcalDivider from "../Divider/Divider.js";
9
- const HeaderActions = ({ select, edit, create, }) => {
10
+ const HeaderActions = ({ select, edit, create, surface, }) => {
10
11
  var _a, _b;
11
12
  const { colors } = useCustomTheme();
13
+ const canvas = surface !== null && surface !== void 0 ? surface : colors.backgroundColor.main;
14
+ const ink = liftToContrast(colors.secondary[500], canvas, AA_NORMAL_TEXT);
15
+ const iconInk = liftToContrast(colors.secondary[500], canvas, AA_NON_TEXT);
12
16
  const elements = [];
13
17
  if (select === null || select === void 0 ? void 0 : select.isSelect) {
14
18
  elements.push(_jsx(Box, { width: (_a = select.width) !== null && _a !== void 0 ? _a : "12.5rem", children: _jsx(Select, { options: (_b = select.options) !== null && _b !== void 0 ? _b : [], placeholder: select.selectPlaceholderText, onChange: (option) => { var _a; return (_a = select.onSelectChange) === null || _a === void 0 ? void 0 : _a.call(select, option); }, value: select.value }, "select") }, "select"));
15
19
  }
16
20
  if (edit === null || edit === void 0 ? void 0 : edit.isEditable) {
17
- elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [_jsx(SquarePen, { size: 16, color: colors.text[500] }), _jsx(Text, { color: accentTextOnCanvas(colors.secondary, colors.backgroundColor.main), children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
21
+ elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = edit.onEdit) === null || _a === void 0 ? void 0 : _a.call(edit); }, children: [_jsx(SquarePen, { size: 16, color: iconInk }), _jsx(Text, { color: ink, children: edit.label ? edit.label : "Edit Layout" })] }, "edit"));
18
22
  }
19
23
  if (create === null || create === void 0 ? void 0 : create.isCreatable) {
20
- elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [_jsx(CirclePlus, { size: 16, color: colors.text[500] }), _jsxs(Text, { color: accentTextOnCanvas(colors.secondary, colors.backgroundColor.main), children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
24
+ elements.push(_jsxs(Box, { display: "flex", alignItems: "center", gap: "0.375rem", cursor: "pointer", fontSize: 14, onClick: () => { var _a; return (_a = create.onCreate) === null || _a === void 0 ? void 0 : _a.call(create); }, children: [_jsx(CirclePlus, { size: 16, color: iconInk }), _jsxs(Text, { color: ink, children: [" ", create.label ? create.label : "Create New", " "] })] }, "create"));
21
25
  }
22
26
  return (_jsx(Box, { display: "flex", alignItems: "center", gap: "0.625rem", children: elements.map((el, i) => (_jsxs(React.Fragment, { children: [i > 0 && _jsx(VeritcalDivider, {}), el] }, i))) }));
23
27
  };
@@ -3,7 +3,7 @@ import { Box, Flex, Text } from "@chakra-ui/react";
3
3
  import { AlertCircle, Clock, Sparkles } from "lucide-react";
4
4
  import { useCustomTheme } from "../../Theme/useCustomTheme.js";
5
5
  import { onGradient } from "../../Theme/tokens/builders/accentText.js";
6
- import { ACCENT_GRADIENT, chipBorder, chipFill, inkSafeGradient, statusGradient, } from "./planPillGradient.js";
6
+ import { chipBorder, chipFill, inkSafeGradient, statusGradient, } from "./planPillGradient.js";
7
7
  const TONE_ICON = {
8
8
  normal: Sparkles,
9
9
  warning: Clock,
@@ -13,7 +13,7 @@ const PlanPill = ({ label, mobileLabel, status, tone = "normal", icon, gradient,
13
13
  const theme = useCustomTheme();
14
14
  const c = theme.colors;
15
15
  const toneGradient = {
16
- normal: ACCENT_GRADIENT,
16
+ normal: inkSafeGradient(c.gradient),
17
17
  warning: statusGradient(c.semantic.warning),
18
18
  danger: statusGradient(c.semantic.error),
19
19
  };
@@ -1,5 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
2
2
  import { menuAnatomy } from "@chakra-ui/anatomy";
3
+ import { paletteOf } from "./paletteFromTheme.js";
3
4
  const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(menuAnatomy.keys);
4
5
  const $bg = cssVar("menu-bg");
5
6
  /**
@@ -19,14 +20,14 @@ const $bg = cssVar("menu-bg");
19
20
  */
20
21
  const $itemBg = cssVar("menu-item-bg");
21
22
  const baseStyle = definePartsStyle(({ theme }) => {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
23
- const hoverBg = (_g = (_d = (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.opacity) === null || _c === void 0 ? void 0 : _c[8]) !== null && _d !== void 0 ? _d : (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray) === null || _f === void 0 ? void 0 : _f[100]) !== null && _g !== void 0 ? _g : "#f7fafc";
24
- const activeBg = (_p = (_l = (_k = (_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.primary) === null || _j === void 0 ? void 0 : _j.opacity) === null || _k === void 0 ? void 0 : _k[16]) !== null && _l !== void 0 ? _l : (_o = (_m = theme.colors) === null || _m === void 0 ? void 0 : _m.gray) === null || _o === void 0 ? void 0 : _o[200]) !== null && _p !== void 0 ? _p : "#edf2f7";
23
+ const colors = paletteOf(theme);
24
+ const hoverBg = colors.primary.opacity[8];
25
+ const activeBg = colors.primary.opacity[16];
25
26
  return {
26
27
  list: {
27
- [$bg.variable]: (_v = (_s = (_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.backgroundColor) === null || _r === void 0 ? void 0 : _r.light) !== null && _s !== void 0 ? _s : (_u = (_t = theme.colors) === null || _t === void 0 ? void 0 : _t.background) === null || _u === void 0 ? void 0 : _u[50]) !== null && _v !== void 0 ? _v : "#fff",
28
+ [$bg.variable]: colors.backgroundColor.light,
28
29
  bg: $bg.reference,
29
- color: (_y = (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.text) === null || _x === void 0 ? void 0 : _x[900]) !== null && _y !== void 0 ? _y : "inherit",
30
+ color: colors.text[900],
30
31
  },
31
32
  // Own CSS var (`--menu-item-bg`), NOT the list's `--menu-bg` — Chakra's stock item
32
33
  // baseStyle rewrites `--menu-bg` itself on hover/focus, so reusing that same var name
@@ -1,5 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
2
2
  import { popoverAnatomy } from "@chakra-ui/anatomy";
3
+ import { paletteOf } from "./paletteFromTheme.js";
3
4
  const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(popoverAnatomy.keys);
4
5
  const $popperBg = cssVar("popper-bg");
5
6
  const $arrowShadowColor = cssVar("popper-arrow-shadow-color");
@@ -12,15 +13,15 @@ const $arrowShadowColor = cssVar("popper-arrow-shadow-color");
12
13
  * fixing `$popperBg` here fixes the arrow fill too.
13
14
  */
14
15
  const baseStyle = definePartsStyle(({ theme }) => {
15
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
16
- return ({
16
+ const colors = paletteOf(theme);
17
+ return {
17
18
  content: {
18
- [$popperBg.variable]: (_f = (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.light) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50]) !== null && _f !== void 0 ? _f : "#fff",
19
+ [$popperBg.variable]: colors.backgroundColor.light,
19
20
  bg: $popperBg.reference,
20
- [$arrowShadowColor.variable]: (_m = (_j = (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.border) === null || _h === void 0 ? void 0 : _h[200]) !== null && _j !== void 0 ? _j : (_l = (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.gray) === null || _l === void 0 ? void 0 : _l[200]) !== null && _m !== void 0 ? _m : "#e2e8f0",
21
- color: (_q = (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.text) === null || _p === void 0 ? void 0 : _p[900]) !== null && _q !== void 0 ? _q : "inherit",
21
+ [$arrowShadowColor.variable]: colors.border[200],
22
+ color: colors.text[900],
22
23
  },
23
- });
24
+ };
24
25
  });
25
26
  export const Popover = defineMultiStyleConfig({
26
27
  baseStyle,
@@ -1,5 +1,6 @@
1
1
  import { createMultiStyleConfigHelpers, cssVar } from "@chakra-ui/react";
2
2
  import { switchAnatomy } from "@chakra-ui/anatomy";
3
+ import { paletteOf } from "./paletteFromTheme.js";
3
4
  const { defineMultiStyleConfig, definePartsStyle } = createMultiStyleConfigHelpers(switchAnatomy.keys);
4
5
  const $thumbBg = cssVar("switch-thumb-bg");
5
6
  /**
@@ -7,15 +8,12 @@ const $thumbBg = cssVar("switch-thumb-bg");
7
8
  * `_dark` gate at all, so every bare `<Switch>` renders a literal white knob on the dark canvas
8
9
  * regardless of mode.
9
10
  */
10
- const baseStyle = definePartsStyle(({ theme }) => {
11
- var _a, _b, _c, _d, _e, _f;
12
- return ({
13
- thumb: {
14
- [$thumbBg.variable]: (_f = (_c = (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.backgroundColor) === null || _b === void 0 ? void 0 : _b.light) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50]) !== null && _f !== void 0 ? _f : "#fff",
15
- bg: $thumbBg.reference,
16
- },
17
- });
18
- });
11
+ const baseStyle = definePartsStyle(({ theme }) => ({
12
+ thumb: {
13
+ [$thumbBg.variable]: paletteOf(theme).backgroundColor.light,
14
+ bg: $thumbBg.reference,
15
+ },
16
+ }));
19
17
  export const Switch = defineMultiStyleConfig({
20
18
  baseStyle,
21
19
  });
@@ -159,42 +159,40 @@ export const PixelizeThemeProvider = ({ children, brand: brandProp = DEFAULT_BRA
159
159
  * `data-mode` for consumers that want to hook their own dark CSS.
160
160
  */
161
161
  useLayoutEffect(() => {
162
- var _a, _b, _c, _d, _e, _f, _g;
163
162
  const root = document.documentElement;
164
163
  root.dataset.mode = resolvedMode;
165
- const colors = resolvedTheme.colors;
166
- const sem = (_a = colors.semantic) !== null && _a !== void 0 ? _a : {};
167
- const gray = colors.gray;
164
+ const { colors } = resolvedTheme;
165
+ const { gray, semantic } = colors;
168
166
  const HUE_SCALES = [
169
167
  "primary", "gray", "red", "orange", "yellow",
170
168
  "green", "teal", "blue", "cyan", "purple", "pink",
171
169
  ];
172
- const SEMANTIC_SCALES = ["success", "error", "warning", "info"]; // nested under colors.semantic
170
+ const SEMANTIC_SCALES = ["success", "error", "warning", "info"];
173
171
  const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
174
- // Single-value semantic vars → palette scale+rung. The dark gray ramp runs dark(50) → light(900),
175
- // so low rungs read as surfaces and high rungs as text — correct in dark, cleared in light.
172
+ // The dark gray ramp runs dark(50) → light(900), so low rungs read as surfaces
173
+ // and high rungs as text — correct in dark, cleared in light.
176
174
  const SEMANTIC_VARS = {
177
- "text-heading": gray === null || gray === void 0 ? void 0 : gray[900], "text-body": gray === null || gray === void 0 ? void 0 : gray[700],
178
- "text-subtle": gray === null || gray === void 0 ? void 0 : gray[500], "text-input": gray === null || gray === void 0 ? void 0 : gray[500],
179
- "bg-main": gray === null || gray === void 0 ? void 0 : gray[50], "bg-secondary": gray === null || gray === void 0 ? void 0 : gray[100], "bg-tertiary": gray === null || gray === void 0 ? void 0 : gray[100],
180
- "bg-quaternary": gray === null || gray === void 0 ? void 0 : gray[200], "bg-light": gray === null || gray === void 0 ? void 0 : gray[50], "bg-medium": gray === null || gray === void 0 ? void 0 : gray[100],
181
- "bg-accent": gray === null || gray === void 0 ? void 0 : gray[200], "bg-subtle": gray === null || gray === void 0 ? void 0 : gray[100], "bg-muted": gray === null || gray === void 0 ? void 0 : gray[200],
182
- "bg-neutral": gray === null || gray === void 0 ? void 0 : gray[100], "bg-base": gray === null || gray === void 0 ? void 0 : gray[50], "bg-table-header": gray === null || gray === void 0 ? void 0 : gray[100],
183
- "border-default": gray === null || gray === void 0 ? void 0 : gray[200], "border-light": gray === null || gray === void 0 ? void 0 : gray[100],
184
- "border-dark": gray === null || gray === void 0 ? void 0 : gray[300], "border-input": gray === null || gray === void 0 ? void 0 : gray[300],
185
- "border-error": (_b = sem.error) === null || _b === void 0 ? void 0 : _b[500], "border-success": (_c = sem.success) === null || _c === void 0 ? void 0 : _c[500],
186
- "border-warning": (_d = sem.warning) === null || _d === void 0 ? void 0 : _d[500], "border-info": (_e = sem.info) === null || _e === void 0 ? void 0 : _e[500],
175
+ "text-heading": gray[900], "text-body": gray[700],
176
+ "text-subtle": gray[500], "text-input": gray[500],
177
+ "bg-main": gray[50], "bg-secondary": gray[100], "bg-tertiary": gray[100],
178
+ "bg-quaternary": gray[200], "bg-light": gray[50], "bg-medium": gray[100],
179
+ "bg-accent": gray[200], "bg-subtle": gray[100], "bg-muted": gray[200],
180
+ "bg-neutral": gray[100], "bg-base": gray[50], "bg-table-header": gray[100],
181
+ "border-default": gray[200], "border-light": gray[100],
182
+ "border-dark": gray[300], "border-input": gray[300],
183
+ "border-error": semantic.error[500], "border-success": semantic.success[500],
184
+ "border-warning": semantic.warning[500], "border-info": semantic.info[500],
187
185
  };
188
- const set = (name, val) => val && root.style.setProperty(`--color-${name}`, val);
186
+ const set = (name, val) => root.style.setProperty(`--color-${name}`, val);
189
187
  const clear = (name) => root.style.removeProperty(`--color-${name}`);
190
188
  const allRampNames = [...HUE_SCALES, ...SEMANTIC_SCALES].flatMap((s) => RUNGS.map((r) => `${s}-${r}`));
191
189
  if (resolvedMode === "dark") {
192
190
  for (const s of HUE_SCALES)
193
191
  for (const r of RUNGS)
194
- set(`${s}-${r}`, (_f = colors[s]) === null || _f === void 0 ? void 0 : _f[r]);
192
+ set(`${s}-${r}`, colors[s][r]);
195
193
  for (const s of SEMANTIC_SCALES)
196
194
  for (const r of RUNGS)
197
- set(`${s}-${r}`, (_g = sem[s]) === null || _g === void 0 ? void 0 : _g[r]);
195
+ set(`${s}-${r}`, semantic[s][r]);
198
196
  for (const [name, val] of Object.entries(SEMANTIC_VARS))
199
197
  set(name, val);
200
198
  }