@crewlethq/tokens 0.48.3 → 0.49.1

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/dist/themes.d.ts CHANGED
@@ -1,267 +1,3 @@
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
- export declare const themes: {
11
- readonly light: {
12
- readonly color: {
13
- readonly surface: {
14
- readonly frame: "#e9ecf3";
15
- readonly background: "#f6f7fb";
16
- readonly subtle: "#fcfcfc";
17
- readonly elevated: "#f1f2f6";
18
- readonly hover: "rgba(7, 8, 13, 0.044)";
19
- readonly pressed: "rgba(7, 8, 13, 0.088)";
20
- readonly inset: "rgba(7, 8, 13, 0.026)";
21
- readonly glass: "rgba(252, 252, 252, 0.90)";
22
- readonly scrim: "rgba(0, 0, 0, 0.6)";
23
- readonly veil: "rgba(233, 236, 243, 0.65)";
24
- readonly inverse: "#07080d";
25
- };
26
- readonly text: {
27
- readonly primary: "#121625";
28
- readonly secondary: "#3e4459";
29
- readonly linkQuiet: "#484e99";
30
- readonly tertiary: "#585e73";
31
- readonly muted: "#878d9f";
32
- readonly onAccent: "#ffffff";
33
- readonly onDanger: "#ffffff";
34
- readonly onScrim: "#ffffff";
35
- readonly inverse: "#f6f7fb";
36
- };
37
- readonly brand: {
38
- readonly accent: "#735af2";
39
- readonly accentHover: "#674ee4";
40
- readonly accentActive: "#5b3dc7";
41
- readonly accentInk: "#4f51bd";
42
- readonly accentSoft: "rgba(115, 90, 242, 0.125)";
43
- readonly accentRgb: "115, 90, 242";
44
- readonly accentSoftStrong: "rgba(115, 90, 242, 0.32)";
45
- };
46
- readonly border: {
47
- readonly default: "#e5e6ea";
48
- readonly hover: "#c9cfdc";
49
- readonly strong: "#c9cfdc";
50
- readonly strongHover: "#acb6cc";
51
- readonly hatch: "#dbdfe8";
52
- readonly control: "#777a83";
53
- readonly field: "#838894";
54
- readonly selected: "rgba(115, 90, 242, 0.6)";
55
- };
56
- readonly focus: "#735af2";
57
- readonly feedback: {
58
- readonly success: "#0b9a74";
59
- readonly successInk: "#0b6a4b";
60
- readonly warning: "#c17300";
61
- readonly warningInk: "#8c4e00";
62
- readonly danger: "#b9112c";
63
- readonly dangerHover: "#ad0023";
64
- readonly dangerInk: "#b20d23";
65
- readonly info: "#2f92b4";
66
- readonly infoInk: "#1a6588";
67
- readonly successSoft: "rgba(11, 154, 116, 0.12)";
68
- readonly successLine: "rgba(11, 154, 116, 0.3)";
69
- readonly warningSoft: "rgba(193, 115, 0, 0.12)";
70
- readonly warningLine: "rgba(193, 115, 0, 0.3)";
71
- readonly dangerSoft: "rgba(185, 17, 44, 0.12)";
72
- readonly dangerLine: "rgba(185, 17, 44, 0.3)";
73
- readonly infoSoft: "rgba(47, 146, 180, 0.12)";
74
- readonly infoLine: "rgba(47, 146, 180, 0.3)";
75
- };
76
- readonly data: {
77
- readonly "1": "#5c76c3";
78
- readonly "2": "#dd5920";
79
- readonly "3": "#00956e";
80
- readonly "4": "#c27600";
81
- readonly other: "#85868d";
82
- };
83
- readonly node: {
84
- readonly purple: "#7150b3";
85
- readonly purpleInk: "#573394";
86
- readonly cyan: "#166b80";
87
- readonly cyanInk: "#004f62";
88
- readonly green: "#2c7046";
89
- readonly greenInk: "#05532b";
90
- readonly amber: "#865a28";
91
- readonly amberInk: "#683e03";
92
- readonly rose: "#984a55";
93
- readonly roseInk: "#7a2f3c";
94
- readonly blue: "#4062a7";
95
- readonly blueInk: "#264588";
96
- readonly purpleFill: "rgba(113, 80, 179, 0.12)";
97
- readonly purpleLine: "rgba(113, 80, 179, 0.38)";
98
- readonly purpleHalo: "rgba(113, 80, 179, 0.16)";
99
- readonly cyanFill: "rgba(22, 107, 128, 0.12)";
100
- readonly cyanLine: "rgba(22, 107, 128, 0.38)";
101
- readonly cyanHalo: "rgba(22, 107, 128, 0.16)";
102
- readonly greenFill: "rgba(44, 112, 70, 0.12)";
103
- readonly greenLine: "rgba(44, 112, 70, 0.38)";
104
- readonly greenHalo: "rgba(44, 112, 70, 0.16)";
105
- readonly amberFill: "rgba(134, 90, 40, 0.12)";
106
- readonly amberLine: "rgba(134, 90, 40, 0.38)";
107
- readonly amberHalo: "rgba(134, 90, 40, 0.16)";
108
- readonly roseFill: "rgba(152, 74, 85, 0.12)";
109
- readonly roseLine: "rgba(152, 74, 85, 0.38)";
110
- readonly roseHalo: "rgba(152, 74, 85, 0.16)";
111
- readonly blueFill: "rgba(64, 98, 167, 0.12)";
112
- readonly blueLine: "rgba(64, 98, 167, 0.38)";
113
- readonly blueHalo: "rgba(64, 98, 167, 0.16)";
114
- };
115
- readonly presence: {
116
- readonly flagText: "#ffffff";
117
- };
118
- readonly scrollbar: "rgba(7, 8, 13, 0.2)";
119
- readonly scrollbarHover: "rgba(7, 8, 13, 0.32)";
120
- };
121
- readonly shadow: {
122
- readonly xs: "0 1px 2px rgba(7, 8, 13, 0.06)";
123
- readonly sm: "0 2px 8px rgba(7, 8, 13, 0.07)";
124
- readonly md: "0 4px 12px rgba(7, 8, 13, 0.08), 0 1px 3px rgba(7, 8, 13, 0.06)";
125
- readonly lg: "0 8px 24px rgba(7, 8, 13, 0.12)";
126
- readonly xl: "0 16px 40px rgba(7, 8, 13, 0.16), 0 2px 8px rgba(7, 8, 13, 0.08)";
127
- readonly sheet: "-16px 0 40px rgba(7, 8, 13, 0.16), -2px 0 8px rgba(7, 8, 13, 0.08)";
128
- readonly "2xl": "0 16px 64px rgba(7, 8, 13, 0.20)";
129
- readonly card: "0 8px 24px rgba(7, 8, 13, 0.07)";
130
- readonly rimLit: "0 4px 24px rgba(7, 8, 13, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6)";
131
- readonly hairline: "none";
132
- readonly focus: "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)";
133
- readonly selection: "inset 0 0 0 2px var(--color-brand-accent)";
134
- readonly glow: "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.22)";
135
- };
136
- };
137
- readonly dark: {
138
- readonly color: {
139
- readonly surface: {
140
- readonly frame: "#07080d";
141
- readonly background: "#0c0e16";
142
- readonly subtle: "#11141d";
143
- readonly elevated: "#242833";
144
- readonly hover: "rgba(255, 255, 255, 0.061)";
145
- readonly pressed: "rgba(255, 255, 255, 0.098)";
146
- readonly inset: "rgba(255, 255, 255, 0.028)";
147
- readonly glass: "rgba(17, 20, 29, 0.90)";
148
- readonly scrim: "rgba(0, 0, 0, 0.6)";
149
- readonly veil: "rgba(7, 8, 13, 0.65)";
150
- readonly inverse: "#fcfcfc";
151
- };
152
- readonly text: {
153
- readonly primary: "#e7eaf3";
154
- readonly secondary: "#a9b0c3";
155
- readonly linkQuiet: "#a9b0ea";
156
- readonly tertiary: "#9fa7bc";
157
- readonly muted: "#5a6176";
158
- readonly onAccent: "#ffffff";
159
- readonly onDanger: "#ffffff";
160
- readonly onScrim: "#ffffff";
161
- readonly inverse: "#07080d";
162
- };
163
- readonly brand: {
164
- readonly accent: "#725be6";
165
- readonly accentHover: "#674ee4";
166
- readonly accentActive: "#5b3dc7";
167
- readonly accentInk: "#a9b0ff";
168
- readonly accentSoft: "rgba(114, 91, 230, 0.16)";
169
- readonly accentRgb: "114, 91, 230";
170
- readonly accentSoftStrong: "rgba(114, 91, 230, 0.32)";
171
- };
172
- readonly border: {
173
- readonly default: "#1e2025";
174
- readonly hover: "#2d3448";
175
- readonly strong: "#2d3448";
176
- readonly strongHover: "#424f74";
177
- readonly hatch: "#202534";
178
- readonly control: "#7f879c";
179
- readonly field: "#687187";
180
- readonly selected: "rgba(114, 91, 230, 0.6)";
181
- };
182
- readonly focus: "#8572fe";
183
- readonly feedback: {
184
- readonly success: "#34c98b";
185
- readonly successInk: "#74dcae";
186
- readonly warning: "#f0b425";
187
- readonly warningInk: "#f6cd72";
188
- readonly danger: "#d73756";
189
- readonly dangerHover: "#cc2b4e";
190
- readonly dangerInk: "#ff9fb0";
191
- readonly info: "#61d0ff";
192
- readonly infoInk: "#8ad6fb";
193
- readonly successSoft: "rgba(52, 201, 139, 0.12)";
194
- readonly successLine: "rgba(52, 201, 139, 0.3)";
195
- readonly warningSoft: "rgba(240, 180, 37, 0.12)";
196
- readonly warningLine: "rgba(240, 180, 37, 0.3)";
197
- readonly dangerSoft: "rgba(215, 55, 86, 0.12)";
198
- readonly dangerLine: "rgba(215, 55, 86, 0.3)";
199
- readonly infoSoft: "rgba(97, 208, 255, 0.12)";
200
- readonly infoLine: "rgba(97, 208, 255, 0.3)";
201
- };
202
- readonly data: {
203
- readonly "1": "#4d8ff6";
204
- readonly "2": "#e67737";
205
- readonly "3": "#26b582";
206
- readonly "4": "#eab106";
207
- readonly other: "#6a7186";
208
- };
209
- readonly node: {
210
- readonly purple: "#8e6ed4";
211
- readonly purpleInk: "#cabae0";
212
- readonly cyan: "#5ca8be";
213
- readonly cyanInk: "#b3d7e0";
214
- readonly green: "#62a578";
215
- readonly greenInk: "#b8d8c0";
216
- readonly amber: "#c89866";
217
- readonly amberInk: "#e0c89e";
218
- readonly rose: "#c8757f";
219
- readonly roseInk: "#e0bfc4";
220
- readonly blue: "#5b7fc7";
221
- readonly blueInk: "#b9c5e0";
222
- readonly purpleFill: "rgba(142, 110, 212, 0.12)";
223
- readonly purpleLine: "rgba(142, 110, 212, 0.38)";
224
- readonly purpleHalo: "rgba(142, 110, 212, 0.16)";
225
- readonly cyanFill: "rgba(92, 168, 190, 0.12)";
226
- readonly cyanLine: "rgba(92, 168, 190, 0.38)";
227
- readonly cyanHalo: "rgba(92, 168, 190, 0.16)";
228
- readonly greenFill: "rgba(98, 165, 120, 0.12)";
229
- readonly greenLine: "rgba(98, 165, 120, 0.38)";
230
- readonly greenHalo: "rgba(98, 165, 120, 0.16)";
231
- readonly amberFill: "rgba(200, 152, 102, 0.12)";
232
- readonly amberLine: "rgba(200, 152, 102, 0.38)";
233
- readonly amberHalo: "rgba(200, 152, 102, 0.16)";
234
- readonly roseFill: "rgba(200, 117, 127, 0.12)";
235
- readonly roseLine: "rgba(200, 117, 127, 0.38)";
236
- readonly roseHalo: "rgba(200, 117, 127, 0.16)";
237
- readonly blueFill: "rgba(91, 127, 199, 0.12)";
238
- readonly blueLine: "rgba(91, 127, 199, 0.38)";
239
- readonly blueHalo: "rgba(91, 127, 199, 0.16)";
240
- };
241
- readonly presence: {
242
- readonly flagText: "#07080d";
243
- };
244
- readonly scrollbar: "rgba(255, 255, 255, 0.16)";
245
- readonly scrollbarHover: "rgba(255, 255, 255, 0.26)";
246
- };
247
- readonly shadow: {
248
- readonly xs: "0 1px 2px rgba(0, 0, 0, 0.2)";
249
- readonly sm: "0 2px 8px rgba(0, 0, 0, 0.15)";
250
- readonly md: "0 4px 12px rgba(0, 0, 0, 0.25)";
251
- readonly lg: "0 8px 24px rgba(0, 0, 0, 0.3)";
252
- readonly xl: "0 12px 32px rgba(0, 0, 0, 0.4)";
253
- readonly sheet: "-8px 0 32px rgba(0, 0, 0, 0.4)";
254
- readonly "2xl": "0 16px 64px rgba(0, 0, 0, 0.6)";
255
- readonly card: "0 8px 24px rgba(0, 0, 0, 0.1)";
256
- readonly rimLit: "0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04)";
257
- readonly hairline: "inset 0 1px 0 rgba(255, 255, 255, 0.04)";
258
- readonly focus: "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)";
259
- readonly selection: "inset 0 0 0 2px var(--color-brand-accent)";
260
- readonly glow: "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.3)";
261
- };
262
- };
263
- };
264
- export type ThemeName = keyof typeof themes;
265
1
  /** The groups a theme picker lists the themes under, in order. */
266
2
  export declare const themeGroups: readonly [{
267
3
  readonly id: "crewlet";
package/dist/themes.js CHANGED
@@ -1,267 +1,8 @@
1
1
  /* Generated by style-dictionary. Do not edit. */
2
- /**
3
- * The two palettes, for JavaScript that cannot read a custom property: the
4
- * tool chrome around a preview, a chart library that wants a series' colour
5
- * as a string, a canvas that paints its own pixels.
6
- *
7
- * PREFER THE CUSTOM PROPERTY wherever CSS can reach: a value read here is a
8
- * value taken at build time, so it does not follow a theme the reader
9
- * changes. This is for the places where there is no element to read from.
2
+ /*
3
+ * The theme registry: the themes this build ships, as a picker lists them.
4
+ * The palettes themselves are palettes.ts, a module of their own.
10
5
  */
11
- export const themes = {
12
- "light": {
13
- "color": {
14
- "surface": {
15
- "frame": "#e9ecf3",
16
- "background": "#f6f7fb",
17
- "subtle": "#fcfcfc",
18
- "elevated": "#f1f2f6",
19
- "hover": "rgba(7, 8, 13, 0.044)",
20
- "pressed": "rgba(7, 8, 13, 0.088)",
21
- "inset": "rgba(7, 8, 13, 0.026)",
22
- "glass": "rgba(252, 252, 252, 0.90)",
23
- "scrim": "rgba(0, 0, 0, 0.6)",
24
- "veil": "rgba(233, 236, 243, 0.65)",
25
- "inverse": "#07080d"
26
- },
27
- "text": {
28
- "primary": "#121625",
29
- "secondary": "#3e4459",
30
- "linkQuiet": "#484e99",
31
- "tertiary": "#585e73",
32
- "muted": "#878d9f",
33
- "onAccent": "#ffffff",
34
- "onDanger": "#ffffff",
35
- "onScrim": "#ffffff",
36
- "inverse": "#f6f7fb"
37
- },
38
- "brand": {
39
- "accent": "#735af2",
40
- "accentHover": "#674ee4",
41
- "accentActive": "#5b3dc7",
42
- "accentInk": "#4f51bd",
43
- "accentSoft": "rgba(115, 90, 242, 0.125)",
44
- "accentRgb": "115, 90, 242",
45
- "accentSoftStrong": "rgba(115, 90, 242, 0.32)"
46
- },
47
- "border": {
48
- "default": "#e5e6ea",
49
- "hover": "#c9cfdc",
50
- "strong": "#c9cfdc",
51
- "strongHover": "#acb6cc",
52
- "hatch": "#dbdfe8",
53
- "control": "#777a83",
54
- "field": "#838894",
55
- "selected": "rgba(115, 90, 242, 0.6)"
56
- },
57
- "focus": "#735af2",
58
- "feedback": {
59
- "success": "#0b9a74",
60
- "successInk": "#0b6a4b",
61
- "warning": "#c17300",
62
- "warningInk": "#8c4e00",
63
- "danger": "#b9112c",
64
- "dangerHover": "#ad0023",
65
- "dangerInk": "#b20d23",
66
- "info": "#2f92b4",
67
- "infoInk": "#1a6588",
68
- "successSoft": "rgba(11, 154, 116, 0.12)",
69
- "successLine": "rgba(11, 154, 116, 0.3)",
70
- "warningSoft": "rgba(193, 115, 0, 0.12)",
71
- "warningLine": "rgba(193, 115, 0, 0.3)",
72
- "dangerSoft": "rgba(185, 17, 44, 0.12)",
73
- "dangerLine": "rgba(185, 17, 44, 0.3)",
74
- "infoSoft": "rgba(47, 146, 180, 0.12)",
75
- "infoLine": "rgba(47, 146, 180, 0.3)"
76
- },
77
- "data": {
78
- "1": "#5c76c3",
79
- "2": "#dd5920",
80
- "3": "#00956e",
81
- "4": "#c27600",
82
- "other": "#85868d"
83
- },
84
- "node": {
85
- "purple": "#7150b3",
86
- "purpleInk": "#573394",
87
- "cyan": "#166b80",
88
- "cyanInk": "#004f62",
89
- "green": "#2c7046",
90
- "greenInk": "#05532b",
91
- "amber": "#865a28",
92
- "amberInk": "#683e03",
93
- "rose": "#984a55",
94
- "roseInk": "#7a2f3c",
95
- "blue": "#4062a7",
96
- "blueInk": "#264588",
97
- "purpleFill": "rgba(113, 80, 179, 0.12)",
98
- "purpleLine": "rgba(113, 80, 179, 0.38)",
99
- "purpleHalo": "rgba(113, 80, 179, 0.16)",
100
- "cyanFill": "rgba(22, 107, 128, 0.12)",
101
- "cyanLine": "rgba(22, 107, 128, 0.38)",
102
- "cyanHalo": "rgba(22, 107, 128, 0.16)",
103
- "greenFill": "rgba(44, 112, 70, 0.12)",
104
- "greenLine": "rgba(44, 112, 70, 0.38)",
105
- "greenHalo": "rgba(44, 112, 70, 0.16)",
106
- "amberFill": "rgba(134, 90, 40, 0.12)",
107
- "amberLine": "rgba(134, 90, 40, 0.38)",
108
- "amberHalo": "rgba(134, 90, 40, 0.16)",
109
- "roseFill": "rgba(152, 74, 85, 0.12)",
110
- "roseLine": "rgba(152, 74, 85, 0.38)",
111
- "roseHalo": "rgba(152, 74, 85, 0.16)",
112
- "blueFill": "rgba(64, 98, 167, 0.12)",
113
- "blueLine": "rgba(64, 98, 167, 0.38)",
114
- "blueHalo": "rgba(64, 98, 167, 0.16)"
115
- },
116
- "presence": {
117
- "flagText": "#ffffff"
118
- },
119
- "scrollbar": "rgba(7, 8, 13, 0.2)",
120
- "scrollbarHover": "rgba(7, 8, 13, 0.32)"
121
- },
122
- "shadow": {
123
- "xs": "0 1px 2px rgba(7, 8, 13, 0.06)",
124
- "sm": "0 2px 8px rgba(7, 8, 13, 0.07)",
125
- "md": "0 4px 12px rgba(7, 8, 13, 0.08), 0 1px 3px rgba(7, 8, 13, 0.06)",
126
- "lg": "0 8px 24px rgba(7, 8, 13, 0.12)",
127
- "xl": "0 16px 40px rgba(7, 8, 13, 0.16), 0 2px 8px rgba(7, 8, 13, 0.08)",
128
- "sheet": "-16px 0 40px rgba(7, 8, 13, 0.16), -2px 0 8px rgba(7, 8, 13, 0.08)",
129
- "2xl": "0 16px 64px rgba(7, 8, 13, 0.20)",
130
- "card": "0 8px 24px rgba(7, 8, 13, 0.07)",
131
- "rimLit": "0 4px 24px rgba(7, 8, 13, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.6)",
132
- "hairline": "none",
133
- "focus": "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)",
134
- "selection": "inset 0 0 0 2px var(--color-brand-accent)",
135
- "glow": "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.22)"
136
- }
137
- },
138
- "dark": {
139
- "color": {
140
- "surface": {
141
- "frame": "#07080d",
142
- "background": "#0c0e16",
143
- "subtle": "#11141d",
144
- "elevated": "#242833",
145
- "hover": "rgba(255, 255, 255, 0.061)",
146
- "pressed": "rgba(255, 255, 255, 0.098)",
147
- "inset": "rgba(255, 255, 255, 0.028)",
148
- "glass": "rgba(17, 20, 29, 0.90)",
149
- "scrim": "rgba(0, 0, 0, 0.6)",
150
- "veil": "rgba(7, 8, 13, 0.65)",
151
- "inverse": "#fcfcfc"
152
- },
153
- "text": {
154
- "primary": "#e7eaf3",
155
- "secondary": "#a9b0c3",
156
- "linkQuiet": "#a9b0ea",
157
- "tertiary": "#9fa7bc",
158
- "muted": "#5a6176",
159
- "onAccent": "#ffffff",
160
- "onDanger": "#ffffff",
161
- "onScrim": "#ffffff",
162
- "inverse": "#07080d"
163
- },
164
- "brand": {
165
- "accent": "#725be6",
166
- "accentHover": "#674ee4",
167
- "accentActive": "#5b3dc7",
168
- "accentInk": "#a9b0ff",
169
- "accentSoft": "rgba(114, 91, 230, 0.16)",
170
- "accentRgb": "114, 91, 230",
171
- "accentSoftStrong": "rgba(114, 91, 230, 0.32)"
172
- },
173
- "border": {
174
- "default": "#1e2025",
175
- "hover": "#2d3448",
176
- "strong": "#2d3448",
177
- "strongHover": "#424f74",
178
- "hatch": "#202534",
179
- "control": "#7f879c",
180
- "field": "#687187",
181
- "selected": "rgba(114, 91, 230, 0.6)"
182
- },
183
- "focus": "#8572fe",
184
- "feedback": {
185
- "success": "#34c98b",
186
- "successInk": "#74dcae",
187
- "warning": "#f0b425",
188
- "warningInk": "#f6cd72",
189
- "danger": "#d73756",
190
- "dangerHover": "#cc2b4e",
191
- "dangerInk": "#ff9fb0",
192
- "info": "#61d0ff",
193
- "infoInk": "#8ad6fb",
194
- "successSoft": "rgba(52, 201, 139, 0.12)",
195
- "successLine": "rgba(52, 201, 139, 0.3)",
196
- "warningSoft": "rgba(240, 180, 37, 0.12)",
197
- "warningLine": "rgba(240, 180, 37, 0.3)",
198
- "dangerSoft": "rgba(215, 55, 86, 0.12)",
199
- "dangerLine": "rgba(215, 55, 86, 0.3)",
200
- "infoSoft": "rgba(97, 208, 255, 0.12)",
201
- "infoLine": "rgba(97, 208, 255, 0.3)"
202
- },
203
- "data": {
204
- "1": "#4d8ff6",
205
- "2": "#e67737",
206
- "3": "#26b582",
207
- "4": "#eab106",
208
- "other": "#6a7186"
209
- },
210
- "node": {
211
- "purple": "#8e6ed4",
212
- "purpleInk": "#cabae0",
213
- "cyan": "#5ca8be",
214
- "cyanInk": "#b3d7e0",
215
- "green": "#62a578",
216
- "greenInk": "#b8d8c0",
217
- "amber": "#c89866",
218
- "amberInk": "#e0c89e",
219
- "rose": "#c8757f",
220
- "roseInk": "#e0bfc4",
221
- "blue": "#5b7fc7",
222
- "blueInk": "#b9c5e0",
223
- "purpleFill": "rgba(142, 110, 212, 0.12)",
224
- "purpleLine": "rgba(142, 110, 212, 0.38)",
225
- "purpleHalo": "rgba(142, 110, 212, 0.16)",
226
- "cyanFill": "rgba(92, 168, 190, 0.12)",
227
- "cyanLine": "rgba(92, 168, 190, 0.38)",
228
- "cyanHalo": "rgba(92, 168, 190, 0.16)",
229
- "greenFill": "rgba(98, 165, 120, 0.12)",
230
- "greenLine": "rgba(98, 165, 120, 0.38)",
231
- "greenHalo": "rgba(98, 165, 120, 0.16)",
232
- "amberFill": "rgba(200, 152, 102, 0.12)",
233
- "amberLine": "rgba(200, 152, 102, 0.38)",
234
- "amberHalo": "rgba(200, 152, 102, 0.16)",
235
- "roseFill": "rgba(200, 117, 127, 0.12)",
236
- "roseLine": "rgba(200, 117, 127, 0.38)",
237
- "roseHalo": "rgba(200, 117, 127, 0.16)",
238
- "blueFill": "rgba(91, 127, 199, 0.12)",
239
- "blueLine": "rgba(91, 127, 199, 0.38)",
240
- "blueHalo": "rgba(91, 127, 199, 0.16)"
241
- },
242
- "presence": {
243
- "flagText": "#07080d"
244
- },
245
- "scrollbar": "rgba(255, 255, 255, 0.16)",
246
- "scrollbarHover": "rgba(255, 255, 255, 0.26)"
247
- },
248
- "shadow": {
249
- "xs": "0 1px 2px rgba(0, 0, 0, 0.2)",
250
- "sm": "0 2px 8px rgba(0, 0, 0, 0.15)",
251
- "md": "0 4px 12px rgba(0, 0, 0, 0.25)",
252
- "lg": "0 8px 24px rgba(0, 0, 0, 0.3)",
253
- "xl": "0 12px 32px rgba(0, 0, 0, 0.4)",
254
- "sheet": "-8px 0 32px rgba(0, 0, 0, 0.4)",
255
- "2xl": "0 16px 64px rgba(0, 0, 0, 0.6)",
256
- "card": "0 8px 24px rgba(0, 0, 0, 0.1)",
257
- "rimLit": "0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04)",
258
- "hairline": "inset 0 1px 0 rgba(255, 255, 255, 0.04)",
259
- "focus": "0 0 0 2px var(--color-surface-background), 0 0 0 4px var(--color-focus)",
260
- "selection": "inset 0 0 0 2px var(--color-brand-accent)",
261
- "glow": "0 4px 24px rgba(var(--color-brand-accent-rgb), 0.3)"
262
- }
263
- }
264
- };
265
6
  /** The groups a theme picker lists the themes under, in order. */
266
7
  export const themeGroups = [
267
8
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewlethq/tokens",
3
- "version": "0.48.3",
3
+ "version": "0.49.1",
4
4
  "description": "Crewlet design tokens. Single JSON source compiled to CSS variables and typed JS modules.",
5
5
  "license": "MIT AND OFL-1.1",
6
6
  "repository": {
@@ -26,6 +26,8 @@
26
26
  },
27
27
  "./css": "./dist/css/tokens.css",
28
28
  "./css/base": "./dist/css/base.css",
29
+ "./css/brand": "./dist/css/brand.css",
30
+ "./css/brand-scope": "./dist/css/brand-scope.css",
29
31
  "./css/breakpoint": "./dist/css/breakpoint.css",
30
32
  "./css/density": "./dist/css/density.css",
31
33
  "./css/fonts": "./dist/css/fonts.css",
@@ -53,7 +55,7 @@
53
55
  "lint": "eslint scripts test",
54
56
  "typecheck": "tsc -p tsconfig.json --noEmit",
55
57
  "test": "node --test \"test/*.test.mjs\"",
56
- "clean": "rm -rf dist src/index.ts src/themes.ts"
58
+ "clean": "rm -rf dist src/index.ts src/themes.ts src/palettes.ts"
57
59
  },
58
60
  "devDependencies": {
59
61
  "style-dictionary": "^5.6.0"
package/test/color.mjs CHANGED
@@ -12,8 +12,18 @@
12
12
  *
13
13
  * It is published as part of `@crewlethq/tokens/test/palette`, so a consumer
14
14
  * runs the same maths over the version it installed.
15
+ *
16
+ * The colour values and the WCAG ratio are not implemented here: they are the
17
+ * package's runtime module (`src/color.ts`, built to `dist/color.js`), which
18
+ * `@crewlethq/tokens` itself exports, and this file re-exports them. An
19
+ * interface that shows a contrast ratio and the suite that holds a theme to
20
+ * one therefore compute it with the same code.
15
21
  */
16
22
 
23
+ import { contrast, linearChannel, luminance, parseHex, parseRgba, withAlpha } from '../dist/color.js';
24
+
25
+ export { contrast, luminance, parseHex, parseRgba, withAlpha };
26
+
17
27
  /** @typedef {{ r: number, g: number, b: number }} RGB */
18
28
 
19
29
  // ---------------------------------------------------------------------------
@@ -102,26 +112,6 @@ export function cascade(sources, matches) {
102
112
  // Colour values
103
113
  // ---------------------------------------------------------------------------
104
114
 
105
- export function parseHex(hex) {
106
- const match = /^#([0-9a-f]{6})$/i.exec(hex.trim());
107
- if (!match) return null;
108
- const n = parseInt(match[1], 16);
109
- return { r: (n >> 16) & 255, g: (n >> 8) & 255, b: n & 255 };
110
- }
111
-
112
- export function parseRgba(value) {
113
- const match = /^rgba?\(([^)]+)\)$/i.exec(value.trim());
114
- if (!match) return null;
115
- const parts = match[1]
116
- .split(/[,/\s]+/)
117
- .filter(Boolean)
118
- .map(Number);
119
- const [r, g, b, a] = parts;
120
- if (r === undefined || g === undefined || b === undefined) return null;
121
- if ([r, g, b].some(Number.isNaN)) return null;
122
- return { rgb: { r, g, b }, a: a === undefined ? 1 : a };
123
- }
124
-
125
115
  /** Composite a possibly translucent value over an opaque backdrop. */
126
116
  export function flatten(value, backdrop) {
127
117
  const hex = parseHex(value);
@@ -136,33 +126,6 @@ export function flatten(value, backdrop) {
136
126
  };
137
127
  }
138
128
 
139
- /** The same colour at a new alpha, as the CSS value the build emits. */
140
- export function withAlpha(value, alpha) {
141
- const rgb = parseHex(value) ?? parseRgba(value)?.rgb;
142
- if (!rgb) throw new Error(`cannot re-alpha "${value}"`);
143
- return `rgba(${Math.round(rgb.r)}, ${Math.round(rgb.g)}, ${Math.round(rgb.b)}, ${alpha})`;
144
- }
145
-
146
- // ---------------------------------------------------------------------------
147
- // WCAG
148
- // ---------------------------------------------------------------------------
149
-
150
- function channel(v) {
151
- const c = v / 255;
152
- return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
153
- }
154
-
155
- export function luminance({ r, g, b }) {
156
- return 0.2126 * channel(r) + 0.7152 * channel(g) + 0.0722 * channel(b);
157
- }
158
-
159
- export function contrast(a, b) {
160
- const la = luminance(a);
161
- const lb = luminance(b);
162
- const [hi, lo] = la > lb ? [la, lb] : [lb, la];
163
- return (hi + 0.05) / (lo + 0.05);
164
- }
165
-
166
129
  // ---------------------------------------------------------------------------
167
130
  // OKLab. Perceptual distance is what "these two hues are separable" means.
168
131
  // RGB distance says magenta and red are far apart and says the same of two
@@ -170,9 +133,9 @@ export function contrast(a, b) {
170
133
  // ---------------------------------------------------------------------------
171
134
 
172
135
  export function toOklab({ r, g, b }) {
173
- const lr = channel(r);
174
- const lg = channel(g);
175
- const lb = channel(b);
136
+ const lr = linearChannel(r);
137
+ const lg = linearChannel(g);
138
+ const lb = linearChannel(b);
176
139
  const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
177
140
  const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
178
141
  const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
@@ -253,9 +216,9 @@ export function nudge(value, direction, ok, step = 0.002) {
253
216
 
254
217
  /** Simulate protanopia or deuteranopia. Enough to answer "do these collide?". */
255
218
  export function simulate(c, kind) {
256
- const r = channel(c.r);
257
- const g = channel(c.g);
258
- const b = channel(c.b);
219
+ const r = linearChannel(c.r);
220
+ const g = linearChannel(c.g);
221
+ const b = linearChannel(c.b);
259
222
  const L = 0.31399022 * r + 0.63951294 * g + 0.04649755 * b;
260
223
  const M = 0.15537241 * r + 0.75789446 * g + 0.08670142 * b;
261
224
  const S = 0.01775239 * r + 0.10944209 * g + 0.87256922 * b;