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

63 lines 2.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var typestyle_1 = require("typestyle"); var utils_1 = require("../../../Common/utils"); var utils_2 = require("../../../Common/theming/utils"); var fillColor = function (props) { var color; if (!props.touched) color = props.theme.colorMap.default; if (!!props.value) color = props.theme.colorMap.success; if (props.showError && props.hasError) color = props.theme.colorMap.error; return color; }; exports.onSide = typestyle_1.style({ display: 'flex' }); exports.getStyles = function (props) { return typestyle_1.style({ $nest: { "&.up-password": { position: "relative", }, "&.up-password .up-icon-wrapper": { position: 'absolute', top: props.floatingLabel ? 18 : 4, right: 0, cursor: "pointer", zIndex: 10, }, "&.up-password .up-icon-wrapper svg, &.up-password .up-icon-wrapper svg polygon, &.up-password .up-icon-wrapper svg path, &.up-password .up-icon-wrapper svg polyline": { fill: fillColor(props) + " !important", }, "&.up-password .up-wrapper-error-tooltip": { display: 'none', background: 'transparent' } } }); }; exports.getRulesStyle = function (props) { return typestyle_1.style({ display: 'block', zIndex: 1000, width: '100%', border: "0 1px 1px solid " + props.theme.colorMap.lightGrey1, borderTop: 'unset', boxShadow: '0 0 5px 0 rgba(0,0,0,0.11)', fontSize: utils_2.toRem(12), color: '#4E5B59', lineHeight: 1.5, fontWeight: 400, marginTop: utils_2.toRem(0.5) }); }; exports.getRuleStatus = function (props, regex) { return typestyle_1.style({ height: '8px', width: '8px', backgroundColor: "" + (utils_1.ruleIsValid(props.value, regex) ? props.theme.colorMap.success : props.theme.colorMap.lightGrey1), borderRadius: '50%', display: 'inline-block', margin: utils_2.toRem(0) + " " + utils_2.toRem(10), }); }; //# sourceMappingURL=styles.js.map