Skip to content

Commit

Permalink
feat(radio): fullWidth -> block
Browse files Browse the repository at this point in the history
  • Loading branch information
redzumi committed Jan 13, 2021
1 parent 7e8103a commit 97e0cf6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/radio/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@alfalab/core-components-radio",
"version": "1.5.0",
"version": "1.4.0",
"description": "Radio component",
"keywords": [],
"license": "ISC",
Expand Down
4 changes: 2 additions & 2 deletions packages/radio/src/Component.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { name, version } from '../package.json';
const handleChange = () => setChecked(!checked);
const size = select('size', ['s', 'm'], 's');
const disabled = boolean('disabled', false);
const fullWidth = boolean('fullWidth', false);
const block = boolean('block', false);
const label = text('label', 'Text label')
const hint = text('hint', 'Hint');
const align = select('align', ['start', 'end', 'center'], 'start');
Expand All @@ -29,7 +29,7 @@ import { name, version } from '../package.json';
<Radio
disabled={disabled}
addons={addons}
fullWidth={fullWidth}
block={block}
size={size}
align={align}
onChange={handleChange}
Expand Down
8 changes: 4 additions & 4 deletions packages/radio/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ export type RadioProps = Omit<
/**
* Дополнительный слот
*/
addons?: React.ReactNode | string;
addons?: React.ReactNode;

/**
* Растягивать ли компонент на всю ширину
*/
fullWidth?: boolean;
block?: boolean;

/**
* Обработчик на выбор элемента
Expand Down Expand Up @@ -93,7 +93,7 @@ export const Radio = forwardRef<HTMLLabelElement, RadioProps>(
size = 's',
align = 'start',
addons,
fullWidth,
block,
...restProps
},
ref,
Expand All @@ -115,7 +115,7 @@ export const Radio = forwardRef<HTMLLabelElement, RadioProps>(
[styles.disabled]: disabled,
[styles.checked]: checked,
[styles.focused]: focused,
[styles.fullWidth]: fullWidth,
[styles.block]: block,
})}
ref={mergeRefs([labelRef, ref])}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/radio/src/index.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
line-height: 24px;
}

.fullWidth {
.block {
width: 100%;
}

Expand Down

0 comments on commit 97e0cf6

Please sign in to comment.