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

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 (29) 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/tokens/brands/emerald/palette.light.js +5 -7
  5. package/dist/Theme/tokens/brands/lavender/palette.light.js +3 -110
  6. package/dist/Theme/tokens/brands/meadow/palette.light.js +5 -7
  7. package/dist/Theme/tokens/brands/neutrals.d.ts +8 -0
  8. package/dist/Theme/tokens/brands/neutrals.js +119 -0
  9. package/dist/Theme/tokens/brands/radiant/palette.light.js +5 -7
  10. package/dist/Theme/tokens/brands/rosewood/palette.light.js +5 -7
  11. package/dist/Theme/tokens/brands/skyline/palette.light.js +5 -7
  12. package/dist/Theme/tokens/brands/slate/palette.light.js +5 -7
  13. package/dist/Theme/tokens/brands/storefront/palette.light.js +5 -7
  14. package/dist/Theme/tokens/builders/brandInk.d.ts +11 -0
  15. package/dist/Theme/tokens/builders/brandInk.js +106 -0
  16. package/dist/Theme/tokens/types.d.ts +5 -0
  17. package/dist/esm/Components/Header/HeaderActions.js +8 -4
  18. package/dist/esm/Components/PlanPill/PlanPill.js +2 -2
  19. package/dist/esm/Theme/tokens/brands/emerald/palette.light.js +5 -4
  20. package/dist/esm/Theme/tokens/brands/lavender/palette.light.js +3 -110
  21. package/dist/esm/Theme/tokens/brands/meadow/palette.light.js +5 -4
  22. package/dist/esm/Theme/tokens/brands/neutrals.js +116 -0
  23. package/dist/esm/Theme/tokens/brands/radiant/palette.light.js +5 -4
  24. package/dist/esm/Theme/tokens/brands/rosewood/palette.light.js +5 -4
  25. package/dist/esm/Theme/tokens/brands/skyline/palette.light.js +5 -4
  26. package/dist/esm/Theme/tokens/brands/slate/palette.light.js +5 -4
  27. package/dist/esm/Theme/tokens/brands/storefront/palette.light.js +5 -4
  28. package/dist/esm/Theme/tokens/builders/brandInk.js +103 -0
  29. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ import { buildPrimaryOpacity } from "./buildBrandTokens.js";
2
+ import { hexToHsl, relativeLuminance, withLightness } from "./color.js";
3
+ const RUNGS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];
4
+ // Lavender's primary saturation. Each brand's ramps scale away from it.
5
+ const REFERENCE_SATURATION = 55.5;
6
+ const SECONDARY = {
7
+ 50: [39.4, 0.8231],
8
+ 100: [41.0, 0.61132],
9
+ 200: [37.7, 0.39479],
10
+ 300: [27.4, 0.18614],
11
+ 400: [28.4, 0.10269],
12
+ 500: [52.4, 0.00831],
13
+ 600: [55.1, 0.00573],
14
+ 700: [55.6, 0.00386],
15
+ 800: [60.0, 0.00245],
16
+ 900: [57.1, 0.00141],
17
+ };
18
+ const TEXT = {
19
+ 50: [25.9, 0.86267],
20
+ 100: [32.4, 0.63853],
21
+ 200: [32.7, 0.48344],
22
+ 300: [30.6, 0.30607],
23
+ 400: [29.2, 0.21515],
24
+ 500: [26.3, 0.10787],
25
+ 600: [26.6, 0.08786],
26
+ 700: [26.7, 0.05281],
27
+ 800: [27.4, 0.03145],
28
+ 900: [29.0, 0.01826],
29
+ };
30
+ const HEADER = {
31
+ 50: [31.3, 0.83382],
32
+ 100: [31.0, 0.59779],
33
+ 200: [30.6, 0.44729],
34
+ 300: [29.3, 0.27622],
35
+ 400: [30.0, 0.19238],
36
+ 500: [29.9, 0.10467],
37
+ 600: [29.9, 0.08682],
38
+ 700: [29.7, 0.05281],
39
+ 800: [29.1, 0.0319],
40
+ 900: [29.9, 0.01915],
41
+ };
42
+ const PLACEHOLDER = {
43
+ 50: [30.4, 0.87913],
44
+ 100: [35.4, 0.67128],
45
+ 200: [36.1, 0.53513],
46
+ 300: [34.7, 0.37333],
47
+ 400: [31.4, 0.30462],
48
+ 500: [28.2, 0.19307],
49
+ 600: [22.8, 0.15818],
50
+ 700: [22.0, 0.09196],
51
+ 800: [21.5, 0.05448],
52
+ 900: [22.3, 0.03206],
53
+ };
54
+ const DISABLED = {
55
+ 50: [33.3, 0.90353],
56
+ 100: [38.9, 0.80618],
57
+ 200: [40.7, 0.71546],
58
+ 300: [41.0, 0.60545],
59
+ 400: [39.6, 0.53328],
60
+ 500: [40.5, 0.43688],
61
+ 600: [28.2, 0.35566],
62
+ 700: [13.4, 0.20289],
63
+ 800: [11.4, 0.1171],
64
+ 900: [11.2, 0.06724],
65
+ };
66
+ // Lightness is monotonic in luminance for a fixed hue/saturation, so bisection converges.
67
+ const atLuminance = (anchor, saturation, target) => {
68
+ let low = 0;
69
+ let high = 100;
70
+ for (let i = 0; i < 30; i += 1) {
71
+ const mid = (low + high) / 2;
72
+ if (relativeLuminance(withLightness(anchor, mid, saturation)) < target)
73
+ low = mid;
74
+ else
75
+ high = mid;
76
+ }
77
+ return withLightness(anchor, (low + high) / 2, saturation);
78
+ };
79
+ const ramp = (anchor, profile) => {
80
+ const ratio = hexToHsl(anchor).s / REFERENCE_SATURATION;
81
+ const scale = {};
82
+ for (const rung of RUNGS) {
83
+ const [saturation, luminance] = profile[rung];
84
+ scale[rung] = atLuminance(anchor, Math.min(100, saturation * ratio), luminance);
85
+ }
86
+ return scale;
87
+ };
88
+ const brandRamp = (anchor, profile) => {
89
+ const scale = ramp(anchor, profile);
90
+ return { ...scale, opacity: buildPrimaryOpacity(scale[500]) };
91
+ };
92
+ /** Brand-hued ink ramps at lavender's verified luminances, so contrast carries over. */
93
+ export function buildBrandInk(primary500) {
94
+ const secondary = brandRamp(primary500, SECONDARY);
95
+ return {
96
+ secondary,
97
+ tertiary: { ...secondary },
98
+ text: ramp(primary500, TEXT),
99
+ header: ramp(primary500, HEADER),
100
+ placeholder: ramp(primary500, PLACEHOLDER),
101
+ disabled: ramp(primary500, DISABLED),
102
+ };
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.4.2-beta.1",
3
+ "version": "2.4.2-beta.2",
4
4
  "description": "React component library for Pixelize apps: themeable Chakra-based components, design tokens and light/dark brand theming.",
5
5
  "keywords": [
6
6
  "react",