@hexure/ui 1.13.90 → 1.13.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -2738,7 +2738,7 @@ const Content$3 = styled.div(props => (Object.assign({ position: 'absolute', bor
2738
2738
  Content$3.defaultProps = { theme: EditableTheme };
2739
2739
  const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, dataItemid, height, auto = false, }) => {
2740
2740
  const [show_content, toggleContent] = React.useState(false);
2741
- const baseId = dataItemid || 'tooltip';
2741
+ const baseId = dataItemid || `tooltip-${Math.random().toString(36).slice(2, 9)}`;
2742
2742
  if (auto) {
2743
2743
  return (React.createElement(StyledDiv, { "data-itemid": `${baseId}-wrapper` },
2744
2744
  React.createElement("style", null, `
@@ -2760,13 +2760,13 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
2760
2760
  }
2761
2761
 
2762
2762
  `),
2763
- React.createElement(StyledAnchor, { "data-itemid": `${baseId}-icon-wrapper`, "data-tooltip-html": children, "data-tooltip-id": 'auto-tooltip-data-html' }, trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline })),
2763
+ React.createElement(StyledAnchor, { "data-itemid": `${baseId}-icon-wrapper`, "data-tooltip-id": `${baseId}-auto-tooltip-data-html` }, trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline })),
2764
2764
  React.createElement(TooltipPortal, null,
2765
- React.createElement(M, { className: 'custom-tooltip', classNameArrow: 'custom-tooltip-arrow', "data-itemid": `${baseId}-content`, id: 'auto-tooltip-data-html' }))));
2765
+ React.createElement(M, { className: 'custom-tooltip', classNameArrow: 'custom-tooltip-arrow', "data-itemid": `${baseId}-content`, id: `${baseId}-auto-tooltip-data-html`, render: () => React.createElement("p", { "data-itemid": `${baseId}-text` }, children) }))));
2766
2766
  }
2767
2767
  return (React.createElement(Wrapper$h, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
2768
2768
  trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline }),
2769
- show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-copy`, type: 'small' }, children)))) : null));
2769
+ show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-text`, type: 'small' }, children)))) : null));
2770
2770
  };
2771
2771
  const TooltipPortal = ({ children }) => {
2772
2772
  const [container, setContainer] = React.useState();
@@ -3306,9 +3306,10 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px', dataIte
3306
3306
  React.createElement(MenuWrapper$1, { "$active": !!nav_item.is_active, "$color": theme.PRIMARY_COLOR, "data-itemid": `${navItemId}-menu-wrapper`, onClick: nav_item.onClick, title: collapsed ? (nav_item === null || nav_item === void 0 ? void 0 : nav_item.title) || nav_item.label : '', type: 'button' },
3307
3307
  React.createElement(MenuIcon, { "$active": !!nav_item.is_active, "data-itemid": `${navItemId}-menu-icon`, path: nav_item.icon }),
3308
3308
  collapsed ? null : (React.createElement(MenuLabel, { "$active": nav_item.is_active, "$color": theme.PRIMARY_COLOR, "data-itemid": `${navItemId}-menu-label` }, nav_item.label))),
3309
- nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, { "data-itemid": `${navItemId}-sub-menu` }, nav_item.menu.map(menu_item => {
3309
+ nav_item.is_active && nav_item.menu && !collapsed ? (React.createElement(SubMenu, { "data-itemid": `${navItemId}-sub-menu` }, nav_item.menu.map((menu_item, menuIndex) => {
3310
3310
  const menuItemId = `${navItemId}-menu-item`;
3311
- return (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, "data-itemid": `${menuItemId}-sub-menu-item`, key: menuItemId, onClick: menu_item.onClick }, menu_item.label));
3311
+ const newKey = `${navItemId}-menu-item-${menuIndex}`;
3312
+ return (React.createElement(SubMenuItem, { "$active": menu_item.is_active, "$color": theme.PRIMARY_COLOR, "data-itemid": `${menuItemId}-sub-menu-item`, key: newKey, onClick: menu_item.onClick }, menu_item.label));
3312
3313
  }))) : null));
3313
3314
  })),
3314
3315
  React.createElement(Footer, { "$isOpen": !collapsed, "data-itemid": `${baseId}-footer` },
@@ -5702,6 +5703,7 @@ const ButtonContainer = styled.div `
5702
5703
  margin: 0 10px;
5703
5704
  `;
5704
5705
  const Modal = (_a) => {
5706
+ var _b, _c, _d, _e;
5705
5707
  var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton, dataItemid, modalStyle, headerStyle, headerTitleStyle } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton", "dataItemid", "modalStyle", "headerStyle", "headerTitleStyle"]);
5706
5708
  React.useEffect(() => {
5707
5709
  document.onkeydown = e => {
@@ -5730,9 +5732,9 @@ const Modal = (_a) => {
5730
5732
  display: 'flex',
5731
5733
  alignItems: 'center',
5732
5734
  } },
5733
- tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { "data-itemid": tertiaryButton.children || `${baseId}-${tertiaryButton.children}`, dataItemid: tertiaryButton.children || `${baseId}-${tertiaryButton.children}`, format: tertiaryButton.format || 'secondary' }))) : null,
5735
+ tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { dataItemid: (_b = tertiaryButton.dataItemid) !== null && _b !== void 0 ? _b : tertiaryButton.children, format: tertiaryButton.format || 'secondary' }))) : null,
5734
5736
  quarternaryButton ? (React.createElement(ButtonContainer, { "data-itemid": `${baseId}-quarternary-button-container` },
5735
- React.createElement(Button, Object.assign({}, quarternaryButton, { "data-itemid": quarternaryButton.children || `${baseId}-${quarternaryButton.children}`, dataItemid: quarternaryButton.children || `${baseId}-${quarternaryButton.children}`, format: quarternaryButton.format || 'secondary' })))) : null)) : null,
5737
+ React.createElement(Button, Object.assign({}, quarternaryButton, { dataItemid: (_c = quarternaryButton.dataItemid) !== null && _c !== void 0 ? _c : quarternaryButton.children, format: quarternaryButton.format || 'secondary' })))) : null)) : null,
5736
5738
  primaryButton || secondaryButton ? (React.createElement("div", { "data-itemid": `${baseId}-right-buttons`, style: {
5737
5739
  marginLeft: 'auto',
5738
5740
  paddingLeft: 40,
@@ -5740,8 +5742,8 @@ const Modal = (_a) => {
5740
5742
  alignItems: 'center',
5741
5743
  } },
5742
5744
  secondaryButton ? (React.createElement(ButtonContainer, { "data-itemid": `${baseId}-secondary-button-container` },
5743
- React.createElement(Button, Object.assign({}, secondaryButton, { "data-itemid": secondaryButton.children || `${baseId}-${secondaryButton.children}`, dataItemid: secondaryButton.children || `${baseId}-${secondaryButton.children}`, format: secondaryButton.format || 'secondary' })))) : null,
5744
- primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": primaryButton.children || `${baseId}-${primaryButton.children}`, dataItemid: primaryButton.children || `${baseId}-${primaryButton.children}`, format: primaryButton.format || 'primary' }))) : null)) : null)) : null)));
5745
+ React.createElement(Button, Object.assign({}, secondaryButton, { dataItemid: (_d = secondaryButton.dataItemid) !== null && _d !== void 0 ? _d : secondaryButton.children, format: secondaryButton.format || 'secondary' })))) : null,
5746
+ primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { dataItemid: (_e = primaryButton.dataItemid) !== null && _e !== void 0 ? _e : primaryButton.children, format: primaryButton.format || 'primary' }))) : null)) : null)) : null)));
5745
5747
  };
5746
5748
 
5747
5749
  const Wrapper$5 = styled.div `