bianic-ui 2.2.0 → 2.3.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 (38) hide show
  1. package/dist/cjs/index.js +232 -73
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Card/config.d.ts +6 -0
  4. package/dist/cjs/types/components/Card/index.d.ts +8 -0
  5. package/dist/cjs/types/components/FileTree/FileTreeSimulation.d.ts +3 -0
  6. package/dist/cjs/types/components/FileTree/TreeItem.d.ts +13 -0
  7. package/dist/cjs/types/components/FileTree/useFileTree.d.ts +12 -0
  8. package/dist/cjs/types/components/Forms/SelectInput/Example/CustomDropdown.d.ts +2 -1
  9. package/dist/cjs/types/components/PaginationBar/SelectedPage.d.ts +7 -0
  10. package/dist/cjs/types/components/Popover/PropInterface.d.ts +21 -0
  11. package/dist/cjs/types/components/Popover/index.d.ts +2 -10
  12. package/dist/cjs/types/components/Tooltip/PropsInterface.d.ts +6 -2
  13. package/dist/cjs/types/components/index.d.ts +3 -0
  14. package/dist/cjs/types/stories/Card/Card.stories.d.ts +17 -0
  15. package/dist/cjs/types/stories/FileTree/FileTreeSimulation.stories.d.ts +12 -0
  16. package/dist/cjs/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +2 -2
  17. package/dist/cjs/types/stories/Form/SelectInput/SelectInputCustom.stories.d.ts +1 -1
  18. package/dist/cjs/types/utility/public/words.d.ts +13 -0
  19. package/dist/esm/index.js +230 -74
  20. package/dist/esm/lib.css +1 -1
  21. package/dist/esm/types/components/Card/config.d.ts +6 -0
  22. package/dist/esm/types/components/Card/index.d.ts +8 -0
  23. package/dist/esm/types/components/FileTree/FileTreeSimulation.d.ts +3 -0
  24. package/dist/esm/types/components/FileTree/TreeItem.d.ts +13 -0
  25. package/dist/esm/types/components/FileTree/useFileTree.d.ts +12 -0
  26. package/dist/esm/types/components/Forms/SelectInput/Example/CustomDropdown.d.ts +2 -1
  27. package/dist/esm/types/components/PaginationBar/SelectedPage.d.ts +7 -0
  28. package/dist/esm/types/components/Popover/PropInterface.d.ts +21 -0
  29. package/dist/esm/types/components/Popover/index.d.ts +2 -10
  30. package/dist/esm/types/components/Tooltip/PropsInterface.d.ts +6 -2
  31. package/dist/esm/types/components/index.d.ts +3 -0
  32. package/dist/esm/types/stories/Card/Card.stories.d.ts +17 -0
  33. package/dist/esm/types/stories/FileTree/FileTreeSimulation.stories.d.ts +12 -0
  34. package/dist/esm/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +2 -2
  35. package/dist/esm/types/stories/Form/SelectInput/SelectInputCustom.stories.d.ts +1 -1
  36. package/dist/esm/types/utility/public/words.d.ts +13 -0
  37. package/dist/index.d.ts +40 -6
  38. package/package.json +8 -2
package/dist/esm/index.js CHANGED
@@ -101,6 +101,10 @@ function TbCircleCheckFilled (props) {
101
101
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M9 6l6 6l-6 6"},"child":[]}]})(props);
102
102
  }function TbChevronUp (props) {
103
103
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M6 15l6 -6l6 6"},"child":[]}]})(props);
104
+ }function TbChevronsLeft (props) {
105
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M11 7l-5 5l5 5"},"child":[]},{"tag":"path","attr":{"d":"M17 7l-5 5l5 5"},"child":[]}]})(props);
106
+ }function TbChevronsRight (props) {
107
+ return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M7 7l5 5l-5 5"},"child":[]},{"tag":"path","attr":{"d":"M13 7l5 5l-5 5"},"child":[]}]})(props);
104
108
  }function TbCrop11 (props) {
105
109
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z"},"child":[]}]})(props);
106
110
  }function TbDots (props) {
@@ -457,7 +461,7 @@ var minWidthConfig$1 = {
457
461
  var iconOnlySizeConfig$1 = {
458
462
  lg: 'py-[13px] h-[48px] w-[48px] flex items-center justify-center gap-[10px]',
459
463
  md: 'py-[11px] h-[40px] w-[40px] flex items-center justify-center gap-[5px]',
460
- sm: 'py-[8px] h-[30px] w-[30px] flex items-center justify-center gap-[5px] ',
464
+ sm: 'py-[8px] h-[30px] w-[30px] flex items-center justify-center gap-[5px]',
461
465
  tn: 'py-[4px] h-[22px] w-[22px] flex items-center justify-center gap-[3px]',
462
466
  };
463
467
  var doubleIconSizeConfig = {
@@ -475,7 +479,7 @@ var variantConfig$2 = {
475
479
  warning: "text-primary-white bg-bia-orange active:bg-bia-orange-active hover:bg-bia-orange-hover disabled:bg-bia-orange-light-50 disabled:text-bia-orange-light-90 focus-visible:outline focus-visible:outline-offset-0 focus-visible:outline-bia-orange-light-50 focus-visible:outline-[3px] focus-visible:rounded-md shadow-bia-orange-disabled ".concat(shadow),
476
480
  danger: "text-primary-white bg-bia-red active:bg-bia-red-dark-10 hover:bg-bia-red-hover disabled:bg-bia-red-light-50 disabled:text-bia-red-light-90 focus-visible:outline focus-visible:outline-offset-0 focus-visible:outline-bia-red-light-50 focus-visible:outline-[3px] focus-visible:rounded-md shadow-bia-red-disabled ".concat(shadow),
477
481
  link: "text-bia-blue bg-transparent hover:text-bia-blue-hover disabled:text-bia-blue-light-50 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-blue-light-50",
478
- subtle: "text-primary-cool bg-bia-grey-disabled active:bg-bia-grey-dark-10 hover:bg-bia-grey-hover disabled:bg-bia-grey-light-50disabled:text-bia-grey-dark-10 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-blue-light-50 ",
482
+ subtle: "text-primary-cool bg-bia-grey-light-50 active:bg-bia-grey-dark-10 hover:bg-bia-grey-hover disabled:bg-bia-grey-light-50 disabled:text-bia-grey-dark-10 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-blue-light-50 ",
479
483
  'subtle-link': "text-bia-coolgrey bg-transparent active:text-bia-blue-dark-10 hover:text-bia-blue-light-10 disabled:text-bia-coolgrey-light-50 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-blue-light-50 ",
480
484
  'default-outlined': "text-primary-black bg-primary-white border-bia-coolgrey border-solid active:bg-bia-coolgrey-light-90 active:border-bia-coolgrey-active hover:border-bia-coolgrey-hover border disabled:bg-primary-white disabled:border-[1px]disabled:border-bia-coolgrey-disabled disabled:text-bia-coolgrey-disabled focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-coolgrey-light-50 focus-visible:border-none",
481
485
  'primary-outlined': "bg-primary-white border border-bia-blue active:text-bia-blue-active active:bg-bia-blue-pastel active:border-bia-blue-active hover:text-bia-blue-hover hover:border-bia-blue-hover disabled:border-[1px]disabled:border-bia-blue-disabled disabled:text-bia-blue-disabled focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-bia-blue-disabled focus-visible:outline-[3px] focus-visible:rounded-md text-bia-blue focus-visible:border-none",
@@ -1553,6 +1557,27 @@ var ContextualButton = forwardRef(function (_a, ref) {
1553
1557
  actionElement))));
1554
1558
  });
1555
1559
 
1560
+ var config$2 = {
1561
+ 'dark-background': 'bg-white hover:bg-bia-grey-light-90 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-80',
1562
+ 'light-background': 'bg-bia-grey-light-90 hover:bg-bia-grey-light-80 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-70',
1563
+ 'outline-light-background': 'bg-white border border-bia-grey-light-40 hover:bg-bia-grey-light-90 outline-none focus:outline-2 focus:outline-bia-blue-light-50 focus-visible:outline-2 focus-visible:outline-bia-blue-light-50 active:bg-bia-grey-light-80',
1564
+ };
1565
+
1566
+ var Card = function (_a) {
1567
+ var children = _a.children, disabled = _a.disabled, variant = _a.variant;
1568
+ var base = config$2[variant || 'dark-background'];
1569
+ var removeStateClasses = function (cls) {
1570
+ return cls
1571
+ .replace(/\b(?:hover|active|focus-visible|focus):[^\s]+/g, '')
1572
+ .replace(/\s+/g, ' ')
1573
+ .trim();
1574
+ };
1575
+ var cardClassName = disabled
1576
+ ? "".concat(removeStateClasses(base), " cursor-not-allowed")
1577
+ : base;
1578
+ return (React.createElement("button", { disabled: disabled, "aria-disabled": disabled, className: "rounded-radius-md p-5 ".concat(cardClassName), tabIndex: disabled ? -1 : 0 }, children));
1579
+ };
1580
+
1556
1581
  function Color() {
1557
1582
  var colors = [
1558
1583
  {
@@ -1694,7 +1719,7 @@ var FileTree = function (_a) {
1694
1719
  return (React.createElement("div", { className: "file-tree" },
1695
1720
  data.map(function (_a, index) {
1696
1721
  var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
1697
- return (React.createElement(TreeItem, __assign({ label: label, nodes: nodes, key: index, color: color, chevronColor: chevronColor, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDown }, props)));
1722
+ return (React.createElement(TreeItem$1, __assign({ label: label, nodes: nodes, key: index, color: color, chevronColor: chevronColor, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDown }, props)));
1698
1723
  }),
1699
1724
  isOpenContMenu && (React.createElement("div", { style: menuStyle, ref: popupRef, className: "bianic-filetree-contextmenu" }, React.isValidElement(contextMenu)
1700
1725
  ? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
@@ -1704,7 +1729,7 @@ var FileTree = function (_a) {
1704
1729
  })
1705
1730
  : contextMenu))));
1706
1731
  };
1707
- var TreeItem = function (_a) {
1732
+ var TreeItem$1 = function (_a) {
1708
1733
  var label = _a.label, nodes = _a.nodes, color = _a.color, chevronColor = _a.chevronColor, handleRightClick = _a.handleRightClick, onMouseDownTreeItem = _a.onMouseDownTreeItem, props = __rest(_a, ["label", "nodes", "color", "chevronColor", "handleRightClick", "onMouseDownTreeItem"]);
1709
1734
  var treeRef = useRef(null);
1710
1735
  var _b = useState(false), isExpand = _b[0], setIsExpand = _b[1];
@@ -1745,10 +1770,106 @@ var TreeItem = function (_a) {
1745
1770
  React.createElement(Text, { variant: "small-text" }, label))),
1746
1771
  isExpand && nodes && nodes.length > 0 && (React.createElement("div", { className: "ml-4" }, nodes.map(function (_a, index) {
1747
1772
  var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
1748
- return (React.createElement(TreeItem, __assign({ label: label, nodes: nodes, key: index, color: color, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDownTreeItem }, props)));
1773
+ return (React.createElement(TreeItem$1, __assign({ label: label, nodes: nodes, key: index, color: color, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDownTreeItem }, props)));
1749
1774
  })))));
1750
1775
  };
1751
1776
 
1777
+ var TreeItem = function (_a) {
1778
+ var data = _a.data, expandedData = _a.expandedData, setExpandedData = _a.setExpandedData, dataMap = _a.dataMap, activeUnitId = _a.activeUnitId, handleChevronClick = _a.handleChevronClick, handleRightClick = _a.handleRightClick, handleCLick = _a.handleCLick;
1779
+ var isExpanded = !!expandedData.get(data.id);
1780
+ var toogleExpand = function () {
1781
+ var isCurrentlyExpanded = !!expandedData.get(data.id);
1782
+ // create a new Map based on the existing one
1783
+ var newExpandedState = new Map(expandedData);
1784
+ if (isCurrentlyExpanded) {
1785
+ // Logic to collapse this data and all its descendants
1786
+ var collapseDescendants_1 = function (parent) {
1787
+ newExpandedState.set(parent.id, false);
1788
+ if (parent.children && parent.children.length > 0)
1789
+ parent.children.forEach(function (child) { return collapseDescendants_1(child); });
1790
+ };
1791
+ collapseDescendants_1(data);
1792
+ }
1793
+ else {
1794
+ // Logic to expand this data and all its ancestors
1795
+ var current = data;
1796
+ while (current) {
1797
+ newExpandedState.set(current.id, true);
1798
+ current = dataMap[current.parent];
1799
+ }
1800
+ }
1801
+ setExpandedData(newExpandedState);
1802
+ };
1803
+ var clickItemHandler = function () {
1804
+ if (data.children && !isExpanded)
1805
+ toogleExpand();
1806
+ // forward selection event to optional handler; cast is used because this is a click callback without a MouseEvent
1807
+ handleCLick === null || handleCLick === void 0 ? void 0 : handleCLick(data);
1808
+ };
1809
+ var chevronClickHandler = function () {
1810
+ toogleExpand();
1811
+ handleChevronClick === null || handleChevronClick === void 0 ? void 0 : handleChevronClick(data);
1812
+ };
1813
+ return (React.createElement("div", { className: "tree-item" },
1814
+ React.createElement("div", { className: "tree-item-header flex items-center justify-start" },
1815
+ data.children ? (React.createElement("button", { className: "tree-item-chevron", onClick: chevronClickHandler, type: "button" },
1816
+ React.createElement(TbChevronRight, { className: "chevron ".concat(activeUnitId === data.id ? 'text-bia-green hover:text-bia-green-light-10' : 'text-bia-coolgrey-light-50 hover:text-bia-coolgrey-light-20', " ").concat(isExpanded ? 'rotate-90' : ''), size: 18 }))) : (React.createElement("div", { className: "chevron-placeholder aspect-square min-w-[18px]" })),
1817
+ React.createElement("button", { className: "tree-item-label rounded-radius-sm px-0.5 py-[0.5px] text-start font-segoe text-size-sm font-normal text-bia-black ".concat(activeUnitId === data.id ? 'bg-bia-green-light-70' : 'hover:bg-bia-coolgrey-light-90'), onClick: clickItemHandler, type: "button", onContextMenu: function (e) {
1818
+ e.preventDefault();
1819
+ handleRightClick === null || handleRightClick === void 0 ? void 0 : handleRightClick(data);
1820
+ } }, data.label)),
1821
+ isExpanded && data.children && (React.createElement("div", { className: "tree-item-children flex flex-col gap-0.5 rounded-radius-sm pl-[18px]" }, data.children.map(function (childUnit) { return (React.createElement(TreeItem, { key: childUnit.id, data: childUnit, expandedData: expandedData, setExpandedData: setExpandedData, dataMap: dataMap, activeUnitId: activeUnitId, handleRightClick: handleRightClick, handleCLick: handleCLick })); })))));
1822
+ };
1823
+
1824
+ var defaultAlias = {
1825
+ id: null,
1826
+ label: null,
1827
+ parent: null,
1828
+ };
1829
+ var unitTransformator = function (unit, alias) {
1830
+ var _a, _b, _c;
1831
+ if (alias === void 0) { alias = defaultAlias; }
1832
+ var newUnit = {
1833
+ id: unit[(_a = alias.id) !== null && _a !== void 0 ? _a : 'id'],
1834
+ label: unit[(_b = alias.label) !== null && _b !== void 0 ? _b : 'label'],
1835
+ parent: unit[(_c = alias.parent) !== null && _c !== void 0 ? _c : 'parent'],
1836
+ children: [],
1837
+ data: __assign({}, unit),
1838
+ }; // new unit object that will used in TreeItem Component
1839
+ return newUnit;
1840
+ };
1841
+ var useFileTree = function (data, alias) {
1842
+ if (alias === void 0) { alias = defaultAlias; }
1843
+ var _a = useState(function () { return new Map(); }), expandedData = _a[0], setExpandedData = _a[1];
1844
+ var usedAlias = __assign(__assign({}, defaultAlias), alias);
1845
+ // A map to store all items by their ID for quick lookup
1846
+ var map = new Map();
1847
+ // An array to hold the root-level objects
1848
+ var tree = [];
1849
+ // First, create a map of all items
1850
+ data.forEach(function (unit) {
1851
+ map.set(unit['id'], unitTransformator(unit, usedAlias));
1852
+ });
1853
+ // build tree structure by linkiing children to parents
1854
+ map.forEach(function (unit) {
1855
+ var parent = map.get(unit.parent);
1856
+ if (parent) {
1857
+ // Find the correct insertion point for the new child
1858
+ var insertionIndex = parent.children.findIndex(function (child) {
1859
+ return unit.label.toLowerCase().localeCompare(child.label.toLowerCase()) < 0;
1860
+ });
1861
+ // Insert the new child at the correct position
1862
+ if (insertionIndex === -1)
1863
+ parent.children.push(unit);
1864
+ else
1865
+ parent.children.splice(insertionIndex, 0, unit);
1866
+ }
1867
+ else
1868
+ tree.push(unit);
1869
+ });
1870
+ return { tree: tree, map: map, expandedData: expandedData, setExpandedData: setExpandedData };
1871
+ };
1872
+
1752
1873
  var getContextualPopupStyle = function (anchorRef, popupRef, position) {
1753
1874
  if (!anchorRef.current || !popupRef.current) {
1754
1875
  return {};
@@ -1987,15 +2108,15 @@ MenuItem.defaultProps = {
1987
2108
  };
1988
2109
 
1989
2110
  function Tooltip(props) {
1990
- 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;
2111
+ 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, _c = props.zIndex, zIndex = _c === void 0 ? 150 : _c, className = props.className, style = props.style;
1991
2112
  var timeout;
1992
- var _c = useState(false), active = _c[0], setActive = _c[1];
2113
+ var _d = useState(false), active = _d[0], setActive = _d[1];
1993
2114
  var anchorRef = useRef(null);
1994
2115
  var tooltipContainerRef = useRef(null);
1995
- var _d = useState({
2116
+ var _e = useState({
1996
2117
  maxWidth: maxWidth + 'px',
1997
2118
  whiteSpace: 'nowrap',
1998
- }), tooltipContainerStyle = _d[0], setTooltipContainerStyle = _d[1];
2119
+ }), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
1999
2120
  var showTip = function () {
2000
2121
  timeout = setTimeout(function () {
2001
2122
  setActive(true);
@@ -2039,12 +2160,12 @@ function Tooltip(props) {
2039
2160
  }, [content, maxWidth, scrollWidth, offsetHeight]);
2040
2161
  return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
2041
2162
  children,
2042
- active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle }))));
2163
+ active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle, zIndex: zIndex, className: className, style: style }))));
2043
2164
  }
2044
2165
  var TooltipItem = function (_a) {
2045
- var anchorRef = _a.anchorRef, direction = _a.direction, content = _a.content, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle;
2166
+ var anchorRef = _a.anchorRef, className = _a.className, content = _a.content, direction = _a.direction, style = _a.style, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle, zIndex = _a.zIndex;
2046
2167
  var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
2047
- return createPortal(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", style: __assign(__assign({}, positionStyle), tooltipContainerStyle), ref: tooltipContainerRef }, content), document.body);
2168
+ return createPortal(React.createElement("div", { className: "tooltip-container break-word absolute inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(className), style: __assign(__assign(__assign({ zIndex: zIndex }, positionStyle), tooltipContainerStyle), style), ref: tooltipContainerRef }, content), document.body);
2048
2169
  };
2049
2170
  Tooltip.defaultProps = {
2050
2171
  delay: 400,
@@ -2170,12 +2291,13 @@ var TextInput = forwardRef(function (_a, ref) {
2170
2291
  if (variant === 'date')
2171
2292
  iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
2172
2293
  var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
2294
+ var disabledClass = disabled ? 'cursor-not-allowed' : '';
2173
2295
  return (React.createElement("div", { className: "bianic-text-input-container bianic-fgc-container group/form flex w-full flex-col gap-y-2 text-bia-black" },
2174
2296
  label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
2175
- React.createElement("div", { className: "relative w-full" },
2176
- React.createElement("input", __assign({ className: "bianic-text-input bianic-fgc-target 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, autoComplete: autoComplete, ref: ref }, props)),
2297
+ React.createElement("div", { className: "relative w-full ".concat(disabledClass) },
2298
+ React.createElement("input", __assign({ className: "bianic-text-input bianic-fgc-target 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:cursor-not-allowed 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, autoComplete: autoComplete, ref: ref }, props)),
2177
2299
  React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(actionElement ? '' : iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
2178
- (descText || maxLength) && (React.createElement("div", { className: "bianic-text-input-desc flex justify-between gap-1 text-xs whitespace-nowrap ".concat(descColor) },
2300
+ (descText || maxLength) && (React.createElement("div", { className: "bianic-text-input-desc flex justify-between gap-1 whitespace-nowrap text-xs ".concat(descColor) },
2179
2301
  React.createElement("span", null, descText),
2180
2302
  maxLength && (React.createElement("span", null,
2181
2303
  remainWords,
@@ -2217,10 +2339,10 @@ function Radio(_a) {
2217
2339
  var validatedSize = validUnion(size, sizeUnion$4);
2218
2340
  var _f = sizeConfig$b[validatedSize], checkSize = _f.checkSize, labelSize = _f.labelSize;
2219
2341
  return (React.createElement("div", { className: "flex items-center" },
2220
- React.createElement("div", { className: "bg-white rounded-full flex flex-shrink-0 justify-center items-center relative ".concat(checkSize) },
2221
- React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "peer checkbox box-content appearance-none focus:opacity-100 focus:ring-1 focus:ring-offset-2 checked:disabled:border-bia-blue-disabled focus:ring-bia-blue focus:outline-none rounded-full border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover disabled:border-bia-grey-dark-10 border-2 absolute cursor-pointer w-full h-full", onClick: function (e) { return onClick(e); }, checked: checked, disabled: disabled }),
2222
- React.createElement("div", { className: "check-icon flex text-bia-grey group justify-center border-2 border-primary-white peer-disabled:bg-bia-grey-light-80 peer-disabled:border-transparent peer-disabled:peer-checked:border-primary-white peer-checked:peer-disabled:bg-bia-blue-disabled peer-checked:hover:border-bia-blue-hover peer-checked:bg-bia-blue peer-checked:peer-hover:bg-bia-blue-hover outline-2 peer-checked:hover:outline-bia-blue-hover outline-bia-blue rounded-full w-full h-full z-1" })),
2223
- React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 font-[350] ".concat(labelSize), style: { color: disabled ? '#8C8CA6' : '#2f2f2f' } }, childrenElement(label))));
2342
+ React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkSize) },
2343
+ React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "checkbox peer absolute box-content h-full w-full cursor-pointer appearance-none rounded-full border-2 border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover focus:opacity-100 focus:outline-none focus:ring-1 focus:ring-bia-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:border-bia-grey-dark-10 checked:disabled:border-bia-blue-disabled", onClick: function (e) { return onClick(e); }, checked: checked, disabled: disabled }),
2344
+ React.createElement("div", { className: "check-icon z-1 group flex h-full w-full justify-center rounded-full border-2 border-primary-white text-bia-grey outline-2 outline-bia-blue peer-checked:bg-bia-blue peer-checked:hover:border-bia-blue-hover peer-checked:hover:outline-bia-blue-hover peer-checked:peer-hover:bg-bia-blue-hover peer-disabled:border-transparent peer-disabled:bg-bia-grey-light-80 peer-disabled:peer-checked:border-primary-white peer-checked:peer-disabled:bg-bia-blue-disabled" })),
2345
+ React.createElement("label", { htmlFor: id, className: "ml-2 font-[350] leading-4 ".concat(labelSize), style: { color: disabled ? '#8C8CA6' : '#2f2f2f' } }, childrenElement(label))));
2224
2346
  }
2225
2347
  Radio.defaultProps = {
2226
2348
  label: '',
@@ -2256,11 +2378,12 @@ function TextArea(_a) {
2256
2378
  var inputRow = rows !== null && rows !== void 0 ? rows : 4;
2257
2379
  var inputClass = sizeConfig$a[size].inputClass;
2258
2380
  var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
2381
+ var disabledClass = disabled ? 'cursor-not-allowed' : '';
2259
2382
  return (React.createElement("div", { className: "field-group group/form flex w-full flex-col gap-y-2" },
2260
2383
  label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
2261
- React.createElement("div", { className: "relative h-fit w-full min-w-[250px]" },
2384
+ React.createElement("div", { className: "relative h-fit w-full min-w-[250px] ".concat(disabledClass) },
2262
2385
  React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
2263
- React.createElement("textarea", __assign({ className: "field bianic-text-area w-full rounded border border-bia-grey-dark-10 bg-primary-white p-2.5 read-only:pointer-events-none 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-grey-active ".concat(inputClass), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value, autoComplete: autoComplete, readOnly: readOnly }, props))),
2386
+ React.createElement("textarea", __assign({ className: "field bianic-text-area w-full rounded border border-bia-grey-dark-10 bg-primary-white p-2.5 read-only:pointer-events-none 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:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(inputClass), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value, autoComplete: autoComplete, readOnly: readOnly }, props))),
2264
2387
  React.createElement("div", { className: "desc flex justify-between gap-1 text-xs text-primary-cool" },
2265
2388
  descText && React.createElement("span", null, descText),
2266
2389
  maxLength && (React.createElement("span", null,
@@ -2299,7 +2422,7 @@ function Checkbox(_a) {
2299
2422
  var _e = sizeConfig$9[validUnion(size, sizeUnion$3)], checkClass = _e.checkClass, labelClass = _e.labelClass;
2300
2423
  return (React.createElement("div", { className: "flex items-center" },
2301
2424
  React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkClass) },
2302
- React.createElement("input", __assign({ id: id, type: "checkbox", className: "checkbox peer absolute box-content h-full w-full cursor-pointer appearance-none rounded-full border-2 border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-bia-blue focus-visible:ring-offset-2 disabled:border-bia-coolgrey-light-50 disabled:checked:border-bia-blue-light-50", onChange: function (e) { return onChange(e); }, disabled: disabled }, props)),
2425
+ React.createElement("input", __assign({ id: id, type: "checkbox", className: "checkbox peer absolute box-content h-full w-full cursor-pointer appearance-none rounded-full border-2 border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-bia-blue focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-bia-coolgrey-light-50 disabled:checked:border-bia-blue-light-50", onChange: function (e) { return onChange(e); }, disabled: disabled }, props)),
2303
2426
  React.createElement("div", { className: "check-icon z-1 group flex h-full w-full justify-center rounded-full text-bia-grey outline-2 outline-bia-blue peer-checked:border-2 peer-checked:border-primary-white peer-checked:bg-bia-blue peer-checked:hover:border-bia-blue-hover peer-checked:hover:outline-bia-blue-hover peer-checked:peer-hover:bg-bia-blue-hover peer-disabled:bg-bia-grey-light-80 peer-disabled:peer-checked:bg-bia-blue-light-50 peer-disabled:peer-checked:outline-bia-blue-light-50" },
2304
2427
  React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: " fill-bia-grey-dark-10 peer-checked:group-[]:fill-primary-white peer-hover:group-[]:fill-bia-blue-hover peer-checked:peer-hover:group-[]:fill-primary-white peer-disabled:group-[]:fill-bia-grey-dark-10 peer-disabled:peer-checked:group-[]:fill-primary-white", viewBox: "-5 -7 24 24", width: "24" },
2305
2428
  React.createElement("path", { d: "M5.486 9.73a.997.997 0 0 1-.707-.292L.537 5.195A1 1 0 1 1 1.95 3.78l3.535 3.535L11.85.952a1 1 0 0 1 1.415 1.414L6.193 9.438a.997.997 0 0 1-.707.292z" })))),
@@ -2412,12 +2535,13 @@ function SelectInput(_a) {
2412
2535
  descColor = 'text-bia-green';
2413
2536
  if (!disabled && isExistValidation && !isValid)
2414
2537
  descColor = 'text-bia-red';
2538
+ var disabledClass = disabled ? 'cursor-not-allowed' : '';
2415
2539
  return (React.createElement("div", { className: "bianic-fgc-container bianic-text-input-container field-group flex w-full flex-col" },
2416
2540
  React.createElement("label", { htmlFor: id, className: "label pb-2 text-xs font-semibold" },
2417
2541
  childrenElement(label),
2418
2542
  required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
2419
- React.createElement("div", { className: "group relative w-full" },
2420
- React.createElement("input", __assign({ className: "bianic-fgc-target 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, ref: inputRef }, props)),
2543
+ React.createElement("div", { className: "group relative w-full ".concat(disabledClass) },
2544
+ React.createElement("input", __assign({ className: "bianic-fgc-target 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:cursor-not-allowed 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, ref: inputRef }, props)),
2421
2545
  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)),
2422
2546
  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", ref: optionsRef, onClick: onClickDropdown }, options.map(function (option) {
2423
2547
  var isSelected = JSON.stringify(option) === JSON.stringify(selected);
@@ -2733,7 +2857,7 @@ var useLiveSearch = function (_a) {
2733
2857
  };
2734
2858
 
2735
2859
  function LiveSearch(_a) {
2736
- var _b = _a.autoComplete, autoComplete = _b === void 0 ? 'off' : _b, _c = _a.children, children = _c === void 0 ? undefined : _c, descText = _a.descText, _d = _a.disabled, disabled = _d === void 0 ? false : _d, dropContProps = _a.dropContProps, id = _a.id; _a.label; var _e = _a.onChangeText, onChangeText = _e === void 0 ? function () { } : _e, _f = _a.onClickDropdown, onClickDropdown = _f === void 0 ? function () { } : _f, options = _a.options, placeholder = _a.placeholder, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.searchVariant, searchVariant = _j === void 0 ? 'include' : _j, setValue = _a.setValue, _k = _a.size, size = _k === void 0 ? 'md' : _k, _l = _a.isValid, isValid = _l === void 0 ? null : _l, value = _a.value;
2860
+ var _b = _a.autoComplete, autoComplete = _b === void 0 ? 'off' : _b, _c = _a.children, children = _c === void 0 ? undefined : _c, descText = _a.descText, _d = _a.disabled, disabled = _d === void 0 ? false : _d, dropContProps = _a.dropContProps, id = _a.id, label = _a.label, _e = _a.onChangeText, onChangeText = _e === void 0 ? function () { } : _e, _f = _a.onClickDropdown, onClickDropdown = _f === void 0 ? function () { } : _f, options = _a.options, placeholder = _a.placeholder, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.searchVariant, searchVariant = _j === void 0 ? 'include' : _j, setValue = _a.setValue, _k = _a.size, size = _k === void 0 ? 'md' : _k, _l = _a.isValid, isValid = _l === void 0 ? null : _l, value = _a.value;
2737
2861
  var inputRef = useRef(null);
2738
2862
  var _m = useLiveSearch({
2739
2863
  value: value,
@@ -2752,8 +2876,10 @@ function LiveSearch(_a) {
2752
2876
  descColor = 'text-bia-red';
2753
2877
  var filteredOptions = filterOptions(options || [], value.label);
2754
2878
  var _q = processRenderedChildren(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
2755
- return (React.createElement("div", { className: "bianic-livesearch bianic-fgc-container bianic-text-input-container field-group group/form flex w-full flex-col gap-y-2 " },
2756
- React.createElement("div", { className: "group relative w-full" },
2879
+ var disabledClass = disabled ? 'cursor-not-allowed' : '';
2880
+ return (React.createElement("div", { className: "bianic-livesearch bianic-fgc-container bianic-text-input-container field-group group/form flex w-full flex-col gap-y-2" },
2881
+ label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
2882
+ React.createElement("div", { className: "group relative w-full ".concat(disabledClass) },
2757
2883
  React.createElement("input", { className: "bianic-livesearch-input bianic-fgc-target field peer w-full rounded border border-bia-grey-dark-10 bg-primary-white text-bia-black read-only:pointer-events-none read-only:border-bia-grey-light-50 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:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-coolgrey ".concat(inputClass), onClick: function () { return setIsOpen(!isOpen); }, value: searchTerm, required: required, disabled: disabled, id: id, placeholder: placeholder, ref: inputRef, onChange: function (e) {
2758
2884
  onChangeText(e);
2759
2885
  handleInputChange(e);
@@ -2808,11 +2934,13 @@ var sizeConfig$5 = {
2808
2934
  function Toggle(_a) {
2809
2935
  var _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.onClick, onClick = _d === void 0 ? function () { } : _d, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.id, id = _f === void 0 ? '' : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g;
2810
2936
  var _h = sizeConfig$5[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
2937
+ var checkedClass = checked ? 'justify-end' : 'justify-start';
2938
+ var containerClass = "".concat(checkedClass, " ").concat(containerSize);
2811
2939
  return (React.createElement("div", { className: "flex items-center" },
2812
- React.createElement("div", { className: "".concat(containerSize, " rounded-full py-[2px] flex flex-shrink-0 ").concat(checked ? 'justify-end' : 'justify-start', " items-center relative cursor-pointer"), onClick: onClick, onKeyDown: function () { }, role: "checkbox", tabIndex: 0, "aria-checked": checked },
2813
- React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "".concat(checkSize, " peer checkbox appearance-none opacity-100 focus:ring-1 focus:ring-offset-2 focus:ring-bia-blue focus:outline-none rounded-full border-bia-grey checked:border-bia-blue bg-primary-white checked:bg-bia-blue checked:hover:bg-bia-blue-hover cursor-pointer hover:border-bia-blue-hover peer-hover:border-bia-blue-hover disabled:bg-bia-grey-light-80 disabled:checked:bg-bia-blue-light-50 disabled:border-none border-2 absolute w-full h-full"), type: "checkbox" }),
2814
- React.createElement("div", { className: "peer check-icon flex m-[2px] text-bia-grey group justify-center border-2 peer-checked:border-bia-blue border-primary-white peer-checked:hover:bg-primary-white peer-checked:bg-primary-white bg-bia-grey peer-checked:peer-hover:bg-primary-white peer-hover:bg-bia-blue-hover peer-disabled:bg-bia-grey-dark-10 peer-disabled:border-none peer-disabled:outline-none peer-disabled:peer-checked:bg-bia-blue-light-90 outline-2 rounded-full w-5/12 h-full z-10" })),
2815
- React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 font-normal text-grey-800 ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
2940
+ React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full py-[2px] ".concat(containerClass), onClick: onClick, onKeyDown: function () { }, role: "checkbox", tabIndex: 0, "aria-checked": checked },
2941
+ React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "".concat(checkSize, " checkbox peer absolute h-full w-full cursor-pointer appearance-none rounded-full border-2 border-bia-grey bg-primary-white opacity-100 checked:border-bia-blue checked:bg-bia-blue hover:border-bia-blue-hover checked:hover:bg-bia-blue-hover focus:outline-none focus:ring-1 focus:ring-bia-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:border-none disabled:bg-bia-grey-light-80 disabled:checked:bg-bia-blue-light-50 peer-hover:border-bia-blue-hover"), type: "checkbox" }),
2942
+ React.createElement("div", { className: "check-icon group peer z-10 m-[2px] flex h-full w-5/12 justify-center rounded-full border-2 border-primary-white bg-bia-grey text-bia-grey outline-2 peer-checked:border-bia-blue peer-checked:bg-primary-white peer-checked:hover:bg-primary-white peer-hover:bg-bia-blue-hover peer-checked:peer-hover:bg-primary-white peer-disabled:cursor-not-allowed peer-disabled:border-none peer-disabled:bg-bia-grey-dark-10 peer-disabled:outline-none peer-disabled:peer-checked:bg-bia-blue-light-90" })),
2943
+ React.createElement("label", { htmlFor: id, className: "text-grey-800 ml-2 font-normal leading-4 ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
2816
2944
  }
2817
2945
  Toggle.defaultProps = {
2818
2946
  label: '',
@@ -3287,7 +3415,7 @@ var DateInputDisplay = forwardRef(function (_a, ref) {
3287
3415
  setIsEditing(false);
3288
3416
  setDateString(value);
3289
3417
  };
3290
- var input = isEditing ? (React.createElement(TextInput, { type: "text", value: dateString !== null && dateString !== void 0 ? dateString : '', onChange: handleTextChange, onBlur: handleBlur, placeholder: placeholder, size: size, inputClassName: className, autoFocus: true, actionElement: React.createElement("button", { className: "bianic-datepicker-toggle-button text-bia-coolgrey", disabled: disabled, onClick: function () {
3418
+ var input = isEditing || disabled ? (React.createElement(TextInput, { type: "text", value: dateString !== null && dateString !== void 0 ? dateString : '', onChange: handleTextChange, onBlur: handleBlur, placeholder: placeholder, size: size, inputClassName: className, autoFocus: true, disabled: disabled, actionElement: React.createElement("button", { className: "bianic-datepicker-toggle-button text-bia-coolgrey disabled:cursor-not-allowed", disabled: disabled, onClick: function () {
3291
3419
  buttonAction && buttonAction();
3292
3420
  } },
3293
3421
  React.createElement(TbCalendar, { size: iconSize })) })) : (React.createElement(React.Fragment, null,
@@ -3581,48 +3709,78 @@ var positionConfig = {
3581
3709
  end: 'justify-end',
3582
3710
  };
3583
3711
 
3712
+ var SelectedPage = function (_a) {
3713
+ var label = _a.label, _b = _a.size, size = _b === void 0 ? 'sm' : _b;
3714
+ var basicButtonStyle = 'bianic-custom-button bianic-fgc-target flex items-center justify-center font-semibold cursor-default';
3715
+ var basicColorStyle = 'text-primary-cool bg-bia-grey-dark-10 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-blue-light-50';
3716
+ var textStyleOptions = {
3717
+ sm: 'text-size-sm',
3718
+ md: 'text-size-base',
3719
+ };
3720
+ var sizeStyleOptions = "".concat(iconOnlySizeConfig$1[size], " ").concat(radiusConfig$1['default'][size]);
3721
+ var style = "".concat(basicButtonStyle, " ").concat(basicColorStyle, " ").concat(sizeStyleOptions, " ").concat(textStyleOptions[size]);
3722
+ return React.createElement("div", { className: style }, label);
3723
+ };
3724
+
3584
3725
  function PaginationBar(_a) {
3585
3726
  var size = _a.size, position = _a.position, currentPage = _a.currentPage, totalPages = _a.totalPages, onPageChange = _a.onPageChange;
3586
- var _b = useState([]), range = _b[0], setRange = _b[1];
3587
- var _c = useState([]), showedPages = _c[0], setShowedPages = _c[1];
3727
+ var totalRange = Array.from({ length: totalPages }, function (_, i) { return i + 1; });
3728
+ var PAGE_SIZE = 5;
3729
+ var _b = useState(0), startIndex = _b[0], setStartIndex = _b[1];
3730
+ var _c = useState(totalRange.slice(startIndex, PAGE_SIZE)), showedPages = _c[0], setShowedPages = _c[1];
3588
3731
  var buttonSizingStyle = size === 'sm' ? 31 : 38;
3589
3732
  var iconSize = size === 'sm' ? 14 : 18;
3590
- useEffect(function () {
3591
- var tempRange = [];
3592
- for (var i = 1; i <= totalPages; i += 1) {
3593
- tempRange.push(i);
3594
- }
3595
- setRange(tempRange);
3596
- }, [totalPages]);
3597
- useEffect(function () {
3598
- var usedRange = [];
3599
- var startRange = 0;
3600
- var endRange = totalPages > 5 ? 5 : totalPages;
3601
- if (totalPages > 5) {
3602
- if (currentPage < 3) {
3603
- endRange = 5;
3604
- }
3605
- else if (currentPage >= totalPages - 1) {
3606
- startRange = totalPages - 5;
3607
- endRange = totalPages;
3608
- }
3609
- else {
3610
- startRange = currentPage - 3;
3611
- endRange = currentPage + 2;
3612
- }
3613
- }
3614
- usedRange = range.slice(startRange, endRange);
3615
- setShowedPages(usedRange);
3616
- }, [currentPage, totalPages, range]);
3617
3733
  var handlePageChange = function (page) {
3618
- if (page >= 1 && page <= totalPages) {
3734
+ if (page >= 1 && page <= totalPages)
3619
3735
  onPageChange(page);
3620
- }
3621
3736
  };
3737
+ var handleNextRange = function () {
3738
+ var newStartIndex = startIndex + PAGE_SIZE;
3739
+ if (newStartIndex < totalPages)
3740
+ setStartIndex(newStartIndex);
3741
+ else
3742
+ setStartIndex(totalPages - PAGE_SIZE);
3743
+ };
3744
+ var handlePrevRange = function () {
3745
+ var newStartIndex = startIndex - PAGE_SIZE;
3746
+ if (newStartIndex >= 0)
3747
+ setStartIndex(newStartIndex);
3748
+ else
3749
+ setStartIndex(0);
3750
+ };
3751
+ var getStartIndex = function (index) {
3752
+ if (index + PAGE_SIZE > totalPages)
3753
+ return Math.max(0, totalPages - PAGE_SIZE);
3754
+ return index;
3755
+ };
3756
+ useEffect(function () {
3757
+ var correctedIndex = getStartIndex(startIndex);
3758
+ setShowedPages(totalRange.slice(correctedIndex, correctedIndex + PAGE_SIZE));
3759
+ }, [startIndex, totalRange, totalPages]);
3622
3760
  return (React.createElement("div", { className: "flex ".concat(positionConfig[position], " gap-[5px]") },
3623
- React.createElement(Button, { variant: "subtle-link", size: size, type: "button", onClick: function () { return handlePageChange(currentPage - 1); }, className: "cursor-pointer", iconLeft: React.createElement(TbChevronLeft, { size: iconSize }), disabled: currentPage === 1 }),
3624
- showedPages.map(function (page) { return (React.createElement(Button, { key: page, variant: currentPage === page ? 'default' : 'subtle-link', size: size, type: "button", onClick: function () { return handlePageChange(page); }, className: "cursor-pointer ".concat(sizeConfig$2[size]), label: page.toString(), minWidth: buttonSizingStyle })); }),
3625
- React.createElement(Button, { variant: "subtle-link", size: size, type: "button", onClick: function () { return handlePageChange(currentPage + 1); }, className: "cursor-pointer", iconLeft: React.createElement(TbChevronRight, { size: iconSize }), disabled: currentPage === totalPages })));
3761
+ totalPages > 5 && (React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: handlePrevRange, className: showedPages[0] === 1 ? '' : 'cursor-pointer', iconLeft: React.createElement(TbChevronsLeft, { size: iconSize }), disabled: showedPages[0] === 1 })),
3762
+ React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
3763
+ handlePageChange(currentPage - 1);
3764
+ if (showedPages[0] === currentPage)
3765
+ setStartIndex(function (old) { return old - 1; });
3766
+ }, className: currentPage === 1 ? '' : 'cursor-pointer', iconLeft: React.createElement(TbChevronLeft, { size: iconSize }), disabled: currentPage === 1 }),
3767
+ showedPages.map(function (page) {
3768
+ if (page === currentPage) {
3769
+ return React.createElement(SelectedPage, { key: page, label: page.toString(), size: size });
3770
+ }
3771
+ return (React.createElement(Button, { key: page, variant: "subtle", size: size, type: "button", onClick: function () {
3772
+ handlePageChange(page);
3773
+ }, className: "cursor-pointer ".concat(sizeConfig$2[size]), label: page.toString(), minWidth: buttonSizingStyle }));
3774
+ }),
3775
+ React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
3776
+ handlePageChange(currentPage + 1);
3777
+ if (showedPages[4] === currentPage) {
3778
+ setStartIndex(function (old) { return old + 1; });
3779
+ }
3780
+ }, className: currentPage === totalPages ? '' : 'cursor-pointer', iconLeft: React.createElement(TbChevronRight, { size: iconSize }), disabled: currentPage === totalPages }),
3781
+ totalPages > 5 && (React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: handleNextRange, className: showedPages[showedPages.length - 1] === totalPages
3782
+ ? ''
3783
+ : 'cursor-pointer', iconLeft: React.createElement(TbChevronsRight, { size: iconSize }), disabled: showedPages[showedPages.length - 1] === totalPages }))));
3626
3784
  }
3627
3785
 
3628
3786
  var activeConfig = {
@@ -3707,20 +3865,19 @@ var classConfig = {
3707
3865
  };
3708
3866
 
3709
3867
  function Popover(_a) {
3710
- var children = _a.children, content = _a.content; _a.delay; var _c = _a.direction, direction = _c === void 0 ? 'bottom' : _c, _d = _a.title, title = _d === void 0 ? '' : _d; _a.maxWidth;
3868
+ var className = _a.className, children = _a.children, content = _a.content, _b = _a.direction, direction = _b === void 0 ? 'bottom' : _b; _a.maxWidth; var _c = _a.title, title = _c === void 0 ? '' : _c, style = _a.style, zIndex = _a.zIndex;
3711
3869
  var wrapperRef = useRef(null);
3712
- useRef(null);
3713
- var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
3870
+ var _d = useDetectOutsideClick(wrapperRef, false), isOpen = _d[0], setIsOpen = _d[1];
3714
3871
  return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
3715
3872
  children,
3716
- isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction }))));
3873
+ isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction, className: className, style: style, zIndex: zIndex }))));
3717
3874
  }
3718
3875
  var PopoverItem = function (_a) {
3719
- var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction;
3876
+ var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction, className = _a.className, style = _a.style, zIndex = _a.zIndex;
3720
3877
  var popoverRef = useRef(null);
3721
3878
  var positionStyle = usePopupPosition(anchorRef, popoverRef, direction)[0];
3722
3879
  var _b = classConfig[direction], triangleContainer = _b.triangleContainer, triangleShape = _b.triangleShape;
3723
- return createPortal(React.createElement("div", { ref: popoverRef, style: positionStyle, className: "Bianic-popover-Tip text-bia-sm absolute z-50 w-[245px] space-y-[5px] rounded-[4px] bg-primary-black px-[20px] py-[17.5px] text-primary-white" },
3880
+ return createPortal(React.createElement("div", { ref: popoverRef, style: __assign(__assign(__assign({}, positionStyle), style), { zIndex: zIndex }), className: "Bianic-popover-Tip text-bia-sm absolute z-50 w-[245px] space-y-[5px] rounded-[4px] bg-primary-black px-[20px] py-[17.5px] text-primary-white ".concat(className) },
3724
3881
  React.createElement("div", { className: "flex flex-col" },
3725
3882
  React.createElement("div", { className: "mb-[5px] font-humnst777 text-[16px] font-bold leading-[19.42px]" }, title),
3726
3883
  React.createElement("div", { className: "break-words font-segoe text-[12px] font-normal" }, content)),
@@ -3728,7 +3885,6 @@ var PopoverItem = function (_a) {
3728
3885
  React.createElement("div", { className: "h-0 w-0 ".concat(triangleShape) }))), document.body);
3729
3886
  };
3730
3887
  Popover.defaultProps = {
3731
- delay: 400,
3732
3888
  direction: 'top',
3733
3889
  title: '',
3734
3890
  };
@@ -4262,4 +4418,4 @@ function Window(_a) {
4262
4418
  React.createElement("div", { className: "bianic-window-content flex w-full flex-col items-start gap-[20px] px-[20px] pb-[20px] text-primary-black" }, rest.children)));
4263
4419
  }
4264
4420
 
4265
- export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, ContextualButton, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };
4421
+ export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Card, Checkbox, Color, ContextualButton, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, TreeItem, Window, useFileTree };