bianic-ui 1.10.2 → 1.12.0

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 (29) hide show
  1. package/dist/cjs/index.js +89 -34
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Icons/Neutral.d.ts +4 -0
  4. package/dist/cjs/types/components/Icons/index.d.ts +1 -0
  5. package/dist/cjs/types/components/ResizeableDiv/Simulation.d.ts +1 -0
  6. package/dist/cjs/types/components/ResizeableDiv/SimulationZIndex.d.ts +15 -0
  7. package/dist/cjs/types/components/ResizeableDiv/index.d.ts +4 -1
  8. package/dist/cjs/types/components/Snippet/ContextualButtonsTable.d.ts +3 -0
  9. package/dist/cjs/types/components/Typography/Text/index.d.ts +2 -1
  10. package/dist/cjs/types/stories/Icons/Neutral.stories.d.ts +14 -0
  11. package/dist/cjs/types/stories/Resizeable/ResizeableSimulation.stories.d.ts +0 -1
  12. package/dist/cjs/types/stories/Resizeable/ResizeableZIndexSimulation.stories.d.ts +12 -0
  13. package/dist/cjs/types/stories/Snippet/ContextualButtonsTable/Story.stories.d.ts +13 -0
  14. package/dist/esm/index.js +89 -35
  15. package/dist/esm/lib.css +1 -1
  16. package/dist/esm/types/components/Icons/Neutral.d.ts +4 -0
  17. package/dist/esm/types/components/Icons/index.d.ts +1 -0
  18. package/dist/esm/types/components/ResizeableDiv/Simulation.d.ts +1 -0
  19. package/dist/esm/types/components/ResizeableDiv/SimulationZIndex.d.ts +15 -0
  20. package/dist/esm/types/components/ResizeableDiv/index.d.ts +4 -1
  21. package/dist/esm/types/components/Snippet/ContextualButtonsTable.d.ts +3 -0
  22. package/dist/esm/types/components/Typography/Text/index.d.ts +2 -1
  23. package/dist/esm/types/stories/Icons/Neutral.stories.d.ts +14 -0
  24. package/dist/esm/types/stories/Resizeable/ResizeableSimulation.stories.d.ts +0 -1
  25. package/dist/esm/types/stories/Resizeable/ResizeableZIndexSimulation.stories.d.ts +12 -0
  26. package/dist/esm/types/stories/Snippet/ContextualButtonsTable/Story.stories.d.ts +13 -0
  27. package/dist/index.d.ts +9 -3
  28. package/package.json +1 -1
  29. package/tailwind.config.js +1 -1
package/dist/cjs/index.js CHANGED
@@ -309,12 +309,17 @@ var variantUnion$2 = [
309
309
  'link',
310
310
  ];
311
311
  function Text(_a) {
312
- var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children;
312
+ var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children, _c = _a.className, className = _c === void 0 ? '' : _c;
313
313
  var validatedVariant = validUnion(variant, variantUnion$2);
314
- return (React.createElement("span", { className: "bianic-text ".concat(textClasses[validatedVariant], " ").concat(extended) }, childrenElement(children)));
314
+ var defaultColor = extended.includes('text-bia') || (className === null || className === void 0 ? void 0 : className.includes('text-bia'))
315
+ ? ''
316
+ : 'text-bia-black';
317
+ var extendedClasses = "".concat(className, " ").concat(extended);
318
+ return (React.createElement("span", { className: "bianic-text ".concat(textClasses[validatedVariant], " ").concat(defaultColor, " ").concat(extendedClasses) }, childrenElement(children)));
315
319
  }
316
320
  Text.defaultProps = {
317
321
  extended: '',
322
+ className: '',
318
323
  };
319
324
 
320
325
  /******************************************************************************
@@ -440,10 +445,10 @@ var minWidthConfig$1 = {
440
445
  tn: 'min-w-[64px]',
441
446
  };
442
447
  var iconOnlySizeConfig$1 = {
443
- lg: 'p-[13px] flex items-center justify-center gap-[10px]',
444
- md: ' p-[11px] flex items-center justify-center gap-[5px]',
445
- sm: 'p-[8px] flex items-center justify-center gap-[5px] ',
446
- tn: 'p-[4px] flex items-center justify-center gap-[3px]',
448
+ lg: 'py-[13px] flex items-center justify-center gap-[10px]',
449
+ md: 'py-[11px] flex items-center justify-center gap-[5px]',
450
+ sm: 'py-[8px] flex items-center justify-center gap-[5px] ',
451
+ tn: 'py-[4px] flex items-center justify-center gap-[3px]',
447
452
  };
448
453
  var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
449
454
  var variantConfig$2 = {
@@ -481,7 +486,7 @@ var variantUnion$1 = [
481
486
  'primary-outlined',
482
487
  'success-outlined',
483
488
  'warning-outlined',
484
- 'form-group'
489
+ 'form-group',
485
490
  ];
486
491
  var radiusUnion = ['default', 'full-rounded'];
487
492
  var sizeUnion$5 = ['md', 'lg', 'sm', 'tn'];
@@ -506,7 +511,7 @@ function Button(_a) {
506
511
  }
507
512
  var sizeClass = label || variant === 'form-group'
508
513
  ? " ".concat(minWidthRules, " ").concat(sizingRules)
509
- : iconOnlySizeConfig$1[validatedSize];
514
+ : "".concat(iconOnlySizeConfig$1[validatedSize], " ").concat(variant.includes('link') ? '' : "".concat(sidePaddingConfig[validatedSize]));
510
515
  var classString = "\n ".concat(variantConfig$2[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig$1[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
511
516
  return (React.createElement("button", __assign({ type: "button", className: "bianic-button bianic-fgc-target flex items-center justify-center font-semibold ".concat(classString), disabled: disabled }, props),
512
517
  childrenElement(iconLeft || left),
@@ -1588,7 +1593,7 @@ function Color() {
1588
1593
  'light-30',
1589
1594
  'light-20',
1590
1595
  'light-10',
1591
- 'primary',
1596
+ '',
1592
1597
  'dark-10',
1593
1598
  'dark-20',
1594
1599
  'dark-30',
@@ -1599,14 +1604,8 @@ function Color() {
1599
1604
  'dark-80',
1600
1605
  'dark-90',
1601
1606
  ];
1602
- var aliases = {
1603
- 'light-90': 'pastel',
1604
- 'light-50': 'disabled',
1605
- 'light-10': 'hover',
1606
- 'dark-10': 'active',
1607
- };
1608
1607
  return (React.createElement("div", { className: "color-pallete flex flex-col gap-y-10" },
1609
- React.createElement("div", { className: "flex gap-x-5 justify-center" },
1608
+ React.createElement("div", { className: "flex justify-center gap-x-5" },
1610
1609
  React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3" },
1611
1610
  React.createElement("div", { className: "text-center text-xs font-semibold" }, "Black"),
1612
1611
  React.createElement("div", { className: "aspect-square w-10 rounded-lg", style: {
@@ -1621,13 +1620,13 @@ function Color() {
1621
1620
  React.createElement("div", { className: "flex flex-col items-end justify-center space-y-3" },
1622
1621
  React.createElement("div", { className: "h-10 min-w-10" }),
1623
1622
  lightLevels.map(function (level) { return (React.createElement("div", { key: level, className: "flex h-10 w-fit items-center justify-end" },
1624
- React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" }, aliases[level] ? "(".concat(aliases[level], ") ").concat(level) : level))); })),
1623
+ React.createElement("div", { className: "whitespace-nowrap text-center text-xs font-semibold" }, level))); })),
1625
1624
  colors.map(function (color, index) {
1626
1625
  return (React.createElement("div", { className: "flex w-fit flex-col items-center gap-y-3", key: index },
1627
1626
  React.createElement("div", { className: "h-10 w-fit" },
1628
1627
  React.createElement("div", { className: "text-center text-xs font-semibold" }, color.tailwind)),
1629
1628
  lightLevels.map(function (level) {
1630
- var suffix = level === 'primary' ? '' : "-".concat(level);
1629
+ var suffix = level === '' ? '' : "-".concat(level);
1631
1630
  return (React.createElement("div", { key: level, className: "aspect-square w-10 rounded-lg", style: {
1632
1631
  backgroundColor: "var(--".concat(color.css).concat(suffix, ")"),
1633
1632
  } }));
@@ -1728,18 +1727,18 @@ var TreeItem = function (_a) {
1728
1727
  };
1729
1728
 
1730
1729
  var MenuContainer = React.forwardRef(function MenuContainer(propsComp, ref) {
1731
- var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.zIndex, zIndex = _f === void 0 ? 0 : _f, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex"]);
1730
+ var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.zIndex, zIndex = _f === void 0 ? 100 : _f, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex"]);
1732
1731
  var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
1733
1732
  return (open && (React.createElement(React.Fragment, null,
1734
- isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); } })),
1733
+ isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); }, style: { zIndex: zIndex } })),
1735
1734
  React.createElement("div", __assign({ className: "w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), ref: ref, style: {
1736
- zIndex: zIndex,
1735
+ zIndex: zIndex + 10,
1737
1736
  } }, restProps), React.Children.map(children, function (child) {
1738
1737
  return React.isValidElement(child)
1739
1738
  ? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
1740
1739
  React.cloneElement(child, {
1741
1740
  onClose: function () { return onClose(); },
1742
- zIndex: zIndex,
1741
+ zIndex: zIndex + 10,
1743
1742
  })
1744
1743
  : child;
1745
1744
  })))));
@@ -1749,7 +1748,7 @@ MenuContainer.defaultProps = {
1749
1748
  };
1750
1749
 
1751
1750
  function MenuItem(_a) {
1752
- 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, _g = _a.zIndex, zIndex = _g === void 0 ? 0 : _g, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children", "zIndex"]);
1751
+ 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, _g = _a.zIndex, zIndex = _g === void 0 ? 100 : _g, props = __rest(_a, ["className", "label", "onClick", "caption", "isChecked", "onClose", "children", "zIndex"]);
1753
1752
  var _h = React.useState(false), isHovered = _h[0], setIsHovered = _h[1];
1754
1753
  var _j = React.useState(false), isLeft = _j[0], setIsLeft = _j[1];
1755
1754
  var isWithChecked = isChecked !== undefined;
@@ -1778,14 +1777,14 @@ function MenuItem(_a) {
1778
1777
  React.createElement("div", __assign({ className: "relative flex items-center py-[5px] hover:bg-bia-blue-pastel ".concat(itemClass), role: "button", tabIndex: 0, onClick: function (e) {
1779
1778
  onClick(e);
1780
1779
  }, onKeyDown: function () { }, style: {
1781
- zIndex: isHovered ? currentZIndex : 0,
1780
+ zIndex: isHovered ? currentZIndex : currentZIndex + 15,
1782
1781
  } }, props),
1783
1782
  isWithChecked && (React.createElement("div", { className: "mr-[5px] aspect-square w-[14px]" }, isChecked && React.createElement(TbCheck, { className: "text-primary-black", size: 14 }))),
1784
1783
  React.createElement("span", { className: "whitespace-nowrap font-arial text-[11px] text-bia-black" }, label),
1785
1784
  React.createElement("div", { className: "ml-auto flex items-center" },
1786
1785
  children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),
1787
1786
  children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] text-bia-coolgrey" }, caption)))),
1788
- children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex }, children))));
1787
+ children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex + 10 }, children))));
1789
1788
  }
1790
1789
  MenuItem.defaultProps = {
1791
1790
  className: '',
@@ -2128,7 +2127,7 @@ var fontConfig = {
2128
2127
  };
2129
2128
 
2130
2129
  var DropdownContainer = React.forwardRef(function DropdownContainer(propsComp, ref) {
2131
- var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ? 0 : _h, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "size", "onClickItem", "zIndex"]);
2130
+ var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ? 100 : _h, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "size", "onClickItem", "zIndex"]);
2132
2131
  var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
2133
2132
  var sizeClass = containerSizeConfig[size] || containerSizeConfig['md'];
2134
2133
  var containerClass = "".concat(sizeClass, " ").concat(radiusClass, " ").concat(className);
@@ -2157,7 +2156,7 @@ DropdownContainer.defaultProps = {
2157
2156
  };
2158
2157
 
2159
2158
  function DropdownItem(_a) {
2160
- var children = _a.children, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.onClickItem, onClickItem = _c === void 0 ? function () { } : _c, _d = _a.onClose, onClose = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.value, value = _f === void 0 ? '' : _f, content = _a.content, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 0 : _h, props = __rest(_a, ["children", "className", "onClickItem", "onClose", "size", "value", "content", "disabled", "zIndex"]);
2159
+ var children = _a.children, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.onClickItem, onClickItem = _c === void 0 ? function () { } : _c, _d = _a.onClose, onClose = _d === void 0 ? function () { } : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.value, value = _f === void 0 ? '' : _f, content = _a.content, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.zIndex, zIndex = _h === void 0 ? 100 : _h, props = __rest(_a, ["children", "className", "onClickItem", "onClose", "size", "value", "content", "disabled", "zIndex"]);
2161
2160
  var _j = React.useState(false), isHovered = _j[0], setIsHovered = _j[1];
2162
2161
  var _k = React.useState(false), isLeft = _k[0], setIsLeft = _k[1];
2163
2162
  var fontClass = fontConfig[size] || fontConfig['md'];
@@ -2201,9 +2200,11 @@ var sizeUnion$2 = ['md', 'sm'];
2201
2200
  function SelectInput(_a) {
2202
2201
  var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, id = _a.id, label = _a.label, _d = _a.options, options = _d === void 0 ? [] : _d, _e = _a.required, required = _e === void 0 ? false : _e, selected = _a.selected, setSelected = _a.setSelected, _f = _a.onClickDropdown, onClickDropdown = _f === void 0 ? function () { } : _f, children = _a.children, _g = _a.dropContProps, _h = _g === void 0 ? {} : _g, _j = _h.className, dropContClassName = _j === void 0 ? '' : _j, restDropContProps = __rest(_h, ["className"]), props = __rest(_a, ["descText", "disabled", "size", "id", "label", "options", "required", "selected", "setSelected", "onClickDropdown", "children", "dropContProps"]);
2203
2202
  var _k = React.useState(false), isOpen = _k[0], setIsOpen = _k[1];
2203
+ var _l = React.useState(false), isDropUp = _l[0], setIsDropUp = _l[1];
2204
2204
  var validatedSize = validUnion(size, sizeUnion$2);
2205
- var _l = sizeConfig$7[validatedSize], searchSize = _l.searchSize, iconSize = _l.iconSize;
2205
+ var _m = sizeConfig$7[validatedSize], searchSize = _m.searchSize, iconSize = _m.iconSize;
2206
2206
  var inputRef = React.useRef(null);
2207
+ var dropdownContRef = React.useRef(null);
2207
2208
  var handleOutsideClick = function (e) {
2208
2209
  if (inputRef.current && !inputRef.current.contains(e.target)) {
2209
2210
  setIsOpen(false);
@@ -2215,6 +2216,22 @@ function SelectInput(_a) {
2215
2216
  document.removeEventListener('mousedown', handleOutsideClick);
2216
2217
  };
2217
2218
  });
2219
+ React.useEffect(function () {
2220
+ var _a, _b;
2221
+ if (inputRef.current) {
2222
+ // Adjust dropdown position to prevent show up out of screen
2223
+ var windowHeight = window.innerHeight;
2224
+ var inputRect = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2225
+ var inputBottom = inputRect === null || inputRect === void 0 ? void 0 : inputRect.bottom;
2226
+ var diff = windowHeight - inputBottom;
2227
+ var dropdownRect = (_b = dropdownContRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
2228
+ var dropdownHeight = (dropdownRect === null || dropdownRect === void 0 ? void 0 : dropdownRect.height) || 0;
2229
+ if (dropdownHeight >= diff)
2230
+ setIsDropUp(true);
2231
+ else
2232
+ setIsDropUp(false);
2233
+ }
2234
+ }, [isOpen]);
2218
2235
  var isObjectOptionItem = false;
2219
2236
  if (options.every(function (item) { return typeof item === 'object' && item !== null; }))
2220
2237
  isObjectOptionItem = true;
@@ -2234,6 +2251,7 @@ function SelectInput(_a) {
2234
2251
  optionsElement.style.maxHeight = "".concat(Math.max(0, maxHeight), "px");
2235
2252
  }
2236
2253
  }, [isOpen]);
2254
+ var dropdownPosition = isDropUp ? 'bottom-full' : 'top-full';
2237
2255
  return (React.createElement("div", { className: "field-group flex w-full flex-col", ref: inputRef },
2238
2256
  React.createElement("label", { htmlFor: id, className: "label pb-2 text-xs font-semibold" },
2239
2257
  childrenElement(label),
@@ -2241,7 +2259,7 @@ function SelectInput(_a) {
2241
2259
  React.createElement("div", { className: "group relative w-full" },
2242
2260
  React.createElement("input", __assign({ className: "field peer w-full cursor-pointer rounded border border-bia-grey-dark-10 bg-primary-white pe-8 focus-visible:outline-none enabled:hover:rounded-b-none enabled:hover:border-b-bia-blue enabled:focus:rounded-b-none enabled:focus:border-b-bia-blue disabled:bg-bia-grey-light-80 disabled:text-bia-coolgrey ".concat(searchSize), onClick: function () { return setIsOpen(!isOpen); }, value: selectedLabel, readOnly: true, id: id, disabled: disabled }, props)),
2243
2261
  React.createElement("div", { className: "pointer-events-none absolute inset-y-0 flex items-center pl-3 text-bia-coolgrey peer-disabled:text-bia-coolgrey-light-50 ".concat(iconSize) }, isOpen ? React.createElement(TbChevronUp, null) : React.createElement(TbChevronDown, null)),
2244
- children === undefined && isOpen && (React.createElement("div", { className: "absolute z-10 w-full overflow-y-auto rounded-b-md border border-bia-grey-dark-10 bg-primary-white shadow-lg", ref: optionsRef, onClick: onClickDropdown }, options.map(function (option) {
2262
+ children === undefined && isOpen && (React.createElement("div", { className: "absolute z-10 w-full rounded-b-md border border-bia-grey-dark-10 bg-primary-white shadow-lg ".concat(dropdownPosition), ref: optionsRef, onClick: onClickDropdown }, options.map(function (option) {
2245
2263
  var isSelected = JSON.stringify(option) === JSON.stringify(selected);
2246
2264
  var optionLabel = isObjectOptionItem ? option.label : option;
2247
2265
  var optionCaption = isObjectOptionItem ? option.caption : '';
@@ -2253,7 +2271,7 @@ function SelectInput(_a) {
2253
2271
  setIsOpen(false);
2254
2272
  } }));
2255
2273
  }))),
2256
- children && isOpen && (React.createElement(DropdownContainer, __assign({ open: isOpen, onClose: function () { return setIsOpen(false); }, size: size, isTopFlat: true, className: "bianic-livesearch-dropdown absolute z-10 mt-1 w-full overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(dropContClassName) }, restDropContProps), React.Children.map(children, function (child) {
2274
+ children && isOpen && (React.createElement(DropdownContainer, __assign({ open: isOpen, onClose: function () { return setIsOpen(false); }, size: size, isTopFlat: true, ref: dropdownContRef, className: "bianic-livesearch-dropdown absolute z-10 mt-1 w-full overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none ".concat(dropdownPosition, " ").concat(dropContClassName) }, restDropContProps), React.Children.map(children, function (child) {
2257
2275
  if (React.isValidElement(child)) {
2258
2276
  return React.cloneElement(child, {
2259
2277
  isSelected: selected && selected.id === child.props.value.id,
@@ -2301,6 +2319,8 @@ function LiveSearch(_a) {
2301
2319
  var dropContClassName = dropContProps.className, restDropContProps = __rest(dropContProps, ["className"]);
2302
2320
  var isValueExist = value && value.label !== undefined && value.label !== '';
2303
2321
  var inputRef = React.useRef(null);
2322
+ var dropdownContRef = React.useRef(null);
2323
+ var _p = React.useState(false), isDropUp = _p[0], setIsDropUp = _p[1];
2304
2324
  var handleOutsideClick = function (e) {
2305
2325
  if (inputRef.current && !inputRef.current.contains(e.target)) {
2306
2326
  setIsOpen(false);
@@ -2320,6 +2340,22 @@ function LiveSearch(_a) {
2320
2340
  setSearchTerm(value.label || '');
2321
2341
  }
2322
2342
  }, [value.label, searchTerm]);
2343
+ React.useEffect(function () {
2344
+ var _a, _b;
2345
+ if (inputRef.current) {
2346
+ // Adjust dropdown position to prevent show up out of screen
2347
+ var windowHeight = window.innerHeight;
2348
+ var inputRect = (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2349
+ var inputBottom = inputRect === null || inputRect === void 0 ? void 0 : inputRect.bottom;
2350
+ var diff = windowHeight - inputBottom;
2351
+ var dropdownRect = (_b = dropdownContRef.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
2352
+ var dropdownHeight = (dropdownRect === null || dropdownRect === void 0 ? void 0 : dropdownRect.height) || 0;
2353
+ if (dropdownHeight >= diff)
2354
+ setIsDropUp(true);
2355
+ else
2356
+ setIsDropUp(false);
2357
+ }
2358
+ }, [isOpen]);
2323
2359
  var filteredOptions = options.filter(function (item) {
2324
2360
  return item.label.toLowerCase().includes(value.label.toLowerCase());
2325
2361
  });
@@ -2385,6 +2421,7 @@ function LiveSearch(_a) {
2385
2421
  hasFilteredResults =
2386
2422
  React.Children.toArray(renderedChildren).filter(Boolean).length > 0; // Should always be true if there are initial children
2387
2423
  }
2424
+ var dropdownPosition = isDropUp ? 'bottom-full' : 'top-full';
2388
2425
  return (React.createElement("div", { className: "bianic-livesearch field-group flex w-full flex-col gap-y-2", ref: inputRef },
2389
2426
  React.createElement("label", { htmlFor: id, className: "bianic-livesearch-label text-xs font-semibold read-only:pointer-events-none" },
2390
2427
  label,
@@ -2409,7 +2446,7 @@ function LiveSearch(_a) {
2409
2446
  setIsOpen(false);
2410
2447
  } }));
2411
2448
  }))),
2412
- children && isOpen && (React.createElement(DropdownContainer, __assign({ open: isOpen, onClose: function () { return setIsOpen(false); }, size: size, isTopFlat: true, zIndex: 10, className: "bianic-livesearch-dropdown absolute w-full overflow-hidden bg-white shadow-lg ".concat(dropContClassName) }, restDropContProps), hasFilteredResults
2449
+ children && isOpen && (React.createElement(DropdownContainer, __assign({ open: isOpen, onClose: function () { return setIsOpen(false); }, size: size, isTopFlat: true, zIndex: 10, className: "bianic-livesearch-dropdown absolute w-full overflow-hidden bg-white shadow-lg ".concat(dropdownPosition, " ").concat(dropContClassName), ref: dropdownContRef }, restDropContProps), hasFilteredResults
2413
2450
  ? renderedChildren
2414
2451
  : // If no results and searchTerm is present
2415
2452
  searchTerm.length > 0 && (React.createElement(DropdownItem, { content: React.createElement("div", { className: "px-4 py-2 text-gray-500" }, "Tidak ada hasil ditemukan.") }))))),
@@ -3146,6 +3183,14 @@ var Inlet = function (_a) {
3146
3183
  React.createElement("path", { d: "M15.586 10.657L11.636 6.707C11.4538 6.5184 11.353 6.26579 11.3553 6.0036C11.3576 5.7414 11.4628 5.49059 11.6482 5.30518C11.8336 5.11977 12.0844 5.0146 12.3466 5.01232C12.6088 5.01005 12.8614 5.11084 13.05 5.293L18.707 10.95C18.8002 11.0427 18.8741 11.1528 18.9246 11.2741C18.9751 11.3955 19.001 11.5256 19.001 11.657C19.001 11.7884 18.9751 11.9185 18.9246 12.0399C18.8741 12.1612 18.8002 12.2713 18.707 12.364L13.05 18.021C12.9578 18.1165 12.8474 18.1927 12.7254 18.2451C12.6034 18.2975 12.4722 18.3251 12.3394 18.3263C12.2066 18.3274 12.0749 18.3021 11.952 18.2518C11.8292 18.2015 11.7175 18.1273 11.6236 18.0334C11.5297 17.9395 11.4555 17.8279 11.4052 17.705C11.3549 17.5821 11.3296 17.4504 11.3308 17.3176C11.3319 17.1848 11.3595 17.0536 11.4119 16.9316C11.4643 16.8096 11.5405 16.6992 11.636 16.607L15.586 12.657H6C5.73478 12.657 5.48043 12.5516 5.29289 12.3641C5.10536 12.1766 5 11.9222 5 11.657C5 11.3918 5.10536 11.1374 5.29289 10.9499C5.48043 10.7624 5.73478 10.657 6 10.657H15.586Z", fill: "inherit" })));
3147
3184
  };
3148
3185
 
3186
+ var Neutral = function (_a) {
3187
+ var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
3188
+ var numericSize = Number(size);
3189
+ return (React.createElement("svg", { className: className, width: numericSize * 2, height: numericSize, viewBox: "0 0 48 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
3190
+ React.createElement("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M28 12C28 11.4477 28.4477 11 29 11H43C43.5523 11 44 11.4477 44 12C44 12.5523 43.5523 13 43 13H29C28.4477 13 28 12.5523 28 12Z", fill: "#2F2F2F" }),
3191
+ React.createElement("path", { d: "M12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22Z", fill: "#2F2F2F" })));
3192
+ };
3193
+
3149
3194
  function Modal(_a) {
3150
3195
  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, onClick = _a.onClick, rest = __rest(_a, ["size", "title", "open", "zIndex", "onClose", "onClick"]);
3151
3196
  var modalSize;
@@ -3432,8 +3477,8 @@ var resizerContainerClass = {
3432
3477
  };
3433
3478
 
3434
3479
  function ResizeableDiv(_a) {
3435
- var _b = _a.position, position = _b === void 0 ? 'bottom' : _b, children = _a.children, className = _a.className, initialWidth = _a.initialWidth, minWidth = _a.minWidth, initialHeight = _a.initialHeight, minHeight = _a.minHeight;
3436
- var container = React.useRef(null);
3480
+ var _b = _a.position, position = _b === void 0 ? 'bottom' : _b, children = _a.children, className = _a.className, initialWidth = _a.initialWidth, minWidth = _a.minWidth, maxWidth = _a.maxWidth, initialHeight = _a.initialHeight, minHeight = _a.minHeight, maxHeight = _a.maxHeight, ref = _a.ref, zIndex = _a.zIndex; __rest(_a, ["position", "children", "className", "initialWidth", "minWidth", "maxWidth", "initialHeight", "minHeight", "maxHeight", "ref", "zIndex"]);
3481
+ var container = ref || React.useRef(null);
3437
3482
  var resizer = React.useRef(null);
3438
3483
  var handleResize = function (e) {
3439
3484
  var mouseY = e.clientY;
@@ -3478,19 +3523,28 @@ function ResizeableDiv(_a) {
3478
3523
  var minimumWidth = typeof minWidth === 'number' && !isNaN(minWidth)
3479
3524
  ? "".concat(minWidth, "px")
3480
3525
  : minWidth;
3526
+ var maximumWidth = typeof maxWidth === 'number' && !isNaN(maxWidth)
3527
+ ? "".concat(maxWidth, "px")
3528
+ : maxWidth;
3481
3529
  var containerHeight = typeof initialHeight === 'number' && !isNaN(initialHeight)
3482
3530
  ? "".concat(initialHeight, "px")
3483
3531
  : initialHeight;
3484
3532
  var minimumHeight = typeof minHeight === 'number' && !isNaN(minHeight)
3485
3533
  ? "".concat(minHeight, "px")
3486
3534
  : minHeight;
3535
+ var maximumHeight = typeof maxHeight === 'number' && !isNaN(maxHeight)
3536
+ ? "".concat(maxHeight, "px")
3537
+ : maxHeight;
3487
3538
  return (React.createElement("div", { className: "relative overflow-visible", ref: container, style: {
3539
+ zIndex: zIndex,
3488
3540
  width: containerWidth,
3489
3541
  height: containerHeight,
3490
3542
  minWidth: minimumWidth,
3491
3543
  minHeight: minimumHeight,
3544
+ maxHeight: maximumHeight,
3545
+ maxWidth: maximumWidth,
3492
3546
  } },
3493
- React.createElement("div", { className: "group peer absolute z-10 flex items-center justify-center ".concat(resizerContainerClass[position]), ref: resizer, onMouseDown: function () {
3547
+ React.createElement("div", { className: "group peer absolute flex items-center justify-center ".concat(resizerContainerClass[position]), ref: resizer, onMouseDown: function () {
3494
3548
  window.addEventListener('mousemove', handleResize);
3495
3549
  window.addEventListener('mouseup', stopResize);
3496
3550
  }, role: "button" },
@@ -3973,6 +4027,7 @@ exports.BCFlowqount = Flowqount;
3973
4027
  exports.BCInlet = Inlet;
3974
4028
  exports.BCLegend = Legend;
3975
4029
  exports.BCModalBalance = ModalBalance;
4030
+ exports.BCNeutral = Neutral;
3976
4031
  exports.BCNode = Node;
3977
4032
  exports.BCOutlet = Outlet;
3978
4033
  exports.BCPort = Port;