UNPKG

@coko/client

Version:

Client side common code for coko apps

32 lines (31 loc) 2.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = void 0; var _styledComponents = require("styled-components"); var _toolkit = require("../../toolkit"); var _templateObject, _templateObject2, _templateObject3, _templateObject4; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } var borderColor = function borderColor(props) { return props.color ? props.color : props.colorPrimary; }; var outline = (0, _styledComponents.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: ", " ", " ", ";\n padding: ", ";\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n border: ", " ", " ", ";\n }\n"])), (0, _toolkit.th)('borderWidth'), (0, _toolkit.th)('borderStyle'), borderColor, function (props) { return props.size === 'small' ? '0' : props.theme.gridUnit; }, (0, _toolkit.th)('borderWidth'), (0, _toolkit.th)('borderStyle'), borderColor); var ghost = (0, _styledComponents.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: ", ";\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n background-color: ", ";\n }\n"])), function (props) { return props.size === 'small' ? '0' : props.theme.gridUnit; }, (0, _toolkit.th)('colorSecondary')); var secondary = (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: none;\n border: none;\n color: ", ";\n padding: 0;\n text-decoration: underline;\n\n &:hover,\n &:focus,\n &:active {\n background: none;\n border: none;\n color: ", ";\n outline: none;\n }\n\n &[disabled] {\n color: ", ";\n\n &:hover {\n background: none;\n }\n }\n"])), function (props) { return props.color ? props.color : props.theme.colorPrimary; }, function (props) { return props.color ? (0, _toolkit.darken)(props.color, 0.3) : (0, _toolkit.darken)(props.theme.colorPrimary, 0.3); }, (0, _toolkit.th)('colorTextPlaceholder')); var _default = (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n line-height: calc(", " * 4);\n min-width: calc(", " * 16);\n text-transform: uppercase;\n\n /* stylelint-disable-next-line order/properties-alphabetical-order */\n ", ";\n ", ";\n ", ";\n"])), (0, _toolkit.th)('gridUnit'), (0, _toolkit.th)('gridUnit'), function (props) { return !props.primary && secondary; }, function (props) { return props.outline && outline; }, function (props) { return props.ghost && ghost; }); exports["default"] = _default;