@skbkontur/colors 1.1.2-d1791.0 → 2.0.0-alpha.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.
Files changed (111) hide show
  1. package/dist/cjs/constants/abney-correction.js +1102 -1102
  2. package/dist/cjs/constants/chroma-settings.js +102 -102
  3. package/dist/cjs/constants/default-swatch.d.ts +97 -95
  4. package/dist/cjs/constants/default-swatch.js +99 -97
  5. package/dist/cjs/constants/interaction-settings.d.ts +8 -0
  6. package/dist/cjs/constants/interaction-settings.js +19 -0
  7. package/dist/cjs/constants/logo-lightness.js +2 -2
  8. package/dist/cjs/constants/promo-hue-shift.d.ts +1 -1
  9. package/dist/cjs/constants/promo-hue-shift.js +11 -11
  10. package/dist/cjs/constants/warning-hue-patch.d.ts +1 -1
  11. package/dist/cjs/constants/warning-hue-patch.js +22 -22
  12. package/dist/cjs/get-base-tokens.d.ts +11 -9
  13. package/dist/cjs/get-base-tokens.js +178 -202
  14. package/dist/cjs/get-colors.d.ts +19 -0
  15. package/dist/cjs/get-colors.js +16 -0
  16. package/dist/cjs/get-default-tokens.d.ts +642 -1275
  17. package/dist/cjs/get-default-tokens.js +993 -1280
  18. package/dist/cjs/helpers/get-interactions.d.ts +7 -0
  19. package/dist/cjs/helpers/get-interactions.js +61 -0
  20. package/dist/cjs/helpers/get-logo.d.ts +2 -2
  21. package/dist/cjs/helpers/get-logo.js +28 -25
  22. package/dist/cjs/helpers/get-palette.d.ts +69 -42
  23. package/dist/cjs/helpers/get-palette.js +249 -204
  24. package/dist/cjs/helpers/get-promo.d.ts +10 -4
  25. package/dist/cjs/helpers/get-promo.js +48 -50
  26. package/dist/cjs/types/base-tokens.d.ts +115 -43
  27. package/dist/cjs/types/base-tokens.js +2 -2
  28. package/dist/cjs/types/generator-tokens.d.ts +30 -30
  29. package/dist/cjs/types/generator-tokens.js +2 -2
  30. package/dist/cjs/utils/format-variable.d.ts +2 -0
  31. package/dist/cjs/utils/format-variable.js +15 -0
  32. package/dist/colors.default-dark.js +325 -0
  33. package/dist/colors.default-light.js +326 -0
  34. package/dist/colors.js +319 -0
  35. package/dist/colors.less +319 -0
  36. package/dist/colors.scss +319 -0
  37. package/dist/esm/constants/abney-correction.js +1100 -1100
  38. package/dist/esm/constants/chroma-settings.js +100 -100
  39. package/dist/esm/constants/default-swatch.d.ts +97 -95
  40. package/dist/esm/constants/default-swatch.js +97 -95
  41. package/dist/esm/constants/interaction-settings.d.ts +8 -0
  42. package/dist/esm/constants/interaction-settings.js +8 -0
  43. package/dist/esm/constants/promo-hue-shift.d.ts +1 -1
  44. package/dist/esm/constants/promo-hue-shift.js +9 -9
  45. package/dist/esm/constants/warning-hue-patch.d.ts +1 -1
  46. package/dist/esm/constants/warning-hue-patch.js +20 -20
  47. package/dist/esm/get-base-tokens.d.ts +11 -9
  48. package/dist/esm/get-base-tokens.js +130 -172
  49. package/dist/esm/get-colors.d.ts +19 -0
  50. package/dist/esm/get-colors.js +12 -0
  51. package/dist/esm/get-default-tokens.d.ts +642 -1275
  52. package/dist/esm/get-default-tokens.js +991 -1278
  53. package/dist/esm/helpers/get-interactions.d.ts +7 -0
  54. package/dist/esm/helpers/get-interactions.js +49 -0
  55. package/dist/esm/helpers/get-logo.d.ts +2 -2
  56. package/dist/esm/helpers/get-logo.js +24 -21
  57. package/dist/esm/helpers/get-palette.d.ts +69 -42
  58. package/dist/esm/helpers/get-palette.js +197 -175
  59. package/dist/esm/helpers/get-promo.d.ts +10 -4
  60. package/dist/esm/helpers/get-promo.js +44 -46
  61. package/dist/esm/types/base-tokens.d.ts +115 -43
  62. package/dist/esm/types/generator-tokens.d.ts +30 -30
  63. package/dist/esm/utils/format-variable.d.ts +2 -0
  64. package/dist/esm/utils/format-variable.js +10 -0
  65. package/dist/tokens/brand-blue-deep_accent-brand.css +643 -0
  66. package/dist/tokens/brand-blue-deep_accent-gray.css +643 -0
  67. package/dist/tokens/brand-blue_accent-brand.css +643 -0
  68. package/dist/tokens/brand-blue_accent-gray.css +643 -0
  69. package/dist/tokens/brand-green_accent-brand.css +643 -0
  70. package/dist/tokens/brand-green_accent-gray.css +643 -0
  71. package/dist/tokens/brand-mint_accent-brand.css +643 -0
  72. package/dist/tokens/brand-mint_accent-gray.css +643 -0
  73. package/dist/tokens/brand-orange_accent-gray.css +643 -0
  74. package/dist/tokens/brand-purple_accent-brand.css +643 -0
  75. package/dist/tokens/brand-purple_accent-gray.css +643 -0
  76. package/dist/tokens/brand-red_accent-gray.css +643 -0
  77. package/dist/tokens/brand-violet_accent-brand.css +643 -0
  78. package/dist/tokens/brand-violet_accent-gray.css +643 -0
  79. package/dist/tokens-js/brand-blue-deep_accent-brand.js +644 -0
  80. package/dist/tokens-js/brand-blue-deep_accent-gray.js +644 -0
  81. package/dist/tokens-js/brand-blue_accent-brand.js +644 -0
  82. package/dist/tokens-js/brand-blue_accent-gray.js +644 -0
  83. package/dist/tokens-js/brand-green_accent-brand.js +644 -0
  84. package/dist/tokens-js/brand-green_accent-gray.js +644 -0
  85. package/dist/tokens-js/brand-mint_accent-brand.js +644 -0
  86. package/dist/tokens-js/brand-mint_accent-gray.js +644 -0
  87. package/dist/tokens-js/brand-orange_accent-gray.js +644 -0
  88. package/dist/tokens-js/brand-purple_accent-brand.js +644 -0
  89. package/dist/tokens-js/brand-purple_accent-gray.js +644 -0
  90. package/dist/tokens-js/brand-red_accent-gray.js +644 -0
  91. package/dist/tokens-js/brand-violet_accent-brand.js +644 -0
  92. package/dist/tokens-js/brand-violet_accent-gray.js +644 -0
  93. package/dist/tokens-mobile/brand-blue-deep_accent-brand.json +718 -0
  94. package/dist/tokens-mobile/brand-blue-deep_accent-gray.json +718 -0
  95. package/dist/tokens-mobile/brand-blue_accent-brand.json +718 -0
  96. package/dist/tokens-mobile/brand-blue_accent-gray.json +718 -0
  97. package/dist/tokens-mobile/brand-green_accent-brand.json +718 -0
  98. package/dist/tokens-mobile/brand-green_accent-gray.json +718 -0
  99. package/dist/tokens-mobile/brand-mint_accent-brand.json +718 -0
  100. package/dist/tokens-mobile/brand-mint_accent-gray.json +718 -0
  101. package/dist/tokens-mobile/brand-orange_accent-gray.json +718 -0
  102. package/dist/tokens-mobile/brand-purple_accent-brand.json +718 -0
  103. package/dist/tokens-mobile/brand-purple_accent-gray.json +718 -0
  104. package/dist/tokens-mobile/brand-red_accent-gray.json +718 -0
  105. package/dist/tokens-mobile/brand-violet_accent-brand.json +718 -0
  106. package/dist/tokens-mobile/brand-violet_accent-gray.json +718 -0
  107. package/package.json +7 -6
  108. package/dist/cjs/get-tokens.d.ts +0 -15
  109. package/dist/cjs/get-tokens.js +0 -13
  110. package/dist/esm/get-tokens.d.ts +0 -15
  111. package/dist/esm/get-tokens.js +0 -9
@@ -1,22 +1,22 @@
1
1
  export var WARNING_HUE_PATCH = {
2
- 96: 0,
3
- 92: 0,
4
- 88: 0,
5
- 84: 0,
6
- 80: 0,
7
- 76: 0,
8
- 72: -4,
9
- 68: -8,
10
- 64: -12,
11
- 60: -8,
12
- 56: -4,
13
- 52: -2,
14
- 48: 0,
15
- 44: 0,
16
- 40: 0,
17
- 36: 0,
18
- 32: 0,
19
- 28: 0,
20
- 24: 0,
21
- 20: 0,
2
+ 96: 0,
3
+ 92: 0,
4
+ 88: 0,
5
+ 84: 0,
6
+ 80: 0,
7
+ 76: 0,
8
+ 72: -4,
9
+ 68: -8,
10
+ 64: -12,
11
+ 60: -8,
12
+ 56: -4,
13
+ 52: -2,
14
+ 48: 0,
15
+ 44: 0,
16
+ 40: 0,
17
+ 36: 0,
18
+ 32: 0,
19
+ 28: 0,
20
+ 24: 0,
21
+ 20: 0,
22
22
  };
@@ -1,17 +1,19 @@
1
1
  import * as DEFAULT_SWATCH from './constants/default-swatch';
2
2
  import type { BaseTokens } from './types/base-tokens';
3
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[];
4
10
  export interface ConfigOptions {
5
- brand: PresetOrCustom<keyof typeof DEFAULT_SWATCH.brand>;
6
- accent: PresetOrCustom<'brand' | 'gray'>;
7
- system?: typeof DEFAULT_SWATCH.system;
11
+ brand: PresetOrCustom<keyof typeof DEFAULT_SWATCH.brand>;
12
+ accent: PresetOrCustom<(typeof ACCENT_PARAMS)[number]>;
13
+ system?: typeof DEFAULT_SWATCH.system;
8
14
  }
9
15
  export declare function getBaseTokens({ brand, accent, system }: ConfigOptions): BaseTokens;
10
- export declare const colorToHex: (color: string) => string;
11
- export declare const camelCaseToKebabCase: (str: string) => string;
12
- export declare const kebabCaseToCamelCase: (str: string) => string;
13
- export declare function convertOklchToHex(obj: any): any;
16
+ export declare function convertOklchToHex(obj: ColorStructure): ColorStructure;
14
17
  export declare const convertOklchToRgba: (oklchString: string) => string;
15
- export declare function convertAlphaOklchToRgba(obj: any): any;
16
- export declare function flattenObject(obj: any, prefix?: string): any;
18
+ export declare function convertAlphaOklchToRgba(obj: ColorStructure): ColorStructure;
17
19
  export {};
@@ -1,189 +1,147 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
1
  import { converter, formatHex } from 'culori';
13
2
  import { calcOnBrand, getPalette } from './helpers/get-palette';
14
3
  import { getPromo } from './helpers/get-promo';
15
4
  import * as DEFAULT_SWATCH from './constants/default-swatch';
16
5
  import { getLogo } from './helpers/get-logo';
6
+ import { getHover, getPressed } from './helpers/get-interactions';
7
+ export var ACCENT_PARAMS = ['brand', 'gray'];
17
8
  export function getBaseTokens(_a) {
18
- var brand = _a.brand, accent = _a.accent, _b = _a.system, system = _b === void 0 ? DEFAULT_SWATCH.system : _b;
19
- var brandColor = colorToHex(brand);
20
- var brandPalette = getPalette({ color: brandColor });
21
- var accentPalette;
22
- switch (accent) {
23
- case 'brand':
24
- accentPalette = brandPalette;
25
- break;
26
- case 'gray':
27
- accentPalette = undefined;
28
- break;
29
- default:
30
- accentPalette = getPalette({ color: accent });
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;
31
40
  }
32
- var warningPalette = getPalette({
33
- color: system.warning,
34
- });
35
- var errorPalette = getPalette({ color: system.error });
36
- var successPalette = getPalette({
37
- color: system.success,
41
+ customizablePalettes[key] = getPalette({
42
+ color: DEFAULT_SWATCH.customizable[key],
38
43
  });
39
- var customizable = {};
40
- for (var colorKey in DEFAULT_SWATCH.brand) {
41
- // @ts-expect-error
42
- customizable[colorKey] = getPalette({
43
- // @ts-expect-error
44
- color: DEFAULT_SWATCH.brand[colorKey],
45
- });
46
- }
47
- return {
48
- brandLogo: getLogo(brand),
49
- brandPromo: {
50
- light: getPromo(brandColor),
51
- dark: 'blue',
52
- },
53
- brand: {
54
- // todo Brand
55
- original: {
56
- light: brand,
57
- dark: brand,
58
- },
59
- // todo interactions
60
- interactions: {
61
- hover: {
62
- light: '',
63
- dark: '',
64
- },
65
- pressed: {
66
- light: '',
67
- dark: '',
68
- },
69
- },
70
- palette: brandPalette,
71
- },
72
- accent: {
73
- original: {
74
- // todo Fix gray
75
- light: accent === 'gray' ? accent : '#3d3d3d',
76
- dark: accent === 'gray' ? accent : '#3d3d3d',
77
- },
78
- // todo interactions
79
- interactions: {
80
- hover: {
81
- light: '',
82
- dark: '',
83
- },
84
- pressed: {
85
- light: '',
86
- dark: '',
87
- },
88
- },
89
- palette: accentPalette || undefined,
90
- },
91
- warning: warningPalette,
92
- error: errorPalette,
93
- success: successPalette,
94
- gray: DEFAULT_SWATCH.gray,
95
- whiteAlpha: DEFAULT_SWATCH.whiteAlpha,
96
- blackAlpha: DEFAULT_SWATCH.blackAlpha,
97
- onBrand: calcOnBrand(brandColor),
98
- customizable: customizable,
99
- };
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
+ };
100
79
  }
101
- export var colorToHex = function (color) {
102
- if (DEFAULT_SWATCH.brand[color]) {
103
- return DEFAULT_SWATCH.brand[color];
104
- }
105
- return color;
106
- };
107
- export var camelCaseToKebabCase = function (str) {
108
- return str.replace(/[A-Z]/g, function (match) { return "-".concat(match.toLowerCase()); });
109
- };
110
- export var kebabCaseToCamelCase = function (str) {
111
- return str.replace(/-(\w)/g, function (_, c) { return c.toUpperCase(); });
112
- };
113
80
  export function convertOklchToHex(obj) {
114
- if (typeof obj !== 'object' || obj === null) {
115
- return obj;
116
- }
117
- if (Array.isArray(obj)) {
118
- return obj.map(function (item) { return convertOklchToHex(item); });
119
- }
120
- var newObj = {};
121
- for (var key in obj) {
122
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
123
- var value = obj[key];
124
- if (typeof value === 'string' && value.startsWith('oklch(') && !value.includes('/')) {
125
- try {
126
- var toHex = converter('oklch');
127
- value = formatHex(toHex(value));
128
- }
129
- catch (e) {
130
- console.error("Failed to convert OKLCH to hex: ".concat(value), e);
131
- }
132
- }
133
- newObj[key] = convertOklchToHex(value);
134
- }
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
+ }
135
106
  }
136
- return newObj;
107
+ }
108
+ return newObj;
137
109
  }
138
110
  export var convertOklchToRgba = function (oklchString) {
139
- var oklch = converter('oklch')(oklchString);
140
- var rgb = converter('rgb')(oklch);
141
- if (!rgb) {
142
- throw new Error("Invalid color format: ".concat(oklchString));
143
- }
144
- var r = Math.round(rgb.r * 255);
145
- var g = Math.round(rgb.g * 255);
146
- var b = Math.round(rgb.b * 255);
147
- var alpha = oklch.alpha;
148
- return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
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, ')');
149
119
  };
150
120
  export function convertAlphaOklchToRgba(obj) {
151
- if (typeof obj !== 'object' || obj === null) {
152
- return obj;
153
- }
154
- if (Array.isArray(obj)) {
155
- return obj.map(function (item) { return convertAlphaOklchToRgba(item); });
156
- }
157
- var newObj = {};
158
- for (var key in obj) {
159
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
160
- var value = obj[key];
161
- if (typeof value === 'string' && value.includes('oklch(')) {
162
- try {
163
- value = convertOklchToRgba(value);
164
- }
165
- catch (e) {
166
- console.error("Failed to convert OKLCH with alpha to rgba: ".concat(value), e);
167
- }
168
- }
169
- newObj[key] = convertAlphaOklchToRgba(value);
170
- }
171
- }
172
- return newObj;
173
- }
174
- export function flattenObject(obj, prefix) {
175
- if (prefix === void 0) { prefix = ''; }
176
- var result = {};
177
- for (var key in obj) {
178
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
179
- var newKey = prefix ? "".concat(prefix, "-").concat(camelCaseToKebabCase(key)) : key;
180
- if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
181
- result = __assign(__assign({}, result), flattenObject(obj[key], newKey));
182
- }
183
- else {
184
- result[newKey] = obj[key];
185
- }
186
- }
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
+ if (typeof value === 'string' && value.includes('oklch(')) {
137
+ value = convertOklchToRgba(value);
138
+ }
139
+ if (typeof value === 'object' && value !== null) {
140
+ newObj[key] = convertAlphaOklchToRgba(value);
141
+ } else {
142
+ newObj[key] = value;
143
+ }
187
144
  }
188
- return result;
145
+ }
146
+ return newObj;
189
147
  }
@@ -0,0 +1,19 @@
1
+ import { type ConfigOptions } from './get-base-tokens';
2
+ import { getDefaultTokens } from './get-default-tokens';
3
+ import type { BaseTokens } from './types/base-tokens';
4
+ export interface Themed<T> {
5
+ light: T;
6
+ dark: T;
7
+ }
8
+ export type DefaultTokensFull = ReturnType<typeof getDefaultTokens>;
9
+ export type DefaultTokens = DefaultTokensFull['light' | 'dark'];
10
+ export interface SemanticConfigOptions<T> extends ConfigOptions {
11
+ theme?: 'light' | 'dark';
12
+ overrides?: (base: BaseTokens, defaults?: DefaultTokensFull, params?: SemanticConfigOptions<T>) => Themed<T>;
13
+ }
14
+ export declare function getColors(params: SemanticConfigOptions<DefaultTokens>): DefaultTokens;
15
+ export declare function getColors<T>(
16
+ params: SemanticConfigOptions<T> & {
17
+ overrides: (base: BaseTokens) => Themed<T>;
18
+ }
19
+ ): Themed<T>;
@@ -0,0 +1,12 @@
1
+ import { getBaseTokens } from './get-base-tokens';
2
+ import { getDefaultTokens } from './get-default-tokens';
3
+ var DEFAULT_THEME = 'light';
4
+ export function getColors(params) {
5
+ var theme = params.theme || DEFAULT_THEME;
6
+ var base = getBaseTokens(params);
7
+ var defaults = getDefaultTokens(base);
8
+ if (params.overrides) {
9
+ return params.overrides(base, defaults, params)[theme];
10
+ }
11
+ return defaults[theme];
12
+ }