pixelize-design-library 2.2.142 → 2.2.144

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.
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeHex = normalizeHex;
4
+ exports.buildPrimaryOpacity = buildPrimaryOpacity;
5
+ exports.buildPrimaryShadowTint = buildPrimaryShadowTint;
6
+ /**
7
+ * Builds 8-digit hex alpha tokens from a 6-digit brand color (Chakra primary.500).
8
+ */
9
+ function normalizeHex(hex) {
10
+ var trimmed = hex.trim();
11
+ var withHash = trimmed.startsWith("#") ? trimmed : "#".concat(trimmed);
12
+ if (!/^#[0-9a-fA-F]{6}$/.test(withHash)) {
13
+ throw new Error("Invalid hex color (expected #RRGGBB): ".concat(hex));
14
+ }
15
+ return withHash.toLowerCase();
16
+ }
17
+ function buildPrimaryOpacity(primary500) {
18
+ var h = normalizeHex(primary500);
19
+ return {
20
+ 4: "".concat(h, "0a"),
21
+ 8: "".concat(h, "14"),
22
+ 16: "".concat(h, "29"),
23
+ 24: "".concat(h, "3d"),
24
+ 32: "".concat(h, "52"),
25
+ 40: "".concat(h, "66"),
26
+ 48: "".concat(h, "7a"),
27
+ };
28
+ }
29
+ /** Tint used for focus rings / primary-tinted shadows (matches ~28% alpha pattern). */
30
+ function buildPrimaryShadowTint(primary500) {
31
+ var h = normalizeHex(primary500);
32
+ return "".concat(h, "47");
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var buildBrandTokens_1 = require("./buildBrandTokens");
4
+ describe("normalizeHex", function () {
5
+ it("adds hash and lowercases", function () {
6
+ expect((0, buildBrandTokens_1.normalizeHex)("9A4FE5")).toBe("#9a4fe5");
7
+ expect((0, buildBrandTokens_1.normalizeHex)("#2CAA3D")).toBe("#2caa3d");
8
+ });
9
+ it("rejects invalid hex", function () {
10
+ expect(function () { return (0, buildBrandTokens_1.normalizeHex)("gggggg"); }).toThrow(/Invalid hex/);
11
+ expect(function () { return (0, buildBrandTokens_1.normalizeHex)("#fff"); }).toThrow(/Invalid hex/);
12
+ });
13
+ });
14
+ describe("buildPrimaryOpacity", function () {
15
+ it("appends alpha steps to brand hex", function () {
16
+ expect((0, buildBrandTokens_1.buildPrimaryOpacity)("#2caa3d")).toEqual({
17
+ 4: "#2caa3d0a",
18
+ 8: "#2caa3d14",
19
+ 16: "#2caa3d29",
20
+ 24: "#2caa3d3d",
21
+ 32: "#2caa3d52",
22
+ 40: "#2caa3d66",
23
+ 48: "#2caa3d7a",
24
+ });
25
+ });
26
+ });
27
+ describe("buildPrimaryShadowTint", function () {
28
+ it("returns 8-digit hex with shadow alpha", function () {
29
+ expect((0, buildBrandTokens_1.buildPrimaryShadowTint)("#0088cc")).toBe("#0088cc47");
30
+ });
31
+ });
@@ -366,6 +366,8 @@ export type CustomThemeProps = {
366
366
  subtle: string;
367
367
  muted: string;
368
368
  neutral: string;
369
+ base: string;
370
+ tableHeader: string;
369
371
  };
370
372
  };
371
373
  fonts: ChakraTheme["fonts"] & {
package/dist/global.css CHANGED
@@ -1,21 +1,22 @@
1
1
  :root {
2
- --color-primary-50: #ecddfb;
3
- --color-primary-100: #d6b7f6;
4
- --color-primary-200: #be8ef0;
5
- --color-primary-300: #aa6ae9;
6
- --color-primary-400: #944cde;
7
- --color-primary-500: #9A4FE5;
8
- --color-primary-600: #8b48d8;
9
- --color-primary-700: #7a3ccc;
10
- --color-primary-800: #6933b2;
11
- --color-primary-900: #59299a;
12
-
13
- --color-primary-opacity-8: rgba(154, 82, 226, 0.08);
14
- --color-primary-opacity-16: rgba(154, 82, 226, 0.16);
15
- --color-primary-opacity-24: rgba(154, 82, 226, 0.24);
16
- --color-primary-opacity-28: rgba(154, 82, 226, 0.28);
17
- --color-primary-opacity-32: rgba(154, 82, 226, 0.32);
18
- --color-primary-opacity-40: rgba(154, 82, 226, 0.40);
2
+ /* Aligned with Theme/Default (lavender) primary ramp */
3
+ --color-primary-50: #f5edfc;
4
+ --color-primary-100: #e0c8f7;
5
+ --color-primary-200: #d1aef3;
6
+ --color-primary-300: #bb89ee;
7
+ --color-primary-400: #ae72ea;
8
+ --color-primary-500: #9a4fe5;
9
+ --color-primary-600: #8c48d0;
10
+ --color-primary-700: #6d38a3;
11
+ --color-primary-800: #55277e;
12
+ --color-primary-900: #412160;
13
+
14
+ --color-primary-opacity-8: rgba(154, 79, 229, 0.08);
15
+ --color-primary-opacity-16: rgba(154, 79, 229, 0.16);
16
+ --color-primary-opacity-24: rgba(154, 79, 229, 0.24);
17
+ --color-primary-opacity-28: rgba(154, 79, 229, 0.28);
18
+ --color-primary-opacity-32: rgba(154, 79, 229, 0.32);
19
+ --color-primary-opacity-40: rgba(154, 79, 229, 0.4);
19
20
 
20
21
  --color-success-50: #e9fdf1;
21
22
  --color-success-100: #c8f7d8;
@@ -223,3 +224,16 @@
223
224
  --color-success-500: #319795;
224
225
  --color-error-500: #d53f8c;
225
226
  }
227
+
228
+ /* Optional: align CSS variables with Chakra named themes when `data-theme` is set on a wrapper */
229
+ [data-theme="meadow"] {
230
+ --color-primary-500: #2caa3d;
231
+ }
232
+
233
+ [data-theme="radiant"] {
234
+ --color-primary-500: #fb8c00;
235
+ }
236
+
237
+ [data-theme="skyline"] {
238
+ --color-primary-500: #0088cc;
239
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.2.142",
3
+ "version": "2.2.144",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",