@ctlyst.id/internal-ui 5.6.5 → 5.6.6

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.mjs CHANGED
@@ -342,8 +342,18 @@ var badge_default = Badge;
342
342
  import { Box as Box4, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Flex, IconButton, Text } from "@chakra-ui/react";
343
343
  import { ChevronLeft, ChevronsRight, Home } from "@ctlyst.id/internal-icon";
344
344
  import { Fragment, jsx as jsx14, jsxs } from "react/jsx-runtime";
345
- var BreadCrumb = (props) => {
346
- const { title, children, parents, className, disableHome, spacing: spacing2 = 2, backButton, homeButton, hideTitle } = props;
345
+ var BreadCrumb = ({
346
+ title,
347
+ children,
348
+ parents,
349
+ className,
350
+ disableHome,
351
+ spacing: spacing2 = 2,
352
+ backButton,
353
+ homeButton,
354
+ hideTitle,
355
+ as
356
+ }) => {
347
357
  return /* @__PURE__ */ jsxs(
348
358
  Box4,
349
359
  {
@@ -367,7 +377,7 @@ var BreadCrumb = (props) => {
367
377
  minW: "9",
368
378
  bg: "white",
369
379
  variant: "ghost",
370
- "aria-label": "Edit",
380
+ "aria-label": "Back",
371
381
  icon: /* @__PURE__ */ jsx14(ChevronLeft, { size: 5 }),
372
382
  onClick: backButton
373
383
  }
@@ -385,33 +395,19 @@ var BreadCrumb = (props) => {
385
395
  pr: "4",
386
396
  spacing: spacing2,
387
397
  children: [
388
- /* @__PURE__ */ jsx14(BreadcrumbItem, { children: /* @__PURE__ */ jsx14(
389
- BreadcrumbLink,
390
- {
391
- "data-test-id": "",
392
- alignItems: "center",
393
- href: homeButton || disableHome ? void 0 : "/",
394
- style: { ...disableHome && { cursor: "default" } },
395
- onClick: homeButton,
396
- children: /* @__PURE__ */ jsx14(Box4, { boxSize: "3.5", children: /* @__PURE__ */ jsx14(Home, { size: 3.5, color: "primary.500" }) })
397
- }
398
- ) }),
399
- parents == null ? void 0 : parents.map((val) => /* @__PURE__ */ jsx14(BreadcrumbItem, { children: /* @__PURE__ */ jsx14(
398
+ /* @__PURE__ */ jsx14(BreadcrumbItem, { children: disableHome ? /* @__PURE__ */ jsx14(BreadcrumbLink, { cursor: "default", children: /* @__PURE__ */ jsx14(Box4, { boxSize: "3.5", children: /* @__PURE__ */ jsx14(Home, { size: 3.5, color: "neutral.600" }) }) }) : /* @__PURE__ */ jsx14(BreadcrumbLink, { "data-test-id": "", as, href: "/", onClick: homeButton, children: /* @__PURE__ */ jsx14(Box4, { boxSize: "3.5", children: /* @__PURE__ */ jsx14(Home, { size: 3.5, color: "primary.500" }) }) }) }),
399
+ parents == null ? void 0 : parents.map((parent) => /* @__PURE__ */ jsx14(BreadcrumbItem, { children: parent.disable || !parent.link ? /* @__PURE__ */ jsx14(BreadcrumbLink, { cursor: "default", children: /* @__PURE__ */ jsx14(Text, { color: "neutral.600", textStyle: "text.sm", children: parent.name }) }) : /* @__PURE__ */ jsx14(
400
400
  BreadcrumbLink,
401
401
  {
402
402
  "data-test-id": "",
403
- href: !val.disable && val.link ? val.link : void 0,
404
- onClick: val.onClick,
405
- style: {
406
- ...val.disable && {
407
- cursor: "default"
408
- }
409
- },
403
+ as,
404
+ href: parent.link,
405
+ onClick: parent.onClick,
410
406
  _hover: { textDecoration: "none" },
411
- children: /* @__PURE__ */ jsx14(Text, { color: val.disable ? "neutral.600" : "primary.500", textStyle: "text.sm", children: val.name })
407
+ children: /* @__PURE__ */ jsx14(Text, { color: "primary.500", textStyle: "text.sm", children: parent.name })
412
408
  }
413
- ) }, val.name)),
414
- /* @__PURE__ */ jsx14(BreadcrumbItem, { children: /* @__PURE__ */ jsx14(BreadcrumbLink, { _hover: { textDecor: "none", cursor: "default" }, children: /* @__PURE__ */ jsx14(Text, { color: "neutral.600", textStyle: "text.sm", children: title }) }) })
409
+ ) }, parent.name)),
410
+ /* @__PURE__ */ jsx14(BreadcrumbItem, { isCurrentPage: true, children: /* @__PURE__ */ jsx14(BreadcrumbLink, { cursor: "default", children: /* @__PURE__ */ jsx14(Text, { color: "neutral.600", textStyle: "text.sm", children: title }) }) })
415
411
  ]
416
412
  }
417
413
  )
@@ -425,7 +421,7 @@ BreadCrumb.defaultProps = {
425
421
  children: void 0,
426
422
  parents: void 0,
427
423
  className: void 0,
428
- disableHome: void 0,
424
+ disableHome: false,
429
425
  spacing: 2,
430
426
  backButton: void 0,
431
427
  hideTitle: false