@bigbinary/neeto-molecules 4.0.60 → 4.0.62

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.
@@ -11,8 +11,9 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
12
12
  import classnames from 'classnames';
13
13
  import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils/general';
14
- import Dropdown from '@bigbinary/neetoui/Dropdown';
15
14
  import Typography from '@bigbinary/neetoui/Typography';
15
+ import MoreDropdown from './MoreDropdown.js';
16
+ import Dropdown from '@bigbinary/neetoui/Dropdown';
16
17
  import { useTranslation } from 'react-i18next';
17
18
  import { createElement } from 'react';
18
19
  import PublishBlock from './PublishBlock.js';
@@ -28,7 +29,6 @@ import '@bigbinary/neetoui/Button';
28
29
  import '@bigbinary/neetoui/Input';
29
30
  import '@babel/runtime/helpers/toConsumableArray';
30
31
  import '@bigbinary/neeto-commons-frontend/react-utils';
31
- import './MoreDropdown.js';
32
32
  import '@bigbinary/neeto-icons/MenuHorizontal';
33
33
  import '@bigbinary/neeto-icons/MenuVertical';
34
34
  import '@bigbinary/neeto-commons-frontend/react-utils/withT';
@@ -51,8 +51,8 @@ var DEFAULT_HOME_BUTTON_PROPS = {
51
51
  icon: /*#__PURE__*/jsx(Home, {})
52
52
  };
53
53
 
54
- function ownKeys$2(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; }
55
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
54
+ function ownKeys$3(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; }
55
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
56
56
  var LeftBlock = function LeftBlock(_ref) {
57
57
  var customHomeButtonProps = _ref.homeButtonProps,
58
58
  homeUrl = _ref.homeUrl,
@@ -76,88 +76,125 @@ var LeftBlock = function LeftBlock(_ref) {
76
76
  children: homeButtonProps.icon
77
77
  })
78
78
  })
79
- }), isPresent(renameProps) && /*#__PURE__*/jsx(Rename, _objectSpread$2({
79
+ }), isPresent(renameProps) && /*#__PURE__*/jsx(Rename, _objectSpread$3({
80
80
  dropdownItems: renameProps.dropdownItems,
81
81
  value: renameProps.value
82
82
  }, renameProps)), children]
83
83
  });
84
84
  };
85
85
 
86
- var _excluded = ["key", "label", "disabled"],
87
- _excluded2 = ["key", "to", "label", "disabled"];
88
- function ownKeys$1(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; }
89
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
86
+ var _excluded$1 = ["key", "to", "label", "disabled"],
87
+ _excluded2 = ["key", "label"];
88
+ function ownKeys$2(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; }
89
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
90
90
  var Menu = Dropdown.Menu,
91
91
  MenuItem = Dropdown.MenuItem;
92
- var NavigationLinks = function NavigationLinks(_ref) {
93
- var headerLinks = _ref.headerLinks,
94
- _ref$maxVisibleLinks = _ref.maxVisibleLinks,
95
- maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
92
+ var OverflowLinks = function OverflowLinks(_ref) {
93
+ var overflowLinks = _ref.overflowLinks;
96
94
  var _useLocation = useLocation(),
97
95
  pathname = _useLocation.pathname;
98
96
  var _useTranslation = useTranslation(),
99
97
  t = _useTranslation.t;
100
- var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
101
- var overflowLinks = headerLinks.slice(maxVisibleLinks);
102
98
  var isMoreButtonActive = existsBy({
103
99
  to: pathname
104
100
  }, overflowLinks);
101
+ if (!isNotEmpty(overflowLinks)) {
102
+ return null;
103
+ }
104
+ return /*#__PURE__*/jsx(Dropdown, {
105
+ buttonStyle: "text",
106
+ label: t("neetoMolecules.navigationHeader.more"),
107
+ position: "bottom-end",
108
+ buttonProps: {
109
+ className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
110
+ active: isMoreButtonActive
111
+ })
112
+ },
113
+ children: /*#__PURE__*/jsx(Menu, {
114
+ children: overflowLinks.map(function (_ref2) {
115
+ var key = _ref2.key,
116
+ to = _ref2.to,
117
+ label = _ref2.label,
118
+ disabled = _ref2.disabled,
119
+ rest = _objectWithoutProperties(_ref2, _excluded$1);
120
+ var isActive = to === pathname;
121
+ var menuButton = /*#__PURE__*/createElement(MenuItem.Button, _objectSpread$2({
122
+ isActive: isActive,
123
+ to: to,
124
+ "data-cy": "".concat(joinHyphenCase(key), "-more-tab"),
125
+ isDisabled: disabled,
126
+ key: key,
127
+ onClick: function onClick(e) {
128
+ return disabled && e.preventDefault();
129
+ }
130
+ }, rest), label);
131
+ if (isActive && rest.moreOptions && isNotEmpty(rest.moreOptions.menuItems)) {
132
+ return /*#__PURE__*/jsx(Dropdown, {
133
+ customTarget: menuButton,
134
+ position: "right-start",
135
+ trigger: "hover",
136
+ children: /*#__PURE__*/jsx(Menu, {
137
+ children: rest.moreOptions.menuItems.map(function (_ref3) {
138
+ var key = _ref3.key,
139
+ label = _ref3.label,
140
+ itemProps = _objectWithoutProperties(_ref3, _excluded2);
141
+ return /*#__PURE__*/jsx(MenuItem.Button, _objectSpread$2(_objectSpread$2({}, itemProps), {}, {
142
+ children: label
143
+ }), key);
144
+ })
145
+ })
146
+ }, "".concat(key, "-nested-dropdown"));
147
+ }
148
+ return menuButton;
149
+ })
150
+ })
151
+ });
152
+ };
153
+
154
+ var _excluded = ["className", "key", "label", "disabled", "labelProps", "moreOptions"];
155
+ function ownKeys$1(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; }
156
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
157
+ var NavigationLinks = function NavigationLinks(_ref) {
158
+ var headerLinks = _ref.headerLinks,
159
+ _ref$maxVisibleLinks = _ref.maxVisibleLinks,
160
+ maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
161
+ var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
162
+ var overflowLinks = headerLinks.slice(maxVisibleLinks);
105
163
  return /*#__PURE__*/jsxs("div", {
106
164
  className: "font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6",
107
165
  "data-cy": "navigation-header-navigation-links",
108
166
  "data-testid": "navigation-header-navigation-links",
109
167
  children: [visibleLinks.map(function (_ref2) {
110
- var key = _ref2.key,
168
+ var _ref2$className = _ref2.className,
169
+ className = _ref2$className === void 0 ? "" : _ref2$className,
170
+ key = _ref2.key,
111
171
  label = _ref2.label,
112
172
  disabled = _ref2.disabled,
173
+ labelProps = _ref2.labelProps,
174
+ moreOptions = _ref2.moreOptions,
113
175
  rest = _objectWithoutProperties(_ref2, _excluded);
114
- return /*#__PURE__*/jsx(NavLink, _objectSpread$1(_objectSpread$1({
176
+ return /*#__PURE__*/jsxs(NavLink, _objectSpread$1(_objectSpread$1({
115
177
  activeClassName: "active",
116
178
  "data-cy": "".concat(joinHyphenCase(key), "-tab"),
117
179
  "data-testid": "".concat(joinHyphenCase(key), "-tab"),
118
- className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", {
180
+ className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", className, {
119
181
  disabled: disabled
120
182
  }),
121
183
  onClick: function onClick(e) {
122
184
  return disabled && e.preventDefault();
123
185
  }
124
186
  }, rest), {}, {
125
- children: /*#__PURE__*/jsx(Typography, {
187
+ children: [/*#__PURE__*/jsx(Typography, _objectSpread$1(_objectSpread$1({
126
188
  component: "span",
127
189
  lineHeight: "normal",
128
190
  style: "h4",
129
- weight: "semibold",
191
+ weight: "semibold"
192
+ }, labelProps || {}), {}, {
130
193
  children: label
131
- })
194
+ })), moreOptions && /*#__PURE__*/jsx(MoreDropdown, _objectSpread$1({}, moreOptions))]
132
195
  }), key);
133
- }), isNotEmpty(overflowLinks) && /*#__PURE__*/jsx(Dropdown, {
134
- buttonStyle: "text",
135
- label: t("neetoMolecules.navigationHeader.more"),
136
- position: "bottom-end",
137
- buttonProps: {
138
- className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
139
- active: isMoreButtonActive
140
- })
141
- },
142
- children: /*#__PURE__*/jsx(Menu, {
143
- children: overflowLinks.map(function (_ref3) {
144
- var key = _ref3.key,
145
- to = _ref3.to,
146
- label = _ref3.label,
147
- disabled = _ref3.disabled,
148
- rest = _objectWithoutProperties(_ref3, _excluded2);
149
- return /*#__PURE__*/createElement(MenuItem.Button, _objectSpread$1({
150
- to: to,
151
- "data-cy": "".concat(joinHyphenCase(key), "-more-tab"),
152
- isActive: to === pathname,
153
- isDisabled: disabled,
154
- key: key,
155
- onClick: function onClick(e) {
156
- return disabled && e.preventDefault();
157
- }
158
- }, rest), label);
159
- })
160
- })
196
+ }), /*#__PURE__*/jsx(OverflowLinks, {
197
+ overflowLinks: overflowLinks
161
198
  })]
162
199
  });
163
200
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationHeader.js","sources":["../src/components/NavigationHeader/constants.jsx","../src/components/NavigationHeader/LeftBlock.jsx","../src/components/NavigationHeader/Navigation.jsx","../src/components/NavigationHeader/utils.js","../src/components/NavigationHeader/RightBlock.jsx","../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(({ key, label, disabled, ...rest }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => (\n <MenuItem.Button\n {...{ to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isActive={to === pathname}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","_ref2","key","label","disabled","rest","_objectWithoutProperties","_excluded","NavLink","activeClassName","concat","joinHyphenCase","classNames","onClick","e","preventDefault","Typography","component","lineHeight","style","weight","isNotEmpty","buttonStyle","buttonProps","active","_ref3","_excluded2","_createElement","Button","isActive","isDisabled","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,CAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,GAAA,CAACC,IAAI,EAAA,EAAE;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,GAAAK,IAAA,CAAPL,OAAO;IACPQ,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;AAER,EAAA,IAAMF,eAAe,GAAGG,cAAc,CACpCf,yBAAyB,EACzBW,qBACF,CAAC;AAED,EAAA,oBACEK,IAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,kCAAkC;AAC5C,IAAA,SAAA,EAAQ,8BAA8B;AACtC,IAAA,aAAA,EAAY,8BAA8B;IAAAH,QAAA,EAAA,cAE1CP,GAAA,CAACW,OAAO,EAAA;AACNhB,MAAAA,OAAO,EAAEU,eAAe,CAACX,OAAO,CAACC,OAAQ;AACzCE,MAAAA,QAAQ,EAAEQ,eAAe,CAACX,OAAO,CAACG,QAAS;AAC3Ce,MAAAA,KAAK,EAAE,CAAC,MAAM,EAAE,GAAG,CAAE;MAAAL,QAAA,eAErBP,GAAA,CAACa,IAAI,EAAA;AAAC,QAAA,SAAA,EAAQ,aAAa;AAAC,QAAA,aAAA,E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MAAM,CAACtG,SAAS,EAAE,CAAC6F,eAAe,EAAEC,eAAe,EAAEC,gBAAgB,CAAC,CACxE,CAAC;AAED,EAAA,IAAMQ,SAAS,GAAG;AAChBC,IAAAA,mBAAmB,EAAEL,QAAQ,GAAA,SAAA,CAAAnE,MAAA,CAEvB8D,eAAe,GAAGM,gBAAgB,GAAG,CAAC,GAAGA,gBAAgB,EAAA,SAAA,CAAA,GAAA,SAAA,CAAApE,MAAA,CAEjDoE,gBAAgB,EAAA,QAAA;GAC/B;AAED,EAAA,oBACE1G,IAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAC,QAAQ;AAAAH,IAAAA,QAAA,gBACrBP,GAAA,CAAA,KAAA,EAAA;AACEU,MAAAA,SAAS,EAAC,6KAA6K;AACvL,MAAA,SAAA,EAAQ,mBAAmB;AAC3B,MAAA,aAAA,EAAY,mBAAmB;AAAAH,MAAAA,QAAA,eAE/BE,IAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,mBAAmB;AAAC8C,QAAAA,KAAK,EAAE8D,SAAU;QAAA/G,QAAA,EAAA,CACjDqG,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACPlH,GAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKsG;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGtH,SAAS;AAC5CyG,gBAAgB,CAACpF,eAAe,GAAGA,eAAe;AAClDoF,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
1
+ {"version":3,"file":"NavigationHeader.js","sources":["../src/components/NavigationHeader/constants.jsx","../src/components/NavigationHeader/LeftBlock.jsx","../src/components/NavigationHeader/OverflowLinks.jsx","../src/components/NavigationHeader/Navigation.jsx","../src/components/NavigationHeader/utils.js","../src/components/NavigationHeader/RightBlock.jsx","../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst OverflowLinks = ({ overflowLinks }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n if (!isNotEmpty(overflowLinks)) {\n return null;\n }\n\n return (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => {\n const isActive = to === pathname;\n const menuButton = (\n <MenuItem.Button\n {...{ isActive, to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n );\n\n if (\n isActive &&\n rest.moreOptions &&\n isNotEmpty(rest.moreOptions.menuItems)\n ) {\n return (\n <Dropdown\n customTarget={menuButton}\n key={`${key}-nested-dropdown`}\n position=\"right-start\"\n trigger=\"hover\"\n >\n <Menu>\n {rest.moreOptions.menuItems.map(\n ({ key, label, ...itemProps }) => (\n <MenuItem.Button key={key} {...itemProps}>\n {label}\n </MenuItem.Button>\n )\n )}\n </Menu>\n </Dropdown>\n );\n }\n\n return menuButton;\n })}\n </Menu>\n </Dropdown>\n );\n};\n\nOverflowLinks.propTypes = {\n /**\n * Array of overflow links to be displayed in the more dropdown\n */\n overflowLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n disabled: PropTypes.bool,\n moreOptions: PropTypes.shape({\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n};\n\nexport default OverflowLinks;\n","import classNames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { NavLink } from \"react-router-dom\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nimport OverflowLinks from \"./OverflowLinks\";\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(\n ({\n className = \"\",\n key,\n label,\n disabled,\n labelProps,\n moreOptions,\n ...rest\n }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n className,\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n {...(labelProps || {})}\n >\n {label}\n </Typography>\n {/*\n TODO: In future, render this MoreDropdown only for Active links\n Ref: https://github.com/neetozone/neeto-molecules/issues/2610\n */}\n {moreOptions && <MoreDropdown {...moreOptions} />}\n </NavLink>\n )\n )}\n <OverflowLinks {...{ overflowLinks }} />\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n className: PropTypes.string,\n labelProps: PropTypes.shape({ lineHeight: PropTypes.string }),\n moreOptions: PropTypes.shape({\n isVertical: PropTypes.bool,\n dropdownButtonProps: PropTypes.shape({\n size: PropTypes.string,\n className: PropTypes.string,\n }),\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","OverflowLinks","overflowLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","isMoreButtonActive","existsBy","isNotEmpty","buttonStyle","label","buttonProps","classNames","active","map","_ref2","key","disabled","rest","_objectWithoutProperties","_excluded","isActive","menuButton","_createElement","Button","concat","joinHyphenCase","isDisabled","onClick","e","preventDefault","moreOptions","menuItems","customTarget","trigger","_ref3","itemProps","_excluded2","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","visibleLinks","slice","_ref2$className","labelProps","NavLink","activeClassName","Typography","component","lineHeight","style","weight","MoreDropdown","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,CAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,GAAA,CAACC,IAAI,EAAA,EAAE;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,GAAAK,IAAA,CAAPL,OAAO;IACPQ,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;AAER,EAAA,IAAMF,eAAe,GAAGG,cAAc,CACpCf,yBAAyB,EACzBW,qBACF,CAAC;AAED,EAAA,oBACEK,IAAA,CAAA,KAAA,EAAA;AACEC,IAAAA,SAAS,EAAC,kCAAkC;AAC5C,IAAA,SAAA,EAAQ,8BAA8B;AACtC,IAAA,aAAA,EAAY,8BAA8B;IAAAH,QAAA,EAAA,cAE1CP,GAAA,CAACW,OAAO,EAAA;AACNhB,MAAAA,OAAO,EAAEU,eAAe,CAACX,OAAO,CAAC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;AAAKC,QAAAA,SAAS,EAAC,mBAAmB;AAACiE,QAAAA,KAAK,EAAEqD,SAAU;QAAAzH,QAAA,EAAA,CACjD+G,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACP5H,GAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKgH;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGhI,SAAS;AAC5CmH,gBAAgB,CAACvD,eAAe,GAAGA,eAAe;AAClDuD,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
@@ -13,8 +13,9 @@ var jsxRuntime = require('react/jsx-runtime');
13
13
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
14
14
  var classnames = require('classnames');
15
15
  var general = require('@bigbinary/neeto-commons-frontend/utils/general');
16
- var Dropdown = require('@bigbinary/neetoui/Dropdown');
17
16
  var Typography = require('@bigbinary/neetoui/Typography');
17
+ var MoreDropdown = require('./MoreDropdown.js');
18
+ var Dropdown = require('@bigbinary/neetoui/Dropdown');
18
19
  var reactI18next = require('react-i18next');
19
20
  var React = require('react');
20
21
  var PublishBlock = require('./PublishBlock.js');
@@ -30,7 +31,6 @@ require('@bigbinary/neetoui/Button');
30
31
  require('@bigbinary/neetoui/Input');
31
32
  require('@babel/runtime/helpers/toConsumableArray');
32
33
  require('@bigbinary/neeto-commons-frontend/react-utils');
33
- require('./MoreDropdown.js');
34
34
  require('@bigbinary/neeto-icons/MenuHorizontal');
35
35
  require('@bigbinary/neeto-icons/MenuVertical');
36
36
  require('@bigbinary/neeto-commons-frontend/react-utils/withT');
@@ -53,8 +53,8 @@ var DEFAULT_HOME_BUTTON_PROPS = {
53
53
  icon: /*#__PURE__*/jsxRuntime.jsx(Home, {})
54
54
  };
55
55
 
56
- function ownKeys$2(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; }
57
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
56
+ function ownKeys$3(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; }
57
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
58
58
  var LeftBlock = function LeftBlock(_ref) {
59
59
  var customHomeButtonProps = _ref.homeButtonProps,
60
60
  homeUrl = _ref.homeUrl,
@@ -78,88 +78,125 @@ var LeftBlock = function LeftBlock(_ref) {
78
78
  children: homeButtonProps.icon
79
79
  })
80
80
  })
81
- }), neetoCist.isPresent(renameProps) && /*#__PURE__*/jsxRuntime.jsx(Rename, _objectSpread$2({
81
+ }), neetoCist.isPresent(renameProps) && /*#__PURE__*/jsxRuntime.jsx(Rename, _objectSpread$3({
82
82
  dropdownItems: renameProps.dropdownItems,
83
83
  value: renameProps.value
84
84
  }, renameProps)), children]
85
85
  });
86
86
  };
87
87
 
88
- var _excluded = ["key", "label", "disabled"],
89
- _excluded2 = ["key", "to", "label", "disabled"];
90
- function ownKeys$1(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; }
91
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
88
+ var _excluded$1 = ["key", "to", "label", "disabled"],
89
+ _excluded2 = ["key", "label"];
90
+ function ownKeys$2(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; }
91
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
92
92
  var Menu = Dropdown.Menu,
93
93
  MenuItem = Dropdown.MenuItem;
94
- var NavigationLinks = function NavigationLinks(_ref) {
95
- var headerLinks = _ref.headerLinks,
96
- _ref$maxVisibleLinks = _ref.maxVisibleLinks,
97
- maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
94
+ var OverflowLinks = function OverflowLinks(_ref) {
95
+ var overflowLinks = _ref.overflowLinks;
98
96
  var _useLocation = reactRouterDom.useLocation(),
99
97
  pathname = _useLocation.pathname;
100
98
  var _useTranslation = reactI18next.useTranslation(),
101
99
  t = _useTranslation.t;
102
- var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
103
- var overflowLinks = headerLinks.slice(maxVisibleLinks);
104
100
  var isMoreButtonActive = neetoCist.existsBy({
105
101
  to: pathname
106
102
  }, overflowLinks);
103
+ if (!neetoCist.isNotEmpty(overflowLinks)) {
104
+ return null;
105
+ }
106
+ return /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
107
+ buttonStyle: "text",
108
+ label: t("neetoMolecules.navigationHeader.more"),
109
+ position: "bottom-end",
110
+ buttonProps: {
111
+ className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
112
+ active: isMoreButtonActive
113
+ })
114
+ },
115
+ children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
116
+ children: overflowLinks.map(function (_ref2) {
117
+ var key = _ref2.key,
118
+ to = _ref2.to,
119
+ label = _ref2.label,
120
+ disabled = _ref2.disabled,
121
+ rest = _objectWithoutProperties(_ref2, _excluded$1);
122
+ var isActive = to === pathname;
123
+ var menuButton = /*#__PURE__*/React.createElement(MenuItem.Button, _objectSpread$2({
124
+ isActive: isActive,
125
+ to: to,
126
+ "data-cy": "".concat(general.joinHyphenCase(key), "-more-tab"),
127
+ isDisabled: disabled,
128
+ key: key,
129
+ onClick: function onClick(e) {
130
+ return disabled && e.preventDefault();
131
+ }
132
+ }, rest), label);
133
+ if (isActive && rest.moreOptions && neetoCist.isNotEmpty(rest.moreOptions.menuItems)) {
134
+ return /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
135
+ customTarget: menuButton,
136
+ position: "right-start",
137
+ trigger: "hover",
138
+ children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
139
+ children: rest.moreOptions.menuItems.map(function (_ref3) {
140
+ var key = _ref3.key,
141
+ label = _ref3.label,
142
+ itemProps = _objectWithoutProperties(_ref3, _excluded2);
143
+ return /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, _objectSpread$2(_objectSpread$2({}, itemProps), {}, {
144
+ children: label
145
+ }), key);
146
+ })
147
+ })
148
+ }, "".concat(key, "-nested-dropdown"));
149
+ }
150
+ return menuButton;
151
+ })
152
+ })
153
+ });
154
+ };
155
+
156
+ var _excluded = ["className", "key", "label", "disabled", "labelProps", "moreOptions"];
157
+ function ownKeys$1(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; }
158
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
159
+ var NavigationLinks = function NavigationLinks(_ref) {
160
+ var headerLinks = _ref.headerLinks,
161
+ _ref$maxVisibleLinks = _ref.maxVisibleLinks,
162
+ maxVisibleLinks = _ref$maxVisibleLinks === void 0 ? 5 : _ref$maxVisibleLinks;
163
+ var visibleLinks = headerLinks.slice(0, maxVisibleLinks);
164
+ var overflowLinks = headerLinks.slice(maxVisibleLinks);
107
165
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
108
166
  className: "font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6",
109
167
  "data-cy": "navigation-header-navigation-links",
110
168
  "data-testid": "navigation-header-navigation-links",
111
169
  children: [visibleLinks.map(function (_ref2) {
112
- var key = _ref2.key,
170
+ var _ref2$className = _ref2.className,
171
+ className = _ref2$className === void 0 ? "" : _ref2$className,
172
+ key = _ref2.key,
113
173
  label = _ref2.label,
114
174
  disabled = _ref2.disabled,
175
+ labelProps = _ref2.labelProps,
176
+ moreOptions = _ref2.moreOptions,
115
177
  rest = _objectWithoutProperties(_ref2, _excluded);
116
- return /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.NavLink, _objectSpread$1(_objectSpread$1({
178
+ return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.NavLink, _objectSpread$1(_objectSpread$1({
117
179
  activeClassName: "active",
118
180
  "data-cy": "".concat(general.joinHyphenCase(key), "-tab"),
119
181
  "data-testid": "".concat(general.joinHyphenCase(key), "-tab"),
120
- className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", {
182
+ className: classnames("neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0", className, {
121
183
  disabled: disabled
122
184
  }),
123
185
  onClick: function onClick(e) {
124
186
  return disabled && e.preventDefault();
125
187
  }
126
188
  }, rest), {}, {
127
- children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
189
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread$1(_objectSpread$1({
128
190
  component: "span",
129
191
  lineHeight: "normal",
130
192
  style: "h4",
131
- weight: "semibold",
193
+ weight: "semibold"
194
+ }, labelProps || {}), {}, {
132
195
  children: label
133
- })
196
+ })), moreOptions && /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, _objectSpread$1({}, moreOptions))]
134
197
  }), key);
135
- }), neetoCist.isNotEmpty(overflowLinks) && /*#__PURE__*/jsxRuntime.jsx(Dropdown, {
136
- buttonStyle: "text",
137
- label: t("neetoMolecules.navigationHeader.more"),
138
- position: "bottom-end",
139
- buttonProps: {
140
- className: classnames("neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0", {
141
- active: isMoreButtonActive
142
- })
143
- },
144
- children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
145
- children: overflowLinks.map(function (_ref3) {
146
- var key = _ref3.key,
147
- to = _ref3.to,
148
- label = _ref3.label,
149
- disabled = _ref3.disabled,
150
- rest = _objectWithoutProperties(_ref3, _excluded2);
151
- return /*#__PURE__*/React.createElement(MenuItem.Button, _objectSpread$1({
152
- to: to,
153
- "data-cy": "".concat(general.joinHyphenCase(key), "-more-tab"),
154
- isActive: to === pathname,
155
- isDisabled: disabled,
156
- key: key,
157
- onClick: function onClick(e) {
158
- return disabled && e.preventDefault();
159
- }
160
- }, rest), label);
161
- })
162
- })
198
+ }), /*#__PURE__*/jsxRuntime.jsx(OverflowLinks, {
199
+ overflowLinks: overflowLinks
163
200
  })]
164
201
  });
165
202
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/utils.js","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown, Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { NavLink, useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(({ key, label, disabled, ...rest }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n >\n {label}\n </Typography>\n </NavLink>\n ))}\n {isNotEmpty(overflowLinks) && (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => (\n <MenuItem.Button\n {...{ to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isActive={to === pathname}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n ))}\n </Menu>\n </Dropdown>\n )}\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","visibleLinks","slice","overflowLinks","isMoreButtonActive","existsBy","map","_ref2","key","label","disabled","rest","_objectWithoutProperties","_excluded","NavLink","activeClassName","concat","joinHyphenCase","classNames","onClick","e","preventDefault","Typography","component","lineHeight","style","weight","isNotEmpty","buttonStyle","buttonProps","active","_ref3","_excluded2","_createElement","Button","isActive","isDisabled","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,SAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EAAE,GAAG;AACZC,EAAAA,IAAI,eAAEC,cAAA,CAACC,IAAI,EAAA,EAAE;AACf,CAAC;;;;ACAD,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAAC,IAAA,EAKT;AAAA,EAAA,IAJaC,qBAAqB,GAAAD,IAAA,CAAtCE,eAAe;IACfP,OAAO,GAAAK,IAAA,CAAPL,OAAO;IACPQ,WAAW,GAAAH,IA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AAAA,SAAS,EAAC,mBAAmB;AAAC8C,QAAAA,KAAK,EAAE8D,SAAU;QAAA/G,QAAA,EAAA,CACjDqG,eAAe,EACf,CAACM,QAAQ,IAAIL,eAAe,EAC5BC,gBAAgB;OACd;AAAC,KACH,CAAC,EACLI,QAAQ,iBACPlH,cAAA,CAAA,KAAA,EAAA;AAAKU,MAAAA,SAAS,EAAC,yJAAyJ;AAAAH,MAAAA,QAAA,EACrKsG;AAAe,KACb,CACN;AAAA,GACE,CAAC;AAEV;AAEAF,gBAAgB,CAACa,eAAe,GAAGtH,SAAS;AAC5CyG,gBAAgB,CAACpF,eAAe,GAAGA,eAAe;AAClDoF,gBAAgB,CAACc,gBAAgB,GAAGlD,UAAU;;;;"}
1
+ {"version":3,"file":"NavigationHeader.js","sources":["../../src/components/NavigationHeader/constants.jsx","../../src/components/NavigationHeader/LeftBlock.jsx","../../src/components/NavigationHeader/OverflowLinks.jsx","../../src/components/NavigationHeader/Navigation.jsx","../../src/components/NavigationHeader/utils.js","../../src/components/NavigationHeader/RightBlock.jsx","../../src/components/NavigationHeader/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { Home } from \"neetoicons\";\n\nexport const DEFAULT_HOME_BUTTON_PROPS = {\n tooltip: {\n content: t(\"neetoMolecules.navigationHeader.home\"),\n position: \"bottom\",\n },\n homeUrl: \"/\",\n icon: <Home />,\n};\n","import { isPresent } from \"neetocist\";\nimport { Tooltip } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { mergeDeepRight } from \"ramda\";\nimport { Link } from \"react-router-dom\";\n\nimport Rename from \"components/Rename\";\n\nimport { DEFAULT_HOME_BUTTON_PROPS } from \"./constants\";\n\nconst LeftBlock = ({\n homeButtonProps: customHomeButtonProps,\n homeUrl,\n renameProps,\n children,\n}) => {\n const homeButtonProps = mergeDeepRight(\n DEFAULT_HOME_BUTTON_PROPS,\n customHomeButtonProps\n );\n\n return (\n <div\n className=\"flex items-center gap-1 md:gap-2\"\n data-cy=\"navigation-header-left-block\"\n data-testid=\"navigation-header-left-block\"\n >\n <Tooltip\n content={homeButtonProps.tooltip.content}\n position={homeButtonProps.tooltip.position}\n touch={[\"hold\", 500]}\n >\n <Link data-cy=\"home-button\" data-testid=\"home-button\" to={homeUrl}>\n <div className=\"neeto-ui-rounded hover:neeto-ui-bg-gray-200 p-1\">\n {homeButtonProps.icon}\n </div>\n </Link>\n </Tooltip>\n {isPresent(renameProps) && (\n <Rename\n dropdownItems={renameProps.dropdownItems}\n value={renameProps.value}\n {...renameProps}\n />\n )}\n {children}\n </div>\n );\n};\n\nLeftBlock.propTypes = {\n /**\n * Object containing the home button icon and the props to be passed to the tooltip of the home button.\n */\n homeButtonProps: PropTypes.shape({\n tooltip: PropTypes.shape({\n content: PropTypes.string,\n postition: PropTypes.string,\n }),\n icon: PropTypes.node,\n }),\n /**\n * URL to navigate when the home button is clicked.\n */\n homeUrl: PropTypes.string.isRequired,\n /**\n * Props to be passed to the `Rename` component. Please check the `Rename` component props for more details\n */\n renameProps: PropTypes.object,\n /**\n * To render extra content in the block.\n */\n children: PropTypes.node,\n};\n\nexport default LeftBlock;\n","import classNames from \"classnames\";\nimport { existsBy, isNotEmpty } from \"neetocist\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Dropdown } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\nimport { useLocation } from \"react-router-dom\";\n\nconst { Menu, MenuItem } = Dropdown;\n\nconst OverflowLinks = ({ overflowLinks }) => {\n const { pathname } = useLocation();\n const { t } = useTranslation();\n\n const isMoreButtonActive = existsBy({ to: pathname }, overflowLinks);\n\n if (!isNotEmpty(overflowLinks)) {\n return null;\n }\n\n return (\n <Dropdown\n buttonStyle=\"text\"\n label={t(\"neetoMolecules.navigationHeader.more\")}\n position=\"bottom-end\"\n buttonProps={{\n className: classNames(\n \"neeto-molecules-navigation-header__link neeto-molecules-navigation-header__link--more neeto-ui-typography neeto-ui-text-h4 neeto-ui-font-semibold neeto-ui-leading-normal px-2 capitalize no-underline md:px-0\",\n { active: isMoreButtonActive }\n ),\n }}\n >\n <Menu>\n {overflowLinks.map(({ key, to, label, disabled, ...rest }) => {\n const isActive = to === pathname;\n const menuButton = (\n <MenuItem.Button\n {...{ isActive, to }}\n data-cy={`${joinHyphenCase(key)}-more-tab`}\n isDisabled={disabled}\n key={key}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n {label}\n </MenuItem.Button>\n );\n\n if (\n isActive &&\n rest.moreOptions &&\n isNotEmpty(rest.moreOptions.menuItems)\n ) {\n return (\n <Dropdown\n customTarget={menuButton}\n key={`${key}-nested-dropdown`}\n position=\"right-start\"\n trigger=\"hover\"\n >\n <Menu>\n {rest.moreOptions.menuItems.map(\n ({ key, label, ...itemProps }) => (\n <MenuItem.Button key={key} {...itemProps}>\n {label}\n </MenuItem.Button>\n )\n )}\n </Menu>\n </Dropdown>\n );\n }\n\n return menuButton;\n })}\n </Menu>\n </Dropdown>\n );\n};\n\nOverflowLinks.propTypes = {\n /**\n * Array of overflow links to be displayed in the more dropdown\n */\n overflowLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n disabled: PropTypes.bool,\n moreOptions: PropTypes.shape({\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n};\n\nexport default OverflowLinks;\n","import classNames from \"classnames\";\nimport { joinHyphenCase } from \"neetocommons/utils/general\";\nimport { Typography } from \"neetoui\";\nimport PropTypes from \"prop-types\";\nimport { NavLink } from \"react-router-dom\";\n\nimport MoreDropdown from \"components/MoreDropdown\";\n\nimport OverflowLinks from \"./OverflowLinks\";\n\nconst NavigationLinks = ({ headerLinks, maxVisibleLinks = 5 }) => {\n const visibleLinks = headerLinks.slice(0, maxVisibleLinks);\n const overflowLinks = headerLinks.slice(maxVisibleLinks);\n\n return (\n <div\n className=\"font- flex w-full items-center justify-between gap-4 md:justify-center md:gap-3 lg:gap-6\"\n data-cy=\"navigation-header-navigation-links\"\n data-testid=\"navigation-header-navigation-links\"\n >\n {visibleLinks.map(\n ({\n className = \"\",\n key,\n label,\n disabled,\n labelProps,\n moreOptions,\n ...rest\n }) => (\n <NavLink\n activeClassName=\"active\"\n data-cy={`${joinHyphenCase(key)}-tab`}\n data-testid={`${joinHyphenCase(key)}-tab`}\n key={key}\n className={classNames(\n \"neeto-molecules-navigation-header__link px-2 capitalize no-underline md:px-0\",\n className,\n { disabled }\n )}\n onClick={e => disabled && e.preventDefault()}\n {...rest}\n >\n <Typography\n component=\"span\"\n lineHeight=\"normal\"\n style=\"h4\"\n weight=\"semibold\"\n {...(labelProps || {})}\n >\n {label}\n </Typography>\n {/*\n TODO: In future, render this MoreDropdown only for Active links\n Ref: https://github.com/neetozone/neeto-molecules/issues/2610\n */}\n {moreOptions && <MoreDropdown {...moreOptions} />}\n </NavLink>\n )\n )}\n <OverflowLinks {...{ overflowLinks }} />\n </div>\n );\n};\n\nNavigationLinks.propTypes = {\n /**\n * Links to be rendered in the center of the navigation header. It is an array of objects.\n * Each object should have the properties `key`, `to` and `label`. Other props will be passed on to the `Navlink` component from\n `react-router-dom`.\n */\n headerLinks: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n to: PropTypes.string,\n label: PropTypes.string,\n className: PropTypes.string,\n labelProps: PropTypes.shape({ lineHeight: PropTypes.string }),\n moreOptions: PropTypes.shape({\n isVertical: PropTypes.bool,\n dropdownButtonProps: PropTypes.shape({\n size: PropTypes.string,\n className: PropTypes.string,\n }),\n menuItems: PropTypes.arrayOf(\n PropTypes.shape({\n key: PropTypes.string,\n label: PropTypes.string,\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n isDisabled: PropTypes.bool,\n tooltipProps: PropTypes.shape({\n content: PropTypes.string,\n }),\n })\n ),\n }),\n })\n ),\n /**\n * Maximum number of links to be visible in the navigation header. Remaining links will be shown in a more dropdown.\n */\n maxVisibleLinks: PropTypes.number,\n};\n\nexport default NavigationLinks;\n","export const isAbsoluteUrl = url => /^https?:\\/\\//.test(url);\n","import classNames from \"classnames\";\nimport PropTypes from \"prop-types\";\nimport { useTranslation } from \"react-i18next\";\n\nimport PublishBlock from \"components/PublishBlock\";\n\nimport \"./navigation-header.scss\";\nimport { isAbsoluteUrl } from \"./utils\";\n\nconst RightBlock = ({\n isDraftBlockHidden,\n previewDraftUrl,\n isResetDraftButtonVisible,\n onResetClick,\n isResetting,\n isPublishDisabled,\n isPublishing,\n handlePublish,\n isPublishPreviewDisabled,\n previewPublishedUrl,\n isPublishButtonVisible,\n isResetAlertOpen,\n setIsResetAlertOpen,\n handleReset,\n publishAlertTitle,\n publishAlertDescription,\n publishButtonProps = {},\n}) => {\n const { t } = useTranslation();\n\n const renderDraftButtons = ({ ViewDraftButton, ResetDraftButton }) =>\n !isDraftBlockHidden && (\n <>\n <ViewDraftButton\n {...(isAbsoluteUrl(previewDraftUrl)\n ? { href: previewDraftUrl }\n : { to: previewDraftUrl })}\n />\n {isResetDraftButtonVisible && (\n <ResetDraftButton\n loading={isResetting}\n onClick={() => onResetClick()}\n />\n )}\n </>\n );\n\n const renderPublishButtons = ({ PublishButton, PublishPreviewButton }) => (\n <>\n {isPublishButtonVisible && (\n <PublishButton\n disabled={isPublishDisabled}\n loading={isPublishing}\n onClick={() => handlePublish()}\n {...publishButtonProps}\n />\n )}\n <PublishPreviewButton\n {...(isAbsoluteUrl(previewPublishedUrl)\n ? { href: previewPublishedUrl }\n : { to: previewPublishedUrl })}\n disabled={isPublishPreviewDisabled}\n className={classNames({\n \"standalone-publish-preview-button\": !isPublishButtonVisible,\n })}\n />\n </>\n );\n\n return (\n <>\n <PublishBlock {...{ renderDraftButtons, renderPublishButtons }} />\n <PublishBlock.Alert\n isOpen={isResetAlertOpen}\n isSubmitting={isResetting}\n message={\n publishAlertDescription ||\n t(\"neetoMolecules.navigationHeader.resetDescription\")\n }\n title={\n publishAlertTitle || t(\"neetoMolecules.navigationHeader.resetTitle\")\n }\n onClose={() => setIsResetAlertOpen(false)}\n onSubmit={handleReset}\n />\n </>\n );\n};\n\nRightBlock.propTypes = {\n /**\n * To show/hide the draft block.\n */\n isDraftBlockHidden: PropTypes.bool,\n /**\n * Draft preview URL, when the draft button is clicked user will be redirected to this URL.\n */\n previewDraftUrl: PropTypes.string,\n /**\n * Boolean to control the visibility of reset draft button.\n */\n isResetDraftButtonVisible: PropTypes.bool,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n onResetClick: PropTypes.func,\n /**\n * Setting this to `true` will show a spinner on the reset button. Use when the reset process is in progress.\n */\n isResetting: PropTypes.bool,\n /**\n * To disable the publish button.\n */\n isPublishDisabled: PropTypes.bool,\n /**\n * Setting this to `true` will show a spinner on the publish button. Use when the publish process is in progress.\n */\n isPublishing: PropTypes.bool,\n /**\n * Callback function that will be called when the publish button is clicked.\n */\n handlePublish: PropTypes.func,\n /**\n * To disable the publish preview button.\n */\n isPublishPreviewDisabled: PropTypes.bool,\n /**\n * Publish preview URL, when the preview publish button is clicked user will be redirected to this URL.\n */\n previewPublishedUrl: PropTypes.string,\n /**\n * Boolean to control whether the user have the ability to publish.\n */\n isPublishButtonVisible: PropTypes.bool,\n /**\n * Boolean to control whether the reset alert is open.\n */\n isResetAlertOpen: PropTypes.bool,\n /**\n * Handler to control the `isResetAlert` state variable.\n */\n setIsResetAlertOpen: PropTypes.func,\n /**\n * Callback function that will be called when the reset button is clicked.\n */\n handleReset: PropTypes.func,\n /**\n * Description to be shown in the publish alert\n */\n publishAlertDescription: PropTypes.string,\n /**\n * Title of the publish alert\n */\n publishAlertTitle: PropTypes.string,\n /**\n * Props to be passed to the publish button\n */\n publishButtonProps: PropTypes.object,\n};\n\nexport default RightBlock;\n","import { isPresent } from \"neetocist\";\nimport useBreakpoints from \"neetocommons/react-utils/useBreakpoints\";\nimport PropTypes from \"prop-types\";\nimport { filter, length } from \"ramda\";\n\nimport LeftBlock from \"./LeftBlock\";\nimport NavigationLinks from \"./Navigation\";\nimport RightBlock from \"./RightBlock\";\n\nconst NavigationHeader = ({\n leftActionBlock,\n navigationLinks,\n rightActionBlock,\n}) => {\n const { isSize } = useBreakpoints();\n const isMobile = isSize(\"mobile\");\n\n const numberOfChildren = length(\n filter(isPresent, [leftActionBlock, navigationLinks, rightActionBlock])\n );\n\n const gridStyle = {\n gridTemplateColumns: isMobile\n ? `repeat(${\n navigationLinks ? numberOfChildren - 1 : numberOfChildren\n }, auto)`\n : `repeat(${numberOfChildren}, 1fr)`,\n };\n\n return (\n <div className=\"w-full\">\n <div\n className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex h-16 w-full flex-shrink-0 items-center overflow-x-auto border-b px-2 py-2 md:px-4 lg:px-6\"\n data-cy=\"navigation-header\"\n data-testid=\"navigation-header\"\n >\n <div className=\"grid w-full gap-4\" style={gridStyle}>\n {leftActionBlock}\n {!isMobile && navigationLinks}\n {rightActionBlock}\n </div>\n </div>\n {isMobile && (\n <div className=\"neeto-molecules-navigation-header neeto-ui-border-gray-200 neeto-ui-bg-white flex flex-shrink-0 items-center overflow-x-auto border-b px-4 py-2 lg:px-6\">\n {navigationLinks}\n </div>\n )}\n </div>\n );\n};\n\nNavigationHeader.LeftActionBlock = LeftBlock;\nNavigationHeader.NavigationLinks = NavigationLinks;\nNavigationHeader.RightActionBlock = RightBlock;\n\nNavigationHeader.propTypes = {\n /**\n * To specify the content to be rendered in the left side of the `NavigationHeader`.\n */\n leftActionBlock: PropTypes.node,\n /**\n * To specify the content to be rendered at the center of the `NavigationHeader`.\n */\n navigationLinks: PropTypes.node,\n /**\n * To specify the content to be rendered in the right side of the `NavigationHeader`.\n */\n rightActionBlock: PropTypes.node,\n};\n\nexport default NavigationHeader;\n"],"names":["DEFAULT_HOME_BUTTON_PROPS","tooltip","content","t","position","homeUrl","icon","_jsx","Home","LeftBlock","_ref","customHomeButtonProps","homeButtonProps","renameProps","children","mergeDeepRight","_jsxs","className","Tooltip","touch","Link","to","isPresent","Rename","_objectSpread","dropdownItems","value","Menu","Dropdown","MenuItem","OverflowLinks","overflowLinks","_useLocation","useLocation","pathname","_useTranslation","useTranslation","isMoreButtonActive","existsBy","isNotEmpty","buttonStyle","label","buttonProps","classNames","active","map","_ref2","key","disabled","rest","_objectWithoutProperties","_excluded","isActive","menuButton","_createElement","Button","concat","joinHyphenCase","isDisabled","onClick","e","preventDefault","moreOptions","menuItems","customTarget","trigger","_ref3","itemProps","_excluded2","NavigationLinks","headerLinks","_ref$maxVisibleLinks","maxVisibleLinks","visibleLinks","slice","_ref2$className","labelProps","NavLink","activeClassName","Typography","component","lineHeight","style","weight","MoreDropdown","isAbsoluteUrl","url","test","RightBlock","isDraftBlockHidden","previewDraftUrl","isResetDraftButtonVisible","onResetClick","isResetting","isPublishDisabled","isPublishing","handlePublish","isPublishPreviewDisabled","previewPublishedUrl","isPublishButtonVisible","isResetAlertOpen","setIsResetAlertOpen","handleReset","publishAlertTitle","publishAlertDescription","_ref$publishButtonPro","publishButtonProps","renderDraftButtons","ViewDraftButton","ResetDraftButton","_Fragment","href","loading","renderPublishButtons","PublishButton","PublishPreviewButton","PublishBlock","Alert","isOpen","isSubmitting","message","title","onClose","onSubmit","NavigationHeader","leftActionBlock","navigationLinks","rightActionBlock","_useBreakpoints","useBreakpoints","isSize","isMobile","numberOfChildren","length","filter","gridStyle","gridTemplateColumns","LeftActionBlock","RightActionBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGO,IAAMA,yBAAyB,GAAG;AACvCC,EAAAA,OAAO,EAAE;AACPC,IAAAA,OAAO,EAAEC,SAAC,CAAC,sCAAsC,CAAC;AAClDC,IAAAA,QAAQ,EAAE;GACX;AACDC,EAAAA,OAAO,EA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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>",
@@ -18,10 +18,33 @@ type HomeButtonPropType = {
18
18
  tooltip: TooltipPropType;
19
19
  icon: React.ReactNode;
20
20
  };
21
+ type MenuItemPropType = {
22
+ key: string;
23
+ label: string;
24
+ onClick?: () => void;
25
+ disabled?: boolean;
26
+ isDisabled?: boolean;
27
+ tooltipProps?: {
28
+ content: string;
29
+ };
30
+ };
31
+ type MoreOptionsPropType = {
32
+ isVertical?: boolean;
33
+ dropdownButtonProps?: {
34
+ size?: string;
35
+ className?: string;
36
+ };
37
+ menuItems?: MenuItemPropType[];
38
+ };
21
39
  type HeaderLinkPropType = {
22
40
  key: string;
23
41
  to: string;
24
42
  label: string;
43
+ className?: string;
44
+ labelProps?: {
45
+ lineHeight?: string;
46
+ };
47
+ moreOptions?: MoreOptionsPropType;
25
48
  } & NavLinkProps;
26
49
  type RightActionBlockPropTypes = {
27
50
  isDraftBlockHidden: boolean;
@@ -46,6 +69,9 @@ type NavigationLinkPropsType = {
46
69
  headerLinks: HeaderLinkPropType[];
47
70
  maxVisibleLinks?: number;
48
71
  };
72
+ type OverflowLinksPropsType = {
73
+ overflowLinks: HeaderLinkPropType[];
74
+ };
49
75
  type LeftBlockPropTypes = {
50
76
  homeButtonProps?: HomeButtonPropType;
51
77
  homeUrl: string;
@@ -54,7 +80,7 @@ type LeftBlockPropTypes = {
54
80
  };
55
81
  /**
56
82
  *
57
- * A common component to use as navigation header.
83
+ * A common component to use as navigation header with support for nested dropdown menus.
58
84
  *
59
85
  * @example
60
86
  *
@@ -106,6 +132,8 @@ type LeftBlockPropTypes = {
106
132
  * @endexample
107
133
  * To specify the content to be rendered at the center of the NavigationHeader.
108
134
  *
135
+ * Each object in the headerLinks array can have the following properties:
136
+ *
109
137
  * @example
110
138
  *
111
139
  * import NavigationHeader from "@bigbinary/neeto-molecules/NavigationHeader";
@@ -115,15 +143,48 @@ type LeftBlockPropTypes = {
115
143
  * navigationLinks={
116
144
  * <NavigationHeader.NavigationLinks
117
145
  * headerLinks={[
118
- * { key: "build", to: "/build", label: "Build" },
119
- * { key: "design", to: "/design", label: "Design" },
146
+ * {
147
+ * key: "build",
148
+ * to: "/build",
149
+ * label: "Build",
150
+ * className: "custom-link-class"
151
+ * },
152
+ * {
153
+ * key: "design",
154
+ * to: "/design",
155
+ * label: "Design",
156
+ * labelProps: { lineHeight: "tight" }
157
+ * },
120
158
  * {
121
159
  * key: "configure",
122
160
  * to: "/configure",
123
161
  * label: "Configure",
124
- * exact: true, //Additional props passed to Navlink component.
162
+ * exact: true, // Additional props passed to Navlink component
163
+ * moreOptions: {
164
+ * isVertical: true,
165
+ * dropdownButtonProps: {
166
+ * size: "small",
167
+ * className: "custom-dropdown-class"
168
+ * },
169
+ * menuItems: [
170
+ * {
171
+ * key: "settings",
172
+ * label: "Settings",
173
+ * onClick: () => console.log("Settings clicked")
174
+ * },
175
+ * {
176
+ * key: "preferences",
177
+ * label: "Preferences",
178
+ * disabled: true,
179
+ * tooltipProps: {
180
+ * content: "This feature is coming soon"
181
+ * }
182
+ * }
183
+ * ]
184
+ * }
125
185
  * },
126
186
  * ]}
187
+ * maxVisibleLinks={3}
127
188
  * />
128
189
  * }
129
190
  * rightActionBlock={
@@ -176,6 +237,7 @@ declare const NavigationHeader: React.FC<{
176
237
  RightActionBlock: React.FC<RightActionBlockPropTypes>;
177
238
  NavigationLinks: React.FC<NavigationLinkPropsType>;
178
239
  LeftActionBlock: React.FC<LeftBlockPropTypes>;
240
+ OverflowLinks: React.FC<OverflowLinksPropsType>;
179
241
  };
180
242
 
181
243
  export { NavigationHeader as default };