@bigbinary/neeto-molecules 3.16.22 → 3.16.23
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/HelpPopover.js +3 -0
- package/dist/HelpPopover.js.map +1 -1
- package/dist/ShareViaLink.js +8 -5
- package/dist/ShareViaLink.js.map +1 -1
- package/dist/cjs/HelpPopover.js +3 -0
- package/dist/cjs/HelpPopover.js.map +1 -1
- package/dist/cjs/ShareViaLink.js +8 -5
- package/dist/cjs/ShareViaLink.js.map +1 -1
- package/package.json +1 -1
- package/types/ShareViaLink.d.ts +8 -0
package/dist/HelpPopover.js
CHANGED
|
@@ -54,6 +54,9 @@ var HelpPopover = function HelpPopover(_ref) {
|
|
|
54
54
|
}, popoverProps), {}, {
|
|
55
55
|
children: /*#__PURE__*/jsxs("div", {
|
|
56
56
|
className: "flex flex-col",
|
|
57
|
+
onClick: function onClick(event) {
|
|
58
|
+
return event.stopPropagation();
|
|
59
|
+
},
|
|
57
60
|
children: [title && /*#__PURE__*/jsx(Popover.Title, {
|
|
58
61
|
"data-cy": "help-popover-title",
|
|
59
62
|
"data-testid": "help-popover-title",
|
package/dist/HelpPopover.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpPopover.js","sources":["../src/components/HelpPopover/constants.js","../src/components/HelpPopover/index.jsx"],"sourcesContent":["export const SIZE = { default: 16, large: 20 };\n","import { useRef } from \"react\";\n\nimport classNames from \"classnames\";\nimport { Help } from \"neetoicons\";\nimport { Button, Popover, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SIZE } from \"./constants\";\n\nconst HelpPopover = ({\n title,\n size = \"default\",\n description,\n helpLinkProps,\n popoverProps,\n className,\n iconColor = \"currentColor\",\n icon: IconComponent = Help,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const popoverRef = useRef();\n\n return (\n <>\n <Button\n {...otherProps}\n data-cy=\"help-popover-button\"\n data-testid=\"help-popover-button\"\n icon={() => <IconComponent color={iconColor} size={SIZE[size]} />}\n ref={popoverRef}\n style=\"text\"\n className={classNames(\n \"neeto-molecule-help-popover-trigger neeto-ui-rounded-full bg-transparent p-0\",\n className\n )}\n />\n <Popover\n appendTo={() => document.body}\n reference={popoverRef}\n {...popoverProps}\n >\n <div
|
|
1
|
+
{"version":3,"file":"HelpPopover.js","sources":["../src/components/HelpPopover/constants.js","../src/components/HelpPopover/index.jsx"],"sourcesContent":["export const SIZE = { default: 16, large: 20 };\n","import { useRef } from \"react\";\n\nimport classNames from \"classnames\";\nimport { Help } from \"neetoicons\";\nimport { Button, Popover, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SIZE } from \"./constants\";\n\nconst HelpPopover = ({\n title,\n size = \"default\",\n description,\n helpLinkProps,\n popoverProps,\n className,\n iconColor = \"currentColor\",\n icon: IconComponent = Help,\n ...otherProps\n}) => {\n const { t } = useTranslation();\n\n const popoverRef = useRef();\n\n return (\n <>\n <Button\n {...otherProps}\n data-cy=\"help-popover-button\"\n data-testid=\"help-popover-button\"\n icon={() => <IconComponent color={iconColor} size={SIZE[size]} />}\n ref={popoverRef}\n style=\"text\"\n className={classNames(\n \"neeto-molecule-help-popover-trigger neeto-ui-rounded-full bg-transparent p-0\",\n className\n )}\n />\n <Popover\n appendTo={() => document.body}\n reference={popoverRef}\n {...popoverProps}\n >\n <div\n className=\"flex flex-col\"\n onClick={event => event.stopPropagation()}\n >\n {title && (\n <Popover.Title\n data-cy=\"help-popover-title\"\n data-testid=\"help-popover-title\"\n >\n {title}\n </Popover.Title>\n )}\n {typeof description === \"string\" ? (\n <Typography\n data-cy=\"help-popover-description\"\n data-testid=\"help-popover-description\"\n lineHeight=\"normal\"\n style=\"body2\"\n >\n {description}\n </Typography>\n ) : (\n description\n )}\n {helpLinkProps && (\n <Button\n className=\"neeto-ui-mt-3\"\n data-cy=\"help-popover-link-button\"\n label={t(\"neetoMolecules.common.viewHelpArticle\")}\n size=\"small\"\n {...helpLinkProps}\n data-testid=\"help-popover-link-button\"\n style=\"link\"\n target=\"_blank\"\n />\n )}\n </div>\n </Popover>\n </>\n );\n};\n\nHelpPopover.propTypes = {\n /**\n * To set the title of the help popover.\n */\n title: PropTypes.string,\n /**\n * To set the size of the popover help icon.\n */\n size: PropTypes.oneOf([\"default\", \"large\"]),\n /**\n * To set the description of the popover, this can be a string or a custom component.\n */\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /**\n * To set the props of the help link which is displayed below the description.\n */\n helpLinkProps: PropTypes.object,\n /**\n * To set the props of the popover to customize it further.\n */\n popoverProps: PropTypes.object,\n /**\n * Additional classes passed on to the help button element.\n */\n className: PropTypes.string,\n /**\n * To set the default icon color of the help icon.\n */\n iconColor: PropTypes.string,\n /**\n * To customize the icon of the help popover.\n */\n icon: PropTypes.node,\n};\n\nexport default HelpPopover;\n"],"names":["SIZE","large","HelpPopover","_ref","title","_ref$size","size","description","helpLinkProps","popoverProps","className","_ref$iconColor","iconColor","_ref$icon","icon","IconComponent","Help","otherProps","_objectWithoutProperties","_excluded","_useTranslation","useTranslation","t","popoverRef","useRef","_jsxs","_Fragment","children","_jsx","Button","_objectSpread","color","ref","style","classNames","Popover","appendTo","document","body","reference","onClick","event","stopPropagation","Title","Typography","lineHeight","label","target"],"mappings":";;;;;;;;;;;AAAO,IAAMA,IAAI,GAAG;AAAE,EAAA,SAAA,EAAS,EAAE;AAAEC,EAAAA,KAAK,EAAE,EAAA;AAAG,CAAC;;;;;ACU9C,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAAC,IAAA,EAUX;AAAA,EAAA,IATJC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAAC,SAAA,GAAAF,IAAA,CACLG,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAG,KAAA,CAAA,GAAA,SAAS,GAAAA,SAAA;IAChBE,WAAW,G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,KAAA,CACC,CAAC,CAAA;AAAA,GACV,CAAC,CAAA;AAEP;;;;"}
|
package/dist/ShareViaLink.js
CHANGED
|
@@ -37,6 +37,7 @@ import DatePicker from '@bigbinary/neetoui/DatePicker';
|
|
|
37
37
|
import Share from '@bigbinary/neeto-icons/Share';
|
|
38
38
|
import QrCode from '@bigbinary/neeto-icons/QrCode';
|
|
39
39
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
40
|
+
import HelpPopover from './HelpPopover.js';
|
|
40
41
|
import LeftArrow from '@bigbinary/neeto-icons/LeftArrow';
|
|
41
42
|
import CardLayout from './CardLayout.js';
|
|
42
43
|
import Header$1 from './Header.js';
|
|
@@ -51,9 +52,8 @@ import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
|
51
52
|
import '@bigbinary/neeto-icons/MenuVertical';
|
|
52
53
|
import '@bigbinary/neetoui/Dropdown';
|
|
53
54
|
import '@bigbinary/neetoui/Tooltip';
|
|
54
|
-
import './Breadcrumbs.js';
|
|
55
|
-
import './HelpPopover.js';
|
|
56
55
|
import '@bigbinary/neetoui/Popover';
|
|
56
|
+
import './Breadcrumbs.js';
|
|
57
57
|
import './Search.js';
|
|
58
58
|
import '@bigbinary/neeto-commons-frontend/react-utils/useFuncDebounce';
|
|
59
59
|
import '@bigbinary/neeto-commons-frontend/react-utils/useQueryParams';
|
|
@@ -540,7 +540,7 @@ var Link = function Link(_ref) {
|
|
|
540
540
|
});
|
|
541
541
|
};
|
|
542
542
|
|
|
543
|
-
var _excluded = ["title", "link", "description", "Icon", "onClick"];
|
|
543
|
+
var _excluded = ["title", "link", "description", "Icon", "onClick", "helpPopoverProps"];
|
|
544
544
|
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; }
|
|
545
545
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).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; }
|
|
546
546
|
var Card = function Card(_ref) {
|
|
@@ -550,6 +550,7 @@ var Card = function Card(_ref) {
|
|
|
550
550
|
Icon = _ref.Icon,
|
|
551
551
|
_ref$onClick = _ref.onClick,
|
|
552
552
|
onClick = _ref$onClick === void 0 ? noop : _ref$onClick,
|
|
553
|
+
helpPopoverProps = _ref.helpPopoverProps,
|
|
553
554
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
554
555
|
var Component = isPresent(link) ? Link$1 : "div";
|
|
555
556
|
return /*#__PURE__*/jsxs(Component, _objectSpread(_objectSpread({
|
|
@@ -566,7 +567,7 @@ var Card = function Card(_ref) {
|
|
|
566
567
|
className: "min-w-0 flex-grow break-words",
|
|
567
568
|
style: "h4",
|
|
568
569
|
children: title
|
|
569
|
-
})]
|
|
570
|
+
}), helpPopoverProps && /*#__PURE__*/jsx(HelpPopover, _objectSpread({}, helpPopoverProps))]
|
|
570
571
|
}), description && /*#__PURE__*/jsx(Typography, {
|
|
571
572
|
className: "break-words",
|
|
572
573
|
lineHeight: "normal",
|
|
@@ -600,10 +601,12 @@ var ShareBlock = function ShareBlock(_ref) {
|
|
|
600
601
|
Icon = _ref2.icon,
|
|
601
602
|
onClick = _ref2.onClick,
|
|
602
603
|
dataCy = _ref2.dataCy,
|
|
603
|
-
description = _ref2.description
|
|
604
|
+
description = _ref2.description,
|
|
605
|
+
helpPopoverProps = _ref2.helpPopoverProps;
|
|
604
606
|
return /*#__PURE__*/createElement(Card, {
|
|
605
607
|
Icon: Icon,
|
|
606
608
|
description: description,
|
|
609
|
+
helpPopoverProps: helpPopoverProps,
|
|
607
610
|
link: link,
|
|
608
611
|
onClick: onClick,
|
|
609
612
|
title: title,
|