1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-15 07:40:07 +02:00
copilot/packages/ui-toolkit/src/form/radio.js
2017-06-15 17:11:40 +01:00

41 lines
739 B
JavaScript

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;
`;
const RadioItem = BaseInput(({ children, id, ...rest }) =>
<Li {...rest}>
{children}
</Li>
);
const Radio = Baseline(
BaseToggle({
container: RadioItem,
type: 'radio'
})
);
/**
* @example ./usage-radio.md
*/
export default ({ children, ...rest }) =>
<Radio {...rest}>
{children}
</Radio>;
export const RadioList = Baseline(Ul);