@bigbinary/neeto-molecules 5.1.19 → 5.1.21
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/FinderModal.js +56 -9
- package/dist/FinderModal.js.map +1 -1
- package/dist/IpRestriction.js +2 -3175
- package/dist/IpRestriction.js.map +1 -1
- package/dist/MadeWith.js +3 -74
- package/dist/MadeWith.js.map +1 -1
- package/dist/NeetoWidget.js +3 -1958
- package/dist/NeetoWidget.js.map +1 -1
- package/dist/Onboarding.js +3 -400
- package/dist/Onboarding.js.map +1 -1
- package/dist/chevron-up-B2_LTx_h.js +15 -0
- package/dist/chevron-up-B2_LTx_h.js.map +1 -0
- package/dist/cjs/FinderModal.js +54 -7
- package/dist/cjs/FinderModal.js.map +1 -1
- package/dist/cjs/IpRestriction.js +21 -3194
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/dist/cjs/MadeWith.js +17 -88
- package/dist/cjs/MadeWith.js.map +1 -1
- package/dist/cjs/NeetoWidget.js +4 -1959
- package/dist/cjs/NeetoWidget.js.map +1 -1
- package/dist/cjs/Onboarding.js +3 -400
- package/dist/cjs/Onboarding.js.map +1 -1
- package/dist/cjs/chevron-up-CpzhFWzM.js +17 -0
- package/dist/cjs/chevron-up-CpzhFWzM.js.map +1 -0
- package/dist/cjs/copy-CerjTcLL.js +20 -0
- package/dist/cjs/copy-CerjTcLL.js.map +1 -0
- package/dist/cjs/globe-DawgK2Dx.js +21 -0
- package/dist/cjs/globe-DawgK2Dx.js.map +1 -0
- package/dist/cjs/index-ARGXqXxG.js +78 -0
- package/dist/cjs/index-ARGXqXxG.js.map +1 -0
- package/dist/cjs/index-BeqE2JWC.js +3180 -0
- package/dist/cjs/index-BeqE2JWC.js.map +1 -0
- package/dist/cjs/panel-left-close-CLoRPBWH.js +21 -0
- package/dist/cjs/panel-left-close-CLoRPBWH.js.map +1 -0
- package/dist/cjs/phone-number-Bza7WGZm.js +315 -0
- package/dist/cjs/phone-number-Bza7WGZm.js.map +1 -0
- package/dist/cjs/prism-tomorrow-BMFuJ5o1.js +1963 -0
- package/dist/cjs/prism-tomorrow-BMFuJ5o1.js.map +1 -0
- package/dist/cjs/react-confetti-DdGoyZ0y.js +405 -0
- package/dist/cjs/react-confetti-DdGoyZ0y.js.map +1 -0
- package/dist/cjs/smartphone-ChvEvl-o.js +36 -0
- package/dist/cjs/smartphone-ChvEvl-o.js.map +1 -0
- package/dist/cjs/trash-2-CotPjU5n.js +23 -0
- package/dist/cjs/trash-2-CotPjU5n.js.map +1 -0
- package/dist/cjs/triangle-alert-De-qkUXK.js +27 -0
- package/dist/cjs/triangle-alert-De-qkUXK.js.map +1 -0
- package/dist/cjs/v2/AuditLogs.js +4 -18
- package/dist/cjs/v2/AuditLogs.js.map +1 -1
- package/dist/cjs/v2/Builder.js +4 -18
- package/dist/cjs/v2/Builder.js.map +1 -1
- package/dist/cjs/v2/Codeblock.js +1 -0
- package/dist/cjs/v2/Codeblock.js.map +1 -1
- package/dist/cjs/v2/CopyToClipboardButton.js +3 -16
- package/dist/cjs/v2/CopyToClipboardButton.js.map +1 -1
- package/dist/cjs/v2/FinderModal.js +48 -14
- package/dist/cjs/v2/FinderModal.js.map +1 -1
- package/dist/cjs/v2/FloatingActionMenu.js +1 -0
- package/dist/cjs/v2/FloatingActionMenu.js.map +1 -1
- package/dist/cjs/v2/Insights.js +344 -0
- package/dist/cjs/v2/Insights.js.map +1 -0
- package/dist/cjs/v2/IntegrationCard.js +222 -0
- package/dist/cjs/v2/IntegrationCard.js.map +1 -0
- package/dist/cjs/v2/IpRestriction.js +525 -0
- package/dist/cjs/v2/IpRestriction.js.map +1 -0
- package/dist/cjs/v2/MadeWith.js +73 -0
- package/dist/cjs/v2/MadeWith.js.map +1 -0
- package/dist/cjs/v2/Metadata.js +215 -0
- package/dist/cjs/v2/Metadata.js.map +1 -0
- package/dist/cjs/v2/NavigationHeader.js +1 -0
- package/dist/cjs/v2/NavigationHeader.js.map +1 -1
- package/dist/cjs/v2/NeetoWidget.js +855 -0
- package/dist/cjs/v2/NeetoWidget.js.map +1 -0
- package/dist/cjs/v2/Onboarding.js +323 -0
- package/dist/cjs/v2/Onboarding.js.map +1 -0
- package/dist/cjs/v2/OptionFields.js +1291 -0
- package/dist/cjs/v2/OptionFields.js.map +1 -0
- package/dist/cjs/v2/PhoneNumber.js +20 -307
- package/dist/cjs/v2/PhoneNumber.js.map +1 -1
- package/dist/cjs/v2/ProductEmbed.js +1870 -0
- package/dist/cjs/v2/ProductEmbed.js.map +1 -0
- package/dist/cjs/v2/PublishBlock.js +6 -22
- package/dist/cjs/v2/PublishBlock.js.map +1 -1
- package/dist/cjs/v2/PublishYourItem.js +60 -0
- package/dist/cjs/v2/PublishYourItem.js.map +1 -0
- package/dist/cjs/v2/ResponsiveDevicePicker.js +88 -0
- package/dist/cjs/v2/ResponsiveDevicePicker.js.map +1 -0
- package/dist/cjs/v2/SessionEnvironment.js +479 -0
- package/dist/cjs/v2/SessionEnvironment.js.map +1 -0
- package/dist/copy-DhbOoOav.js +18 -0
- package/dist/copy-DhbOoOav.js.map +1 -0
- package/dist/globe-rBiI1CjO.js +19 -0
- package/dist/globe-rBiI1CjO.js.map +1 -0
- package/dist/index-0jnA7dx6.js +3178 -0
- package/dist/index-0jnA7dx6.js.map +1 -0
- package/dist/index-DF5MKxql.js +76 -0
- package/dist/index-DF5MKxql.js.map +1 -0
- package/dist/panel-left-close-37jik3GB.js +19 -0
- package/dist/panel-left-close-37jik3GB.js.map +1 -0
- package/dist/phone-number-CGZtDB_n.js +291 -0
- package/dist/phone-number-CGZtDB_n.js.map +1 -0
- package/dist/prism-tomorrow-ZUb2Ikm9.js +1961 -0
- package/dist/prism-tomorrow-ZUb2Ikm9.js.map +1 -0
- package/dist/react-confetti-BnGq_LBE.js +403 -0
- package/dist/react-confetti-BnGq_LBE.js.map +1 -0
- package/dist/smartphone-B-jv1y8j.js +33 -0
- package/dist/smartphone-B-jv1y8j.js.map +1 -0
- package/dist/trash-2-N0F6K63L.js +21 -0
- package/dist/trash-2-N0F6K63L.js.map +1 -0
- package/dist/triangle-alert-Pkh6pc42.js +25 -0
- package/dist/triangle-alert-Pkh6pc42.js.map +1 -0
- package/dist/v2/AuditLogs.js +3 -17
- package/dist/v2/AuditLogs.js.map +1 -1
- package/dist/v2/Builder.js +3 -17
- package/dist/v2/Builder.js.map +1 -1
- package/dist/v2/Codeblock.js +1 -0
- package/dist/v2/Codeblock.js.map +1 -1
- package/dist/v2/CopyToClipboardButton.js +2 -15
- package/dist/v2/CopyToClipboardButton.js.map +1 -1
- package/dist/v2/FinderModal.js +49 -15
- package/dist/v2/FinderModal.js.map +1 -1
- package/dist/v2/FloatingActionMenu.js +1 -0
- package/dist/v2/FloatingActionMenu.js.map +1 -1
- package/dist/v2/Insights.js +342 -0
- package/dist/v2/Insights.js.map +1 -0
- package/dist/v2/IntegrationCard.js +220 -0
- package/dist/v2/IntegrationCard.js.map +1 -0
- package/dist/v2/IpRestriction.js +504 -0
- package/dist/v2/IpRestriction.js.map +1 -0
- package/dist/v2/MadeWith.js +52 -0
- package/dist/v2/MadeWith.js.map +1 -0
- package/dist/v2/Metadata.js +213 -0
- package/dist/v2/Metadata.js.map +1 -0
- package/dist/v2/NavigationHeader.js +1 -0
- package/dist/v2/NavigationHeader.js.map +1 -1
- package/dist/v2/NeetoWidget.js +834 -0
- package/dist/v2/NeetoWidget.js.map +1 -0
- package/dist/v2/Onboarding.js +321 -0
- package/dist/v2/Onboarding.js.map +1 -0
- package/dist/v2/OptionFields.js +1289 -0
- package/dist/v2/OptionFields.js.map +1 -0
- package/dist/v2/PhoneNumber.js +20 -287
- package/dist/v2/PhoneNumber.js.map +1 -1
- package/dist/v2/ProductEmbed.js +1868 -0
- package/dist/v2/ProductEmbed.js.map +1 -0
- package/dist/v2/PublishBlock.js +5 -21
- package/dist/v2/PublishBlock.js.map +1 -1
- package/dist/v2/PublishYourItem.js +58 -0
- package/dist/v2/PublishYourItem.js.map +1 -0
- package/dist/v2/ResponsiveDevicePicker.js +86 -0
- package/dist/v2/ResponsiveDevicePicker.js.map +1 -0
- package/dist/v2/SessionEnvironment.js +477 -0
- package/dist/v2/SessionEnvironment.js.map +1 -0
- package/package.json +3 -3
- package/types/v2/Insights.d.ts +69 -0
- package/types/v2/IntegrationCard.d.ts +30 -0
- package/types/v2/IpRestriction.d.ts +5 -0
- package/types/v2/MadeWith.d.ts +8 -0
- package/types/v2/Metadata.d.ts +26 -0
- package/types/v2/MobilePreviewHeader.d.ts +8 -0
- package/types/v2/NeetoWidget.d.ts +19 -0
- package/types/v2/Onboarding.d.ts +22 -0
- package/types/v2/OptionFields.d.ts +55 -0
- package/types/v2/ProductEmbed.d.ts +90 -0
- package/types/v2/PublishYourItem.d.ts +8 -0
- package/types/v2/ResponsiveDevicePicker.d.ts +11 -0
- package/types/v2/SessionEnvironment.d.ts +34 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Typography } from '@bigbinary/neeto-atoms';
|
|
2
|
+
import { withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
3
|
+
import { P as PropTypes } from '../index-DAYCJu79.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
import '../_commonjsHelpers-BFTU3MAI.js';
|
|
6
|
+
|
|
7
|
+
var PublishYourItem = withT(function (_ref) {
|
|
8
|
+
var t = _ref.t,
|
|
9
|
+
item = _ref.item,
|
|
10
|
+
description = _ref.description;
|
|
11
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12
|
+
className: "relative mx-auto flex max-w-sm flex-col gap-y-3",
|
|
13
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
14
|
+
className: "pt-6 text-center",
|
|
15
|
+
"data-testid": "publish-your-item-header",
|
|
16
|
+
variant: "h2",
|
|
17
|
+
weight: "semibold",
|
|
18
|
+
children: /*#__PURE__*/jsxs("span", {
|
|
19
|
+
className: "relative inline-flex flex-col-reverse items-center gap-6 whitespace-nowrap",
|
|
20
|
+
children: [t("neetoMolecules.publishYourItem.title", {
|
|
21
|
+
item: item
|
|
22
|
+
}), /*#__PURE__*/jsxs("svg", {
|
|
23
|
+
className: "start-full bottom-0 sm:absolute sm:ms-2",
|
|
24
|
+
fill: "none",
|
|
25
|
+
height: "53",
|
|
26
|
+
viewBox: "0 0 58 53",
|
|
27
|
+
width: "58",
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
children: [/*#__PURE__*/jsx("path", {
|
|
30
|
+
d: "M7.31443 51.7732C12.2565 52.0622 16.7513 49.6192 20.5942 46.7584C23.9346 44.2309 26.9993 41.3397 29.7741 38.2342C35.221 32.0755 39.4754 24.8436 42.2528 17.0968C43.808 12.7381 44.9292 8.18667 45.4884 3.57236C45.6449 2.40707 43.8096 2.20391 43.6892 3.36379C42.7055 11.2831 40.1442 18.9973 36.2536 25.9536C32.3935 32.8685 27.251 39.092 21.0745 44.0712C17.2642 47.1481 12.6506 50.2719 7.523 49.974C7.03852 49.9362 6.57212 50.2641 6.49837 50.754C6.46065 51.2385 6.82995 51.7355 7.31443 51.7732Z",
|
|
31
|
+
fill: "#68737D"
|
|
32
|
+
}), /*#__PURE__*/jsx("path", {
|
|
33
|
+
d: "M30.2178 13.9691C33.8174 10.9607 37.4585 7.98292 41.0582 4.97452C41.4831 4.61603 41.8775 4.29898 42.3025 3.9405C42.6968 3.62344 43.0749 3.19834 43.5576 2.97852C44.1735 2.66502 44.6058 3.3367 44.8671 3.84994C45.9733 5.82004 46.9462 7.88381 47.9912 9.93677C49.193 12.2977 50.4307 14.6532 51.6325 17.0141C52.155 18.0405 53.8496 17.3072 53.2911 16.2861C52.1416 14.0279 50.9921 11.7696 49.8066 9.51679C48.7093 7.36119 47.6787 5.15873 46.4788 3.05538C45.9834 2.209 45.3385 1.34824 44.3479 1.12871C43.1303 0.869604 42.1471 1.68026 41.2972 2.39723C39.3974 3.97169 37.4977 5.54615 35.5979 7.12061C33.401 8.92386 31.2401 10.7217 29.0486 12.561C28.1627 13.2833 29.2958 14.6969 30.2178 13.9691Z",
|
|
34
|
+
fill: "#68737D"
|
|
35
|
+
})]
|
|
36
|
+
})]
|
|
37
|
+
})
|
|
38
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
39
|
+
className: "text-foreground w-full text-center",
|
|
40
|
+
"data-testid": "publish-your-item-description",
|
|
41
|
+
variant: "body2",
|
|
42
|
+
children: description
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
PublishYourItem.propTypes = {
|
|
47
|
+
/**
|
|
48
|
+
* Item that need to be published
|
|
49
|
+
*/
|
|
50
|
+
item: PropTypes.string,
|
|
51
|
+
/**
|
|
52
|
+
* Description to display on component
|
|
53
|
+
*/
|
|
54
|
+
description: PropTypes.string
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { PublishYourItem as default };
|
|
58
|
+
//# sourceMappingURL=PublishYourItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishYourItem.js","sources":["../../src/v2/components/PublishYourItem.jsx"],"sourcesContent":["import { Typography } from \"@bigbinary/neeto-atoms\";\nimport { withT } from \"neetocommons/v2/react-utils\";\nimport PropTypes from \"prop-types\";\n\nconst PublishYourItem = withT(({ t, item, description }) => (\n <div className=\"relative mx-auto flex max-w-sm flex-col gap-y-3\">\n <Typography\n className=\"pt-6 text-center\"\n data-testid=\"publish-your-item-header\"\n variant=\"h2\"\n weight=\"semibold\"\n >\n <span className=\"relative inline-flex flex-col-reverse items-center gap-6 whitespace-nowrap\">\n {t(\"neetoMolecules.publishYourItem.title\", { item })}\n <svg\n className=\"start-full bottom-0 sm:absolute sm:ms-2\"\n fill=\"none\"\n height=\"53\"\n viewBox=\"0 0 58 53\"\n width=\"58\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.31443 51.7732C12.2565 52.0622 16.7513 49.6192 20.5942 46.7584C23.9346 44.2309 26.9993 41.3397 29.7741 38.2342C35.221 32.0755 39.4754 24.8436 42.2528 17.0968C43.808 12.7381 44.9292 8.18667 45.4884 3.57236C45.6449 2.40707 43.8096 2.20391 43.6892 3.36379C42.7055 11.2831 40.1442 18.9973 36.2536 25.9536C32.3935 32.8685 27.251 39.092 21.0745 44.0712C17.2642 47.1481 12.6506 50.2719 7.523 49.974C7.03852 49.9362 6.57212 50.2641 6.49837 50.754C6.46065 51.2385 6.82995 51.7355 7.31443 51.7732Z\"\n fill=\"#68737D\"\n />\n <path\n d=\"M30.2178 13.9691C33.8174 10.9607 37.4585 7.98292 41.0582 4.97452C41.4831 4.61603 41.8775 4.29898 42.3025 3.9405C42.6968 3.62344 43.0749 3.19834 43.5576 2.97852C44.1735 2.66502 44.6058 3.3367 44.8671 3.84994C45.9733 5.82004 46.9462 7.88381 47.9912 9.93677C49.193 12.2977 50.4307 14.6532 51.6325 17.0141C52.155 18.0405 53.8496 17.3072 53.2911 16.2861C52.1416 14.0279 50.9921 11.7696 49.8066 9.51679C48.7093 7.36119 47.6787 5.15873 46.4788 3.05538C45.9834 2.209 45.3385 1.34824 44.3479 1.12871C43.1303 0.869604 42.1471 1.68026 41.2972 2.39723C39.3974 3.97169 37.4977 5.54615 35.5979 7.12061C33.401 8.92386 31.2401 10.7217 29.0486 12.561C28.1627 13.2833 29.2958 14.6969 30.2178 13.9691Z\"\n fill=\"#68737D\"\n />\n </svg>\n </span>\n </Typography>\n <Typography\n className=\"text-foreground w-full text-center\"\n data-testid=\"publish-your-item-description\"\n variant=\"body2\"\n >\n {description}\n </Typography>\n </div>\n));\n\nPublishYourItem.propTypes = {\n /**\n * Item that need to be published\n */\n item: PropTypes.string,\n /**\n * Description to display on component\n */\n description: PropTypes.string,\n};\n\nexport default PublishYourItem;\n"],"names":["PublishYourItem","withT","_ref","t","item","description","_jsxs","className","children","_jsx","Typography","variant","weight","fill","height","viewBox","width","xmlns","d","propTypes","PropTypes","string"],"mappings":";;;;;;AAIA,IAAMA,eAAe,GAAGC,KAAK,CAAC,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,CAAC,GAAAD,IAAA,CAADC,CAAC;IAAEC,IAAI,GAAAF,IAAA,CAAJE,IAAI;IAAEC,WAAW,GAAAH,IAAA,CAAXG,WAAW;AAAA,EAAA,oBACnDC,IAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,iDAAiD;IAAAC,QAAA,EAAA,cAC9DC,GAAA,CAACC,UAAU,EAAA;AACTH,MAAAA,SAAS,EAAC,kBAAkB;AAC5B,MAAA,aAAA,EAAY,0BAA0B;AACtCI,MAAAA,OAAO,EAAC,IAAI;AACZC,MAAAA,MAAM,EAAC,UAAU;AAAAJ,MAAAA,QAAA,eAEjBF,IAAA,CAAA,MAAA,EAAA;AAAMC,QAAAA,SAAS,EAAC,4EAA4E;AAAAC,QAAAA,QAAA,EAAA,CACzFL,CAAC,CAAC,sCAAsC,EAAE;AAAEC,UAAAA,IAAI,EAAJA;SAAM,CAAC,eACpDE,IAAA,CAAA,KAAA,EAAA;AACEC,UAAAA,SAAS,EAAC,yCAAyC;AACnDM,UAAAA,IAAI,EAAC,MAAM;AACXC,UAAAA,MAAM,EAAC,IAAI;AACXC,UAAAA,OAAO,EAAC,WAAW;AACnBC,UAAAA,KAAK,EAAC,IAAI;AACVC,UAAAA,KAAK,EAAC,4BAA4B;AAAAT,UAAAA,QAAA,gBAElCC,GAAA,CAAA,MAAA,EAAA;AACES,YAAAA,CAAC,EAAC,2eAA2e;AAC7eL,YAAAA,IAAI,EAAC;WACN,CAAC,eACFJ,GAAA,CAAA,MAAA,EAAA;AACES,YAAAA,CAAC,EAAC,4qBAA4qB;AAC9qBL,YAAAA,IAAI,EAAC;AAAS,WACf,CAAC;AAAA,SACC,CAAC;OACF;AAAC,KACG,CAAC,eACbJ,GAAA,CAACC,UAAU,EAAA;AACTH,MAAAA,SAAS,EAAC,oCAAoC;AAC9C,MAAA,aAAA,EAAY,+BAA+B;AAC3CI,MAAAA,OAAO,EAAC,OAAO;AAAAH,MAAAA,QAAA,EAEdH;AAAW,KACF,CAAC;AAAA,GACV,CAAC;AAAA,CACP;AAEDL,eAAe,CAACmB,SAAS,GAAG;AAC1B;AACF;AACA;EACEf,IAAI,EAAEgB,SAAS,CAACC,MAAM;AACtB;AACF;AACA;EACEhB,WAAW,EAAEe,SAAS,CAACC;AACzB,CAAC;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
|
+
import { Button } from '@bigbinary/neeto-atoms';
|
|
5
|
+
import classnames from 'classnames';
|
|
6
|
+
import { t } from 'i18next';
|
|
7
|
+
import { M as Monitor, S as Smartphone } from '../smartphone-B-jv1y8j.js';
|
|
8
|
+
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
9
|
+
import { createElement } from 'react';
|
|
10
|
+
import { jsx } from 'react/jsx-runtime';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @license lucide-react v1.7.0 - ISC
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the ISC license.
|
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const __iconNode = [
|
|
21
|
+
["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
|
|
22
|
+
["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
|
|
23
|
+
];
|
|
24
|
+
const Tablet = createLucideIcon("tablet", __iconNode);
|
|
25
|
+
|
|
26
|
+
var RESPONSIVE_DEVICES = {
|
|
27
|
+
DESKTOP: "desktop",
|
|
28
|
+
TABLET: "tablet",
|
|
29
|
+
MOBILE: "mobile"
|
|
30
|
+
};
|
|
31
|
+
var RESPONSIVE_DEVICES_MAP = _defineProperty(_defineProperty(_defineProperty({}, RESPONSIVE_DEVICES.DESKTOP, {
|
|
32
|
+
icon: Monitor,
|
|
33
|
+
label: t("neetoMolecules.responsiveDevicePicker.desktop")
|
|
34
|
+
}), RESPONSIVE_DEVICES.TABLET, {
|
|
35
|
+
icon: Tablet,
|
|
36
|
+
label: t("neetoMolecules.responsiveDevicePicker.tablet")
|
|
37
|
+
}), RESPONSIVE_DEVICES.MOBILE, {
|
|
38
|
+
icon: Smartphone,
|
|
39
|
+
label: t("neetoMolecules.responsiveDevicePicker.mobile")
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
var _excluded = ["className", "selectedDevice", "onDeviceChange"];
|
|
43
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
44
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
45
|
+
var ResponsiveDevicePicker = function ResponsiveDevicePicker(_ref) {
|
|
46
|
+
var _ref$className = _ref.className,
|
|
47
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
48
|
+
selectedDevice = _ref.selectedDevice,
|
|
49
|
+
onDeviceChange = _ref.onDeviceChange,
|
|
50
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
51
|
+
var devices = Object.entries(RESPONSIVE_DEVICES_MAP);
|
|
52
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
53
|
+
className: classnames("flex items-center justify-center", className)
|
|
54
|
+
}, otherProps), {}, {
|
|
55
|
+
children: devices.map(function (_ref2, index) {
|
|
56
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
57
|
+
key = _ref3[0],
|
|
58
|
+
_ref3$ = _ref3[1],
|
|
59
|
+
icon = _ref3$.icon,
|
|
60
|
+
label = _ref3$.label;
|
|
61
|
+
var isFirst = index === 0;
|
|
62
|
+
var isLast = index === devices.length - 1;
|
|
63
|
+
var isActive = key === selectedDevice;
|
|
64
|
+
return /*#__PURE__*/createElement(Button, {
|
|
65
|
+
icon: icon,
|
|
66
|
+
"data-testid": "".concat(label.toLowerCase(), "-device-button"),
|
|
67
|
+
key: key,
|
|
68
|
+
size: "icon",
|
|
69
|
+
title: label,
|
|
70
|
+
variant: "outline",
|
|
71
|
+
className: classnames("focus:z-10", {
|
|
72
|
+
"rounded-e-none": isFirst,
|
|
73
|
+
"-ms-px rounded-none": !isFirst && !isLast,
|
|
74
|
+
"-ms-px rounded-s-none": isLast,
|
|
75
|
+
"border-primary bg-primary/10 text-primary hover:bg-primary/10 hover:text-primary z-10": isActive
|
|
76
|
+
}),
|
|
77
|
+
onClick: function onClick() {
|
|
78
|
+
return onDeviceChange(key);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
})
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { ResponsiveDevicePicker as default };
|
|
86
|
+
//# sourceMappingURL=ResponsiveDevicePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResponsiveDevicePicker.js","sources":["../../node_modules/lucide-react/dist/esm/icons/tablet.js","../../src/v2/components/ResponsiveDevicePicker/constants.js","../../src/v2/components/ResponsiveDevicePicker/index.jsx"],"sourcesContent":["/**\n * @license lucide-react v1.7.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"16\", height: \"20\", x: \"4\", y: \"2\", rx: \"2\", ry: \"2\", key: \"76otgf\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"18\", y2: \"18\", key: \"1dp563\" }]\n];\nconst Tablet = createLucideIcon(\"tablet\", __iconNode);\n\nexport { __iconNode, Tablet as default };\n//# sourceMappingURL=tablet.js.map\n","import { t } from \"i18next\";\nimport { Monitor, Tablet, Smartphone } from \"lucide-react\";\n\nexport const RESPONSIVE_DEVICES = {\n DESKTOP: \"desktop\",\n TABLET: \"tablet\",\n MOBILE: \"mobile\",\n};\n\nexport const RESPONSIVE_DEVICES_MAP = {\n [RESPONSIVE_DEVICES.DESKTOP]: {\n icon: Monitor,\n label: t(\"neetoMolecules.responsiveDevicePicker.desktop\"),\n },\n [RESPONSIVE_DEVICES.TABLET]: {\n icon: Tablet,\n label: t(\"neetoMolecules.responsiveDevicePicker.tablet\"),\n },\n [RESPONSIVE_DEVICES.MOBILE]: {\n icon: Smartphone,\n label: t(\"neetoMolecules.responsiveDevicePicker.mobile\"),\n },\n};\n","import { Button } from \"@bigbinary/neeto-atoms\";\nimport classnames from \"classnames\";\nimport PropTypes from \"prop-types\";\n\nimport { RESPONSIVE_DEVICES_MAP } from \"./constants\";\n\nconst ResponsiveDevicePicker = ({\n className = \"\",\n selectedDevice,\n onDeviceChange,\n ...otherProps\n}) => {\n const devices = Object.entries(RESPONSIVE_DEVICES_MAP);\n\n return (\n <div\n className={classnames(\"flex items-center justify-center\", className)}\n {...otherProps}\n >\n {devices.map(([key, { icon, label }], index) => {\n const isFirst = index === 0;\n const isLast = index === devices.length - 1;\n const isActive = key === selectedDevice;\n\n return (\n <Button\n {...{ icon }}\n data-testid={`${label.toLowerCase()}-device-button`}\n key={key}\n size=\"icon\"\n title={label}\n variant=\"outline\"\n className={classnames(\"focus:z-10\", {\n \"rounded-e-none\": isFirst,\n \"-ms-px rounded-none\": !isFirst && !isLast,\n \"-ms-px rounded-s-none\": isLast,\n \"border-primary bg-primary/10 text-primary hover:bg-primary/10 hover:text-primary z-10\":\n isActive,\n })}\n onClick={() => onDeviceChange(key)}\n />\n );\n })}\n </div>\n );\n};\n\nResponsiveDevicePicker.propTypes = {\n /**\n * To specify external classnames as overrides.\n */\n className: PropTypes.string,\n /**\n * To show the active device.\n */\n selectedDevice: PropTypes.string,\n /**\n * Handler function that is triggered when one of the device options are selected.\n */\n onDeviceChange: PropTypes.func,\n};\n\nexport default ResponsiveDevicePicker;\n"],"names":["RESPONSIVE_DEVICES","DESKTOP","TABLET","MOBILE","RESPONSIVE_DEVICES_MAP","_defineProperty","icon","Monitor","label","t","Tablet","Smartphone","ResponsiveDevicePicker","_ref","_ref$className","className","selectedDevice","onDeviceChange","otherProps","_objectWithoutProperties","_excluded","devices","Object","entries","_jsx","_objectSpread","classnames","children","map","_ref2","index","_ref3","_slicedToArray","key","_ref3$","isFirst","isLast","length","isActive","_createElement","Button","concat","toLowerCase","size","title","variant","onClick"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
|
+
import { memo, useState, useMemo, useEffect, createElement } from 'react';
|
|
3
|
+
import { Input, Button, Tooltip, Typography, Spinner } from '@bigbinary/neeto-atoms';
|
|
4
|
+
import { isPresent, hyphenate, noop, filterBy, removeBy } from '@bigbinary/neeto-cist';
|
|
5
|
+
import { pipe, prop, isNil, pluck, not } from 'ramda';
|
|
6
|
+
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
8
|
+
import classnames from 'classnames';
|
|
9
|
+
import Apple from '@bigbinary/neeto-icons/misc/Apple';
|
|
10
|
+
import Chrome from '@bigbinary/neeto-icons/misc/Chrome';
|
|
11
|
+
import Edge from '@bigbinary/neeto-icons/misc/Edge';
|
|
12
|
+
import Firefox from '@bigbinary/neeto-icons/misc/Firefox';
|
|
13
|
+
import Safari from '@bigbinary/neeto-icons/misc/Safari';
|
|
14
|
+
import Ubuntu from '@bigbinary/neeto-icons/misc/Ubuntu';
|
|
15
|
+
import Windows from '@bigbinary/neeto-icons/misc/Windows';
|
|
16
|
+
import { M as Monitor, S as Smartphone } from '../smartphone-B-jv1y8j.js';
|
|
17
|
+
import { G as Globe } from '../globe-rBiI1CjO.js';
|
|
18
|
+
import { c as createLucideIcon } from '../createLucideIcon-mNMhCCpf.js';
|
|
19
|
+
import { U as User } from '../user-A843PT-q.js';
|
|
20
|
+
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
21
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
22
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
23
|
+
import 'formik';
|
|
24
|
+
import { P as PhoneNumberInput } from '../phone-number-CGZtDB_n.js';
|
|
25
|
+
import '../index.es5.min-B2AiaKmd.js';
|
|
26
|
+
import '@babel/runtime/helpers/asyncToGenerator';
|
|
27
|
+
import 'i18next';
|
|
28
|
+
import 'libphonenumber-js/min';
|
|
29
|
+
import '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
30
|
+
import 'yup';
|
|
31
|
+
import 'axios';
|
|
32
|
+
import '@bigbinary/neeto-commons-frontend/v2/utils/general';
|
|
33
|
+
import { X } from '../x-B1Er0oV4.js';
|
|
34
|
+
import { C as Check } from '../check-DvxzqR83.js';
|
|
35
|
+
import CopyToClipboardButton from './CopyToClipboardButton.js';
|
|
36
|
+
import TimeFormat from './TimeFormat.js';
|
|
37
|
+
import HelpPopover from './HelpPopover.js';
|
|
38
|
+
import { C as ChevronUp } from '../chevron-up-B2_LTx_h.js';
|
|
39
|
+
import { C as ChevronDown } from '../chevron-down-BMerqYpK.js';
|
|
40
|
+
import '@bigbinary/neeto-atoms/primitives';
|
|
41
|
+
import '@tanstack/react-query';
|
|
42
|
+
import '../inject-css-C2dztUxs.js';
|
|
43
|
+
import '../_commonjsHelpers-BFTU3MAI.js';
|
|
44
|
+
import '../copy-DhbOoOav.js';
|
|
45
|
+
import './DateFormat.js';
|
|
46
|
+
import '@bigbinary/neeto-commons-frontend/v2/react-utils/useTimer';
|
|
47
|
+
import '@bigbinary/neeto-commons-frontend/v2/utils/datetime';
|
|
48
|
+
import '../circle-question-mark-Dib48f5Z.js';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @license lucide-react v1.7.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
const __iconNode$2 = [
|
|
59
|
+
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
60
|
+
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
61
|
+
];
|
|
62
|
+
const Mail = createLucideIcon("mail", __iconNode$2);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @license lucide-react v1.7.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
const __iconNode$1 = [
|
|
73
|
+
[
|
|
74
|
+
"path",
|
|
75
|
+
{
|
|
76
|
+
d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
|
|
77
|
+
key: "1r0f0z"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
|
|
81
|
+
];
|
|
82
|
+
const MapPin = createLucideIcon("map-pin", __iconNode$1);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @license lucide-react v1.7.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
const __iconNode = [
|
|
93
|
+
[
|
|
94
|
+
"path",
|
|
95
|
+
{
|
|
96
|
+
d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
|
|
97
|
+
key: "9njp5v"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
];
|
|
101
|
+
const Phone = createLucideIcon("phone", __iconNode);
|
|
102
|
+
|
|
103
|
+
var BOOLEAN_VALUES_MAP = {
|
|
104
|
+
"true": "Yes",
|
|
105
|
+
"false": "No"
|
|
106
|
+
};
|
|
107
|
+
var ENTER = "enter";
|
|
108
|
+
var ESCAPE = "escape";
|
|
109
|
+
var PHONE_NUMBER = "phone_number";
|
|
110
|
+
var INTEGER = "integer";
|
|
111
|
+
var ICONS_MAP = {
|
|
112
|
+
name: User,
|
|
113
|
+
user: User,
|
|
114
|
+
email: Mail,
|
|
115
|
+
phone_number: Phone,
|
|
116
|
+
location: MapPin,
|
|
117
|
+
timezone: Globe,
|
|
118
|
+
chrome: Chrome,
|
|
119
|
+
safari: Safari,
|
|
120
|
+
firefox: Firefox,
|
|
121
|
+
edge: Edge,
|
|
122
|
+
ie: Edge,
|
|
123
|
+
windows: Windows,
|
|
124
|
+
mac_os: Apple,
|
|
125
|
+
linux: Ubuntu,
|
|
126
|
+
mobile: Smartphone,
|
|
127
|
+
desktop: Monitor
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
var getInputType = function getInputType(_ref) {
|
|
131
|
+
var name = _ref.name,
|
|
132
|
+
kind = _ref.kind;
|
|
133
|
+
if (name === PHONE_NUMBER) return "tel";else if (kind === INTEGER) return "number";
|
|
134
|
+
return "text";
|
|
135
|
+
};
|
|
136
|
+
var getIcon = function getIcon(_ref2) {
|
|
137
|
+
var iconSize = _ref2.iconSize,
|
|
138
|
+
name = _ref2.name,
|
|
139
|
+
value = _ref2.value;
|
|
140
|
+
var Icon = name === "browser" || name === "os" ? ICONS_MAP[value === null || value === void 0 ? void 0 : value.toLowerCase().replace(" ", "_")] : ICONS_MAP[name];
|
|
141
|
+
return isPresent(Icon) ? /*#__PURE__*/jsx(Icon, {
|
|
142
|
+
size: iconSize
|
|
143
|
+
}) : null;
|
|
144
|
+
};
|
|
145
|
+
var isValuePresent = pipe(prop("value"), isPresent);
|
|
146
|
+
var mergeRefs = function mergeRefs() {
|
|
147
|
+
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
148
|
+
refs[_key] = arguments[_key];
|
|
149
|
+
}
|
|
150
|
+
return function (node) {
|
|
151
|
+
return refs.filter(Boolean).forEach(function (ref) {
|
|
152
|
+
return typeof ref === "function" ? ref(node) : ref.current = node;
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
var EditField = function EditField(_ref) {
|
|
158
|
+
var name = _ref.name,
|
|
159
|
+
error = _ref.error,
|
|
160
|
+
label = _ref.label,
|
|
161
|
+
kind = _ref.kind,
|
|
162
|
+
value = _ref.value,
|
|
163
|
+
handleChange = _ref.handleChange,
|
|
164
|
+
handleMetadataCancel = _ref.handleMetadataCancel,
|
|
165
|
+
handleMetadataSubmit = _ref.handleMetadataSubmit;
|
|
166
|
+
var _useTranslation = useTranslation(),
|
|
167
|
+
t = _useTranslation.t;
|
|
168
|
+
var enterRef = useHotkeys(ENTER, handleMetadataSubmit, {
|
|
169
|
+
mode: "scoped"
|
|
170
|
+
});
|
|
171
|
+
var cancelRef = useHotkeys(ESCAPE, handleMetadataCancel, {
|
|
172
|
+
mode: "scoped"
|
|
173
|
+
});
|
|
174
|
+
var InputComponent = name === PHONE_NUMBER ? PhoneNumberInput : Input;
|
|
175
|
+
return /*#__PURE__*/jsxs("div", {
|
|
176
|
+
className: "relative flex min-w-0 flex-grow items-center",
|
|
177
|
+
children: [/*#__PURE__*/jsx(InputComponent, {
|
|
178
|
+
error: error,
|
|
179
|
+
autoFocus: true,
|
|
180
|
+
className: "w-full [&_input]:pe-[2.8125rem]",
|
|
181
|
+
"data-testid": "metadata-input-".concat(hyphenate(name)),
|
|
182
|
+
placeholder: t("neetoMolecules.common.enter", {
|
|
183
|
+
what: label
|
|
184
|
+
}),
|
|
185
|
+
ref: mergeRefs(enterRef, cancelRef),
|
|
186
|
+
type: getInputType({
|
|
187
|
+
name: name,
|
|
188
|
+
kind: kind
|
|
189
|
+
}),
|
|
190
|
+
value: value || "",
|
|
191
|
+
onChange: handleChange
|
|
192
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
193
|
+
className: "absolute end-0 top-0 flex h-8 items-center pe-1",
|
|
194
|
+
children: [/*#__PURE__*/jsx(Button, {
|
|
195
|
+
"data-testid": "metadata-cancel-".concat(hyphenate(name)),
|
|
196
|
+
icon: X,
|
|
197
|
+
size: "sm",
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
tooltipProps: {
|
|
200
|
+
content: t("neetoMolecules.common.actions.cancel"),
|
|
201
|
+
position: "top"
|
|
202
|
+
},
|
|
203
|
+
onClick: handleMetadataCancel
|
|
204
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
205
|
+
"data-testid": "metadata-submit-".concat(hyphenate(name)),
|
|
206
|
+
icon: Check,
|
|
207
|
+
size: "sm",
|
|
208
|
+
variant: "ghost",
|
|
209
|
+
tooltipProps: {
|
|
210
|
+
content: t("neetoMolecules.common.actions.save"),
|
|
211
|
+
position: "top"
|
|
212
|
+
},
|
|
213
|
+
onClick: handleMetadataSubmit
|
|
214
|
+
})]
|
|
215
|
+
})]
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
var EditField$1 = /*#__PURE__*/memo(EditField);
|
|
219
|
+
|
|
220
|
+
var Item = function Item(_ref) {
|
|
221
|
+
var allowMultiline = _ref.allowMultiline,
|
|
222
|
+
handleCancel = _ref.handleCancel,
|
|
223
|
+
handleSubmit = _ref.handleSubmit,
|
|
224
|
+
iconSize = _ref.iconSize,
|
|
225
|
+
item = _ref.item,
|
|
226
|
+
showIcons = _ref.showIcons;
|
|
227
|
+
var _useState = useState(item.isEditing),
|
|
228
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
229
|
+
isEditing = _useState2[0],
|
|
230
|
+
setIsEditing = _useState2[1];
|
|
231
|
+
var _useState3 = useState(item.value),
|
|
232
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
233
|
+
value = _useState4[0],
|
|
234
|
+
setValue = _useState4[1];
|
|
235
|
+
var _useTranslation = useTranslation(),
|
|
236
|
+
t = _useTranslation.t;
|
|
237
|
+
var icon = item.icon,
|
|
238
|
+
_item$isEditable = item.isEditable,
|
|
239
|
+
isEditable = _item$isEditable === void 0 ? false : _item$isEditable,
|
|
240
|
+
_item$extraClasses = item.extraClasses,
|
|
241
|
+
extraClasses = _item$extraClasses === void 0 ? "" : _item$extraClasses,
|
|
242
|
+
_item$extraWrapperCla = item.extraWrapperClasses,
|
|
243
|
+
extraWrapperClasses = _item$extraWrapperCla === void 0 ? "" : _item$extraWrapperCla,
|
|
244
|
+
id = item.id,
|
|
245
|
+
fieldValueId = item.fieldValueId,
|
|
246
|
+
_item$custom = item.custom,
|
|
247
|
+
custom = _item$custom === void 0 ? false : _item$custom,
|
|
248
|
+
name = item.name,
|
|
249
|
+
kind = item.kind,
|
|
250
|
+
error = item.error,
|
|
251
|
+
label = item.label,
|
|
252
|
+
_item$showCopyButton = item.showCopyButton,
|
|
253
|
+
showCopyButton = _item$showCopyButton === void 0 ? false : _item$showCopyButton;
|
|
254
|
+
var valueToRender = useMemo(function () {
|
|
255
|
+
if (isNil(value)) return "-";
|
|
256
|
+
if (typeof value === "boolean") return BOOLEAN_VALUES_MAP[value.toString()];
|
|
257
|
+
if (name === "email") return value.toLowerCase();
|
|
258
|
+
return value;
|
|
259
|
+
}, [value]);
|
|
260
|
+
var iconToRender = useMemo(function () {
|
|
261
|
+
return icon || getIcon({
|
|
262
|
+
iconSize: iconSize,
|
|
263
|
+
name: name,
|
|
264
|
+
value: value
|
|
265
|
+
});
|
|
266
|
+
}, [icon, iconSize, name, value]);
|
|
267
|
+
var onSuccess = function onSuccess() {
|
|
268
|
+
return setIsEditing(false);
|
|
269
|
+
};
|
|
270
|
+
var handleMetadataSubmit = function handleMetadataSubmit() {
|
|
271
|
+
return handleSubmit({
|
|
272
|
+
fieldId: id,
|
|
273
|
+
fieldValueId: fieldValueId,
|
|
274
|
+
name: name,
|
|
275
|
+
value: value,
|
|
276
|
+
custom: custom,
|
|
277
|
+
onSuccess: onSuccess
|
|
278
|
+
});
|
|
279
|
+
};
|
|
280
|
+
var handleMetadataCancel = function handleMetadataCancel() {
|
|
281
|
+
setIsEditing(false);
|
|
282
|
+
setValue(item.value);
|
|
283
|
+
handleCancel(name);
|
|
284
|
+
};
|
|
285
|
+
var handleChange = function handleChange(event) {
|
|
286
|
+
var value = name === PHONE_NUMBER ? event : event.target.value;
|
|
287
|
+
setValue(value);
|
|
288
|
+
};
|
|
289
|
+
useEffect(function () {
|
|
290
|
+
setValue(item.value);
|
|
291
|
+
}, [item]);
|
|
292
|
+
var labelKey = hyphenate(name !== null && name !== void 0 ? name : label);
|
|
293
|
+
return /*#__PURE__*/jsxs("div", {
|
|
294
|
+
"data-testid": "metadata-".concat(labelKey, "-container"),
|
|
295
|
+
className: classnames("mb-3 flex place-items-center gap-2 align-middle", extraWrapperClasses, {
|
|
296
|
+
"flex-wrap": name !== PHONE_NUMBER && allowMultiline,
|
|
297
|
+
"flex-nowrap": !allowMultiline
|
|
298
|
+
}),
|
|
299
|
+
children: [showIcons && isPresent(iconToRender) ? /*#__PURE__*/jsx(Tooltip, {
|
|
300
|
+
content: label || t("neetoMolecules.sessionEnvironment.details.keys.".concat(name)),
|
|
301
|
+
children: /*#__PURE__*/jsx("div", {
|
|
302
|
+
className: "flex-shrink-0",
|
|
303
|
+
children: iconToRender
|
|
304
|
+
})
|
|
305
|
+
}) : /*#__PURE__*/jsx(Typography, {
|
|
306
|
+
className: "text-muted-foreground whitespace-nowrap",
|
|
307
|
+
"data-testid": "metadata-label-".concat(labelKey),
|
|
308
|
+
variant: "body2",
|
|
309
|
+
children: label || t("neetoMolecules.sessionEnvironment.details.keys.".concat(name))
|
|
310
|
+
}), !isEditing ? /*#__PURE__*/jsxs(Fragment, {
|
|
311
|
+
children: [kind === "datetime" ? /*#__PURE__*/jsx(TimeFormat.DateWeekTime, {
|
|
312
|
+
date: value,
|
|
313
|
+
typographyProps: {
|
|
314
|
+
variant: "body2",
|
|
315
|
+
weight: "medium",
|
|
316
|
+
className: classnames("overflow-hidden truncate whitespace-normal break-all ".concat(extraClasses), {
|
|
317
|
+
"whitespace-nowrap": !allowMultiline
|
|
318
|
+
})
|
|
319
|
+
}
|
|
320
|
+
}) : /*#__PURE__*/jsx(Tooltip, {
|
|
321
|
+
content: valueToRender,
|
|
322
|
+
position: "top",
|
|
323
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
324
|
+
"data-testid": "metadata-value-".concat(labelKey),
|
|
325
|
+
variant: "body2",
|
|
326
|
+
weight: "medium",
|
|
327
|
+
className: classnames("truncate overflow-hidden break-all whitespace-normal ".concat(extraClasses), {
|
|
328
|
+
"hover:border-input cursor-pointer rounded border border-transparent p-0.5 transition-colors motion-reduce:transition-none": isEditable,
|
|
329
|
+
"whitespace-nowrap": !allowMultiline
|
|
330
|
+
}),
|
|
331
|
+
onClick: function onClick() {
|
|
332
|
+
return isEditable && setIsEditing(true);
|
|
333
|
+
},
|
|
334
|
+
children: valueToRender
|
|
335
|
+
})
|
|
336
|
+
}), showCopyButton && /*#__PURE__*/jsx(CopyToClipboardButton, {
|
|
337
|
+
className: "flex-shrink-0",
|
|
338
|
+
value: valueToRender,
|
|
339
|
+
variant: "ghost"
|
|
340
|
+
})]
|
|
341
|
+
}) : /*#__PURE__*/jsx(EditField$1, {
|
|
342
|
+
error: error,
|
|
343
|
+
handleChange: handleChange,
|
|
344
|
+
handleMetadataCancel: handleMetadataCancel,
|
|
345
|
+
handleMetadataSubmit: handleMetadataSubmit,
|
|
346
|
+
kind: kind,
|
|
347
|
+
label: label,
|
|
348
|
+
name: name,
|
|
349
|
+
value: value
|
|
350
|
+
})]
|
|
351
|
+
});
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
355
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
356
|
+
var DetailsBlock = function DetailsBlock(_ref) {
|
|
357
|
+
var _ref$allowMultiline = _ref.allowMultiline,
|
|
358
|
+
allowMultiline = _ref$allowMultiline === void 0 ? true : _ref$allowMultiline,
|
|
359
|
+
details = _ref.details,
|
|
360
|
+
_ref$handleCancel = _ref.handleCancel,
|
|
361
|
+
handleCancel = _ref$handleCancel === void 0 ? noop : _ref$handleCancel,
|
|
362
|
+
_ref$handleSubmit = _ref.handleSubmit,
|
|
363
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
364
|
+
helpPopoverProps = _ref.helpPopoverProps,
|
|
365
|
+
iconSize = _ref.iconSize,
|
|
366
|
+
_ref$showIcons = _ref.showIcons,
|
|
367
|
+
showIcons = _ref$showIcons === void 0 ? false : _ref$showIcons,
|
|
368
|
+
_ref$title = _ref.title,
|
|
369
|
+
title = _ref$title === void 0 ? "" : _ref$title;
|
|
370
|
+
return /*#__PURE__*/jsxs("div", {
|
|
371
|
+
className: "mb-4",
|
|
372
|
+
"data-testid": "details-block-items-parent",
|
|
373
|
+
children: [title && /*#__PURE__*/jsxs("div", {
|
|
374
|
+
className: "mb-2 flex items-center gap-2",
|
|
375
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
376
|
+
className: "text-foreground uppercase",
|
|
377
|
+
variant: "h5",
|
|
378
|
+
weight: "bold",
|
|
379
|
+
children: title
|
|
380
|
+
}), isPresent(helpPopoverProps) && /*#__PURE__*/jsx(HelpPopover, _objectSpread({}, helpPopoverProps))]
|
|
381
|
+
}), details.filter(function (detail) {
|
|
382
|
+
return detail.isEditable || isValuePresent(detail);
|
|
383
|
+
}).map(function (detail, index) {
|
|
384
|
+
return /*#__PURE__*/createElement(Item, {
|
|
385
|
+
allowMultiline: allowMultiline,
|
|
386
|
+
handleCancel: handleCancel,
|
|
387
|
+
handleSubmit: handleSubmit,
|
|
388
|
+
iconSize: iconSize,
|
|
389
|
+
showIcons: showIcons,
|
|
390
|
+
item: detail,
|
|
391
|
+
key: index
|
|
392
|
+
});
|
|
393
|
+
})]
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
var DetailsBlock$1 = /*#__PURE__*/memo(DetailsBlock);
|
|
397
|
+
|
|
398
|
+
var SessionEnvironment = function SessionEnvironment(_ref) {
|
|
399
|
+
var _ref$allowMultiline = _ref.allowMultiline,
|
|
400
|
+
allowMultiline = _ref$allowMultiline === void 0 ? false : _ref$allowMultiline,
|
|
401
|
+
details = _ref.details,
|
|
402
|
+
_ref$handleCancel = _ref.handleCancel,
|
|
403
|
+
handleCancel = _ref$handleCancel === void 0 ? noop : _ref$handleCancel,
|
|
404
|
+
_ref$handleSubmit = _ref.handleSubmit,
|
|
405
|
+
handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
|
|
406
|
+
_ref$helpPopoverProps = _ref.helpPopoverProps,
|
|
407
|
+
helpPopoverProps = _ref$helpPopoverProps === void 0 ? {} : _ref$helpPopoverProps,
|
|
408
|
+
_ref$iconSize = _ref.iconSize,
|
|
409
|
+
iconSize = _ref$iconSize === void 0 ? 20 : _ref$iconSize,
|
|
410
|
+
_ref$isLoading = _ref.isLoading,
|
|
411
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
412
|
+
_ref$moreDetails = _ref.moreDetails,
|
|
413
|
+
moreDetails = _ref$moreDetails === void 0 ? [] : _ref$moreDetails,
|
|
414
|
+
_ref$title = _ref.title,
|
|
415
|
+
title = _ref$title === void 0 ? "" : _ref$title;
|
|
416
|
+
var _useState = useState(false),
|
|
417
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
418
|
+
showViewMore = _useState2[0],
|
|
419
|
+
setShowViewMore = _useState2[1];
|
|
420
|
+
var customViewMoreItems = useMemo(function () {
|
|
421
|
+
return filterBy({
|
|
422
|
+
kind: "custom"
|
|
423
|
+
}, moreDetails);
|
|
424
|
+
}, [moreDetails]);
|
|
425
|
+
var _useTranslation = useTranslation(),
|
|
426
|
+
t = _useTranslation.t;
|
|
427
|
+
if (isLoading) {
|
|
428
|
+
return /*#__PURE__*/jsx("div", {
|
|
429
|
+
className: "flex h-full w-full items-center justify-center",
|
|
430
|
+
children: /*#__PURE__*/jsx(Spinner, {
|
|
431
|
+
"data-testid": "neeto-ui-spinner"
|
|
432
|
+
})
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
return /*#__PURE__*/jsxs("div", {
|
|
436
|
+
className: "w-full",
|
|
437
|
+
children: [/*#__PURE__*/jsx(DetailsBlock$1, {
|
|
438
|
+
allowMultiline: allowMultiline,
|
|
439
|
+
details: details,
|
|
440
|
+
handleCancel: handleCancel,
|
|
441
|
+
handleSubmit: handleSubmit,
|
|
442
|
+
helpPopoverProps: helpPopoverProps,
|
|
443
|
+
iconSize: iconSize,
|
|
444
|
+
title: title,
|
|
445
|
+
showIcons: true
|
|
446
|
+
}), showViewMore && /*#__PURE__*/jsxs(Fragment, {
|
|
447
|
+
children: [/*#__PURE__*/jsx("hr", {
|
|
448
|
+
className: "border-border my-4"
|
|
449
|
+
}), /*#__PURE__*/jsx(DetailsBlock$1, {
|
|
450
|
+
handleCancel: handleCancel,
|
|
451
|
+
handleSubmit: handleSubmit,
|
|
452
|
+
helpPopoverProps: helpPopoverProps,
|
|
453
|
+
iconSize: iconSize,
|
|
454
|
+
details: removeBy({
|
|
455
|
+
kind: "custom"
|
|
456
|
+
}, moreDetails)
|
|
457
|
+
}), isPresent(customViewMoreItems) && /*#__PURE__*/jsxs(Fragment, {
|
|
458
|
+
children: [/*#__PURE__*/jsx("hr", {
|
|
459
|
+
className: "border-border my-4"
|
|
460
|
+
}), pluck("value", customViewMoreItems)]
|
|
461
|
+
})]
|
|
462
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
463
|
+
className: "mb-4",
|
|
464
|
+
"data-testid": "view-more-less-button",
|
|
465
|
+
icon: showViewMore ? ChevronUp : ChevronDown,
|
|
466
|
+
variant: "link",
|
|
467
|
+
label: showViewMore ? t("neetoMolecules.sessionEnvironment.viewLess") : t("neetoMolecules.sessionEnvironment.viewMore"),
|
|
468
|
+
onClick: function onClick() {
|
|
469
|
+
return setShowViewMore(not);
|
|
470
|
+
}
|
|
471
|
+
})]
|
|
472
|
+
});
|
|
473
|
+
};
|
|
474
|
+
var index = /*#__PURE__*/memo(SessionEnvironment);
|
|
475
|
+
|
|
476
|
+
export { index as default };
|
|
477
|
+
//# sourceMappingURL=SessionEnvironment.js.map
|