kwikid-components-react
Version:
KwikID's Component Library in React
100 lines (96 loc) • 3.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.KwikUIStyleDialogWrapper = exports.KwikUIStyleDialogContainer = exports.KwikUIStyleDialogChildren = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _Dialog = require("./Dialog.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 KwikUIStyleDialogContainer = exports.KwikUIStyleDialogContainer = _styledComponents.default.div`
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
display: flex;
flex-direction: row;
align-content: center;
justify-content: center;
align-items: center;
grid-gap: 1rem;
gap: 1rem;
z-index: 99999;
position: relative;
${_ref => {
let {
variant
} = _ref;
return variant === "fullscreen" && (0, _styledComponents.css)`
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
`;
}}
`;
const KwikUIStyleDialogWrapper = exports.KwikUIStyleDialogWrapper = _styledComponents.default.div`
display: flex;
flex-direction: row;
align-content: center;
justify-content: center;
align-items: center;
background-color: white;
box-shadow:
rgba(50, 50, 93, 0.25) 0px 13px 27px -5px,
rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
border-radius: 0.5rem;
z-index: 99999;
max-width: 90%;
max-height: 90%;
overflow: auto;
${_ref2 => {
let {
variant,
size
} = _ref2;
switch (variant) {
case _Dialog.IKwikUIDialogVariant.CONTAINED:
switch (size) {
case _Dialog.IKwikUIDialogSize.S:
return (0, _styledComponents.css)`
margin: var(--kwikui-space-s);
`;
case _Dialog.IKwikUIDialogSize.M:
return (0, _styledComponents.css)`
margin: var(--kwikui-space-m);
`;
case _Dialog.IKwikUIDialogSize.L:
return (0, _styledComponents.css)`
margin: var(--kwikui-space-l);
`;
}
}
}}
${_ref3 => {
let {
shape
} = _ref3;
switch (shape) {
case _Dialog.IKwikUIDialogShape.ROUNDED:
return (0, _styledComponents.css)`
border-radius: 2em;
`;
case _Dialog.IKwikUIDialogShape.CURVED:
return (0, _styledComponents.css)`
border-radius: 0.5em;
`;
case _Dialog.IKwikUIDialogShape.RECTANGLE:
return (0, _styledComponents.css)`
border-radius: 0em;
`;
}
}}
`;
const KwikUIStyleDialogChildren = exports.KwikUIStyleDialogChildren = _styledComponents.default.div``;