@crewlethq/tokens 0.49.0 → 0.50.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.
package/README.md CHANGED
@@ -67,9 +67,27 @@ if (text && ground) {
67
67
  | `contrast(a, b)` | The WCAG 2 ratio between two opaque colours, from 1 to 21, in either order. Unrounded: compare the raw ratio with a floor, and round only to display it, because a ratio that passes only once rounded does not pass. |
68
68
  | `luminance(rgb)` | WCAG relative luminance, from 0 to 1. |
69
69
  | `WCAG_CONTRAST` | The floors, frozen: `aa` 4.5 and `aaa` 7 for body text, `aaLarge` 3 and `aaaLarge` 4.5 for large text (24px, or 18.66px bold); `aaLarge` is also the floor for a graphical mark and a control's boundary. |
70
+ | `nearestContrastShade(hex, ground, min)` | The colour nearest `hex` that clears `min` against `ground`, as lowercase `#rrggbb`, or `null` when no shade of it can (or either value is not `#rrggbb`). Only its OKLab lightness moves, in both directions, and the nearer passing shade wins; its hue is kept, and its chroma gives way only where a screen cannot show it. A colour that already clears the floor comes back unchanged. The floor is held on the rounded value it returns. |
70
71
  | `Rgb` | The type of a colour as channels from 0 to 255. |
71
72
 
72
- The implementation is `src/color.ts`, built to `dist/color.js`. The published palette suite imports it from there and re-exports it, and the token build reads the same source to derive each palette's tints, so there is one copy of the maths.
73
+ The implementation is `src/color.ts`, built to `dist/color.js`. The published palette suite imports it from there and re-exports it (the OKLab conversions included), and the token build reads the same source to derive each palette's tints, so there is one copy of the maths.
74
+
75
+ When a pair falls short, offer the nearest shade rather than a verdict alone. It keeps the colour a person chose, so accepting it is a correction rather than a repaint:
76
+
77
+ ```ts
78
+ import { WCAG_CONTRAST, contrast, nearestContrastShade, parseHex } from '@crewlethq/tokens';
79
+
80
+ nearestContrastShade('#00baba', '#f6f7fb', WCAG_CONTRAST.aa); // '#007f7f', 4.51:1
81
+ nearestContrastShade('#00baba', '#f6f7fb', WCAG_CONTRAST.aaLarge); // '#00a0a0', 3.00:1
82
+ ```
83
+
84
+ Show the ratio of the value it returns, measured with `contrast`, rather than the floor it was asked for.
85
+
86
+ ## Changed in 0.50.0: the nearest shade that clears a floor
87
+
88
+ | What changed | What to change | Details |
89
+ | --- | --- | --- |
90
+ | `@crewlethq/tokens` exports `nearestContrastShade(hex, ground, min)`, the colour nearest `hex` (same hue, lightness moved) that clears `min` against `ground`, or `null`. In `@crewlethq/tokens/test/palette`, `toOklab`, `oklabToLinear`, `fromOklab` and `hex` are now the runtime module's functions, re-exported, with the same signatures and results. | Nothing. Replace a suggestion helper of your own with it. | [Contrast at runtime](#contrast-at-runtime) |
73
91
 
74
92
  ## Changed in 0.49.0: contrast at runtime, the brand kind and the brand mapping
75
93
 
package/dist/color.d.ts CHANGED
@@ -59,3 +59,42 @@ export declare function luminance({ r, g, b }: Rgb): number;
59
59
  * ratio against `WCAG_CONTRAST`.
60
60
  */
61
61
  export declare function contrast(a: Rgb, b: Rgb): number;
62
+ /** A colour in OKLab: perceptual lightness `L` from 0 to 1, and the two opponent axes. */
63
+ export interface Oklab {
64
+ L: number;
65
+ a: number;
66
+ b: number;
67
+ }
68
+ /** sRGB channels (0 to 255) in OKLab. */
69
+ export declare function toOklab({ r, g, b }: Rgb): Oklab;
70
+ /**
71
+ * OKLab to LINEAR sRGB, unclipped. A channel under 0 or over 1 says the
72
+ * colour is outside what a screen can show, which `fromOklab` hides by
73
+ * clipping each channel on its own, and clipping one channel turns the hue: a
74
+ * search that walks lightness has to know where the gamut ends rather than be
75
+ * handed a different colour from the one it asked for.
76
+ */
77
+ export declare function oklabToLinear({ L, a, b }: Oklab): Rgb;
78
+ /** One linear channel, 0 to 1, as an sRGB channel, 0 to 255, clipped but not rounded. */
79
+ export declare function fromLinear(v: number): number;
80
+ /** OKLab to sRGB, each channel clipped and rounded to a whole step. */
81
+ export declare function fromOklab(lab: Oklab): Rgb;
82
+ /** Channels as lowercase `#rrggbb`. */
83
+ export declare function formatHex({ r, g, b }: Rgb): string;
84
+ /**
85
+ * The colour nearest `hex` that clears `min` against `ground`, as lowercase
86
+ * `#rrggbb`, or null when no shade of it can (or either value is not
87
+ * `#rrggbb`).
88
+ *
89
+ * THE SAME COLOUR, LIGHTER OR DARKER. Its hue and chroma are kept in OKLab and
90
+ * only its lightness moves, in both directions from where it stands; the
91
+ * nearer shade that clears the floor wins, so a teal too light for a light
92
+ * page becomes a darker teal rather than a different colour. Where a shade
93
+ * cannot carry the colour's full chroma on a screen, chroma gives way and the
94
+ * hue never does. A colour that already clears the floor is its own answer.
95
+ *
96
+ * The floor is held on the rounded value the function returns, unrounded, as
97
+ * every contrast here is: a shade that clears it only before rounding is not
98
+ * returned.
99
+ */
100
+ export declare function nearestContrastShade(hex: string, ground: string, min: number): string | null;
package/dist/color.js CHANGED
@@ -79,3 +79,113 @@ export function contrast(a, b) {
79
79
  const [hi, lo] = la > lb ? [la, lb] : [lb, la];
80
80
  return (hi + 0.05) / (lo + 0.05);
81
81
  }
82
+ /** sRGB channels (0 to 255) in OKLab. */
83
+ export function toOklab({ r, g, b }) {
84
+ const lr = linearChannel(r);
85
+ const lg = linearChannel(g);
86
+ const lb = linearChannel(b);
87
+ const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
88
+ const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
89
+ const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
90
+ return {
91
+ L: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
92
+ a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
93
+ b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
94
+ };
95
+ }
96
+ /**
97
+ * OKLab to LINEAR sRGB, unclipped. A channel under 0 or over 1 says the
98
+ * colour is outside what a screen can show, which `fromOklab` hides by
99
+ * clipping each channel on its own, and clipping one channel turns the hue: a
100
+ * search that walks lightness has to know where the gamut ends rather than be
101
+ * handed a different colour from the one it asked for.
102
+ */
103
+ export function oklabToLinear({ L, a, b }) {
104
+ const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3;
105
+ const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3;
106
+ const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3;
107
+ return {
108
+ r: 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,
109
+ g: -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,
110
+ b: -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s,
111
+ };
112
+ }
113
+ /** One linear channel, 0 to 1, as an sRGB channel, 0 to 255, clipped but not rounded. */
114
+ export function fromLinear(v) {
115
+ const c = v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055;
116
+ return Math.min(255, Math.max(0, c * 255));
117
+ }
118
+ /** OKLab to sRGB, each channel clipped and rounded to a whole step. */
119
+ export function fromOklab(lab) {
120
+ const { r, g, b } = oklabToLinear(lab);
121
+ return { r: Math.round(fromLinear(r)), g: Math.round(fromLinear(g)), b: Math.round(fromLinear(b)) };
122
+ }
123
+ /** Channels as lowercase `#rrggbb`. */
124
+ export function formatHex({ r, g, b }) {
125
+ return `#${[r, g, b].map((v) => Math.round(v).toString(16).padStart(2, '0')).join('')}`;
126
+ }
127
+ /** Whether linear sRGB is inside what a screen can show, with a hair of tolerance for rounding. */
128
+ function inGamut({ r, g, b }) {
129
+ const ok = (v) => v >= -1e-6 && v <= 1 + 1e-6;
130
+ return ok(r) && ok(g) && ok(b);
131
+ }
132
+ /**
133
+ * A lightness in OKLab, at the hue of `a` and `b`, as the most chroma the
134
+ * screen can show there, up to the colour's own: a dark or a very light shade
135
+ * of a vivid colour cannot carry its full chroma, and giving up chroma (never
136
+ * hue) is what keeps it the same colour.
137
+ */
138
+ function shadeAt(L, a, b) {
139
+ if (inGamut(oklabToLinear({ L, a, b })))
140
+ return fromOklab({ L, a, b });
141
+ let lo = 0;
142
+ let hi = 1;
143
+ for (let i = 0; i < 24; i += 1) {
144
+ const k = (lo + hi) / 2;
145
+ if (inGamut(oklabToLinear({ L, a: a * k, b: b * k })))
146
+ lo = k;
147
+ else
148
+ hi = k;
149
+ }
150
+ return fromOklab({ L, a: a * lo, b: b * lo });
151
+ }
152
+ /** How finely the lightness is walked: a thousandth of OKLab's range. */
153
+ const LIGHTNESS_STEP = 0.001;
154
+ /**
155
+ * The colour nearest `hex` that clears `min` against `ground`, as lowercase
156
+ * `#rrggbb`, or null when no shade of it can (or either value is not
157
+ * `#rrggbb`).
158
+ *
159
+ * THE SAME COLOUR, LIGHTER OR DARKER. Its hue and chroma are kept in OKLab and
160
+ * only its lightness moves, in both directions from where it stands; the
161
+ * nearer shade that clears the floor wins, so a teal too light for a light
162
+ * page becomes a darker teal rather than a different colour. Where a shade
163
+ * cannot carry the colour's full chroma on a screen, chroma gives way and the
164
+ * hue never does. A colour that already clears the floor is its own answer.
165
+ *
166
+ * The floor is held on the rounded value the function returns, unrounded, as
167
+ * every contrast here is: a shade that clears it only before rounding is not
168
+ * returned.
169
+ */
170
+ export function nearestContrastShade(hex, ground, min) {
171
+ const colour = parseHex(hex);
172
+ const base = parseHex(ground);
173
+ if (!colour || !base || !(min >= 1))
174
+ return null;
175
+ if (contrast(colour, base) >= min)
176
+ return formatHex(colour);
177
+ const { L, a, b } = toOklab(colour);
178
+ for (let i = 1; i * LIGHTNESS_STEP <= 1; i += 1) {
179
+ const dL = i * LIGHTNESS_STEP;
180
+ // Darker first at an equal distance: on the light grounds a brand is
181
+ // checked against most, darker is the shade that reads as the same ink.
182
+ for (const next of [L - dL, L + dL]) {
183
+ if (next < 0 || next > 1)
184
+ continue;
185
+ const shade = shadeAt(next, a, b);
186
+ if (contrast(shade, base) >= min)
187
+ return formatHex(shade);
188
+ }
189
+ }
190
+ return null;
191
+ }
package/dist/index.d.ts CHANGED
@@ -339,9 +339,11 @@ export declare const zIndex: {
339
339
  readonly popover: "10000";
340
340
  readonly toast: "10001";
341
341
  };
342
- export { themes, themeGroups, themeRegistry, DEFAULT_THEME_ID, isThemeId } from './themes.js';
343
- export type { ThemeName, ThemeGroupId, ThemeEntry, ThemeId } from './themes.js';
344
- export { WCAG_CONTRAST, contrast, luminance, parseHex } from './color.js';
342
+ export { themes } from './palettes.js';
343
+ export type { ThemeName } from './palettes.js';
344
+ export { themeGroups, themeRegistry, DEFAULT_THEME_ID, isThemeId } from './themes.js';
345
+ export type { ThemeGroupId, ThemeEntry, ThemeId } from './themes.js';
346
+ export { WCAG_CONTRAST, contrast, luminance, nearestContrastShade, parseHex } from './color.js';
345
347
  export type { Rgb } from './color.js';
346
348
  export { BRAND_SCOPE_CLASS, BRAND_SCOPE_LAYER_CLASS, BRAND_THEME_PREFIX, brandScopeCss, brandSlots, brandThemeName, parseBrandLayer } from './brand.js';
347
349
  export type { BrandLayer, BrandModeValues } from './brand.js';
package/dist/index.js CHANGED
@@ -340,6 +340,7 @@ export const zIndex = {
340
340
  "popover": "10000",
341
341
  "toast": "10001"
342
342
  };
343
- export { themes, themeGroups, themeRegistry, DEFAULT_THEME_ID, isThemeId } from './themes.js';
344
- export { WCAG_CONTRAST, contrast, luminance, parseHex } from './color.js';
343
+ export { themes } from './palettes.js';
344
+ export { themeGroups, themeRegistry, DEFAULT_THEME_ID, isThemeId } from './themes.js';
345
+ export { WCAG_CONTRAST, contrast, luminance, nearestContrastShade, parseHex } from './color.js';
345
346
  export { BRAND_SCOPE_CLASS, BRAND_SCOPE_LAYER_CLASS, BRAND_THEME_PREFIX, brandScopeCss, brandSlots, brandThemeName, parseBrandLayer } from './brand.js';
@@ -0,0 +1,283 @@
1
+ /**
2
+ * The two palettes, for JavaScript that cannot read a custom property: the
3
+ * tool chrome around a preview, a chart library that wants a series' colour
4
+ * as a string, a canvas that paints its own pixels.
5
+ *
6
+ * PREFER THE CUSTOM PROPERTY wherever CSS can reach: a value read here is a
7
+ * value taken at build time, so it does not follow a theme the reader
8
+ * changes. This is for the places where there is no element to read from.
9
+ *
10
+ * Its own module, apart from the theme registry (themes.ts), so a consumer
11
+ * of the registry never carries these values.
12
+ */
13
+ export declare const themes: {
14
+ readonly light: {
15
+ readonly color: {
16
+ readonly surface: {
17
+ readonly frame: "#e9ecf3";
18
+ readonly background: "#f6f7fb";
19
+ readonly subtle: "#fcfcfc";
20
+ readonly elevated: "#f1f2f6";
21
+ readonly hover: "rgba(7, 8, 13, 0.044)";
22
+ readonly pressed: "rgba(7, 8, 13, 0.088)";
23
+ readonly inset: "rgba(7, 8, 13, 0.026)";
24
+ readonly glass: "rgba(252, 252, 252, 0.90)";
25
+ readonly scrim: "rgba(0, 0, 0, 0.6)";
26
+ readonly veil: "rgba(233, 236, 243, 0.65)";
27
+ readonly inverse: "#07080d";
28
+ };
29
+ readonly text: {
30
+ readonly primary: "#121625";
31
+ readonly secondary: "#3e4459";
32
+ readonly linkQuiet: "#484e99";
33
+ readonly tertiary: "#585e73";
34
+ readonly muted: "#878d9f";
35
+ readonly onAccent: "#ffffff";
36
+ readonly onDanger: "#ffffff";
37
+ readonly onScrim: "#ffffff";
38
+ readonly inverse: "#f6f7fb";
39
+ };
40
+ readonly brand: {
41
+ readonly accent: "#735af2";
42
+ readonly accentHover: "#674ee4";
43
+ readonly accentActive: "#5b3dc7";
44
+ readonly accentInk: "#4f51bd";
45
+ readonly accentSoft: "rgba(115, 90, 242, 0.125)";
46
+ readonly accentRgb: "115, 90, 242";
47
+ readonly accentSoftStrong: "rgba(115, 90, 242, 0.32)";
48
+ };
49
+ readonly border: {
50
+ readonly default: "#e5e6ea";
51
+ readonly hover: "#c9cfdc";
52
+ readonly strong: "#c9cfdc";
53
+ readonly strongHover: "#acb6cc";
54
+ readonly hatch: "#dbdfe8";
55
+ readonly control: "#777a83";
56
+ readonly field: "#838894";
57
+ readonly selected: "rgba(115, 90, 242, 0.6)";
58
+ };
59
+ readonly focus: "#735af2";
60
+ readonly feedback: {
61
+ readonly success: "#0b9a74";
62
+ readonly successInk: "#0b6a4b";
63
+ readonly warning: "#c17300";
64
+ readonly warningInk: "#8c4e00";
65
+ readonly danger: "#b9112c";
66
+ readonly dangerHover: "#ad0023";
67
+ readonly dangerInk: "#b20d23";
68
+ readonly info: "#2f92b4";
69
+ readonly infoInk: "#1a6588";
70
+ readonly successSoft: "rgba(11, 154, 116, 0.12)";
71
+ readonly successLine: "rgba(11, 154, 116, 0.3)";
72
+ readonly warningSoft: "rgba(193, 115, 0, 0.12)";
73
+ readonly warningLine: "rgba(193, 115, 0, 0.3)";
74
+ readonly dangerSoft: "rgba(185, 17, 44, 0.12)";
75
+ readonly dangerLine: "rgba(185, 17, 44, 0.3)";
76
+ readonly infoSoft: "rgba(47, 146, 180, 0.12)";
77
+ readonly infoLine: "rgba(47, 146, 180, 0.3)";
78
+ };
79
+ readonly data: {
80
+ readonly "1": "#5c76c3";
81
+ readonly "2": "#dd5920";
82
+ readonly "3": "#00956e";
83
+ readonly "4": "#c27600";
84
+ readonly other: "#85868d";
85
+ };
86
+ readonly node: {
87
+ readonly purple: "#7150b3";
88
+ readonly purpleInk: "#573394";
89
+ readonly cyan: "#166b80";
90
+ readonly cyanInk: "#004f62";
91
+ readonly green: "#2c7046";
92
+ readonly greenInk: "#05532b";
93
+ readonly amber: "#865a28";
94
+ readonly amberInk: "#683e03";
95
+ readonly rose: "#984a55";
96
+ readonly roseInk: "#7a2f3c";
97
+ readonly blue: "#4062a7";
98
+ readonly blueInk: "#264588";
99
+ readonly purpleFill: "rgba(113, 80, 179, 0.12)";
100
+ readonly purpleLine: "rgba(113, 80, 179, 0.38)";
101
+ readonly purpleHalo: "rgba(113, 80, 179, 0.16)";
102
+ readonly cyanFill: "rgba(22, 107, 128, 0.12)";
103
+ readonly cyanLine: "rgba(22, 107, 128, 0.38)";
104
+ readonly cyanHalo: "rgba(22, 107, 128, 0.16)";
105
+ readonly greenFill: "rgba(44, 112, 70, 0.12)";
106
+ readonly greenLine: "rgba(44, 112, 70, 0.38)";
107
+ readonly greenHalo: "rgba(44, 112, 70, 0.16)";
108
+ readonly amberFill: "rgba(134, 90, 40, 0.12)";
109
+ readonly amberLine: "rgba(134, 90, 40, 0.38)";
110
+ readonly amberHalo: "rgba(134, 90, 40, 0.16)";
111
+ readonly roseFill: "rgba(152, 74, 85, 0.12)";
112
+ readonly roseLine: "rgba(152, 74, 85, 0.38)";
113
+ readonly roseHalo: "rgba(152, 74, 85, 0.16)";
114
+ readonly blueFill: "rgba(64, 98, 167, 0.12)";
115
+ readonly blueLine: "rgba(64, 98, 167, 0.38)";
116
+ readonly blueHalo: "rgba(64, 98, 167, 0.16)";
117
+ };
118
+ readonly presence: {
119
+ readonly flagText: "#ffffff";
120
+ };
121
+ readonly artifact: {
122
+ readonly kind: {
123
+ readonly brand: "#8f3884";
124
+ readonly brandInk: "#74246a";
125
+ readonly brandFill: "rgba(143, 56, 132, 0.12)";
126
+ readonly brandLine: "rgba(143, 56, 132, 0.38)";
127
+ };
128
+ };
129
+ readonly scrollbar: "rgba(7, 8, 13, 0.2)";
130
+ readonly scrollbarHover: "rgba(7, 8, 13, 0.32)";
131
+ };
132
+ readonly shadow: {
133
+ readonly xs: "0 1px 2px rgba(7, 8, 13, 0.06)";
134
+ readonly sm: "0 2px 8px rgba(7, 8, 13, 0.07)";
135
+ readonly md: "0 4px 12px rgba(7, 8, 13, 0.08), 0 1px 3px rgba(7, 8, 13, 0.06)";
136
+ readonly lg: "0 8px 24px rgba(7, 8, 13, 0.12)";
137
+ readonly xl: "0 16px 40px rgba(7, 8, 13, 0.16), 0 2px 8px rgba(7, 8, 13, 0.08)";
138
+ readonly sheet: "-16px 0 40px rgba(7, 8, 13, 0.16), -2px 0 8px rgba(7, 8, 13, 0.08)";
139
+ readonly "2xl": "0 16px 64px rgba(7, 8, 13, 0.20)";
140
+ readonly card: "0 8px 24px rgba(7, 8, 13, 0.07)";
141
+ readonly rimLit: "0 4px 24px rgba(7, 8, 13, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6)";
142
+ readonly hairline: "none";
143
+ readonly focus: "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)";
144
+ readonly selection: "inset 0 0 0 2px var(--color-brand-accent)";
145
+ readonly glow: "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.22)";
146
+ };
147
+ };
148
+ readonly dark: {
149
+ readonly color: {
150
+ readonly surface: {
151
+ readonly frame: "#07080d";
152
+ readonly background: "#0c0e16";
153
+ readonly subtle: "#11141d";
154
+ readonly elevated: "#242833";
155
+ readonly hover: "rgba(255, 255, 255, 0.061)";
156
+ readonly pressed: "rgba(255, 255, 255, 0.098)";
157
+ readonly inset: "rgba(255, 255, 255, 0.028)";
158
+ readonly glass: "rgba(17, 20, 29, 0.90)";
159
+ readonly scrim: "rgba(0, 0, 0, 0.6)";
160
+ readonly veil: "rgba(7, 8, 13, 0.65)";
161
+ readonly inverse: "#fcfcfc";
162
+ };
163
+ readonly text: {
164
+ readonly primary: "#e7eaf3";
165
+ readonly secondary: "#a9b0c3";
166
+ readonly linkQuiet: "#a9b0ea";
167
+ readonly tertiary: "#9fa7bc";
168
+ readonly muted: "#5a6176";
169
+ readonly onAccent: "#ffffff";
170
+ readonly onDanger: "#ffffff";
171
+ readonly onScrim: "#ffffff";
172
+ readonly inverse: "#07080d";
173
+ };
174
+ readonly brand: {
175
+ readonly accent: "#725be6";
176
+ readonly accentHover: "#674ee4";
177
+ readonly accentActive: "#5b3dc7";
178
+ readonly accentInk: "#a9b0ff";
179
+ readonly accentSoft: "rgba(114, 91, 230, 0.16)";
180
+ readonly accentRgb: "114, 91, 230";
181
+ readonly accentSoftStrong: "rgba(114, 91, 230, 0.32)";
182
+ };
183
+ readonly border: {
184
+ readonly default: "#1e2025";
185
+ readonly hover: "#2d3448";
186
+ readonly strong: "#2d3448";
187
+ readonly strongHover: "#424f74";
188
+ readonly hatch: "#202534";
189
+ readonly control: "#7f879c";
190
+ readonly field: "#687187";
191
+ readonly selected: "rgba(114, 91, 230, 0.6)";
192
+ };
193
+ readonly focus: "#8572fe";
194
+ readonly feedback: {
195
+ readonly success: "#34c98b";
196
+ readonly successInk: "#74dcae";
197
+ readonly warning: "#f0b425";
198
+ readonly warningInk: "#f6cd72";
199
+ readonly danger: "#d73756";
200
+ readonly dangerHover: "#cc2b4e";
201
+ readonly dangerInk: "#ff9fb0";
202
+ readonly info: "#61d0ff";
203
+ readonly infoInk: "#8ad6fb";
204
+ readonly successSoft: "rgba(52, 201, 139, 0.12)";
205
+ readonly successLine: "rgba(52, 201, 139, 0.3)";
206
+ readonly warningSoft: "rgba(240, 180, 37, 0.12)";
207
+ readonly warningLine: "rgba(240, 180, 37, 0.3)";
208
+ readonly dangerSoft: "rgba(215, 55, 86, 0.12)";
209
+ readonly dangerLine: "rgba(215, 55, 86, 0.3)";
210
+ readonly infoSoft: "rgba(97, 208, 255, 0.12)";
211
+ readonly infoLine: "rgba(97, 208, 255, 0.3)";
212
+ };
213
+ readonly data: {
214
+ readonly "1": "#4d8ff6";
215
+ readonly "2": "#e67737";
216
+ readonly "3": "#26b582";
217
+ readonly "4": "#eab106";
218
+ readonly other: "#6a7186";
219
+ };
220
+ readonly node: {
221
+ readonly purple: "#8e6ed4";
222
+ readonly purpleInk: "#cabae0";
223
+ readonly cyan: "#5ca8be";
224
+ readonly cyanInk: "#b3d7e0";
225
+ readonly green: "#62a578";
226
+ readonly greenInk: "#b8d8c0";
227
+ readonly amber: "#c89866";
228
+ readonly amberInk: "#e0c89e";
229
+ readonly rose: "#c8757f";
230
+ readonly roseInk: "#e0bfc4";
231
+ readonly blue: "#5b7fc7";
232
+ readonly blueInk: "#b9c5e0";
233
+ readonly purpleFill: "rgba(142, 110, 212, 0.12)";
234
+ readonly purpleLine: "rgba(142, 110, 212, 0.38)";
235
+ readonly purpleHalo: "rgba(142, 110, 212, 0.16)";
236
+ readonly cyanFill: "rgba(92, 168, 190, 0.12)";
237
+ readonly cyanLine: "rgba(92, 168, 190, 0.38)";
238
+ readonly cyanHalo: "rgba(92, 168, 190, 0.16)";
239
+ readonly greenFill: "rgba(98, 165, 120, 0.12)";
240
+ readonly greenLine: "rgba(98, 165, 120, 0.38)";
241
+ readonly greenHalo: "rgba(98, 165, 120, 0.16)";
242
+ readonly amberFill: "rgba(200, 152, 102, 0.12)";
243
+ readonly amberLine: "rgba(200, 152, 102, 0.38)";
244
+ readonly amberHalo: "rgba(200, 152, 102, 0.16)";
245
+ readonly roseFill: "rgba(200, 117, 127, 0.12)";
246
+ readonly roseLine: "rgba(200, 117, 127, 0.38)";
247
+ readonly roseHalo: "rgba(200, 117, 127, 0.16)";
248
+ readonly blueFill: "rgba(91, 127, 199, 0.12)";
249
+ readonly blueLine: "rgba(91, 127, 199, 0.38)";
250
+ readonly blueHalo: "rgba(91, 127, 199, 0.16)";
251
+ };
252
+ readonly presence: {
253
+ readonly flagText: "#07080d";
254
+ };
255
+ readonly artifact: {
256
+ readonly kind: {
257
+ readonly brand: "#cc7bd1";
258
+ readonly brandInk: "#dabcdb";
259
+ readonly brandFill: "rgba(204, 123, 209, 0.12)";
260
+ readonly brandLine: "rgba(204, 123, 209, 0.38)";
261
+ };
262
+ };
263
+ readonly scrollbar: "rgba(255, 255, 255, 0.16)";
264
+ readonly scrollbarHover: "rgba(255, 255, 255, 0.26)";
265
+ };
266
+ readonly shadow: {
267
+ readonly xs: "0 1px 2px rgba(0, 0, 0, 0.2)";
268
+ readonly sm: "0 2px 8px rgba(0, 0, 0, 0.15)";
269
+ readonly md: "0 4px 12px rgba(0, 0, 0, 0.25)";
270
+ readonly lg: "0 8px 24px rgba(0, 0, 0, 0.3)";
271
+ readonly xl: "0 12px 32px rgba(0, 0, 0, 0.4)";
272
+ readonly sheet: "-8px 0 32px rgba(0, 0, 0, 0.4)";
273
+ readonly "2xl": "0 16px 64px rgba(0, 0, 0, 0.6)";
274
+ readonly card: "0 8px 24px rgba(0, 0, 0, 0.1)";
275
+ readonly rimLit: "0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04)";
276
+ readonly hairline: "inset 0 1px 0 rgba(255, 255, 255, 0.04)";
277
+ readonly focus: "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)";
278
+ readonly selection: "inset 0 0 0 2px var(--color-brand-accent)";
279
+ readonly glow: "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.3)";
280
+ };
281
+ };
282
+ };
283
+ export type ThemeName = keyof typeof themes;