Skip to content

Commit

Permalink
feat(button): design review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SiebenSieben committed Nov 24, 2020
1 parent 4bfe364 commit e8f5faf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"dependencies": {
"@alfalab/data": "^0.2.0",
"@alfalab/hooks": "^1.0.0",
"@alfalab/icons-classic": "^1.7.0",
"@alfalab/icons-classic": "^1.33.0",
"@alfalab/icons-flag": "^1.3.0",
"@alfalab/icons-glyph": "^1.26.0",
"@alfalab/icons-glyph": "^1.70.0",
"@alfalab/icons-logotype": "^1.4.0",
"@alfalab/utils": "^0.5.0",
"@popperjs/core": "^2.3.3",
Expand Down
29 changes: 16 additions & 13 deletions packages/button/src/Component.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { action } from '@storybook/addon-actions';
import { text, select, boolean } from '@storybook/addon-knobs';
import { Container, Row, Col } from 'storybook/blocks/grid';
import { ComponentHeader } from 'storybook/blocks/component-header';
import Icon from '@alfalab/icons-glyph/StarMIcon';
import IconM from '@alfalab/icons-glyph/StarMIcon';
import IconS from '@alfalab/icons-glyph/FlashCircleSIcon';

import { Button } from './Component';
import { name, version } from '../package.json';
Expand Down Expand Up @@ -224,14 +225,22 @@ import { Button } from '@alfalab/core-components-button';

<Preview>
<Container>
<Row align="middle">
<Row>
<Col>
<Button leftAddons={<Icon/>} rightAddons={<Icon/>}>
<Button leftAddons={<IconM/>} rightAddons={<IconM/>}>
Кнопка
</Button>
</Col>
<Col>
<Button rightAddons={<Icon/>} view="outlined"/>
<Button rightAddons={<IconM/>} view="outlined"/>
</Col>
<Col>
<Button size="xs" leftAddons={<IconS/>}>
Кнопка
</Button>
</Col>
<Col>
<Button size="xs" rightAddons={<IconS/>} view="outlined"/>
</Col>
</Row>
</Container>
Expand Down Expand Up @@ -277,26 +286,20 @@ import { Button } from '@alfalab/core-components-button';

## Перенос текста

С помощью пропса `nowrap` можно запретить переносить текст кнопки
С помощью свойства `nowrap` можно запретить перенос строки в кнопке.
<Preview>
<div style={{ width: '240px' }}>
<Row align="middle">
<Col>
<Button rightAddons={<Icon/>} view="primary" nowrap={true}>
<Button view="secondary" nowrap={true}>
Кнопка без переноса текста
</Button>
</Col>
<Col>
<Button leftAddons={<Icon/>} />
</Col>
<Col>
<Button rightAddons={<Icon/>} view="outlined"/>
</Col>
<Col>
<Button view="ghost">
Кнопка с переносом текста
</Button>
</Col>
</Row>
</div>
</Preview>
</Preview>
4 changes: 2 additions & 2 deletions packages/button/src/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
--button-ghost-disabled-color: color-mod(var(--button-ghost-base-color) alpha(30%));

/* font */
--button-font-weight: 500;
--button-font-family: var(--font-family);

/* radius */
Expand All @@ -40,7 +39,7 @@
margin: 0;
padding: 0 var(--gap-xl);
line-height: 1.2;
font-weight: var(--button-font-weight);
font-weight: 500;
font-family: var(--font-family);
text-align: center;
text-decoration: none;
Expand Down Expand Up @@ -79,6 +78,7 @@ a.loading {
min-height: 32px;
padding: 0 var(--gap-m);
font-size: 14px;
font-weight: 400;

&.iconOnly {
min-width: 32px;
Expand Down

0 comments on commit e8f5faf

Please sign in to comment.