bianic-ui 1.3.0-beta → 1.4.0-beta

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 (82) hide show
  1. package/dist/cjs/index.js +177 -46
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/FileTree/index.d.ts +12 -0
  4. package/dist/cjs/types/components/Forms/SegmentButton/SegmentButtonItem.d.ts +2 -1
  5. package/dist/cjs/types/components/Forms/SegmentButton/config.d.ts +7 -1
  6. package/dist/cjs/types/components/Forms/TextInput/Simulation.d.ts +4 -7
  7. package/dist/cjs/types/components/Forms/TextInput/configs.d.ts +4 -0
  8. package/dist/cjs/types/components/Forms/TextInput/index.d.ts +6 -2
  9. package/dist/cjs/types/components/Menu/Example/BasicExample.d.ts +3 -0
  10. package/dist/cjs/types/components/Menu/Example/FilterExample.d.ts +9 -0
  11. package/dist/cjs/types/components/Menu/Example/NestedExample.d.ts +14 -0
  12. package/dist/cjs/types/components/Menu/MenuContainer.d.ts +15 -0
  13. package/dist/cjs/types/components/Menu/MenuItem.d.ts +18 -0
  14. package/dist/cjs/types/components/Menu/index.d.ts +3 -0
  15. package/dist/cjs/types/components/Modal/Modal.d.ts +1 -1
  16. package/dist/cjs/types/components/Tab/CardTab.d.ts +13 -0
  17. package/dist/cjs/types/components/Tab/CardTabConfig.d.ts +26 -0
  18. package/dist/cjs/types/components/Tab/CardTabDemo.d.ts +3 -0
  19. package/dist/cjs/types/components/Tab/Tab.d.ts +1 -13
  20. package/dist/cjs/types/components/Tab/index.d.ts +1 -0
  21. package/dist/cjs/types/components/Tooltip/PropsInterface.d.ts +9 -0
  22. package/dist/cjs/types/components/Tooltip/Simulation.d.ts +15 -0
  23. package/dist/cjs/types/components/Tooltip/index.d.ts +1 -7
  24. package/dist/cjs/types/components/index.d.ts +2 -0
  25. package/dist/cjs/types/stories/FileTree/FileTree.stories.d.ts +15 -0
  26. package/dist/cjs/types/stories/Form/TextInput/TextInput.stories.d.ts +6 -3
  27. package/dist/cjs/types/stories/{Form/TextInput/TextInputSimulation.stories.d.ts → Menu/BasicExample.stories.d.ts} +3 -4
  28. package/dist/{esm/types/stories/Form/TextInput/TextInputSimulation.stories.d.ts → cjs/types/stories/Menu/FilterExample.stories.d.ts} +3 -4
  29. package/dist/cjs/types/stories/Menu/MenuContainer.stories.d.ts +13 -0
  30. package/dist/cjs/types/stories/Menu/MenuItem.stories.d.ts +13 -0
  31. package/dist/cjs/types/stories/Menu/NestedExample.stories.d.ts +13 -0
  32. package/dist/cjs/types/stories/Modal/Modal.stories.d.ts +0 -1
  33. package/dist/cjs/types/stories/Modal/ModalDemo.stories.d.ts +0 -1
  34. package/dist/cjs/types/stories/Tab/CardTab.stories.d.ts +18 -0
  35. package/dist/cjs/types/stories/Tab/CardTabDemo.stories.d.ts +13 -0
  36. package/dist/cjs/types/stories/Tab/TabHead.stories.d.ts +0 -1
  37. package/dist/cjs/types/stories/Tooltip/Tooltip.stories.d.ts +2 -2
  38. package/dist/esm/index.js +176 -48
  39. package/dist/esm/lib.css +1 -1
  40. package/dist/esm/types/components/FileTree/index.d.ts +12 -0
  41. package/dist/esm/types/components/Forms/SegmentButton/SegmentButtonItem.d.ts +2 -1
  42. package/dist/esm/types/components/Forms/SegmentButton/config.d.ts +7 -1
  43. package/dist/esm/types/components/Forms/TextInput/Simulation.d.ts +4 -7
  44. package/dist/esm/types/components/Forms/TextInput/configs.d.ts +4 -0
  45. package/dist/esm/types/components/Forms/TextInput/index.d.ts +6 -2
  46. package/dist/esm/types/components/Menu/Example/BasicExample.d.ts +3 -0
  47. package/dist/esm/types/components/Menu/Example/FilterExample.d.ts +9 -0
  48. package/dist/esm/types/components/Menu/Example/NestedExample.d.ts +14 -0
  49. package/dist/esm/types/components/Menu/MenuContainer.d.ts +15 -0
  50. package/dist/esm/types/components/Menu/MenuItem.d.ts +18 -0
  51. package/dist/esm/types/components/Menu/index.d.ts +3 -0
  52. package/dist/esm/types/components/Modal/Modal.d.ts +1 -1
  53. package/dist/esm/types/components/Tab/CardTab.d.ts +13 -0
  54. package/dist/esm/types/components/Tab/CardTabConfig.d.ts +26 -0
  55. package/dist/esm/types/components/Tab/CardTabDemo.d.ts +3 -0
  56. package/dist/esm/types/components/Tab/Tab.d.ts +1 -13
  57. package/dist/esm/types/components/Tab/index.d.ts +1 -0
  58. package/dist/esm/types/components/Tooltip/PropsInterface.d.ts +9 -0
  59. package/dist/esm/types/components/Tooltip/Simulation.d.ts +15 -0
  60. package/dist/esm/types/components/Tooltip/index.d.ts +1 -7
  61. package/dist/esm/types/components/index.d.ts +2 -0
  62. package/dist/esm/types/stories/FileTree/FileTree.stories.d.ts +15 -0
  63. package/dist/esm/types/stories/Form/TextInput/TextInput.stories.d.ts +6 -3
  64. package/dist/esm/types/stories/Menu/BasicExample.stories.d.ts +13 -0
  65. package/dist/esm/types/stories/Menu/FilterExample.stories.d.ts +13 -0
  66. package/dist/esm/types/stories/Menu/MenuContainer.stories.d.ts +13 -0
  67. package/dist/esm/types/stories/Menu/MenuItem.stories.d.ts +13 -0
  68. package/dist/esm/types/stories/Menu/NestedExample.stories.d.ts +13 -0
  69. package/dist/esm/types/stories/Modal/Modal.stories.d.ts +0 -1
  70. package/dist/esm/types/stories/Modal/ModalDemo.stories.d.ts +0 -1
  71. package/dist/esm/types/stories/Tab/CardTab.stories.d.ts +18 -0
  72. package/dist/esm/types/stories/Tab/CardTabDemo.stories.d.ts +13 -0
  73. package/dist/esm/types/stories/Tab/TabHead.stories.d.ts +0 -1
  74. package/dist/esm/types/stories/Tooltip/Tooltip.stories.d.ts +2 -2
  75. package/dist/index.d.ts +125 -87
  76. package/package.json +1 -1
  77. package/src/font/Arial/arial.ttf +0 -0
  78. package/src/font/Arial/arialblack.ttf +0 -0
  79. package/src/font/Arial/arialbold.ttf +0 -0
  80. package/src/font/Arial/arialbolditalic.ttf +0 -0
  81. package/src/font/Arial/arialitalic.ttf +0 -0
  82. package/tailwind.config.js +1 -0
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import React, { useState, useRef, useEffect } from 'react';
1
+ import React, { useState, useRef, useEffect, Children, cloneElement } from 'react';
2
2
 
3
3
  function Accordions(_a) {
4
4
  var title = _a.title, content = _a.content;
@@ -1496,6 +1496,82 @@ Divider.defaultProps = {
1496
1496
  classname: '',
1497
1497
  };
1498
1498
 
1499
+ var FileTree = function (_a) {
1500
+ var data = _a.data, color = _a.color;
1501
+ return (React.createElement("div", { className: "file-tree" }, data.map(function (_a, index) {
1502
+ var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
1503
+ return (React.createElement(TreeItem, __assign({ label: label, nodes: nodes, key: index, color: color }, props)));
1504
+ })));
1505
+ };
1506
+ var TreeItem = function (_a) {
1507
+ var label = _a.label, nodes = _a.nodes, color = _a.color, props = __rest(_a, ["label", "nodes", "color"]);
1508
+ var _b = useState(false), isExpand = _b[0], setIsExpand = _b[1];
1509
+ var _c = useState(false), isFocused = _c[0], setIsFocused = _c[1];
1510
+ var focusedIconColor = color
1511
+ ? "text-bia-".concat(color)
1512
+ : 'text-bia-coolgrey-light-50';
1513
+ var foucusedBgColor = color ? "bg-bia-".concat(color) : 'bg-bia-coolgrey-light-50';
1514
+ var textClass = "flex items-center rounded-radius-sm px-[2px] cursor-pointer hover:bg-bia-coolgrey-light-90 focus:pointer-events-none ".concat(isFocused && foucusedBgColor);
1515
+ return (React.createElement("div", { className: "bianic-tree-item" },
1516
+ React.createElement("div", { className: "justify-left group flex items-center" },
1517
+ nodes && nodes.length > 0 ? (React.createElement("button", { className: "cursor-pointer", onClick: function (e) {
1518
+ setIsExpand(function (prev) { return !prev; });
1519
+ } },
1520
+ React.createElement(TbChevronRight, { className: "text-bia-coolgrey-light-50 ".concat(isFocused && focusedIconColor, " ").concat(isExpand && 'rotate-90'), size: 18 }))) : (React.createElement("div", { className: "aspect-square w-[18px]" })),
1521
+ React.createElement("button", __assign({ onFocus: function (e) {
1522
+ var _a;
1523
+ setIsFocused(true);
1524
+ (_a = props === null || props === void 0 ? void 0 : props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
1525
+ }, onBlur: function (e) {
1526
+ var _a;
1527
+ setIsFocused(false);
1528
+ (_a = props === null || props === void 0 ? void 0 : props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
1529
+ }, className: textClass }, props),
1530
+ React.createElement(Text, { variant: "small-text" },
1531
+ " ",
1532
+ label,
1533
+ " "))),
1534
+ isExpand && nodes && nodes.length > 0 && (React.createElement("div", { className: "ml-4" }, nodes.map(function (_a, index) {
1535
+ var label = _a.label, nodes = _a.nodes;
1536
+ return (React.createElement(TreeItem, { label: label, nodes: nodes, key: index, color: color }));
1537
+ })))));
1538
+ };
1539
+
1540
+ function MenuContainer(_a) {
1541
+ var _b = _a.isTopFlat, isTopFlat = _b === void 0 ? false : _b, children = _a.children, open = _a.open, _c = _a.onClose, onClose = _c === void 0 ? function () { } : _c, _d = _a.className, className = _d === void 0 ? '' : _d;
1542
+ var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
1543
+ return (open && (React.createElement(React.Fragment, null,
1544
+ React.createElement("div", { className: "fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); } }),
1545
+ React.createElement("div", { className: "w-fit shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className) }, Children.map(children, function (child) {
1546
+ return React.isValidElement(child)
1547
+ ? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
1548
+ cloneElement(child, { onClose: function () { return onClose(); } })
1549
+ : child;
1550
+ })))));
1551
+ }
1552
+ MenuContainer.defaultProps = {
1553
+ isTopFlat: false,
1554
+ };
1555
+
1556
+ function MenuItem(_a) {
1557
+ var _b = _a.className, className = _b === void 0 ? '' : _b, label = _a.label, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.caption, caption = _d === void 0 ? undefined : _d, _e = _a.isChecked, isChecked = _e === void 0 ? undefined : _e, _f = _a.onClose, onClose = _f === void 0 ? function () { } : _f, children = _a.children, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children"]);
1558
+ var _g = useState(false), isHovered = _g[0], setIsHovered = _g[1];
1559
+ return (React.createElement("div", { className: "group/main relative cursor-pointer first:rounded-t-radius-sm first:pt-[6px] last:rounded-b-radius-sm last:pb-[6px] ".concat(!isHovered && 'z-10'), onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } },
1560
+ React.createElement("div", __assign({ className: "relative z-10 flex items-center p-[5px] font-arial hover:bg-bia-blue-pastel ".concat(className, "}"), role: "button", tabIndex: 0, onClick: function (e) {
1561
+ onClick(e);
1562
+ }, onKeyDown: function () { } }, props),
1563
+ React.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked !== undefined && isChecked && (React.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
1564
+ React.createElement("span", { className: "whitespace-nowrap text-[11px]" }, label),
1565
+ React.createElement("div", { className: "ml-auto flex items-center" },
1566
+ children && React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-grey" }),
1567
+ children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] text-bia-coolgrey" }, caption)))),
1568
+ children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute right-0 top-0 translate-x-full bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px]" }, children))));
1569
+ }
1570
+ MenuItem.defaultProps = {
1571
+ className: '',
1572
+ onClick: function () { },
1573
+ };
1574
+
1499
1575
  var sizeConfig$a = {
1500
1576
  md: {
1501
1577
  fieldSize: 'text-size-base p-2.5 font-[350] h-10',
@@ -1525,6 +1601,10 @@ var styleConfig = {
1525
1601
  fieldStyle: '',
1526
1602
  iconStyle: 'pointer-events-none',
1527
1603
  },
1604
+ 'text-transparent': {
1605
+ fieldStyle: 'px-0 ',
1606
+ iconStyle: '',
1607
+ },
1528
1608
  };
1529
1609
 
1530
1610
  function ValidationIcon(_a) {
@@ -1548,15 +1628,22 @@ function PasswordIcon(_a) {
1548
1628
  }
1549
1629
 
1550
1630
  function TextInput(_a) {
1551
- var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l, _m = _a.maxLength, maxLength = _m === void 0 ? undefined : _m, props = __rest(_a, ["descText", "disabled", "icon", "id", "size", "isValid", "label", "placeholder", "readOnly", "required", "variant", "value", "onChange", "maxLength"]);
1552
- var _o = useState(false), isShow = _o[0], setIsShow = _o[1];
1553
- var _p = styleConfig[variant], fieldStyle = _p.fieldStyle, iconStyle = _p.iconStyle;
1554
- var _q = sizeConfig$a[size], iconSize = _q.iconSize, fieldSize = _q.fieldSize, iconPosition = _q.iconPosition;
1631
+ var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l, _m = _a.maxLength, maxLength = _m === void 0 ? undefined : _m, _o = _a.inputClassName, inputClassName = _o === void 0 ? '' : _o, _p = _a.isFlatRight, isFlatRight = _p === void 0 ? false : _p, props = __rest(_a, ["descText", "disabled", "icon", "id", "size", "isValid", "label", "placeholder", "readOnly", "required", "variant", "value", "onChange", "maxLength", "inputClassName", "isFlatRight"]);
1632
+ var isTransparent = variant.includes('transparent');
1633
+ var _q = useState(false), isShow = _q[0], setIsShow = _q[1];
1634
+ var _r = styleConfig[variant], fieldStyle = _r.fieldStyle, iconStyle = _r.iconStyle;
1635
+ var _s = isTransparent
1636
+ ? __assign(__assign({}, sizeConfig$a[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$a[size].fieldSize +
1637
+ " pe-[".concat(9 + sizeConfig$a[size].iconSize, "px]") }) : sizeConfig$a[size], iconSize = _s.iconSize, fieldSize = _s.fieldSize, iconPosition = _s.iconPosition;
1638
+ var borderStyle = isTransparent
1639
+ ? 'border-transparent bg-transparent' // customize border rule for transparent variant
1640
+ : 'border border-bia-grey-dark-10 bg-primary-white';
1641
+ var iconSizing = iconSize ? "text-[".concat(iconSize, "px]") : 'text-[18px]';
1642
+ var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
1643
+ var isExistValidation = isValid !== null;
1555
1644
  var typeVariant = variant;
1556
1645
  if (variant === 'password')
1557
1646
  typeVariant = isShow ? 'text' : 'password';
1558
- var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
1559
- var isExistValidation = isValid !== null;
1560
1647
  var descColor = 'text-primary-cool';
1561
1648
  if (!disabled && isExistValidation && isValid)
1562
1649
  descColor = 'text-bia-green';
@@ -1575,13 +1662,14 @@ function TextInput(_a) {
1575
1662
  if (variant === 'password') {
1576
1663
  iconElement = (React.createElement(PasswordIcon, { isShow: isShow, showHandler: setIsShow, iconSize: iconSize, disabled: disabled }));
1577
1664
  }
1665
+ var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle, " ").concat(isFlatRight && 'rounded-r-none');
1578
1666
  return (React.createElement("div", { className: "field-group flex w-full flex-col gap-y-2 text-bia-black" },
1579
1667
  React.createElement("label", { htmlFor: id, className: "label text-xs font-semibold" },
1580
1668
  label,
1581
1669
  required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
1582
1670
  React.createElement("div", { className: "relative w-full" },
1583
- React.createElement("input", __assign({ className: "field w-full rounded border border-bia-grey-dark-10 bg-primary-white read-only:pointer-events-none read-only:border-bia-grey-light-50 hover:rounded-b-none focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor), disabled: disabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); }, maxLength: maxLength }, props)),
1584
- React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(iconStyle, " ").concat(iconPosition) }, iconElement)),
1671
+ React.createElement("input", __assign({ className: "field w-full rounded read-only:pointer-events-none read-only:border-bia-grey-light-50 hover:rounded-b-none focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName), disabled: disabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); }, maxLength: maxLength }, props)),
1672
+ React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
1585
1673
  React.createElement("div", { className: "desc flex justify-between gap-1 text-xs ".concat(descColor) },
1586
1674
  descText && React.createElement("span", null, descText),
1587
1675
  maxLength && (React.createElement("span", null,
@@ -1603,6 +1691,8 @@ TextInput.defaultProps = {
1603
1691
  variant: 'text',
1604
1692
  value: '',
1605
1693
  onChange: function () { },
1694
+ inputClassName: '',
1695
+ isFlatRight: false,
1606
1696
  };
1607
1697
 
1608
1698
  // Desc: Radio button size configuration
@@ -1813,7 +1903,7 @@ function SelectInput(_a) {
1813
1903
  setIsOpen(false);
1814
1904
  } }));
1815
1905
  })))),
1816
- React.createElement("span", { className: "desc mt-2 text-xs text-primary-cool" }, descText)));
1906
+ descText && (React.createElement("span", { className: "desc mt-2 text-xs text-primary-cool" }, descText))));
1817
1907
  }
1818
1908
  SelectInput.defaultProps = {
1819
1909
  descText: '',
@@ -1933,16 +2023,27 @@ var roundedConfig = {
1933
2023
  tn: 'first:rounded-l-radius-tn last:rounded-r-radius-tn',
1934
2024
  };
1935
2025
  var sizeConfig$2 = {
1936
- lg: 'text-size-md leading-[23.94px] px-[13px] py-[10.5px] min-w-[112px]',
1937
- md: 'text-size-base leading-[21px] px-[11px] py-[9px] min-w-[96px]',
1938
- sm: 'text-size-sm leading-[15.96px] px-[7px] py-[5px] min-w-[72px]',
1939
- tn: 'text-size-sm leading-[15.96px] px-[4px] py-[2px] min-w-[64px]',
2026
+ lg: 'text-size-md leading-[23.94px] px-[13px] py-[10.5px] ',
2027
+ md: 'text-size-base leading-[21px] px-[11px] py-[9px] ',
2028
+ sm: 'text-size-sm leading-[15.96px] px-[7px] py-[5px] ',
2029
+ tn: 'text-size-sm leading-[15.96px] px-[4px] py-[2px] ',
2030
+ };
2031
+ var minWidthConfig = {
2032
+ lg: 'min-w-[112px]',
2033
+ md: 'min-w-[96px]',
2034
+ sm: 'min-w-[72px]',
2035
+ tn: 'min-w-[64px]',
1940
2036
  };
1941
2037
 
1942
2038
  function SegmentButtonItem(_a) {
1943
- var _b = _a.selected, selected = _b === void 0 ? false : _b, size = _a.size, children = _a.children, disabled = _a.disabled, onClick = _a.onClick;
2039
+ var _b = _a.selected, selected = _b === void 0 ? false : _b, size = _a.size, children = _a.children, disabled = _a.disabled, _c = _a.isfitContent, isfitContent = _c === void 0 ? false : _c, onClick = _a.onClick;
1944
2040
  var isSelected = selected ? 'selected' : 'notSelected';
1945
- return (React.createElement("button", { type: "button", onClick: onClick, disabled: disabled, className: "group:last:border-l-0 border-[1px] border-l-0 border-bia-grey-dark-10 first:border-l-[1px] focus-visible:z-50 focus-visible:outline focus-visible:outline-[3px] focus-visible:-outline-offset-1 focus-visible:outline-bia-blue-light-50 disabled:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-dark-10 ".concat(isSelectedConfig[isSelected], " ").concat(roundedConfig[size], " ").concat(sizeConfig$2[size]) }, children));
2041
+ var sizingStyle = isfitContent
2042
+ ? "".concat(sizeConfig$2[size])
2043
+ : "".concat(sizeConfig$2[size], " ").concat(minWidthConfig[size]);
2044
+ var radiusStyle = "".concat(roundedConfig[size]);
2045
+ var selectedStyle = "".concat(isSelectedConfig[isSelected]);
2046
+ return (React.createElement("button", { type: "button", onClick: onClick, disabled: disabled, className: "group:last:border-l-0 border-[1px] border-l-0 border-bia-grey-dark-10 first:border-l-[1px] focus-visible:z-50 focus-visible:outline focus-visible:outline-[3px] focus-visible:-outline-offset-1 focus-visible:outline-bia-blue-light-50 disabled:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-dark-10 ".concat(selectedStyle, " ").concat(radiusStyle, " ").concat(sizingStyle) }, children));
1946
2047
  }
1947
2048
 
1948
2049
  function SegmentButtonGroup(_a) {
@@ -1951,7 +2052,7 @@ function SegmentButtonGroup(_a) {
1951
2052
  }
1952
2053
 
1953
2054
  function Modal(_a) {
1954
- var size = _a.size, title = _a.title, open = _a.open, zIndex = _a.zIndex, onClose = _a.onClose, rest = __rest(_a, ["size", "title", "open", "zIndex", "onClose"]);
2055
+ var _b = _a.size, size = _b === void 0 ? 'sm' : _b, title = _a.title, open = _a.open, _c = _a.zIndex, zIndex = _c === void 0 ? 100 : _c, onClose = _a.onClose, rest = __rest(_a, ["size", "title", "open", "zIndex", "onClose"]);
1955
2056
  var modalSize;
1956
2057
  if (size === 'sm') {
1957
2058
  modalSize = 'w-[300px]';
@@ -1973,12 +2074,12 @@ function Modal(_a) {
1973
2074
  if (open) {
1974
2075
  return (
1975
2076
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
1976
- React.createElement("div", { className: "fixed inset-0 flex items-center justify-center bg-bia-black-transparent-75", style: { zIndex: !zIndex && isNaN(zIndex) ? 'auto' : zIndex }, id: "wrapper", onClick: handleClose },
1977
- React.createElement("div", { className: "modal flex flex-col gap-[20px] rounded-[5px] bg-white p-[20px] ".concat(modalSize) },
1978
- React.createElement("div", { className: "flex justify-between" },
1979
- React.createElement("div", { className: " w-[260px] text-wrap font-humnst777 text-[18px] font-bold leading-[21.85px] text-primary-black" }, title),
2077
+ React.createElement("div", { className: "bianic-modal-wrapper fixed inset-0 flex items-center justify-center bg-bia-black-transparent-75", style: { zIndex: !zIndex && isNaN(zIndex) ? 'auto' : zIndex }, id: "", onClick: handleClose },
2078
+ React.createElement("div", { className: "bianic-modal flex flex-col gap-[20px] rounded-[5px] bg-white p-[20px] ".concat(modalSize) },
2079
+ React.createElement("div", { className: "bianic-modal-header flex justify-between" },
2080
+ React.createElement("div", { className: " text-wrap text-left font-humnst777 text-[18px] font-bold leading-[21.85px] text-primary-black" }, title),
1980
2081
  React.createElement(Button, { variant: "subtle", radius: "full-rounded", iconLeft: React.createElement(TbX, null), size: "tn", onClick: function () { return onClose(); } })),
1981
- React.createElement("div", { className: "flex flex-col gap-[20px]" }, rest.children))));
2082
+ React.createElement("div", { className: "bianic-modal-content flex w-full flex-col items-start gap-[20px]" }, rest.children))));
1982
2083
  }
1983
2084
  return null;
1984
2085
  }
@@ -2260,17 +2361,9 @@ var configTab = {
2260
2361
  };
2261
2362
 
2262
2363
  function Tab(_a) {
2263
- var children = _a.children, active = _a.active, icon = _a.icon, disabled = _a.disabled, _b = _a.mode, mode = _b === void 0 ? 'horizontal' : _b, _c = _a.fit, fit = _c === void 0 ? 'fit-content' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.card, card = _e === void 0 ? false : _e, rest = __rest(_a, ["children", "active", "icon", "disabled", "mode", "fit", "size", "card"]);
2364
+ var children = _a.children, active = _a.active, icon = _a.icon, disabled = _a.disabled, _b = _a.mode, mode = _b === void 0 ? 'horizontal' : _b, _c = _a.fit, fit = _c === void 0 ? 'fit-content' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, rest = __rest(_a, ["children", "active", "icon", "disabled", "mode", "fit", "size"]);
2264
2365
  var disabledKeyTab = disabled || active ? ' pointer-events-none' : '';
2265
2366
  var cursor;
2266
- var cardColor;
2267
- if (active) {
2268
- cardColor = 'bg-white';
2269
- }
2270
- else {
2271
- cardColor =
2272
- 'bg-bia-grey-light-50 hover:bg-bia-grey-light-20 active:bg-bia-grey';
2273
- }
2274
2367
  if (disabled) {
2275
2368
  cursor = 'cursor-not-allowed';
2276
2369
  }
@@ -2280,26 +2373,25 @@ function Tab(_a) {
2280
2373
  else {
2281
2374
  cursor = 'cursor-auto';
2282
2375
  }
2376
+ var horizontalButtonStyle = mode === 'horizontal' ? '-mb-[1px] flex-col' : 'w-full flex-row';
2377
+ var indicatorStyle = configTab[active ? 'true' : 'false'][mode];
2378
+ var indicatorContainerStyle = mode === 'vertical' ? 'w-[3px] justify-end' : 'h-[3px] w-full';
2379
+ var buttonContentStyle = size === 'sm'
2380
+ ? " pt-[10px] ".concat(mode === 'vertical' ? 'pb-[10px] pe-[30px]' : 'px-[30px] pb-[8px]')
2381
+ : "px-[30px] pt-[13px] ".concat(mode === 'vertical' ? 'pb-[13px]' : 'pb-[10px]', " ");
2283
2382
  var activeKeyTab = active
2284
2383
  ? 'group-disabled:text-bia-coolgrey-disabled text-primary-black'
2285
2384
  : 'text-bia-coolgrey group-hover:text-bia-coolgrey-hover group-active:text-bia-coolgrey-active group-disabled:text-bia-coolgrey-disabled';
2286
2385
  return (React.createElement("div", { className: "".concat(mode === 'horizontal' ? 'h-full' : 'w-full', " ").concat(cursor) },
2287
- React.createElement("button", __assign({ type: "button", disabled: disabled }, rest, { className: "-mb-[1px] flex items-stretch justify-between ".concat(card && cardColor, " ").concat(mode === 'horizontal' ? 'flex-col' : 'w-full flex-row', " group relative outline-none ").concat(disabledKeyTab, " ").concat(fit) }),
2288
- React.createElement("div", { className: "flex items-center justify-center ".concat(size === 'sm' ? " pt-[10px] ".concat(mode === 'vertical' ? 'pb-[10px] pe-[30px]' : 'px-[30px] pb-[8px]') : "px-[30px] pt-[13px] ".concat(mode === 'vertical' ? 'pb-[13px]' : 'pb-[10px]', " ")) },
2386
+ React.createElement("button", __assign({ type: "button", disabled: disabled }, rest, { className: "flex items-stretch justify-between ".concat(horizontalButtonStyle, " group relative outline-none ").concat(disabledKeyTab, " ").concat(fit) }),
2387
+ React.createElement("div", { className: "flex items-center justify-center ".concat(buttonContentStyle) },
2289
2388
  React.createElement("div", { className: "flex items-center justify-center " },
2290
2389
  React.createElement("div", { className: "flex items-center space-x-1 text-nowrap ".concat(activeKeyTab, " ").concat(configTab[size].text) },
2291
2390
  icon && React.createElement("div", { className: "mr-[5px]" }, icon),
2292
2391
  children))),
2293
- React.createElement("div", { className: "flex flex-row ".concat(mode === 'vertical' ? 'w-[3px] justify-end' : 'h-[3px] w-full', " items-end") }, !card && (React.createElement("div", { className: "shadow-lg shadow-bia-blue ".concat(configTab[active ? 'true' : 'false'][mode]) }))))));
2392
+ React.createElement("div", { className: "flex flex-row ".concat(indicatorContainerStyle, " items-end") },
2393
+ React.createElement("div", { className: "shadow-lg shadow-bia-blue ".concat(indicatorStyle) })))));
2294
2394
  }
2295
- Tab.defaultProps = {
2296
- children: null,
2297
- mode: 'horizontal',
2298
- fit: 'size-base',
2299
- size: 'md',
2300
- icon: null,
2301
- card: false,
2302
- };
2303
2395
 
2304
2396
  var radiusConfig = {
2305
2397
  none: '',
@@ -2618,7 +2710,7 @@ var classConfig = {
2618
2710
  };
2619
2711
 
2620
2712
  function Tooltip(props) {
2621
- var children = props.children, content = props.content, delay = props.delay, _a = props.direction, direction = _a === void 0 ? 'top' : _a, _b = props.maxWidth, maxWidth = _b === void 0 ? '300px' : _b;
2713
+ var children = props.children, content = props.content, delay = props.delay, _a = props.direction, direction = _a === void 0 ? 'top' : _a, _b = props.maxWidth, maxWidth = _b === void 0 ? undefined : _b;
2622
2714
  var timeout;
2623
2715
  var _c = useState(false), active = _c[0], setActive = _c[1];
2624
2716
  var showTip = function () {
@@ -2631,16 +2723,52 @@ function Tooltip(props) {
2631
2723
  setActive(false);
2632
2724
  };
2633
2725
  var _d = classConfig[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
2634
- return (React.createElement("div", { className: "Tooltip-Wrapper relative flex flex-col w-full h-fit", onMouseEnter: showTip, onMouseLeave: hideTip },
2726
+ var tooltipContainerRef = useRef(null);
2727
+ var _e = useState({
2728
+ maxWidth: maxWidth + 'px',
2729
+ whiteSpace: 'nowrap',
2730
+ }), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
2731
+ var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
2732
+ var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
2733
+ var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
2734
+ var offsetHeight = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetHeight;
2735
+ useEffect(function () {
2736
+ if (scrollWidth && offsetWidth) {
2737
+ var maxWidthNumber = Number(maxWidth);
2738
+ var isMultiLine = offsetHeight > 23; // 23 pixels is the approximate height of one line of text
2739
+ // Tooltip Width and Whitespace Determination Rules:
2740
+ // 1. Default Condition:
2741
+ // - width: fit-content
2742
+ // - whiteSpace: nowrap
2743
+ // 2. When maxWidth is Set:
2744
+ // * Text Exceeds maxWidth:
2745
+ // - width: maxWidth
2746
+ // - whiteSpace: normal
2747
+ // * Text Equals maxWidth (Multi-line):
2748
+ // - width: maxWidth
2749
+ // - whiteSpace: normal
2750
+ // * Text Less Than maxWidth:
2751
+ // - width: fit-content
2752
+ // - whiteSpace: nowrap
2753
+ var newWidth_1 = 'fit-content';
2754
+ var newWhiteSpace_1 = 'nowrap';
2755
+ if (scrollWidth > maxWidthNumber ||
2756
+ (offsetWidth === maxWidthNumber && isMultiLine)) {
2757
+ newWidth_1 = maxWidthNumber + 'px';
2758
+ newWhiteSpace_1 = 'normal';
2759
+ }
2760
+ setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
2761
+ }
2762
+ }, [content, maxWidth, scrollWidth, offsetHeight]);
2763
+ return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip },
2635
2764
  children,
2636
- active && (React.createElement("div", { className: "Tooltip absolute px-[7px] py-[4px] text-size-sm bg-primary-black text-primary-white z-50 whitespace-nowrap rounded-[4px] ".concat(tooltipContainer), style: { maxWidth: maxWidth } },
2637
- React.createElement("p", { className: " whitespace-pre-wrap break-words" }, content)))));
2765
+ active && (React.createElement("div", { className: "tooltip-container break-word absolute z-50 inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(tooltipContainer), style: tooltipContainerStyle, ref: tooltipContainerRef }, content))));
2638
2766
  }
2639
2767
  Tooltip.defaultProps = {
2640
2768
  delay: 400,
2641
2769
  direction: 'top',
2642
- maxWidth: '300px',
2770
+ maxWidth: '300',
2643
2771
  };
2644
2772
  Tooltip.defaultProps = {};
2645
2773
 
2646
- export { Accordions, Alert, Avatar, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, Display, Divider, Heading, LiveSearch, Modal, P, PaginationBar, Piils as Pills, Popover, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, Table, TableBody, TableCol, TableDemo, TableHead, TableRow, TagLabel, Text, TextArea, TextInput, Toggle, Tooltip };
2774
+ export { Accordions, Alert, Avatar, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, Display, Divider, FileTree, Heading, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, Piils as Pills, Popover, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, Table, TableBody, TableCol, TableDemo, TableHead, TableRow, TagLabel, Text, TextArea, TextInput, Toggle, Tooltip };