@bigbinary/neeto-molecules 3.3.8 → 3.3.9
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.
package/dist/EmailPreview.js
CHANGED
|
@@ -18,7 +18,8 @@ var EmailPreview = withT(function (_ref) {
|
|
|
18
18
|
actionButtonText = _ref.actionButtonText,
|
|
19
19
|
logo = _ref.logo,
|
|
20
20
|
_ref$className = _ref.className,
|
|
21
|
-
className = _ref$className === void 0 ? "" : _ref$className
|
|
21
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
22
|
+
customContent = _ref.customContent;
|
|
22
23
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
23
24
|
"data-cy": "email-preview-card",
|
|
24
25
|
"data-testid": "email-preview",
|
|
@@ -76,7 +77,7 @@ var EmailPreview = withT(function (_ref) {
|
|
|
76
77
|
className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72"
|
|
77
78
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
78
79
|
className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80"
|
|
79
|
-
})), actionButtonText && /*#__PURE__*/React__default.createElement("div", {
|
|
80
|
+
})), customContent && customContent, actionButtonText && /*#__PURE__*/React__default.createElement("div", {
|
|
80
81
|
className: "mt-6 flex w-full items-center justify-center"
|
|
81
82
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
82
83
|
className: "pointer-events-none",
|
|
@@ -112,7 +113,11 @@ EmailPreview.propTypes = {
|
|
|
112
113
|
/**
|
|
113
114
|
* Source link for the company logo.
|
|
114
115
|
*/
|
|
115
|
-
logo: propTypes.exports.string
|
|
116
|
+
logo: propTypes.exports.string,
|
|
117
|
+
/**
|
|
118
|
+
* To pass custom content that will be rendered above the action button.
|
|
119
|
+
*/
|
|
120
|
+
customContent: propTypes.exports.string
|
|
116
121
|
};
|
|
117
122
|
|
|
118
123
|
export { EmailPreview as default };
|
package/dist/EmailPreview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailPreview.js","sources":["../src/components/EmailPreview.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst MemoizedEditorContent = React.memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n }) => (\n <div\n data-cy=\"email-preview-card\"\n data-testid=\"email-preview\"\n className={classnames(\n \"neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border\",\n className\n )}\n >\n <div className=\"neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6\">\n <div\n className=\"flex gap-2\"\n data-cy=\"email-send-to-preview\"\n data-testid=\"email-to-block\"\n >\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.to\")}:\n </Typography>\n {isPresent(to) ? (\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40\" />\n )}\n </div>\n {from && (\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.from\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-send-from-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {from}\n </Typography>\n </div>\n )}\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.subject\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-subject-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {subject || (\n <span className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40\" />\n )}\n </Typography>\n </div>\n </div>\n <div\n className=\"neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed\"\n data-cy=\"email-body-preview-container\"\n >\n {body ? (\n <MemoizedEditorContent content={body} />\n ) : (\n <div className=\"space-y-4\">\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n </div>\n )}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button className=\"pointer-events-none\" label={actionButtonText} />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-cy=\"company-logo-preview\"\n src={logo}\n />\n )}\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\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","React","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","createElement","classnames","Typography","lineHeight","style","isPresent","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;AASA,IAAMA,qBAAqB,gBAAGC,cAAK,CAACC,IAAI,CAACC,aAAa,CAAC,CAAA;AAEvD,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,KAAG,KAAA,CAAA,GAAA,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,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"EmailPreview.js","sources":["../src/components/EmailPreview.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst MemoizedEditorContent = React.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-cy=\"email-preview-card\"\n data-testid=\"email-preview\"\n className={classnames(\n \"neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border\",\n className\n )}\n >\n <div className=\"neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6\">\n <div\n className=\"flex gap-2\"\n data-cy=\"email-send-to-preview\"\n data-testid=\"email-to-block\"\n >\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.to\")}:\n </Typography>\n {isPresent(to) ? (\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40\" />\n )}\n </div>\n {from && (\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.from\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-send-from-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {from}\n </Typography>\n </div>\n )}\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.subject\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-subject-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {subject || (\n <span className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40\" />\n )}\n </Typography>\n </div>\n </div>\n <div\n className=\"neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed\"\n data-cy=\"email-body-preview-container\"\n >\n {body ? (\n <MemoizedEditorContent content={body} />\n ) : (\n <div className=\"space-y-4\">\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-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 className=\"pointer-events-none\" label={actionButtonText} />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-cy=\"company-logo-preview\"\n src={logo}\n />\n )}\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","React","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","createElement","classnames","Typography","lineHeight","style","isPresent","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;AASA,IAAMA,qBAAqB,gBAAGC,cAAK,CAACC,IAAI,CAACC,aAAa,CAAC,CAAA;AAEvD,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,KAAG,KAAA,CAAA,G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YAAY,CAAC0B,SAAS,GAAG;AACvB;AACF;AACA;EACErB,EAAE,EAAEsB,iBAAS,CAACC,OAAO,CAACD,iBAAS,CAACE,MAAM,CAAC;AACvC;AACF;AACA;EACEvB,IAAI,EAAEqB,iBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEtB,OAAO,EAAEoB,iBAAS,CAACE,MAAM;AACzB;AACF;AACA;EACErB,IAAI,EAAEmB,iBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEpB,gBAAgB,EAAEkB,iBAAS,CAACE,MAAM;AAClC;AACF;AACA;EACEnB,IAAI,EAAEiB,iBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEhB,aAAa,EAAEc,iBAAS,CAACE,MAAAA;AAC3B,CAAC;;;;"}
|
package/dist/cjs/EmailPreview.js
CHANGED
|
@@ -29,7 +29,8 @@ var EmailPreview = withT__default["default"](function (_ref) {
|
|
|
29
29
|
actionButtonText = _ref.actionButtonText,
|
|
30
30
|
logo = _ref.logo,
|
|
31
31
|
_ref$className = _ref.className,
|
|
32
|
-
className = _ref$className === void 0 ? "" : _ref$className
|
|
32
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
33
|
+
customContent = _ref.customContent;
|
|
33
34
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
34
35
|
"data-cy": "email-preview-card",
|
|
35
36
|
"data-testid": "email-preview",
|
|
@@ -87,7 +88,7 @@ var EmailPreview = withT__default["default"](function (_ref) {
|
|
|
87
88
|
className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72"
|
|
88
89
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
89
90
|
className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80"
|
|
90
|
-
})), actionButtonText && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
91
|
+
})), customContent && customContent, actionButtonText && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
91
92
|
className: "mt-6 flex w-full items-center justify-center"
|
|
92
93
|
}, /*#__PURE__*/React__default["default"].createElement(Button__default["default"], {
|
|
93
94
|
className: "pointer-events-none",
|
|
@@ -123,7 +124,11 @@ EmailPreview.propTypes = {
|
|
|
123
124
|
/**
|
|
124
125
|
* Source link for the company logo.
|
|
125
126
|
*/
|
|
126
|
-
logo: index.propTypes.exports.string
|
|
127
|
+
logo: index.propTypes.exports.string,
|
|
128
|
+
/**
|
|
129
|
+
* To pass custom content that will be rendered above the action button.
|
|
130
|
+
*/
|
|
131
|
+
customContent: index.propTypes.exports.string
|
|
127
132
|
};
|
|
128
133
|
|
|
129
134
|
module.exports = EmailPreview;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmailPreview.js","sources":["../../src/components/EmailPreview.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst MemoizedEditorContent = React.memo(EditorContent);\n\nconst EmailPreview = withT(\n ({\n t,\n to = [],\n from,\n subject,\n body,\n actionButtonText,\n logo,\n className = \"\",\n }) => (\n <div\n data-cy=\"email-preview-card\"\n data-testid=\"email-preview\"\n className={classnames(\n \"neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border\",\n className\n )}\n >\n <div className=\"neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6\">\n <div\n className=\"flex gap-2\"\n data-cy=\"email-send-to-preview\"\n data-testid=\"email-to-block\"\n >\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.to\")}:\n </Typography>\n {isPresent(to) ? (\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40\" />\n )}\n </div>\n {from && (\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.from\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-send-from-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {from}\n </Typography>\n </div>\n )}\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.subject\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-subject-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {subject || (\n <span className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40\" />\n )}\n </Typography>\n </div>\n </div>\n <div\n className=\"neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed\"\n data-cy=\"email-body-preview-container\"\n >\n {body ? (\n <MemoizedEditorContent content={body} />\n ) : (\n <div className=\"space-y-4\">\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n </div>\n )}\n {actionButtonText && (\n <div className=\"mt-6 flex w-full items-center justify-center\">\n <Button className=\"pointer-events-none\" label={actionButtonText} />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-cy=\"company-logo-preview\"\n src={logo}\n />\n )}\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\nexport default EmailPreview;\n"],"names":["MemoizedEditorContent","React","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","createElement","classnames","Typography","lineHeight","style","isPresent","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,IAAMA,qBAAqB,gBAAGC,yBAAK,CAACC,IAAI,CAACC,iCAAa,CAAC,CAAA;AAEvD,IAAMC,YAAY,GAAGC,yBAAK,CACxB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,OAAA,GAAAF,IAAA,CACDG,EAAE;AAAFA,IAAAA,EAAE,GAAAD,OAAA,KAAG,KAAA,CAAA,GAAA,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,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA,CAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"EmailPreview.js","sources":["../../src/components/EmailPreview.jsx"],"sourcesContent":["import React from \"react\";\n\nimport classnames from \"classnames\";\nimport { isPresent } from \"neetocist\";\nimport withT from \"neetocommons/react-utils/withT\";\nimport { EditorContent } from \"neetoeditor\";\nimport { Typography, Button } from \"neetoui\";\nimport PropTypes from \"prop-types\";\n\nconst MemoizedEditorContent = React.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-cy=\"email-preview-card\"\n data-testid=\"email-preview\"\n className={classnames(\n \"neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border\",\n className\n )}\n >\n <div className=\"neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6\">\n <div\n className=\"flex gap-2\"\n data-cy=\"email-send-to-preview\"\n data-testid=\"email-to-block\"\n >\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.to\")}:\n </Typography>\n {isPresent(to) ? (\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {to.join(\", \")}\n </Typography>\n ) : (\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40\" />\n )}\n </div>\n {from && (\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.from\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-send-from-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {from}\n </Typography>\n </div>\n )}\n <div className=\"flex items-center gap-2 pt-3\">\n <Typography\n className=\"neeto-ui-text-gray-500\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {t(\"neetoMolecules.emailPreview.subject\")}:\n </Typography>\n <Typography\n className=\"neeto-ui-text-gray-800 min-w-0 flex-grow break-words\"\n data-cy=\"email-subject-preview\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {subject || (\n <span className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40\" />\n )}\n </Typography>\n </div>\n </div>\n <div\n className=\"neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed\"\n data-cy=\"email-body-preview-container\"\n >\n {body ? (\n <MemoizedEditorContent content={body} />\n ) : (\n <div className=\"space-y-4\">\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-full md:w-80\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40 max-w-full md:w-72\" />\n <div className=\"neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-48 max-w-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 className=\"pointer-events-none\" label={actionButtonText} />\n </div>\n )}\n {logo && (\n <img\n alt={t(\"neetoMolecules.emailPreview.logoAltText\")}\n className=\"h-20 w-36 object-cover\"\n data-cy=\"company-logo-preview\"\n src={logo}\n />\n )}\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","React","memo","EditorContent","EmailPreview","withT","_ref","t","_ref$to","to","from","subject","body","actionButtonText","logo","_ref$className","className","customContent","createElement","classnames","Typography","lineHeight","style","isPresent","join","content","Button","label","alt","src","propTypes","PropTypes","arrayOf","string"],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,IAAMA,qBAAqB,gBAAGC,yBAAK,CAACC,IAAI,CAACC,iCAAa,CAAC,CAAA;AAEvD,IAAMC,YAAY,GAAGC,yBAAK,CACxB,UAAAC,IAAA,EAAA;AAAA,EAAA,IACEC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAAC,OAAA,GAAAF,IAAA,CACDG,EAAE;AAAFA,IAAAA,EAAE,GAAAD,OAAA,KAAG,KAAA,CAAA,GAAA,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,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,cAAA;IACdE,aAAa,GAAAX,IAAA,CAAbW,aAAa,CAAA;EAAA,oBAEbhB,yBAAA,CAAAiB,aAAA,CAAA,KAAA,EAAA;AACE,IAAA,SAAA,EAAQ,oBAAoB;AAC5B,IAAA,aAAA,EAAY,eAAe;AAC3BF,IAAAA,SAAS,EAAEG,8BAAU,CACnB,0FAA0F,EAC1FH,SACF,CAAA;GAEAf,eAAAA,yBAAA,CAAAiB,aAAA,CAAA,KAAA,EAAA;AAAKF,IAAAA,SAAS,EAAC,0EAAA;GACbf,eAAAA,yBAAA,CAAAiB,aAAA,CAAA,KAAA,EAAA;AACEF,IAAAA,SAAS,EAAC,YAAY;AACtB,IAAA,SAAA,EAAQ,uBAAuB;IAC/B,aAAY,EAAA,gBAAA;AAAgB,G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IAAAA,SAAS,EAAC,8CAAA;AAA8C,GAAA,eAC3Df,yBAAA,CAAAiB,aAAA,CAACQ,0BAAM,EAAA;AAACV,IAAAA,SAAS,EAAC,qBAAqB;AAACW,IAAAA,KAAK,EAAEd,gBAAAA;AAAiB,GAAE,CAC/D,CACN,EACAC,IAAI,iBACHb,yBAAA,CAAAiB,aAAA,CAAA,KAAA,EAAA;AACEU,IAAAA,GAAG,EAAErB,CAAC,CAAC,yCAAyC,CAAE;AAClDS,IAAAA,SAAS,EAAC,wBAAwB;AAClC,IAAA,SAAA,EAAQ,sBAAsB;AAC9Ba,IAAAA,GAAG,EAAEf,IAAAA;GACN,CAEA,CACF,CAAC,CAAA;AAAA,CAEV,EAAC;AAEDV,YAAY,CAAC0B,SAAS,GAAG;AACvB;AACF;AACA;EACErB,EAAE,EAAEsB,uBAAS,CAACC,OAAO,CAACD,uBAAS,CAACE,MAAM,CAAC;AACvC;AACF;AACA;EACEvB,IAAI,EAAEqB,uBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEtB,OAAO,EAAEoB,uBAAS,CAACE,MAAM;AACzB;AACF;AACA;EACErB,IAAI,EAAEmB,uBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEpB,gBAAgB,EAAEkB,uBAAS,CAACE,MAAM;AAClC;AACF;AACA;EACEnB,IAAI,EAAEiB,uBAAS,CAACE,MAAM;AACtB;AACF;AACA;EACEhB,aAAa,EAAEc,uBAAS,CAACE,MAAAA;AAC3B,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-molecules",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.9",
|
|
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>",
|