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.
- package/dist/cjs/index.js +232 -73
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Card/config.d.ts +6 -0
- package/dist/cjs/types/components/Card/index.d.ts +8 -0
- package/dist/cjs/types/components/FileTree/FileTreeSimulation.d.ts +3 -0
- package/dist/cjs/types/components/FileTree/TreeItem.d.ts +13 -0
- package/dist/cjs/types/components/FileTree/useFileTree.d.ts +12 -0
- package/dist/cjs/types/components/Forms/SelectInput/Example/CustomDropdown.d.ts +2 -1
- package/dist/cjs/types/components/PaginationBar/SelectedPage.d.ts +7 -0
- package/dist/cjs/types/components/Popover/PropInterface.d.ts +21 -0
- package/dist/cjs/types/components/Popover/index.d.ts +2 -10
- package/dist/cjs/types/components/Tooltip/PropsInterface.d.ts +6 -2
- package/dist/cjs/types/components/index.d.ts +3 -0
- package/dist/cjs/types/stories/Card/Card.stories.d.ts +17 -0
- package/dist/cjs/types/stories/FileTree/FileTreeSimulation.stories.d.ts +12 -0
- package/dist/cjs/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +2 -2
- package/dist/cjs/types/stories/Form/SelectInput/SelectInputCustom.stories.d.ts +1 -1
- package/dist/cjs/types/utility/public/words.d.ts +13 -0
- package/dist/esm/index.js +230 -74
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Card/config.d.ts +6 -0
- package/dist/esm/types/components/Card/index.d.ts +8 -0
- package/dist/esm/types/components/FileTree/FileTreeSimulation.d.ts +3 -0
- package/dist/esm/types/components/FileTree/TreeItem.d.ts +13 -0
- package/dist/esm/types/components/FileTree/useFileTree.d.ts +12 -0
- package/dist/esm/types/components/Forms/SelectInput/Example/CustomDropdown.d.ts +2 -1
- package/dist/esm/types/components/PaginationBar/SelectedPage.d.ts +7 -0
- package/dist/esm/types/components/Popover/PropInterface.d.ts +21 -0
- package/dist/esm/types/components/Popover/index.d.ts +2 -10
- package/dist/esm/types/components/Tooltip/PropsInterface.d.ts +6 -2
- package/dist/esm/types/components/index.d.ts +3 -0
- package/dist/esm/types/stories/Card/Card.stories.d.ts +17 -0
- package/dist/esm/types/stories/FileTree/FileTreeSimulation.stories.d.ts +12 -0
- package/dist/esm/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +2 -2
- package/dist/esm/types/stories/Form/SelectInput/SelectInputCustom.stories.d.ts +1 -1
- package/dist/esm/types/utility/public/words.d.ts +13 -0
- package/dist/index.d.ts +40 -6
- package/package.json +8 -2
package/dist/cjs/index.js
CHANGED
|
@@ -103,6 +103,10 @@ function TbCircleCheckFilled (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":"M9 6l6 6l-6 6"},"child":[]}]})(props);
|
|
104
104
|
}function TbChevronUp (props) {
|
|
105
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":"M6 15l6 -6l6 6"},"child":[]}]})(props);
|
|
106
|
+
}function TbChevronsLeft (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":"M11 7l-5 5l5 5"},"child":[]},{"tag":"path","attr":{"d":"M17 7l-5 5l5 5"},"child":[]}]})(props);
|
|
108
|
+
}function TbChevronsRight (props) {
|
|
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":"M7 7l5 5l-5 5"},"child":[]},{"tag":"path","attr":{"d":"M13 7l5 5l-5 5"},"child":[]}]})(props);
|
|
106
110
|
}function TbCrop11 (props) {
|
|
107
111
|
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);
|
|
108
112
|
}function TbDots (props) {
|
|
@@ -459,7 +463,7 @@ var minWidthConfig$1 = {
|
|
|
459
463
|
var iconOnlySizeConfig$1 = {
|
|
460
464
|
lg: 'py-[13px] h-[48px] w-[48px] flex items-center justify-center gap-[10px]',
|
|
461
465
|
md: 'py-[11px] h-[40px] w-[40px] flex items-center justify-center gap-[5px]',
|
|
462
|
-
sm: 'py-[8px] h-[30px] w-[30px] flex items-center justify-center gap-[5px]
|
|
466
|
+
sm: 'py-[8px] h-[30px] w-[30px] flex items-center justify-center gap-[5px]',
|
|
463
467
|
tn: 'py-[4px] h-[22px] w-[22px] flex items-center justify-center gap-[3px]',
|
|
464
468
|
};
|
|
465
469
|
var doubleIconSizeConfig = {
|
|
@@ -477,7 +481,7 @@ var variantConfig$2 = {
|
|
|
477
481
|
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),
|
|
478
482
|
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),
|
|
479
483
|
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",
|
|
480
|
-
subtle: "text-primary-cool bg-bia-grey-
|
|
484
|
+
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 ",
|
|
481
485
|
'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 ",
|
|
482
486
|
'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",
|
|
483
487
|
'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",
|
|
@@ -1555,6 +1559,27 @@ var ContextualButton = React.forwardRef(function (_a, ref) {
|
|
|
1555
1559
|
actionElement))));
|
|
1556
1560
|
});
|
|
1557
1561
|
|
|
1562
|
+
var config$2 = {
|
|
1563
|
+
'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',
|
|
1564
|
+
'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',
|
|
1565
|
+
'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',
|
|
1566
|
+
};
|
|
1567
|
+
|
|
1568
|
+
var Card = function (_a) {
|
|
1569
|
+
var children = _a.children, disabled = _a.disabled, variant = _a.variant;
|
|
1570
|
+
var base = config$2[variant || 'dark-background'];
|
|
1571
|
+
var removeStateClasses = function (cls) {
|
|
1572
|
+
return cls
|
|
1573
|
+
.replace(/\b(?:hover|active|focus-visible|focus):[^\s]+/g, '')
|
|
1574
|
+
.replace(/\s+/g, ' ')
|
|
1575
|
+
.trim();
|
|
1576
|
+
};
|
|
1577
|
+
var cardClassName = disabled
|
|
1578
|
+
? "".concat(removeStateClasses(base), " cursor-not-allowed")
|
|
1579
|
+
: base;
|
|
1580
|
+
return (React.createElement("button", { disabled: disabled, "aria-disabled": disabled, className: "rounded-radius-md p-5 ".concat(cardClassName), tabIndex: disabled ? -1 : 0 }, children));
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1558
1583
|
function Color() {
|
|
1559
1584
|
var colors = [
|
|
1560
1585
|
{
|
|
@@ -1696,7 +1721,7 @@ var FileTree = function (_a) {
|
|
|
1696
1721
|
return (React.createElement("div", { className: "file-tree" },
|
|
1697
1722
|
data.map(function (_a, index) {
|
|
1698
1723
|
var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
|
|
1699
|
-
return (React.createElement(TreeItem, __assign({ label: label, nodes: nodes, key: index, color: color, chevronColor: chevronColor, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDown }, props)));
|
|
1724
|
+
return (React.createElement(TreeItem$1, __assign({ label: label, nodes: nodes, key: index, color: color, chevronColor: chevronColor, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDown }, props)));
|
|
1700
1725
|
}),
|
|
1701
1726
|
isOpenContMenu && (React.createElement("div", { style: menuStyle, ref: popupRef, className: "bianic-filetree-contextmenu" }, React.isValidElement(contextMenu)
|
|
1702
1727
|
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
|
@@ -1706,7 +1731,7 @@ var FileTree = function (_a) {
|
|
|
1706
1731
|
})
|
|
1707
1732
|
: contextMenu))));
|
|
1708
1733
|
};
|
|
1709
|
-
var TreeItem = function (_a) {
|
|
1734
|
+
var TreeItem$1 = function (_a) {
|
|
1710
1735
|
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"]);
|
|
1711
1736
|
var treeRef = React.useRef(null);
|
|
1712
1737
|
var _b = React.useState(false), isExpand = _b[0], setIsExpand = _b[1];
|
|
@@ -1747,10 +1772,106 @@ var TreeItem = function (_a) {
|
|
|
1747
1772
|
React.createElement(Text, { variant: "small-text" }, label))),
|
|
1748
1773
|
isExpand && nodes && nodes.length > 0 && (React.createElement("div", { className: "ml-4" }, nodes.map(function (_a, index) {
|
|
1749
1774
|
var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
|
|
1750
|
-
return (React.createElement(TreeItem, __assign({ label: label, nodes: nodes, key: index, color: color, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDownTreeItem }, props)));
|
|
1775
|
+
return (React.createElement(TreeItem$1, __assign({ label: label, nodes: nodes, key: index, color: color, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDownTreeItem }, props)));
|
|
1751
1776
|
})))));
|
|
1752
1777
|
};
|
|
1753
1778
|
|
|
1779
|
+
var TreeItem = function (_a) {
|
|
1780
|
+
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;
|
|
1781
|
+
var isExpanded = !!expandedData.get(data.id);
|
|
1782
|
+
var toogleExpand = function () {
|
|
1783
|
+
var isCurrentlyExpanded = !!expandedData.get(data.id);
|
|
1784
|
+
// create a new Map based on the existing one
|
|
1785
|
+
var newExpandedState = new Map(expandedData);
|
|
1786
|
+
if (isCurrentlyExpanded) {
|
|
1787
|
+
// Logic to collapse this data and all its descendants
|
|
1788
|
+
var collapseDescendants_1 = function (parent) {
|
|
1789
|
+
newExpandedState.set(parent.id, false);
|
|
1790
|
+
if (parent.children && parent.children.length > 0)
|
|
1791
|
+
parent.children.forEach(function (child) { return collapseDescendants_1(child); });
|
|
1792
|
+
};
|
|
1793
|
+
collapseDescendants_1(data);
|
|
1794
|
+
}
|
|
1795
|
+
else {
|
|
1796
|
+
// Logic to expand this data and all its ancestors
|
|
1797
|
+
var current = data;
|
|
1798
|
+
while (current) {
|
|
1799
|
+
newExpandedState.set(current.id, true);
|
|
1800
|
+
current = dataMap[current.parent];
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
setExpandedData(newExpandedState);
|
|
1804
|
+
};
|
|
1805
|
+
var clickItemHandler = function () {
|
|
1806
|
+
if (data.children && !isExpanded)
|
|
1807
|
+
toogleExpand();
|
|
1808
|
+
// forward selection event to optional handler; cast is used because this is a click callback without a MouseEvent
|
|
1809
|
+
handleCLick === null || handleCLick === void 0 ? void 0 : handleCLick(data);
|
|
1810
|
+
};
|
|
1811
|
+
var chevronClickHandler = function () {
|
|
1812
|
+
toogleExpand();
|
|
1813
|
+
handleChevronClick === null || handleChevronClick === void 0 ? void 0 : handleChevronClick(data);
|
|
1814
|
+
};
|
|
1815
|
+
return (React.createElement("div", { className: "tree-item" },
|
|
1816
|
+
React.createElement("div", { className: "tree-item-header flex items-center justify-start" },
|
|
1817
|
+
data.children ? (React.createElement("button", { className: "tree-item-chevron", onClick: chevronClickHandler, type: "button" },
|
|
1818
|
+
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]" })),
|
|
1819
|
+
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) {
|
|
1820
|
+
e.preventDefault();
|
|
1821
|
+
handleRightClick === null || handleRightClick === void 0 ? void 0 : handleRightClick(data);
|
|
1822
|
+
} }, data.label)),
|
|
1823
|
+
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 })); })))));
|
|
1824
|
+
};
|
|
1825
|
+
|
|
1826
|
+
var defaultAlias = {
|
|
1827
|
+
id: null,
|
|
1828
|
+
label: null,
|
|
1829
|
+
parent: null,
|
|
1830
|
+
};
|
|
1831
|
+
var unitTransformator = function (unit, alias) {
|
|
1832
|
+
var _a, _b, _c;
|
|
1833
|
+
if (alias === void 0) { alias = defaultAlias; }
|
|
1834
|
+
var newUnit = {
|
|
1835
|
+
id: unit[(_a = alias.id) !== null && _a !== void 0 ? _a : 'id'],
|
|
1836
|
+
label: unit[(_b = alias.label) !== null && _b !== void 0 ? _b : 'label'],
|
|
1837
|
+
parent: unit[(_c = alias.parent) !== null && _c !== void 0 ? _c : 'parent'],
|
|
1838
|
+
children: [],
|
|
1839
|
+
data: __assign({}, unit),
|
|
1840
|
+
}; // new unit object that will used in TreeItem Component
|
|
1841
|
+
return newUnit;
|
|
1842
|
+
};
|
|
1843
|
+
var useFileTree = function (data, alias) {
|
|
1844
|
+
if (alias === void 0) { alias = defaultAlias; }
|
|
1845
|
+
var _a = React.useState(function () { return new Map(); }), expandedData = _a[0], setExpandedData = _a[1];
|
|
1846
|
+
var usedAlias = __assign(__assign({}, defaultAlias), alias);
|
|
1847
|
+
// A map to store all items by their ID for quick lookup
|
|
1848
|
+
var map = new Map();
|
|
1849
|
+
// An array to hold the root-level objects
|
|
1850
|
+
var tree = [];
|
|
1851
|
+
// First, create a map of all items
|
|
1852
|
+
data.forEach(function (unit) {
|
|
1853
|
+
map.set(unit['id'], unitTransformator(unit, usedAlias));
|
|
1854
|
+
});
|
|
1855
|
+
// build tree structure by linkiing children to parents
|
|
1856
|
+
map.forEach(function (unit) {
|
|
1857
|
+
var parent = map.get(unit.parent);
|
|
1858
|
+
if (parent) {
|
|
1859
|
+
// Find the correct insertion point for the new child
|
|
1860
|
+
var insertionIndex = parent.children.findIndex(function (child) {
|
|
1861
|
+
return unit.label.toLowerCase().localeCompare(child.label.toLowerCase()) < 0;
|
|
1862
|
+
});
|
|
1863
|
+
// Insert the new child at the correct position
|
|
1864
|
+
if (insertionIndex === -1)
|
|
1865
|
+
parent.children.push(unit);
|
|
1866
|
+
else
|
|
1867
|
+
parent.children.splice(insertionIndex, 0, unit);
|
|
1868
|
+
}
|
|
1869
|
+
else
|
|
1870
|
+
tree.push(unit);
|
|
1871
|
+
});
|
|
1872
|
+
return { tree: tree, map: map, expandedData: expandedData, setExpandedData: setExpandedData };
|
|
1873
|
+
};
|
|
1874
|
+
|
|
1754
1875
|
var getContextualPopupStyle = function (anchorRef, popupRef, position) {
|
|
1755
1876
|
if (!anchorRef.current || !popupRef.current) {
|
|
1756
1877
|
return {};
|
|
@@ -1989,15 +2110,15 @@ MenuItem.defaultProps = {
|
|
|
1989
2110
|
};
|
|
1990
2111
|
|
|
1991
2112
|
function Tooltip(props) {
|
|
1992
|
-
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;
|
|
2113
|
+
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;
|
|
1993
2114
|
var timeout;
|
|
1994
|
-
var
|
|
2115
|
+
var _d = React.useState(false), active = _d[0], setActive = _d[1];
|
|
1995
2116
|
var anchorRef = React.useRef(null);
|
|
1996
2117
|
var tooltipContainerRef = React.useRef(null);
|
|
1997
|
-
var
|
|
2118
|
+
var _e = React.useState({
|
|
1998
2119
|
maxWidth: maxWidth + 'px',
|
|
1999
2120
|
whiteSpace: 'nowrap',
|
|
2000
|
-
}), tooltipContainerStyle =
|
|
2121
|
+
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
2001
2122
|
var showTip = function () {
|
|
2002
2123
|
timeout = setTimeout(function () {
|
|
2003
2124
|
setActive(true);
|
|
@@ -2041,12 +2162,12 @@ function Tooltip(props) {
|
|
|
2041
2162
|
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
2042
2163
|
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
|
|
2043
2164
|
children,
|
|
2044
|
-
active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle }))));
|
|
2165
|
+
active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle, zIndex: zIndex, className: className, style: style }))));
|
|
2045
2166
|
}
|
|
2046
2167
|
var TooltipItem = function (_a) {
|
|
2047
|
-
var anchorRef = _a.anchorRef,
|
|
2168
|
+
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;
|
|
2048
2169
|
var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
|
|
2049
|
-
return reactDom.createPortal(React.createElement("div", { className: "tooltip-container break-word absolute
|
|
2170
|
+
return reactDom.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);
|
|
2050
2171
|
};
|
|
2051
2172
|
Tooltip.defaultProps = {
|
|
2052
2173
|
delay: 400,
|
|
@@ -2172,12 +2293,13 @@ var TextInput = React.forwardRef(function (_a, ref) {
|
|
|
2172
2293
|
if (variant === 'date')
|
|
2173
2294
|
iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
|
|
2174
2295
|
var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
|
|
2296
|
+
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2175
2297
|
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" },
|
|
2176
2298
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2177
|
-
React.createElement("div", { className: "relative w-full" },
|
|
2178
|
-
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)),
|
|
2299
|
+
React.createElement("div", { className: "relative w-full ".concat(disabledClass) },
|
|
2300
|
+
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)),
|
|
2179
2301
|
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(actionElement ? '' : iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
|
|
2180
|
-
(descText || maxLength) && (React.createElement("div", { className: "bianic-text-input-desc flex justify-between gap-1 text-xs
|
|
2302
|
+
(descText || maxLength) && (React.createElement("div", { className: "bianic-text-input-desc flex justify-between gap-1 whitespace-nowrap text-xs ".concat(descColor) },
|
|
2181
2303
|
React.createElement("span", null, descText),
|
|
2182
2304
|
maxLength && (React.createElement("span", null,
|
|
2183
2305
|
remainWords,
|
|
@@ -2219,10 +2341,10 @@ function Radio(_a) {
|
|
|
2219
2341
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
2220
2342
|
var _f = sizeConfig$b[validatedSize], checkSize = _f.checkSize, labelSize = _f.labelSize;
|
|
2221
2343
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2222
|
-
React.createElement("div", { className: "
|
|
2223
|
-
React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "peer
|
|
2224
|
-
React.createElement("div", { className: "check-icon flex
|
|
2225
|
-
React.createElement("label", { htmlFor: id, className: "ml-2
|
|
2344
|
+
React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkSize) },
|
|
2345
|
+
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 }),
|
|
2346
|
+
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" })),
|
|
2347
|
+
React.createElement("label", { htmlFor: id, className: "ml-2 font-[350] leading-4 ".concat(labelSize), style: { color: disabled ? '#8C8CA6' : '#2f2f2f' } }, childrenElement(label))));
|
|
2226
2348
|
}
|
|
2227
2349
|
Radio.defaultProps = {
|
|
2228
2350
|
label: '',
|
|
@@ -2258,11 +2380,12 @@ function TextArea(_a) {
|
|
|
2258
2380
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
2259
2381
|
var inputClass = sizeConfig$a[size].inputClass;
|
|
2260
2382
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
2383
|
+
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2261
2384
|
return (React.createElement("div", { className: "field-group group/form flex w-full flex-col gap-y-2" },
|
|
2262
2385
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2263
|
-
React.createElement("div", { className: "relative h-fit w-full min-w-[250px]" },
|
|
2386
|
+
React.createElement("div", { className: "relative h-fit w-full min-w-[250px] ".concat(disabledClass) },
|
|
2264
2387
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
2265
|
-
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))),
|
|
2388
|
+
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))),
|
|
2266
2389
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs text-primary-cool" },
|
|
2267
2390
|
descText && React.createElement("span", null, descText),
|
|
2268
2391
|
maxLength && (React.createElement("span", null,
|
|
@@ -2301,7 +2424,7 @@ function Checkbox(_a) {
|
|
|
2301
2424
|
var _e = sizeConfig$9[validUnion(size, sizeUnion$3)], checkClass = _e.checkClass, labelClass = _e.labelClass;
|
|
2302
2425
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2303
2426
|
React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkClass) },
|
|
2304
|
-
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)),
|
|
2427
|
+
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)),
|
|
2305
2428
|
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" },
|
|
2306
2429
|
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" },
|
|
2307
2430
|
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" })))),
|
|
@@ -2414,12 +2537,13 @@ function SelectInput(_a) {
|
|
|
2414
2537
|
descColor = 'text-bia-green';
|
|
2415
2538
|
if (!disabled && isExistValidation && !isValid)
|
|
2416
2539
|
descColor = 'text-bia-red';
|
|
2540
|
+
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2417
2541
|
return (React.createElement("div", { className: "bianic-fgc-container bianic-text-input-container field-group flex w-full flex-col" },
|
|
2418
2542
|
React.createElement("label", { htmlFor: id, className: "label pb-2 text-xs font-semibold" },
|
|
2419
2543
|
childrenElement(label),
|
|
2420
2544
|
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
2421
|
-
React.createElement("div", { className: "group relative w-full" },
|
|
2422
|
-
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)),
|
|
2545
|
+
React.createElement("div", { className: "group relative w-full ".concat(disabledClass) },
|
|
2546
|
+
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)),
|
|
2423
2547
|
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)),
|
|
2424
2548
|
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) {
|
|
2425
2549
|
var isSelected = JSON.stringify(option) === JSON.stringify(selected);
|
|
@@ -2735,7 +2859,7 @@ var useLiveSearch = function (_a) {
|
|
|
2735
2859
|
};
|
|
2736
2860
|
|
|
2737
2861
|
function LiveSearch(_a) {
|
|
2738
|
-
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
|
|
2862
|
+
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;
|
|
2739
2863
|
var inputRef = React.useRef(null);
|
|
2740
2864
|
var _m = useLiveSearch({
|
|
2741
2865
|
value: value,
|
|
@@ -2754,8 +2878,10 @@ function LiveSearch(_a) {
|
|
|
2754
2878
|
descColor = 'text-bia-red';
|
|
2755
2879
|
var filteredOptions = filterOptions(options || [], value.label);
|
|
2756
2880
|
var _q = processRenderedChildren(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
2757
|
-
|
|
2758
|
-
|
|
2881
|
+
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2882
|
+
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" },
|
|
2883
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2884
|
+
React.createElement("div", { className: "group relative w-full ".concat(disabledClass) },
|
|
2759
2885
|
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) {
|
|
2760
2886
|
onChangeText(e);
|
|
2761
2887
|
handleInputChange(e);
|
|
@@ -2810,11 +2936,13 @@ var sizeConfig$5 = {
|
|
|
2810
2936
|
function Toggle(_a) {
|
|
2811
2937
|
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;
|
|
2812
2938
|
var _h = sizeConfig$5[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
|
|
2939
|
+
var checkedClass = checked ? 'justify-end' : 'justify-start';
|
|
2940
|
+
var containerClass = "".concat(checkedClass, " ").concat(containerSize);
|
|
2813
2941
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2814
|
-
React.createElement("div", { className: "
|
|
2815
|
-
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "".concat(checkSize, "
|
|
2816
|
-
React.createElement("div", { className: "
|
|
2817
|
-
React.createElement("label", { htmlFor: id, className: "ml-2
|
|
2942
|
+
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 },
|
|
2943
|
+
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" }),
|
|
2944
|
+
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" })),
|
|
2945
|
+
React.createElement("label", { htmlFor: id, className: "text-grey-800 ml-2 font-normal leading-4 ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
|
|
2818
2946
|
}
|
|
2819
2947
|
Toggle.defaultProps = {
|
|
2820
2948
|
label: '',
|
|
@@ -3289,7 +3417,7 @@ var DateInputDisplay = React.forwardRef(function (_a, ref) {
|
|
|
3289
3417
|
setIsEditing(false);
|
|
3290
3418
|
setDateString(value);
|
|
3291
3419
|
};
|
|
3292
|
-
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 () {
|
|
3420
|
+
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 () {
|
|
3293
3421
|
buttonAction && buttonAction();
|
|
3294
3422
|
} },
|
|
3295
3423
|
React.createElement(TbCalendar, { size: iconSize })) })) : (React.createElement(React.Fragment, null,
|
|
@@ -3583,48 +3711,78 @@ var positionConfig = {
|
|
|
3583
3711
|
end: 'justify-end',
|
|
3584
3712
|
};
|
|
3585
3713
|
|
|
3714
|
+
var SelectedPage = function (_a) {
|
|
3715
|
+
var label = _a.label, _b = _a.size, size = _b === void 0 ? 'sm' : _b;
|
|
3716
|
+
var basicButtonStyle = 'bianic-custom-button bianic-fgc-target flex items-center justify-center font-semibold cursor-default';
|
|
3717
|
+
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';
|
|
3718
|
+
var textStyleOptions = {
|
|
3719
|
+
sm: 'text-size-sm',
|
|
3720
|
+
md: 'text-size-base',
|
|
3721
|
+
};
|
|
3722
|
+
var sizeStyleOptions = "".concat(iconOnlySizeConfig$1[size], " ").concat(radiusConfig$1['default'][size]);
|
|
3723
|
+
var style = "".concat(basicButtonStyle, " ").concat(basicColorStyle, " ").concat(sizeStyleOptions, " ").concat(textStyleOptions[size]);
|
|
3724
|
+
return React.createElement("div", { className: style }, label);
|
|
3725
|
+
};
|
|
3726
|
+
|
|
3586
3727
|
function PaginationBar(_a) {
|
|
3587
3728
|
var size = _a.size, position = _a.position, currentPage = _a.currentPage, totalPages = _a.totalPages, onPageChange = _a.onPageChange;
|
|
3588
|
-
var
|
|
3589
|
-
var
|
|
3729
|
+
var totalRange = Array.from({ length: totalPages }, function (_, i) { return i + 1; });
|
|
3730
|
+
var PAGE_SIZE = 5;
|
|
3731
|
+
var _b = React.useState(0), startIndex = _b[0], setStartIndex = _b[1];
|
|
3732
|
+
var _c = React.useState(totalRange.slice(startIndex, PAGE_SIZE)), showedPages = _c[0], setShowedPages = _c[1];
|
|
3590
3733
|
var buttonSizingStyle = size === 'sm' ? 31 : 38;
|
|
3591
3734
|
var iconSize = size === 'sm' ? 14 : 18;
|
|
3592
|
-
React.useEffect(function () {
|
|
3593
|
-
var tempRange = [];
|
|
3594
|
-
for (var i = 1; i <= totalPages; i += 1) {
|
|
3595
|
-
tempRange.push(i);
|
|
3596
|
-
}
|
|
3597
|
-
setRange(tempRange);
|
|
3598
|
-
}, [totalPages]);
|
|
3599
|
-
React.useEffect(function () {
|
|
3600
|
-
var usedRange = [];
|
|
3601
|
-
var startRange = 0;
|
|
3602
|
-
var endRange = totalPages > 5 ? 5 : totalPages;
|
|
3603
|
-
if (totalPages > 5) {
|
|
3604
|
-
if (currentPage < 3) {
|
|
3605
|
-
endRange = 5;
|
|
3606
|
-
}
|
|
3607
|
-
else if (currentPage >= totalPages - 1) {
|
|
3608
|
-
startRange = totalPages - 5;
|
|
3609
|
-
endRange = totalPages;
|
|
3610
|
-
}
|
|
3611
|
-
else {
|
|
3612
|
-
startRange = currentPage - 3;
|
|
3613
|
-
endRange = currentPage + 2;
|
|
3614
|
-
}
|
|
3615
|
-
}
|
|
3616
|
-
usedRange = range.slice(startRange, endRange);
|
|
3617
|
-
setShowedPages(usedRange);
|
|
3618
|
-
}, [currentPage, totalPages, range]);
|
|
3619
3735
|
var handlePageChange = function (page) {
|
|
3620
|
-
if (page >= 1 && page <= totalPages)
|
|
3736
|
+
if (page >= 1 && page <= totalPages)
|
|
3621
3737
|
onPageChange(page);
|
|
3622
|
-
}
|
|
3623
3738
|
};
|
|
3739
|
+
var handleNextRange = function () {
|
|
3740
|
+
var newStartIndex = startIndex + PAGE_SIZE;
|
|
3741
|
+
if (newStartIndex < totalPages)
|
|
3742
|
+
setStartIndex(newStartIndex);
|
|
3743
|
+
else
|
|
3744
|
+
setStartIndex(totalPages - PAGE_SIZE);
|
|
3745
|
+
};
|
|
3746
|
+
var handlePrevRange = function () {
|
|
3747
|
+
var newStartIndex = startIndex - PAGE_SIZE;
|
|
3748
|
+
if (newStartIndex >= 0)
|
|
3749
|
+
setStartIndex(newStartIndex);
|
|
3750
|
+
else
|
|
3751
|
+
setStartIndex(0);
|
|
3752
|
+
};
|
|
3753
|
+
var getStartIndex = function (index) {
|
|
3754
|
+
if (index + PAGE_SIZE > totalPages)
|
|
3755
|
+
return Math.max(0, totalPages - PAGE_SIZE);
|
|
3756
|
+
return index;
|
|
3757
|
+
};
|
|
3758
|
+
React.useEffect(function () {
|
|
3759
|
+
var correctedIndex = getStartIndex(startIndex);
|
|
3760
|
+
setShowedPages(totalRange.slice(correctedIndex, correctedIndex + PAGE_SIZE));
|
|
3761
|
+
}, [startIndex, totalRange, totalPages]);
|
|
3624
3762
|
return (React.createElement("div", { className: "flex ".concat(positionConfig[position], " gap-[5px]") },
|
|
3625
|
-
React.createElement(Button, { variant: "subtle
|
|
3626
|
-
|
|
3627
|
-
|
|
3763
|
+
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 })),
|
|
3764
|
+
React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
|
|
3765
|
+
handlePageChange(currentPage - 1);
|
|
3766
|
+
if (showedPages[0] === currentPage)
|
|
3767
|
+
setStartIndex(function (old) { return old - 1; });
|
|
3768
|
+
}, className: currentPage === 1 ? '' : 'cursor-pointer', iconLeft: React.createElement(TbChevronLeft, { size: iconSize }), disabled: currentPage === 1 }),
|
|
3769
|
+
showedPages.map(function (page) {
|
|
3770
|
+
if (page === currentPage) {
|
|
3771
|
+
return React.createElement(SelectedPage, { key: page, label: page.toString(), size: size });
|
|
3772
|
+
}
|
|
3773
|
+
return (React.createElement(Button, { key: page, variant: "subtle", size: size, type: "button", onClick: function () {
|
|
3774
|
+
handlePageChange(page);
|
|
3775
|
+
}, className: "cursor-pointer ".concat(sizeConfig$2[size]), label: page.toString(), minWidth: buttonSizingStyle }));
|
|
3776
|
+
}),
|
|
3777
|
+
React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
|
|
3778
|
+
handlePageChange(currentPage + 1);
|
|
3779
|
+
if (showedPages[4] === currentPage) {
|
|
3780
|
+
setStartIndex(function (old) { return old + 1; });
|
|
3781
|
+
}
|
|
3782
|
+
}, className: currentPage === totalPages ? '' : 'cursor-pointer', iconLeft: React.createElement(TbChevronRight, { size: iconSize }), disabled: currentPage === totalPages }),
|
|
3783
|
+
totalPages > 5 && (React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: handleNextRange, className: showedPages[showedPages.length - 1] === totalPages
|
|
3784
|
+
? ''
|
|
3785
|
+
: 'cursor-pointer', iconLeft: React.createElement(TbChevronsRight, { size: iconSize }), disabled: showedPages[showedPages.length - 1] === totalPages }))));
|
|
3628
3786
|
}
|
|
3629
3787
|
|
|
3630
3788
|
var activeConfig = {
|
|
@@ -3709,20 +3867,19 @@ var classConfig = {
|
|
|
3709
3867
|
};
|
|
3710
3868
|
|
|
3711
3869
|
function Popover(_a) {
|
|
3712
|
-
var children = _a.children, content = _a.content
|
|
3870
|
+
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;
|
|
3713
3871
|
var wrapperRef = React.useRef(null);
|
|
3714
|
-
|
|
3715
|
-
var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
|
|
3872
|
+
var _d = useDetectOutsideClick(wrapperRef, false), isOpen = _d[0], setIsOpen = _d[1];
|
|
3716
3873
|
return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
|
|
3717
3874
|
children,
|
|
3718
|
-
isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction }))));
|
|
3875
|
+
isOpen && (React.createElement(PopoverItem, { title: title, content: content, anchorRef: wrapperRef, direction: direction, className: className, style: style, zIndex: zIndex }))));
|
|
3719
3876
|
}
|
|
3720
3877
|
var PopoverItem = function (_a) {
|
|
3721
|
-
var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction;
|
|
3878
|
+
var title = _a.title, content = _a.content, anchorRef = _a.anchorRef, direction = _a.direction, className = _a.className, style = _a.style, zIndex = _a.zIndex;
|
|
3722
3879
|
var popoverRef = React.useRef(null);
|
|
3723
3880
|
var positionStyle = usePopupPosition(anchorRef, popoverRef, direction)[0];
|
|
3724
3881
|
var _b = classConfig[direction], triangleContainer = _b.triangleContainer, triangleShape = _b.triangleShape;
|
|
3725
|
-
return reactDom.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" },
|
|
3882
|
+
return reactDom.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) },
|
|
3726
3883
|
React.createElement("div", { className: "flex flex-col" },
|
|
3727
3884
|
React.createElement("div", { className: "mb-[5px] font-humnst777 text-[16px] font-bold leading-[19.42px]" }, title),
|
|
3728
3885
|
React.createElement("div", { className: "break-words font-segoe text-[12px] font-normal" }, content)),
|
|
@@ -3730,7 +3887,6 @@ var PopoverItem = function (_a) {
|
|
|
3730
3887
|
React.createElement("div", { className: "h-0 w-0 ".concat(triangleShape) }))), document.body);
|
|
3731
3888
|
};
|
|
3732
3889
|
Popover.defaultProps = {
|
|
3733
|
-
delay: 400,
|
|
3734
3890
|
direction: 'top',
|
|
3735
3891
|
title: '',
|
|
3736
3892
|
};
|
|
@@ -4295,6 +4451,7 @@ exports.Brand = Brand;
|
|
|
4295
4451
|
exports.Breadcrumb = Breadcrumb;
|
|
4296
4452
|
exports.Button = Button;
|
|
4297
4453
|
exports.ButtonApp = ButtonApp;
|
|
4454
|
+
exports.Card = Card;
|
|
4298
4455
|
exports.Checkbox = Checkbox;
|
|
4299
4456
|
exports.Color = Color;
|
|
4300
4457
|
exports.ContextualButton = ContextualButton;
|
|
@@ -4339,4 +4496,6 @@ exports.TextInput = TextInput;
|
|
|
4339
4496
|
exports.Toaster = Toaster;
|
|
4340
4497
|
exports.Toggle = Toggle;
|
|
4341
4498
|
exports.Tooltip = Tooltip;
|
|
4499
|
+
exports.TreeItem = TreeItem;
|
|
4342
4500
|
exports.Window = Window;
|
|
4501
|
+
exports.useFileTree = useFileTree;
|