2017-05-18 21:21:33 +03:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import BaseToggle from './base/toggle';
|
|
|
|
import Baseline from '../baseline';
|
|
|
|
import BaseInput from './base/input';
|
|
|
|
import typography from '../typography';
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
const Li = styled.li`
|
|
|
|
list-style-type: none;
|
|
|
|
${typography.fontFamily};
|
|
|
|
${typography.normal};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Ul = styled.ul`
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
`;
|
|
|
|
|
2017-06-12 01:58:22 +03:00
|
|
|
const RadioItem = BaseInput(({ children, id, ...rest }) =>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Li {...rest}>
|
|
|
|
{children}
|
|
|
|
</Li>
|
2017-06-12 01:58:22 +03:00
|
|
|
);
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
const Radio = Baseline(
|
|
|
|
BaseToggle({
|
|
|
|
container: RadioItem,
|
|
|
|
type: 'radio'
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @example ./usage-radio.md
|
|
|
|
*/
|
2017-06-12 01:58:22 +03:00
|
|
|
export default ({ children, ...rest }) =>
|
2017-05-18 21:21:33 +03:00
|
|
|
<Radio {...rest}>
|
|
|
|
{children}
|
2017-06-12 01:58:22 +03:00
|
|
|
</Radio>;
|
2017-05-18 21:21:33 +03:00
|
|
|
|
|
|
|
export const RadioList = Baseline(Ul);
|