@skbkontur/colors 2.0.0-alpha.2 → 2.0.0-alpha.3

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 (123) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +104 -171
  3. package/dist/colors.default-dark.js +16 -16
  4. package/dist/colors.default-light.js +17 -17
  5. package/dist/esm/consts/params/abney-correction.d.ts +2 -0
  6. package/dist/esm/consts/params/chroma-params.d.ts +2 -0
  7. package/dist/esm/{constants/chroma-settings.js → consts/params/chroma-params.js} +1 -1
  8. package/dist/esm/consts/params/logo-lightness.d.ts +1 -0
  9. package/dist/esm/consts/params/logo-lightness.js +1 -0
  10. package/dist/esm/get-colors-base.d.ts +12 -0
  11. package/dist/esm/get-colors-base.js +81 -0
  12. package/dist/{cjs/get-default-tokens.d.ts → esm/get-colors-default-tokens.d.ts} +2 -2
  13. package/dist/{cjs/get-default-tokens.js → esm/get-colors-default-tokens.js} +34 -38
  14. package/dist/esm/get-colors.d.ts +3 -10
  15. package/dist/esm/get-colors.js +6 -8
  16. package/dist/esm/get-default-tokens.d.ts +1 -1
  17. package/dist/esm/get-default-tokens.js +33 -33
  18. package/dist/esm/helpers/get-interactions.js +1 -1
  19. package/dist/esm/helpers/get-logo.js +4 -4
  20. package/dist/esm/helpers/get-palette.d.ts +3 -3
  21. package/dist/esm/helpers/get-palette.js +6 -6
  22. package/dist/esm/helpers/get-promo.js +1 -1
  23. package/dist/esm/types/{generator-tokens.d.ts → tokens-base-generator.d.ts} +2 -2
  24. package/dist/esm/types/tokens.d.ts +12 -0
  25. package/dist/esm/types/tokens.js +1 -0
  26. package/dist/esm/utils/convert-color.d.ts +3 -0
  27. package/dist/esm/utils/convert-color.js +133 -0
  28. package/dist/tokens/brand-blue-deep_accent-brand.css +33 -33
  29. package/dist/tokens/brand-blue-deep_accent-gray.css +33 -33
  30. package/dist/tokens/brand-blue_accent-brand.css +33 -33
  31. package/dist/tokens/brand-blue_accent-gray.css +33 -33
  32. package/dist/tokens/brand-green_accent-brand.css +33 -33
  33. package/dist/tokens/brand-green_accent-gray.css +33 -33
  34. package/dist/tokens/brand-mint_accent-brand.css +33 -33
  35. package/dist/tokens/brand-mint_accent-gray.css +33 -33
  36. package/dist/tokens/brand-orange_accent-gray.css +33 -33
  37. package/dist/tokens/brand-purple_accent-brand.css +33 -33
  38. package/dist/tokens/brand-purple_accent-gray.css +33 -33
  39. package/dist/tokens/brand-red_accent-gray.css +33 -33
  40. package/dist/tokens/brand-violet_accent-brand.css +33 -33
  41. package/dist/tokens/brand-violet_accent-gray.css +33 -33
  42. package/dist/tokens-js/brand-blue-deep_accent-brand.js +33 -33
  43. package/dist/tokens-js/brand-blue-deep_accent-gray.js +33 -33
  44. package/dist/tokens-js/brand-blue_accent-brand.js +33 -33
  45. package/dist/tokens-js/brand-blue_accent-gray.js +33 -33
  46. package/dist/tokens-js/brand-green_accent-brand.js +33 -33
  47. package/dist/tokens-js/brand-green_accent-gray.js +33 -33
  48. package/dist/tokens-js/brand-mint_accent-brand.js +33 -33
  49. package/dist/tokens-js/brand-mint_accent-gray.js +33 -33
  50. package/dist/tokens-js/brand-orange_accent-gray.js +33 -33
  51. package/dist/tokens-js/brand-purple_accent-brand.js +33 -33
  52. package/dist/tokens-js/brand-purple_accent-gray.js +33 -33
  53. package/dist/tokens-js/brand-red_accent-gray.js +33 -33
  54. package/dist/tokens-js/brand-violet_accent-brand.js +33 -33
  55. package/dist/tokens-js/brand-violet_accent-gray.js +33 -33
  56. package/dist/tokens-mobile/brand-blue-deep_accent-brand.json +304 -304
  57. package/dist/tokens-mobile/brand-blue-deep_accent-gray.json +304 -304
  58. package/dist/tokens-mobile/brand-blue_accent-brand.json +304 -304
  59. package/dist/tokens-mobile/brand-blue_accent-gray.json +304 -304
  60. package/dist/tokens-mobile/brand-green_accent-brand.json +304 -304
  61. package/dist/tokens-mobile/brand-green_accent-gray.json +304 -304
  62. package/dist/tokens-mobile/brand-mint_accent-brand.json +304 -304
  63. package/dist/tokens-mobile/brand-mint_accent-gray.json +304 -304
  64. package/dist/tokens-mobile/brand-orange_accent-gray.json +303 -303
  65. package/dist/tokens-mobile/brand-purple_accent-brand.json +304 -304
  66. package/dist/tokens-mobile/brand-purple_accent-gray.json +304 -304
  67. package/dist/tokens-mobile/brand-red_accent-gray.json +303 -303
  68. package/dist/tokens-mobile/brand-violet_accent-brand.json +300 -300
  69. package/dist/tokens-mobile/brand-violet_accent-gray.json +302 -302
  70. package/package.json +13 -22
  71. package/scripts/babel-register.js +4 -0
  72. package/scripts/tokens-base.json +3499 -0
  73. package/scripts/tokens.json +710 -0
  74. package/dist/cjs/constants/abney-correction.d.ts +0 -2
  75. package/dist/cjs/constants/abney-correction.js +0 -1105
  76. package/dist/cjs/constants/chroma-settings.d.ts +0 -2
  77. package/dist/cjs/constants/chroma-settings.js +0 -105
  78. package/dist/cjs/constants/default-swatch.js +0 -112
  79. package/dist/cjs/constants/interaction-settings.js +0 -19
  80. package/dist/cjs/constants/logo-lightness.d.ts +0 -1
  81. package/dist/cjs/constants/logo-lightness.js +0 -4
  82. package/dist/cjs/constants/promo-hue-shift.js +0 -14
  83. package/dist/cjs/constants/warning-hue-patch.js +0 -25
  84. package/dist/cjs/get-base-tokens.d.ts +0 -26
  85. package/dist/cjs/get-base-tokens.js +0 -319
  86. package/dist/cjs/get-colors.d.ts +0 -20
  87. package/dist/cjs/get-colors.js +0 -20
  88. package/dist/cjs/helpers/get-interactions.d.ts +0 -7
  89. package/dist/cjs/helpers/get-interactions.js +0 -61
  90. package/dist/cjs/helpers/get-logo.d.ts +0 -6
  91. package/dist/cjs/helpers/get-logo.js +0 -32
  92. package/dist/cjs/helpers/get-palette.d.ts +0 -76
  93. package/dist/cjs/helpers/get-palette.js +0 -287
  94. package/dist/cjs/helpers/get-promo.d.ts +0 -12
  95. package/dist/cjs/helpers/get-promo.js +0 -56
  96. package/dist/cjs/types/base-tokens.js +0 -2
  97. package/dist/cjs/types/generator-tokens.d.ts +0 -43
  98. package/dist/cjs/types/generator-tokens.js +0 -2
  99. package/dist/cjs/utils/format-variable.d.ts +0 -2
  100. package/dist/cjs/utils/format-variable.js +0 -15
  101. package/dist/esm/constants/abney-correction.d.ts +0 -2
  102. package/dist/esm/constants/chroma-settings.d.ts +0 -2
  103. package/dist/esm/constants/default-swatch.d.ts +0 -109
  104. package/dist/esm/constants/interaction-settings.d.ts +0 -8
  105. package/dist/esm/constants/logo-lightness.d.ts +0 -1
  106. package/dist/esm/constants/logo-lightness.js +0 -1
  107. package/dist/esm/constants/promo-hue-shift.d.ts +0 -3
  108. package/dist/esm/constants/warning-hue-patch.d.ts +0 -3
  109. package/dist/esm/get-base-tokens.d.ts +0 -26
  110. package/dist/esm/get-base-tokens.js +0 -257
  111. package/dist/esm/types/base-tokens.d.ts +0 -125
  112. /package/dist/{cjs/constants → esm/consts}/default-swatch.d.ts +0 -0
  113. /package/dist/esm/{constants → consts}/default-swatch.js +0 -0
  114. /package/dist/esm/{constants → consts/params}/abney-correction.js +0 -0
  115. /package/dist/{cjs/constants/interaction-settings.d.ts → esm/consts/params/interactions.d.ts} +0 -0
  116. /package/dist/esm/{constants/interaction-settings.js → consts/params/interactions.js} +0 -0
  117. /package/dist/{cjs/constants → esm/consts/params}/promo-hue-shift.d.ts +0 -0
  118. /package/dist/esm/{constants → consts/params}/promo-hue-shift.js +0 -0
  119. /package/dist/{cjs/constants → esm/consts/params}/warning-hue-patch.d.ts +0 -0
  120. /package/dist/esm/{constants → consts/params}/warning-hue-patch.js +0 -0
  121. /package/dist/esm/types/{base-tokens.js → tokens-base-generator.js} +0 -0
  122. /package/dist/{cjs/types/base-tokens.d.ts → esm/types/tokens-base.d.ts} +0 -0
  123. /package/dist/esm/types/{generator-tokens.js → tokens-base.js} +0 -0
@@ -1,109 +0,0 @@
1
- export declare const brand: {
2
- red: string;
3
- orange: string;
4
- green: string;
5
- mint: string;
6
- blue: string;
7
- blueDeep: string;
8
- violet: string;
9
- purple: string;
10
- };
11
- export declare const system: {
12
- warning: string;
13
- error: string;
14
- success: string;
15
- accent: string;
16
- };
17
- export declare const customizable: {
18
- red: string;
19
- orange: string;
20
- green: string;
21
- mint: string;
22
- blue: string;
23
- blueDeep: string;
24
- violet: string;
25
- purple: string;
26
- yellow: string;
27
- };
28
- export declare const gray: {
29
- 0: string;
30
- 16: string;
31
- 20: string;
32
- 24: string;
33
- 28: string;
34
- 32: string;
35
- 36: string;
36
- 40: string;
37
- 44: string;
38
- 48: string;
39
- 52: string;
40
- 56: string;
41
- 60: string;
42
- 64: string;
43
- 68: string;
44
- 72: string;
45
- 76: string;
46
- 80: string;
47
- 84: string;
48
- 88: string;
49
- 92: string;
50
- 96: string;
51
- 98: string;
52
- 100: string;
53
- };
54
- export declare const whiteAlpha: {
55
- 4: string;
56
- 6: string;
57
- 8: string;
58
- 12: string;
59
- 16: string;
60
- 20: string;
61
- 24: string;
62
- 28: string;
63
- 32: string;
64
- 36: string;
65
- 40: string;
66
- 44: string;
67
- 48: string;
68
- 52: string;
69
- 56: string;
70
- 60: string;
71
- 64: string;
72
- 68: string;
73
- 72: string;
74
- 76: string;
75
- 80: string;
76
- 84: string;
77
- 88: string;
78
- 92: string;
79
- 96: string;
80
- 100: string;
81
- };
82
- export declare const blackAlpha: {
83
- 4: string;
84
- 6: string;
85
- 8: string;
86
- 12: string;
87
- 16: string;
88
- 20: string;
89
- 24: string;
90
- 28: string;
91
- 32: string;
92
- 36: string;
93
- 40: string;
94
- 44: string;
95
- 48: string;
96
- 52: string;
97
- 56: string;
98
- 60: string;
99
- 64: string;
100
- 68: string;
101
- 72: string;
102
- 76: string;
103
- 80: string;
104
- 84: string;
105
- 88: string;
106
- 92: string;
107
- 96: string;
108
- 100: string;
109
- };
@@ -1,8 +0,0 @@
1
- export declare const HOVER_LIGHT_L = -4;
2
- export declare const HOVER_LIGHT_C = 0;
3
- export declare const HOVER_DARK_L = 4;
4
- export declare const HOVER_DARK_C = 0;
5
- export declare const PRESSED_LIGHT_L = -8;
6
- export declare const PRESSED_LIGHT_C = -0.03;
7
- export declare const PRESSED_DARK_L = -4;
8
- export declare const PRESSED_DARK_C = -0.03;
@@ -1 +0,0 @@
1
- export declare const MIN_LOGO_LIGHTNESS = 64;
@@ -1 +0,0 @@
1
- export var MIN_LOGO_LIGHTNESS = 64;
@@ -1,3 +0,0 @@
1
- export declare const PROMO_HUE_SHIFTS: {
2
- [hueRange: number]: number;
3
- };
@@ -1,3 +0,0 @@
1
- export declare const WARNING_HUE_PATCH: {
2
- [lightness: number]: number;
3
- };
@@ -1,26 +0,0 @@
1
- import * as DEFAULT_SWATCH from './constants/default-swatch';
2
- import type { BaseTokens } from './types/base-tokens';
3
- type PresetOrCustom<T extends string> = T | (string & Record<never, never>);
4
- export declare const ACCENT_PARAMS: string[];
5
- export interface ColorObject {
6
- [key: string]: ColorValue;
7
- }
8
- export type ColorValue = string | ColorObject | ColorValue[];
9
- type ColorStructure = ColorObject | ColorValue[];
10
- export type ColorFormat = 'hex/rgba' | 'rgb/rgba' | 'oklch' | 'hex-aarrggbb';
11
- export interface ConfigOptions {
12
- brand: PresetOrCustom<keyof typeof DEFAULT_SWATCH.brand>;
13
- accent: PresetOrCustom<(typeof ACCENT_PARAMS)[number]>;
14
- system?: typeof DEFAULT_SWATCH.system;
15
- format?: ColorFormat;
16
- }
17
- export declare function getBaseTokens({ brand, accent, system }: ConfigOptions): BaseTokens;
18
- export declare function convertOklchToHex(obj: ColorStructure): ColorStructure;
19
- export declare const convertOklchToRgba: (oklchString: string) => string;
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;
26
- export {};
@@ -1,257 +0,0 @@
1
- import { converter, formatHex } from 'culori';
2
- import { calcOnBrand, getPalette } from './helpers/get-palette';
3
- import { getPromo } from './helpers/get-promo';
4
- import * as DEFAULT_SWATCH from './constants/default-swatch';
5
- import { getLogo } from './helpers/get-logo';
6
- import { getHover, getPressed } from './helpers/get-interactions';
7
- export var ACCENT_PARAMS = ['brand', 'gray'];
8
- export function getBaseTokens(_a) {
9
- var brand = _a.brand,
10
- _b = _a.accent,
11
- accent = _b === void 0 ? 'gray' : _b,
12
- _c = _a.system,
13
- system = _c === void 0 ? DEFAULT_SWATCH.system : _c;
14
- var isPresetColor = brand in DEFAULT_SWATCH.brand;
15
- var brandColor;
16
- if (isPresetColor) {
17
- brandColor = DEFAULT_SWATCH.brand[brand];
18
- } else {
19
- brandColor = brand;
20
- }
21
- var accentColor;
22
- if (accent === 'brand') {
23
- accentColor = brandColor;
24
- } else if (accent !== 'gray') {
25
- accentColor = accent;
26
- }
27
- var brandPalette = getPalette({ color: brandColor });
28
- var accentPalette;
29
- if (accent === 'brand') {
30
- accentPalette = brandPalette;
31
- } else if (accent !== 'gray' && accentColor) {
32
- accentPalette = getPalette({ color: accentColor });
33
- }
34
- var customizablePalettes = {};
35
- for (var colorKey in DEFAULT_SWATCH.customizable) {
36
- var key = colorKey;
37
- if (key === brand && isPresetColor) {
38
- customizablePalettes[key] = brandPalette;
39
- continue;
40
- }
41
- customizablePalettes[key] = getPalette({
42
- color: DEFAULT_SWATCH.customizable[key],
43
- });
44
- }
45
- return {
46
- brand: {
47
- logo: getLogo(brandColor),
48
- promo: getPromo(brandColor),
49
- original: brandColor,
50
- interactions: {
51
- hover: getHover(brandColor),
52
- pressed: getPressed(brandColor),
53
- },
54
- palette: brandPalette,
55
- },
56
- accent: accentColor
57
- ? {
58
- original: {
59
- light: accentColor,
60
- dark: accentColor,
61
- },
62
- interactions: {
63
- hover: getHover(accentColor),
64
- pressed: getPressed(accentColor),
65
- },
66
- palette: accentPalette,
67
- }
68
- : undefined,
69
- warning: getPalette({ color: system.warning }),
70
- error: getPalette({ color: system.error }),
71
- success: getPalette({ color: system.success }),
72
- gray: DEFAULT_SWATCH.gray,
73
- whiteAlpha: DEFAULT_SWATCH.whiteAlpha,
74
- blackAlpha: DEFAULT_SWATCH.blackAlpha,
75
- onBrand: calcOnBrand(brandColor),
76
- onAccent: accentColor ? calcOnBrand(accentColor) : undefined,
77
- customizable: customizablePalettes,
78
- };
79
- }
80
- export function convertOklchToHex(obj) {
81
- if (typeof obj !== 'object' || obj === null) {
82
- return obj;
83
- }
84
- if (Array.isArray(obj)) {
85
- return obj.map(function (item) {
86
- if (typeof item === 'object' && item !== null) {
87
- return convertOklchToHex(item);
88
- }
89
- return item;
90
- });
91
- }
92
- var newObj = {};
93
- for (var key in obj) {
94
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
95
- var value = obj[key];
96
- if (typeof value === 'string' && value.startsWith('oklch(') && !value.includes('/')) {
97
- var oklchColor = converter('oklch')(value);
98
- var rgbColor = converter('rgb')(oklchColor);
99
- value = formatHex(rgbColor);
100
- }
101
- if (typeof value === 'object' && value !== null) {
102
- newObj[key] = convertOklchToHex(value);
103
- } else {
104
- newObj[key] = value;
105
- }
106
- }
107
- }
108
- return newObj;
109
- }
110
- export var convertOklchToRgba = function (oklchString) {
111
- var _a;
112
- var oklch = converter('oklch')(oklchString);
113
- var rgb = converter('rgb')(oklch);
114
- var r = Math.round(rgb.r * 255);
115
- var g = Math.round(rgb.g * 255);
116
- var b = Math.round(rgb.b * 255);
117
- var alpha = (_a = oklch.alpha) !== null && _a !== void 0 ? _a : 1;
118
- return 'rgba('.concat(r, ', ').concat(g, ', ').concat(b, ', ').concat(alpha, ')');
119
- };
120
- export function convertAlphaOklchToRgba(obj) {
121
- if (typeof obj !== 'object' || obj === null) {
122
- return obj;
123
- }
124
- if (Array.isArray(obj)) {
125
- return obj.map(function (item) {
126
- if (typeof item === 'object' && item !== null) {
127
- return convertAlphaOklchToRgba(item);
128
- }
129
- return item;
130
- });
131
- }
132
- var newObj = {};
133
- for (var key in obj) {
134
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
135
- var value = obj[key];
136
- // Конвертируем OKLCH с альфа-каналом (содержит '/') в RGBA
137
- if (typeof value === 'string' && value.includes('oklch(')) {
138
- value = convertOklchToRgba(value);
139
- }
140
- if (typeof value === 'object' && value !== null) {
141
- newObj[key] = convertAlphaOklchToRgba(value);
142
- } else {
143
- newObj[key] = value;
144
- }
145
- }
146
- }
147
- return newObj;
148
- }
149
- export var convertHexToRgbString = function (hexString) {
150
- var _a;
151
- var color = converter('rgb')(hexString);
152
- if (!color) {
153
- return hexString;
154
- }
155
- var r = Math.round(color.r * 255);
156
- var g = Math.round(color.g * 255);
157
- var b = Math.round(color.b * 255);
158
- var alpha = (_a = color.alpha) !== null && _a !== void 0 ? _a : 1;
159
- return alpha === 1
160
- ? 'rgb('.concat(r, ', ').concat(g, ', ').concat(b, ')')
161
- : 'rgba('.concat(r, ', ').concat(g, ', ').concat(b, ', ').concat(alpha, ')');
162
- };
163
- export function convertHexValuesToRgb(obj) {
164
- if (typeof obj !== 'object' || obj === null) {
165
- return obj;
166
- }
167
- if (Array.isArray(obj)) {
168
- return obj.map(function (item) {
169
- if (typeof item === 'object' && item !== null) {
170
- return convertHexValuesToRgb(item);
171
- }
172
- return item;
173
- });
174
- }
175
- var newObj = {};
176
- for (var key in obj) {
177
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
178
- var value = obj[key];
179
- // Конвертируем HEX-строки в RGB(A)-строки
180
- if (typeof value === 'string' && value.startsWith('#')) {
181
- newObj[key] = convertHexToRgbString(value);
182
- } else if (typeof value === 'object' && value !== null) {
183
- newObj[key] = convertHexValuesToRgb(value);
184
- } else {
185
- newObj[key] = value;
186
- }
187
- }
188
- }
189
- return newObj;
190
- }
191
- export var convertToAarrggbb = function (colorString) {
192
- var _a;
193
- var color = converter('rgb')(colorString);
194
- if (!color) {
195
- return colorString;
196
- }
197
- var r = Math.round(color.r * 255);
198
- var g = Math.round(color.g * 255);
199
- var b = Math.round(color.b * 255);
200
- var alpha = Math.round(((_a = color.alpha) !== null && _a !== void 0 ? _a : 1) * 255);
201
- var toHex = function (c) {
202
- return c.toString(16).padStart(2, '0');
203
- };
204
- var rgbHex = ''.concat(toHex(r)).concat(toHex(g)).concat(toHex(b)).toUpperCase();
205
- if (alpha === 255) {
206
- return '#'.concat(rgbHex);
207
- }
208
- return '#'.concat(toHex(alpha)).concat(rgbHex).toUpperCase();
209
- };
210
- export function convertToAarrggbbRecursive(obj) {
211
- if (typeof obj !== 'object' || obj === null) {
212
- return obj;
213
- }
214
- if (Array.isArray(obj)) {
215
- return obj.map(function (item) {
216
- if (typeof item === 'object' && item !== null) {
217
- return convertToAarrggbbRecursive(item);
218
- }
219
- return item;
220
- });
221
- }
222
- var newObj = {};
223
- for (var key in obj) {
224
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
225
- var value = obj[key];
226
- // Конвертируем строки цветов (HEX, RGBA) в AARRGGBB
227
- if (typeof value === 'string') {
228
- newObj[key] = convertToAarrggbb(value); // Измененная логика в этой функции
229
- } else if (typeof value === 'object' && value !== null) {
230
- newObj[key] = convertToAarrggbbRecursive(value);
231
- } else {
232
- newObj[key] = value;
233
- }
234
- }
235
- }
236
- return newObj;
237
- }
238
- export function convertColorFormat(obj, format) {
239
- if (format === void 0) {
240
- format = 'hex/rgba';
241
- }
242
- var result = obj;
243
- result = convertOklchToHex(obj);
244
- result = convertAlphaOklchToRgba(result);
245
- switch (format) {
246
- case 'oklch':
247
- return obj;
248
- case 'hex/rgba':
249
- return result;
250
- case 'rgb/rgba':
251
- return convertHexValuesToRgb(result);
252
- case 'hex-aarrggbb':
253
- return convertToAarrggbbRecursive(result);
254
- default:
255
- return result;
256
- }
257
- }
@@ -1,125 +0,0 @@
1
- export interface BaseTokens {
2
- brand: {
3
- logo: ThemedValue;
4
- original: string;
5
- promo: string;
6
- interactions: {
7
- hover: ThemedValue;
8
- pressed: ThemedValue;
9
- };
10
- palette: ColorPalette;
11
- };
12
- accent?: {
13
- original: ThemedValue;
14
- interactions: {
15
- hover: ThemedValue;
16
- pressed: ThemedValue;
17
- };
18
- palette?: ColorPalette;
19
- };
20
- warning: ColorPalette;
21
- error: ColorPalette;
22
- success: ColorPalette;
23
- gray: ColorWithScale<GrayScale>;
24
- whiteAlpha: ColorWithScale<AlphaScale>;
25
- blackAlpha: ColorWithScale<AlphaScale>;
26
- onBrand: ColorWithScale<AlphaScale>;
27
- onAccent?: ColorWithScale<AlphaScale>;
28
- customizable: {
29
- red: ColorPalette;
30
- orange: ColorPalette;
31
- green: ColorPalette;
32
- mint: ColorPalette;
33
- blue: ColorPalette;
34
- blueDeep: ColorPalette;
35
- violet: ColorPalette;
36
- purple: ColorPalette;
37
- yellow: ColorPalette;
38
- };
39
- }
40
- export interface ColorPalette {
41
- vivid: ColorWithScale<ChromaScale>;
42
- normal: ColorWithScale<ChromaScale>;
43
- dim: ColorWithScale<ChromaScale>;
44
- }
45
- export type ChromaScale =
46
- | 20
47
- | 24
48
- | 28
49
- | 32
50
- | 36
51
- | 40
52
- | 44
53
- | 48
54
- | 52
55
- | 56
56
- | 60
57
- | 64
58
- | 68
59
- | 72
60
- | 76
61
- | 80
62
- | 84
63
- | 88
64
- | 92
65
- | 96;
66
- type AlphaScale =
67
- | 4
68
- | 6
69
- | 8
70
- | 12
71
- | 16
72
- | 20
73
- | 24
74
- | 28
75
- | 32
76
- | 36
77
- | 40
78
- | 44
79
- | 48
80
- | 52
81
- | 56
82
- | 60
83
- | 64
84
- | 68
85
- | 72
86
- | 76
87
- | 80
88
- | 84
89
- | 88
90
- | 92
91
- | 96
92
- | 100;
93
- export type GrayScale =
94
- | 0
95
- | 16
96
- | 20
97
- | 24
98
- | 28
99
- | 32
100
- | 36
101
- | 40
102
- | 44
103
- | 48
104
- | 52
105
- | 56
106
- | 60
107
- | 64
108
- | 68
109
- | 72
110
- | 76
111
- | 80
112
- | 84
113
- | 88
114
- | 92
115
- | 96
116
- | 98
117
- | 100;
118
- type ColorWithScale<T extends string | number> = {
119
- [K in T]: string;
120
- };
121
- export interface ThemedValue {
122
- light: string;
123
- dark: string;
124
- }
125
- export {};