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

102 lines 3.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var typestyle_1 = require("typestyle"); var csx_1 = require("csx"); var utils_1 = require("../../../Common/theming/utils"); exports.convertDurationFromMsToSecond = function (duration) { return duration && duration / 1000; }; exports.getIntentColor = function (intent, theme) { return ({ fg: theme.colorMap[intent + "Dark"] || theme.colorMap.darkGray5, bg: theme.colorMap[intent + "Light"] || theme.colorMap.white3 }); }; exports.getIntentStyle = function (intent, theme) { var intentColors = exports.getIntentColor(intent, theme); return typestyle_1.style({ color: intentColors.fg, backgroundColor: intentColors.bg, $nest: { '& p, & .up-toast-title': { color: intentColors.fg, backgroundColor: intentColors.bg }, '& .up-toast-close .colored svg, & .up-toast-close .colored svg path, & .up-toast-close .colored svg polygon, & .up-toast-close .colored svg polyline': { fill: intentColors.fg } } }); }; exports.getHoverColor = function (hexaColor) { return csx_1.color(hexaColor).darken('10%').toHexString(); }; exports.toastTitleStyle = typestyle_1.style({ $nest: { '&.up-toast-title': { padding: utils_1.toRem(6), borderTopLeftRadius: '6px', borderTopRightRadius: '6px', width: '100%', margin: utils_1.toRem(0) + " " + utils_1.toRem(0) + " " + utils_1.toRem(10) + " " + utils_1.toRem(0), textAlign: 'left' } } }); exports.buttonStyle = typestyle_1.style({ fontFamily: 'materialinear', backgroundColor: 'transparent', border: '0px', cursor: 'pointer', fontSize: utils_1.toRem(32), position: 'absolute', top: utils_1.toRem(-4), right: utils_1.toRem(4) }); exports.wrapperToastCss = { position: 'fixed', fontSize: utils_1.toRem(16), bottom: utils_1.toRem(10), right: utils_1.toRem(30), borderRadius: '6px', zIndex: 999999, display: 'flex', boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)', textAlign: 'center', padding: '0', width: utils_1.toRem(350), height: 'auto', flexDirection: 'column', $nest: { '& .up-toast-body': { padding: 0 }, '& .up-toast-message': { border: 0, marginBottom: 0 }, '& .up-toast-message p': { margin: utils_1.toRem(6) }, '& .up-toast-title': { marginBottom: 0 } } }; exports.unmount = typestyle_1.keyframes({ '0%': { transform: 'translateX(0%)', opacity: 1 }, '100%': { transform: 'translateX(50%)', opacity: 0 } }); exports.mount = typestyle_1.keyframes({ '0%': { transform: 'translateX(50%)', opacity: 0 }, '100%': { transform: 'translateX(0%)', opacity: 1 } }); exports.wrapperToastStyle = function (isUnmounting) { return typestyle_1.style(tslib_1.__assign(tslib_1.__assign({}, exports.wrapperToastCss), { animationName: isUnmounting ? exports.unmount : exports.mount, animationDuration: '1.5s' })); }; //# sourceMappingURL=styles.js.map