@up-group/react-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
52 lines • 2.41 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var react_1 = require("@storybook/react");
var theming_1 = require("../../../Common/theming");
var themedComponents_1 = require("../../../Common/theming/themedComponents");
var UpCheckBox_1 = require("./UpCheckBox");
var Label_1 = require("../../Display/Label");
var onOptionChange = function () { };
var state = {
activation: false,
majeur: false,
homme: true,
grand: false,
couleur: "red",
selection: null
};
var onActivationChange = function () {
state.activation = !state.activation;
};
react_1.storiesOf('UpCheckbox', module)
.addWithInfo('Simple usage', 'Utilisation avec plusieurs options', function () { return (React.createElement(themedComponents_1.ThemeProvider, { theme: theming_1.default },
React.createElement(Label_1.default, { textAlign: "left", inline: true, width: "medium", text: "Activation de ... :" },
React.createElement(UpCheckBox_1.default, { options: [{
text: "",
name: "Option1",
onChange: onActivationChange,
value: true,
checked: state.activation === true
}] })))); })
.addWithInfo('Multiple usage', 'Utilisation avec plusieurs options', function () { return (React.createElement(themedComponents_1.ThemeProvider, { theme: theming_1.default },
React.createElement(Label_1.default, { inline: true, width: "small", text: "Choix :" },
React.createElement(UpCheckBox_1.default, { options: [{
text: "Vous êtes majeur ?",
name: "Option1",
onChange: onOptionChange,
value: true,
checked: state.majeur === true
}, {
text: "Vous êtes Homme ?",
name: "Option2",
onChange: onOptionChange,
value: true,
checked: state.homme === true
}, {
text: "Vous êtes grand ?",
name: "Option3",
onChange: onOptionChange,
value: true,
checked: state.grand === true
}] })))); });
//# sourceMappingURL=index.stories.js.map