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