bianic-ui 1.13.2 → 1.14.1
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 +248 -301
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Forms/DatePicker/DatePicker.d.ts +10 -3
- package/dist/cjs/types/components/Forms/DatePicker/PickerCalendar.d.ts +1 -1
- package/dist/cjs/types/components/Forms/DatePicker/index.d.ts +1 -0
- package/dist/cjs/types/components/Forms/FormLabel.d.ts +18 -0
- package/dist/cjs/types/components/InfoPanel/config.d.ts +12 -0
- package/dist/cjs/types/components/InfoPanel/index.d.ts +17 -0
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/esm/index.js +248 -302
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Forms/DatePicker/DatePicker.d.ts +10 -3
- package/dist/esm/types/components/Forms/DatePicker/PickerCalendar.d.ts +1 -1
- package/dist/esm/types/components/Forms/DatePicker/index.d.ts +1 -0
- package/dist/esm/types/components/Forms/FormLabel.d.ts +18 -0
- package/dist/esm/types/components/InfoPanel/config.d.ts +12 -0
- package/dist/esm/types/components/InfoPanel/index.d.ts +17 -0
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/index.d.ts +27 -4
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -271,12 +271,9 @@ var useDetectOutsideClick = function (ref, initialState, ignoreRef, event) {
|
|
|
271
271
|
// If the active element exists and is clicked outside of
|
|
272
272
|
if (ignoreRef &&
|
|
273
273
|
ignoreRef.current &&
|
|
274
|
-
ignoreRef.current.contains(event.target))
|
|
275
|
-
console.log('enter');
|
|
276
|
-
}
|
|
274
|
+
ignoreRef.current.contains(event.target)) ;
|
|
277
275
|
else if (ref.current !== null &&
|
|
278
276
|
!ref.current.contains(event.target)) {
|
|
279
|
-
console.log('close');
|
|
280
277
|
setIsActive(!isActive);
|
|
281
278
|
}
|
|
282
279
|
};
|
|
@@ -424,7 +421,7 @@ var radiusConfig$1 = {
|
|
|
424
421
|
tn: 'rounded-radius-full focus-visible:rounded-radius-full',
|
|
425
422
|
},
|
|
426
423
|
};
|
|
427
|
-
var sizeConfig$
|
|
424
|
+
var sizeConfig$d = {
|
|
428
425
|
lg: 'py-[10.5px] h-[48px] flex items-center justify-center gap-[10px] text-size-md ',
|
|
429
426
|
md: 'py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base ',
|
|
430
427
|
sm: 'py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm ',
|
|
@@ -443,10 +440,10 @@ var minWidthConfig$1 = {
|
|
|
443
440
|
tn: 'min-w-[64px]',
|
|
444
441
|
};
|
|
445
442
|
var iconOnlySizeConfig$1 = {
|
|
446
|
-
lg: 'py-[13px] flex items-center justify-center gap-[10px]',
|
|
447
|
-
md: 'py-[11px] flex items-center justify-center gap-[5px]',
|
|
448
|
-
sm: 'py-[8px] flex items-center justify-center gap-[5px] ',
|
|
449
|
-
tn: 'py-[4px] flex items-center justify-center gap-[3px]',
|
|
443
|
+
lg: 'py-[13px] h-[48px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
444
|
+
md: 'py-[11px] h-[40px] w-[40px] flex items-center justify-center gap-[5px]',
|
|
445
|
+
sm: 'py-[8px] h-[30px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
446
|
+
tn: 'py-[4px] h-[22px] h-[22px] flex items-center justify-center gap-[3px]',
|
|
450
447
|
};
|
|
451
448
|
var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
|
|
452
449
|
var variantConfig$2 = {
|
|
@@ -462,7 +459,7 @@ var variantConfig$2 = {
|
|
|
462
459
|
'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",
|
|
463
460
|
'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",
|
|
464
461
|
'info-outlined': "text-bia-teal border-bia-teal bg-primary-white border-solid border active:text-bia-teal-active active:bg-bia-teal-pastel active:border-bia-teal-active active:outline-none disabled:border-[1px]disabled:border-bia-teal-light-50 disabled:text-bia-teal-light-50 hover:text-bia-teal-hover hover:border-bia-teal-hover focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-teal-light-50 focus-visible:border-none",
|
|
465
|
-
'success-outlined': "text-bia-green bg-primary-white bg-primary-white border-solid border border-bia-
|
|
462
|
+
'success-outlined': "text-bia-green bg-primary-white bg-primary-white border-solid border border-bia-green active:text-bia-green-active active:bg-bia-green-pastel active:border-bia-green-active hover:text-bia-green-hover hover:border-bia-green-hover disabled:border-[1px] disabled:border-bia-green-light-50 disabled:text-bia-green-light-50 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-green-light-50 focus-visible:border-none ",
|
|
466
463
|
'warning-outlined': "text-bia-orange bg-primary-white border-solid border border-bia-orange active:text-bia-orange-dark-10 active:bg-bia-orange-light-90 active:border-bia-orange-active active:outline-none hover:text-bia-orange-hover hover:border-bia-orange-hover disabled:border-[1px]disabled:border-bia-orange-light-50 disabled:text-bia-orange-light-50 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-orange-light-50 focus-visible:border-none",
|
|
467
464
|
'danger-outlined': "text-bia-red border-solid border border-bia-red bg-primary-white active:text-bia-red-dark-10 active:border-bia-red-active active:bg-bia-red-light-90 active:border-bia-red-disabled hover:text-bia-red-hover hover:border-bia-red-hover disabled:border-[1px]disabled:border-bia-red-light-50 disabled:text-bia-red-light-50 focus-visible:outline-none focus-visible:outline-offset-0 focus-visible:outline-[3px] focus-visible:rounded-md focus-visible:outline-bia-red-light-50 focus-visible:border-none \n ",
|
|
468
465
|
'form-group': "text-bia-black border-solid border border-bia-grey-dark-10 bg-bia-white active:bg-bia-grey-light-20 hover:bg-bia-grey-light-80 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-grey-dark-10 focus-visible:border-none \n ",
|
|
@@ -502,10 +499,10 @@ function Button(_a) {
|
|
|
502
499
|
}
|
|
503
500
|
var sizingRules;
|
|
504
501
|
if (variant.includes('link')) {
|
|
505
|
-
sizingRules = "".concat(sizeConfig$
|
|
502
|
+
sizingRules = "".concat(sizeConfig$d[validatedSize]);
|
|
506
503
|
}
|
|
507
504
|
else {
|
|
508
|
-
sizingRules = "".concat(sizeConfig$
|
|
505
|
+
sizingRules = "".concat(sizeConfig$d[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
|
|
509
506
|
}
|
|
510
507
|
var sizeClass = label || variant === 'form-group'
|
|
511
508
|
? " ".concat(minWidthRules, " ").concat(sizingRules)
|
|
@@ -1487,7 +1484,7 @@ Breadcrumb.defaultProps = {
|
|
|
1487
1484
|
selected: false,
|
|
1488
1485
|
};
|
|
1489
1486
|
|
|
1490
|
-
var colorConfig$
|
|
1487
|
+
var colorConfig$2 = {
|
|
1491
1488
|
green: {
|
|
1492
1489
|
default: 'bg-bia-verdantgreen-dark-20 hover:bg-bia-verdantgreen-dark-10 active:bg-bia-verdantgreen-dark-40 text-primary-white disabled:bg-bia-verdantgreen-dark-20 disabled:text-primary-white/50 disabled:cursor-default',
|
|
1493
1490
|
active: 'bg-bia-verdantgreen-dark-40 text-primary-white',
|
|
@@ -1501,7 +1498,7 @@ var colorConfig$1 = {
|
|
|
1501
1498
|
var ButtonApp = function (_a) {
|
|
1502
1499
|
_a.icon; _a.isNotified; var _c = _a.isActive, isActive = _c === void 0 ? false : _c, disabled = _a.disabled, _d = _a.color, color = _d === void 0 ? 'green' : _d, label = _a.label, extended = _a.extended, rest = __rest(_a, ["icon", "isNotified", "isActive", "disabled", "color", "label", "extended"]);
|
|
1503
1500
|
var buttonState = isActive ? 'active' : 'default';
|
|
1504
|
-
return (React.createElement("button", __assign({ className: "button-app flex items-center justify-center px-[10px] pb-[8.3px] pt-[8.5px] font-arial text-size-tiny ".concat(colorConfig$
|
|
1501
|
+
return (React.createElement("button", __assign({ className: "button-app flex items-center justify-center px-[10px] pb-[8.3px] pt-[8.5px] font-arial text-size-tiny ".concat(colorConfig$2[color][buttonState], " ").concat(extended), type: "button", disabled: disabled }, rest), label));
|
|
1505
1502
|
};
|
|
1506
1503
|
|
|
1507
1504
|
var textColorConfig = {
|
|
@@ -1791,7 +1788,147 @@ MenuItem.defaultProps = {
|
|
|
1791
1788
|
onClick: function () { },
|
|
1792
1789
|
};
|
|
1793
1790
|
|
|
1794
|
-
var
|
|
1791
|
+
var classConfig$1 = {
|
|
1792
|
+
top: {
|
|
1793
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
1794
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1795
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1796
|
+
},
|
|
1797
|
+
right: {
|
|
1798
|
+
tooltipContainer: 'left-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
1799
|
+
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
1800
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
1801
|
+
},
|
|
1802
|
+
bottom: {
|
|
1803
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
1804
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1805
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1806
|
+
},
|
|
1807
|
+
left: {
|
|
1808
|
+
tooltipContainer: 'right-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
1809
|
+
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
1810
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
1811
|
+
},
|
|
1812
|
+
'top-right': {
|
|
1813
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] right-0',
|
|
1814
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1815
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1816
|
+
},
|
|
1817
|
+
'top-left': {
|
|
1818
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-0',
|
|
1819
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1820
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1821
|
+
},
|
|
1822
|
+
'bottom-right': {
|
|
1823
|
+
tooltipContainer: 'top-[calc(100%+5px)] right-0',
|
|
1824
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1825
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1826
|
+
},
|
|
1827
|
+
'bottom-left': {
|
|
1828
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-0',
|
|
1829
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1830
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1831
|
+
},
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1834
|
+
function Tooltip(props) {
|
|
1835
|
+
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;
|
|
1836
|
+
var timeout;
|
|
1837
|
+
var _c = useState(false), active = _c[0], setActive = _c[1];
|
|
1838
|
+
var showTip = function () {
|
|
1839
|
+
timeout = setTimeout(function () {
|
|
1840
|
+
setActive(true);
|
|
1841
|
+
}, delay || 400);
|
|
1842
|
+
};
|
|
1843
|
+
var hideTip = function () {
|
|
1844
|
+
clearInterval(timeout);
|
|
1845
|
+
setActive(false);
|
|
1846
|
+
};
|
|
1847
|
+
var _d = classConfig$1[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
|
|
1848
|
+
var tooltipContainerRef = useRef(null);
|
|
1849
|
+
var _e = useState({
|
|
1850
|
+
maxWidth: maxWidth + 'px',
|
|
1851
|
+
whiteSpace: 'nowrap',
|
|
1852
|
+
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
1853
|
+
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
1854
|
+
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
1855
|
+
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
1856
|
+
var offsetHeight = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetHeight;
|
|
1857
|
+
useEffect(function () {
|
|
1858
|
+
if (scrollWidth && offsetWidth) {
|
|
1859
|
+
var maxWidthNumber = Number(maxWidth);
|
|
1860
|
+
var isMultiLine = offsetHeight > 23; // 23 pixels is the approximate height of one line of text
|
|
1861
|
+
// Tooltip Width and Whitespace Determination Rules:
|
|
1862
|
+
// 1. Default Condition:
|
|
1863
|
+
// - width: fit-content
|
|
1864
|
+
// - whiteSpace: nowrap
|
|
1865
|
+
// 2. When maxWidth is Set:
|
|
1866
|
+
// * Text Exceeds maxWidth:
|
|
1867
|
+
// - width: maxWidth
|
|
1868
|
+
// - whiteSpace: normal
|
|
1869
|
+
// * Text Equals maxWidth (Multi-line):
|
|
1870
|
+
// - width: maxWidth
|
|
1871
|
+
// - whiteSpace: normal
|
|
1872
|
+
// * Text Less Than maxWidth:
|
|
1873
|
+
// - width: fit-content
|
|
1874
|
+
// - whiteSpace: nowrap
|
|
1875
|
+
var newWidth_1 = 'fit-content';
|
|
1876
|
+
var newWhiteSpace_1 = 'nowrap';
|
|
1877
|
+
if (scrollWidth > maxWidthNumber ||
|
|
1878
|
+
(offsetWidth === maxWidthNumber && isMultiLine)) {
|
|
1879
|
+
newWidth_1 = maxWidthNumber + 'px';
|
|
1880
|
+
newWhiteSpace_1 = 'normal';
|
|
1881
|
+
}
|
|
1882
|
+
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
1883
|
+
}
|
|
1884
|
+
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
1885
|
+
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip },
|
|
1886
|
+
children,
|
|
1887
|
+
active && (React.createElement("div", { className: "tooltip-container break-word absolute z-50 inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(tooltipContainer), style: tooltipContainerStyle, ref: tooltipContainerRef }, content))));
|
|
1888
|
+
}
|
|
1889
|
+
Tooltip.defaultProps = {
|
|
1890
|
+
delay: 400,
|
|
1891
|
+
direction: 'top',
|
|
1892
|
+
maxWidth: '300',
|
|
1893
|
+
};
|
|
1894
|
+
Tooltip.defaultProps = {};
|
|
1895
|
+
|
|
1896
|
+
var FormLabel = function (_a) {
|
|
1897
|
+
var children = _a.children, className = _a.className, htmlFor = _a.htmlFor, readOnly = _a.readOnly, required = _a.required;
|
|
1898
|
+
var labelClass = readOnly ? 'pointer-events-none' : '';
|
|
1899
|
+
return (React.createElement(Tooltip, { content: "Required", delay: 2000, direction: "right" },
|
|
1900
|
+
React.createElement("label", { htmlFor: htmlFor, className: "bianic-form-label group/formlabel text-xs font-semibold ".concat(labelClass, " ").concat(className) },
|
|
1901
|
+
children,
|
|
1902
|
+
required && (React.createElement("span", { className: "p-1 text-bia-coolgrey group-hover/form:text-bia-red group-hover/formlabel:text-bia-red" }, "*")))));
|
|
1903
|
+
};
|
|
1904
|
+
FormLabel.defaultProps = {
|
|
1905
|
+
className: '',
|
|
1906
|
+
htmlFor: undefined,
|
|
1907
|
+
required: false,
|
|
1908
|
+
readOnly: false,
|
|
1909
|
+
};
|
|
1910
|
+
|
|
1911
|
+
function PasswordIcon(_a) {
|
|
1912
|
+
var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, disabled = _a.disabled;
|
|
1913
|
+
var iconColor = disabled ? '#8b8ba6' : '#5E5EEA';
|
|
1914
|
+
if (isShow) {
|
|
1915
|
+
return (React.createElement(TbEye, { onClick: function () { return showHandler(false); }, style: {
|
|
1916
|
+
fontSize: iconSize,
|
|
1917
|
+
color: iconColor,
|
|
1918
|
+
} }));
|
|
1919
|
+
}
|
|
1920
|
+
return (React.createElement(TbEyeOff, { onClick: function () { return showHandler(true); }, style: { fontSize: iconSize, color: iconColor } }));
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
function ValidationIcon(_a) {
|
|
1924
|
+
var isValid = _a.isValid, iconSize = _a.iconSize;
|
|
1925
|
+
if (isValid) {
|
|
1926
|
+
return (React.createElement(TbCheck, { className: "text-bia-green", style: { fontSize: iconSize } }));
|
|
1927
|
+
}
|
|
1928
|
+
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
var sizeConfig$c = {
|
|
1795
1932
|
md: {
|
|
1796
1933
|
fieldSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
1797
1934
|
iconPosition: 'right-[10px]',
|
|
@@ -1826,34 +1963,14 @@ var styleConfig = {
|
|
|
1826
1963
|
},
|
|
1827
1964
|
};
|
|
1828
1965
|
|
|
1829
|
-
function ValidationIcon(_a) {
|
|
1830
|
-
var isValid = _a.isValid, iconSize = _a.iconSize;
|
|
1831
|
-
if (isValid) {
|
|
1832
|
-
return (React.createElement(TbCheck, { className: "text-bia-green", style: { fontSize: iconSize } }));
|
|
1833
|
-
}
|
|
1834
|
-
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
function PasswordIcon(_a) {
|
|
1838
|
-
var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, disabled = _a.disabled;
|
|
1839
|
-
var iconColor = disabled ? '#8b8ba6' : '#5E5EEA';
|
|
1840
|
-
if (isShow) {
|
|
1841
|
-
return (React.createElement(TbEye, { onClick: function () { return showHandler(false); }, style: {
|
|
1842
|
-
fontSize: iconSize,
|
|
1843
|
-
color: iconColor,
|
|
1844
|
-
} }));
|
|
1845
|
-
}
|
|
1846
|
-
return (React.createElement(TbEyeOff, { onClick: function () { return showHandler(true); }, style: { fontSize: iconSize, color: iconColor } }));
|
|
1847
|
-
}
|
|
1848
|
-
|
|
1849
1966
|
function TextInput(_a) {
|
|
1850
1967
|
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? null : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? undefined : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l, _m = _a.maxLength, maxLength = _m === void 0 ? undefined : _m, _o = _a.inputClassName, inputClassName = _o === void 0 ? '' : _o; _a.isFlatRight; var actionElement = _a.actionElement, _q = _a.autoComplete, autoComplete = _q === void 0 ? 'off' : _q, ref = _a.ref, props = __rest(_a, ["descText", "disabled", "icon", "id", "size", "isValid", "label", "placeholder", "readOnly", "required", "variant", "value", "onChange", "maxLength", "inputClassName", "isFlatRight", "actionElement", "autoComplete", "ref"]);
|
|
1851
1968
|
var isTransparent = variant.includes('transparent');
|
|
1852
1969
|
var _r = useState(false), isShow = _r[0], setIsShow = _r[1];
|
|
1853
1970
|
var _s = styleConfig[variant], fieldStyle = _s.fieldStyle, iconStyle = _s.iconStyle;
|
|
1854
1971
|
var _t = isTransparent
|
|
1855
|
-
? __assign(__assign({}, sizeConfig$
|
|
1856
|
-
" pe-[".concat(9 + sizeConfig$
|
|
1972
|
+
? __assign(__assign({}, sizeConfig$c[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$c[size].fieldSize +
|
|
1973
|
+
" pe-[".concat(9 + sizeConfig$c[size].iconSize, "px]") }) : sizeConfig$c[size], iconSize = _t.iconSize, fieldSize = _t.fieldSize, iconPosition = _t.iconPosition;
|
|
1857
1974
|
var borderStyle = isTransparent
|
|
1858
1975
|
? 'border-transparent bg-transparent' // customize border rule for transparent variant
|
|
1859
1976
|
: 'border border-bia-grey-dark-10 bg-primary-white';
|
|
@@ -1886,11 +2003,8 @@ function TextInput(_a) {
|
|
|
1886
2003
|
if (variant === 'date')
|
|
1887
2004
|
iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
|
|
1888
2005
|
var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
label && (React.createElement("label", { htmlFor: id, className: "bianic-text-input-label text-xs font-semibold ".concat(labelStatus) },
|
|
1892
|
-
label,
|
|
1893
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*"))),
|
|
2006
|
+
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" },
|
|
2007
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
1894
2008
|
React.createElement("div", { className: "relative w-full" },
|
|
1895
2009
|
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)),
|
|
1896
2010
|
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(actionElement ? '' : iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
|
|
@@ -1919,7 +2033,7 @@ TextInput.defaultProps = {
|
|
|
1919
2033
|
};
|
|
1920
2034
|
|
|
1921
2035
|
// Desc: Radio button size configuration
|
|
1922
|
-
var sizeConfig$
|
|
2036
|
+
var sizeConfig$b = {
|
|
1923
2037
|
md: {
|
|
1924
2038
|
checkSize: 'w-[22px] h-[22px]',
|
|
1925
2039
|
labelSize: 'text-size-base',
|
|
@@ -1934,7 +2048,7 @@ var sizeUnion$4 = ['md', 'sm'];
|
|
|
1934
2048
|
function Radio(_a) {
|
|
1935
2049
|
var label = _a.label, _b = _a.size, size = _b === void 0 ? 'md' : _b, id = _a.id, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.checked, checked = _e === void 0 ? false : _e;
|
|
1936
2050
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
1937
|
-
var _f = sizeConfig$
|
|
2051
|
+
var _f = sizeConfig$b[validatedSize], checkSize = _f.checkSize, labelSize = _f.labelSize;
|
|
1938
2052
|
return (React.createElement("div", { className: "flex items-center" },
|
|
1939
2053
|
React.createElement("div", { className: "bg-white rounded-full flex flex-shrink-0 justify-center items-center relative ".concat(checkSize) },
|
|
1940
2054
|
React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "peer checkbox box-content appearance-none focus:opacity-100 focus:ring-1 focus:ring-offset-2 checked:disabled:border-bia-blue-disabled focus:ring-bia-blue focus:outline-none rounded-full border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover disabled:border-bia-grey-dark-10 border-2 absolute cursor-pointer w-full h-full", onClick: function (e) { return onClick(e); }, checked: checked, disabled: disabled }),
|
|
@@ -1950,15 +2064,6 @@ Radio.defaultProps = {
|
|
|
1950
2064
|
checked: false,
|
|
1951
2065
|
};
|
|
1952
2066
|
|
|
1953
|
-
var sizeConfig$9 = {
|
|
1954
|
-
md: {
|
|
1955
|
-
inputClass: 'text-size-base font-[350] min-h-10',
|
|
1956
|
-
},
|
|
1957
|
-
sm: {
|
|
1958
|
-
inputClass: 'text-size-sm min-h-[30px]',
|
|
1959
|
-
},
|
|
1960
|
-
};
|
|
1961
|
-
|
|
1962
2067
|
var ResizeIcon = function (_a) {
|
|
1963
2068
|
var className = _a.className;
|
|
1964
2069
|
return (React.createElement("svg", { width: "9", height: "9", viewBox: "0 0 9 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "bianic-resize-icon ".concat(className) },
|
|
@@ -1970,16 +2075,23 @@ var ResizeIcon = function (_a) {
|
|
|
1970
2075
|
React.createElement("line", { y1: "-0.5", x2: "3.77124", y2: "-0.5", transform: "matrix(0.707106 -0.707108 0.707106 0.707108 6.33398 9)", stroke: "black", "stroke-opacity": "0.1" })));
|
|
1971
2076
|
};
|
|
1972
2077
|
|
|
2078
|
+
var sizeConfig$a = {
|
|
2079
|
+
md: {
|
|
2080
|
+
inputClass: 'text-size-base font-[350] min-h-10',
|
|
2081
|
+
},
|
|
2082
|
+
sm: {
|
|
2083
|
+
inputClass: 'text-size-sm min-h-[30px]',
|
|
2084
|
+
},
|
|
2085
|
+
};
|
|
2086
|
+
|
|
1973
2087
|
function TextArea(_a) {
|
|
1974
2088
|
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, _d = _a.placeholder, placeholder = _d === void 0 ? '' : _d, required = _a.required, rows = _a.rows, _e = _a.maxLength, maxLength = _e === void 0 ? undefined : _e, value = _a.value, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, _g = _a.autoComplete, autoComplete = _g === void 0 ? 'off' : _g, props = __rest(_a, ["descText", "disabled", "id", "size", "label", "placeholder", "required", "rows", "maxLength", "value", "readOnly", "autoComplete"]);
|
|
1975
2089
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
1976
|
-
var inputClass = sizeConfig$
|
|
2090
|
+
var inputClass = sizeConfig$a[size].inputClass;
|
|
1977
2091
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
1978
|
-
return (React.createElement("div", { className: "field-group flex w-full flex-col" },
|
|
1979
|
-
React.createElement(
|
|
1980
|
-
|
|
1981
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
1982
|
-
React.createElement("div", { className: "relative h-full w-full min-w-[250px]" },
|
|
2092
|
+
return (React.createElement("div", { className: "field-group group/form flex w-full flex-col gap-y-2" },
|
|
2093
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2094
|
+
React.createElement("div", { className: "relative h-fit w-full min-w-[250px]" },
|
|
1983
2095
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
1984
2096
|
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))),
|
|
1985
2097
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs text-primary-cool" },
|
|
@@ -2003,7 +2115,7 @@ TextArea.defaultProps = {
|
|
|
2003
2115
|
value: '',
|
|
2004
2116
|
};
|
|
2005
2117
|
|
|
2006
|
-
var sizeConfig$
|
|
2118
|
+
var sizeConfig$9 = {
|
|
2007
2119
|
md: {
|
|
2008
2120
|
checkClass: 'w-[22px] h-[22px]',
|
|
2009
2121
|
labelClass: 'text-size-base font-[350]',
|
|
@@ -2017,7 +2129,7 @@ var sizeConfig$8 = {
|
|
|
2017
2129
|
var sizeUnion$3 = ['md', 'sm'];
|
|
2018
2130
|
function Checkbox(_a) {
|
|
2019
2131
|
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, _d = _a.onChange, onChange = _d === void 0 ? function () { } : _d, props = __rest(_a, ["disabled", "id", "size", "label", "onChange"]);
|
|
2020
|
-
var _e = sizeConfig$
|
|
2132
|
+
var _e = sizeConfig$9[validUnion(size, sizeUnion$3)], checkClass = _e.checkClass, labelClass = _e.labelClass;
|
|
2021
2133
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2022
2134
|
React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkClass) },
|
|
2023
2135
|
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)),
|
|
@@ -2035,7 +2147,7 @@ Checkbox.defaultProps = {
|
|
|
2035
2147
|
onChange: function () { },
|
|
2036
2148
|
};
|
|
2037
2149
|
|
|
2038
|
-
var sizeConfig$
|
|
2150
|
+
var sizeConfig$8 = {
|
|
2039
2151
|
md: {
|
|
2040
2152
|
searchSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2041
2153
|
iconSize: 'right-[10px] text-[18px]',
|
|
@@ -2046,7 +2158,7 @@ var sizeConfig$7 = {
|
|
|
2046
2158
|
},
|
|
2047
2159
|
};
|
|
2048
2160
|
|
|
2049
|
-
var sizeConfig$
|
|
2161
|
+
var sizeConfig$7 = {
|
|
2050
2162
|
md: {
|
|
2051
2163
|
container: 'text-size-base font-[350] py-[3px] first:pt-[8px] last:pb-[8px]',
|
|
2052
2164
|
item: 'min-h-[34px] p-2.5',
|
|
@@ -2064,7 +2176,7 @@ function CustomDropdownItem(_a) {
|
|
|
2064
2176
|
var _f = useState(false), isHoveredSubMenu = _f[0], setIsHoveredSubMenu = _f[1];
|
|
2065
2177
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2066
2178
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2067
|
-
var _g = sizeConfig$
|
|
2179
|
+
var _g = sizeConfig$7[size], containerClass = _g.container, item = _g.item;
|
|
2068
2180
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2069
2181
|
var isExistSubDropdown = options.length !== 0;
|
|
2070
2182
|
return (React.createElement("div", { className: "relative w-full focus-visible:outline-bia-blue-light-50 ".concat(containerClass), tabIndex: 0, role: "button", onClick: function (e) { return onClick(e); }, onMouseEnter: function () { return setisHovered(true); }, onMouseLeave: function () { return setisHovered(false); }, onKeyDown: function () { } },
|
|
@@ -2091,7 +2203,7 @@ function DefaultDropdownItem(_a) {
|
|
|
2091
2203
|
var _g = useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
2092
2204
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2093
2205
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2094
|
-
var _h = sizeConfig$
|
|
2206
|
+
var _h = sizeConfig$7[size], containerClass = _h.container, item = _h.item;
|
|
2095
2207
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2096
2208
|
var isExistSubDropdown = options.length !== 0;
|
|
2097
2209
|
return (React.createElement("div", { className: "relative w-full focus-visible:outline-bia-blue-light-50 ".concat(containerClass), tabIndex: 0, role: "button", onClick: function (e) { return onClick(e); }, onMouseEnter: function () { return setisHovered(true); }, onMouseLeave: function () { return setisHovered(false); }, onKeyDown: function () { } },
|
|
@@ -2202,7 +2314,7 @@ function SelectInput(_a) {
|
|
|
2202
2314
|
var _k = useState(false), isOpen = _k[0], setIsOpen = _k[1];
|
|
2203
2315
|
var _l = useState(false), isDropUp = _l[0], setIsDropUp = _l[1];
|
|
2204
2316
|
var validatedSize = validUnion(size, sizeUnion$2);
|
|
2205
|
-
var _m = sizeConfig$
|
|
2317
|
+
var _m = sizeConfig$8[validatedSize], searchSize = _m.searchSize, iconSize = _m.iconSize;
|
|
2206
2318
|
var inputRef = useRef(null);
|
|
2207
2319
|
var dropdownContRef = useRef(null);
|
|
2208
2320
|
var handleOutsideClick = function (e) {
|
|
@@ -2296,7 +2408,7 @@ SelectInput.defaultProps = {
|
|
|
2296
2408
|
setSelected: function () { },
|
|
2297
2409
|
};
|
|
2298
2410
|
|
|
2299
|
-
var sizeConfig$
|
|
2411
|
+
var sizeConfig$6 = {
|
|
2300
2412
|
md: {
|
|
2301
2413
|
iconClass: 'right-[10px]',
|
|
2302
2414
|
iconSize: '18',
|
|
@@ -2315,7 +2427,7 @@ function LiveSearch(_a) {
|
|
|
2315
2427
|
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, placeholder = _a.placeholder, _d = _a.required, required = _d === void 0 ? false : _d, options = _a.options, setValue = _a.setValue, value = _a.value, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.onChangeText, onChangeText = _f === void 0 ? function () { } : _f, _g = _a.onClickDropdown, onClickDropdown = _g === void 0 ? function () { } : _g, _h = _a.autoComplete, autoComplete = _h === void 0 ? 'off' : _h, _j = _a.children, children = _j === void 0 ? undefined : _j, _k = _a.dropContProps, dropContProps = _k === void 0 ? { className: undefined } : _k;
|
|
2316
2428
|
var _l = useState(false), isOpen = _l[0], setIsOpen = _l[1];
|
|
2317
2429
|
var _m = useState(value.label || ''), searchTerm = _m[0], setSearchTerm = _m[1];
|
|
2318
|
-
var _o = sizeConfig$
|
|
2430
|
+
var _o = sizeConfig$6[size], iconClass = _o.iconClass, iconSize = _o.iconSize, inputClass = _o.inputClass;
|
|
2319
2431
|
var dropContClassName = dropContProps.className, restDropContProps = __rest(dropContProps, ["className"]);
|
|
2320
2432
|
var isValueExist = value && value.label !== undefined && value.label !== '';
|
|
2321
2433
|
var inputRef = useRef(null);
|
|
@@ -2422,10 +2534,8 @@ function LiveSearch(_a) {
|
|
|
2422
2534
|
Children.toArray(renderedChildren).filter(Boolean).length > 0; // Should always be true if there are initial children
|
|
2423
2535
|
}
|
|
2424
2536
|
var dropdownPosition = isDropUp ? 'bottom-full' : 'top-full';
|
|
2425
|
-
return (React.createElement("div", { className: "bianic-livesearch field-group flex w-full flex-col gap-y-2", ref: inputRef },
|
|
2426
|
-
React.createElement(
|
|
2427
|
-
label,
|
|
2428
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
2537
|
+
return (React.createElement("div", { className: "bianic-livesearch field-group group/form flex w-full flex-col gap-y-2 ", ref: inputRef },
|
|
2538
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2429
2539
|
React.createElement("div", { className: "group relative w-full" },
|
|
2430
2540
|
React.createElement("input", { className: "bianic-livesearch-input field peer w-full rounded border border-bia-grey-dark-10 bg-primary-white read-only:pointer-events-none read-only:border-bia-grey-disabled 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-10 disabled:text-bia-coolgrey ".concat(inputClass), onClick: function () { return setIsOpen(!isOpen); }, value: searchTerm, required: required, disabled: disabled, id: id, placeholder: placeholder, onChange: function (e) {
|
|
2431
2541
|
onChangeText(e);
|
|
@@ -2450,7 +2560,7 @@ function LiveSearch(_a) {
|
|
|
2450
2560
|
? renderedChildren
|
|
2451
2561
|
: // If no results and searchTerm is present
|
|
2452
2562
|
searchTerm.length > 0 && (React.createElement(DropdownItem, { content: React.createElement("div", { className: "px-4 py-2 text-gray-500" }, "Tidak ada hasil ditemukan.") }))))),
|
|
2453
|
-
React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText)));
|
|
2563
|
+
descText && (React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText))));
|
|
2454
2564
|
}
|
|
2455
2565
|
LiveSearch.defaultProps = {
|
|
2456
2566
|
descText: '',
|
|
@@ -2466,7 +2576,7 @@ LiveSearch.defaultProps = {
|
|
|
2466
2576
|
readonly: false,
|
|
2467
2577
|
};
|
|
2468
2578
|
|
|
2469
|
-
var sizeConfig$
|
|
2579
|
+
var sizeConfig$5 = {
|
|
2470
2580
|
md: {
|
|
2471
2581
|
containerSize: 'w-[42px] h-[22px]',
|
|
2472
2582
|
checkSize: 'p-2',
|
|
@@ -2481,7 +2591,7 @@ var sizeConfig$4 = {
|
|
|
2481
2591
|
|
|
2482
2592
|
function Toggle(_a) {
|
|
2483
2593
|
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;
|
|
2484
|
-
var _h = sizeConfig$
|
|
2594
|
+
var _h = sizeConfig$5[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
|
|
2485
2595
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2486
2596
|
React.createElement("div", { className: "".concat(containerSize, " rounded-full py-[2px] flex flex-shrink-0 ").concat(checked ? 'justify-end' : 'justify-start', " items-center relative cursor-pointer"), onClick: onClick, onKeyDown: function () { }, role: "checkbox", tabIndex: 0, "aria-checked": checked },
|
|
2487
2597
|
React.createElement("input", { id: id, checked: checked, disabled: disabled, className: "".concat(checkSize, " peer checkbox appearance-none opacity-100 focus:ring-1 focus:ring-offset-2 focus:ring-bia-blue focus:outline-none rounded-full border-bia-grey checked:border-bia-blue bg-primary-white checked:bg-bia-blue checked:hover:bg-bia-blue-hover cursor-pointer hover:border-bia-blue-hover peer-hover:border-bia-blue-hover disabled:bg-bia-grey-light-80 disabled:checked:bg-bia-blue-light-50 disabled:border-none border-2 absolute w-full h-full"), type: "checkbox" }),
|
|
@@ -2507,7 +2617,7 @@ var roundedConfig = {
|
|
|
2507
2617
|
sm: 'first:rounded-l-radius-sm last:rounded-r-radius-sm',
|
|
2508
2618
|
tn: 'first:rounded-l-radius-tn last:rounded-r-radius-tn',
|
|
2509
2619
|
};
|
|
2510
|
-
var sizeConfig$
|
|
2620
|
+
var sizeConfig$4 = {
|
|
2511
2621
|
lg: 'text-size-md leading-[23.94px] px-[13px] py-[11px] ',
|
|
2512
2622
|
md: 'text-size-base leading-[21px] px-[11px] py-[8.5px] ',
|
|
2513
2623
|
sm: 'text-size-sm leading-[15.96px] px-[7px] py-[6px] ',
|
|
@@ -2530,8 +2640,8 @@ function SegmentButtonItem(_a) {
|
|
|
2530
2640
|
var className = _a.className, _b = _a.selected, selected = _b === void 0 ? false : _b, size = _a.size, children = _a.children, disabled = _a.disabled, _c = _a.isfitContent, isfitContent = _c === void 0 ? false : _c, onClick = _a.onClick;
|
|
2531
2641
|
var isSelected = selected ? 'selected' : 'notSelected';
|
|
2532
2642
|
var sizingStyle = isfitContent
|
|
2533
|
-
? "".concat(sizeConfig$
|
|
2534
|
-
: "".concat(sizeConfig$
|
|
2643
|
+
? "".concat(sizeConfig$4[size], " ").concat(minHeightConfig[size])
|
|
2644
|
+
: "".concat(sizeConfig$4[size], " ").concat(minWidthConfig[size], " ").concat(minHeightConfig[size]);
|
|
2535
2645
|
var radiusStyle = "".concat(roundedConfig[size]);
|
|
2536
2646
|
var selectedStyle = "".concat(isSelectedConfig[isSelected]);
|
|
2537
2647
|
return (React.createElement("button", { type: "button", onClick: onClick, disabled: disabled, className: "group:last:border-l-0 flex items-center justify-center border-[1px] border-l-0 border-bia-grey-dark-10 first:border-l-[1px] focus-visible:z-50 focus-visible:outline focus-visible:outline-[3px] focus-visible:-outline-offset-1 focus-visible:outline-bia-blue-light-50 disabled:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-dark-10 ".concat(selectedStyle, " ").concat(radiusStyle, " ").concat(sizingStyle, " ").concat(className) }, children));
|
|
@@ -2579,7 +2689,7 @@ var todayValue = Date.now() -
|
|
|
2579
2689
|
(Date.now() % oneDayValue) +
|
|
2580
2690
|
new Date().getTimezoneOffset() * 1000 * 60; // today in milliseconds
|
|
2581
2691
|
var PickerCalendar = function (_a) {
|
|
2582
|
-
var
|
|
2692
|
+
var _b = _a.selectedDate, selectedDate = _b === void 0 ? null : _b, onDateChange = _a.onDateChange, ref = _a.ref;
|
|
2583
2693
|
// Constants
|
|
2584
2694
|
var daysMap = [
|
|
2585
2695
|
'Monday',
|
|
@@ -2606,8 +2716,8 @@ var PickerCalendar = function (_a) {
|
|
|
2606
2716
|
];
|
|
2607
2717
|
var modeMap = ['date', 'year', 'month'];
|
|
2608
2718
|
// Mode Controller
|
|
2609
|
-
var
|
|
2610
|
-
var
|
|
2719
|
+
var _c = useState(modeMap[0]), pickerMode = _c[0], setPickerMode = _c[1];
|
|
2720
|
+
var _d = useState(''), prevMode = _d[0], setPrevMode = _d[1];
|
|
2611
2721
|
// styling constants and functions
|
|
2612
2722
|
var chevronButtonStyle = 'text-bia-coolgrey';
|
|
2613
2723
|
var selectedDateStyle = function (date, dateSelected) {
|
|
@@ -2723,9 +2833,9 @@ var PickerCalendar = function (_a) {
|
|
|
2723
2833
|
});
|
|
2724
2834
|
};
|
|
2725
2835
|
// View Date Logic
|
|
2726
|
-
var
|
|
2727
|
-
var
|
|
2728
|
-
var
|
|
2836
|
+
var _e = useState(new Date(selectedDate || todayValue).getMonth()), viewMonthValue = _e[0], setViewMonthValue = _e[1]; // get the month of the selected date
|
|
2837
|
+
var _f = useState(new Date(selectedDate || todayValue).getFullYear()), viewYearValue = _f[0], setViewYearValue = _f[1]; // get the year of the selected date
|
|
2838
|
+
var _g = useState(new Date(selectedDate || todayValue).getFullYear()), viewDecadeValue = _g[0], setViewDecadeValue = _g[1]; // get the year for decaderange
|
|
2729
2839
|
// Month view logic
|
|
2730
2840
|
var monthStartDay = new Date("".concat(viewYearValue, "-").concat(viewMonthValue + 1, "-01")).getDay() === 0
|
|
2731
2841
|
? 6
|
|
@@ -2737,7 +2847,7 @@ var PickerCalendar = function (_a) {
|
|
|
2737
2847
|
var viewLastDate = new Date(viewFirstDate);
|
|
2738
2848
|
viewLastDate.setDate(viewLastDate.getDate() + monthCalenderView - 1); // get the last date of the view
|
|
2739
2849
|
// Generate the view days array
|
|
2740
|
-
var
|
|
2850
|
+
var _h = useState([]), displayDays = _h[0], setDisplayDays = _h[1];
|
|
2741
2851
|
function getDecadeRange(year) {
|
|
2742
2852
|
// Calculate the start of the decade
|
|
2743
2853
|
var startOfDecade = Math.floor(year / 10) * 10;
|
|
@@ -2753,13 +2863,13 @@ var PickerCalendar = function (_a) {
|
|
|
2753
2863
|
var yearDisplayRange = getDecadeRange(viewDecadeValue);
|
|
2754
2864
|
// Variable display
|
|
2755
2865
|
var dateDisplay = (React.createElement("div", { className: "".concat(pickerMode === 'date' ? '' : 'hidden') },
|
|
2756
|
-
React.createElement("div", { className: "bianic-datepicker-calendar-days-grid-header grid grid-cols-7 gap-[3px] pb-1.5" }, daysMap.map(function (day) { return (React.createElement("div", { key: day, className: "bianic-datepicker-calendar-day flex h-[18px] w-[31px] items-center justify-center text-bia-coolgrey" },
|
|
2866
|
+
React.createElement("div", { className: "bianic-datepicker-calendar-days-grid-header grid grid-cols-7 gap-[3px] pb-1.5", style: { zIndex: 100 } }, daysMap.map(function (day) { return (React.createElement("div", { key: day, className: "bianic-datepicker-calendar-day flex h-[18px] w-[31px] items-center justify-center text-bia-coolgrey" },
|
|
2757
2867
|
React.createElement(Text, { variant: "small-text" }, day.slice(0, 3)))); })),
|
|
2758
2868
|
React.createElement("div", { className: "bianic-datepicker-calendar-days-grid-body grid grid-cols-7 gap-y-1.5" }, displayDays.map(function (date) { return (React.createElement("button", { key: date.toString(), className: "bianic-datepicker-calendar-day flex h-[31px] w-[31px] items-center justify-center ".concat(datesColorStyle(date, viewMonthValue), " ").concat(selectedDateStyle(date, selectedDate)), onClick: function () {
|
|
2759
2869
|
// Handle date selection logic here
|
|
2760
2870
|
handleSetSelectedDate(date);
|
|
2761
2871
|
} },
|
|
2762
|
-
React.createElement(Text, { variant: "small-text" }, date.getDate()))); }))));
|
|
2872
|
+
React.createElement(Text, { variant: "small-text", extended: checkDateEquals(date, selectedDate) ? 'text-bia-white' : '' }, date.getDate()))); }))));
|
|
2763
2873
|
var monthDisplay = (React.createElement("div", { className: "bianic-datepicker-calendar-month-grid grid grid-cols-3 gap-y-1.5 ".concat(pickerMode === 'month' ? '' : 'hidden') }, monthMap.map(function (month, index) { return (React.createElement("button", { className: "bianic-datepicker-calendar-month mx-[15px] flex h-[31px] items-center justify-center ".concat(selectedMonthStyle(index, viewMonthValue)), key: index, onClick: function () { return handleSetMonth(index); } },
|
|
2764
2874
|
React.createElement(Text, { variant: "small-text" }, month.slice(0, 3)))); })));
|
|
2765
2875
|
var yearDisplay = (React.createElement("div", { className: "bianic-datepicker-calendar-year-grid grid grid-cols-4 gap-y-1.5 ".concat(pickerMode === 'year' ? '' : 'hidden') }, yearDisplayRange.map(function (year, index) { return (React.createElement("button", { className: "bianic-datepicker-calendar-month mx-[6px] flex h-[31px] items-center justify-center ".concat(selectedMonthStyle(year, viewYearValue), " ").concat(index === 0 || index === 11 ? 'text-bia-coolgrey' : 'text-bia-black'), key: index, onClick: function () { return handleSetYear(year); } },
|
|
@@ -2808,20 +2918,20 @@ var monthMap = [
|
|
|
2808
2918
|
'December',
|
|
2809
2919
|
];
|
|
2810
2920
|
function DatePicker(_a) {
|
|
2811
|
-
var value = _a.value, onChange = _a.onChange;
|
|
2921
|
+
var value = _a.value, onChange = _a.onChange, size = _a.size, disabled = _a.disabled, _b = _a.placeholder, placeholder = _b === void 0 ? '"YYYY-MM-DD"' : _b, label = _a.label, descText = _a.descText, required = _a.required;
|
|
2812
2922
|
// State and Ref
|
|
2813
2923
|
var inputRef = useRef(null);
|
|
2814
2924
|
var wrapperRef = useRef(null);
|
|
2815
2925
|
var pickerRef = useRef(null);
|
|
2816
|
-
var
|
|
2926
|
+
var _c = useDetectOutsideClick(wrapperRef, false, pickerRef), isPickerOpen = _c[0], setIsPickerOpen = _c[1];
|
|
2817
2927
|
return (React.createElement("div", { className: "bianic-datepicker-container relative", ref: wrapperRef },
|
|
2818
2928
|
React.createElement("div", { className: "bianic-datepicker-field-container" },
|
|
2819
|
-
React.createElement(DateInput, { ref: inputRef, placeholder:
|
|
2929
|
+
React.createElement(DateInput, { ref: inputRef, placeholder: placeholder, value: value, onChange: onChange, size: size, disabled: disabled, buttonAction: function () { return setIsPickerOpen(true); }, setIsActive: setIsPickerOpen, label: label, descText: descText, required: required })),
|
|
2820
2930
|
isPickerOpen && (React.createElement("div", { className: "bianic-datepicker-calendar-container absolute left-0 w-[250px] rounded-b-radius-sm bg-bia-white px-1.5 pb-[17px] pt-[15px] shadow-md" },
|
|
2821
2931
|
React.createElement(PickerCalendar, { selectedDate: new Date(value), onDateChange: onChange, ref: pickerRef })))));
|
|
2822
2932
|
}
|
|
2823
2933
|
var DateInput = function (_a) {
|
|
2824
|
-
var className = _a.className, value = _a.value; _a.isActive; var setIsActive = _a.setIsActive, label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? 'md' : _b, onChange = _a.onChange, _c = _a.required, required = _c === void 0 ? false : _c, buttonAction = _a.buttonAction, props = __rest(_a, ["className", "value", "isActive", "setIsActive", "label", "id", "size", "onChange", "required", "buttonAction"]);
|
|
2934
|
+
var className = _a.className, value = _a.value; _a.isActive; var setIsActive = _a.setIsActive, label = _a.label, id = _a.id, _b = _a.size, size = _b === void 0 ? 'md' : _b, onChange = _a.onChange, _c = _a.required, required = _c === void 0 ? false : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, buttonAction = _a.buttonAction, readOnly = _a.readOnly, descText = _a.descText, props = __rest(_a, ["className", "value", "isActive", "setIsActive", "label", "id", "size", "onChange", "required", "disabled", "buttonAction", "readOnly", "descText"]);
|
|
2825
2935
|
var editDateFormatter = function (date) {
|
|
2826
2936
|
var localString = date.toLocaleDateString().split('/');
|
|
2827
2937
|
return localString.reverse().join('-');
|
|
@@ -2831,41 +2941,13 @@ var DateInput = function (_a) {
|
|
|
2831
2941
|
};
|
|
2832
2942
|
// Convert Date to string for display
|
|
2833
2943
|
var formattedValue = value instanceof Date ? displayDateFormatter(value) : value;
|
|
2834
|
-
var
|
|
2944
|
+
var _e = useState(formattedValue), viewValue = _e[0], setViewValue = _e[1];
|
|
2835
2945
|
useRef(null);
|
|
2836
|
-
var
|
|
2837
|
-
var
|
|
2838
|
-
var
|
|
2946
|
+
var _f = useState(0); _f[0]; _f[1];
|
|
2947
|
+
var _g = styleConfig['text'], fieldStyle = _g.fieldStyle;
|
|
2948
|
+
var _h = sizeConfig$c[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
2839
2949
|
var borderStyle = 'border border-bia-grey-dark-10 bg-primary-white';
|
|
2840
2950
|
var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(borderStyle, " ").concat(className);
|
|
2841
|
-
var labelStatus = props.readOnly ? 'read-only:pointer-events-none' : '';
|
|
2842
|
-
// Don't remove this, it will be used later
|
|
2843
|
-
// Helper function to format the cleaned input with specific group sizes
|
|
2844
|
-
// const formatInput = (cleanedValue: string, separator: string = '-') => {
|
|
2845
|
-
// let formattedValue = ''
|
|
2846
|
-
// // Define the group lengths: 4, 2, 2
|
|
2847
|
-
// const groupLengths = [4, 2, 2]
|
|
2848
|
-
// let currentIndex = 0
|
|
2849
|
-
// for (let i = 0; i < groupLengths.length; i++) {
|
|
2850
|
-
// const groupLength = groupLengths[i]
|
|
2851
|
-
// const nextSegment = cleanedValue.substring(
|
|
2852
|
-
// currentIndex,
|
|
2853
|
-
// currentIndex + groupLength
|
|
2854
|
-
// )
|
|
2855
|
-
// if (nextSegment.length > 0) {
|
|
2856
|
-
// formattedValue += nextSegment
|
|
2857
|
-
// currentIndex += groupLength
|
|
2858
|
-
// // Add separator if there are more groups to follow and we have enough characters
|
|
2859
|
-
// if (i < groupLengths.length - 1 && currentIndex < cleanedValue.length) {
|
|
2860
|
-
// formattedValue += separator
|
|
2861
|
-
// }
|
|
2862
|
-
// } else {
|
|
2863
|
-
// // Stop if there are no more characters for the current group
|
|
2864
|
-
// break
|
|
2865
|
-
// }
|
|
2866
|
-
// }
|
|
2867
|
-
// return formattedValue
|
|
2868
|
-
// }
|
|
2869
2951
|
var validateAndFormatDate = function (value) {
|
|
2870
2952
|
// 1. validate separator
|
|
2871
2953
|
var splittedDate = value.split('-');
|
|
@@ -2918,56 +3000,6 @@ var DateInput = function (_a) {
|
|
|
2918
3000
|
onChange(date); // Update the value if it's a valid date
|
|
2919
3001
|
}
|
|
2920
3002
|
};
|
|
2921
|
-
// Handle input change will develop later don't remove
|
|
2922
|
-
// const handleChange = (event) => {
|
|
2923
|
-
// const inputElement = event.target
|
|
2924
|
-
// const rawValue = inputElement.value
|
|
2925
|
-
// const currentCursorPos = inputElement.selectionStart
|
|
2926
|
-
// const cleaned = cleanInput(rawValue)
|
|
2927
|
-
// // Max total digits for XXXX-XX-XX is 4 + 2 + 2 = 8
|
|
2928
|
-
// const maxDigits = 8
|
|
2929
|
-
// const truncatedCleaned = cleaned.substring(0, maxDigits)
|
|
2930
|
-
// const formatted = formatInput(truncatedCleaned)
|
|
2931
|
-
// // --- Cursor Position Adjustment Logic ---
|
|
2932
|
-
// let newCursorPos = currentCursorPos
|
|
2933
|
-
// const prevFormattedLength = viewValue.length // Length of the string *before* update
|
|
2934
|
-
// const currentFormattedLength = formatted.length // Length of the string *after* update
|
|
2935
|
-
// // If text was added and formatted length increased
|
|
2936
|
-
// if (currentFormattedLength > prevFormattedLength) {
|
|
2937
|
-
// // Count how many separators are now *before* the cursor in the new string
|
|
2938
|
-
// // We'll compare the raw cursor position with the formatted string to adjust
|
|
2939
|
-
// let separatorCountBeforeCursor = 0
|
|
2940
|
-
// let originalCleanedValue = cleanInput(viewValue) // Clean value before this change
|
|
2941
|
-
// // If a character was inserted, estimate new cursor position
|
|
2942
|
-
// if (cleaned.length > originalCleanedValue.length) {
|
|
2943
|
-
// // Count separators in the *new* formatted string up to the currentCursorPos
|
|
2944
|
-
// for (let i = 0; i < currentCursorPos; i++) {
|
|
2945
|
-
// if (formatted.charAt(i) === '-') {
|
|
2946
|
-
// separatorCountBeforeCursor++
|
|
2947
|
-
// }
|
|
2948
|
-
// }
|
|
2949
|
-
// newCursorPos = currentCursorPos + separatorCountBeforeCursor
|
|
2950
|
-
// } else {
|
|
2951
|
-
// // If characters were deleted (backspace/delete)
|
|
2952
|
-
// newCursorPos = currentCursorPos
|
|
2953
|
-
// // More sophisticated logic for backspace/delete on separators can go here.
|
|
2954
|
-
// // For example, if you backspace a digit and it causes a separator to disappear,
|
|
2955
|
-
// // the cursor might need to jump back an extra position.
|
|
2956
|
-
// // This basic setup often works acceptably for most cases.
|
|
2957
|
-
// }
|
|
2958
|
-
// } else {
|
|
2959
|
-
// // If text was deleted or no change in length
|
|
2960
|
-
// newCursorPos = currentCursorPos
|
|
2961
|
-
// }
|
|
2962
|
-
// const handleKeyDown = (event) => {
|
|
2963
|
-
// if (event.key === 'Enter') {
|
|
2964
|
-
// // Prevent default form submission if the input is inside a <form>
|
|
2965
|
-
// // event.preventDefault();
|
|
2966
|
-
// }
|
|
2967
|
-
// }
|
|
2968
|
-
// setViewValue(formatted)
|
|
2969
|
-
// setLastCursorPos(newCursorPos)
|
|
2970
|
-
// }
|
|
2971
3003
|
var handleChange = function (event) {
|
|
2972
3004
|
var value = event.target.value;
|
|
2973
3005
|
// Regular expression to allow only numbers (0-9) and hyphens (-)
|
|
@@ -2978,25 +3010,16 @@ var DateInput = function (_a) {
|
|
|
2978
3010
|
setViewValue(value);
|
|
2979
3011
|
}
|
|
2980
3012
|
};
|
|
2981
|
-
// Will Develop later
|
|
2982
|
-
// useEffect to set cursor position after render
|
|
2983
|
-
// useEffect(() => {
|
|
2984
|
-
// if (inputRef.current) {
|
|
2985
|
-
// inputRef.current.setSelectionRange(lastCursorPos, lastCursorPos)
|
|
2986
|
-
// }
|
|
2987
|
-
// }, [viewValue, lastCursorPos]) // Re-run when viewValue or lastCursorPos changes
|
|
2988
3013
|
useEffect(function () {
|
|
2989
3014
|
setViewValue(formattedValue);
|
|
2990
3015
|
}, [value]);
|
|
2991
|
-
return (React.createElement("div", { className: "bianic-date-input-container bianic-fgc-container flex w-full flex-col gap-y-2 text-bia-black" },
|
|
2992
|
-
label && (React.createElement(
|
|
2993
|
-
label,
|
|
2994
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*"))),
|
|
3016
|
+
return (React.createElement("div", { className: "bianic-date-input-container bianic-fgc-container group/form flex w-full flex-col gap-y-2 text-bia-black " },
|
|
3017
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2995
3018
|
React.createElement("div", { className: "relative w-full" },
|
|
2996
|
-
React.createElement("input", __assign({}, props, { type: "text", 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
|
|
3019
|
+
React.createElement("input", __assign({}, props, { type: "text", 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 hover:border-b-bia-blue 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), id: id, value: viewValue, disabled: disabled, onChange: handleChange, required: required, onFocus: function () {
|
|
2997
3020
|
setIsActive && setIsActive(true);
|
|
2998
3021
|
setViewValue(editDateFormatter(value));
|
|
2999
|
-
},
|
|
3022
|
+
}, onBlur: function () {
|
|
3000
3023
|
var _a = validateAndFormatDate(viewValue), status = _a[0], validatedValue = _a[1];
|
|
3001
3024
|
setViewValue(displayDateFormatter(value));
|
|
3002
3025
|
if (status !== 0) ;
|
|
@@ -3004,11 +3027,12 @@ var DateInput = function (_a) {
|
|
|
3004
3027
|
updateValue(validatedValue);
|
|
3005
3028
|
}
|
|
3006
3029
|
}, maxLength: 10 })),
|
|
3007
|
-
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 text-
|
|
3008
|
-
React.createElement("button", { className: "bianic-datepicker-toggle-button", onClick: function () {
|
|
3030
|
+
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 text-bia-coolgrey ".concat(iconPosition) },
|
|
3031
|
+
React.createElement("button", { className: "bianic-datepicker-toggle-button", disabled: disabled, onClick: function () {
|
|
3009
3032
|
buttonAction && buttonAction();
|
|
3010
3033
|
} },
|
|
3011
|
-
React.createElement(TbCalendar,
|
|
3034
|
+
React.createElement(TbCalendar, { size: iconSize })))),
|
|
3035
|
+
descText && (React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText))));
|
|
3012
3036
|
};
|
|
3013
3037
|
|
|
3014
3038
|
var Node = function (_a) {
|
|
@@ -3176,9 +3200,9 @@ var Outlet = function (_a) {
|
|
|
3176
3200
|
};
|
|
3177
3201
|
|
|
3178
3202
|
var Inlet = function (_a) {
|
|
3179
|
-
_a.className
|
|
3203
|
+
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
3180
3204
|
var numericSize = Number(size);
|
|
3181
|
-
return (React.createElement("svg", { width: numericSize * 2, height: numericSize, viewBox: "0 0 48 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
3205
|
+
return (React.createElement("svg", { className: className, width: numericSize * 2, height: numericSize, viewBox: "0 0 48 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
3182
3206
|
React.createElement("path", { d: "M36 20C38.1217 20 40.1566 19.1571 41.6569 17.6569C43.1571 16.1566 44 14.1217 44 12C44 9.87827 43.1571 7.84344 41.6569 6.34315C40.1566 4.84285 38.1217 4 36 4C33.8783 4 31.8434 4.84285 30.3431 6.34315C28.8429 7.84344 28 9.87827 28 12C28 14.1217 28.8429 16.1566 30.3431 17.6569C31.8434 19.1571 33.8783 20 36 20ZM36 22C30.477 22 26 17.523 26 12C26 6.477 30.477 2 36 2C41.523 2 46 6.477 46 12C46 17.523 41.523 22 36 22Z", fill: "inherit" }),
|
|
3183
3207
|
React.createElement("path", { d: "M15.586 10.657L11.636 6.707C11.4538 6.5184 11.353 6.26579 11.3553 6.0036C11.3576 5.7414 11.4628 5.49059 11.6482 5.30518C11.8336 5.11977 12.0844 5.0146 12.3466 5.01232C12.6088 5.01005 12.8614 5.11084 13.05 5.293L18.707 10.95C18.8002 11.0427 18.8741 11.1528 18.9246 11.2741C18.9751 11.3955 19.001 11.5256 19.001 11.657C19.001 11.7884 18.9751 11.9185 18.9246 12.0399C18.8741 12.1612 18.8002 12.2713 18.707 12.364L13.05 18.021C12.9578 18.1165 12.8474 18.1927 12.7254 18.2451C12.6034 18.2975 12.4722 18.3251 12.3394 18.3263C12.2066 18.3274 12.0749 18.3021 11.952 18.2518C11.8292 18.2015 11.7175 18.1273 11.6236 18.0334C11.5297 17.9395 11.4555 17.8279 11.4052 17.705C11.3549 17.5821 11.3296 17.4504 11.3308 17.3176C11.3319 17.1848 11.3595 17.0536 11.4119 16.9316C11.4643 16.8096 11.5405 16.6992 11.636 16.607L15.586 12.657H6C5.73478 12.657 5.48043 12.5516 5.29289 12.3641C5.10536 12.1766 5 11.9222 5 11.657C5 11.3918 5.10536 11.1374 5.29289 10.9499C5.48043 10.7624 5.73478 10.657 6 10.657H15.586Z", fill: "inherit" })));
|
|
3184
3208
|
};
|
|
@@ -3187,8 +3211,35 @@ var Neutral = function (_a) {
|
|
|
3187
3211
|
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
3188
3212
|
var numericSize = Number(size);
|
|
3189
3213
|
return (React.createElement("svg", { className: className, width: numericSize * 2, height: numericSize, viewBox: "0 0 48 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
3190
|
-
React.createElement("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M28 12C28 11.4477 28.4477 11 29 11H43C43.5523 11 44 11.4477 44 12C44 12.5523 43.5523 13 43 13H29C28.4477 13 28 12.5523 28 12Z", fill: "
|
|
3191
|
-
React.createElement("path", { d: "M12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22Z", fill: "
|
|
3214
|
+
React.createElement("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M28 12C28 11.4477 28.4477 11 29 11H43C43.5523 11 44 11.4477 44 12C44 12.5523 43.5523 13 43 13H29C28.4477 13 28 12.5523 28 12Z", fill: "inherit" }),
|
|
3215
|
+
React.createElement("path", { d: "M12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22Z", fill: "inherit" })));
|
|
3216
|
+
};
|
|
3217
|
+
|
|
3218
|
+
var colorConfig$1 = {
|
|
3219
|
+
yellow: 'bg-bia-yellow-light-80',
|
|
3220
|
+
blue: 'bg-bia-sky-light-90',
|
|
3221
|
+
grey: 'bg-bia-grey-light-80',
|
|
3222
|
+
white: 'bg-bia-white border border-bia-grey',
|
|
3223
|
+
};
|
|
3224
|
+
var sizeConfig$3 = {
|
|
3225
|
+
container: 'min-h-fit p-5 text-wrap',
|
|
3226
|
+
'form-sm': 'h-[30px] whitespace-nowrap px-2.5',
|
|
3227
|
+
'form-md': 'h-10 whitespace-nowrap px-2.5',
|
|
3228
|
+
};
|
|
3229
|
+
|
|
3230
|
+
var InfoPanel = function (_a) {
|
|
3231
|
+
var variant = _a.variant, color = _a.color, className = _a.className, textClassName = _a.textClassName;
|
|
3232
|
+
var sizeClass = sizeConfig$3[variant || 'container'];
|
|
3233
|
+
var colorClass = colorConfig$1[color || 'yellow'];
|
|
3234
|
+
var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
|
|
3235
|
+
return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) },
|
|
3236
|
+
React.createElement(Text, { variant: "medium-text", extended: textClassName }, "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")));
|
|
3237
|
+
};
|
|
3238
|
+
InfoPanel.defaultProps = {
|
|
3239
|
+
variant: 'container',
|
|
3240
|
+
color: 'yellow',
|
|
3241
|
+
className: '',
|
|
3242
|
+
textClassName: '',
|
|
3192
3243
|
};
|
|
3193
3244
|
|
|
3194
3245
|
function Modal(_a) {
|
|
@@ -3316,7 +3367,7 @@ Pills.defaultProps = {
|
|
|
3316
3367
|
iconRight: null,
|
|
3317
3368
|
};
|
|
3318
3369
|
|
|
3319
|
-
var classConfig
|
|
3370
|
+
var classConfig = {
|
|
3320
3371
|
top: {
|
|
3321
3372
|
tooltipContainer: 'bottom-[calc(100%+10px)] left-1/2 -translate-x-1/2',
|
|
3322
3373
|
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
@@ -3363,7 +3414,7 @@ function Popover(_a) {
|
|
|
3363
3414
|
var children = _a.children, content = _a.content; _a.delay; var _c = _a.direction, direction = _c === void 0 ? 'bottom' : _c, _d = _a.title, title = _d === void 0 ? '' : _d; _a.maxWidth;
|
|
3364
3415
|
var wrapperRef = useRef(null);
|
|
3365
3416
|
var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
|
|
3366
|
-
var _f = classConfig
|
|
3417
|
+
var _f = classConfig[direction], tooltipContainer = _f.tooltipContainer, triangleContainer = _f.triangleContainer, triangleShape = _f.triangleShape;
|
|
3367
3418
|
return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
|
|
3368
3419
|
children,
|
|
3369
3420
|
isOpen && (React.createElement("div", { 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(tooltipContainer) },
|
|
@@ -3851,111 +3902,6 @@ TagLabel.defaultProps = {
|
|
|
3851
3902
|
isDark: false,
|
|
3852
3903
|
};
|
|
3853
3904
|
|
|
3854
|
-
var classConfig = {
|
|
3855
|
-
top: {
|
|
3856
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
3857
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3858
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3859
|
-
},
|
|
3860
|
-
right: {
|
|
3861
|
-
tooltipContainer: 'left-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
3862
|
-
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
3863
|
-
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
3864
|
-
},
|
|
3865
|
-
bottom: {
|
|
3866
|
-
tooltipContainer: 'top-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
3867
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3868
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3869
|
-
},
|
|
3870
|
-
left: {
|
|
3871
|
-
tooltipContainer: 'right-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
3872
|
-
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
3873
|
-
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
3874
|
-
},
|
|
3875
|
-
'top-right': {
|
|
3876
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] right-0',
|
|
3877
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3878
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3879
|
-
},
|
|
3880
|
-
'top-left': {
|
|
3881
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] left-0',
|
|
3882
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3883
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3884
|
-
},
|
|
3885
|
-
'bottom-right': {
|
|
3886
|
-
tooltipContainer: 'top-[calc(100%+5px)] right-0',
|
|
3887
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3888
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3889
|
-
},
|
|
3890
|
-
'bottom-left': {
|
|
3891
|
-
tooltipContainer: 'top-[calc(100%+5px)] left-0',
|
|
3892
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3893
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3894
|
-
},
|
|
3895
|
-
};
|
|
3896
|
-
|
|
3897
|
-
function Tooltip(props) {
|
|
3898
|
-
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;
|
|
3899
|
-
var timeout;
|
|
3900
|
-
var _c = useState(false), active = _c[0], setActive = _c[1];
|
|
3901
|
-
var showTip = function () {
|
|
3902
|
-
timeout = setTimeout(function () {
|
|
3903
|
-
setActive(true);
|
|
3904
|
-
}, delay || 400);
|
|
3905
|
-
};
|
|
3906
|
-
var hideTip = function () {
|
|
3907
|
-
clearInterval(timeout);
|
|
3908
|
-
setActive(false);
|
|
3909
|
-
};
|
|
3910
|
-
var _d = classConfig[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
|
|
3911
|
-
var tooltipContainerRef = useRef(null);
|
|
3912
|
-
var _e = useState({
|
|
3913
|
-
maxWidth: maxWidth + 'px',
|
|
3914
|
-
whiteSpace: 'nowrap',
|
|
3915
|
-
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
3916
|
-
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
3917
|
-
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
3918
|
-
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
3919
|
-
var offsetHeight = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetHeight;
|
|
3920
|
-
useEffect(function () {
|
|
3921
|
-
if (scrollWidth && offsetWidth) {
|
|
3922
|
-
var maxWidthNumber = Number(maxWidth);
|
|
3923
|
-
var isMultiLine = offsetHeight > 23; // 23 pixels is the approximate height of one line of text
|
|
3924
|
-
// Tooltip Width and Whitespace Determination Rules:
|
|
3925
|
-
// 1. Default Condition:
|
|
3926
|
-
// - width: fit-content
|
|
3927
|
-
// - whiteSpace: nowrap
|
|
3928
|
-
// 2. When maxWidth is Set:
|
|
3929
|
-
// * Text Exceeds maxWidth:
|
|
3930
|
-
// - width: maxWidth
|
|
3931
|
-
// - whiteSpace: normal
|
|
3932
|
-
// * Text Equals maxWidth (Multi-line):
|
|
3933
|
-
// - width: maxWidth
|
|
3934
|
-
// - whiteSpace: normal
|
|
3935
|
-
// * Text Less Than maxWidth:
|
|
3936
|
-
// - width: fit-content
|
|
3937
|
-
// - whiteSpace: nowrap
|
|
3938
|
-
var newWidth_1 = 'fit-content';
|
|
3939
|
-
var newWhiteSpace_1 = 'nowrap';
|
|
3940
|
-
if (scrollWidth > maxWidthNumber ||
|
|
3941
|
-
(offsetWidth === maxWidthNumber && isMultiLine)) {
|
|
3942
|
-
newWidth_1 = maxWidthNumber + 'px';
|
|
3943
|
-
newWhiteSpace_1 = 'normal';
|
|
3944
|
-
}
|
|
3945
|
-
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
3946
|
-
}
|
|
3947
|
-
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
3948
|
-
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip },
|
|
3949
|
-
children,
|
|
3950
|
-
active && (React.createElement("div", { className: "tooltip-container break-word absolute z-50 inline-block break-all rounded-[4px] bg-primary-black px-[7px] py-[4px] text-size-sm text-primary-white ".concat(tooltipContainer), style: tooltipContainerStyle, ref: tooltipContainerRef }, content))));
|
|
3951
|
-
}
|
|
3952
|
-
Tooltip.defaultProps = {
|
|
3953
|
-
delay: 400,
|
|
3954
|
-
direction: 'top',
|
|
3955
|
-
maxWidth: '300',
|
|
3956
|
-
};
|
|
3957
|
-
Tooltip.defaultProps = {};
|
|
3958
|
-
|
|
3959
3905
|
var colorConfigs = {
|
|
3960
3906
|
default: 'bg-bia-black',
|
|
3961
3907
|
info: 'bg-bia-teal',
|
|
@@ -3976,7 +3922,7 @@ function Toaster(_a) {
|
|
|
3976
3922
|
React.createElement("div", { className: "bianic-toaster-description-area text-[12px] font-normal leading-[134%]" }, children))) : (React.createElement("div", { className: "bianic-toaster-content-area flex flex-row gap-[5px]" },
|
|
3977
3923
|
icon && React.createElement("div", { className: "bianic-toaster-icon-area" }, icon),
|
|
3978
3924
|
React.createElement("div", { className: "bianic-toaster-description-area text-[12px] font-normal leading-[134%]" }, children)));
|
|
3979
|
-
return (React.createElement("div", { className: "bianic-toaster flex
|
|
3925
|
+
return (React.createElement("div", { className: "bianic-toaster flex w-[300px] flex-row gap-[5px] rounded-[5px] py-[10px] shadow-[0px_3px_20px_0px_rgba(0,0,0,0.10)] ".concat(colorStyles) },
|
|
3980
3926
|
React.createElement("span", { className: "mr-[10px] flex min-w-[3px] rounded-r-[10px] bg-bia-white/50" }),
|
|
3981
3927
|
content,
|
|
3982
3928
|
React.createElement("div", { className: "flex items-start pr-[11px] pt-[1px]" },
|
|
@@ -4011,4 +3957,4 @@ function Window(_a) {
|
|
|
4011
3957
|
React.createElement("div", { className: "bianic-window-content flex w-full flex-col items-start gap-[20px] px-[20px] pb-[20px] text-primary-black" }, rest.children)));
|
|
4012
3958
|
}
|
|
4013
3959
|
|
|
4014
|
-
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, ContextualButton, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, Heading, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };
|
|
3960
|
+
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, VirtualPort as BCVirtualPort, Badge, Banner, Brand, Breadcrumb, Button, ButtonApp, Checkbox, Color, ContextualButton, DatePicker, Display, Divider, DropdownContainer, DropdownItem, FileTree, FormGroup, FormGroupButton, FormGroupLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, P, PaginationBar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, Slider, Spinner, Tab, TabMenu, TableCell, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, Window };
|