@bigbinary/neeto-molecules 1.0.115 → 1.1.0

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.
@@ -1,11 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { forwardRef, useRef, useState } from 'react';
3
- import { isNotPresent, noop, snakeToCamelCase, isNotEmpty } from '@bigbinary/neeto-commons-frontend/pure';
3
+ import { isNotPresent, isNotEmpty, noop, snakeToCamelCase } from '@bigbinary/neeto-commons-frontend/pure';
4
4
  import { withT, useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
5
5
  import { Typography, Button, Alert, Dropdown as Dropdown$1, Input, Tag, Callout, Pane, Label, Table, NoData } from '@bigbinary/neetoui';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
- import { not, isEmpty } from 'ramda';
8
- import { Column, Download, Filter, Right, MenuVertical, HamburgerMenu, Search, MenuHorizontal, Info, Check } from '@bigbinary/neeto-icons';
7
+ import { not } from 'ramda';
8
+ import { Column, Download, Filter, MenuVertical, Search, MenuHorizontal, Info, Check } from '@bigbinary/neeto-icons';
9
9
  import ManageColumns from '@bigbinary/neeto-molecules/Columns';
10
10
  import { Filters } from '@bigbinary/neeto-filters-frontend';
11
11
  import { PLURAL, SINGULAR } from '@bigbinary/neeto-commons-frontend/constants';
@@ -1319,7 +1319,7 @@ if (process.env.NODE_ENV !== 'production') {
1319
1319
 
1320
1320
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
1321
1321
 
1322
- var css$3 = ".neeto-molecules-container{align-items:flex-start;display:flex;flex-direction:column;flex-grow:1;height:100vh;justify-content:flex-start;overflow-y:auto;padding:0 24px}.neeto-molecules-container--header-fixed{padding:0}.neeto-molecules-container--header-fixed>.neeto-molecules-header,.neeto-molecules-container--header-fixed>.neeto-molecules-scrollable,.neeto-molecules-container--header-fixed>.neeto-molecules-subheader{padding-left:24px;padding-right:24px}";
1322
+ var css$3 = ".neeto-molecules-container{align-items:flex-start;display:flex;flex-direction:column;flex-grow:1;height:100vh;justify-content:flex-start;overflow-y:auto;padding:0 40px!important}.neeto-molecules-container--header-fixed{padding:0!important}.neeto-molecules-container--header-fixed>.neeto-molecules-header,.neeto-molecules-container--header-fixed>.neeto-molecules-scrollable,.neeto-molecules-container--header-fixed>.neeto-molecules-subheader{padding-left:40px!important;padding-right:40px!important}";
1323
1323
  n(css$3,{});
1324
1324
 
1325
1325
  var Container = /*#__PURE__*/forwardRef(function (_ref, ref) {
@@ -1598,7 +1598,7 @@ var RightBlock = function RightBlock(_ref) {
1598
1598
  }, downloadButtonProps && /*#__PURE__*/React__default.createElement(DownloadButton, downloadButtonProps), columnsButtonProps && /*#__PURE__*/React__default.createElement(Columns, columnsButtonProps), filterProps && /*#__PURE__*/React__default.createElement(FilterButton, filterProps));
1599
1599
  };
1600
1600
 
1601
- var css$1 = ".neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:var(--neeto-ui-sub-header-bottom-margin);min-height:var(--neeto-ui-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
1601
+ var css$1 = ":root{--neeto-molecules-sub-header-height:37px;--neeto-molecules-sub-header-bottom-margin:20px}.neeto-molecules-subheader{align-items:center;background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;margin-bottom:20px;margin-bottom:var(--neeto-molecules-sub-header-bottom-margin);min-height:37px;min-height:var(--neeto-molecules-sub-header-height);width:100%}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper{display:flex;flex-grow:1}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left{align-items:center;display:flex;flex-direction:row;justify-content:flex-start}.neeto-molecules-subheader .neeto-molecules-subheader__left-wrapper .neeto-molecules-subheader__left .neeto-molecules-input__prefix{color:rgb(var(--neeto-ui-gray-400))}.neeto-molecules-subheader .neeto-molecules-subheader__right{align-items:center;display:flex;flex-direction:row;gap:12px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions{align-items:center;display:flex;flex-direction:row;gap:8px;justify-content:flex-end}.neeto-molecules-subheader .neeto-molecules-subheader__right-actions>:not([hidden])~:not([hidden]){border-left:thin solid rgb(var(--neeto-ui-gray-300));padding-left:8px}.neeto-molecules-subheader__download{position:relative}.neeto-molecules-subheader__download-count{align-items:center;background-color:rgb(var(--neeto-ui-primary-500));border-radius:var(--neeto-ui-rounded-full);color:rgb(var(--neeto-ui-white));display:inline-flex;font-size:10px;justify-content:center;min-height:16px;min-width:16px;position:absolute;right:-2px;text-align:center;top:-2px;z-index:1}";
1602
1602
  n(css$1,{});
1603
1603
 
1604
1604
  var SubHeader = function SubHeader(_ref) {
@@ -1650,7 +1650,7 @@ var DeleteAlert = function DeleteAlert(_ref) {
1650
1650
  });
1651
1651
  };
1652
1652
 
1653
- var css = ".neeto-molecules-header{align-items:center;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;min-height:var(--neeto-ui-main-header-height);padding:24px 0;width:100%}.neeto-molecules-header--has-breadcrumbs{min-height:var(--neeto-ui-main-header-with-breadcrumbs-height)}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:8px}.neeto-molecules-header .neeto-molecules-header__left{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{display:flex;flex-direction:row;width:100%}.neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{display:flex}.neeto-molecules-header .neeto-molecules-header__breadcrumb{align-items:center;display:flex;flex-direction:row;justify-content:flex-start;line-height:1}.neeto-molecules-header .neeto-molecules-header__breadcrumb a{text-decoration:none;transition:all .3s ease-in-out}.neeto-molecules-header .neeto-molecules-header__breadcrumb a:focus-visible{border-radius:var(--neeto-ui-rounded-sm);outline:3px solid rgba(var(--neeto-ui-primary-500),50%)}.neeto-molecules-header .neeto-molecules-header__breadcrumb-separator{margin:0 4px}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;flex-direction:row;justify-content:flex-end}";
1653
+ var css = ":root{--neeto-molecules-main-header-height:98px;--neeto-molecules-main-header-with-breadcrumbs-height:170px}.neeto-molecules-header{align-items:flex-start!important;background:rgb(var(--neeto-ui-white));display:flex;flex-direction:row;justify-content:space-between;min-height:98px;min-height:var(--neeto-molecules-main-header-height);padding:40px 0 24px!important;width:100%}.neeto-molecules-header .neeto-molecules-header__toggle-menubar-btn{margin-right:8px}.neeto-molecules-header .neeto-molecules-header__left{align-items:flex-start!important;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.neeto-molecules-header .neeto-molecules-header__left-data-wrap{display:flex;flex-wrap:wrap}.neeto-molecules-header .neeto-molecules-header__page-title{align-items:center;display:flex;flex-direction:row;gap:12px;margin-top:-16px;width:100%}.neeto-molecules-header .neeto-molecules-header__page-title h2{font-size:40px;line-height:var(--neeto-ui-leading-tight)}.neeto-molecules-header .neeto-molecules-header__breadcrumbs-wrap{display:flex;margin:0 0 40px}.neeto-molecules-header .neeto-molecules-header__breadcrumb{align-items:center;display:flex;flex-direction:row;justify-content:flex-start;line-height:1}.neeto-molecules-header .neeto-molecules-header__breadcrumb a{text-decoration:none;transition:all .3s ease-in-out}.neeto-molecules-header .neeto-molecules-header__breadcrumb a:focus-visible{border-radius:var(--neeto-ui-rounded-sm);outline:3px solid rgba(var(--neeto-ui-primary-500),50%)}.neeto-molecules-header .neeto-molecules-header__breadcrumb-separator{font-size:12px;line-height:16px;margin:0 12px!important}.neeto-molecules-header .neeto-molecules-header__right{align-items:center;display:flex;flex-direction:row;justify-content:flex-end}.neeto-molecules-header--has-breadcrumbs{min-height:170px;min-height:var(--neeto-molecules-main-header-with-breadcrumbs-height)}.neeto-molecules-header--has-breadcrumbs .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano,.neeto-molecules-header--small{flex-shrink:0;min-height:0}.neeto-molecules-header--nano .neeto-molecules-header__breadcrumbs-wrap,.neeto-molecules-header--small .neeto-molecules-header__breadcrumbs-wrap{margin:0 0 16px}.neeto-molecules-header--small .neeto-molecules-header__page-title{margin-top:-4px}.neeto-molecules-header--small .neeto-molecules-header__page-title h2{font-size:32px}.neeto-molecules-header--nano .neeto-molecules-header__page-title{margin-top:0}.neeto-molecules-header--nano .neeto-molecules-header__page-title h2{font-size:24px}";
1654
1654
  n(css,{});
1655
1655
 
1656
1656
  var Breadcrumbs = function Breadcrumbs(_ref) {
@@ -1659,7 +1659,8 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
1659
1659
  className: "neeto-molecules-header__breadcrumbs-wrap"
1660
1660
  }, breadcrumbs.map(function (_ref2, index) {
1661
1661
  var text = _ref2.text,
1662
- link = _ref2.link;
1662
+ _ref2$link = _ref2.link,
1663
+ link = _ref2$link === void 0 ? "#" : _ref2$link;
1663
1664
  return /*#__PURE__*/React__default.createElement("div", {
1664
1665
  className: "neeto-molecules-header__breadcrumb",
1665
1666
  "data-cy": "header-breadcrumb",
@@ -1667,27 +1668,28 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
1667
1668
  }, /*#__PURE__*/React__default.createElement(Link, {
1668
1669
  to: link
1669
1670
  }, /*#__PURE__*/React__default.createElement(Typography, {
1670
- className: "neeto-molecules-text-gray-700 hover:neeto-ui-text-gray-800 neeto-molecules-header__breadcrumb-link",
1671
+ className: "neeto-ui-text-gray-700 hover:neeto-ui-text-gray-800 neeto-molecules-header__breadcrumb-link",
1671
1672
  component: "span",
1672
1673
  "data-cy": text,
1673
1674
  "data-test-id": text,
1674
1675
  style: "body2",
1675
1676
  weight: "normal"
1676
- }, text)), /*#__PURE__*/React__default.createElement(Right, {
1677
- className: "neeto-molecules-header__breadcrumb-separator neeto-ui-text-gray-400",
1678
- size: 16
1679
- }));
1677
+ }, text)), index !== breadcrumbs.length - 1 && /*#__PURE__*/React__default.createElement("span", {
1678
+ className: "neeto-molecules-header__breadcrumb-separator neeto-ui-text-black"
1679
+ }, "/"));
1680
1680
  }));
1681
1681
  };
1682
1682
  var Breadcrumbs$1 = /*#__PURE__*/React__default.memo(Breadcrumbs);
1683
1683
 
1684
+ var SIZES = {
1685
+ nano: "nano",
1686
+ small: "small",
1687
+ large: "large"
1688
+ };
1689
+
1684
1690
  var Dropdown = function Dropdown(props) {
1685
1691
  return /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$1({
1686
- buttonProps: {
1687
- className: "ml-1.5"
1688
- },
1689
1692
  buttonStyle: "text",
1690
- className: "ml-3",
1691
1693
  icon: MenuVertical,
1692
1694
  position: "bottom-end"
1693
1695
  }, props));
@@ -1695,7 +1697,6 @@ var Dropdown = function Dropdown(props) {
1695
1697
 
1696
1698
  var Header$2 = function Header(_ref) {
1697
1699
  var title = _ref.title,
1698
- menuBarToggle = _ref.menuBarToggle,
1699
1700
  searchProps = _ref.searchProps,
1700
1701
  _ref$className = _ref.className,
1701
1702
  className = _ref$className === void 0 ? "" : _ref$className,
@@ -1704,6 +1705,8 @@ var Header$2 = function Header(_ref) {
1704
1705
  breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
1705
1706
  _ref$renderDropdown = _ref.renderDropdown,
1706
1707
  renderDropdown = _ref$renderDropdown === void 0 ? noop : _ref$renderDropdown,
1708
+ _ref$size = _ref.size,
1709
+ size = _ref$size === void 0 ? "large" : _ref$size,
1707
1710
  _ref$dataTestid = _ref["data-testid"],
1708
1711
  dataTestId = _ref$dataTestid === void 0 ? "neeto-molecules-header" : _ref$dataTestid;
1709
1712
  var searchRef = useRef(null);
@@ -1712,20 +1715,16 @@ var Header$2 = function Header(_ref) {
1712
1715
  return /*#__PURE__*/React__default.createElement("div", {
1713
1716
  "data-testid": dataTestId,
1714
1717
  className: classnames(["neeto-molecules-header", {
1715
- "neeto-molecules-header--has-breadcrumbs": !isEmpty(breadcrumbs)
1718
+ "neeto-molecules-header--has-breadcrumbs": isNotEmpty(breadcrumbs),
1719
+ "neeto-molecules-header--large": size === SIZES.large,
1720
+ "neeto-molecules-header--small": size === SIZES.small,
1721
+ "neeto-molecules-header--nano": size === SIZES.nano
1716
1722
  }, className])
1717
1723
  }, /*#__PURE__*/React__default.createElement("div", {
1718
1724
  className: "neeto-molecules-header__left"
1719
- }, menuBarToggle && /*#__PURE__*/React__default.createElement(Button, {
1720
- "aria-label": "Toggle Menubar",
1721
- className: "neeto-molecules-header__toggle-menubar-btn",
1722
- "data-cy": "menubar-toggle-button",
1723
- icon: HamburgerMenu,
1724
- style: "text",
1725
- onClick: menuBarToggle
1726
- }), /*#__PURE__*/React__default.createElement("div", {
1725
+ }, /*#__PURE__*/React__default.createElement("div", {
1727
1726
  className: "neeto-molecules-header__left-data-wrap"
1728
- }, breadcrumbs && /*#__PURE__*/React__default.createElement(Breadcrumbs$1, {
1727
+ }, isNotEmpty(breadcrumbs) && /*#__PURE__*/React__default.createElement(Breadcrumbs$1, {
1729
1728
  breadcrumbs: breadcrumbs
1730
1729
  }), /*#__PURE__*/React__default.createElement("div", {
1731
1730
  className: "neeto-molecules-header__page-title"