@consumidor-positivo/aurora 0.0.203 → 0.0.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
|
|
2
|
+
type ModalLayout = 'default' | 'centralized';
|
|
2
3
|
type ModalProps = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
onClose?: () => void;
|
|
5
6
|
headerContent?: React.ReactNode | string | JSX.Element | JSX.Element[];
|
|
6
7
|
content?: React.ReactNode | string | JSX.Element | JSX.Element[];
|
|
7
|
-
|
|
8
|
+
layoutMobile?: ModalLayout;
|
|
9
|
+
layoutDesktop?: ModalLayout;
|
|
8
10
|
};
|
|
9
|
-
export declare const Modal: ({ isOpen, onClose, headerContent, content,
|
|
11
|
+
export declare const Modal: ({ isOpen, onClose, headerContent, content, layoutMobile, layoutDesktop, }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
12
|
export {};
|
|
@@ -2,35 +2,28 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
|
3
3
|
import "../Icon/index.es.js";
|
|
4
4
|
import { IconX } from "../icons/IconX/index.es.js";
|
|
5
|
+
import { W as When } from "../../react-if.esm-CoCMV6iA.js";
|
|
5
6
|
import './styles.css';const Modal = ({
|
|
6
7
|
isOpen,
|
|
7
8
|
onClose,
|
|
8
9
|
headerContent,
|
|
9
10
|
content,
|
|
10
|
-
|
|
11
|
+
layoutMobile = "default",
|
|
12
|
+
layoutDesktop = "default"
|
|
11
13
|
}) => {
|
|
12
14
|
if (!isOpen) return null;
|
|
13
15
|
const modalClasses = classNames("au-modal", {
|
|
14
16
|
"au-modal--is-open": isOpen,
|
|
15
|
-
"au-modal--
|
|
16
|
-
"au-modal--centralized":
|
|
17
|
+
"au-modal--mobile-centralized": layoutMobile === "centralized",
|
|
18
|
+
"au-modal--desktop-centralized": layoutDesktop === "centralized"
|
|
17
19
|
});
|
|
18
|
-
return /* @__PURE__ */ jsx("div", { className: modalClasses, children: /* @__PURE__ */ jsxs(
|
|
19
|
-
"div",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ jsxs("div", { className: "au-modal__header", children: [
|
|
27
|
-
/* @__PURE__ */ jsx("div", { className: "au-modal__header-close", onClick: onClose, children: /* @__PURE__ */ jsx(IconX, {}) }),
|
|
28
|
-
headerContent
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ jsx("div", { className: "au-modal__content", children: content })
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
) });
|
|
20
|
+
return /* @__PURE__ */ jsx("div", { className: modalClasses, children: /* @__PURE__ */ jsxs("div", { className: "au-modal__container", children: [
|
|
21
|
+
/* @__PURE__ */ jsxs("div", { className: "au-modal__header", children: [
|
|
22
|
+
/* @__PURE__ */ jsx(When, { condition: !!onClose, children: /* @__PURE__ */ jsx("div", { className: "au-modal__header-close", onClick: onClose, children: /* @__PURE__ */ jsx(IconX, {}) }) }),
|
|
23
|
+
headerContent
|
|
24
|
+
] }),
|
|
25
|
+
/* @__PURE__ */ jsx("div", { className: "au-modal__content", children: content })
|
|
26
|
+
] }) });
|
|
34
27
|
};
|
|
35
28
|
export {
|
|
36
29
|
Modal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Modal/index.tsx"],"sourcesContent":["import { IconX } from '@components/icons'\nimport classNames from 'classnames'\n\nimport './styles.scss'\n\ntype ModalProps = {\n isOpen: boolean\n onClose?: () => void\n headerContent?: React.ReactNode | string | JSX.Element | JSX.Element[]\n content?: React.ReactNode | string | JSX.Element | JSX.Element[]\n
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../../../lib/components/Modal/index.tsx"],"sourcesContent":["import { IconX } from '@components/icons'\nimport classNames from 'classnames'\nimport { If } from '../misc'\n\nimport './styles.scss'\n\ntype ModalLayout = 'default' | 'centralized'\n\ntype ModalProps = {\n isOpen: boolean\n onClose?: () => void\n headerContent?: React.ReactNode | string | JSX.Element | JSX.Element[]\n content?: React.ReactNode | string | JSX.Element | JSX.Element[]\n layoutMobile?: ModalLayout\n layoutDesktop?: ModalLayout\n}\n\nexport const Modal = ({\n isOpen,\n onClose,\n headerContent,\n content,\n layoutMobile = 'default',\n layoutDesktop = 'default',\n}: ModalProps) => {\n if (!isOpen) return null\n\n const modalClasses = classNames('au-modal', {\n 'au-modal--is-open': isOpen,\n 'au-modal--mobile-centralized': layoutMobile === 'centralized',\n 'au-modal--desktop-centralized': layoutDesktop === 'centralized',\n })\n\n return (\n <div className={modalClasses}>\n <div className=\"au-modal__container\">\n <div className=\"au-modal__header\">\n <If condition={!!onClose}>\n <div className=\"au-modal__header-close\" onClick={onClose}>\n <IconX />\n </div>\n </If>\n {headerContent}\n </div>\n <div className=\"au-modal__content\">{content}</div>\n </div>\n </div>\n )\n}\n"],"names":["If"],"mappings":";;;;;AAiBO,MAAM,QAAQ,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,gBAAgB;AAClB,MAAkB;AACZ,MAAA,CAAC,OAAe,QAAA;AAEd,QAAA,eAAe,WAAW,YAAY;AAAA,IAC1C,qBAAqB;AAAA,IACrB,gCAAgC,iBAAiB;AAAA,IACjD,iCAAiC,kBAAkB;AAAA,EAAA,CACpD;AAED,6BACG,OAAI,EAAA,WAAW,cACd,UAAC,qBAAA,OAAA,EAAI,WAAU,uBACb,UAAA;AAAA,IAAC,qBAAA,OAAA,EAAI,WAAU,oBACb,UAAA;AAAA,MAAA,oBAACA,MAAG,EAAA,WAAW,CAAC,CAAC,SACjB,UAAC,oBAAA,OAAA,EAAI,WAAU,0BAAyB,SAAS,SAC/C,UAAC,oBAAA,OAAA,CAAA,CAAM,EACT,CAAA,GACA;AAAA,MACC;AAAA,IAAA,GACH;AAAA,IACC,oBAAA,OAAA,EAAI,WAAU,qBAAqB,UAAQ,SAAA;AAAA,EAAA,EAC9C,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.au-modal{height:100vh;width:100vw;position:fixed;top:0;left:0;bottom:0;right:0;background-color:#16181dcc;opacity:0;visibility:hidden;pointer-events:none;transition:all .3s ease;z-index:5}@keyframes slideInY{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInX{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideCentralized{0%{transform:translate(-50%,calc(100% + 12px))}to{transform:translate(-50%,-50%)}}.au-modal--is-open{opacity:1;visibility:visible;pointer-events:all}.au-modal--is-open .au-modal__container{animation:slideInY .3s ease forwards}
|
|
1
|
+
.au-modal{height:100vh;width:100vw;position:fixed;top:0;left:0;bottom:0;right:0;background-color:#16181dcc;opacity:0;visibility:hidden;pointer-events:none;transition:all .3s ease;z-index:5}@keyframes slideInY{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInX{0%{transform:translate(100%)}to{transform:translate(0)}}@keyframes slideCentralized{0%{transform:translate(-50%,calc(100% + 12px))}to{transform:translate(-50%,-50%)}}.au-modal--is-open{opacity:1;visibility:visible;pointer-events:all}.au-modal--is-open .au-modal__container{animation:slideInY .3s ease forwards}.au-modal--is-open.au-modal--mobile-centralized .au-modal__container{animation:slideCentralized .3s ease forwards}@media (min-width: 600px){.au-modal--is-open.au-modal--desktop-centralized .au-modal__container{animation:slideCentralized .3s ease forwards}.au-modal--is-open:not(.au-modal--desktop-centralized) .au-modal__container{animation:slideInX .3s ease forwards}}.au-modal__container{background-color:#fff;border-radius:16px 16px 0 0;padding:16px;position:fixed;z-index:6;bottom:0;display:flex;flex-direction:column;justify-content:space-between;gap:16px;width:100%;max-height:90vh}.au-modal.au-modal--mobile-centralized .au-modal__container{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:90%;max-width:500px;height:min-content;border-radius:16px;display:flex;flex-direction:column;gap:16px}@media (min-width: 600px){.au-modal:not(.au-modal--desktop-centralized) .au-modal__container{border-radius:16px 0 0 16px;box-shadow:0 24px 56px #7686ad14,0 12px 12px #0048db0a;top:0;right:0;bottom:auto;left:auto;margin:0;height:100vh;height:100dvh;max-width:414px;max-height:100vh}.au-modal.au-modal--desktop-centralized .au-modal__container{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;display:flex;max-width:500px;gap:16px;height:min-content;flex-direction:column;border-radius:16px}}.au-modal__header{position:relative}.au-modal__header-close{cursor:pointer;display:flex;justify-content:end;width:100%}.au-modal__content{height:calc(100% - 150px);overflow-y:auto;flex:1}.au-modal__content::-webkit-scrollbar{width:16px}.au-modal__content::-webkit-scrollbar-track{background:#f4f7fb;border-radius:32px}.au-modal__content::-webkit-scrollbar-thumb{background:#0048db;border-radius:8px;border:4px solid #f4f7fb}.au-modal__content::-webkit-scrollbar-thumb:hover{background:#1737a4;transition:all .3s ease}
|