@ctlyst.id/internal-ui 5.6.7 → 5.7.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.
package/dist/index.d.mts CHANGED
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
@@ -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
@@ -261,7 +261,7 @@ interface DataTableProps<T> {
261
261
  onRowClick?: (data: T) => void;
262
262
  disabledRow?: (row: T) => boolean;
263
263
  highlightedRow?: (row: T) => boolean;
264
- highlightRowColor?: BackgroundProps['bg'];
264
+ highlightRowColor?: BackgroundProps['bg'] | ((row: T) => BackgroundProps['bg']);
265
265
  /** paddingRowX in px */
266
266
  paddingRowX?: number;
267
267
  }
@@ -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
@@ -1767,12 +1767,13 @@ var DataTable = React6.forwardRef((props, ref) => {
1767
1767
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react31.Tbody, { ...styles == null ? void 0 : styles.tableBody, animation: `${fadeIn} 0.15s ease-out`, children: table.getRowModel().rows.map((row, index) => {
1768
1768
  const isDisabledRow = disabledRow && disabledRow(row.original);
1769
1769
  const isHighlightedRow = Object.keys(selectedRow != null ? selectedRow : {}).filter((key) => selectedRow == null ? void 0 : selectedRow[key]).includes(row.id) || highlightedRow && highlightedRow(row.original);
1770
+ const hgColor = typeof highlightRowColor === "function" ? highlightRowColor(row.original) : highlightRowColor;
1770
1771
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1771
1772
  import_react31.Tr,
1772
1773
  {
1773
1774
  "data-test-id": "-RU0hNYGRzeVM3HQ4cXHl",
1774
1775
  ...styles == null ? void 0 : styles.tableRow,
1775
- sx: { ...isHighlightedRow && getTableHighlightStyle(highlightRowColor) },
1776
+ sx: { ...isHighlightedRow && getTableHighlightStyle(hgColor) },
1776
1777
  "aria-disabled": isDisabledRow,
1777
1778
  "data-highlight": isHighlightedRow ? "true" : "false",
1778
1779
  css: import_react32.css`
@@ -5459,6 +5460,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5459
5460
  const offsetStyle = isCollapse ? noChild ? [-5, 16] : [-1, 16] : [-1, 8];
5460
5461
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
5461
5462
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Popover, { trigger: "hover", placement: "right-start", offset: offsetStyle, children: ({ isOpen, onClose }) => {
5463
+ var _a, _b;
5462
5464
  const activeOption = isOpen ? "primary.50" : "white";
5463
5465
  const backgroundColor = isOpen && !isActive ? "primary.50" : "primary.100";
5464
5466
  const activeParent = isActive ? backgroundColor : activeOption;
@@ -5480,6 +5482,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5480
5482
  "data-test-id": `CTA_nav-item-${item.title}`,
5481
5483
  onClick: () => setActive(item.children.length > 0 ? item.children[0].navLink : item.navLink, true),
5482
5484
  position: "relative",
5485
+ ...(_a = item.itemProps) != null ? _a : {},
5483
5486
  ...itemStyles,
5484
5487
  children: [
5485
5488
  mappingIcon2 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
@@ -5525,22 +5528,26 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5525
5528
  mappingIcon2.get(item.icon || ""),
5526
5529
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { as: "span", ml: "2", children: item.title })
5527
5530
  ] }) }),
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();
5531
+ !!item.children.length && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.PopoverBody, { pb: "1", px: "0", pt: "0", children: item.children.map((submenu) => {
5532
+ var _a2;
5533
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5534
+ NavItem,
5535
+ {
5536
+ "data-test-id": `CTA_Sidebar-popover-item-${submenu.id}`,
5537
+ isChild: true,
5538
+ isActive: active === submenu.navLink,
5539
+ onClick: () => {
5540
+ setActive(submenu.navLink);
5541
+ onClose();
5542
+ },
5543
+ rounded: "none",
5544
+ ...(_a2 = submenu.itemProps) != null ? _a2 : {},
5545
+ ...itemStyles,
5546
+ children: submenu.title
5537
5547
  },
5538
- rounded: "none",
5539
- ...itemStyles,
5540
- children: submenu.title
5541
- },
5542
- submenu.id
5543
- )) })
5548
+ submenu.id
5549
+ );
5550
+ }) })
5544
5551
  ] }) : 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
5552
  NavItem,
5546
5553
  {
@@ -5552,6 +5559,7 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5552
5559
  onClose();
5553
5560
  },
5554
5561
  rounded: "none",
5562
+ ...(_b = item.itemProps) != null ? _b : {},
5555
5563
  ...itemStyles,
5556
5564
  children: [
5557
5565
  mappingIcon2 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.Box, { display: "flex", boxSize: "3", transition: "50ms linear", children: mappingIcon2.get(item.icon || "") }),
@@ -5569,19 +5577,23 @@ var SidebarMenu = ({ menu, isCollapse, mappingIcon: mappingIcon2, itemStyles, se
5569
5577
  transition: {
5570
5578
  enter: { duration: 0.5 }
5571
5579
  },
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
- )) })
5580
+ children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react85.AccordionPanel, { mt: "1", p: "0", children: item.children.map((submenu) => {
5581
+ var _a;
5582
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5583
+ NavItem,
5584
+ {
5585
+ mt: "1",
5586
+ "data-test-id": `CTA_Sidebar-accordion-item-${submenu.id}`,
5587
+ isActive: active === submenu.navLink,
5588
+ isChild: true,
5589
+ ...(_a = submenu.itemProps) != null ? _a : {},
5590
+ ...itemStyles,
5591
+ onClick: () => setActive(submenu.navLink),
5592
+ children: submenu.title
5593
+ },
5594
+ submenu.id
5595
+ );
5596
+ }) })
5585
5597
  }
5586
5598
  )
5587
5599
  ] });