bianic-ui 2.10.0-beta.0 → 2.10.0-beta.2

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.
Files changed (36) hide show
  1. package/dist/cjs/index.js +223 -136
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Badge/MonospaceBadge.d.ts +8 -0
  4. package/dist/cjs/types/components/Badge/MonospaceBadgeConfig.d.ts +21 -0
  5. package/dist/cjs/types/components/Badge/index.d.ts +2 -1
  6. package/dist/cjs/types/components/Sidebar/SidebarCointainer.d.ts +9 -0
  7. package/dist/cjs/types/components/Sidebar/SidebarItem.d.ts +14 -0
  8. package/dist/cjs/types/components/Sidebar/index.d.ts +2 -0
  9. package/dist/cjs/types/components/index.d.ts +2 -1
  10. package/dist/cjs/types/stories/Badge/Badge.stories.d.ts +77 -2
  11. package/dist/cjs/types/stories/Sidebar/SidebarContainer.stories.d.ts +13 -0
  12. package/dist/cjs/types/stories/Sidebar/SidebarItem.stories.d.ts +13 -0
  13. package/dist/cjs/types/stories/VerticalStepper/VerticalStepper.stories.d.ts +2 -1
  14. package/dist/esm/index.js +221 -137
  15. package/dist/esm/lib.css +1 -1
  16. package/dist/esm/types/components/Badge/MonospaceBadge.d.ts +8 -0
  17. package/dist/esm/types/components/Badge/MonospaceBadgeConfig.d.ts +21 -0
  18. package/dist/esm/types/components/Badge/index.d.ts +2 -1
  19. package/dist/esm/types/components/Sidebar/SidebarCointainer.d.ts +9 -0
  20. package/dist/esm/types/components/Sidebar/SidebarItem.d.ts +14 -0
  21. package/dist/esm/types/components/Sidebar/index.d.ts +2 -0
  22. package/dist/esm/types/components/index.d.ts +2 -1
  23. package/dist/esm/types/stories/Badge/Badge.stories.d.ts +77 -2
  24. package/dist/esm/types/stories/Sidebar/SidebarContainer.stories.d.ts +13 -0
  25. package/dist/esm/types/stories/Sidebar/SidebarItem.stories.d.ts +13 -0
  26. package/dist/esm/types/stories/VerticalStepper/VerticalStepper.stories.d.ts +2 -1
  27. package/dist/index.d.ts +29 -1
  28. package/package.json +1 -1
  29. package/src/font/SansCode/GoogleSansCode-Italic-VariableFont_MONO,wght.ttf +0 -0
  30. package/src/font/SansCode/GoogleSansCode-Italic-VariableFont_MONO,wght.ttf:Zone.Identifier +0 -0
  31. package/src/font/SansCode/GoogleSansCode-VariableFont_MONO,wght.ttf +0 -0
  32. package/src/font/SansCode/GoogleSansCode-VariableFont_MONO,wght.ttf:Zone.Identifier +0 -0
  33. package/src/font/SansCode/OFL.txt +93 -0
  34. package/src/font/SansCode/OFL.txt:Zone.Identifier +0 -0
  35. package/src/font/SansCode/README.txt +88 -0
  36. package/src/font/SansCode/README.txt:Zone.Identifier +0 -0
package/dist/cjs/index.js CHANGED
@@ -456,7 +456,7 @@ var radiusConfig$1 = {
456
456
  tn: 'rounded-radius-full focus-visible:rounded-radius-full',
457
457
  },
458
458
  };
459
- var sizeConfig$d = {
459
+ var sizeConfig$e = {
460
460
  lg: 'py-[10.5px] h-[48px] flex items-center justify-center gap-[10px] text-size-md ',
461
461
  md: 'py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base ',
462
462
  sm: 'py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm ',
@@ -540,10 +540,10 @@ var Button = React.forwardRef(function (_a, ref) {
540
540
  }
541
541
  var sizingRules;
542
542
  if (variant.includes('link')) {
543
- sizingRules = "".concat(sizeConfig$d[validatedSize]);
543
+ sizingRules = "".concat(sizeConfig$e[validatedSize]);
544
544
  }
545
545
  else {
546
- sizingRules = "".concat(sizeConfig$d[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
546
+ sizingRules = "".concat(sizeConfig$e[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
547
547
  }
548
548
  var hasDoubleIcon = iconRight && iconLeft;
549
549
  var isVariantLink = variant.includes('link')
@@ -723,6 +723,38 @@ Banner.defaultProps = {
723
723
  variant: 'black',
724
724
  };
725
725
 
726
+ var sizeConfig$d = {
727
+ md: 'h-[16px] text-[12px]',
728
+ sm: 'h-[15px] text-[10px]',
729
+ };
730
+ var colorConfig$3 = {
731
+ blue: 'bg-bia-blue-light-90 text-bia-blue-dark-10',
732
+ brown: 'bg-bia-brown-light-90 text-bia-brown-dark-10',
733
+ grey: 'bg-bia-coolgrey-light-80 text-bia-black', //
734
+ crayola: 'bg-bia-crayola-light-90 text-bia-crayola-dark-10',
735
+ green: 'bg-bia-green-light-90 text-bia-green-dark-10',
736
+ marguirette: 'bg-bia-margueriteblue-light-90 text-bia-margueriteblue-dark-10',
737
+ orange: 'bg-bia-orange-light-90 text-bia-orange-dark-10',
738
+ pink: 'bg-bia-pink-light-90 text-bia-pink-dark-10',
739
+ red: 'bg-bia-red-light-90 text-bia-red-dark-10',
740
+ sky: 'bg-bia-sky-light-90 text-bia-sky-dark-10',
741
+ teal: 'bg-bia-teal-light-90 text-bia-teal-dark-10',
742
+ verdant: 'bg-bia-verdantgreen-light-90 text-bia-verdantgreen-dark-10',
743
+ yellow: 'bg-bia-yellow-light-90 text-bia-yellow-dark-10',
744
+ black: 'bg-bia-black text-bia-white',
745
+ white: 'bg-bia-white text-bia-black border border-bia-grey',
746
+ };
747
+
748
+ var MonospaceBadge = function (_a) {
749
+ var text = _a.text, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.color, color = _c === void 0 ? 'blue' : _c;
750
+ var sizeClass = sizeConfig$d[size];
751
+ var colorClass = colorConfig$3[color];
752
+ var fontPosition = size === 'sm' ? 'top-[1px]' : '';
753
+ var variantClass = "".concat(sizeClass, " ").concat(colorClass);
754
+ return (React.createElement("span", { className: "relative -top-[1px] inline-flex w-fit items-center justify-center rounded-[2px] px-[3px] ".concat(variantClass) },
755
+ React.createElement("span", { className: "font-sans-code relative ".concat(fontPosition) }, text)));
756
+ };
757
+
726
758
  function Biaenergi$6() {
727
759
  return (React.createElement("div", { className: "" },
728
760
  React.createElement("svg", { width: "235", height: "74", viewBox: "0 0 235 74", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
@@ -7762,6 +7794,189 @@ ResizeableDiv.defaultProps = {
7762
7794
  position: 'left',
7763
7795
  };
7764
7796
 
7797
+ var SidebarContainer = function (_a) {
7798
+ _a.bgColor; var children = _a.children, _c = _a.isMinimized, isMinimized = _c === void 0 ? false : _c; _a.activeItem;
7799
+ var minWidth = isMinimized ? 'min-w-0' : 'min-w-[285px]';
7800
+ return (React.createElement("div", { className: "sidebar-container flex h-full flex-col justify-start bg-[#64747D] py-[30px] ".concat(minWidth) }, React.Children.map(children, function (child) {
7801
+ return React.isValidElement(child)
7802
+ ? React.cloneElement(child, {
7803
+ isMinimized: isMinimized,
7804
+ })
7805
+ : child;
7806
+ })));
7807
+ };
7808
+
7809
+ var colorConfig = {
7810
+ default: 'bg-bia-grey-light-50 text-primary-black',
7811
+ blue: 'bg-bia-blue text-primary-white',
7812
+ teal: 'bg-bia-teal text-primary-white',
7813
+ green: 'bg-bia-green text-primary-white',
7814
+ // yellow: 'bg-bia-yellow text-primary-black',
7815
+ orange: 'bg-bia-orange text-primary-white',
7816
+ red: 'bg-bia-red text-primary-white',
7817
+ black: 'bg-primary-black text-primary-white',
7818
+ white: 'bg-primary-white text-primary-black border border-primary-black',
7819
+ };
7820
+ var sizeConfig$1 = {
7821
+ md: 'px-[10px] py-[7px] h-[34px] text-size-base',
7822
+ sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
7823
+ tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
7824
+ };
7825
+ var iconOnlySizeConfig = {
7826
+ md: 'p-[7px]',
7827
+ sm: 'p-[4px]',
7828
+ tn: 'p-[2px]',
7829
+ };
7830
+ var closeColorConfig = {
7831
+ default: 'bg-bia-grey-dark-30 text-primary-white',
7832
+ blue: 'bg-bia-white-transparent-50 text-bia-blue',
7833
+ teal: 'bg-bia-white-transparent-50 text-bia-teal',
7834
+ green: 'bg-bia-white-transparent-50 text-bia-green',
7835
+ yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
7836
+ red: 'bg-bia-white-transparent-50 text-bia-red',
7837
+ black: 'bg-bia-white-transparent-50 text-primary-black',
7838
+ white: 'bg-bia-grey-dark-30 text-primary-white',
7839
+ };
7840
+ var closeSizeConfig = {
7841
+ md: 'w-[18px] h-[18px] text-[14px]',
7842
+ sm: 'w-[12px] h-[12px] text-[9.33px]',
7843
+ tn: 'w-[12px] h-[12px] text-[9.33px]',
7844
+ };
7845
+ var rightPaddingConfig = {
7846
+ md: 'pr-[8px]',
7847
+ sm: 'pr-[5px]',
7848
+ tn: 'pr-[3px]',
7849
+ };
7850
+
7851
+ var colorUnion = [
7852
+ 'default',
7853
+ 'blue',
7854
+ 'teal',
7855
+ 'green',
7856
+ 'orange',
7857
+ 'red',
7858
+ 'black',
7859
+ 'white',
7860
+ 'custom',
7861
+ ];
7862
+ var sizeUnion = ['md', 'sm', 'tn'];
7863
+ var variantUnion = ['label', 'icon', 'closeable'];
7864
+ var TagLabel = function (_a) {
7865
+ var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var _c = _a.bgColor, bgColor = _c === void 0 ? 'grey-light-50' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'black' : _d, outlineColor = _a.outlineColor, isBlock = _a.isBlock, maxWidth = _a.maxWidth, isDark = _a.isDark; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
7866
+ var validatedColor = validUnion(color, colorUnion);
7867
+ var validatedSize = validUnion(size, sizeUnion);
7868
+ var validatedVariant = validUnion(variant, variantUnion);
7869
+ var containerRef = React.useRef(null);
7870
+ var _e = React.useState(null), sizeCount = _e[0], setSizeCount = _e[1];
7871
+ React.useEffect(function () {
7872
+ if (variant === 'icon') {
7873
+ // Get the size of the icon
7874
+ // and set the size of the container
7875
+ // to the one with the biggest size (width or height icon)
7876
+ // in order to make the container square
7877
+ var rect = containerRef.current.getBoundingClientRect();
7878
+ var width = rect.width;
7879
+ var height = rect.height;
7880
+ if (width > height)
7881
+ setSizeCount(width);
7882
+ else
7883
+ setSizeCount(height);
7884
+ }
7885
+ }, []);
7886
+ var isCloseable = validatedVariant === 'closeable';
7887
+ var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
7888
+ var borderColorRules = outlineColor || bgColor;
7889
+ var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
7890
+ var sizeClass = validatedVariant === 'icon'
7891
+ ? iconOnlySizeConfig[validatedSize]
7892
+ : sizeConfig$1[validatedSize];
7893
+ var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
7894
+ var colorClass = validatedColor === 'custom'
7895
+ ? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
7896
+ : colorConfig[validatedColor];
7897
+ var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
7898
+ var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
7899
+ var textClass = isBlock ? 'text-center' : 'text-left';
7900
+ var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
7901
+ var closeColor = validatedColor === 'custom'
7902
+ ? isDark
7903
+ ? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
7904
+ : "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
7905
+ : closeColorConfig[validatedColor];
7906
+ var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
7907
+ var isOpen = isCloseable ? open : true;
7908
+ return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
7909
+ maxWidth: maxWidthStyle,
7910
+ } }, props),
7911
+ leftIcon && (React.createElement("div", { style: {
7912
+ width: sizeCount + 'px',
7913
+ height: sizeCount + 'px',
7914
+ }, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
7915
+ (validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
7916
+ validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate pb-[1px] ".concat(textClass) }, text)),
7917
+ validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
7918
+ " ",
7919
+ rightIcon,
7920
+ " ")),
7921
+ isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
7922
+ React.createElement(TbX, null))))));
7923
+ };
7924
+ TagLabel.defaultProps = {
7925
+ variant: 'default',
7926
+ size: 'sm',
7927
+ open: true,
7928
+ closeHandler: function () { },
7929
+ leftIcon: null,
7930
+ rightIcon: null,
7931
+ left: null,
7932
+ right: null,
7933
+ bgColor: 'grey-light-50',
7934
+ textColor: 'black',
7935
+ isBlock: false,
7936
+ maxWidth: 300,
7937
+ isDark: false,
7938
+ };
7939
+
7940
+ var SidebarItem = function (_a) {
7941
+ var title = _a.title, icon = _a.icon, _b = _a.active, active = _b === void 0 ? false : _b, onClick = _a.onClick, children = _a.children, _c = _a.isMinimized, isMinimized = _c === void 0 ? false : _c, _d = _a.isExpand, isExpand = _d === void 0 ? false : _d, notificationCount = _a.notificationCount, _e = _a.level, level = _e === void 0 ? 0 : _e;
7942
+ var horizontalPadding = isMinimized ? 'px-[11px]' : 'pl-[30px] pr-[15px]';
7943
+ var _f = React.useState(isExpand || false), isChildExpanded = _f[0], setIsChildExpanded = _f[1];
7944
+ var hasChildren = !!children;
7945
+ var chevronClass = hasChildren ? 'inline-block' : 'hidden';
7946
+ var nextLevel = level + 1;
7947
+ var buttonClass = level === 1 ? 'pl-[30px]' : level === 2 ? 'pl-[68px]' : '';
7948
+ var isGrandChild = level === 2;
7949
+ return (React.createElement(React.Fragment, null,
7950
+ React.createElement("div", { className: "sidebar-item relative flex h-fit items-center ".concat(horizontalPadding) },
7951
+ isGrandChild && (React.createElement("div", { className: "relative left-[39px] h-full w-[1px] bg-bia-white" })),
7952
+ React.createElement("div", { className: "group relative grow" },
7953
+ !isMinimized && (React.createElement("button", { onClick: function () {
7954
+ if (hasChildren)
7955
+ setIsChildExpanded(function (prev) { return !prev; });
7956
+ else
7957
+ onClick === null || onClick === void 0 ? void 0 : onClick();
7958
+ }, className: "flex w-full min-w-fit grow items-center gap-x-2.5 p-2.5 ".concat(buttonClass) },
7959
+ React.isValidElement(icon)
7960
+ ? React.cloneElement(icon, {
7961
+ className: 'text-bia-white',
7962
+ size: '18',
7963
+ })
7964
+ : '',
7965
+ React.createElement(Text, { variant: "normal-text", className: "text-bia-white" }, title),
7966
+ React.createElement("div", { className: "ml-auto flex items-center gap-x-[5px]" },
7967
+ notificationCount !== undefined ? (React.createElement(TagLabel, { text: String(notificationCount), color: "white", size: "tn" })) : (''),
7968
+ React.createElement("button", { className: chevronClass }, isChildExpanded ? (React.createElement(TbChevronDown, { className: "text-bia-white", size: 18 })) : (React.createElement(TbChevronRight, { className: "text-bia-white", size: 18 })))))),
7969
+ isMinimized && (React.createElement("button", { className: "flex items-center justify-center px-2.5 py-[11px] text-bia-white" }, icon)),
7970
+ React.createElement("div", { className: "pointer-events-none absolute inset-0 rounded-radius-lg bg-black opacity-0 transition-opacity duration-200 group-hover:opacity-5 group-active:opacity-15" })),
7971
+ active && (React.createElement("div", { className: "absolute right-0 ml-auto h-2/3 w-1 rounded-l-radius-md bg-bia-white" }))),
7972
+ isChildExpanded &&
7973
+ React.Children.map(children, function (child) {
7974
+ return React.isValidElement(child)
7975
+ ? React.cloneElement(child, { level: nextLevel })
7976
+ : child;
7977
+ })));
7978
+ };
7979
+
7765
7980
  function Slider(_a) {
7766
7981
  var disabled = _a.disabled;
7767
7982
  var _b = React.useState(50), sliderValue = _b[0], setsliderValue = _b[1];
@@ -7908,7 +8123,7 @@ var TabMenu = React.forwardRef(function (props, ref) {
7908
8123
  });
7909
8124
  TabMenu.displayName = 'TabMenu';
7910
8125
 
7911
- var sizeConfig$1 = {
8126
+ var sizeConfig = {
7912
8127
  md: 'px-2.5 py-[9px]',
7913
8128
  sm: 'px-2.5 py-[7px]',
7914
8129
  tn: 'px-2.5 py-[3px]',
@@ -7930,7 +8145,7 @@ function TableCell(_a) {
7930
8145
  var bgColorClass = "bg-bia-".concat(bgColor);
7931
8146
  var isHead = variant === 'head';
7932
8147
  var textConfig = isHead ? headTextConfig[size] : bodyTextConfig[size];
7933
- var columnClass = "p-0 ".concat(sizeConfig$1[size], " ").concat(bottomLined, " ").concat(bgColorClass, " ").concat(textConfig, " ").concat(className);
8148
+ var columnClass = "p-0 ".concat(sizeConfig[size], " ").concat(bottomLined, " ").concat(bgColorClass, " ").concat(textConfig, " ").concat(className);
7934
8149
  if (variant === 'head') {
7935
8150
  return (React.createElement("th", __assign({ className: "bianic-table-cell table-head bg-bia-grey-light-80 ".concat(columnClass) }, props), children));
7936
8151
  }
@@ -7942,137 +8157,6 @@ TableCell.defaultProps = {
7942
8157
  variant: 'body',
7943
8158
  };
7944
8159
 
7945
- var colorConfig = {
7946
- default: 'bg-bia-grey-light-50 text-primary-black',
7947
- blue: 'bg-bia-blue text-primary-white',
7948
- teal: 'bg-bia-teal text-primary-white',
7949
- green: 'bg-bia-green text-primary-white',
7950
- // yellow: 'bg-bia-yellow text-primary-black',
7951
- orange: 'bg-bia-orange text-primary-white',
7952
- red: 'bg-bia-red text-primary-white',
7953
- black: 'bg-primary-black text-primary-white',
7954
- white: 'bg-primary-white text-primary-black border border-primary-black',
7955
- };
7956
- var sizeConfig = {
7957
- md: 'px-[10px] py-[7px] h-[34px] text-size-base',
7958
- sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
7959
- tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
7960
- };
7961
- var iconOnlySizeConfig = {
7962
- md: 'p-[7px]',
7963
- sm: 'p-[4px]',
7964
- tn: 'p-[2px]',
7965
- };
7966
- var closeColorConfig = {
7967
- default: 'bg-bia-grey-dark-30 text-primary-white',
7968
- blue: 'bg-bia-white-transparent-50 text-bia-blue',
7969
- teal: 'bg-bia-white-transparent-50 text-bia-teal',
7970
- green: 'bg-bia-white-transparent-50 text-bia-green',
7971
- yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
7972
- red: 'bg-bia-white-transparent-50 text-bia-red',
7973
- black: 'bg-bia-white-transparent-50 text-primary-black',
7974
- white: 'bg-bia-grey-dark-30 text-primary-white',
7975
- };
7976
- var closeSizeConfig = {
7977
- md: 'w-[18px] h-[18px] text-[14px]',
7978
- sm: 'w-[12px] h-[12px] text-[9.33px]',
7979
- tn: 'w-[12px] h-[12px] text-[9.33px]',
7980
- };
7981
- var rightPaddingConfig = {
7982
- md: 'pr-[8px]',
7983
- sm: 'pr-[5px]',
7984
- tn: 'pr-[3px]',
7985
- };
7986
-
7987
- var colorUnion = [
7988
- 'default',
7989
- 'blue',
7990
- 'teal',
7991
- 'green',
7992
- 'orange',
7993
- 'red',
7994
- 'black',
7995
- 'white',
7996
- 'custom',
7997
- ];
7998
- var sizeUnion = ['md', 'sm', 'tn'];
7999
- var variantUnion = ['label', 'icon', 'closeable'];
8000
- var TagLabel = function (_a) {
8001
- var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var _c = _a.bgColor, bgColor = _c === void 0 ? 'grey-light-50' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'black' : _d, outlineColor = _a.outlineColor, isBlock = _a.isBlock, maxWidth = _a.maxWidth, isDark = _a.isDark; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
8002
- var validatedColor = validUnion(color, colorUnion);
8003
- var validatedSize = validUnion(size, sizeUnion);
8004
- var validatedVariant = validUnion(variant, variantUnion);
8005
- var containerRef = React.useRef(null);
8006
- var _e = React.useState(null), sizeCount = _e[0], setSizeCount = _e[1];
8007
- React.useEffect(function () {
8008
- if (variant === 'icon') {
8009
- // Get the size of the icon
8010
- // and set the size of the container
8011
- // to the one with the biggest size (width or height icon)
8012
- // in order to make the container square
8013
- var rect = containerRef.current.getBoundingClientRect();
8014
- var width = rect.width;
8015
- var height = rect.height;
8016
- if (width > height)
8017
- setSizeCount(width);
8018
- else
8019
- setSizeCount(height);
8020
- }
8021
- }, []);
8022
- var isCloseable = validatedVariant === 'closeable';
8023
- var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
8024
- var borderColorRules = outlineColor || bgColor;
8025
- var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
8026
- var sizeClass = validatedVariant === 'icon'
8027
- ? iconOnlySizeConfig[validatedSize]
8028
- : sizeConfig[validatedSize];
8029
- var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
8030
- var colorClass = validatedColor === 'custom'
8031
- ? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
8032
- : colorConfig[validatedColor];
8033
- var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
8034
- var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
8035
- var textClass = isBlock ? 'text-center' : 'text-left';
8036
- var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
8037
- var closeColor = validatedColor === 'custom'
8038
- ? isDark
8039
- ? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
8040
- : "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
8041
- : closeColorConfig[validatedColor];
8042
- var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
8043
- var isOpen = isCloseable ? open : true;
8044
- return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
8045
- maxWidth: maxWidthStyle,
8046
- } }, props),
8047
- leftIcon && (React.createElement("div", { style: {
8048
- width: sizeCount + 'px',
8049
- height: sizeCount + 'px',
8050
- }, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
8051
- (validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
8052
- validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate pb-[1px] ".concat(textClass) }, text)),
8053
- validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
8054
- " ",
8055
- rightIcon,
8056
- " ")),
8057
- isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
8058
- React.createElement(TbX, null))))));
8059
- };
8060
- TagLabel.defaultProps = {
8061
- variant: 'default',
8062
- size: 'sm',
8063
- open: true,
8064
- closeHandler: function () { },
8065
- leftIcon: null,
8066
- rightIcon: null,
8067
- left: null,
8068
- right: null,
8069
- bgColor: 'grey-light-50',
8070
- textColor: 'black',
8071
- isBlock: false,
8072
- maxWidth: 300,
8073
- isDark: false,
8074
- };
8075
-
8076
8160
  var colorConfigs = {
8077
8161
  default: 'bg-bia-black',
8078
8162
  info: 'bg-bia-teal',
@@ -8253,6 +8337,7 @@ exports.LiveSearch = LiveSearch;
8253
8337
  exports.MenuContainer = MenuContainer;
8254
8338
  exports.MenuItem = MenuItem;
8255
8339
  exports.Modal = Modal;
8340
+ exports.MonospaceBadge = MonospaceBadge;
8256
8341
  exports.Notification = Notification;
8257
8342
  exports.P = P;
8258
8343
  exports.PaginationBar = PaginationBar;
@@ -8266,6 +8351,8 @@ exports.ResizeableDiv = ResizeableDiv;
8266
8351
  exports.SegmentButtonGroup = SegmentButtonGroup;
8267
8352
  exports.SegmentButtonItem = SegmentButtonItem;
8268
8353
  exports.SelectInput = SelectInput;
8354
+ exports.SidebarContainer = SidebarContainer;
8355
+ exports.SidebarItem = SidebarItem;
8269
8356
  exports.Slider = Slider;
8270
8357
  exports.Spinner = Spinner;
8271
8358
  exports.Tab = Tab;