@ctlyst.id/internal-ui 3.1.23 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.mjs CHANGED
@@ -350,7 +350,7 @@ import { Box as Box4, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Flex, IconButt
350
350
  import { ChevronLeft, ChevronsRight, Home } from "@ctlyst.id/internal-icon";
351
351
  import { Fragment, jsx as jsx14, jsxs } from "react/jsx-runtime";
352
352
  var BreadCrumb = (props) => {
353
- const { title, children, parents, className, disableHome, spacing: spacing2 = 2, backButton, hideTitle } = props;
353
+ const { title, children, parents, className, disableHome, spacing: spacing2 = 2, backButton, homeButton, hideTitle } = props;
354
354
  return /* @__PURE__ */ jsxs(
355
355
  Box4,
356
356
  {
@@ -395,9 +395,11 @@ var BreadCrumb = (props) => {
395
395
  /* @__PURE__ */ jsx14(BreadcrumbItem, { children: /* @__PURE__ */ jsx14(
396
396
  BreadcrumbLink,
397
397
  {
398
+ "data-test-id": "",
398
399
  alignItems: "center",
399
- href: !disableHome ? "/" : void 0,
400
+ href: homeButton || disableHome ? void 0 : "/",
400
401
  style: { ...disableHome && { cursor: "default" } },
402
+ onClick: homeButton,
401
403
  children: /* @__PURE__ */ jsx14(Box4, { boxSize: "3.5", children: /* @__PURE__ */ jsx14(Home, { size: 3.5, color: "primary.500" }) })
402
404
  }
403
405
  ) }),
@@ -405,7 +407,7 @@ var BreadCrumb = (props) => {
405
407
  BreadcrumbLink,
406
408
  {
407
409
  "data-test-id": "",
408
- href: !val.disable ? val.link : void 0,
410
+ href: !val.disable && val.link ? val.link : void 0,
409
411
  onClick: val.onClick,
410
412
  style: {
411
413
  ...val.disable && {
@@ -5135,7 +5137,11 @@ import {
5135
5137
  } from "@chakra-ui/react";
5136
5138
 
5137
5139
  // src/config/theme/themeConfiguration.ts
5138
- import { extendTheme } from "@chakra-ui/react";
5140
+ import {
5141
+ extendTheme as _chakraExtendTheme,
5142
+ isChakraTheme,
5143
+ mergeThemeOverride
5144
+ } from "@chakra-ui/react";
5139
5145
 
5140
5146
  // src/config/theme/components/index.ts
5141
5147
  var components_exports = {};
@@ -6713,8 +6719,32 @@ var config = {
6713
6719
  initialColorMode: "light",
6714
6720
  useSystemColorMode: false
6715
6721
  };
6722
+ function isFunction(value) {
6723
+ return typeof value === "function";
6724
+ }
6725
+ function pipe(...fns) {
6726
+ return (v) => fns.reduce((a, b) => b(a), v);
6727
+ }
6728
+ var createExtendTheme = (theme5) => {
6729
+ return function extendTheme2(...extensions) {
6730
+ let overrides = [...extensions];
6731
+ let activeTheme = extensions[extensions.length - 1];
6732
+ if (isChakraTheme(activeTheme) && // this ensures backward compatibility
6733
+ // previously only `extendTheme(override, activeTheme?)` was allowed
6734
+ overrides.length > 1) {
6735
+ overrides = overrides.slice(0, overrides.length - 1);
6736
+ } else {
6737
+ activeTheme = theme5;
6738
+ }
6739
+ return pipe(
6740
+ ...overrides.map(
6741
+ (extension) => (prevTheme) => isFunction(extension) ? extension(prevTheme) : mergeThemeOverride(prevTheme, extension)
6742
+ )
6743
+ )(activeTheme);
6744
+ };
6745
+ };
6716
6746
  var getTheme = (foundations) => {
6717
- return extendTheme({
6747
+ return _chakraExtendTheme({
6718
6748
  ...foundations,
6719
6749
  components: {
6720
6750
  ...components_exports
@@ -6731,7 +6761,7 @@ var getTheme = (foundations) => {
6731
6761
  config
6732
6762
  });
6733
6763
  };
6734
- var theme4 = extendTheme({
6764
+ var theme4 = _chakraExtendTheme({
6735
6765
  components: {
6736
6766
  ...components_exports
6737
6767
  },
@@ -6834,7 +6864,7 @@ import {
6834
6864
  } from "@chakra-ui/react";
6835
6865
 
6836
6866
  // src/index.ts
6837
- import { extendTheme as extendTheme2, forwardRef as forwardRef12 } from "@chakra-ui/react";
6867
+ import { extendTheme, forwardRef as forwardRef12 } from "@chakra-ui/react";
6838
6868
  export {
6839
6869
  Accordion,
6840
6870
  AccordionButton,
@@ -7145,7 +7175,8 @@ export {
7145
7175
  WrapItemProps,
7146
7176
  WrapProps,
7147
7177
  XMSLogo,
7148
- extendTheme2 as extendTheme,
7178
+ createExtendTheme,
7179
+ extendTheme,
7149
7180
  forwardRef12 as forwardRef,
7150
7181
  getSelectAllCheckboxState,
7151
7182
  getTheme,