bianic-ui 2.14.0-beta.5 → 2.14.0-beta.7
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/README.md +49 -49
- package/dist/cjs/Empty.svg +12 -12
- package/dist/cjs/font/SansCode/README.txt +88 -88
- package/dist/cjs/index.js +160 -183
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Button/buttonConfigs.d.ts +6 -0
- package/dist/cjs/types/components/FileTree/TreeItem.d.ts +5 -4
- package/dist/cjs/types/components/Forms/DatePicker/PickerCalendar/helpers/dateUtils.d.ts +1 -0
- package/dist/cjs/types/components/Forms/Radio/configs.d.ts +3 -3
- package/dist/cjs/types/components/InfoPanel/index.d.ts +9 -3
- package/dist/cjs/types/components/Stepper/Horizontal/configs.d.ts +2 -5
- package/dist/cjs/types/components/Stepper/Horizontal/index.d.ts +1 -1
- package/dist/cjs/types/components/Stepper/Horizontal/types.d.ts +2 -3
- package/dist/cjs/types/components/Stepper/index.d.ts +1 -1
- package/dist/cjs/types/components/Table/TableCell/index.d.ts +2 -1
- package/dist/cjs/types/components/index.d.ts +1 -2
- package/dist/cjs/types/stories/FileTree/FileTree.stories.d.ts +1 -1
- package/dist/cjs/types/stories/FileTree/FileTreeContextMenu.stories.d.ts +1 -1
- package/dist/cjs/types/stories/Form/Dropdown/DropdownContainer.test.stories.d.ts +28 -0
- package/dist/cjs/types/stories/Form/LiveSearch/Livesearch.test.stories.d.ts +27 -0
- package/dist/cjs/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +1 -0
- package/dist/cjs/types/stories/HorizontalStepper/HorizontalStepper.test.stories.d.ts +6 -2
- package/dist/cjs/types/stories/InfoPanel/InfoPanel.stories.d.ts +1 -0
- package/dist/cjs/types/stories/Table/TableCell.stories.d.ts +4 -0
- package/dist/cjs/types/utility/hooks/usePopupPosition.d.ts +1 -1
- package/dist/esm/Empty.svg +12 -12
- package/dist/esm/font/SansCode/README.txt +88 -88
- package/dist/esm/index.js +161 -183
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Button/buttonConfigs.d.ts +6 -0
- package/dist/esm/types/components/FileTree/TreeItem.d.ts +5 -4
- package/dist/esm/types/components/Forms/DatePicker/PickerCalendar/helpers/dateUtils.d.ts +1 -0
- package/dist/esm/types/components/Forms/Radio/configs.d.ts +3 -3
- package/dist/esm/types/components/InfoPanel/index.d.ts +9 -3
- package/dist/esm/types/components/Stepper/Horizontal/configs.d.ts +2 -5
- package/dist/esm/types/components/Stepper/Horizontal/index.d.ts +1 -1
- package/dist/esm/types/components/Stepper/Horizontal/types.d.ts +2 -3
- package/dist/esm/types/components/Stepper/index.d.ts +1 -1
- package/dist/esm/types/components/Table/TableCell/index.d.ts +2 -1
- package/dist/esm/types/components/index.d.ts +1 -2
- package/dist/esm/types/stories/FileTree/FileTree.stories.d.ts +1 -1
- package/dist/esm/types/stories/FileTree/FileTreeContextMenu.stories.d.ts +1 -1
- package/dist/esm/types/stories/Form/Dropdown/DropdownContainer.test.stories.d.ts +28 -0
- package/dist/esm/types/stories/Form/LiveSearch/Livesearch.test.stories.d.ts +27 -0
- package/dist/esm/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +1 -0
- package/dist/esm/types/stories/HorizontalStepper/HorizontalStepper.test.stories.d.ts +6 -2
- package/dist/esm/types/stories/InfoPanel/InfoPanel.stories.d.ts +1 -0
- package/dist/esm/types/stories/Table/TableCell.stories.d.ts +4 -0
- package/dist/esm/types/utility/hooks/usePopupPosition.d.ts +1 -1
- package/dist/index.d.ts +21 -31
- package/package.json +163 -161
- package/src/font/SansCode/README.txt +88 -88
- package/src/style/color.css +650 -650
- package/src/style/scrollbar.css +78 -78
- package/tailwind.config.js +592 -592
package/dist/cjs/index.js
CHANGED
|
@@ -468,6 +468,14 @@ var sidePaddingConfig = {
|
|
|
468
468
|
sm: 'px-[8px]',
|
|
469
469
|
tn: 'px-[4px]',
|
|
470
470
|
};
|
|
471
|
+
// Rounded buttons add a spacer (3px, tn 2px) plus the size gap on each side:
|
|
472
|
+
// side padding + spacer + gap
|
|
473
|
+
var roundedSidePaddingConfig = {
|
|
474
|
+
lg: 'px-[26px]',
|
|
475
|
+
md: 'px-[19px]',
|
|
476
|
+
sm: 'px-[16px]',
|
|
477
|
+
tn: 'px-[9px]',
|
|
478
|
+
};
|
|
471
479
|
var minWidthConfig$1 = {
|
|
472
480
|
lg: 'min-w-[112px]',
|
|
473
481
|
md: 'min-w-[96px]',
|
|
@@ -559,7 +567,8 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
559
567
|
sizingRules = "".concat(sizeConfig$f[validatedSize]);
|
|
560
568
|
}
|
|
561
569
|
else {
|
|
562
|
-
|
|
570
|
+
var sidePadding = radius === 'full-rounded' ? roundedSidePaddingConfig : sidePaddingConfig;
|
|
571
|
+
sizingRules = "".concat(sizeConfig$f[validatedSize], " ").concat(sidePadding[validatedSize]);
|
|
563
572
|
}
|
|
564
573
|
var hasDoubleIcon = iconRight && iconLeft;
|
|
565
574
|
var isVariantLink = variant.includes('link')
|
|
@@ -1819,84 +1828,15 @@ function Divider(_a) {
|
|
|
1819
1828
|
return (React.createElement("div", { className: "bianic-divider bg-bia-grey-light-50 ".concat(margin, " ").concat(config, " ").concat(className) }));
|
|
1820
1829
|
}
|
|
1821
1830
|
|
|
1822
|
-
function TreeItem$1(_a) {
|
|
1823
|
-
var label = _a.label, _b = _a.nodes, nodes = _b === void 0 ? undefined : _b, _c = _a.color, color = _c === void 0 ? undefined : _c, _d = _a.chevronColor, chevronColor = _d === void 0 ? undefined : _d, _e = _a.handleRightClick, handleRightClick = _e === void 0 ? undefined : _e, _f = _a.onMouseDownTreeItem, onMouseDownTreeItem = _f === void 0 ? undefined : _f, props = __rest(_a, ["label", "nodes", "color", "chevronColor", "handleRightClick", "onMouseDownTreeItem"]);
|
|
1824
|
-
var treeRef = React.useRef(null);
|
|
1825
|
-
var _g = React.useState(false), isExpand = _g[0], setIsExpand = _g[1];
|
|
1826
|
-
var _h = React.useState(false), isFocused = _h[0], setIsFocused = _h[1];
|
|
1827
|
-
var _j = useDetectOutsideClick(treeRef, false, 'mousedown'), isClickRight = _j[0], setIsClickRight = _j[1];
|
|
1828
|
-
var focusedIconColor = chevronColor || color
|
|
1829
|
-
? "text-bia-".concat(chevronColor || color)
|
|
1830
|
-
: 'text-bia-coolgrey-light-50';
|
|
1831
|
-
var focusedBgColor = color ? "bg-bia-".concat(color) : 'bg-bia-coolgrey-light-50';
|
|
1832
|
-
var clickRightClass = 'outline outline-[3px] outline-bia-blue-light-50';
|
|
1833
|
-
var textClass = "flex items-center rounded-radius-sm px-[2px] cursor-pointer hover:bg-bia-coolgrey-light-90 focus:pointer-events-none ".concat(isFocused && focusedBgColor, " ").concat(isClickRight && clickRightClass);
|
|
1834
|
-
return (React.createElement("div", { className: "bianic-tree-item" },
|
|
1835
|
-
React.createElement("div", { className: "justify-left group flex items-center", ref: treeRef },
|
|
1836
|
-
nodes && nodes.length > 0 ? (React.createElement("button", { type: "button", className: "cursor-pointer", onClick: function () {
|
|
1837
|
-
setIsExpand(function (prev) { return !prev; });
|
|
1838
|
-
} },
|
|
1839
|
-
React.createElement(TbChevronRight, { className: "".concat(isFocused ? focusedIconColor : 'text-bia-coolgrey-light-20', " ").concat(isExpand && 'rotate-90'), size: 18 }))) : (React.createElement("div", { className: "aspect-square w-[18px]" })),
|
|
1840
|
-
React.createElement("button", __assign({ type: "button", onFocus: function (e) {
|
|
1841
|
-
var _a;
|
|
1842
|
-
setIsFocused(true);
|
|
1843
|
-
(_a = props === null || props === void 0 ? void 0 : props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
1844
|
-
}, onBlur: function (e) {
|
|
1845
|
-
var _a;
|
|
1846
|
-
setIsFocused(false);
|
|
1847
|
-
setIsClickRight(false); // Reset isClickRight saat blur
|
|
1848
|
-
(_a = props === null || props === void 0 ? void 0 : props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
1849
|
-
}, className: textClass, onMouseDown: function (e) {
|
|
1850
|
-
if (e.button === 2) {
|
|
1851
|
-
// 2 = tombol kanan mouse
|
|
1852
|
-
e.preventDefault(); // Blokir default lebih awal
|
|
1853
|
-
}
|
|
1854
|
-
onMouseDownTreeItem === null || onMouseDownTreeItem === void 0 ? void 0 : onMouseDownTreeItem(e, __assign({ label: label, nodes: nodes }, props));
|
|
1855
|
-
}, onContextMenu: function (e) {
|
|
1856
|
-
e.preventDefault();
|
|
1857
|
-
setIsClickRight(true);
|
|
1858
|
-
handleRightClick === null || handleRightClick === void 0 ? void 0 : handleRightClick(e);
|
|
1859
|
-
} }, props),
|
|
1860
|
-
React.createElement(Text, { variant: "small-text" }, label))),
|
|
1861
|
-
isExpand && nodes && nodes.length > 0 && (React.createElement("div", { className: "ml-4" }, nodes.map(function (_a) {
|
|
1862
|
-
var childLabel = _a.label, childNodes = _a.nodes, childProps = __rest(_a, ["label", "nodes"]);
|
|
1863
|
-
return (React.createElement(TreeItem$1, __assign({ label: childLabel, nodes: childNodes, key: childLabel, color: color, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDownTreeItem }, childProps)));
|
|
1864
|
-
})))));
|
|
1865
|
-
}
|
|
1866
|
-
function FileTree(_a) {
|
|
1867
|
-
var data = _a.data, _b = _a.color, color = _b === void 0 ? undefined : _b, _c = _a.chevronColor, chevronColor = _c === void 0 ? undefined : _c, _d = _a.contextMenu, contextMenu = _d === void 0 ? undefined : _d, _e = _a.onMouseDown, onMouseDown = _e === void 0 ? undefined : _e;
|
|
1868
|
-
var popupRef = React.useRef(null); // Ref untuk div utama
|
|
1869
|
-
var _f = useDetectOutsideClick(popupRef, false), isOpenContMenu = _f[0], setIsOpenContMenu = _f[1];
|
|
1870
|
-
var _g = React.useState({ x: 0, y: 0 }), contMenuPosition = _g[0], setContMenuPosition = _g[1];
|
|
1871
|
-
var menuStyle = {
|
|
1872
|
-
position: 'fixed',
|
|
1873
|
-
top: "".concat(contMenuPosition.y, "px"),
|
|
1874
|
-
left: "".concat(contMenuPosition.x, "px"),
|
|
1875
|
-
// Pastikan z-index cukup tinggi agar muncul di atas elemen lain
|
|
1876
|
-
zIndex: 1000,
|
|
1877
|
-
};
|
|
1878
|
-
var handleRightClick = function (event) {
|
|
1879
|
-
setIsOpenContMenu(true);
|
|
1880
|
-
setContMenuPosition({ x: event.clientX, y: event.clientY });
|
|
1881
|
-
};
|
|
1882
|
-
return (React.createElement("div", { className: "file-tree" },
|
|
1883
|
-
data.map(function (_a) {
|
|
1884
|
-
var label = _a.label, nodes = _a.nodes, props = __rest(_a, ["label", "nodes"]);
|
|
1885
|
-
return (React.createElement(TreeItem$1, __assign({ label: label, nodes: nodes, key: label, color: color, chevronColor: chevronColor, handleRightClick: handleRightClick, onMouseDownTreeItem: onMouseDown }, props)));
|
|
1886
|
-
}),
|
|
1887
|
-
isOpenContMenu && (React.createElement("div", { style: menuStyle, ref: popupRef, className: "bianic-filetree-contextmenu" }, React.isValidElement(contextMenu)
|
|
1888
|
-
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
|
1889
|
-
React.cloneElement(contextMenu, {
|
|
1890
|
-
isWithOverlay: false,
|
|
1891
|
-
onClickItem: function () { return setIsOpenContMenu(false); },
|
|
1892
|
-
})
|
|
1893
|
-
: contextMenu))));
|
|
1894
|
-
}
|
|
1895
|
-
|
|
1896
1831
|
function TreeItem(_a) {
|
|
1897
|
-
var data = _a.data, expandedData = _a.expandedData, setExpandedData = _a.setExpandedData, dataMap = _a.dataMap, _b = _a.activeUnitId, activeUnitId = _b === void 0 ? undefined : _b, _c = _a.handleChevronClick, handleChevronClick = _c === void 0 ? undefined : _c, _d = _a.handleRightClick, handleRightClick = _d === void 0 ? undefined : _d, _e = _a.
|
|
1832
|
+
var data = _a.data, expandedData = _a.expandedData, setExpandedData = _a.setExpandedData, dataMap = _a.dataMap, _b = _a.activeUnitId, activeUnitId = _b === void 0 ? undefined : _b, _c = _a.handleChevronClick, handleChevronClick = _c === void 0 ? undefined : _c, _d = _a.handleRightClick, handleRightClick = _d === void 0 ? undefined : _d, _e = _a.handleClick, handleClick = _e === void 0 ? undefined : _e;
|
|
1898
1833
|
var isExpanded = !!expandedData.get(data.id);
|
|
1899
|
-
var
|
|
1834
|
+
var hasActiveDescendant = function (unit) {
|
|
1835
|
+
var _a;
|
|
1836
|
+
return !!((_a = unit.children) === null || _a === void 0 ? void 0 : _a.some(function (child) { return child.id === activeUnitId || hasActiveDescendant(child); }));
|
|
1837
|
+
};
|
|
1838
|
+
var isChevronActive = activeUnitId === data.id || (!isExpanded && hasActiveDescendant(data));
|
|
1839
|
+
var toggleExpand = function () {
|
|
1900
1840
|
var isCurrentlyExpanded = !!expandedData.get(data.id);
|
|
1901
1841
|
// create a new Map based on the existing one
|
|
1902
1842
|
var newExpandedState = new Map(expandedData);
|
|
@@ -1922,24 +1862,24 @@ function TreeItem(_a) {
|
|
|
1922
1862
|
};
|
|
1923
1863
|
var clickItemHandler = function () {
|
|
1924
1864
|
if (data.children && !isExpanded)
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
handleCLick === null || handleCLick === void 0 ? void 0 : handleCLick(data);
|
|
1865
|
+
toggleExpand();
|
|
1866
|
+
handleClick === null || handleClick === void 0 ? void 0 : handleClick(data);
|
|
1928
1867
|
};
|
|
1929
1868
|
var chevronClickHandler = function () {
|
|
1930
|
-
|
|
1869
|
+
toggleExpand();
|
|
1931
1870
|
handleChevronClick === null || handleChevronClick === void 0 ? void 0 : handleChevronClick(data);
|
|
1932
1871
|
};
|
|
1933
|
-
return (React.createElement("div", { className: "tree-item" },
|
|
1872
|
+
return (React.createElement("div", { className: "tree-item", role: "treeitem", "aria-expanded": data.children ? isExpanded : undefined, "aria-selected": activeUnitId === data.id },
|
|
1934
1873
|
React.createElement("div", { className: "tree-item-header flex items-center justify-start" },
|
|
1935
|
-
data.children ? (React.createElement("button", { className: "tree-item-chevron", onClick: chevronClickHandler, type: "button" },
|
|
1936
|
-
React.createElement(TbChevronRight, { className: "chevron ".concat(
|
|
1874
|
+
data.children ? (React.createElement("button", { className: "tree-item-chevron", onClick: chevronClickHandler, type: "button", "aria-label": isExpanded ? 'Collapse' : 'Expand' },
|
|
1875
|
+
React.createElement(TbChevronRight, { className: "chevron ".concat(isChevronActive ? '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, "aria-hidden": "true" }))) : (React.createElement("div", { className: "chevron-placeholder aspect-square min-w-[18px]" })),
|
|
1937
1876
|
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) {
|
|
1938
1877
|
e.preventDefault();
|
|
1939
1878
|
handleRightClick === null || handleRightClick === void 0 ? void 0 : handleRightClick(data);
|
|
1940
1879
|
} }, data.label)),
|
|
1941
|
-
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,
|
|
1880
|
+
isExpanded && data.children && (React.createElement("div", { className: "tree-item-children flex flex-col gap-0.5 rounded-radius-sm pl-[18px]", role: "group" }, data.children.map(function (childUnit) { return (React.createElement(TreeItem, { key: childUnit.id, data: childUnit, expandedData: expandedData, setExpandedData: setExpandedData, dataMap: dataMap, activeUnitId: activeUnitId, handleChevronClick: handleChevronClick, handleRightClick: handleRightClick, handleClick: handleClick })); })))));
|
|
1942
1881
|
}
|
|
1882
|
+
var TreeItem$1 = React.memo(TreeItem);
|
|
1943
1883
|
|
|
1944
1884
|
var defaultAlias = {
|
|
1945
1885
|
id: null,
|
|
@@ -2073,32 +2013,66 @@ var getDropdownStyle = function (anchorRef, popupRef) {
|
|
|
2073
2013
|
}
|
|
2074
2014
|
return style;
|
|
2075
2015
|
};
|
|
2016
|
+
var noop = function () { };
|
|
2017
|
+
var isSameStyle = function (a, b) {
|
|
2018
|
+
return a.position === b.position &&
|
|
2019
|
+
a.top === b.top &&
|
|
2020
|
+
a.left === b.left &&
|
|
2021
|
+
a.right === b.right &&
|
|
2022
|
+
a.bottom === b.bottom;
|
|
2023
|
+
};
|
|
2076
2024
|
var usePopupPosition = function (anchorRef, popupRef, position) {
|
|
2077
2025
|
if (!anchorRef || !popupRef) {
|
|
2078
|
-
return [{},
|
|
2026
|
+
return [{}, noop];
|
|
2079
2027
|
}
|
|
2080
2028
|
var _a = React.useState(0), repeateRender = _a[0], setRepeateRender = _a[1];
|
|
2081
2029
|
var _b = React.useState({}), positionStyle = _b[0], setPositionStyle = _b[1];
|
|
2082
|
-
var
|
|
2030
|
+
var resizeObserverRef = React.useRef(null);
|
|
2031
|
+
var observedNodesRef = React.useRef({ popup: null, anchor: null });
|
|
2032
|
+
var calcPosition = React.useCallback(function () {
|
|
2083
2033
|
var newStyle = position !== undefined
|
|
2084
2034
|
? getContextualPopupStyle(anchorRef, popupRef, position)
|
|
2085
2035
|
: getDropdownStyle(anchorRef, popupRef);
|
|
2086
|
-
|
|
2087
|
-
|
|
2036
|
+
// Keep the same object when nothing changed, so React skips the re-render
|
|
2037
|
+
setPositionStyle(function (prev) { return (isSameStyle(prev, newStyle) ? prev : newStyle); });
|
|
2038
|
+
}, [anchorRef, popupRef, position]);
|
|
2039
|
+
var calcPositionRef = React.useRef(calcPosition);
|
|
2040
|
+
calcPositionRef.current = calcPosition;
|
|
2041
|
+
// Window listeners: mount only
|
|
2088
2042
|
React.useLayoutEffect(function () {
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
var resizeObserver = new ResizeObserver(calcPosition);
|
|
2093
|
-
resizeObserver.observe(popupRef.current);
|
|
2094
|
-
window.addEventListener('scroll', calcPosition, true);
|
|
2095
|
-
window.addEventListener('resize', calcPosition);
|
|
2043
|
+
var handler = function () { return calcPositionRef.current(); };
|
|
2044
|
+
window.addEventListener('scroll', handler, true);
|
|
2045
|
+
window.addEventListener('resize', handler);
|
|
2096
2046
|
return function () {
|
|
2097
|
-
|
|
2098
|
-
window.removeEventListener('
|
|
2099
|
-
window.removeEventListener('resize', calcPosition);
|
|
2047
|
+
window.removeEventListener('scroll', handler, true);
|
|
2048
|
+
window.removeEventListener('resize', handler);
|
|
2100
2049
|
};
|
|
2101
|
-
}, [
|
|
2050
|
+
}, []);
|
|
2051
|
+
// Follow the popup and anchor nodes that are really on screen.
|
|
2052
|
+
React.useLayoutEffect(function () {
|
|
2053
|
+
var _a;
|
|
2054
|
+
var popupNode = popupRef.current;
|
|
2055
|
+
var anchorNode = anchorRef.current;
|
|
2056
|
+
var observed = observedNodesRef.current;
|
|
2057
|
+
if (observed.popup === popupNode && observed.anchor === anchorNode)
|
|
2058
|
+
return;
|
|
2059
|
+
(_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
2060
|
+
resizeObserverRef.current = null;
|
|
2061
|
+
observedNodesRef.current = { popup: popupNode, anchor: anchorNode };
|
|
2062
|
+
if (!popupNode || !anchorNode)
|
|
2063
|
+
return;
|
|
2064
|
+
var resizeObserver = new ResizeObserver(function () { return calcPositionRef.current(); });
|
|
2065
|
+
resizeObserver.observe(popupNode);
|
|
2066
|
+
resizeObserver.observe(anchorNode);
|
|
2067
|
+
resizeObserverRef.current = resizeObserver;
|
|
2068
|
+
calcPositionRef.current();
|
|
2069
|
+
});
|
|
2070
|
+
React.useLayoutEffect(function () { return function () {
|
|
2071
|
+
var _a;
|
|
2072
|
+
(_a = resizeObserverRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
2073
|
+
resizeObserverRef.current = null;
|
|
2074
|
+
observedNodesRef.current = { popup: null, anchor: null };
|
|
2075
|
+
}; }, []);
|
|
2102
2076
|
React.useEffect(function () {
|
|
2103
2077
|
// In projects where bianic-ui is installed,
|
|
2104
2078
|
// there is a delay in rendering styles,
|
|
@@ -2439,15 +2413,15 @@ TextInput.defaultProps = {
|
|
|
2439
2413
|
var sizeConfig$c = {
|
|
2440
2414
|
md: {
|
|
2441
2415
|
checkSize: 'w-[22px] h-[22px]',
|
|
2442
|
-
labelSize: 'text-size-base',
|
|
2416
|
+
labelSize: 'text-size-base font-normal',
|
|
2443
2417
|
},
|
|
2444
2418
|
sm: {
|
|
2445
2419
|
checkSize: 'w-4 h-4',
|
|
2446
|
-
labelSize: 'text-size-sm',
|
|
2420
|
+
labelSize: 'text-size-sm font-normal',
|
|
2447
2421
|
},
|
|
2448
2422
|
tn: {
|
|
2449
2423
|
checkSize: 'w-3 h-3',
|
|
2450
|
-
labelSize: 'text-size-sm',
|
|
2424
|
+
labelSize: 'text-size-sm font-normal',
|
|
2451
2425
|
},
|
|
2452
2426
|
};
|
|
2453
2427
|
|
|
@@ -2541,7 +2515,7 @@ var TextArea = React.forwardRef(TextAreaInner);
|
|
|
2541
2515
|
var sizeConfig$a = {
|
|
2542
2516
|
md: {
|
|
2543
2517
|
checkClass: 'w-[22px] h-[22px]',
|
|
2544
|
-
labelClass: 'text-size-base font-
|
|
2518
|
+
labelClass: 'text-size-base font-normal',
|
|
2545
2519
|
},
|
|
2546
2520
|
sm: {
|
|
2547
2521
|
checkClass: 'w-4 h-4',
|
|
@@ -2560,7 +2534,7 @@ function Checkbox(_a) {
|
|
|
2560
2534
|
var isValidIndeterminate = isIndeterminate && props.checked;
|
|
2561
2535
|
var backgroundClass = size === 'tn' && props.checked ? 'bg-bia-blue' : 'bg-bia-white';
|
|
2562
2536
|
var peerCheckedClass = size === 'tn' ? '' : 'peer-checked:border-2';
|
|
2563
|
-
return (React.createElement("div", { className: "flex items-center" },
|
|
2537
|
+
return (React.createElement("div", { className: "inline-flex items-center" },
|
|
2564
2538
|
React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full ".concat(backgroundClass, " ").concat(checkClass) },
|
|
2565
2539
|
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)),
|
|
2566
2540
|
React.createElement("div", { className: "check-icon z-1 group flex h-full w-full items-center justify-center rounded-full text-bia-grey outline-2 outline-transparent 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-focus-visible:outline-bia-blue 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 ".concat(peerCheckedClass) }, isValidIndeterminate ? (React.createElement(TbMinus, { className: "stroke-[3px] text-bia-grey-dark-10 peer-checked:group-[]:text-bia-white peer-hover:group-[]:text-bia-blue-hover peer-checked:peer-hover:group-[]:text-bia-white peer-disabled:group-[]:text-bia-grey-dark-10 peer-disabled:peer-checked:group-[]:text-bia-white", size: 14 })) : (React.createElement(TbCheck, { className: "stroke-[3px] text-bia-grey-dark-10 peer-checked:group-[]:text-bia-white peer-hover:group-[]:text-bia-blue-hover peer-checked:peer-hover:group-[]:text-bia-white peer-disabled:group-[]:text-bia-grey-dark-10 peer-disabled:peer-checked:group-[]:text-bia-white", size: 14 })))),
|
|
@@ -2665,7 +2639,11 @@ var DropdownElement = React.forwardRef(function (_a, ref) {
|
|
|
2665
2639
|
function DropdownContainer(propsComp) {
|
|
2666
2640
|
var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ? 100 : _h, anchorRef = propsComp.anchorRef, matchAnchorWidth = propsComp.matchAnchorWidth, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "size", "onClickItem", "zIndex", "anchorRef", "matchAnchorWidth"]);
|
|
2667
2641
|
var dropdownRef = React.useRef(null);
|
|
2668
|
-
var
|
|
2642
|
+
var _j = usePopupPosition(anchorRef, dropdownRef), positionStyle = _j[0], recalcPosition = _j[1];
|
|
2643
|
+
React.useLayoutEffect(function () {
|
|
2644
|
+
if (open)
|
|
2645
|
+
recalcPosition();
|
|
2646
|
+
}, [open, recalcPosition]);
|
|
2669
2647
|
var newStyle = React.useMemo(function () {
|
|
2670
2648
|
var _a, _b, _c;
|
|
2671
2649
|
if (!(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current)) {
|
|
@@ -3009,7 +2987,7 @@ function LiveSearch(_a) {
|
|
|
3009
2987
|
: 20,
|
|
3010
2988
|
} },
|
|
3011
2989
|
!isSearchTermExist && (React.createElement(TbZoom, { className: "text-primary-black", style: { fontSize: iconSize } })),
|
|
3012
|
-
isSearchTermExist && !onChangeButton && (React.createElement("button", { type: "button", onClick: function () { return setValue({ id: null, label: '' }); }, className: "flex h-full w-full items-center disabled:cursor-not-allowed", disabled: disabled },
|
|
2990
|
+
isSearchTermExist && !onChangeButton && (React.createElement("button", { type: "button", "aria-label": "Clear search", onClick: function () { return setValue({ id: null, label: '' }); }, className: "flex h-full w-full items-center disabled:cursor-not-allowed", disabled: disabled },
|
|
3013
2991
|
React.createElement(TbX, { className: "text-primary-black", style: { fontSize: iconSize } }))),
|
|
3014
2992
|
isSearchTermExist && onChangeButton),
|
|
3015
2993
|
children === undefined && isOpen && (
|
|
@@ -3199,7 +3177,7 @@ var rightPaddingConfig = {
|
|
|
3199
3177
|
tn: 'pr-[3px]',
|
|
3200
3178
|
};
|
|
3201
3179
|
|
|
3202
|
-
var colorUnion = [
|
|
3180
|
+
var colorUnion$1 = [
|
|
3203
3181
|
'default',
|
|
3204
3182
|
'blue',
|
|
3205
3183
|
'teal',
|
|
@@ -3219,7 +3197,7 @@ function TagLabel(_a) {
|
|
|
3219
3197
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
3220
3198
|
_a.right;
|
|
3221
3199
|
var _k = _a.bgColor, bgColor = _k === void 0 ? 'grey-light-50' : _k, _l = _a.textColor, textColor = _l === void 0 ? 'black' : _l, _m = _a.outlineColor, outlineColor = _m === void 0 ? undefined : _m, _o = _a.isBlock, isBlock = _o === void 0 ? undefined : _o, _p = _a.maxWidth, maxWidth = _p === void 0 ? undefined : _p, _q = _a.isDark, isDark = _q === void 0 ? undefined : _q; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
|
|
3222
|
-
var validatedColor = validUnion(color, colorUnion);
|
|
3200
|
+
var validatedColor = validUnion(color, colorUnion$1);
|
|
3223
3201
|
var validatedSize = validUnion(size, sizeUnion$1);
|
|
3224
3202
|
var validatedVariant = validUnion(variant, variantUnion);
|
|
3225
3203
|
var containerRef = React.useRef(null);
|
|
@@ -3389,21 +3367,21 @@ var sizeConfig$4 = {
|
|
|
3389
3367
|
trackBorder: 'border-2',
|
|
3390
3368
|
knobSize: 'size-[18px]',
|
|
3391
3369
|
knobInset: 'mx-[4px]',
|
|
3392
|
-
labelClass: 'text-size-base',
|
|
3370
|
+
labelClass: 'text-size-base font-normal',
|
|
3393
3371
|
},
|
|
3394
3372
|
sm: {
|
|
3395
3373
|
containerSize: 'w-[32px] h-[20px]',
|
|
3396
3374
|
trackBorder: 'border-2',
|
|
3397
3375
|
knobSize: 'size-[12px]',
|
|
3398
3376
|
knobInset: 'mx-[4px]',
|
|
3399
|
-
labelClass: 'text-size-sm',
|
|
3377
|
+
labelClass: 'text-size-sm font-normal',
|
|
3400
3378
|
},
|
|
3401
3379
|
tn: {
|
|
3402
3380
|
containerSize: 'w-[22.4px] h-[14px]',
|
|
3403
3381
|
trackBorder: 'border-[1.5px]',
|
|
3404
3382
|
knobSize: 'size-[8.4px]',
|
|
3405
3383
|
knobInset: 'mx-[2.8px]',
|
|
3406
|
-
labelClass: 'text-size-sm',
|
|
3384
|
+
labelClass: 'text-size-sm font-normal',
|
|
3407
3385
|
},
|
|
3408
3386
|
};
|
|
3409
3387
|
|
|
@@ -3416,7 +3394,7 @@ function Toggle(_a) {
|
|
|
3416
3394
|
React.createElement("div", { className: "relative flex flex-shrink-0 cursor-pointer items-center rounded-full ".concat(containerClass), onClick: onClick },
|
|
3417
3395
|
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "checkbox peer absolute h-full w-full cursor-pointer appearance-none rounded-full 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-visible:ring-1 focus-visible:ring-bia-blue focus-visible: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 ".concat(trackBorder), type: "checkbox" }),
|
|
3418
3396
|
React.createElement("div", { className: "check-icon group peer z-10 flex-shrink-0 rounded-full bg-bia-grey text-bia-grey 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:bg-bia-grey-dark-10 peer-disabled:peer-checked:bg-bia-blue-light-90 ".concat(knobSize, " ").concat(knobInset) })),
|
|
3419
|
-
React.createElement("label", { htmlFor: id, className: "ml-2
|
|
3397
|
+
React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 text-bia-black ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
|
|
3420
3398
|
}
|
|
3421
3399
|
|
|
3422
3400
|
var isSelectedConfig = {
|
|
@@ -3540,6 +3518,10 @@ var checkDateEquals = function (date1, date2) {
|
|
|
3540
3518
|
date1.getMonth() === date2.getMonth() &&
|
|
3541
3519
|
date1.getDate() === date2.getDate());
|
|
3542
3520
|
};
|
|
3521
|
+
// Sortable number for the calendar day only, so the time of day is ignored.
|
|
3522
|
+
var getDayKey = function (date) {
|
|
3523
|
+
return date.getFullYear() * 10000 + date.getMonth() * 100 + date.getDate();
|
|
3524
|
+
};
|
|
3543
3525
|
var checkIsValidDate = function (dateString) {
|
|
3544
3526
|
var regex = /^\d{4}-\d{2}-\d{2}$/;
|
|
3545
3527
|
if (!regex.test(dateString)) {
|
|
@@ -3583,8 +3565,13 @@ var areMonthsAdjacent = function (leftMonth, leftYear, rightMonth, rightYear) {
|
|
|
3583
3565
|
function DateDisplay(_a) {
|
|
3584
3566
|
var displayDays = _a.displayDays, viewMonthValue = _a.viewMonthValue, selectedDate = _a.selectedDate, onDateSelect = _a.onDateSelect, minDateValue = _a.minDateValue, maxDateValue = _a.maxDateValue;
|
|
3585
3567
|
var isRangeMode = Array.isArray(selectedDate) && selectedDate.length === 2;
|
|
3586
|
-
var
|
|
3587
|
-
var
|
|
3568
|
+
var firstRangeDate = isRangeMode && (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate[0]) ? new Date(selectedDate[0]) : null;
|
|
3569
|
+
var secondRangeDate = isRangeMode && (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate[1]) ? new Date(selectedDate[1]) : null;
|
|
3570
|
+
var isReversedRange = !!firstRangeDate &&
|
|
3571
|
+
!!secondRangeDate &&
|
|
3572
|
+
getDayKey(firstRangeDate) > getDayKey(secondRangeDate);
|
|
3573
|
+
var startRangeDate = isReversedRange ? secondRangeDate : firstRangeDate;
|
|
3574
|
+
var endRangeDate = isReversedRange ? firstRangeDate : secondRangeDate;
|
|
3588
3575
|
return (React.createElement("div", null,
|
|
3589
3576
|
React.createElement("div", { className: "bianic-datepicker-calendar-days-grid-header grid grid-cols-7 gap-[3px] pb-1.5" }, DAYS_MAP.map(function (day) { return (React.createElement("div", { key: day, className: "bianic-datepicker-calendar-day flex h-[18px] w-[31px] items-center justify-center" },
|
|
3590
3577
|
React.createElement(Text, { variant: "small-text", extended: "text-bia-coolgrey" }, day.slice(0, 3)))); })),
|
|
@@ -3601,28 +3588,23 @@ function DateDisplay(_a) {
|
|
|
3601
3588
|
: checkDateEquals(date, new Date(selectedDate));
|
|
3602
3589
|
}
|
|
3603
3590
|
var isBetween = isRangeMode && startRangeDate && endRangeDate
|
|
3604
|
-
? (
|
|
3605
|
-
|
|
3606
|
-
var end = endRangeDate;
|
|
3607
|
-
if (start > end) {
|
|
3608
|
-
var t = start;
|
|
3609
|
-
start = end;
|
|
3610
|
-
end = t;
|
|
3611
|
-
}
|
|
3612
|
-
return date > start && date < end;
|
|
3613
|
-
})()
|
|
3591
|
+
? getDayKey(date) > getDayKey(startRangeDate) &&
|
|
3592
|
+
getDayKey(date) < getDayKey(endRangeDate)
|
|
3614
3593
|
: false;
|
|
3615
3594
|
var isToday = checkDateEquals(date, new Date(TODAY_VALUE));
|
|
3616
3595
|
var customClassname = 'w-[31px] rounded-full';
|
|
3617
3596
|
if (isRangeMode && (isBetween || isStartRange || isEndRange)) {
|
|
3618
|
-
if (
|
|
3597
|
+
if (isStartRange && isEndRange) {
|
|
3598
|
+
customClassname = 'w-[31px] rounded-full';
|
|
3599
|
+
}
|
|
3600
|
+
else if (isBetween) {
|
|
3619
3601
|
customClassname = 'w-full';
|
|
3620
3602
|
}
|
|
3621
3603
|
else if (isStartRange) {
|
|
3622
3604
|
customClassname = 'w-full rounded-l-full';
|
|
3623
3605
|
}
|
|
3624
3606
|
else {
|
|
3625
|
-
customClassname = 'rounded-r-full';
|
|
3607
|
+
customClassname = 'w-full rounded-r-full';
|
|
3626
3608
|
}
|
|
3627
3609
|
}
|
|
3628
3610
|
var dayStateClass = 'hover:bg-bia-blue-pastel';
|
|
@@ -4923,10 +4905,21 @@ var sizeConfig$2 = {
|
|
|
4923
4905
|
'form-md': 'min-h-[40px] h-fit whitespace-nowrap px-2.5 py-[9.5px]',
|
|
4924
4906
|
};
|
|
4925
4907
|
|
|
4908
|
+
var colorUnion = ['yellow', 'blue', 'grey', 'white', 'custom'];
|
|
4926
4909
|
function InfoPanel(_a) {
|
|
4927
|
-
var _b = _a.variant, variant = _b === void 0 ? 'container' : _b, _c = _a.color, color = _c === void 0 ? 'yellow' : _c, _d = _a.className, className =
|
|
4910
|
+
var _b = _a.variant, variant = _b === void 0 ? 'container' : _b, _c = _a.color, color = _c === void 0 ? 'yellow' : _c, _d = _a.bgColor, bgColor = _d === void 0 ? undefined : _d, _e = _a.textColor, textColor = _e === void 0 ? undefined : _e, _f = _a.outlineColor, outlineColor = _f === void 0 ? undefined : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.children, children = _h === void 0 ? null : _h;
|
|
4928
4911
|
var sizeClass = sizeConfig$2[variant || 'container'];
|
|
4929
|
-
var
|
|
4912
|
+
var validColor = validUnion(color, colorUnion);
|
|
4913
|
+
var presetColor = validColor === 'custom' ? 'yellow' : validColor;
|
|
4914
|
+
var colorClass = validColor === 'custom' && bgColor
|
|
4915
|
+
? [
|
|
4916
|
+
"bg-bia-".concat(bgColor),
|
|
4917
|
+
textColor && "text-bia-".concat(textColor),
|
|
4918
|
+
outlineColor && "border border-bia-".concat(outlineColor),
|
|
4919
|
+
]
|
|
4920
|
+
.filter(Boolean)
|
|
4921
|
+
.join(' ')
|
|
4922
|
+
: colorConfig[presetColor];
|
|
4930
4923
|
var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
|
|
4931
4924
|
return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) }, children));
|
|
4932
4925
|
}
|
|
@@ -5487,6 +5480,24 @@ function SidebarItemInner(_a, ref) {
|
|
|
5487
5480
|
: child;
|
|
5488
5481
|
});
|
|
5489
5482
|
};
|
|
5483
|
+
// Leaf items (no children of their own) are the only ones that can be picked.
|
|
5484
|
+
var collectLeafItems = function (nodes) {
|
|
5485
|
+
return React.Children.toArray(nodes)
|
|
5486
|
+
.filter(isSidebarItemElement)
|
|
5487
|
+
.flatMap(function (node) {
|
|
5488
|
+
return React.Children.toArray(node.props.children).some(isSidebarItemElement)
|
|
5489
|
+
? collectLeafItems(node.props.children)
|
|
5490
|
+
: [node];
|
|
5491
|
+
});
|
|
5492
|
+
};
|
|
5493
|
+
var handleDropdownItemClick = function (value) {
|
|
5494
|
+
var _a, _b;
|
|
5495
|
+
var picked = collectLeafItems(children).find(function (leaf) { return leaf.props.id !== undefined && leaf.props.id === value; });
|
|
5496
|
+
if (!picked)
|
|
5497
|
+
return;
|
|
5498
|
+
(_b = (_a = picked.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
5499
|
+
setActiveId(picked.props.id);
|
|
5500
|
+
};
|
|
5490
5501
|
var renderDropdownItems = function () {
|
|
5491
5502
|
return childrenArray.filter(isSidebarItemElement).map(function (child) {
|
|
5492
5503
|
var _a, _b, _c;
|
|
@@ -5494,12 +5505,12 @@ function SidebarItemInner(_a, ref) {
|
|
|
5494
5505
|
var childNotificationCount = grandChildren.length > 0
|
|
5495
5506
|
? sumNotificationCounts(child.props.children)
|
|
5496
5507
|
: ((_a = child.props.notificationCount) !== null && _a !== void 0 ? _a : 0);
|
|
5497
|
-
return (React.createElement(DropdownItem, { key: (_b = child.props.id) !== null && _b !== void 0 ? _b : String((_c = child.key) !== null && _c !== void 0 ? _c : ''), content: React.createElement("div", { className: "relative" },
|
|
5508
|
+
return (React.createElement(DropdownItem, { key: (_b = child.props.id) !== null && _b !== void 0 ? _b : String((_c = child.key) !== null && _c !== void 0 ? _c : ''), value: child.props.id, disabled: child.props.disabled, content: React.createElement("div", { className: "relative" },
|
|
5498
5509
|
child.props.title,
|
|
5499
5510
|
isMinimized && childNotificationCount > 0 && (React.createElement("div", { className: "absolute -right-[8px] top-[2px] h-[6px] w-[6px] rounded-radius-full ".concat(colorClass) }))) }, grandChildren.length > 0 &&
|
|
5500
5511
|
grandChildren.map(function (grandChild) {
|
|
5501
5512
|
var _a, _b;
|
|
5502
|
-
return (React.createElement(DropdownItem, { key: (_a = grandChild.props.id) !== null && _a !== void 0 ? _a : String((_b = grandChild.key) !== null && _b !== void 0 ? _b : ''), content: React.createElement("div", { className: "flex justify-between gap-x-[11px]" },
|
|
5513
|
+
return (React.createElement(DropdownItem, { key: (_a = grandChild.props.id) !== null && _a !== void 0 ? _a : String((_b = grandChild.key) !== null && _b !== void 0 ? _b : ''), value: grandChild.props.id, disabled: grandChild.props.disabled, content: React.createElement("div", { className: "flex justify-between gap-x-[11px]" },
|
|
5503
5514
|
grandChild.props.title,
|
|
5504
5515
|
grandChild.props.notificationCount ? (React.createElement(TagLabel, { text: String(grandChild.props.notificationCount), color: "custom", bgColor: color, textColor: "white", size: "tn" })) : null) }));
|
|
5505
5516
|
})));
|
|
@@ -5540,7 +5551,7 @@ function SidebarItemInner(_a, ref) {
|
|
|
5540
5551
|
isActive && (React.createElement("div", { className: "absolute right-0 ml-auto h-full w-1 rounded-l-radius-md bg-bia-white" }))),
|
|
5541
5552
|
!isMinimized && hasChildren && isChildExpanded && renderChildren(),
|
|
5542
5553
|
React.createElement("div", { className: "dropdown-anchor absolute left-[60px] top-0", ref: childDropdownRef }),
|
|
5543
|
-
isMinimized && hasChildren && (React.createElement(DropdownContainer, { open: isChildExpanded, onClose: function () { return setIsChildExpanded(false); }, anchorRef: childDropdownRef }, renderDropdownItems()))));
|
|
5554
|
+
isMinimized && hasChildren && (React.createElement(DropdownContainer, { open: isChildExpanded, onClose: function () { return setIsChildExpanded(false); }, anchorRef: childDropdownRef, onClickItem: function (_, value) { return handleDropdownItemClick(value); } }, renderDropdownItems()))));
|
|
5544
5555
|
}
|
|
5545
5556
|
var SidebarItem = React.forwardRef(SidebarItemInner);
|
|
5546
5557
|
SidebarItem.displayName = 'SidebarItem';
|
|
@@ -5837,13 +5848,18 @@ var headTextConfig = {
|
|
|
5837
5848
|
tn: 'text-size-sm font-semibold font-segoe',
|
|
5838
5849
|
};
|
|
5839
5850
|
|
|
5851
|
+
var verticalAlignConfig = {
|
|
5852
|
+
top: 'align-top',
|
|
5853
|
+
middle: 'align-middle',
|
|
5854
|
+
bottom: 'align-bottom',
|
|
5855
|
+
};
|
|
5840
5856
|
function TableCell(_a) {
|
|
5841
|
-
var _b = _a.variant, variant = _b === void 0 ? 'body' : _b, className = _a.className, children = _a.children, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.lined, lined = _d === void 0 ? false : _d, _e = _a.bgColor, bgColor = _e === void 0 ? '' : _e, props = __rest(_a, ["variant", "className", "children", "size", "lined", "bgColor"]);
|
|
5857
|
+
var _b = _a.variant, variant = _b === void 0 ? 'body' : _b, className = _a.className, children = _a.children, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.lined, lined = _d === void 0 ? false : _d, _e = _a.bgColor, bgColor = _e === void 0 ? '' : _e, _f = _a.verticalAlign, verticalAlign = _f === void 0 ? 'top' : _f, props = __rest(_a, ["variant", "className", "children", "size", "lined", "bgColor", "verticalAlign"]);
|
|
5842
5858
|
var bottomLined = lined ? 'border-b border-bia-grey' : '';
|
|
5843
5859
|
var bgColorClass = "bg-bia-".concat(bgColor);
|
|
5844
5860
|
var isHead = variant === 'head';
|
|
5845
5861
|
var textConfig = isHead ? headTextConfig[size] : bodyTextConfig[size];
|
|
5846
|
-
var columnClass = "p-0 ".concat(sizeConfig[size], " ").concat(bottomLined, " ").concat(bgColorClass, " ").concat(textConfig, " ").concat(className);
|
|
5862
|
+
var columnClass = "p-0 h-[30px] ".concat(verticalAlignConfig[verticalAlign], " ").concat(sizeConfig[size], " ").concat(bottomLined, " ").concat(bgColorClass, " ").concat(textConfig, " ").concat(className);
|
|
5847
5863
|
if (variant === 'head') {
|
|
5848
5864
|
return (React.createElement("th", __assign({ className: "bianic-table-cell table-head bg-bia-grey-light-80 ".concat(columnClass) }, props), children));
|
|
5849
5865
|
}
|
|
@@ -9305,34 +9321,12 @@ var navbarItemConfig = {
|
|
|
9305
9321
|
disabled: 'cursor-not-allowed',
|
|
9306
9322
|
};
|
|
9307
9323
|
var navbarCircleConfig = {
|
|
9324
|
+
filledBase: 'bg-bia-white border-bia-white',
|
|
9308
9325
|
currentDefault: 'bg-bia-white border-bia-white text-bia-black',
|
|
9309
9326
|
other: 'border-bia-white text-bia-white',
|
|
9310
9327
|
disabled: 'border-bia-white-transparent-40 text-bia-white-transparent-40',
|
|
9311
9328
|
};
|
|
9312
|
-
var
|
|
9313
|
-
blue: 'bg-bia-blue border-bia-blue text-bia-white',
|
|
9314
|
-
green: 'bg-bia-green border-bia-green text-bia-white',
|
|
9315
|
-
teal: 'bg-bia-teal border-bia-teal text-bia-white',
|
|
9316
|
-
crayola: 'bg-bia-crayola border-bia-crayola text-bia-white',
|
|
9317
|
-
orange: 'bg-bia-orange border-bia-orange text-bia-white',
|
|
9318
|
-
red: 'bg-bia-red border-bia-red text-bia-white',
|
|
9319
|
-
};
|
|
9320
|
-
var navbarProcessedColorConfig = {
|
|
9321
|
-
blue: 'border-bia-blue text-bia-white',
|
|
9322
|
-
green: 'border-bia-green text-bia-white',
|
|
9323
|
-
teal: 'border-bia-teal text-bia-white',
|
|
9324
|
-
crayola: 'border-bia-crayola text-bia-white',
|
|
9325
|
-
orange: 'border-bia-orange text-bia-white',
|
|
9326
|
-
red: 'border-bia-red text-bia-white',
|
|
9327
|
-
};
|
|
9328
|
-
var navbarProcessedFilledColorConfig = {
|
|
9329
|
-
blue: 'bg-bia-blue border-bia-blue text-bia-white',
|
|
9330
|
-
green: 'bg-bia-green border-bia-green text-bia-white',
|
|
9331
|
-
teal: 'bg-bia-teal border-bia-teal text-bia-white',
|
|
9332
|
-
crayola: 'bg-bia-crayola border-bia-crayola text-bia-white',
|
|
9333
|
-
orange: 'bg-bia-orange border-bia-orange text-bia-white',
|
|
9334
|
-
red: 'bg-bia-red border-bia-red text-bia-white',
|
|
9335
|
-
};
|
|
9329
|
+
var BIA_COLOR_NAME = /^(?:(?:white|black)(?:-transparent-(?:[1-9]0|75))?|(?:red|yellow|green|teal|blue|grey|coolgrey|pink|sky|orange|crayola|verdantgreen|margueriteblue|brown)(?:-(?:hover|active|disabled|pastel|(?:light|dark)-[1-9]0))?|purple(?:-(?:hover|active|disabled|pastel))?)$/;
|
|
9336
9330
|
var navbarLabelConfig = {
|
|
9337
9331
|
enabled: 'whitespace-nowrap leading-4 text-bia-white',
|
|
9338
9332
|
disabled: 'whitespace-nowrap leading-4 text-bia-white-transparent-40',
|
|
@@ -9342,14 +9336,6 @@ var navbarChevronConfig = {
|
|
|
9342
9336
|
disabled: 'shrink-0 text-bia-white-transparent-40',
|
|
9343
9337
|
};
|
|
9344
9338
|
|
|
9345
|
-
var NAVBAR_COLORS = [
|
|
9346
|
-
'blue',
|
|
9347
|
-
'green',
|
|
9348
|
-
'teal',
|
|
9349
|
-
'crayola',
|
|
9350
|
-
'orange',
|
|
9351
|
-
'red',
|
|
9352
|
-
];
|
|
9353
9339
|
var circleTextColor = function (circleClass) { var _a, _b; return (_b = (_a = circleClass.match(/text-bia-\S+/)) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : ''; };
|
|
9354
9340
|
function resolveItemState(isCurrent, isDisabled, isClickable) {
|
|
9355
9341
|
if (isCurrent)
|
|
@@ -9360,18 +9346,14 @@ function resolveItemState(isCurrent, isDisabled, isClickable) {
|
|
|
9360
9346
|
return 'clickable';
|
|
9361
9347
|
return 'static';
|
|
9362
9348
|
}
|
|
9363
|
-
function resolveCircleClass(isCurrent, isDisabled,
|
|
9349
|
+
function resolveCircleClass(isCurrent, isDisabled, isProcessed, color) {
|
|
9364
9350
|
if (isDisabled)
|
|
9365
9351
|
return navbarCircleConfig.disabled;
|
|
9366
|
-
if (isCurrent ||
|
|
9367
|
-
if (
|
|
9368
|
-
return
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
if (isProcessed && navColor) {
|
|
9372
|
-
if (processedIcon)
|
|
9373
|
-
return navbarProcessedFilledColorConfig[navColor];
|
|
9374
|
-
return navbarProcessedColorConfig[navColor];
|
|
9352
|
+
if (isCurrent || isProcessed) {
|
|
9353
|
+
if (typeof color !== 'string' || !BIA_COLOR_NAME.test(color)) {
|
|
9354
|
+
return navbarCircleConfig.currentDefault;
|
|
9355
|
+
}
|
|
9356
|
+
return "".concat(navbarCircleConfig.filledBase, " text-bia-").concat(color);
|
|
9375
9357
|
}
|
|
9376
9358
|
return navbarCircleConfig.other;
|
|
9377
9359
|
}
|
|
@@ -9390,10 +9372,6 @@ function NavbarHorizontalStepper(_a) {
|
|
|
9390
9372
|
_a.size;
|
|
9391
9373
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9392
9374
|
_a.showLabels;
|
|
9393
|
-
// size and showLabels are accepted for API parity, ignored on navbar
|
|
9394
|
-
var navColor = color === undefined
|
|
9395
|
-
? undefined
|
|
9396
|
-
: validUnion(color, NAVBAR_COLORS);
|
|
9397
9375
|
return (React.createElement("nav", { "aria-label": "Progress", className: cn$1('flex', className) },
|
|
9398
9376
|
React.createElement("ol", { className: "flex items-center" }, steps.map(function (step, index) {
|
|
9399
9377
|
var _a;
|
|
@@ -9403,7 +9381,7 @@ function NavbarHorizontalStepper(_a) {
|
|
|
9403
9381
|
var isClickable = !isCurrent && !isDisabled && Boolean(onStepClick);
|
|
9404
9382
|
var itemState = resolveItemState(isCurrent, isDisabled, isClickable);
|
|
9405
9383
|
var itemClass = cn$1('flex h-6 items-center gap-[5px] px-[5px] py-[3px]', !isCurrent && 'rounded-radius-sm', navbarItemConfig[itemState]);
|
|
9406
|
-
var circleClass = resolveCircleClass(isCurrent, isDisabled,
|
|
9384
|
+
var circleClass = resolveCircleClass(isCurrent, isDisabled, isProcessed, color);
|
|
9407
9385
|
var labelClass = isDisabled
|
|
9408
9386
|
? navbarLabelConfig.disabled
|
|
9409
9387
|
: navbarLabelConfig.enabled;
|
|
@@ -9774,7 +9752,6 @@ exports.DropdownContainer = DropdownContainer;
|
|
|
9774
9752
|
exports.DropdownItem = DropdownItem;
|
|
9775
9753
|
exports.DropzoneFileUploader = DropzoneFileUploader;
|
|
9776
9754
|
exports.EmptyTable = EmptyTable;
|
|
9777
|
-
exports.FileTree = FileTree;
|
|
9778
9755
|
exports.FormGroup = FormGroup;
|
|
9779
9756
|
exports.FormGroupButton = FormGroupButton;
|
|
9780
9757
|
exports.FormGroupLabel = FormGroupLabel;
|
|
@@ -9826,7 +9803,7 @@ exports.TextInput = TextInput;
|
|
|
9826
9803
|
exports.Toaster = Toaster;
|
|
9827
9804
|
exports.Toggle = Toggle;
|
|
9828
9805
|
exports.Tooltip = Tooltip;
|
|
9829
|
-
exports.TreeItem = TreeItem;
|
|
9806
|
+
exports.TreeItem = TreeItem$1;
|
|
9830
9807
|
exports.VerticalStepper = StepperItem;
|
|
9831
9808
|
exports.Window = Window;
|
|
9832
9809
|
exports.YearPicker = YearPicker;
|