kwikid-components-react
Version:
KwikID's Component Library in React
101 lines (97 loc) • 3.78 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.KwikUIStyleAlertMessage = exports.KwikUIStyleAlertContainer = exports.KwikUIStyleAlertCloseButton = void 0;
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _Alert = require("./Alert.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 KwikUIStyleAlertContainer = exports.KwikUIStyleAlertContainer = _styledComponents.default.div`
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
align-content: center;
width: 280px;
border: 2px solid black;
padding: 0.25rem;
transition: opacity 0.3s ease-in-out;
border-radius: 0.5rem;
box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
${_ref => {
let {
variant
} = _ref;
switch (variant) {
case _Alert.IKwikUIAlertVariant.SUCCESS:
return (0, _styledComponents.css)`
border: 2px solid #28a745;
background-color: #28a745;
color: white;
`;
case _Alert.IKwikUIAlertVariant.ERROR:
return (0, _styledComponents.css)`
border: 2px solid #dc3545;
background-color: #dc3545;
color: white;
`;
case _Alert.IKwikUIAlertVariant.WARN:
return (0, _styledComponents.css)`
border: 2px solid #ffc107;
background-color: #ffc107;
color: white;
`;
case _Alert.IKwikUIAlertVariant.INFO:
return (0, _styledComponents.css)`
border: 2px solid #007bff;
background-color: #007bff;
color: white;
`;
}
}}
${_ref2 => {
let {
position
} = _ref2;
switch (position) {
case _Alert.IKwikUIAlertPosition.TOP_LEFT:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.TOP_CENTER:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.TOP_RIGHT:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.CENTER_LEFT:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.CENTER_CENTER:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.CENTER_RIGHT:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.BOTTOM_LEFT:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.BOTTOM_CENTER:
return (0, _styledComponents.css)``;
case _Alert.IKwikUIAlertPosition.BOTTOM_RIGHT:
return (0, _styledComponents.css)``;
}
}}
`;
const KwikUIStyleAlertMessage = exports.KwikUIStyleAlertMessage = _styledComponents.default.div`
font-size: 1rem;
padding: 0.5rem;
`;
const KwikUIStyleAlertCloseButton = exports.KwikUIStyleAlertCloseButton = _styledComponents.default.button`
background-color: transparent;
border: none;
font-size: 1rem;
cursor: pointer;
padding: 0.25rem;
color: inherit;
display: flex;
flex-direction: row;
align-content: center;
justify-content: center;
align-items: center;
&:hover {
}
`;