@bigbinary/neeto-molecules 5.3.34 → 5.3.35
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.
|
@@ -26,7 +26,7 @@ var EmailPreview = reactUtils.withT(function (_ref) {
|
|
|
26
26
|
customContent = _ref.customContent;
|
|
27
27
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
28
28
|
"data-testid": "email-preview-card",
|
|
29
|
-
className: classnames("bg-background neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8", className),
|
|
29
|
+
className: classnames("bg-background light neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8", className),
|
|
30
30
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31
31
|
className: "absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']",
|
|
32
32
|
children: t("neetoMolecules.emailPreview.previewMessage")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailPreview.js","sources":["../../../src/v2/components/EmailPreview.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Button, Typography } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\nimport { EditorContent } from \"neetoeditor/v2\";\nimport PropTypes from \"prop-types\";\n\nimport AvatarPlaceholder from \"assets/images/avatar-placeholder\";\n\nconst MemoizedEditorContent = memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n customContent,\n }) => (\n <div\n data-testid=\"email-preview-card\"\n className={classnames(\n \"bg-background neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8\",\n className\n )}\n >\n <div className=\"absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']\">\n {t(\"neetoMolecules.emailPreview.previewMessage\")}\n </div>\n <div className=\"w-full pb-4\">\n <Typography\n className=\"text-foreground min-w-0 grow space-x-2 leading-normal break-words\"\n data-testid=\"email-subject-preview\"\n variant=\"h4\"\n >\n <span>\n {subject || <span className=\"bg-muted h-2 w-40 rounded-full\" />}\n </span>\n </Typography>\n <div className=\"mt-4 flex items-center gap-2\">\n <div className=\"shrink-0\">\n <AvatarPlaceholder />\n </div>\n <div className=\"flex flex-col gap-1\">\n {isPresent(from) ? (\n <Typography variant=\"h6\" weight=\"medium\">\n {from}\n </Typography>\n ) : (\n <div className=\"flex gap-2\">\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n </div>\n )}\n {isPresent(to) ? (\n <Typography\n className=\"text-muted-foreground line-clamp-1\"\n data-testid=\"email-to-block\"\n variant=\"nano\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <span\n className=\"bg-muted h-2 w-16 rounded-full\"\n data-testid=\"email-to-block\"\n />\n )}\n </div>\n </div>\n </div>\n <div\n className=\"bg-muted flex flex-1 flex-col justify-between gap-y-6 rounded px-6 py-4 text-base leading-relaxed\"\n data-testid=\"email-body-preview-container\"\n >\n <div className=\"bg-background w-full p-6 md:p-8 2xl:mx-auto 2xl:max-w-lg\">\n {body ? (\n <MemoizedEditorContent\n className=\"whitespace-normal\"\n content={body}\n />\n ) : (\n <div className=\"flex flex-col gap-y-4\">\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n <div className=\"bg-muted h-2 w-40 max-w-full rounded-full md:w-72\" />\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n </div>\n )}\n {customContent && customContent}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button\n className=\"pointer-events-none\"\n label={actionButtonText}\n />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-testid=\"company-logo-preview\"\n src={logo}\n />\n )}\n </div>\n </div>\n </div>\n )\n);\n\nEmailPreview.propTypes = {\n /**\n * The value of the send-to field.\n */\n to: PropTypes.arrayOf(PropTypes.string),\n /**\n * The value of the send-from field.\n */\n from: PropTypes.string,\n /**\n * The subject of the email.\n */\n subject: PropTypes.string,\n /**\n * The body of the email.\n */\n body: PropTypes.string,\n /**\n * The text to be shown in the action button.\n */\n actionButtonText: PropTypes.string,\n /**\n * Source link for the company logo.\n */\n logo: PropTypes.string,\n /**\n * To pass custom content that will be rendered above the action button.\n */\n customContent: PropTypes.string,\n};\n\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","_jsxs","classnames","children","_jsx","Typography","variant","AvatarPlaceholder","isPresent","weight","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;;;;;AAWA,IAAMA,qBAAqB,gBAAGC,UAAI,CAACC,aAAa,CAAC;AAEjD,IAAMC,YAAY,GAAGC,gBAAK,CACxB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,OAAA,GAAAF,IAAA,CACDG,EAAE;AAAFA,IAAAA,EAAE,GAAAD,OAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,OAAA;IACPE,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACJC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IAAAC,cAAA,GAAAT,IAAA,CACJU,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,aAAa,GAAAX,IAAA,CAAbW,aAAa;AAAA,EAAA,oBAEbC,eAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,oBAAoB;AAChCF,IAAAA,SAAS,EAAEG,UAAU,CACnB,
|
|
1
|
+
{"version":3,"file":"EmailPreview.js","sources":["../../../src/v2/components/EmailPreview.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Button, Typography } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\nimport { EditorContent } from \"neetoeditor/v2\";\nimport PropTypes from \"prop-types\";\n\nimport AvatarPlaceholder from \"assets/images/avatar-placeholder\";\n\nconst MemoizedEditorContent = memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n customContent,\n }) => (\n <div\n data-testid=\"email-preview-card\"\n className={classnames(\n \"bg-background light neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8\",\n className\n )}\n >\n <div className=\"absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']\">\n {t(\"neetoMolecules.emailPreview.previewMessage\")}\n </div>\n <div className=\"w-full pb-4\">\n <Typography\n className=\"text-foreground min-w-0 grow space-x-2 leading-normal break-words\"\n data-testid=\"email-subject-preview\"\n variant=\"h4\"\n >\n <span>\n {subject || <span className=\"bg-muted h-2 w-40 rounded-full\" />}\n </span>\n </Typography>\n <div className=\"mt-4 flex items-center gap-2\">\n <div className=\"shrink-0\">\n <AvatarPlaceholder />\n </div>\n <div className=\"flex flex-col gap-1\">\n {isPresent(from) ? (\n <Typography variant=\"h6\" weight=\"medium\">\n {from}\n </Typography>\n ) : (\n <div className=\"flex gap-2\">\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n </div>\n )}\n {isPresent(to) ? (\n <Typography\n className=\"text-muted-foreground line-clamp-1\"\n data-testid=\"email-to-block\"\n variant=\"nano\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <span\n className=\"bg-muted h-2 w-16 rounded-full\"\n data-testid=\"email-to-block\"\n />\n )}\n </div>\n </div>\n </div>\n <div\n className=\"bg-muted flex flex-1 flex-col justify-between gap-y-6 rounded px-6 py-4 text-base leading-relaxed\"\n data-testid=\"email-body-preview-container\"\n >\n <div className=\"bg-background w-full p-6 md:p-8 2xl:mx-auto 2xl:max-w-lg\">\n {body ? (\n <MemoizedEditorContent\n className=\"whitespace-normal\"\n content={body}\n />\n ) : (\n <div className=\"flex flex-col gap-y-4\">\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n <div className=\"bg-muted h-2 w-40 max-w-full rounded-full md:w-72\" />\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n </div>\n )}\n {customContent && customContent}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button\n className=\"pointer-events-none\"\n label={actionButtonText}\n />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-testid=\"company-logo-preview\"\n src={logo}\n />\n )}\n </div>\n </div>\n </div>\n )\n);\n\nEmailPreview.propTypes = {\n /**\n * The value of the send-to field.\n */\n to: PropTypes.arrayOf(PropTypes.string),\n /**\n * The value of the send-from field.\n */\n from: PropTypes.string,\n /**\n * The subject of the email.\n */\n subject: PropTypes.string,\n /**\n * The body of the email.\n */\n body: PropTypes.string,\n /**\n * The text to be shown in the action button.\n */\n actionButtonText: PropTypes.string,\n /**\n * Source link for the company logo.\n */\n logo: PropTypes.string,\n /**\n * To pass custom content that will be rendered above the action button.\n */\n customContent: PropTypes.string,\n};\n\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","_jsxs","classnames","children","_jsx","Typography","variant","AvatarPlaceholder","isPresent","weight","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;;;;;AAWA,IAAMA,qBAAqB,gBAAGC,UAAI,CAACC,aAAa,CAAC;AAEjD,IAAMC,YAAY,GAAGC,gBAAK,CACxB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,OAAA,GAAAF,IAAA,CACDG,EAAE;AAAFA,IAAAA,EAAE,GAAAD,OAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,OAAA;IACPE,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACJC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IAAAC,cAAA,GAAAT,IAAA,CACJU,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,aAAa,GAAAX,IAAA,CAAbW,aAAa;AAAA,EAAA,oBAEbC,eAAA,CAAA,KAAA,EAAA;AACE,I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S,EAAC,8CAA8C;UAAAI,QAAA,eAC3DC,cAAA,CAACQ,iBAAM,EAAA;AACLb,YAAAA,SAAS,EAAC,qBAAqB;AAC/Bc,YAAAA,KAAK,EAAEjB;WACR;AAAC,SACC,CACN,EACAC,IAAI,iBACHO,cAAA,CAAA,KAAA,EAAA;AACEU,UAAAA,GAAG,EAAExB,CAAC,CAAC,yCAAyC,CAAE;AAClDS,UAAAA,SAAS,EAAC,wBAAwB;AAClC,UAAA,aAAA,EAAY,sBAAsB;AAClCgB,UAAAA,GAAG,EAAElB;AAAK,SACX,CACF;OACE;AAAC,KACH,CAAC;AAAA,GACH,CAAC;AAAA,CAEV;AAEAV,YAAY,CAAC6B,SAAS,GAAG;AACvB;AACF;AACA;EACExB,EAAE,EAAEyB,eAAS,CAACC,OAAO,CAACD,eAAS,CAACE,MAAM,CAAC;AACvC;AACF;AACA;EACE1B,IAAI,EAAEwB,eAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEzB,OAAO,EAAEuB,eAAS,CAACE,MAAM;AACzB;AACF;AACA;EACExB,IAAI,EAAEsB,eAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEvB,gBAAgB,EAAEqB,eAAS,CAACE,MAAM;AAClC;AACF;AACA;EACEtB,IAAI,EAAEoB,eAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEnB,aAAa,EAAEiB,eAAS,CAACE;AAC3B,CAAC;;;;"}
|
package/dist/v2/EmailPreview.js
CHANGED
|
@@ -24,7 +24,7 @@ var EmailPreview = withT(function (_ref) {
|
|
|
24
24
|
customContent = _ref.customContent;
|
|
25
25
|
return /*#__PURE__*/jsxs("div", {
|
|
26
26
|
"data-testid": "email-preview-card",
|
|
27
|
-
className: classnames("bg-background neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8", className),
|
|
27
|
+
className: classnames("bg-background light neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8", className),
|
|
28
28
|
children: [/*#__PURE__*/jsx("div", {
|
|
29
29
|
className: "absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']",
|
|
30
30
|
children: t("neetoMolecules.emailPreview.previewMessage")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailPreview.js","sources":["../../src/v2/components/EmailPreview.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Button, Typography } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\nimport { EditorContent } from \"neetoeditor/v2\";\nimport PropTypes from \"prop-types\";\n\nimport AvatarPlaceholder from \"assets/images/avatar-placeholder\";\n\nconst MemoizedEditorContent = memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n customContent,\n }) => (\n <div\n data-testid=\"email-preview-card\"\n className={classnames(\n \"bg-background neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8\",\n className\n )}\n >\n <div className=\"absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']\">\n {t(\"neetoMolecules.emailPreview.previewMessage\")}\n </div>\n <div className=\"w-full pb-4\">\n <Typography\n className=\"text-foreground min-w-0 grow space-x-2 leading-normal break-words\"\n data-testid=\"email-subject-preview\"\n variant=\"h4\"\n >\n <span>\n {subject || <span className=\"bg-muted h-2 w-40 rounded-full\" />}\n </span>\n </Typography>\n <div className=\"mt-4 flex items-center gap-2\">\n <div className=\"shrink-0\">\n <AvatarPlaceholder />\n </div>\n <div className=\"flex flex-col gap-1\">\n {isPresent(from) ? (\n <Typography variant=\"h6\" weight=\"medium\">\n {from}\n </Typography>\n ) : (\n <div className=\"flex gap-2\">\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n </div>\n )}\n {isPresent(to) ? (\n <Typography\n className=\"text-muted-foreground line-clamp-1\"\n data-testid=\"email-to-block\"\n variant=\"nano\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <span\n className=\"bg-muted h-2 w-16 rounded-full\"\n data-testid=\"email-to-block\"\n />\n )}\n </div>\n </div>\n </div>\n <div\n className=\"bg-muted flex flex-1 flex-col justify-between gap-y-6 rounded px-6 py-4 text-base leading-relaxed\"\n data-testid=\"email-body-preview-container\"\n >\n <div className=\"bg-background w-full p-6 md:p-8 2xl:mx-auto 2xl:max-w-lg\">\n {body ? (\n <MemoizedEditorContent\n className=\"whitespace-normal\"\n content={body}\n />\n ) : (\n <div className=\"flex flex-col gap-y-4\">\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n <div className=\"bg-muted h-2 w-40 max-w-full rounded-full md:w-72\" />\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n </div>\n )}\n {customContent && customContent}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button\n className=\"pointer-events-none\"\n label={actionButtonText}\n />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-testid=\"company-logo-preview\"\n src={logo}\n />\n )}\n </div>\n </div>\n </div>\n )\n);\n\nEmailPreview.propTypes = {\n /**\n * The value of the send-to field.\n */\n to: PropTypes.arrayOf(PropTypes.string),\n /**\n * The value of the send-from field.\n */\n from: PropTypes.string,\n /**\n * The subject of the email.\n */\n subject: PropTypes.string,\n /**\n * The body of the email.\n */\n body: PropTypes.string,\n /**\n * The text to be shown in the action button.\n */\n actionButtonText: PropTypes.string,\n /**\n * Source link for the company logo.\n */\n logo: PropTypes.string,\n /**\n * To pass custom content that will be rendered above the action button.\n */\n customContent: PropTypes.string,\n};\n\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","_jsxs","classnames","children","_jsx","Typography","variant","AvatarPlaceholder","isPresent","weight","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;;;AAWA,IAAMA,qBAAqB,gBAAGC,IAAI,CAACC,aAAa,CAAC;AAEjD,IAAMC,YAAY,GAAGC,KAAK,CACxB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,OAAA,GAAAF,IAAA,CACDG,EAAE;AAAFA,IAAAA,EAAE,GAAAD,OAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,OAAA;IACPE,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACJC,OAAO,GAAAL,IAAA,CAAPK,OAAO;IACPC,IAAI,GAAAN,IAAA,CAAJM,IAAI;IACJC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,IAAI,GAAAR,IAAA,CAAJQ,IAAI;IAAAC,cAAA,GAAAT,IAAA,CACJU,SAAS;AAATA,IAAAA,SAAS,GAAAD,cAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,cAAA;IACdE,aAAa,GAAAX,IAAA,CAAbW,aAAa;AAAA,EAAA,oBAEbC,IAAA,CAAA,KAAA,EAAA;AACE,IAAA,aAAA,EAAY,oBAAoB;AAChCF,IAAAA,SAAS,EAAEG,UAAU,CACnB,
|
|
1
|
+
{"version":3,"file":"EmailPreview.js","sources":["../../src/v2/components/EmailPreview.jsx"],"sourcesContent":["import { memo } from \"react\";\n\nimport { Button, Typography } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport { withT } from \"neetocommons/v2/react-utils\";\nimport { EditorContent } from \"neetoeditor/v2\";\nimport PropTypes from \"prop-types\";\n\nimport AvatarPlaceholder from \"assets/images/avatar-placeholder\";\n\nconst MemoizedEditorContent = memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n customContent,\n }) => (\n <div\n data-testid=\"email-preview-card\"\n className={classnames(\n \"bg-background light neeto-ui-theme--light relative flex flex-1 flex-col rounded-lg px-6 py-8\",\n className\n )}\n >\n <div className=\"absolute -end-1.5 -top-1.5 z-10 min-w-max rounded-ss-md rounded-se-md rounded-es-md px-3 py-1.5 text-center text-sm font-medium text-[#49545c] shadow-[0px_3px_4px_0px_#00000026] [background:#ffee6a] after:absolute after:end-0 after:top-full after:-z-20 after:[border-width:0_0_12px_6px] after:border-solid after:[border-color:transparent_#ddd06b] after:content-['']\">\n {t(\"neetoMolecules.emailPreview.previewMessage\")}\n </div>\n <div className=\"w-full pb-4\">\n <Typography\n className=\"text-foreground min-w-0 grow space-x-2 leading-normal break-words\"\n data-testid=\"email-subject-preview\"\n variant=\"h4\"\n >\n <span>\n {subject || <span className=\"bg-muted h-2 w-40 rounded-full\" />}\n </span>\n </Typography>\n <div className=\"mt-4 flex items-center gap-2\">\n <div className=\"shrink-0\">\n <AvatarPlaceholder />\n </div>\n <div className=\"flex flex-col gap-1\">\n {isPresent(from) ? (\n <Typography variant=\"h6\" weight=\"medium\">\n {from}\n </Typography>\n ) : (\n <div className=\"flex gap-2\">\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n <span className=\"bg-muted h-2 w-24 rounded-full\" />\n </div>\n )}\n {isPresent(to) ? (\n <Typography\n className=\"text-muted-foreground line-clamp-1\"\n data-testid=\"email-to-block\"\n variant=\"nano\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <span\n className=\"bg-muted h-2 w-16 rounded-full\"\n data-testid=\"email-to-block\"\n />\n )}\n </div>\n </div>\n </div>\n <div\n className=\"bg-muted flex flex-1 flex-col justify-between gap-y-6 rounded px-6 py-4 text-base leading-relaxed\"\n data-testid=\"email-body-preview-container\"\n >\n <div className=\"bg-background w-full p-6 md:p-8 2xl:mx-auto 2xl:max-w-lg\">\n {body ? (\n <MemoizedEditorContent\n className=\"whitespace-normal\"\n content={body}\n />\n ) : (\n <div className=\"flex flex-col gap-y-4\">\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n <div className=\"bg-muted h-2 w-40 max-w-full rounded-full md:w-72\" />\n <div className=\"bg-muted h-2 w-48 max-w-full rounded-full md:w-80\" />\n </div>\n )}\n {customContent && customContent}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button\n className=\"pointer-events-none\"\n label={actionButtonText}\n />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-testid=\"company-logo-preview\"\n src={logo}\n />\n )}\n </div>\n </div>\n </div>\n )\n);\n\nEmailPreview.propTypes = {\n /**\n * The value of the send-to field.\n */\n to: PropTypes.arrayOf(PropTypes.string),\n /**\n * The value of the send-from field.\n */\n from: PropTypes.string,\n /**\n * The subject of the email.\n */\n subject: PropTypes.string,\n /**\n * The body of the email.\n */\n body: PropTypes.string,\n /**\n * The text to be shown in the action button.\n */\n actionButtonText: PropTypes.string,\n /**\n * Source link for the company logo.\n */\n logo: PropTypes.string,\n /**\n * To pass custom content that will be rendered above the action button.\n */\n customContent: PropTypes.string,\n};\n\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","_jsxs","classnames","children","_jsx","Typography","variant","Avat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C,OAAO,CAACD,SAAS,CAACE,MAAM,CAAC;AACvC;AACF;AACA;EACE1B,IAAI,EAAEwB,SAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEzB,OAAO,EAAEuB,SAAS,CAACE,MAAM;AACzB;AACF;AACA;EACExB,IAAI,EAAEsB,SAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEvB,gBAAgB,EAAEqB,SAAS,CAACE,MAAM;AAClC;AACF;AACA;EACEtB,IAAI,EAAEoB,SAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEnB,aAAa,EAAEiB,SAAS,CAACE;AAC3B,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.35",
|
|
4
4
|
"description": "A package of reusable molecular components for neeto products.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-molecules.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|