UNPKG

@rocket.chat/fuselage-toastbar

Version:
37 lines 1.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ToastBarContainer = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const styled_1 = require("@rocket.chat/styled"); const positionProps = { 'top-start': { ltr: 'top: 0; left: 0; right: unset; bottom: unset;', rtl: 'top: 0; right: 0; left: unset; bottom: unset;', }, 'top-end': { ltr: 'top: 0; right: 0; left: unset; bottom: unset;', rtl: 'top: 0; left: 0; right: unset; bottom: unset;', }, 'bottom-start': { ltr: 'bottom: 0; left: 0; right: unset; top: unset;', rtl: 'bottom: 0; right: 0; left: unset; top: unset;', }, 'bottom-end': { ltr: 'bottom: 0; right: 0; left: unset; top: unset;', rtl: 'bottom: 0; left: 0; right: unset; top: unset;', }, }; exports.ToastBarContainer = (0, styled_1.default)('div', ({ position: _position, ...props }) => props) ` position: fixed; gap: 1rem; display: flex; flex-direction: column; margin: 1rem; ${(p) => (p.position ? positionProps[p.position].ltr : '')} [dir='rtl'] & { ${(p) => (p.position ? positionProps[p.position].rtl : '')} } `; const ToastBarZone = ({ children, position = 'top-end', }) => ((0, jsx_runtime_1.jsx)(exports.ToastBarContainer, { position: position, children: children })); exports.default = ToastBarZone; //# sourceMappingURL=ToastBarZone.js.map