@ctlyst.id/internal-ui 5.6.7 → 5.6.8

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/index.d.mts CHANGED
@@ -686,6 +686,7 @@ type SubMenuItem = {
686
686
  navHost: string;
687
687
  title: string;
688
688
  id: number;
689
+ itemProps?: NavItemProps;
689
690
  };
690
691
  type MenuItem = {
691
692
  id: number;
@@ -694,6 +695,7 @@ type MenuItem = {
694
695
  navHost?: string;
695
696
  title: string;
696
697
  type: string;
698
+ itemProps?: NavItemProps;
697
699
  children: SubMenuItem[];
698
700
  };
699
701
 
package/dist/index.d.ts CHANGED
@@ -686,6 +686,7 @@ type SubMenuItem = {
686
686
  navHost: string;
687
687
  title: string;
688
688
  id: number;
689
+ itemProps?: NavItemProps;
689
690
  };
690
691
  type MenuItem = {
691
692
  id: number;
@@ -694,6 +695,7 @@ type MenuItem = {
694
695
  navHost?: string;
695
696
  title: string;
696
697
  type: string;
698
+ itemProps?: NavItemProps;
697
699
  children: SubMenuItem[];
698
700
  };
699
701
 
package/dist/index.js CHANGED
@@ -5459,6 +5459,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5459
5459
  const offsetStyle = isCollapse ? noChild ? [-5, 16] : [-1, 16] : [-1, 8];
5460
5460
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
5461
5461
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Popover, { trigger: "hover", placement: "right-start", offset: offsetStyle, children: ({ isOpen, onClose }) => {
5462
+ var _a, _b;
5462
5463
  const activeOption = isOpen ? "primary.50" : "white";
5463
5464
  const backgroundColor = isOpen && !isActive ? "primary.50" : "primary.100";
5464
5465
  const activeParent = isActive ? backgroundColor : activeOption;
@@ -5480,6 +5481,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5480
5481
  "data-test-id": `CTA_nav-item-${item.title}`,
5481
5482
  onClick: () => setActive(item.children.length > 0 ? item.children[0].navLink : item.navLink, true),
5482
5483
  position: "relative",
5484
+ ...(_a = item.itemProps) != null ? _a : {},
5483
5485
  ...itemStyles,
5484
5486
  children: [
5485
5487
  mappingIcon2 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
@@ -5525,22 +5527,26 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5525
5527
  mappingIcon2.get(item.icon || ""),
5526
5528
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { as: "span", ml: "2", children: item.title })
5527
5529
  ] }) }),
5528
- !!item.children.length && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.PopoverBody, { pb: "1", px: "0", pt: "0", children: item.children.map((submenu) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5529
- NavItem,
5530
- {
5531
- "data-test-id": `CTA_Sidebar-popover-item-${submenu.id}`,
5532
- isChild: true,
5533
- isActive: active === submenu.navLink,
5534
- onClick: () => {
5535
- setActive(submenu.navLink);
5536
- onClose();
5530
+ !!item.children.length && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.PopoverBody, { pb: "1", px: "0", pt: "0", children: item.children.map((submenu) => {
5531
+ var _a2;
5532
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5533
+ NavItem,
5534
+ {
5535
+ "data-test-id": `CTA_Sidebar-popover-item-${submenu.id}`,
5536
+ isChild: true,
5537
+ isActive: active === submenu.navLink,
5538
+ onClick: () => {
5539
+ setActive(submenu.navLink);
5540
+ onClose();
5541
+ },
5542
+ rounded: "none",
5543
+ ...(_a2 = submenu.itemProps) != null ? _a2 : {},
5544
+ ...itemStyles,
5545
+ children: submenu.title
5537
5546
  },
5538
- rounded: "none",
5539
- ...itemStyles,
5540
- children: submenu.title
5541
- },
5542
- submenu.id
5543
- )) })
5547
+ submenu.id
5548
+ );
5549
+ }) })
5544
5550
  ] }) : isCollapse && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.PopoverContent, { w: "174px", borderColor: "neutral.200", bg: "white", rounded: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.PopoverBody, { py: "1", px: "0", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
5545
5551
  NavItem,
5546
5552
  {
@@ -5552,6 +5558,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5552
5558
  onClose();
5553
5559
  },
5554
5560
  rounded: "none",
5561
+ ...(_b = item.itemProps) != null ? _b : {},
5555
5562
  ...itemStyles,
5556
5563
  children: [
5557
5564
  mappingIcon2 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
@@ -5569,19 +5576,23 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5569
5576
  transition: {
5570
5577
  enter: { duration: 0.5 }
5571
5578
  },
5572
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.AccordionPanel, { mt: "1", p: "0", children: item.children.map((submenu) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5573
- NavItem,
5574
- {
5575
- mt: "1",
5576
- "data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
5577
- isActive: active === submenu.navLink,
5578
- isChild: true,
5579
- ...itemStyles,
5580
- onClick: () => setActive(submenu.navLink),
5581
- children: submenu.title
5582
- },
5583
- submenu.id
5584
- )) })
5579
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.AccordionPanel, { mt: "1", p: "0", children: item.children.map((submenu) => {
5580
+ var _a;
5581
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5582
+ NavItem,
5583
+ {
5584
+ mt: "1",
5585
+ "data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
5586
+ isActive: active === submenu.navLink,
5587
+ isChild: true,
5588
+ ...(_a = submenu.itemProps) != null ? _a : {},
5589
+ ...itemStyles,
5590
+ onClick: () => setActive(submenu.navLink),
5591
+ children: submenu.title
5592
+ },
5593
+ submenu.id
5594
+ );
5595
+ }) })
5585
5596
  }
5586
5597
  )
5587
5598
  ] });