Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRNT-532, FRNT-532] Implement box model, rewrite ButtonIcon and Chip #109

Merged
merged 2 commits into from
May 7, 2021

Conversation

tatinacher
Copy link
Member

Implement box model, rewrite ButtonIcon and Chip

[FRNT-435, FRNT-532]

@tatinacher tatinacher added the @atoms Changes inside atoms label May 6, 2021
@tatinacher tatinacher force-pushed the feat/FRNT-532-implement-box-model branch from e5af3fe to 66f5b5e Compare May 6, 2021 09:45
@tatinacher tatinacher marked this pull request as draft May 6, 2021 10:54
@tatinacher tatinacher force-pushed the feat/FRNT-532-implement-box-model branch from 66f5b5e to 857c804 Compare May 6, 2021 11:41
@tatinacher tatinacher marked this pull request as ready for review May 6, 2021 11:41
--local-padding: calc(1px * var(--woly-component-level) * var(--woly-main-level));
--local-icon-size: calc(var(--woly-line-height));
--local-button-size: calc(var(--local-icon-size) + (var(--local-vertical) * 2));
--local-icon-color: var(--woly-shape-default);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

на макете цвета иконок черные и в primary, и в secondary
Снимок экрана 2021-05-06 в 16 26 57

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

цвета не меняла, ток у Chip чуть поправила чтоб его видно было и удобно было смотреть, но пока не как в макетах, задачи такой не стояло

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а есть смысл заводить задачу только на то, чтобы 1 переменную для цвета поменять?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

по идее надо две задачи, для чипа проверить все цвета для вариантов и для иконок. плюс из такого что щас вижу - у иконок еще появилась подложка с прозрачностью.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ты просто в этой таске уже начала рефакторить цвета иконки, тут тогда не надо было совсем этого делать


interface ChipProps {
action?: React.ReactNode;
children?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-06 в 16 32 45

при клике на иконку у chip состояние active отображается всегда только для блока, iconButton никак не меняется

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в этой ветке смотрим box-model, состояния как в макетах я не делала


interface ChipProps {
action?: React.ReactNode;
children?: string;
className?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-06 в 16 36 14

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ага, надо поправить, но в отдельной задаче по правке состояний чипа


interface ChipProps {
action?: React.ReactNode;
children?: string;
className?: string;
disabled?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-06 в 16 44 28

иконка залезает на слова

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да, для нулевого размера пока не знаю как cделать, в формулах gap = 0 и изза этого outline который выходит за ButtonIcon перекрывает текст

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут нет outline у icon, это подсвечивается сам chip, icon-button никак не меняется

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут дело не в icon-button, а в формуле компенсации для текста, у тебя текст может быть любой длины, при этом, иконка не должна залезать на него. Плюс у тебя сама иконка меньше по размерам, чем высота chip, а так не должно быть, по высоте они должны быть одинаковыми

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а я тут вижу что иконка в фокусе 👀

Copy link
Member Author

@tatinacher tatinacher May 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут надо обсудить уже подробнее и мб с дизайнерами, потому что пока что реализовано, что если фокус на иконку то вся плашка чипа тоже в фокусе, и вроде с Димой Марисоным обсуждали это и он говорил что это ок.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можем втроем поглядеть, чтобы никому обидно не было ))

children?: string;
className?: string;
disabled?: boolean;
icon?: React.ReactNode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-06 в 16 48 35

у тебя chip размера xs, то есть он должен быть по размеру как иконка === 24px, и в примере, где есть иконка она должна быть вплотную с границами chip, а вылезать за пределы должна только box-shadow => т.е. нужно вычесть ширину border, иначе он не будет соответствовать размерам icon-button и не будет вмещаться в input, к примеру

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для XS размер 30, это у размера N - 24px.
бордеры учта и правила, погляди точно свежая версия ветки

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-07 в 13 08 45

а, ок, думала, что размер xs самый мелкий. Но вот размер N и по размерам он равен 24px, ветку подтянула.

children?: string;
className?: string;
disabled?: boolean;
icon?: React.ReactNode;
onActionClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-06 в 16 53 14

вот скрин с макета

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

в чем вопрос?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это скрин к комменту выше

children?: string;
className?: string;
disabled?: boolean;
icon?: React.ReactNode;
onActionClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Снимок экрана 2021-05-07 в 12 53 08

chip зазмера s у тебя по высоте 36px, а должен быть 30 px по макету: высота шрифта и иконки 24px + 6px - отступ

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В нашей модели N = 24, XS = 30, S = 36, и тп

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ок ) выше написала коммент )

children,
className,
disabled,
icon,
onActionClick,
leftIcon,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем снова переименовывать иконки?

Оно так называлось, потому что иконки имели разную принадлежность. Это не просто иконка слева и справа. Это иконка чипа и иконка действия. Если вдруг добавим rtl получится криво, что leftIcon внезапно начнет отображаться справа.

Мне кажется, лучше переименовать обратно, или в chipIcon, actionIcon

@@ -6,6 +6,11 @@ export const Global = styled.div`
font-family: 'Helvetica Neue', sans-serif;
}

button {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тот же комментарий что и в https://github.com/woly-ui/woly/pull/110/files#r628142059

@@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Почему close? Если это крестик, то ни для чего другого его нельзя использовать? Например, для удаления.

@@ -22,24 +23,38 @@ const ButtonIconBase: React.FC<Props & Variant> = ({
);

export const ButtonIcon = styled(ButtonIconBase)`
${box}
--local-vertical: calc(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Может унести local-vertical внутрь box?

--local-icon-size: var(--woly-line-height);
--local-icon-color: var(--woly-canvas-text-default);
--local-padding: calc(1px * var(--woly-component-level) * var(--woly-main-level));
--local-icon-size: calc(var(--woly-line-height));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а зачем тут calc?

</div>
{rightIcon && <div data-icon>{rightIcon}</div>}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sergeysova sergeysova merged commit 7adcecc into master May 7, 2021
@sergeysova sergeysova deleted the feat/FRNT-532-implement-box-model branch May 7, 2021 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@atoms Changes inside atoms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants