UNPKG

@arche-mc2/arche-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

71 lines 4.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var UpNotification_1 = require("./UpNotification"); var stories_1 = require("../../../Common/stories"); var addon_knobs_1 = require("@storybook/addon-knobs"); var LoadingIndicator_1 = require("../LoadingIndicator"); var typestyle_1 = require("typestyle"); var Box_1 = require("../../Containers/Box"); var Ligne_1 = require("../../Display/Ligne"); var __1 = require("../../.."); exports.default = { title: 'Components/Display/UpNotification', decorators: [addon_knobs_1.withKnobs, stories_1.getRootContainer('UpNotification')], component: UpNotification_1.UpNotification }; var wrapperBoxesStyle = typestyle_1.style({ $nest: { '& > div': { margin: '10px 0px', }, }, }); var useShowButton = function () { var _a = React.useState(0), key = _a[0], setKey = _a[1]; var Button = (React.createElement(__1.UpButton, { intent: 'primary', onClick: function () { return setKey(key + 1); } }, "Show Notification")); return [key, Button]; }; exports.General = function () { return (React.createElement(Box_1.default, { alignItems: 'normal', className: wrapperBoxesStyle }, React.createElement(UpNotification_1.default, { intent: 'warning', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Votre connexion se termine dans 10 minutes !")), React.createElement(UpNotification_1.default, { intent: 'success', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Votre op\u00E9ration a \u00E9t\u00E9 enregistr\u00E9 avec succ\u00E8s !")), React.createElement(UpNotification_1.default, { intent: 'danger', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Une erreur est survenue dans le traitement de votre demande !")), React.createElement(UpNotification_1.default, { intent: 'error', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Une erreur est survenue dans le traitement de votre demande !")), React.createElement(UpNotification_1.default, { intent: 'default', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Bonjour !")), React.createElement(UpNotification_1.default, { intent: 'light', iconSize: 25 }, React.createElement(Ligne_1.default, null, "Hello !")), React.createElement(UpNotification_1.default, { intent: 'info', iconSize: 25 }, React.createElement(LoadingIndicator_1.default, { isLoading: true, displayMode: 'inline' })))); }; exports.DismissableNotification = function () { return (React.createElement(UpNotification_1.default, { iconSize: 25, intent: 'primary', dismissable: true, onCloseClick: function () { return alert('icon Clicked, Notification is closing'); } }, React.createElement(Ligne_1.default, null, "Votre op\u00E9ration a \u00E9t\u00E9 enregistr\u00E9 avec succ\u00E8s !"))); }; exports.AutoDismissableNotification = function () { var _a = useShowButton(), key = _a[0], Button = _a[1]; return (React.createElement(React.Fragment, null, Button, React.createElement(UpNotification_1.default, { key: key, intent: 'success', dismissable: true, durationBeforeClosing: 8, className: typestyle_1.style({ marginTop: '20px' }) }, React.createElement(Ligne_1.default, null, "Votre op\u00E9ration a \u00E9t\u00E9 enregistr\u00E9 avec succ\u00E8s !")))); }; exports.WithTitle = function () { return (React.createElement(UpNotification_1.default, { intent: 'warning', title: 'UpNotification Title', className: typestyle_1.style({ $nest: { '& h2': { color: '#fff' } } }) }, React.createElement(Ligne_1.default, null, "Votre op\u00E9ration a \u00E9t\u00E9 enregistr\u00E9 avec succ\u00E8s !"))); }; exports.WithBigIcon = function () { return (React.createElement(UpNotification_1.default, { intent: 'success', iconSize: 40 }, React.createElement(Ligne_1.default, null, "Votre op\u00E9ration a \u00E9t\u00E9 enregistr\u00E9 avec succ\u00E8s !"))); }; exports.ShowInModal = function () { return (React.createElement(UpNotification_1.default, { title: 'Erreur', displayMode: 'modal', intent: 'danger' }, React.createElement("p", null, "Un probl\u00E8me est survenu !!"))); }; exports.ShowInModal.decorators = [function (ShowInModal) { return (React.createElement("div", { style: { height: '250px' } }, React.createElement(ShowInModal, null))); }]; exports.ShowInText = function () { return (React.createElement(UpNotification_1.default, { displayMode: 'text', intent: 'danger' }, React.createElement(Ligne_1.default, null, "Un probl\u00E8me est survenu !!"))); }; //# sourceMappingURL=index.stories.js.map