UNPKG

kwikid-components-react

Version:

KwikID's Component Library in React

106 lines (105 loc) 11.9 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.KwikUIStyleInputRadioChipWrapper = exports.KwikUIStyleInputRadioChipMessagesContainer = exports.KwikUIStyleInputRadioChipLabel = exports.KwikUIStyleInputRadioChipItemsContainer = exports.KwikUIStyleInputRadioChipItemLabelContainer = exports.KwikUIStyleInputRadioChipItemLabel = exports.KwikUIStyleInputRadioChipItemContainer = exports.KwikUIStyleInputRadioChipContainer = exports.KwikUIStyleInputRadioChip = 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"); var _InputRadioChip = require("./InputRadioChip.definition"); var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject0, _templateObject1, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25, _templateObject26, _templateObject27; function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); } const KwikUIStyleInputRadioChipWrapper = exports.KwikUIStyleInputRadioChipWrapper = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-content: flex-start;\n justify-content: flex-start;\n align-items: flex-start;\n\n & > *:not(:last-child) {\n margin-bottom: 0.5rem;\n }\n"]))); const KwikUIStyleInputRadioChipContainer = exports.KwikUIStyleInputRadioChipContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-content: flex-start;\n justify-content: flex-start;\n align-items: flex-start;\n width: 100%;\n\n & > *:not(:last-child) {\n margin-bottom: 0.25rem;\n margin-right: 0.25rem;\n }\n"]))); const KwikUIStyleInputRadioChip = exports.KwikUIStyleInputRadioChip = _styledComponents.default.input(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n outline: none;\n padding: 10px;\n border-radius: 5px;\n font-size: 16px;\n transition: all 0.3s ease;\n width: 100%;\n background-color: var(--kwikui-color-white);\n color: #333;\n border: 2px solid var(--kwikui-color-disabled);\n\n &:hover,\n &:focus {\n border-color: #66afe9;\n background-color: #fff;\n box-shadow: 0 0 5px rgba(102, 175, 233, 0.6);\n }\n\n &::placeholder {\n color: var(--kwikui-color-disabled);\n }\n\n &:disabled {\n background-color: var(--kwikui-color-disabled-hover);\n color: var(--kwikui-color-disabled);\n }\n"]))); const KwikUIStyleInputRadioChipItemContainer = exports.KwikUIStyleInputRadioChipItemContainer = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: grid;\n grid-template-areas:\n \". .\"\n \". .\";\n justify-items: start;\n align-items: center;\n justify-content: start;\n column-gap: 0rem;\n\n appearance: none;\n outline: 2px solid var(--kwikui-color-primary);\n margin: 0px;\n border-radius: 50%;\n background-color: transparent;\n transition: 1s linear ease;\n\n &:hover * {\n ", "\n ", "\n }\n\n ", "\n\n ", "\n\n & > input[type=\"radio\"] {\n appearance: none;\n border: 0;\n outline: 0;\n width: 0;\n min-width: 0;\n max-width: 0;\n height: 0;\n min-height: 0;\n max-height: 0;\n margin: 0px;\n }\n\n ", "\n\n ", "\n"])), _ref => { let { disabled } = _ref; return !disabled && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n cursor: pointer;\n "]))); }, _ref2 => { let { disabled } = _ref2; return disabled && (0, _styledComponents.css)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n cursor: not-allowed;\n "]))); }, _ref3 => { let { checked } = _ref3; return checked && (0, _styledComponents.css)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n transition: 1s linear ease;\n border-color: white;\n outline-color: var(--kwikui-color-primary);\n background-color: var(--kwikui-color-primary);\n color: var(--kwikui-color-primary-text);\n "]))); }, _ref4 => { let { disabled, checked } = _ref4; return disabled && (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n transition: 1s linear;\n border-color: var(--kwikui-color-white);\n outline-color: var(--kwikui-color-disabled-active);\n background-color: ", ";\n color: ", ";\n "])), checked ? 'var(--kwikui-color-disabled-active)' : 'transparent', checked ? 'var(--kwikui-color-white)' : 'var(--kwikui-color-disabled-active)'); }, _ref5 => { let { shape } = _ref5; switch (shape) { case _Shape.IKwikUIShape.ROUNDED: return (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n border-radius: 2rem;\n "]))); case _Shape.IKwikUIShape.CURVED: return (0, _styledComponents.css)(_templateObject0 || (_templateObject0 = _taggedTemplateLiteral(["\n border-radius: 0.25rem;\n "]))); case _Shape.IKwikUIShape.RECTANGLE: return (0, _styledComponents.css)(_templateObject1 || (_templateObject1 = _taggedTemplateLiteral(["\n border-radius: 0rem;\n "]))); default: return (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n border-radius: 0.25rem;\n "]))); } }, _ref6 => { let { size } = _ref6; switch (size) { case _Size.IKwikUISize.S: return (0, _styledComponents.css)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding: var(--kwikui-space-xs);\n font-size: var(--kwikui-font-size-s);\n row-gap: calc(var(--kwikui-font-size-s) / 2);\n "]))); case _Size.IKwikUISize.M: return (0, _styledComponents.css)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n padding: var(--kwikui-space-s);\n font-size: var(--kwikui-font-size-m);\n row-gap: calc(var(--kwikui-font-size-m) / 2);\n "]))); case _Size.IKwikUISize.L: return (0, _styledComponents.css)(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n padding: var(--kwikui-space-m);\n font-size: var(--kwikui-font-size-l);\n row-gap: calc(var(--kwikui-font-size-l) / 2);\n "]))); } }); const KwikUIStyleInputRadioChipItemLabelContainer = exports.KwikUIStyleInputRadioChipItemLabelContainer = _styledComponents.default.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-content: flex-start;\n justify-content: flex-start;\n align-items: stretch;\n width: 100%;\n\n & > *:not(:last-child) {\n margin-bottom: 0.25rem;\n }\n"]))); const KwikUIStyleInputRadioChipItemLabel = exports.KwikUIStyleInputRadioChipItemLabel = _styledComponents.default.label(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-top: 0rem;\n width: max-content;\n\n ", "\n"])), _ref7 => { let { size } = _ref7; switch (size) { case _Size.IKwikUISize.S: return (0, _styledComponents.css)(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n line-height: var(--kwikui-font-size-s);\n "]))); case _Size.IKwikUISize.M: return (0, _styledComponents.css)(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n line-height: var(--kwikui-font-size-m);\n "]))); case _Size.IKwikUISize.L: return (0, _styledComponents.css)(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n line-height: var(--kwikui-font-size-l);\n "]))); } }); const KwikUIStyleInputRadioChipLabel = exports.KwikUIStyleInputRadioChipLabel = _styledComponents.default.label(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n ", "\n\n ", "\n"])), _Input.KwikUIStyleInputLabel, _ref8 => { let { size } = _ref8; switch (size) { case _Size.IKwikUISize.S: return (0, _styledComponents.css)(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n margin-bottom: 0.25rem !important;\n "]))); case _Size.IKwikUISize.M: return (0, _styledComponents.css)(_templateObject21 || (_templateObject21 = _taggedTemplateLiteral(["\n margin-bottom: 0.5rem !important;\n "]))); case _Size.IKwikUISize.L: return (0, _styledComponents.css)(_templateObject22 || (_templateObject22 = _taggedTemplateLiteral(["\n margin-bottom: 0.5rem !important;\n "]))); } }); const KwikUIStyleInputRadioChipMessagesContainer = exports.KwikUIStyleInputRadioChipMessagesContainer = _styledComponents.default.div(_templateObject23 || (_templateObject23 = _taggedTemplateLiteral(["\n width: 100%;\n margin-left: 0.25rem;\n"]))); const KwikUIStyleInputRadioChipItemsContainer = exports.KwikUIStyleInputRadioChipItemsContainer = _styledComponents.default.div(_templateObject24 || (_templateObject24 = _taggedTemplateLiteral(["\n margin: 0.25rem 0rem 0rem 0.25rem;\n\n ", "\n"])), _ref9 => { let { orientation } = _ref9; switch (orientation) { case _InputRadioChip.IKwikUIInputRadioChipOrientation.VERTICAL: return (0, _styledComponents.css)(_templateObject25 || (_templateObject25 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n margin-left: 0.25rem;\n margin-top: 0.25rem;\n\n & > * {\n margin-bottom: 0.5rem;\n }\n "]))); case _InputRadioChip.IKwikUIInputRadioChipOrientation.HORIZONTAL: return (0, _styledComponents.css)(_templateObject26 || (_templateObject26 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: flex-start;\n margin-left: 0.25rem;\n margin-top: 0.25rem;\n\n & > * {\n margin-right: 0.5rem;\n }\n "]))); case _InputRadioChip.IKwikUIInputRadioChipOrientation.WRAPPED: return (0, _styledComponents.css)(_templateObject27 || (_templateObject27 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n justify-content: flex-start;\n margin-left: 0.25rem;\n margin-top: 0.25rem;\n flex-wrap: wrap;\n\n & > * {\n margin-bottom: 0.5rem;\n margin-right: 0.5rem;\n }\n "]))); } });