@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.
- package/CHANGELOG.md +84 -0
- package/README.md +104 -171
- package/dist/colors.default-dark.js +16 -16
- package/dist/colors.default-light.js +17 -17
- package/dist/esm/consts/params/abney-correction.d.ts +2 -0
- package/dist/esm/consts/params/chroma-params.d.ts +2 -0
- package/dist/esm/{constants/chroma-settings.js → consts/params/chroma-params.js} +1 -1
- package/dist/esm/consts/params/logo-lightness.d.ts +1 -0
- package/dist/esm/consts/params/logo-lightness.js +1 -0
- package/dist/esm/get-colors-base.d.ts +12 -0
- package/dist/esm/get-colors-base.js +81 -0
- package/dist/{cjs/get-default-tokens.d.ts → esm/get-colors-default-tokens.d.ts} +2 -2
- package/dist/{cjs/get-default-tokens.js → esm/get-colors-default-tokens.js} +34 -38
- package/dist/esm/get-colors.d.ts +3 -10
- package/dist/esm/get-colors.js +6 -8
- package/dist/esm/get-default-tokens.d.ts +1 -1
- package/dist/esm/get-default-tokens.js +33 -33
- package/dist/esm/helpers/get-interactions.js +1 -1
- package/dist/esm/helpers/get-logo.js +4 -4
- package/dist/esm/helpers/get-palette.d.ts +3 -3
- package/dist/esm/helpers/get-palette.js +6 -6
- package/dist/esm/helpers/get-promo.js +1 -1
- package/dist/esm/types/{generator-tokens.d.ts → tokens-base-generator.d.ts} +2 -2
- package/dist/esm/types/tokens.d.ts +12 -0
- package/dist/esm/types/tokens.js +1 -0
- package/dist/esm/utils/convert-color.d.ts +3 -0
- package/dist/esm/utils/convert-color.js +133 -0
- package/dist/tokens/brand-blue-deep_accent-brand.css +33 -33
- package/dist/tokens/brand-blue-deep_accent-gray.css +33 -33
- package/dist/tokens/brand-blue_accent-brand.css +33 -33
- package/dist/tokens/brand-blue_accent-gray.css +33 -33
- package/dist/tokens/brand-green_accent-brand.css +33 -33
- package/dist/tokens/brand-green_accent-gray.css +33 -33
- package/dist/tokens/brand-mint_accent-brand.css +33 -33
- package/dist/tokens/brand-mint_accent-gray.css +33 -33
- package/dist/tokens/brand-orange_accent-gray.css +33 -33
- package/dist/tokens/brand-purple_accent-brand.css +33 -33
- package/dist/tokens/brand-purple_accent-gray.css +33 -33
- package/dist/tokens/brand-red_accent-gray.css +33 -33
- package/dist/tokens/brand-violet_accent-brand.css +33 -33
- package/dist/tokens/brand-violet_accent-gray.css +33 -33
- package/dist/tokens-js/brand-blue-deep_accent-brand.js +33 -33
- package/dist/tokens-js/brand-blue-deep_accent-gray.js +33 -33
- package/dist/tokens-js/brand-blue_accent-brand.js +33 -33
- package/dist/tokens-js/brand-blue_accent-gray.js +33 -33
- package/dist/tokens-js/brand-green_accent-brand.js +33 -33
- package/dist/tokens-js/brand-green_accent-gray.js +33 -33
- package/dist/tokens-js/brand-mint_accent-brand.js +33 -33
- package/dist/tokens-js/brand-mint_accent-gray.js +33 -33
- package/dist/tokens-js/brand-orange_accent-gray.js +33 -33
- package/dist/tokens-js/brand-purple_accent-brand.js +33 -33
- package/dist/tokens-js/brand-purple_accent-gray.js +33 -33
- package/dist/tokens-js/brand-red_accent-gray.js +33 -33
- package/dist/tokens-js/brand-violet_accent-brand.js +33 -33
- package/dist/tokens-js/brand-violet_accent-gray.js +33 -33
- package/dist/tokens-mobile/brand-blue-deep_accent-brand.json +304 -304
- package/dist/tokens-mobile/brand-blue-deep_accent-gray.json +304 -304
- package/dist/tokens-mobile/brand-blue_accent-brand.json +304 -304
- package/dist/tokens-mobile/brand-blue_accent-gray.json +304 -304
- package/dist/tokens-mobile/brand-green_accent-brand.json +304 -304
- package/dist/tokens-mobile/brand-green_accent-gray.json +304 -304
- package/dist/tokens-mobile/brand-mint_accent-brand.json +304 -304
- package/dist/tokens-mobile/brand-mint_accent-gray.json +304 -304
- package/dist/tokens-mobile/brand-orange_accent-gray.json +303 -303
- package/dist/tokens-mobile/brand-purple_accent-brand.json +304 -304
- package/dist/tokens-mobile/brand-purple_accent-gray.json +304 -304
- package/dist/tokens-mobile/brand-red_accent-gray.json +303 -303
- package/dist/tokens-mobile/brand-violet_accent-brand.json +300 -300
- package/dist/tokens-mobile/brand-violet_accent-gray.json +302 -302
- package/package.json +13 -22
- package/scripts/babel-register.js +4 -0
- package/scripts/tokens-base.json +3499 -0
- package/scripts/tokens.json +710 -0
- package/dist/cjs/constants/abney-correction.d.ts +0 -2
- package/dist/cjs/constants/abney-correction.js +0 -1105
- package/dist/cjs/constants/chroma-settings.d.ts +0 -2
- package/dist/cjs/constants/chroma-settings.js +0 -105
- package/dist/cjs/constants/default-swatch.js +0 -112
- package/dist/cjs/constants/interaction-settings.js +0 -19
- package/dist/cjs/constants/logo-lightness.d.ts +0 -1
- package/dist/cjs/constants/logo-lightness.js +0 -4
- package/dist/cjs/constants/promo-hue-shift.js +0 -14
- package/dist/cjs/constants/warning-hue-patch.js +0 -25
- package/dist/cjs/get-base-tokens.d.ts +0 -26
- package/dist/cjs/get-base-tokens.js +0 -319
- package/dist/cjs/get-colors.d.ts +0 -20
- package/dist/cjs/get-colors.js +0 -20
- package/dist/cjs/helpers/get-interactions.d.ts +0 -7
- package/dist/cjs/helpers/get-interactions.js +0 -61
- package/dist/cjs/helpers/get-logo.d.ts +0 -6
- package/dist/cjs/helpers/get-logo.js +0 -32
- package/dist/cjs/helpers/get-palette.d.ts +0 -76
- package/dist/cjs/helpers/get-palette.js +0 -287
- package/dist/cjs/helpers/get-promo.d.ts +0 -12
- package/dist/cjs/helpers/get-promo.js +0 -56
- package/dist/cjs/types/base-tokens.js +0 -2
- package/dist/cjs/types/generator-tokens.d.ts +0 -43
- package/dist/cjs/types/generator-tokens.js +0 -2
- package/dist/cjs/utils/format-variable.d.ts +0 -2
- package/dist/cjs/utils/format-variable.js +0 -15
- package/dist/esm/constants/abney-correction.d.ts +0 -2
- package/dist/esm/constants/chroma-settings.d.ts +0 -2
- package/dist/esm/constants/default-swatch.d.ts +0 -109
- package/dist/esm/constants/interaction-settings.d.ts +0 -8
- package/dist/esm/constants/logo-lightness.d.ts +0 -1
- package/dist/esm/constants/logo-lightness.js +0 -1
- package/dist/esm/constants/promo-hue-shift.d.ts +0 -3
- package/dist/esm/constants/warning-hue-patch.d.ts +0 -3
- package/dist/esm/get-base-tokens.d.ts +0 -26
- package/dist/esm/get-base-tokens.js +0 -257
- package/dist/esm/types/base-tokens.d.ts +0 -125
- /package/dist/{cjs/constants → esm/consts}/default-swatch.d.ts +0 -0
- /package/dist/esm/{constants → consts}/default-swatch.js +0 -0
- /package/dist/esm/{constants → consts/params}/abney-correction.js +0 -0
- /package/dist/{cjs/constants/interaction-settings.d.ts → esm/consts/params/interactions.d.ts} +0 -0
- /package/dist/esm/{constants/interaction-settings.js → consts/params/interactions.js} +0 -0
- /package/dist/{cjs/constants → esm/consts/params}/promo-hue-shift.d.ts +0 -0
- /package/dist/esm/{constants → consts/params}/promo-hue-shift.js +0 -0
- /package/dist/{cjs/constants → esm/consts/params}/warning-hue-patch.d.ts +0 -0
- /package/dist/esm/{constants → consts/params}/warning-hue-patch.js +0 -0
- /package/dist/esm/types/{base-tokens.js → tokens-base-generator.js} +0 -0
- /package/dist/{cjs/types/base-tokens.d.ts → esm/types/tokens-base.d.ts} +0 -0
- /package/dist/esm/types/{generator-tokens.js → tokens-base.js} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [1.1.1](https://git.skbkontur.ru/ui/ui-parking-2/compare/@skbkontur/colors@1.1.0...@skbkontur/colors@1.1.1) (2025-05-06)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
9
|
+
|
|
10
|
+
# [1.1.0](https://git.skbkontur.ru/ui/ui-parking-2/compare/@skbkontur/colors@1.0.0...@skbkontur/colors@1.1.0) (2025-03-17)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- add new storybook documentation ([c267b12](https://git.skbkontur.ru/ui/ui-parking-2/commits/c267b12a86e845a219b173a4e69be6a04b972df8))
|
|
15
|
+
|
|
16
|
+
# [1.0.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.5.1...@skbkontur/colors@1.0.0) (2024-08-08)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **colors:** add scss and change naming ([ef3345f](https://git.skbkontur.ru/ui/ui-parking/commits/ef3345f5f54be830f284c9a2a53991e117b8ba0b))
|
|
21
|
+
- **colors:** add scss and change naming ([78b32b7](https://git.skbkontur.ru/ui/ui-parking/commits/78b32b7a22d260baf166195e7eb1adeea5b2c9f7))
|
|
22
|
+
|
|
23
|
+
### BREAKING CHANGES
|
|
24
|
+
|
|
25
|
+
- **colors:** change naming from camelCase to dash-case
|
|
26
|
+
- **colors:** change naming from camelCase to dash-case
|
|
27
|
+
|
|
28
|
+
## [0.5.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.5.0...@skbkontur/colors@0.5.1) (2024-08-08)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
31
|
+
|
|
32
|
+
# [0.5.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.4.4...@skbkontur/colors@0.5.0) (2024-06-25)
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
- **colors:** update colors 2024 ([7020c9b](https://git.skbkontur.ru/ui/ui-parking/commits/7020c9b1311e4e37973847af70bad28cbbd2902d))
|
|
37
|
+
|
|
38
|
+
### Reverts
|
|
39
|
+
|
|
40
|
+
- remove screenshots in ie11 and obsolete packages ([57a6e89](https://git.skbkontur.ru/ui/ui-parking/commits/57a6e8962089825b6c71c1b96f4d09bc8a5a4ef7))
|
|
41
|
+
|
|
42
|
+
## [0.4.4](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.4.3...@skbkontur/colors@0.4.4) (2023-08-11)
|
|
43
|
+
|
|
44
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
45
|
+
|
|
46
|
+
## [0.4.3](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.4.2...@skbkontur/colors@0.4.3) (2023-08-11)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
49
|
+
|
|
50
|
+
## [0.4.2](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.4.1...@skbkontur/colors@0.4.2) (2023-08-11)
|
|
51
|
+
|
|
52
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
53
|
+
|
|
54
|
+
## [0.4.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.4.0...@skbkontur/colors@0.4.1) (2023-06-29)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
57
|
+
|
|
58
|
+
# [0.4.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.3.0...@skbkontur/colors@0.4.0) (2023-05-22)
|
|
59
|
+
|
|
60
|
+
### Features
|
|
61
|
+
|
|
62
|
+
- **colors:** обновление grayscaleSecondaryText с [#858585](https://git.skbkontur.ru/ui/ui-parking/issues/858585) на [#757575](https://git.skbkontur.ru/ui/ui-parking/issues/757575) ([8f27457](https://git.skbkontur.ru/ui/ui-parking/commits/8f27457477e25ecd52dfb7ab9b1f521145b25125))
|
|
63
|
+
|
|
64
|
+
# [0.3.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.1.1...@skbkontur/colors@0.3.0) (2023-05-12)
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
- **colors:** добавила новые цвета с прозрачностью ([9cd91ef](https://git.skbkontur.ru/ui/ui-parking/commits/9cd91ef608a9f619d02cfb818cf2a4dc2c410929))
|
|
69
|
+
|
|
70
|
+
# [0.2.0](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.1.1...@skbkontur/colors@0.2.0) (2023-05-12)
|
|
71
|
+
|
|
72
|
+
### Features
|
|
73
|
+
|
|
74
|
+
- **colors:** добавила новые цвета с прозрачностью ([9cd91ef](https://git.skbkontur.ru/ui/ui-parking/commits/9cd91ef608a9f619d02cfb818cf2a4dc2c410929))
|
|
75
|
+
|
|
76
|
+
## [0.1.1](https://git.skbkontur.ru/ui/ui-parking/compare/@skbkontur/colors@0.1.0...@skbkontur/colors@0.1.1) (2023-02-06)
|
|
77
|
+
|
|
78
|
+
**Note:** Version bump only for package @skbkontur/colors
|
|
79
|
+
|
|
80
|
+
# 0.1.0 (2023-02-03)
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
- new package @skbkontur/colors ([e9e1a88](https://git.skbkontur.ru/ui/ui-parking/commits/e9e1a88b3f5cea124a770a9e18c5eef2524521dc))
|
package/README.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# Библиотека цветов
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Kontur Colors — библиотека цветов для продуктов Контура
|
|
4
|
+
|
|
5
|
+
**Возможности**
|
|
6
|
+
|
|
7
|
+
- Содержит цветовые схемы для каждого брендового цвета
|
|
8
|
+
- Построена на семантических токенах
|
|
9
|
+
- Поддерживает тёмные темы
|
|
10
|
+
- Доступность. Контрастность цветов по APCA W3
|
|
11
|
+
- Полностью синхронизирована с переменными Figma
|
|
12
|
+
|
|
13
|
+
**Совместимость с любыми веб-фреймворками**
|
|
14
|
+
|
|
15
|
+
- Работает на CSS-переменных `var(--k-color-token-name)` доступных через JS/SCSS/Less
|
|
16
|
+
- Конфигурация сразу нескольких схем через HTML-атрибуты `data-k-brand`, `data-k-accent`, `data-k-theme`
|
|
17
|
+
- [Расширеный JS API](./?path=/docs/colors-colors-api--docs) для генерации палитр любых оттенков и создания кастомных токенов
|
|
4
18
|
|
|
5
19
|
## Установка
|
|
6
20
|
|
|
@@ -8,203 +22,122 @@ NPM-пакет для доступа к цветам из общей Figma-би
|
|
|
8
22
|
npm i @skbkontur/colors
|
|
9
23
|
```
|
|
10
24
|
|
|
11
|
-
##
|
|
25
|
+
## Подключение
|
|
12
26
|
|
|
13
|
-
|
|
14
|
-
- В CSS в виде глобальных переменных`--kontur-color-name` в `:root { ... }`
|
|
15
|
-
- В препроцессорах Less `@color-name` и SCSS `$color-name`
|
|
27
|
+
<br />
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
### 1. Подключение CSS
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
import { KonturColors } from '@skbkontur/colors';
|
|
31
|
+
Подключить CSS-файл с одной или несколькими цветовыми схемами продукта: `brand-[цвет]_accent-[gray|brand].css`
|
|
21
32
|
|
|
22
|
-
|
|
33
|
+
```css
|
|
34
|
+
/* Список всех цветовых схем. Выберите одну или несколько */
|
|
35
|
+
@import '@skbkontur/colors/tokens/brand-red_accent-gray.css';
|
|
36
|
+
@import '@skbkontur/colors/tokens/brand-orange_accent-gray.css';
|
|
37
|
+
@import '@skbkontur/colors/tokens/brand-mint_accent-brand.css';
|
|
38
|
+
@import '@skbkontur/colors/tokens/brand-mint_accent-gray.css';
|
|
39
|
+
@import '@skbkontur/colors/tokens/brand-blue_accent-brand.css';
|
|
40
|
+
@import '@skbkontur/colors/tokens/brand-blue_accent-gray.css';
|
|
41
|
+
@import '@skbkontur/colors/tokens/brand-blue-deep_accent-brand.css';
|
|
42
|
+
@import '@skbkontur/colors/tokens/brand-blue-deep_accent-gray.css';
|
|
43
|
+
@import '@skbkontur/colors/tokens/brand-green_accent-brand.css';
|
|
44
|
+
@import '@skbkontur/colors/tokens/brand-green_accent-gray.css';
|
|
45
|
+
@import '@skbkontur/colors/tokens/brand-violet_accent-brand.css';
|
|
46
|
+
@import '@skbkontur/colors/tokens/brand-violet_accent-gray.css';
|
|
47
|
+
@import '@skbkontur/colors/tokens/brand-purple_accent-brand.css';
|
|
48
|
+
@import '@skbkontur/colors/tokens/brand-purple_accent-gray.css';
|
|
23
49
|
```
|
|
24
50
|
|
|
25
|
-
|
|
51
|
+
### 2. Конфигурация в HTML
|
|
52
|
+
|
|
53
|
+
Настройка контекста через 3 data-атрибута:
|
|
26
54
|
|
|
27
|
-
|
|
28
|
-
|
|
55
|
+
- **data-k-brand** — брендовый цвет `red | orange | green | mint | blue | blueDeep | violet | purple`
|
|
56
|
+
- **data-k-accent** — акцентный цвет `gray | brand`
|
|
57
|
+
- **data-k-theme** — тема `light | dark` (по умолчанию light)
|
|
29
58
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
59
|
+
```html
|
|
60
|
+
<div data-k-brand="orange" data-k-accent="gray" data-k-theme="light">
|
|
61
|
+
<div class="block">Блок Контур.Экстерна</div>
|
|
62
|
+
|
|
63
|
+
<div data-k-brand="blue" data-k-accent="brand" data-k-theme="light">
|
|
64
|
+
<div class="banner">Рекламный баннер Контур.Эльбы</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
33
67
|
```
|
|
34
68
|
|
|
35
|
-
|
|
69
|
+
## Использование
|
|
36
70
|
|
|
37
|
-
|
|
38
|
-
@import '@skbkontur/colors/colors.css';
|
|
71
|
+
### CSS
|
|
39
72
|
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
Токены доступны в виде CSS-переменных `var(--k-color-token-name)`
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
.block {
|
|
77
|
+
color: var(--k-color-text-on-accent-default-primary);
|
|
78
|
+
background: var(--k-color-shape-default-accent-faint);
|
|
42
79
|
}
|
|
43
80
|
```
|
|
44
81
|
|
|
45
|
-
|
|
82
|
+
### JS/TS
|
|
46
83
|
|
|
47
|
-
|
|
48
|
-
|
|
84
|
+
Переменные `colors.tokenName` содержат ссылки на `var(--k-color-token-name)`
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
import * as colors from '@skbkontur/colors';
|
|
88
|
+
|
|
89
|
+
const text = `
|
|
90
|
+
<div style="color: ${colors.textNeutralHeavy}">
|
|
91
|
+
Блок с текстом
|
|
92
|
+
</div>
|
|
93
|
+
`;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### SCSS
|
|
97
|
+
|
|
98
|
+
Переменные `colors.$token-name` содержат ссылки на `var(--k-color-token-name)`
|
|
99
|
+
|
|
100
|
+
```css
|
|
101
|
+
@use '@skbkontur/colors/colors.scss';
|
|
49
102
|
|
|
50
103
|
.class {
|
|
51
|
-
color:
|
|
104
|
+
color: colors.$text-neutral-heavy;
|
|
52
105
|
}
|
|
53
106
|
```
|
|
54
107
|
|
|
55
|
-
|
|
108
|
+
### Less
|
|
109
|
+
|
|
110
|
+
Переменные `$token-name` содержат ссылки на `var(--k-color-token-name)`
|
|
56
111
|
|
|
57
|
-
```
|
|
112
|
+
```css
|
|
58
113
|
@import '@skbkontur/colors/colors.less';
|
|
59
114
|
|
|
60
115
|
.class {
|
|
61
|
-
color:
|
|
116
|
+
color: $text-neutral-heavy;
|
|
62
117
|
}
|
|
63
118
|
```
|
|
64
119
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
```jsx harmony
|
|
68
|
-
import { KonturColors } from '@skbkontur/colors';
|
|
69
|
-
import {
|
|
70
|
-
Toast,
|
|
71
|
-
DropdownMenu,
|
|
72
|
-
MenuHeader,
|
|
73
|
-
MenuItem,
|
|
74
|
-
ThemeContext,
|
|
75
|
-
ThemeFactory,
|
|
76
|
-
THEME_2022_UPDATE_2024,
|
|
77
|
-
} from '@skbkontur/react-ui';
|
|
78
|
-
|
|
79
|
-
import { css } from '@skbkontur/react-ui/lib/theming/Emotion';
|
|
80
|
-
|
|
81
|
-
const styles = {
|
|
82
|
-
colors: css`
|
|
83
|
-
display: grid;
|
|
84
|
-
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
85
|
-
gap: 24px;
|
|
86
|
-
`,
|
|
87
|
-
colorGroup: css`
|
|
88
|
-
break-inside: avoid;
|
|
89
|
-
margin-bottom: 64px;
|
|
90
|
-
`,
|
|
91
|
-
colorBlock: css`
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
gap: 10px;
|
|
95
|
-
width: 100%;
|
|
96
|
-
border: none;
|
|
97
|
-
text-align: left;
|
|
98
|
-
background: none;
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
padding: 8px;
|
|
101
|
-
border-radius: 8px;
|
|
102
|
-
transition: 0.1s ease;
|
|
103
|
-
|
|
104
|
-
&:hover {
|
|
105
|
-
background: rgba(0, 0, 0, 0.06);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&:active {
|
|
109
|
-
background: rgba(0, 0, 0, 0.1);
|
|
110
|
-
}
|
|
111
|
-
`,
|
|
112
|
-
colorTile: css`
|
|
113
|
-
display: block;
|
|
114
|
-
height: 32px;
|
|
115
|
-
width: 32px;
|
|
116
|
-
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
117
|
-
border-radius: 8px;
|
|
118
|
-
flex-shrink: 0;
|
|
119
|
-
`,
|
|
120
|
-
groupTitle: css`
|
|
121
|
-
display: block;
|
|
122
|
-
font-size: 20px;
|
|
123
|
-
font-weight: 600;
|
|
124
|
-
margin: 0 8px 12px;
|
|
125
|
-
`,
|
|
126
|
-
title: css`
|
|
127
|
-
display: block;
|
|
128
|
-
padding: 1px 0 0 8px;
|
|
129
|
-
`,
|
|
130
|
-
colorName: css`
|
|
131
|
-
display: block;
|
|
132
|
-
font-size: 14px;
|
|
133
|
-
line-height: 1.2;
|
|
134
|
-
`,
|
|
135
|
-
colorValue: css`
|
|
136
|
-
display: block;
|
|
137
|
-
fontSize: 12px;
|
|
138
|
-
color: #8b8b8b;
|
|
139
|
-
}`,
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const colorGroups = Object.entries(KonturColors).reduce((acc, [colorKey, colorValue]) => {
|
|
143
|
-
const firstWord = ['greenMint', 'blueDark'].find((color) => colorKey.match(color)) || colorKey.match(/^[a-z]+/)[0];
|
|
144
|
-
|
|
145
|
-
acc[firstWord] = { ...acc[firstWord], [colorKey]: colorValue };
|
|
146
|
-
|
|
147
|
-
return acc;
|
|
148
|
-
}, {});
|
|
149
|
-
|
|
150
|
-
const getColors = (color) => {
|
|
151
|
-
const colorDashCase = color
|
|
152
|
-
.replace(/[A-Z]/g, (m) => '-' + m.toLowerCase())
|
|
153
|
-
.replace(/\d/, (m) => `-${m}`)
|
|
154
|
-
.replace('f-f-f', 'fff');
|
|
155
|
-
|
|
156
|
-
return {
|
|
157
|
-
'JavaScript / TypeScript': `KonturColors.${color}`,
|
|
158
|
-
CSS: `var(--kontur-${colorDashCase})`,
|
|
159
|
-
SCSS: `$${colorDashCase}`,
|
|
160
|
-
Less: `@${colorDashCase}`,
|
|
161
|
-
};
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const copyColor = (color) => {
|
|
165
|
-
navigator.clipboard.writeText(color);
|
|
166
|
-
Toast.push('Цвет скопирован', null, 1000);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
<div className={styles.colors}>
|
|
170
|
-
<ThemeContext.Provider value={THEME_2022_UPDATE_2024}>
|
|
171
|
-
{Object.entries(colorGroups).map(([group, colors]) => {
|
|
172
|
-
return (
|
|
173
|
-
<div className={styles.colorGroup}>
|
|
174
|
-
<div className={styles.groupTitle}>{group}</div>
|
|
175
|
-
{Object.keys(colors).map((colorName) => {
|
|
176
|
-
const colorValue = KonturColors[colorName];
|
|
177
|
-
const colorTile = (
|
|
178
|
-
<div className={styles.colorBlock}>
|
|
179
|
-
<span className={styles.colorTile} style={{ backgroundColor: colorValue }} />
|
|
180
|
-
<span>
|
|
181
|
-
<span className={styles.colorName}>{colorName}</span>
|
|
182
|
-
<span className={styles.colorValue}>{colorValue}</span>
|
|
183
|
-
</span>
|
|
184
|
-
</div>
|
|
185
|
-
);
|
|
186
|
-
return (
|
|
187
|
-
<div>
|
|
188
|
-
<DropdownMenu caption={colorTile} width="300">
|
|
189
|
-
<MenuHeader>Скопировать переменную</MenuHeader>
|
|
190
|
-
{Object.entries(getColors(colorName)).map(([lang, color]) => (
|
|
191
|
-
<MenuItem onClick={() => copyColor(color)} comment={lang}>
|
|
192
|
-
<div style={{ minWidth: 270 }}>{color}</div>
|
|
193
|
-
</MenuItem>
|
|
194
|
-
))}
|
|
195
|
-
</DropdownMenu>
|
|
196
|
-
</div>
|
|
197
|
-
);
|
|
198
|
-
})}
|
|
199
|
-
</div>
|
|
200
|
-
);
|
|
201
|
-
})}
|
|
202
|
-
</ThemeContext.Provider>
|
|
203
|
-
</div>;
|
|
204
|
-
```
|
|
120
|
+
<br />
|
|
205
121
|
|
|
206
|
-
##
|
|
122
|
+
## Colors API: генерация палитр и кастомные токены
|
|
207
123
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
124
|
+
Библиотека Colors содержит JS API для продвинутых сценариев:
|
|
125
|
+
|
|
126
|
+
- Генерация палитр для произвольных HEX-цветов, а не только брендовых
|
|
127
|
+
- Создание/расширение цветовых палитр с собственными семантическими токенами
|
|
128
|
+
- Генерация цветов в форматах для разных платформ (oklch, hex, rgba и др.)
|
|
129
|
+
- Перекраска интерфейсов в любой цвет на лету
|
|
130
|
+
|
|
131
|
+
Функция `getColors` позволяет получать цвета для произвольных `brand`, `accent` и `theme`. Настраивать образцы оттенков `warning`, `error`. Указывать формат цвета, задавать кастомные токены со ссылками на сгенерированные палитры и другие параметры.
|
|
132
|
+
|
|
133
|
+
```js static
|
|
134
|
+
import { getColors } from '@skbkontur/colors';
|
|
135
|
+
|
|
136
|
+
const colors = getColors({ brand: 'orange', accent: 'gray', theme: 'light' });
|
|
137
|
+
|
|
138
|
+
const text = `
|
|
139
|
+
<div style="color: ${colors.textNeutralHeavy}">
|
|
140
|
+
Блок с текстом
|
|
141
|
+
</div>
|
|
142
|
+
`;
|
|
143
|
+
```
|
|
@@ -104,13 +104,13 @@ export const shapeOtherLowHover = 'var(--k-color-shape-other-low-hover, rgba(0,
|
|
|
104
104
|
export const shapeOtherLowPressed = 'var(--k-color-shape-other-low-pressed, rgba(0, 0, 0, 0.32))';
|
|
105
105
|
export const shapeOtherNeutralFaintSolid = 'var(--k-color-shape-other-neutral-faint-solid, #333333)';
|
|
106
106
|
export const shapeOtherNeutralFaintSolidHover = 'var(--k-color-shape-other-neutral-faint-solid-hover, #3d3d3d)';
|
|
107
|
-
export const shapeOtherNeutralFaintSolidPressed = 'var(--k-color-shape-other-neutral-faint-solid-pressed, #
|
|
107
|
+
export const shapeOtherNeutralFaintSolidPressed = 'var(--k-color-shape-other-neutral-faint-solid-pressed, #333333)';
|
|
108
108
|
export const shapeOtherNeutralPaleSolid = 'var(--k-color-shape-other-neutral-pale-solid, #3d3d3d)';
|
|
109
109
|
export const shapeOtherNeutralPaleSolidHover = 'var(--k-color-shape-other-neutral-pale-solid-hover, #484848)';
|
|
110
110
|
export const shapeOtherNeutralPaleSolidPressed = 'var(--k-color-shape-other-neutral-pale-solid-pressed, #333333)';
|
|
111
|
-
export const shapeOtherNeutralSoftSolid = 'var(--k-color-shape-other-neutral-soft-solid, #
|
|
111
|
+
export const shapeOtherNeutralSoftSolid = 'var(--k-color-shape-other-neutral-soft-solid, #484848)';
|
|
112
112
|
export const shapeOtherNeutralSoftSolidHover = 'var(--k-color-shape-other-neutral-soft-solid-hover, #5d5d5d)';
|
|
113
|
-
export const shapeOtherNeutralSoftSolidPressed = 'var(--k-color-shape-other-neutral-soft-solid-pressed, #
|
|
113
|
+
export const shapeOtherNeutralSoftSolidPressed = 'var(--k-color-shape-other-neutral-soft-solid-pressed, #3d3d3d)';
|
|
114
114
|
export const shapePaleAccent = 'var(--k-color-shape-pale-accent, rgba(255, 255, 255, 0.16))';
|
|
115
115
|
export const shapePaleAccentHover = 'var(--k-color-shape-pale-accent-hover, rgba(255, 255, 255, 0.24))';
|
|
116
116
|
export const shapePaleAccentPressed = 'var(--k-color-shape-pale-accent-pressed, rgba(255, 255, 255, 0.12))';
|
|
@@ -120,8 +120,8 @@ export const shapePaleBrandPressed = 'var(--k-color-shape-pale-brand-pressed, #5
|
|
|
120
120
|
export const shapePaleError = 'var(--k-color-shape-pale-error, #602a27)';
|
|
121
121
|
export const shapePaleErrorHover = 'var(--k-color-shape-pale-error-hover, #71312e)';
|
|
122
122
|
export const shapePaleErrorPressed = 'var(--k-color-shape-pale-error-pressed, #502421)';
|
|
123
|
-
export const shapePaleNeutralAlpha = 'var(--k-color-shape-pale-neutral-alpha, rgba(255, 255, 255, 0.
|
|
124
|
-
export const shapePaleNeutralAlphaHover = 'var(--k-color-shape-pale-neutral-alpha-hover, rgba(255, 255, 255, 0.
|
|
123
|
+
export const shapePaleNeutralAlpha = 'var(--k-color-shape-pale-neutral-alpha, rgba(255, 255, 255, 0.12))';
|
|
124
|
+
export const shapePaleNeutralAlphaHover = 'var(--k-color-shape-pale-neutral-alpha-hover, rgba(255, 255, 255, 0.16))';
|
|
125
125
|
export const shapePaleNeutralAlphaPressed =
|
|
126
126
|
'var(--k-color-shape-pale-neutral-alpha-pressed, rgba(255, 255, 255, 0.06))';
|
|
127
127
|
export const shapePaleSuccess = 'var(--k-color-shape-pale-success, #27452d)';
|
|
@@ -142,7 +142,7 @@ export const shapeSoftErrorPressed = 'var(--k-color-shape-soft-error-pressed, #8
|
|
|
142
142
|
export const shapeSoftNeutralAlpha = 'var(--k-color-shape-soft-neutral-alpha, rgba(255, 255, 255, 0.16))';
|
|
143
143
|
export const shapeSoftNeutralAlphaHover = 'var(--k-color-shape-soft-neutral-alpha-hover, rgba(255, 255, 255, 0.24))';
|
|
144
144
|
export const shapeSoftNeutralAlphaPressed =
|
|
145
|
-
'var(--k-color-shape-soft-neutral-alpha-pressed, rgba(255, 255, 255, 0.
|
|
145
|
+
'var(--k-color-shape-soft-neutral-alpha-pressed, rgba(255, 255, 255, 0.08))';
|
|
146
146
|
export const shapeSoftSuccess = 'var(--k-color-shape-soft-success, #3a6a43)';
|
|
147
147
|
export const shapeSoftSuccessHover = 'var(--k-color-shape-soft-success-hover, #3f784b)';
|
|
148
148
|
export const shapeSoftSuccessPressed = 'var(--k-color-shape-soft-success-pressed, #345e3c)';
|
|
@@ -150,22 +150,22 @@ export const shapeSoftWarning = 'var(--k-color-shape-soft-warning, #86612c)';
|
|
|
150
150
|
export const shapeSoftWarningHover = 'var(--k-color-shape-soft-warning-hover, #956c30)';
|
|
151
151
|
export const shapeSoftWarningPressed = 'var(--k-color-shape-soft-warning-pressed, #775728)';
|
|
152
152
|
export const shapeInvertedBacklessHover = 'var(--k-color-shape-inverted-backless-hover, rgba(0, 0, 0, 0.06))';
|
|
153
|
-
export const shapeInvertedBacklessPressed = 'var(--k-color-shape-inverted-backless-pressed, rgba(0, 0, 0, 0.
|
|
153
|
+
export const shapeInvertedBacklessPressed = 'var(--k-color-shape-inverted-backless-pressed, rgba(0, 0, 0, 0.16))';
|
|
154
154
|
export const shapeInvertedDisabled = 'var(--k-color-shape-inverted-disabled, rgba(0, 0, 0, 0.06))';
|
|
155
155
|
export const shapeInvertedNeutralFaintAlpha = 'var(--k-color-shape-inverted-neutral-faint-alpha, rgba(0, 0, 0, 0.06))';
|
|
156
156
|
export const shapeInvertedNeutralFaintAlphaHover =
|
|
157
|
-
'var(--k-color-shape-inverted-neutral-faint-alpha-hover, rgba(0, 0, 0, 0.
|
|
157
|
+
'var(--k-color-shape-inverted-neutral-faint-alpha-hover, rgba(0, 0, 0, 0.12))';
|
|
158
158
|
export const shapeInvertedNeutralFaintAlphaPressed =
|
|
159
|
-
'var(--k-color-shape-inverted-neutral-faint-alpha-pressed, rgba(0, 0, 0, 0.
|
|
159
|
+
'var(--k-color-shape-inverted-neutral-faint-alpha-pressed, rgba(0, 0, 0, 0.16))';
|
|
160
160
|
export const shapeInvertedNeutralHeavy = 'var(--k-color-shape-inverted-neutral-heavy, rgba(0, 0, 0, 0.8))';
|
|
161
161
|
export const shapeInvertedNeutralHeavyHover = 'var(--k-color-shape-inverted-neutral-heavy-hover, rgba(0, 0, 0, 0.88))';
|
|
162
162
|
export const shapeInvertedNeutralHeavyPressed =
|
|
163
163
|
'var(--k-color-shape-inverted-neutral-heavy-pressed, rgba(0, 0, 0, 0.72))';
|
|
164
|
-
export const shapeInvertedNeutralPaleAlpha = 'var(--k-color-shape-inverted-neutral-pale-alpha, rgba(0, 0, 0, 0.
|
|
164
|
+
export const shapeInvertedNeutralPaleAlpha = 'var(--k-color-shape-inverted-neutral-pale-alpha, rgba(0, 0, 0, 0.12))';
|
|
165
165
|
export const shapeInvertedNeutralPaleAlphaHover =
|
|
166
|
-
'var(--k-color-shape-inverted-neutral-pale-alpha-hover, rgba(0, 0, 0, 0.
|
|
166
|
+
'var(--k-color-shape-inverted-neutral-pale-alpha-hover, rgba(0, 0, 0, 0.16))';
|
|
167
167
|
export const shapeInvertedNeutralPaleAlphaPressed =
|
|
168
|
-
'var(--k-color-shape-inverted-neutral-pale-alpha-pressed, rgba(0, 0, 0, 0.
|
|
168
|
+
'var(--k-color-shape-inverted-neutral-pale-alpha-pressed, rgba(0, 0, 0, 0.24))';
|
|
169
169
|
export const shapeInvertedNeutralSoftAlpha = 'var(--k-color-shape-inverted-neutral-soft-alpha, rgba(0, 0, 0, 0.16))';
|
|
170
170
|
export const shapeInvertedNeutralSoftAlphaHover =
|
|
171
171
|
'var(--k-color-shape-inverted-neutral-soft-alpha-hover, rgba(0, 0, 0, 0.24))';
|
|
@@ -277,15 +277,15 @@ export const illustrationSymbol = 'var(--k-color-illustration-symbol, #fea09c)';
|
|
|
277
277
|
export const illustrationWhite = 'var(--k-color-illustration-white, #ffffff)';
|
|
278
278
|
export const customizableBoldBlack = 'var(--k-color-customizable-bold-black, #b1b1b1)';
|
|
279
279
|
export const customizableBoldBlue = 'var(--k-color-customizable-bold-blue, #2b8df2)';
|
|
280
|
-
export const customizableBoldBlueDeep = 'var(--k-color-customizable-bold-blue-deep, #
|
|
280
|
+
export const customizableBoldBlueDeep = 'var(--k-color-customizable-bold-blue-deep, #3e72ff)';
|
|
281
281
|
export const customizableBoldGray = 'var(--k-color-customizable-bold-gray, #696969)';
|
|
282
282
|
export const customizableBoldGreen = 'var(--k-color-customizable-bold-green, #2ca651)';
|
|
283
|
-
export const customizableBoldMint = 'var(--k-color-customizable-bold-mint, #
|
|
284
|
-
export const customizableBoldOrange = 'var(--k-color-customizable-bold-orange, #
|
|
283
|
+
export const customizableBoldMint = 'var(--k-color-customizable-bold-mint, #01b197)';
|
|
284
|
+
export const customizableBoldOrange = 'var(--k-color-customizable-bold-orange, #ed6d28)';
|
|
285
285
|
export const customizableBoldPurple = 'var(--k-color-customizable-bold-purple, #be5ad8)';
|
|
286
286
|
export const customizableBoldRed = 'var(--k-color-customizable-bold-red, #ee4948)';
|
|
287
287
|
export const customizableBoldViolet = 'var(--k-color-customizable-bold-violet, #956ef2)';
|
|
288
|
-
export const customizableBoldYellow = 'var(--k-color-customizable-bold-yellow, #
|
|
288
|
+
export const customizableBoldYellow = 'var(--k-color-customizable-bold-yellow, #dfa700)';
|
|
289
289
|
export const customizableFaintBlack = 'var(--k-color-customizable-faint-black, #484848)';
|
|
290
290
|
export const customizableFaintBlue = 'var(--k-color-customizable-faint-blue, #1f344d)';
|
|
291
291
|
export const customizableFaintBlueDeep = 'var(--k-color-customizable-faint-blue-deep, #1e305c)';
|
|
@@ -75,8 +75,8 @@ export const shapeFaintError = 'var(--k-color-shape-faint-error, #ffedef)';
|
|
|
75
75
|
export const shapeFaintErrorHover = 'var(--k-color-shape-faint-error-hover, #ffdadd)';
|
|
76
76
|
export const shapeFaintErrorPressed = 'var(--k-color-shape-faint-error-pressed, #f5dee0)';
|
|
77
77
|
export const shapeFaintNeutralAlpha = 'var(--k-color-shape-faint-neutral-alpha, rgba(0, 0, 0, 0.06))';
|
|
78
|
-
export const shapeFaintNeutralAlphaHover = 'var(--k-color-shape-faint-neutral-alpha-hover, rgba(0, 0, 0, 0.
|
|
79
|
-
export const shapeFaintNeutralAlphaPressed = 'var(--k-color-shape-faint-neutral-alpha-pressed, rgba(0, 0, 0, 0.
|
|
78
|
+
export const shapeFaintNeutralAlphaHover = 'var(--k-color-shape-faint-neutral-alpha-hover, rgba(0, 0, 0, 0.12))';
|
|
79
|
+
export const shapeFaintNeutralAlphaPressed = 'var(--k-color-shape-faint-neutral-alpha-pressed, rgba(0, 0, 0, 0.16))';
|
|
80
80
|
export const shapeFaintSuccess = 'var(--k-color-shape-faint-success, #defbe2)';
|
|
81
81
|
export const shapeFaintSuccessHover = 'var(--k-color-shape-faint-success-hover, #c3f3ca)';
|
|
82
82
|
export const shapeFaintSuccessPressed = 'var(--k-color-shape-faint-success-pressed, #d1edd5)';
|
|
@@ -89,7 +89,7 @@ export const shapeHeavySuccess = 'var(--k-color-shape-heavy-success, #0b4a1f)';
|
|
|
89
89
|
export const shapeHeavyWarning = 'var(--k-color-shape-heavy-warning, #543600)';
|
|
90
90
|
export const shapeOtherAccentBoldDisabled = 'var(--k-color-shape-other-accent-bold-disabled, rgba(0, 0, 0, 0.32))';
|
|
91
91
|
export const shapeOtherBacklessHover = 'var(--k-color-shape-other-backless-hover, rgba(0, 0, 0, 0.06))';
|
|
92
|
-
export const shapeOtherBacklessPressed = 'var(--k-color-shape-other-backless-pressed, rgba(0, 0, 0, 0.
|
|
92
|
+
export const shapeOtherBacklessPressed = 'var(--k-color-shape-other-backless-pressed, rgba(0, 0, 0, 0.16))';
|
|
93
93
|
export const shapeOtherBase = 'var(--k-color-shape-other-base, #ffffff)';
|
|
94
94
|
export const shapeOtherBaseHover = 'var(--k-color-shape-other-base-hover, #f2f2f2)';
|
|
95
95
|
export const shapeOtherBasePressed = 'var(--k-color-shape-other-base-pressed, #e4e4e4)';
|
|
@@ -106,7 +106,7 @@ export const shapeOtherNeutralFaintSolidPressed = 'var(--k-color-shape-other-neu
|
|
|
106
106
|
export const shapeOtherNeutralPaleSolid = 'var(--k-color-shape-other-neutral-pale-solid, #e4e4e4)';
|
|
107
107
|
export const shapeOtherNeutralPaleSolidHover = 'var(--k-color-shape-other-neutral-pale-solid-hover, #d7d7d7)';
|
|
108
108
|
export const shapeOtherNeutralPaleSolidPressed = 'var(--k-color-shape-other-neutral-pale-solid-pressed, #cacaca)';
|
|
109
|
-
export const shapeOtherNeutralSoftSolid = 'var(--k-color-shape-other-neutral-soft-solid, #
|
|
109
|
+
export const shapeOtherNeutralSoftSolid = 'var(--k-color-shape-other-neutral-soft-solid, #d7d7d7)';
|
|
110
110
|
export const shapeOtherNeutralSoftSolidHover = 'var(--k-color-shape-other-neutral-soft-solid-hover, #bebebe)';
|
|
111
111
|
export const shapeOtherNeutralSoftSolidPressed = 'var(--k-color-shape-other-neutral-soft-solid-pressed, #b1b1b1)';
|
|
112
112
|
export const shapePaleAccent = 'var(--k-color-shape-pale-accent, rgba(0, 0, 0, 0.16))';
|
|
@@ -118,9 +118,9 @@ export const shapePaleBrandPressed = 'var(--k-color-shape-pale-brand-pressed, #f
|
|
|
118
118
|
export const shapePaleError = 'var(--k-color-shape-pale-error, #ffdadd)';
|
|
119
119
|
export const shapePaleErrorHover = 'var(--k-color-shape-pale-error-hover, #ffc7c7)';
|
|
120
120
|
export const shapePaleErrorPressed = 'var(--k-color-shape-pale-error-pressed, #f2cdcd)';
|
|
121
|
-
export const shapePaleNeutralAlpha = 'var(--k-color-shape-pale-neutral-alpha, rgba(0, 0, 0, 0.
|
|
122
|
-
export const shapePaleNeutralAlphaHover = 'var(--k-color-shape-pale-neutral-alpha-hover, rgba(0, 0, 0, 0.
|
|
123
|
-
export const shapePaleNeutralAlphaPressed = 'var(--k-color-shape-pale-neutral-alpha-pressed, rgba(0, 0, 0, 0.
|
|
121
|
+
export const shapePaleNeutralAlpha = 'var(--k-color-shape-pale-neutral-alpha, rgba(0, 0, 0, 0.12))';
|
|
122
|
+
export const shapePaleNeutralAlphaHover = 'var(--k-color-shape-pale-neutral-alpha-hover, rgba(0, 0, 0, 0.16))';
|
|
123
|
+
export const shapePaleNeutralAlphaPressed = 'var(--k-color-shape-pale-neutral-alpha-pressed, rgba(0, 0, 0, 0.24))';
|
|
124
124
|
export const shapePaleSuccess = 'var(--k-color-shape-pale-success, #c3f3ca)';
|
|
125
125
|
export const shapePaleSuccessHover = 'var(--k-color-shape-pale-success-hover, #a7ebb2)';
|
|
126
126
|
export const shapePaleSuccessPressed = 'var(--k-color-shape-pale-success-pressed, #bae4c0)';
|
|
@@ -160,9 +160,9 @@ export const shapeInvertedNeutralHeavyHover =
|
|
|
160
160
|
export const shapeInvertedNeutralHeavyPressed =
|
|
161
161
|
'var(--k-color-shape-inverted-neutral-heavy-pressed, rgba(255, 255, 255, 0.72))';
|
|
162
162
|
export const shapeInvertedNeutralPaleAlpha =
|
|
163
|
-
'var(--k-color-shape-inverted-neutral-pale-alpha, rgba(255, 255, 255, 0.
|
|
163
|
+
'var(--k-color-shape-inverted-neutral-pale-alpha, rgba(255, 255, 255, 0.12))';
|
|
164
164
|
export const shapeInvertedNeutralPaleAlphaHover =
|
|
165
|
-
'var(--k-color-shape-inverted-neutral-pale-alpha-hover, rgba(255, 255, 255, 0.
|
|
165
|
+
'var(--k-color-shape-inverted-neutral-pale-alpha-hover, rgba(255, 255, 255, 0.16))';
|
|
166
166
|
export const shapeInvertedNeutralPaleAlphaPressed =
|
|
167
167
|
'var(--k-color-shape-inverted-neutral-pale-alpha-pressed, rgba(255, 255, 255, 0.06))';
|
|
168
168
|
export const shapeInvertedNeutralSoftAlpha =
|
|
@@ -170,7 +170,7 @@ export const shapeInvertedNeutralSoftAlpha =
|
|
|
170
170
|
export const shapeInvertedNeutralSoftAlphaHover =
|
|
171
171
|
'var(--k-color-shape-inverted-neutral-soft-alpha-hover, rgba(255, 255, 255, 0.24))';
|
|
172
172
|
export const shapeInvertedNeutralSoftAlphaPressed =
|
|
173
|
-
'var(--k-color-shape-inverted-neutral-soft-alpha-pressed, rgba(255, 255, 255, 0.
|
|
173
|
+
'var(--k-color-shape-inverted-neutral-soft-alpha-pressed, rgba(255, 255, 255, 0.08))';
|
|
174
174
|
export const shapeConstBacklessBlackHover = 'var(--k-color-shape-const-backless-black-hover, rgba(0, 0, 0, 0.12))';
|
|
175
175
|
export const shapeConstBacklessBlackPressed = 'var(--k-color-shape-const-backless-black-pressed, rgba(0, 0, 0, 0.16))';
|
|
176
176
|
export const shapeConstBacklessWhiteHover =
|
|
@@ -281,21 +281,21 @@ export const illustrationSymbol = 'var(--k-color-illustration-symbol, #fea09c)';
|
|
|
281
281
|
export const illustrationWhite = 'var(--k-color-illustration-white, #ffffff)';
|
|
282
282
|
export const customizableBoldBlack = 'var(--k-color-customizable-bold-black, #696969)';
|
|
283
283
|
export const customizableBoldBlue = 'var(--k-color-customizable-bold-blue, #369bff)';
|
|
284
|
-
export const customizableBoldBlueDeep = 'var(--k-color-customizable-bold-blue-deep, #
|
|
284
|
+
export const customizableBoldBlueDeep = 'var(--k-color-customizable-bold-blue-deep, #5183ff)';
|
|
285
285
|
export const customizableBoldGray = 'var(--k-color-customizable-bold-gray, #a4a4a4)';
|
|
286
286
|
export const customizableBoldGreen = 'var(--k-color-customizable-bold-green, #00b74e)';
|
|
287
|
-
export const customizableBoldMint = 'var(--k-color-customizable-bold-mint, #
|
|
287
|
+
export const customizableBoldMint = 'var(--k-color-customizable-bold-mint, #05bfa3)';
|
|
288
288
|
export const customizableBoldOrange = 'var(--k-color-customizable-bold-orange, #f56600)';
|
|
289
289
|
export const customizableBoldPurple = 'var(--k-color-customizable-bold-purple, #cf60ec)';
|
|
290
290
|
export const customizableBoldRed = 'var(--k-color-customizable-bold-red, #ff5352)';
|
|
291
291
|
export const customizableBoldViolet = 'var(--k-color-customizable-bold-violet, #a17bff)';
|
|
292
|
-
export const customizableBoldYellow = 'var(--k-color-customizable-bold-yellow, #
|
|
292
|
+
export const customizableBoldYellow = 'var(--k-color-customizable-bold-yellow, #ecb400)';
|
|
293
293
|
export const customizableFaintBlack = 'var(--k-color-customizable-faint-black, #e4e4e4)';
|
|
294
294
|
export const customizableFaintBlue = 'var(--k-color-customizable-faint-blue, #e2f5ff)';
|
|
295
295
|
export const customizableFaintBlueDeep = 'var(--k-color-customizable-faint-blue-deep, #e8f3ff)';
|
|
296
296
|
export const customizableFaintGray = 'var(--k-color-customizable-faint-gray, #f2f2f2)';
|
|
297
|
-
export const customizableFaintGreen = 'var(--k-color-customizable-faint-green, #
|
|
298
|
-
export const customizableFaintMint = 'var(--k-color-customizable-faint-mint, #
|
|
297
|
+
export const customizableFaintGreen = 'var(--k-color-customizable-faint-green, #defbe2)';
|
|
298
|
+
export const customizableFaintMint = 'var(--k-color-customizable-faint-mint, #d2fcf6)';
|
|
299
299
|
export const customizableFaintOrange = 'var(--k-color-customizable-faint-orange, #ffeee1)';
|
|
300
300
|
export const customizableFaintPurple = 'var(--k-color-customizable-faint-purple, #ffeaff)';
|
|
301
301
|
export const customizableFaintRed = 'var(--k-color-customizable-faint-red, #ffedef)';
|
|
@@ -316,8 +316,8 @@ export const customizablePaleBlack = 'var(--k-color-customizable-pale-black, #d7
|
|
|
316
316
|
export const customizablePaleBlue = 'var(--k-color-customizable-pale-blue, #c7ebff)';
|
|
317
317
|
export const customizablePaleBlueDeep = 'var(--k-color-customizable-pale-blue-deep, #d2e7ff)';
|
|
318
318
|
export const customizablePaleGray = 'var(--k-color-customizable-pale-gray, #e4e4e4)';
|
|
319
|
-
export const customizablePaleGreen = 'var(--k-color-customizable-pale-green, #
|
|
320
|
-
export const customizablePaleMint = 'var(--k-color-customizable-pale-mint, #
|
|
319
|
+
export const customizablePaleGreen = 'var(--k-color-customizable-pale-green, #c3f3ca)';
|
|
320
|
+
export const customizablePaleMint = 'var(--k-color-customizable-pale-mint, #adf5e9)';
|
|
321
321
|
export const customizablePaleOrange = 'var(--k-color-customizable-pale-orange, #ffddc6)';
|
|
322
322
|
export const customizablePalePurple = 'var(--k-color-customizable-pale-purple, #fbd6ff)';
|
|
323
323
|
export const customizablePaleRed = 'var(--k-color-customizable-pale-red, #ffdadd)';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LOGO_LIGHTNESS_MIN = 64;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var LOGO_LIGHTNESS_MIN = 64;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ColorFormat } from './utils/convert-color.js';
|
|
2
|
+
import * as DEFAULT_SWATCH from './consts/default-swatch.js';
|
|
3
|
+
import type { BaseTokens } from './types/tokens-base.js';
|
|
4
|
+
type PresetOrCustom<T extends string> = T | (string & Record<never, never>);
|
|
5
|
+
export interface ConfigOptions {
|
|
6
|
+
brand: PresetOrCustom<keyof typeof DEFAULT_SWATCH.brand>;
|
|
7
|
+
accent: PresetOrCustom<'brand' | 'gray'>;
|
|
8
|
+
system?: typeof DEFAULT_SWATCH.system;
|
|
9
|
+
format?: ColorFormat;
|
|
10
|
+
}
|
|
11
|
+
export declare function getColorsBase({ brand, accent, system, format }: ConfigOptions): BaseTokens;
|
|
12
|
+
export {};
|