@ctlyst.id/internal-ui 3.1.23 → 3.1.24

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.d.mts CHANGED
@@ -130,7 +130,7 @@ interface BreadCrumbParentProps {
130
130
  name: string;
131
131
  onClick?: () => void;
132
132
  disable?: boolean;
133
- link: string;
133
+ link?: string;
134
134
  }
135
135
  interface BreadCrumbProps {
136
136
  title: string;
@@ -141,6 +141,7 @@ interface BreadCrumbProps {
141
141
  spacing?: number;
142
142
  backButton?: () => void;
143
143
  hideTitle?: boolean;
144
+ homeButton?: () => void;
144
145
  }
145
146
  declare const BreadCrumb: React$1.FC<BreadCrumbProps>;
146
147
 
package/dist/index.d.ts CHANGED
@@ -130,7 +130,7 @@ interface BreadCrumbParentProps {
130
130
  name: string;
131
131
  onClick?: () => void;
132
132
  disable?: boolean;
133
- link: string;
133
+ link?: string;
134
134
  }
135
135
  interface BreadCrumbProps {
136
136
  title: string;
@@ -141,6 +141,7 @@ interface BreadCrumbProps {
141
141
  spacing?: number;
142
142
  backButton?: () => void;
143
143
  hideTitle?: boolean;
144
+ homeButton?: () => void;
144
145
  }
145
146
  declare const BreadCrumb: React$1.FC<BreadCrumbProps>;
146
147
 
package/dist/index.js CHANGED
@@ -727,7 +727,7 @@ var import_react9 = require("@chakra-ui/react");
727
727
  var import_internal_icon4 = require("@ctlyst.id/internal-icon");
728
728
  var import_jsx_runtime14 = require("react/jsx-runtime");
729
729
  var BreadCrumb = (props) => {
730
- const { title, children, parents, className, disableHome, spacing: spacing2 = 2, backButton, hideTitle } = props;
730
+ const { title, children, parents, className, disableHome, spacing: spacing2 = 2, backButton, homeButton, hideTitle } = props;
731
731
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
732
732
  import_react9.Box,
733
733
  {
@@ -772,9 +772,11 @@ var BreadCrumb = (props) => {
772
772
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react9.BreadcrumbItem, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
773
773
  import_react9.BreadcrumbLink,
774
774
  {
775
+ "data-test-id": "",
775
776
  alignItems: "center",
776
- href: !disableHome ? "/" : void 0,
777
+ href: homeButton || disableHome ? void 0 : "/",
777
778
  style: { ...disableHome && { cursor: "default" } },
779
+ onClick: homeButton,
778
780
  children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react9.Box, { boxSize: "3.5", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_internal_icon4.Home, { size: 3.5, color: "primary.500" }) })
779
781
  }
780
782
  ) }),
@@ -782,7 +784,7 @@ var BreadCrumb = (props) => {
782
784
  import_react9.BreadcrumbLink,
783
785
  {
784
786
  "data-test-id": "",
785
- href: !val.disable ? val.link : void 0,
787
+ href: !val.disable && val.link ? val.link : void 0,
786
788
  onClick: val.onClick,
787
789
  style: {
788
790
  ...val.disable && {