lucid-ui
Version:
A UI component library from AppNexus.
57 lines (56 loc) • 2.54 kB
JavaScript
import React from 'react';
import createClass from 'create-react-class';
import { RadioButtonLabeled } from '../../../index';
const style = {
marginBottom: '3px',
};
export default createClass({
getInitialState() {
return {
flavor: 'vanilla',
};
},
handleSelectedChocolate() {
this.setState({
flavor: 'chocolate',
});
},
handleSelectedCaramel() {
this.setState({
flavor: 'saltedCaramel',
});
},
handleSelectedMint() {
this.setState({
flavor: 'mintChip',
});
},
handleSelectedStrawberry() {
this.setState({
flavor: 'strawberry',
});
},
handleSelectedVanilla() {
this.setState({
flavor: 'vanilla',
});
},
render() {
return (React.createElement("section", null,
React.createElement("span", { style: {
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'flex-start',
} },
React.createElement(RadioButtonLabeled, { isSelected: this.state.flavor === 'vanilla', name: 'interactive-radio-buttons', onSelect: this.handleSelectedVanilla, style: style },
React.createElement(RadioButtonLabeled.Label, null, "Vanilla")),
React.createElement(RadioButtonLabeled, { isSelected: this.state.flavor === 'chocolate', name: 'interactive-radio-buttons', onSelect: this.handleSelectedChocolate, style: style },
React.createElement(RadioButtonLabeled.Label, null, "Chocolate")),
React.createElement(RadioButtonLabeled, { isSelected: this.state.flavor === 'strawberry', name: 'interactive-radio-buttons', onSelect: this.handleSelectedStrawberry, style: style },
React.createElement(RadioButtonLabeled.Label, null, "Strawberry")),
React.createElement(RadioButtonLabeled, { isSelected: this.state.flavor === 'saltedCaramel', name: 'interactive-radio-buttons', onSelect: this.handleSelectedCaramel, style: style },
React.createElement(RadioButtonLabeled.Label, null, "Salted caramel")),
React.createElement(RadioButtonLabeled, { isSelected: this.state.flavor === 'mintChip', name: 'interactive-radio-buttons', onSelect: this.handleSelectedMint, style: style },
React.createElement(RadioButtonLabeled.Label, null, "Mint choc chip (the best)")))));
},
});