UNPKG

kwikid-components-react

Version:

KwikID's Component Library in React

134 lines (124 loc) 5.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KwikUIStyleInputSelectWrapper = exports.KwikUIStyleInputSelectMessagesContainer = exports.KwikUIStyleInputSelectLabel = exports.KwikUIStyleInputSelectItemLabelContainer = exports.KwikUIStyleInputSelectItemLabel = exports.KwikUIStyleInputSelectItemContainer = exports.KwikUIStyleInputSelectContainer = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _Input = require("../../../../shared/styles/Input.style"); var _InputSelect = require("./InputSelect.definition"); function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } const KwikUIStyleInputSelectWrapper = exports.KwikUIStyleInputSelectWrapper = _styledComponents.default.div` display: flex; flex-direction: column; align-content: flex-start; justify-content: flex-start; align-items: flex-start; & > *:not(:last-child) { margin-bottom: 0.5rem; } `; const KwikUIStyleInputSelectLabel = exports.KwikUIStyleInputSelectLabel = _styledComponents.default.label` ${_Input.KwikUIStyleInputLabel} position: absolute; top: 0px; margin-left: -0.15rem; transform: translate(0px, -50%); `; const KwikUIStyleInputSelectContainer = exports.KwikUIStyleInputSelectContainer = _styledComponents.default.div` ${_Input.KwikUIStyleInputContainerBase} ${_ref => { let { variant, disabled } = _ref; switch (variant) { case _InputSelect.IKwikUIInputSelectVariant.DROPDOWN: return (0, _styledComponents.css)` cursor: ${disabled ? "not-allowed" : "pointer"}; border: ${disabled ? "2px solid var(--kwikui-color-disabled-active) !important" : "2px solid var(--kwikui-color-primary) !important"}; background-color: ${disabled ? "var(--kwikui-color-disabled) !important" : "var(--kwikui-color-primary) !important"}; color: ${disabled ? "var(--kwikui-color-disabled-text) !important" : "var(--kwikui-color-white) !important"}; `; case _InputSelect.IKwikUIInputSelectVariant.SELECT: return (0, _styledComponents.css)` cursor: ${disabled ? "not-allowed" : "text"}; `; default: return (0, _styledComponents.css)``; } }}; &:hover { background-color: var(--kwikui-color-white); // box-shadow: 0 0 8px -3px var(--kwikui-color-disabled) !important; box-shadow: 0px 2px 12px -3px var(--kwikui-color-disabled-active); ${_ref2 => { let { disabled } = _ref2; return (0, _styledComponents.css)` box-shadow: ${disabled ? "0 0 5px var(--kwikui-color-disabled)" : "0 0 5px rgba(102, 175, 233, 0.6)"}; `; }}; } &:focus, &:focus-within { border-color: var(--kwikui-color-primary); background-color: var(--kwikui-color-white); box-shadow: 0 0 8px -3px var(--kwikui-color-primary) !important; ${_ref3 => { let { disabled } = _ref3; return (0, _styledComponents.css)` box-shadow: ${disabled ? "0 0 5px var(--kwikui-color-disabled)" : "0 0 5px rgba(102, 175, 233, 0.6)"}; `; }}; } ${_Input.KwikUIStyleInputStatus} ${_Input.KwikUIStyleInputContainerDisabled} ${_Input.KwikUIStyleInputContainerSize} ${_Input.KwikUIStyleInputContainerShape} #prefix { ${_Input.KwikUIStyleInputPrefix} } #postfix { ${_Input.KwikUIStyleInputPostfix} } input { ${_Input.KwikUIStyleInputReset} ${_Input.KwikUIStyleInputBase} ${_Input.KwikUIStyleInputSize} &::placeholder { ${_Input.KwikUIStyleInputPlaceholder} } } `; const KwikUIStyleInputSelectItemContainer = exports.KwikUIStyleInputSelectItemContainer = _styledComponents.default.div` display: flex; flex-direction: column; align-content: flex-start; justify-content: flex-start; align-items: flex-start; & > *:not(:last-child) { margin-bottom: 0.5rem; } `; const KwikUIStyleInputSelectItemLabelContainer = exports.KwikUIStyleInputSelectItemLabelContainer = _styledComponents.default.div` display: flex; flex-direction: column; align-content: flex-start; justify-content: flex-start; align-items: stretch; & > *:not(:last-child) { margin-bottom: 0.5rem; } `; const KwikUIStyleInputSelectItemLabel = exports.KwikUIStyleInputSelectItemLabel = _styledComponents.default.div` margin-top: 0.15rem; `; const KwikUIStyleInputSelectMessagesContainer = exports.KwikUIStyleInputSelectMessagesContainer = _styledComponents.default.div` width: 100%; margin-left: 0.25rem; font-size: 0.9rem; `;