UNPKG

kwikid-components-react

Version:

KwikID's Component Library in React

167 lines (159 loc) 5.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KwikUIStyleInputOtpWrapper = exports.KwikUIStyleInputOtpSingleContainer = exports.KwikUIStyleInputOtpOutsideLabel = exports.KwikUIStyleInputOtpMessagesContainer = exports.KwikUIStyleInputOtpLabel = exports.KwikUIStyleInputOtpContainer = exports.KwikUIStyleInputOtpBoxesContainer = exports.KwikUIStyleInputOtpBox = void 0; var _styledComponents = _interopRequireWildcard(require("styled-components")); var _Shape = require("../../../../shared/definitions/Shape"); var _Size = require("../../../../shared/definitions/Size"); var _Input = require("../../../../shared/styles/Input.style"); 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; } // InputOtp.style.ts const KwikUIStyleInputOtpWrapper = exports.KwikUIStyleInputOtpWrapper = _styledComponents.default.div` display: flex; flex-direction: column; gap: var(--kwikui-space-s); width: 100%; `; const KwikUIStyleInputOtpLabel = exports.KwikUIStyleInputOtpLabel = _styledComponents.default.label` ${_Input.KwikUIStyleInputLabel} position: absolute; top: 0; margin-left: calc(-1 * var(--kwikui-space-xxs)); transform: translate(0, -50%); background-color: var(--kwikui-color-white); padding: 0 var(--kwikui-space-xxs); `; const KwikUIStyleInputOtpContainer = exports.KwikUIStyleInputOtpContainer = _styledComponents.default.div` display: flex; flex-direction: column; align-items: stretch; width: 100%; background: transparent; border: none; padding: 0; margin: 0; `; const KwikUIStyleInputOtpBoxesContainer = exports.KwikUIStyleInputOtpBoxesContainer = _styledComponents.default.div` display: flex; gap: var(--kwikui-space-s); flex-wrap: wrap; justify-content: flex-start; align-items: center; `; const KwikUIStyleInputOtpBox = exports.KwikUIStyleInputOtpBox = _styledComponents.default.div` ${_Input.KwikUIStyleInputContainerBase} ${_Input.KwikUIStyleInputStatus} ${_Input.KwikUIStyleInputContainerDisabled} ${_Input.KwikUIStyleInputContainerSize} ${_Input.KwikUIStyleInputContainerShape} ${_Input.KwikUIStyleInputContainerSize} flex: 0 0 auto; aspect-ratio: 1; min-width: unset; padding: 0; position: relative; overflow: hidden; input { ${_Input.KwikUIStyleInputReset} ${_Input.KwikUIStyleInputBase} ${_Input.KwikUIStyleInputSize} text-align: center; width: 100%; height: 100%; &::placeholder { ${_Input.KwikUIStyleInputPlaceholder} } } ${_ref => { let { shape } = _ref; switch (shape) { case _Shape.IKwikUIShape.ROUNDED: return (0, _styledComponents.css)` border-radius: 2rem; `; case _Shape.IKwikUIShape.CURVED: return (0, _styledComponents.css)` border-radius: 0.25rem; `; case _Shape.IKwikUIShape.RECTANGLE: return (0, _styledComponents.css)` border-radius: 0rem; `; default: return (0, _styledComponents.css)` border-radius: 0.25rem; `; } }} ${_ref2 => { let { size } = _ref2; switch (size) { case _Size.IKwikUISize.XS: return (0, _styledComponents.css)` width: calc(3 * var(--kwikui-font-size-xs)); height: calc(3 * var(--kwikui-font-size-xs)); `; case _Size.IKwikUISize.S: return (0, _styledComponents.css)` width: calc(3 * var(--kwikui-font-size-s)); height: calc(3 * var(--kwikui-font-size-s)); `; case _Size.IKwikUISize.M: return (0, _styledComponents.css)` width: calc(3 * var(--kwikui-font-size-m)); height: calc(3 * var(--kwikui-font-size-m)); `; case _Size.IKwikUISize.L: return (0, _styledComponents.css)` width: calc(3 * var(--kwikui-font-size-l)); height: calc(3 * var(--kwikui-font-size-l)); `; case _Size.IKwikUISize.XL: return (0, _styledComponents.css)` width: calc(3 * var(--kwikui-font-size-xl)); height: calc(3 * var(--kwikui-font-size-xl)); `; } }} `; const KwikUIStyleInputOtpOutsideLabel = exports.KwikUIStyleInputOtpOutsideLabel = _styledComponents.default.label` ${_Input.KwikUIStyleInputLabel} margin-bottom: var(--kwikui-space-xs); color: ${_ref3 => { let { disabled } = _ref3; return disabled ? "var(--kwikui-color-disabled-text)" : "inherit"; }}; `; const KwikUIStyleInputOtpSingleContainer = exports.KwikUIStyleInputOtpSingleContainer = _styledComponents.default.div` ${_Input.KwikUIStyleInputContainerBase} ${_Input.KwikUIStyleInputStatus} ${_Input.KwikUIStyleInputContainerDisabled} ${_Input.KwikUIStyleInputContainerSize} ${_Input.KwikUIStyleInputContainerShape} position: relative; width: 100%; input { ${_Input.KwikUIStyleInputReset} ${_Input.KwikUIStyleInputBase} ${_Input.KwikUIStyleInputSize} width: 100%; letter-spacing: 0.5em; &::placeholder { ${_Input.KwikUIStyleInputPlaceholder} letter-spacing: normal; } } `; const KwikUIStyleInputOtpMessagesContainer = exports.KwikUIStyleInputOtpMessagesContainer = _styledComponents.default.div` width: 100%; margin-top: var(--kwikui-space-xxs); font-size: var(--kwikui-font-size-s); `;