@skbkontur/colors 2.0.0-alpha.0 → 2.0.0-alpha.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 (62) hide show
  1. package/dist/cjs/get-base-tokens.d.ts +7 -0
  2. package/dist/cjs/get-base-tokens.js +121 -1
  3. package/dist/cjs/get-colors.d.ts +2 -1
  4. package/dist/cjs/get-colors.js +6 -2
  5. package/dist/cjs/get-default-tokens.d.ts +12 -12
  6. package/dist/cjs/get-default-tokens.js +15 -16
  7. package/dist/cjs/helpers/get-palette.js +3 -3
  8. package/dist/colors.default-dark.js +326 -319
  9. package/dist/colors.default-light.js +329 -319
  10. package/dist/colors.js +319 -319
  11. package/dist/colors.less +319 -319
  12. package/dist/colors.scss +319 -319
  13. package/dist/esm/get-base-tokens.d.ts +7 -0
  14. package/dist/esm/get-base-tokens.js +110 -0
  15. package/dist/esm/get-colors.d.ts +2 -1
  16. package/dist/esm/get-colors.js +7 -3
  17. package/dist/esm/get-default-tokens.d.ts +12 -12
  18. package/dist/esm/get-default-tokens.js +15 -16
  19. package/dist/esm/helpers/get-palette.js +3 -3
  20. package/dist/tokens/brand-blue-deep_accent-brand.css +640 -640
  21. package/dist/tokens/brand-blue-deep_accent-gray.css +640 -640
  22. package/dist/tokens/brand-blue_accent-brand.css +640 -640
  23. package/dist/tokens/brand-blue_accent-gray.css +640 -640
  24. package/dist/tokens/brand-green_accent-brand.css +640 -640
  25. package/dist/tokens/brand-green_accent-gray.css +640 -640
  26. package/dist/tokens/brand-mint_accent-brand.css +640 -640
  27. package/dist/tokens/brand-mint_accent-gray.css +640 -640
  28. package/dist/tokens/brand-orange_accent-gray.css +640 -640
  29. package/dist/tokens/brand-purple_accent-brand.css +640 -640
  30. package/dist/tokens/brand-purple_accent-gray.css +640 -640
  31. package/dist/tokens/brand-red_accent-gray.css +640 -640
  32. package/dist/tokens/brand-violet_accent-brand.css +640 -640
  33. package/dist/tokens/brand-violet_accent-gray.css +640 -640
  34. package/dist/tokens-js/brand-blue-deep_accent-brand.js +15 -15
  35. package/dist/tokens-js/brand-blue-deep_accent-gray.js +15 -15
  36. package/dist/tokens-js/brand-blue_accent-brand.js +15 -15
  37. package/dist/tokens-js/brand-blue_accent-gray.js +15 -15
  38. package/dist/tokens-js/brand-green_accent-brand.js +15 -15
  39. package/dist/tokens-js/brand-green_accent-gray.js +15 -15
  40. package/dist/tokens-js/brand-mint_accent-brand.js +15 -15
  41. package/dist/tokens-js/brand-mint_accent-gray.js +15 -15
  42. package/dist/tokens-js/brand-orange_accent-gray.js +15 -15
  43. package/dist/tokens-js/brand-purple_accent-brand.js +15 -15
  44. package/dist/tokens-js/brand-purple_accent-gray.js +15 -15
  45. package/dist/tokens-js/brand-red_accent-gray.js +15 -15
  46. package/dist/tokens-js/brand-violet_accent-brand.js +15 -15
  47. package/dist/tokens-js/brand-violet_accent-gray.js +15 -15
  48. package/dist/tokens-mobile/brand-blue-deep_accent-brand.json +13 -13
  49. package/dist/tokens-mobile/brand-blue-deep_accent-gray.json +13 -13
  50. package/dist/tokens-mobile/brand-blue_accent-brand.json +13 -13
  51. package/dist/tokens-mobile/brand-blue_accent-gray.json +13 -13
  52. package/dist/tokens-mobile/brand-green_accent-brand.json +13 -13
  53. package/dist/tokens-mobile/brand-green_accent-gray.json +13 -13
  54. package/dist/tokens-mobile/brand-mint_accent-brand.json +13 -13
  55. package/dist/tokens-mobile/brand-mint_accent-gray.json +13 -13
  56. package/dist/tokens-mobile/brand-orange_accent-gray.json +13 -13
  57. package/dist/tokens-mobile/brand-purple_accent-brand.json +13 -13
  58. package/dist/tokens-mobile/brand-purple_accent-gray.json +13 -13
  59. package/dist/tokens-mobile/brand-red_accent-gray.json +13 -13
  60. package/dist/tokens-mobile/brand-violet_accent-brand.json +13 -13
  61. package/dist/tokens-mobile/brand-violet_accent-gray.json +13 -13
  62. package/package.json +2 -2
@@ -7,13 +7,20 @@ export interface ColorObject {
7
7
  }
8
8
  export type ColorValue = string | ColorObject | ColorValue[];
9
9
  type ColorStructure = ColorObject | ColorValue[];
10
+ export type ColorFormat = 'hex/rgba' | 'rgb/rgba' | 'oklch' | 'hex-aarrggbb';
10
11
  export interface ConfigOptions {
11
12
  brand: PresetOrCustom<keyof typeof DEFAULT_SWATCH.brand>;
12
13
  accent: PresetOrCustom<(typeof ACCENT_PARAMS)[number]>;
13
14
  system?: typeof DEFAULT_SWATCH.system;
15
+ format?: ColorFormat;
14
16
  }
15
17
  export declare function getBaseTokens({ brand, accent, system }: ConfigOptions): BaseTokens;
16
18
  export declare function convertOklchToHex(obj: ColorStructure): ColorStructure;
17
19
  export declare const convertOklchToRgba: (oklchString: string) => string;
18
20
  export declare function convertAlphaOklchToRgba(obj: ColorStructure): ColorStructure;
21
+ export declare const convertHexToRgbString: (hexString: string) => string;
22
+ export declare function convertHexValuesToRgb(obj: ColorStructure): ColorStructure;
23
+ export declare const convertToAarrggbb: (colorString: string) => string;
24
+ export declare function convertToAarrggbbRecursive(obj: ColorStructure): ColorStructure;
25
+ export declare function convertColorFormat(obj: ColorStructure, format?: ColorFormat): ColorStructure;
19
26
  export {};
@@ -40,7 +40,12 @@ var __importStar =
40
40
  return result;
41
41
  };
42
42
  Object.defineProperty(exports, '__esModule', { value: true });
43
- exports.convertAlphaOklchToRgba =
43
+ exports.convertColorFormat =
44
+ exports.convertToAarrggbbRecursive =
45
+ exports.convertToAarrggbb =
46
+ exports.convertHexValuesToRgb =
47
+ exports.convertHexToRgbString =
48
+ exports.convertAlphaOklchToRgba =
44
49
  exports.convertOklchToRgba =
45
50
  exports.convertOklchToHex =
46
51
  exports.getBaseTokens =
@@ -184,6 +189,7 @@ function convertAlphaOklchToRgba(obj) {
184
189
  for (var key in obj) {
185
190
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
186
191
  var value = obj[key];
192
+ // Конвертируем OKLCH с альфа-каналом (содержит '/') в RGBA
187
193
  if (typeof value === 'string' && value.includes('oklch(')) {
188
194
  value = (0, exports.convertOklchToRgba)(value);
189
195
  }
@@ -197,3 +203,117 @@ function convertAlphaOklchToRgba(obj) {
197
203
  return newObj;
198
204
  }
199
205
  exports.convertAlphaOklchToRgba = convertAlphaOklchToRgba;
206
+ var convertHexToRgbString = function (hexString) {
207
+ var _a;
208
+ var color = (0, culori_1.converter)('rgb')(hexString);
209
+ if (!color) {
210
+ return hexString;
211
+ }
212
+ var r = Math.round(color.r * 255);
213
+ var g = Math.round(color.g * 255);
214
+ var b = Math.round(color.b * 255);
215
+ var alpha = (_a = color.alpha) !== null && _a !== void 0 ? _a : 1;
216
+ return alpha === 1
217
+ ? 'rgb('.concat(r, ', ').concat(g, ', ').concat(b, ')')
218
+ : 'rgba('.concat(r, ', ').concat(g, ', ').concat(b, ', ').concat(alpha, ')');
219
+ };
220
+ exports.convertHexToRgbString = convertHexToRgbString;
221
+ function convertHexValuesToRgb(obj) {
222
+ if (typeof obj !== 'object' || obj === null) {
223
+ return obj;
224
+ }
225
+ if (Array.isArray(obj)) {
226
+ return obj.map(function (item) {
227
+ if (typeof item === 'object' && item !== null) {
228
+ return convertHexValuesToRgb(item);
229
+ }
230
+ return item;
231
+ });
232
+ }
233
+ var newObj = {};
234
+ for (var key in obj) {
235
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
236
+ var value = obj[key];
237
+ // Конвертируем HEX-строки в RGB(A)-строки
238
+ if (typeof value === 'string' && value.startsWith('#')) {
239
+ newObj[key] = (0, exports.convertHexToRgbString)(value);
240
+ } else if (typeof value === 'object' && value !== null) {
241
+ newObj[key] = convertHexValuesToRgb(value);
242
+ } else {
243
+ newObj[key] = value;
244
+ }
245
+ }
246
+ }
247
+ return newObj;
248
+ }
249
+ exports.convertHexValuesToRgb = convertHexValuesToRgb;
250
+ var convertToAarrggbb = function (colorString) {
251
+ var _a;
252
+ var color = (0, culori_1.converter)('rgb')(colorString);
253
+ if (!color) {
254
+ return colorString;
255
+ }
256
+ var r = Math.round(color.r * 255);
257
+ var g = Math.round(color.g * 255);
258
+ var b = Math.round(color.b * 255);
259
+ var alpha = Math.round(((_a = color.alpha) !== null && _a !== void 0 ? _a : 1) * 255);
260
+ var toHex = function (c) {
261
+ return c.toString(16).padStart(2, '0');
262
+ };
263
+ var rgbHex = ''.concat(toHex(r)).concat(toHex(g)).concat(toHex(b)).toUpperCase();
264
+ if (alpha === 255) {
265
+ return '#'.concat(rgbHex);
266
+ }
267
+ return '#'.concat(toHex(alpha)).concat(rgbHex).toUpperCase();
268
+ };
269
+ exports.convertToAarrggbb = convertToAarrggbb;
270
+ function convertToAarrggbbRecursive(obj) {
271
+ if (typeof obj !== 'object' || obj === null) {
272
+ return obj;
273
+ }
274
+ if (Array.isArray(obj)) {
275
+ return obj.map(function (item) {
276
+ if (typeof item === 'object' && item !== null) {
277
+ return convertToAarrggbbRecursive(item);
278
+ }
279
+ return item;
280
+ });
281
+ }
282
+ var newObj = {};
283
+ for (var key in obj) {
284
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
285
+ var value = obj[key];
286
+ // Конвертируем строки цветов (HEX, RGBA) в AARRGGBB
287
+ if (typeof value === 'string') {
288
+ newObj[key] = (0, exports.convertToAarrggbb)(value); // Измененная логика в этой функции
289
+ } else if (typeof value === 'object' && value !== null) {
290
+ newObj[key] = convertToAarrggbbRecursive(value);
291
+ } else {
292
+ newObj[key] = value;
293
+ }
294
+ }
295
+ }
296
+ return newObj;
297
+ }
298
+ exports.convertToAarrggbbRecursive = convertToAarrggbbRecursive;
299
+ function convertColorFormat(obj, format) {
300
+ if (format === void 0) {
301
+ format = 'hex/rgba';
302
+ }
303
+ var result = obj;
304
+ result = convertOklchToHex(obj);
305
+ result = convertAlphaOklchToRgba(result);
306
+ switch (format) {
307
+ case 'oklch':
308
+ return obj;
309
+ case 'hex/rgba':
310
+ return result;
311
+ case 'rgb/rgba':
312
+ return convertHexValuesToRgb(result);
313
+ case 'hex-aarrggbb':
314
+ return convertToAarrggbbRecursive(result);
315
+ default:
316
+ return result;
317
+ }
318
+ }
319
+ exports.convertColorFormat = convertColorFormat;
@@ -1,4 +1,4 @@
1
- import { type ConfigOptions } from './get-base-tokens';
1
+ import { type ConfigOptions, type ColorFormat } from './get-base-tokens';
2
2
  import { getDefaultTokens } from './get-default-tokens';
3
3
  import type { BaseTokens } from './types/base-tokens';
4
4
  export interface Themed<T> {
@@ -10,6 +10,7 @@ export type DefaultTokens = DefaultTokensFull['light' | 'dark'];
10
10
  export interface SemanticConfigOptions<T> extends ConfigOptions {
11
11
  theme?: 'light' | 'dark';
12
12
  overrides?: (base: BaseTokens, defaults?: DefaultTokensFull, params?: SemanticConfigOptions<T>) => Themed<T>;
13
+ format?: ColorFormat;
13
14
  }
14
15
  export declare function getColors(params: SemanticConfigOptions<DefaultTokens>): DefaultTokens;
15
16
  export declare function getColors<T>(
@@ -8,9 +8,13 @@ function getColors(params) {
8
8
  var theme = params.theme || DEFAULT_THEME;
9
9
  var base = (0, get_base_tokens_1.getBaseTokens)(params);
10
10
  var defaults = (0, get_default_tokens_1.getDefaultTokens)(base);
11
+ var result;
11
12
  if (params.overrides) {
12
- return params.overrides(base, defaults, params)[theme];
13
+ result = params.overrides(base, defaults, params)[theme];
14
+ } else {
15
+ result = defaults[theme];
13
16
  }
14
- return defaults[theme];
17
+ var finalResult = (0, get_base_tokens_1.convertColorFormat)(result, params.format);
18
+ return finalResult;
15
19
  }
16
20
  exports.getColors = getColors;
@@ -4,17 +4,16 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
4
4
  textAccentHeavy: string;
5
5
  textAccentHeavyHover: string;
6
6
  textAccentHeavyPressed: string;
7
- textDisabled: string;
8
7
  textErrorHeavy: string;
9
8
  textErrorHeavyHover: string;
10
9
  textErrorHeavyPressed: string;
11
10
  textInvertedAccentHeavy: string;
12
11
  textInvertedAccentHeavyHover: string;
13
12
  textInvertedAccentHeavyPressed: string;
14
- textInvertedDisabled: string;
15
13
  textInvertedErrorHeavy: string;
16
14
  textInvertedErrorHeavyHover: string;
17
15
  textInvertedErrorHeavyPressed: string;
16
+ textInvertedNeutralFaint: string;
18
17
  textInvertedNeutralHeavy: string;
19
18
  textInvertedNeutralPale: string;
20
19
  textInvertedNeutralSoft: string;
@@ -25,6 +24,7 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
25
24
  textInvertedWarningHeavyHover: string;
26
25
  textInvertedWarningHeavyPressed: string;
27
26
  textLogo: string;
27
+ textNeutralFaint: string;
28
28
  textNeutralHeavy: string;
29
29
  textNeutralPale: string;
30
30
  textNeutralSoft: string;
@@ -34,19 +34,19 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
34
34
  textWarningHeavy: string;
35
35
  textWarningHeavyHover: string;
36
36
  textWarningHeavyPressed: string;
37
- textConstDisabledBlack: string;
38
- textConstDisabledWhite: string;
37
+ textConstFaintBlack: string;
38
+ textConstFaintWhite: string;
39
39
  textConstHeavyBlack: string;
40
40
  textConstHeavyWhite: string;
41
41
  textConstPaleBlack: string;
42
42
  textConstPaleWhite: string;
43
43
  textConstSoftBlack: string;
44
44
  textConstSoftWhite: string;
45
- textOnAccentBoldDisabled: string;
45
+ textOnAccentBoldFaint: string;
46
46
  textOnAccentBoldHeavy: string;
47
47
  textOnAccentBoldPale: string;
48
48
  textOnAccentBoldSoft: string;
49
- textOnBrandOriginalDisabled: string;
49
+ textOnBrandOriginalFaint: string;
50
50
  textOnBrandOriginalHeavy: string;
51
51
  textOnBrandOriginalPale: string;
52
52
  textOnBrandOriginalSoft: string;
@@ -325,17 +325,16 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
325
325
  textAccentHeavy: string;
326
326
  textAccentHeavyHover: string;
327
327
  textAccentHeavyPressed: string;
328
- textDisabled: string;
329
328
  textErrorHeavy: string;
330
329
  textErrorHeavyHover: string;
331
330
  textErrorHeavyPressed: string;
332
331
  textInvertedAccentHeavy: string;
333
332
  textInvertedAccentHeavyHover: string;
334
333
  textInvertedAccentHeavyPressed: string;
335
- textInvertedDisabled: string;
336
334
  textInvertedErrorHeavy: string;
337
335
  textInvertedErrorHeavyHover: string;
338
336
  textInvertedErrorHeavyPressed: string;
337
+ textInvertedNeutralFaint: string;
339
338
  textInvertedNeutralHeavy: string;
340
339
  textInvertedNeutralPale: string;
341
340
  textInvertedNeutralSoft: string;
@@ -346,6 +345,7 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
346
345
  textInvertedWarningHeavyHover: string;
347
346
  textInvertedWarningHeavyPressed: string;
348
347
  textLogo: string;
348
+ textNeutralFaint: string;
349
349
  textNeutralHeavy: string;
350
350
  textNeutralPale: string;
351
351
  textNeutralSoft: string;
@@ -355,19 +355,19 @@ export declare const getDefaultTokens: (base: BaseTokens) => {
355
355
  textWarningHeavy: string;
356
356
  textWarningHeavyHover: string;
357
357
  textWarningHeavyPressed: string;
358
- textConstDisabledBlack: string;
359
- textConstDisabledWhite: string;
358
+ textConstFaintBlack: string;
359
+ textConstFaintWhite: string;
360
360
  textConstHeavyBlack: string;
361
361
  textConstHeavyWhite: string;
362
362
  textConstPaleBlack: string;
363
363
  textConstPaleWhite: string;
364
364
  textConstSoftBlack: string;
365
365
  textConstSoftWhite: string;
366
- textOnAccentBoldDisabled: string;
366
+ textOnAccentBoldFaint: string;
367
367
  textOnAccentBoldHeavy: string;
368
368
  textOnAccentBoldPale: string;
369
369
  textOnAccentBoldSoft: string;
370
- textOnBrandOriginalDisabled: string;
370
+ textOnBrandOriginalFaint: string;
371
371
  textOnBrandOriginalHeavy: string;
372
372
  textOnBrandOriginalPale: string;
373
373
  textOnBrandOriginalSoft: string;
@@ -174,7 +174,6 @@ var getDefaultTokens = function (base) {
174
174
  ((_f = (_e = base.accent) === null || _e === void 0 ? void 0 : _e.palette) === null || _f === void 0
175
175
  ? void 0
176
176
  : _f.dim[48]) || base.blackAlpha[96],
177
- textDisabled: base.blackAlpha[32],
178
177
  textErrorHeavy: base.customizable.red.vivid[52],
179
178
  textErrorHeavyHover: base.customizable.red.vivid[60],
180
179
  textErrorHeavyPressed: base.customizable.red.dim[48],
@@ -190,10 +189,10 @@ var getDefaultTokens = function (base) {
190
189
  ((_m = (_l = base.accent) === null || _l === void 0 ? void 0 : _l.palette) === null || _m === void 0
191
190
  ? void 0
192
191
  : _m.dim[64]) || base.gray[100],
193
- textInvertedDisabled: base.whiteAlpha[40],
194
192
  textInvertedErrorHeavy: base.customizable.red.vivid[68],
195
193
  textInvertedErrorHeavyHover: base.customizable.red.vivid[72],
196
194
  textInvertedErrorHeavyPressed: base.customizable.red.dim[64],
195
+ textInvertedNeutralFaint: base.whiteAlpha[40],
197
196
  textInvertedNeutralHeavy: base.whiteAlpha[96],
198
197
  textInvertedNeutralPale: base.whiteAlpha[48],
199
198
  textInvertedNeutralSoft: base.whiteAlpha[64],
@@ -204,6 +203,7 @@ var getDefaultTokens = function (base) {
204
203
  textInvertedWarningHeavyHover: base.warning.vivid[84],
205
204
  textInvertedWarningHeavyPressed: base.warning.dim[72],
206
205
  textLogo: base.brand.logo.light,
206
+ textNeutralFaint: base.blackAlpha[32],
207
207
  textNeutralHeavy: base.blackAlpha[88],
208
208
  textNeutralPale: base.blackAlpha[40],
209
209
  textNeutralSoft: base.blackAlpha[56],
@@ -213,20 +213,19 @@ var getDefaultTokens = function (base) {
213
213
  textWarningHeavy: base.warning.vivid[64],
214
214
  textWarningHeavyHover: base.warning.vivid[72],
215
215
  textWarningHeavyPressed: base.warning.dim[60],
216
- textConstDisabledBlack: base.blackAlpha[32],
217
- textConstDisabledWhite: base.whiteAlpha[40],
216
+ textConstFaintBlack: base.blackAlpha[32],
217
+ textConstFaintWhite: base.whiteAlpha[40],
218
218
  textConstHeavyBlack: base.blackAlpha[88],
219
219
  textConstHeavyWhite: base.whiteAlpha[96],
220
220
  textConstPaleBlack: base.blackAlpha[40],
221
221
  textConstPaleWhite: base.whiteAlpha[48],
222
222
  textConstSoftBlack: base.blackAlpha[56],
223
223
  textConstSoftWhite: base.whiteAlpha[64],
224
- textOnAccentBoldDisabled:
225
- ((_o = base.onAccent) === null || _o === void 0 ? void 0 : _o[40]) || base.whiteAlpha[40],
224
+ textOnAccentBoldFaint: ((_o = base.onAccent) === null || _o === void 0 ? void 0 : _o[40]) || base.whiteAlpha[40],
226
225
  textOnAccentBoldHeavy: ((_p = base.onAccent) === null || _p === void 0 ? void 0 : _p[96]) || base.whiteAlpha[96],
227
226
  textOnAccentBoldPale: ((_q = base.onAccent) === null || _q === void 0 ? void 0 : _q[48]) || base.whiteAlpha[48],
228
227
  textOnAccentBoldSoft: ((_r = base.onAccent) === null || _r === void 0 ? void 0 : _r[64]) || base.whiteAlpha[64],
229
- textOnBrandOriginalDisabled: base.onBrand[40],
228
+ textOnBrandOriginalFaint: base.onBrand[40],
230
229
  textOnBrandOriginalHeavy: base.onBrand[96],
231
230
  textOnBrandOriginalPale: base.onBrand[48],
232
231
  textOnBrandOriginalSoft: base.onBrand[64],
@@ -588,7 +587,6 @@ var getDefaultTokens = function (base) {
588
587
  ((_60 = (_59 = base.accent) === null || _59 === void 0 ? void 0 : _59.palette) === null || _60 === void 0
589
588
  ? void 0
590
589
  : _60.dim[64]) || base.gray[100],
591
- textDisabled: base.whiteAlpha[40],
592
590
  textErrorHeavy: base.customizable.red.vivid[68],
593
591
  textErrorHeavyHover: base.customizable.red.vivid[72],
594
592
  textErrorHeavyPressed: base.customizable.red.dim[64],
@@ -604,10 +602,10 @@ var getDefaultTokens = function (base) {
604
602
  ((_66 = (_65 = base.accent) === null || _65 === void 0 ? void 0 : _65.palette) === null || _66 === void 0
605
603
  ? void 0
606
604
  : _66.dim[48]) || base.blackAlpha[96],
607
- textInvertedDisabled: base.blackAlpha[32],
608
605
  textInvertedErrorHeavy: base.customizable.red.vivid[52],
609
606
  textInvertedErrorHeavyHover: base.customizable.red.vivid[60],
610
607
  textInvertedErrorHeavyPressed: base.customizable.red.dim[48],
608
+ textInvertedNeutralFaint: base.blackAlpha[32],
611
609
  textInvertedNeutralHeavy: base.blackAlpha[88],
612
610
  textInvertedNeutralPale: base.blackAlpha[40],
613
611
  textInvertedNeutralSoft: base.blackAlpha[56],
@@ -618,6 +616,7 @@ var getDefaultTokens = function (base) {
618
616
  textInvertedWarningHeavyHover: base.warning.vivid[72],
619
617
  textInvertedWarningHeavyPressed: base.warning.dim[56],
620
618
  textLogo: base.brand.logo.dark,
619
+ textNeutralFaint: base.whiteAlpha[40],
621
620
  textNeutralHeavy: base.whiteAlpha[96],
622
621
  textNeutralPale: base.whiteAlpha[48],
623
622
  textNeutralSoft: base.whiteAlpha[64],
@@ -627,15 +626,15 @@ var getDefaultTokens = function (base) {
627
626
  textWarningHeavy: base.warning.vivid[80],
628
627
  textWarningHeavyHover: base.warning.vivid[84],
629
628
  textWarningHeavyPressed: base.warning.dim[72],
630
- textConstDisabledBlack: base.blackAlpha[32],
631
- textConstDisabledWhite: base.whiteAlpha[40],
629
+ textConstFaintBlack: base.blackAlpha[32],
630
+ textConstFaintWhite: base.whiteAlpha[40],
632
631
  textConstHeavyBlack: base.blackAlpha[88],
633
632
  textConstHeavyWhite: base.whiteAlpha[96],
634
633
  textConstPaleBlack: base.blackAlpha[40],
635
634
  textConstPaleWhite: base.whiteAlpha[48],
636
635
  textConstSoftBlack: base.blackAlpha[56],
637
636
  textConstSoftWhite: base.whiteAlpha[64],
638
- textOnAccentBoldDisabled:
637
+ textOnAccentBoldFaint:
639
638
  ((_67 = base.onAccent) === null || _67 === void 0 ? void 0 : _67[32]) || base.blackAlpha[32],
640
639
  textOnAccentBoldHeavy:
641
640
  ((_68 = base.onAccent) === null || _68 === void 0 ? void 0 : _68[96]) || base.blackAlpha[88],
@@ -643,7 +642,7 @@ var getDefaultTokens = function (base) {
643
642
  ((_69 = base.onAccent) === null || _69 === void 0 ? void 0 : _69[40]) || base.blackAlpha[40],
644
643
  textOnAccentBoldSoft:
645
644
  ((_70 = base.onAccent) === null || _70 === void 0 ? void 0 : _70[56]) || base.blackAlpha[56],
646
- textOnBrandOriginalDisabled: base.onBrand[40],
645
+ textOnBrandOriginalFaint: base.onBrand[40],
647
646
  textOnBrandOriginalHeavy: base.onBrand[96],
648
647
  textOnBrandOriginalPale: base.onBrand[48],
649
648
  textOnBrandOriginalSoft: base.onBrand[64],
@@ -701,9 +700,9 @@ var getDefaultTokens = function (base) {
701
700
  shapeOtherAccentBoldDisabled: base.whiteAlpha[32],
702
701
  shapeOtherBacklessHover: base.whiteAlpha[6],
703
702
  shapeOtherBacklessPressed: base.whiteAlpha[4],
704
- shapeOtherBase: base.gray[32],
705
- shapeOtherBaseHover: base.gray[36],
706
- shapeOtherBasePressed: base.gray[28],
703
+ shapeOtherBase: base.whiteAlpha[6],
704
+ shapeOtherBaseHover: base.whiteAlpha[8],
705
+ shapeOtherBasePressed: base.whiteAlpha[4],
707
706
  shapeOtherDisabled: base.whiteAlpha[6],
708
707
  shapeOtherField: base.blackAlpha[16],
709
708
  shapeOtherFieldHover: base.blackAlpha[4],
@@ -277,9 +277,9 @@ function calculateBaseHueAndCorrectionRange(inputColorString, abneyData) {
277
277
  }
278
278
  exports.calculateBaseHueAndCorrectionRange = calculateBaseHueAndCorrectionRange;
279
279
  function calcOnBrand(hex) {
280
- var whiteContrast = Number((0, apca_w3_1.calcAPCA)('#fff', hex));
281
- var blackContrast = Number((0, apca_w3_1.calcAPCA)('#000', hex));
282
- if (whiteContrast - 10 <= blackContrast) {
280
+ var whiteContrast = Math.abs(Number((0, apca_w3_1.calcAPCA)('#fff', hex)));
281
+ var blackContrast = Math.abs(Number((0, apca_w3_1.calcAPCA)('#000', hex)));
282
+ if (whiteContrast + 10 >= blackContrast) {
283
283
  return DefaultSwatch.whiteAlpha;
284
284
  }
285
285
  return DefaultSwatch.blackAlpha;