Skip to content

Commit

Permalink
Merge branch 'dev' into feat/add-grid
Browse files Browse the repository at this point in the history
  • Loading branch information
gizeasy committed Mar 11, 2021
2 parents c27a6c2 + 3a4a177 commit ccace76
Show file tree
Hide file tree
Showing 72 changed files with 979 additions and 439 deletions.
7 changes: 3 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
* @gizeasy @c1n1k @dmitriykorsakovnedra @karpovfv-nedra @VladislavYukhimenko @azhadanov
*.md @miocene @fooontic @kolebayev @arhayka
*.mdx @miocene @fooontic @kolebayev @arhayka
*.css @miocene @fooontic @kolebayev
* @gizeasy @c1n1k @dmitriykorsakovnedra @karpovfv-nedra @VladislavYukhimenko @azhadanov @kolebayev
*.md @arhayka
*.mdx @arhayka
60 changes: 27 additions & 33 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Changelog

## v1.11.7 (10/03/2021)

- [refactor(Tabs): removed casting to types and more fix (#958)](https://github.com/gazprom-neft/consta-uikit/commit/82949196c2ecdfd51242257e8f15cf4d9e535119) - [@gizeasy](https://github.com/gizeasy)
- [chore(react-app-env): add mdx types (#974)](https://github.com/gazprom-neft/consta-uikit/commit/d35bafef3f78b877b6670b71666c5af681784e83) - [@azhadanov](https://github.com/azhadanov)
- [fix(TextField): fix cols and rows props (#957)](https://github.com/gazprom-neft/consta-uikit/commit/a6d1704eb791910319615dee3a9298aa78654231) - [@azhadanov](https://github.com/azhadanov)
- [fix(MultiCombobox): fix clear value function (#959)](https://github.com/gazprom-neft/consta-uikit/commit/64e428c16b1100c262c2db011f66fd7bc935d259) - [@azhadanov](https://github.com/azhadanov)
- [chore(Prettier): add commit-formatting for mdx files (#970)](https://github.com/gazprom-neft/consta-uikit/commit/cb013105d6304c849cc6154b1bf4cc1b5d99acd6) - [@azhadanov](https://github.com/azhadanov)
- [chore(deps): bump elliptic from 6.5.3 to 6.5.4 (#969)](https://github.com/gazprom-neft/consta-uikit/commit/a54a7c4d38f09e5ef319be01fd35f010fb35403d) - [@dependabot[bot]](https://github.com/dependabot[bot])
- [chore(CODEOWNERS): update (#960)](https://github.com/gazprom-neft/consta-uikit/commit/4af8e14ff9735804d2b3e67f8eae207086eadf2e) - [@gizeasy](https://github.com/gizeasy)

---

## v1.11.6 (03/03/2021)

- [docs(components): fix some links (#884)](https://github.com/gazprom-neft/consta-uikit/commit/5bb19e3be64943f8b50c9c3f1fb083ab03ac61c1) - [@azhadanov](https://github.com/azhadanov)
- [docs(Theme): add doc for creating custom preset (#856)](https://github.com/gazprom-neft/consta-uikit/commit/2c921381f4ce0a35fe07a09ccf4c104fa296ba5c) - [@kolebayev](https://github.com/kolebayev)

---

## v1.11.5 (24/02/2021)

- [docs(Responces): add docs and examples (#839)](https://github.com/gazprom-neft/consta-uikit/commit/82f36fbc17f853e742c288a6a13f4038d1e131d4) - [@arhayka](https://github.com/arhayka)
- [docs(Pagination): edit docs, add examples (#833)](https://github.com/gazprom-neft/consta-uikit/commit/b213ef1373e4f5e51ec5a16efad8e0f3660d3d52) - [@arhayka](https://github.com/arhayka)
- [fix(File): fixed loader color (#807)](https://github.com/gazprom-neft/consta-uikit/commit/23eaabd4c3d1f6e079e7f85b0479be0f67d4b91f) - [@azhadanov](https://github.com/azhadanov)

---

## v1.11.4 (10/02/2021)

- [fix(Checkbox): fixed centering and colors for intermediate (#786)](https://github.com/gazprom-neft/consta-uikit/commit/635b17eec094a7e0ba6acbb7cb27c4626f409ef5) - [@azhadanov](https://github.com/azhadanov)
Expand Down Expand Up @@ -345,36 +372,3 @@
- [feat(Icons): add IconDisconnection and IconRestart (#260)](https://github.com/gazprom-neft/consta-uikit/commit/b3ecce80e675c9fe61051a6a320cbdc29845d7b7) - @fooontic
- [chore(Travis): run unit tests (#249)](https://github.com/gazprom-neft/consta-uikit/commit/b79c6fe1cdd573eca4c935427271294095fcbd4e) - @nekitk
- [refactor(components): removed unused components (#247)](https://github.com/gazprom-neft/consta-uikit/commit/ba6e9cfbec116be8b410a4fa9f37236bc234ec81) - @nekitk

---

## v1.4.1 (15/07/2020)

docs(button): add new docs for button - @fooontic

---

## v1.4.0 (15/07/2020)

- [chore(prettier): svg formatting added (#238)](https://github.com/gazprom-neft/consta-uikit/commit/94acf37e93242e077fa26466dd6d7e9ee3a6ead3) - @gizeasy
- [fix(iconAlignRight): replace wrong svg](https://github.com/gazprom-neft/consta-uikit/commit/d1847af18bb549b26f648252299eeda035df282e) - @fooontic
- [feat(icons): add new icons IconUnsort](https://github.com/gazprom-neft/consta-uikit/commit/3850f96fb3ff3ebb09cdede46b440b026c35f003) - @fooontic
- [feat(Theme): add ref](https://github.com/gazprom-neft/consta-uikit/commit/468fbf14e72b380d71c02f3ad96abf32fb07d493) - @gizeasy
- [feat(components): add prop iconSize in ChoiceGroup, Tabs, TextField](https://github.com/gazprom-neft/consta-uikit/commit/424d4473802965ca81a7f199d40bbe1a27df20f3) - @gizeasy
- [chore(tslib): update -> 13.0.0](https://github.com/gazprom-neft/consta-uikit/commit/49076e34253833ac0ffde80e58caad7159279413) - @gizeasy
- [fix(TextField): fix color icons](https://github.com/gazprom-neft/consta-uikit/commit/c58e6cf37c01a007b7f3f58f286b48fd7dff8883) - @gizeasy
- [refactor(Icons): sort icons in storyBook](https://github.com/gazprom-neft/consta-uikit/commit/edce93906e6fbbfb409aac5af1cd2bcf32201db9) - @gizeasy
- [feat(SbackBar): add onAutoClose](https://github.com/gazprom-neft/consta-uikit/commit/e59ccd6e82ffbda8ee59077b96c782d2896654f5) - @gizeasy
- [fix(IconBag): fix color](https://github.com/gazprom-neft/consta-uikit/commit/a4663dd9f103ae0ddd4df9918711d45e978613c0) - @gizeasy
- [fix(ts-ignore): removed ts-ignore](https://github.com/gazprom-neft/consta-uikit/commit/05171bd666a831495222d26858bb750d5e8b20fb) - @gizeasy

---

## v1.3.0 (06/07/2020)

- [1.3.0](https://github.com/gazprom-neft/consta-uikit/commit/287d4b71f0a3db6bfa1b85294680c583fdcb36be) - @gizeasy
- [feat(IconSmile): add IconSmile](https://github.com/gazprom-neft/consta-uikit/commit/b6113cf598cff409ecbf525b9940ba44762a5726) - @gizeasy
- [feat(IconComment): add xs size](https://github.com/gazprom-neft/consta-uikit/commit/5239b4c3530d3662704a827175546cb5139af3c4) - @gizeasy
- [feat(components): children ban in components](https://github.com/gazprom-neft/consta-uikit/commit/ce94abb158a3cefc8303f0c85a3f65f9b766ab9a) - @gizeasy
- [refactor(icons): change iconHoc -> createIcon](https://github.com/gazprom-neft/consta-uikit/commit/56a650cd3f91fc4c06e4d6a7386d161ebcd5529a) - @gizeasy
- [refactor(icons): re-generate icons](https://github.com/gazprom-neft/consta-uikit/commit/d5be2773977be10fcc4d6e457fc54cc188308367) - @gizeasy
3 changes: 1 addition & 2 deletions builder/templates/Icons.stories.tsx.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { createMetadata } from '../../../utils/storybook';
#imports#

import { IconsItem } from './Item/Icons-Item';
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore

import mdx from './Icon.mdx';

const defaultKnobs = () => ({
Expand Down
112 changes: 112 additions & 0 deletions docs/common/developers/creatingPreset.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import { Meta } from '@storybook/addon-docs/blocks';

<Meta
title="Документация|Разработчикам/Как создать свой пресет"
id="сommon-develop-creatingPreset"
parameters={{ order: 331 }}
/>

# Как создать свой пресет

> Перед прочтением этого гайда рекомендуем ознакомиться с [документацией по компоненту Theme](https://consta-uikit.vercel.app/?path=/docs/components-theme--playground).
При работе с Consta в качестве установленной зависимости,
в вашем проекте необходимо создать директорию для новых пресетов.

Директория для пресетов должна содержать следующий набор папок и файлов
(такой же, как в компоненте Theme):

```
pathToPresets/
_color/
_Theme_color_myThemeDark.css
_Theme_color_myThemeDefault.css
_Theme_color_myThemeDisplay.css
_control/
_Theme_control_myThemeDefault.css
_font/
_Theme_font_myThemeDefault.css
_size/
_Theme_size_myThemeDefault.css
_space/
_Theme_space_myThemeDefault.css
myPresetDefault.js
```

Создание нового пресета подразумевает ручную настройку переменных CSS (также их принято называть _дизайн токенами_), составляющих темы.

> Все переменные имеют семантические имена, так их проще контролировать и применять.
## Тема на цвет `_color`

Цветовая тема: набор переменных, которые применяются к разным частям компонентов Consta. Значения применяемых переменных получаются путем наследования значений от базовых `base` цветовых переменных.
Первым делом необходимо определиться с базовыми переменными и записать их в CSS-файл на цвет в папке `_color`.
Значения переменных внутри CSS-класса рассчитываются с помощью [postcss-color-function](https://github.com/postcss/postcss-color-function)
и [postcss-simple-vars](https://github.com/postcss/postcss-simple-vars). **Но цвета можно подобрать и вручную.**

Всегда желательно создавать минимум две темы: `default` — светлая и `dark` — темная, потому что некоторые
компоненты используют инверсные цвета (например [Tooltip](https://consta-uikit.vercel.app/?path=/docs/components-tooltip--tooltip-positioned-by-anchor-story)).

## Тема на контролы `_control`

Здесь описаны размеры контролов, внутренние отступы и размеры текста внутри контролов.
Все значения наследуются из темы на отступы `_space`, о ней ниже.

## Тема на шрифт `_font`

Здесь подключаются все начертания/насыщенности/жирности шрифта. Убедитесь, что в шрифте есть насыщенность, которую вы используете.
Браузер имитирует насыщенность, которой нет в наборе, но неизвестно, как это будет выглядеть.

> Ознакомьтесь [со списком значений weight по умолчанию](https://consta-uikit.vercel.app/?path=/docs/components-text--playground#%D0%BD%D0%B0%D1%81%D1%8B%D1%89%D0%B5%D0%BD%D0%BD%D0%BE%D1%81%D1%82%D1%8C) для компонента Text.
Обратите внимание, что для каждого уникального шрифта в проекте необходимо использовать свою тему `font`.

## Тема на размеры шрифта `_size`

Содержит сетку размеров шрифта и межстрочных интервалов. Значения используются в компоненте Text и всех текстовых
элементах компонентов.

## Тема на отступы `_space`

Содержит сетку отступов.

## Создание файла пресета

В самом файле пресета `myPresetDefault.js` необходимо прописать импорты всех новых CSS-файлов. И экспортировать
объект со значениями ключей, которые совпадают с постфиксами из названия CSS-файлов.

```js
import './_color/Theme_color_myThemeDefault.css';
import './_color/Theme_color_myThemeDark.css';
import './_control/Theme_control_myThemeDefault.css';
import './_font/Theme_font_myThemeDefault.css';
import './_size/Theme_size_myThemeDefault.css';
import './_space/Theme_space_myThemeDefault.css';

export const myNewPreset = {
color: {
primary: 'myThemeDefault',
accent: 'myThemeDark',
invert: 'myThemeDark',
},
control: 'myThemeDefault',
font: 'myThemeDefault',
size: 'myThemeDefault',
space: 'myThemeDefault',
};
```

Для проверки значений нужно подключить пресет в провайдер темы.

```ts
import React from 'react';

import { Theme } from '@consta/uikit/Theme';
import { myNewPreset } from 'pathToPresets/myPresetDefault';

const App = () => {
return <Theme preset={myNewPreset}>your app code</Theme>;
};

export default App;
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@consta/uikit",
"version": "1.11.4",
"version": "1.11.7",
"keywords": [
"ui-kit",
"design-system",
Expand Down Expand Up @@ -63,7 +63,7 @@
"stylelint --fix",
"git add"
],
"*.{json,md}": [
"*.{json,md,mdx}": [
"prettier --write",
"git add"
],
Expand Down
2 changes: 0 additions & 2 deletions src/components/Attach/__stories__/Attach.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { cn } from '../../../utils/bem';
import { createMetadata } from '../../../utils/storybook';
import { Attach } from '../Attach';

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import mdx from './Attach.mdx';

const defaultKnobs = () => ({
Expand Down
2 changes: 0 additions & 2 deletions src/components/Avatar/__stories__/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
avatarPropSizeDefault,
} from '../Avatar';

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import mdx from './Avatar.mdx';

const defaultKnobs = () => ({
Expand Down
2 changes: 0 additions & 2 deletions src/components/Badge/__stories__/Badge.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
badgePropViewDefault,
} from '../Badge';

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import mdx from './Badge.mdx';

const defaultKnobs = () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {
} from '../../SelectComponents/types';
import { BasicSelect } from '../BasicSelect';

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import mdx from './BasicSelect.mdx';

type SelectOption = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { cn } from '../../../utils/bem';
import { createMetadata } from '../../../utils/storybook';
import { breadcrumbPropSize, breadcrumbPropSizeDefault, Breadcrumbs } from '../Breadcrumbs';

// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
import mdx from './Breadcrumbs.mdx';

const defaultKnobs = () => ({
Expand Down

0 comments on commit ccace76

Please sign in to comment.