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/cjs/index.js
CHANGED
|
@@ -273,12 +273,9 @@ var useDetectOutsideClick = function (ref, initialState, ignoreRef, event) {
|
|
|
273
273
|
// If the active element exists and is clicked outside of
|
|
274
274
|
if (ignoreRef &&
|
|
275
275
|
ignoreRef.current &&
|
|
276
|
-
ignoreRef.current.contains(event.target))
|
|
277
|
-
console.log('enter');
|
|
278
|
-
}
|
|
276
|
+
ignoreRef.current.contains(event.target)) ;
|
|
279
277
|
else if (ref.current !== null &&
|
|
280
278
|
!ref.current.contains(event.target)) {
|
|
281
|
-
console.log('close');
|
|
282
279
|
setIsActive(!isActive);
|
|
283
280
|
}
|
|
284
281
|
};
|
|
@@ -426,7 +423,7 @@ var radiusConfig$1 = {
|
|
|
426
423
|
tn: 'rounded-radius-full focus-visible:rounded-radius-full',
|
|
427
424
|
},
|
|
428
425
|
};
|
|
429
|
-
var sizeConfig$
|
|
426
|
+
var sizeConfig$d = {
|
|
430
427
|
lg: 'py-[10.5px] h-[48px] flex items-center justify-center gap-[10px] text-size-md ',
|
|
431
428
|
md: 'py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base ',
|
|
432
429
|
sm: 'py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm ',
|
|
@@ -445,10 +442,10 @@ var minWidthConfig$1 = {
|
|
|
445
442
|
tn: 'min-w-[64px]',
|
|
446
443
|
};
|
|
447
444
|
var iconOnlySizeConfig$1 = {
|
|
448
|
-
lg: 'py-[13px] flex items-center justify-center gap-[10px]',
|
|
449
|
-
md: 'py-[11px] flex items-center justify-center gap-[5px]',
|
|
450
|
-
sm: 'py-[8px] flex items-center justify-center gap-[5px] ',
|
|
451
|
-
tn: 'py-[4px] flex items-center justify-center gap-[3px]',
|
|
445
|
+
lg: 'py-[13px] h-[48px] h-[48px] flex items-center justify-center gap-[10px]',
|
|
446
|
+
md: 'py-[11px] h-[40px] w-[40px] flex items-center justify-center gap-[5px]',
|
|
447
|
+
sm: 'py-[8px] h-[30px] h-[30px] flex items-center justify-center gap-[5px] ',
|
|
448
|
+
tn: 'py-[4px] h-[22px] h-[22px] flex items-center justify-center gap-[3px]',
|
|
452
449
|
};
|
|
453
450
|
var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
|
|
454
451
|
var variantConfig$2 = {
|
|
@@ -464,7 +461,7 @@ var variantConfig$2 = {
|
|
|
464
461
|
'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",
|
|
465
462
|
'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",
|
|
466
463
|
'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",
|
|
467
|
-
'success-outlined': "text-bia-green bg-primary-white bg-primary-white border-solid border border-bia-
|
|
464
|
+
'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 ",
|
|
468
465
|
'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",
|
|
469
466
|
'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 ",
|
|
470
467
|
'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 ",
|
|
@@ -504,10 +501,10 @@ function Button(_a) {
|
|
|
504
501
|
}
|
|
505
502
|
var sizingRules;
|
|
506
503
|
if (variant.includes('link')) {
|
|
507
|
-
sizingRules = "".concat(sizeConfig$
|
|
504
|
+
sizingRules = "".concat(sizeConfig$d[validatedSize]);
|
|
508
505
|
}
|
|
509
506
|
else {
|
|
510
|
-
sizingRules = "".concat(sizeConfig$
|
|
507
|
+
sizingRules = "".concat(sizeConfig$d[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
|
|
511
508
|
}
|
|
512
509
|
var sizeClass = label || variant === 'form-group'
|
|
513
510
|
? " ".concat(minWidthRules, " ").concat(sizingRules)
|
|
@@ -1489,7 +1486,7 @@ Breadcrumb.defaultProps = {
|
|
|
1489
1486
|
selected: false,
|
|
1490
1487
|
};
|
|
1491
1488
|
|
|
1492
|
-
var colorConfig$
|
|
1489
|
+
var colorConfig$2 = {
|
|
1493
1490
|
green: {
|
|
1494
1491
|
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',
|
|
1495
1492
|
active: 'bg-bia-verdantgreen-dark-40 text-primary-white',
|
|
@@ -1503,7 +1500,7 @@ var colorConfig$1 = {
|
|
|
1503
1500
|
var ButtonApp = function (_a) {
|
|
1504
1501
|
_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"]);
|
|
1505
1502
|
var buttonState = isActive ? 'active' : 'default';
|
|
1506
|
-
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$
|
|
1503
|
+
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));
|
|
1507
1504
|
};
|
|
1508
1505
|
|
|
1509
1506
|
var textColorConfig = {
|
|
@@ -1793,7 +1790,147 @@ MenuItem.defaultProps = {
|
|
|
1793
1790
|
onClick: function () { },
|
|
1794
1791
|
};
|
|
1795
1792
|
|
|
1796
|
-
var
|
|
1793
|
+
var classConfig$1 = {
|
|
1794
|
+
top: {
|
|
1795
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
1796
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1797
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1798
|
+
},
|
|
1799
|
+
right: {
|
|
1800
|
+
tooltipContainer: 'left-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
1801
|
+
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
1802
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
1803
|
+
},
|
|
1804
|
+
bottom: {
|
|
1805
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
1806
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1807
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1808
|
+
},
|
|
1809
|
+
left: {
|
|
1810
|
+
tooltipContainer: 'right-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
1811
|
+
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
1812
|
+
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
1813
|
+
},
|
|
1814
|
+
'top-right': {
|
|
1815
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] right-0',
|
|
1816
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1817
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1818
|
+
},
|
|
1819
|
+
'top-left': {
|
|
1820
|
+
tooltipContainer: 'bottom-[calc(100%+5px)] left-0',
|
|
1821
|
+
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
1822
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
1823
|
+
},
|
|
1824
|
+
'bottom-right': {
|
|
1825
|
+
tooltipContainer: 'top-[calc(100%+5px)] right-0',
|
|
1826
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1827
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1828
|
+
},
|
|
1829
|
+
'bottom-left': {
|
|
1830
|
+
tooltipContainer: 'top-[calc(100%+5px)] left-0',
|
|
1831
|
+
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
1832
|
+
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
1833
|
+
},
|
|
1834
|
+
};
|
|
1835
|
+
|
|
1836
|
+
function Tooltip(props) {
|
|
1837
|
+
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;
|
|
1838
|
+
var timeout;
|
|
1839
|
+
var _c = React.useState(false), active = _c[0], setActive = _c[1];
|
|
1840
|
+
var showTip = function () {
|
|
1841
|
+
timeout = setTimeout(function () {
|
|
1842
|
+
setActive(true);
|
|
1843
|
+
}, delay || 400);
|
|
1844
|
+
};
|
|
1845
|
+
var hideTip = function () {
|
|
1846
|
+
clearInterval(timeout);
|
|
1847
|
+
setActive(false);
|
|
1848
|
+
};
|
|
1849
|
+
var _d = classConfig$1[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
|
|
1850
|
+
var tooltipContainerRef = React.useRef(null);
|
|
1851
|
+
var _e = React.useState({
|
|
1852
|
+
maxWidth: maxWidth + 'px',
|
|
1853
|
+
whiteSpace: 'nowrap',
|
|
1854
|
+
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
1855
|
+
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
1856
|
+
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
1857
|
+
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
1858
|
+
var offsetHeight = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetHeight;
|
|
1859
|
+
React.useEffect(function () {
|
|
1860
|
+
if (scrollWidth && offsetWidth) {
|
|
1861
|
+
var maxWidthNumber = Number(maxWidth);
|
|
1862
|
+
var isMultiLine = offsetHeight > 23; // 23 pixels is the approximate height of one line of text
|
|
1863
|
+
// Tooltip Width and Whitespace Determination Rules:
|
|
1864
|
+
// 1. Default Condition:
|
|
1865
|
+
// - width: fit-content
|
|
1866
|
+
// - whiteSpace: nowrap
|
|
1867
|
+
// 2. When maxWidth is Set:
|
|
1868
|
+
// * Text Exceeds maxWidth:
|
|
1869
|
+
// - width: maxWidth
|
|
1870
|
+
// - whiteSpace: normal
|
|
1871
|
+
// * Text Equals maxWidth (Multi-line):
|
|
1872
|
+
// - width: maxWidth
|
|
1873
|
+
// - whiteSpace: normal
|
|
1874
|
+
// * Text Less Than maxWidth:
|
|
1875
|
+
// - width: fit-content
|
|
1876
|
+
// - whiteSpace: nowrap
|
|
1877
|
+
var newWidth_1 = 'fit-content';
|
|
1878
|
+
var newWhiteSpace_1 = 'nowrap';
|
|
1879
|
+
if (scrollWidth > maxWidthNumber ||
|
|
1880
|
+
(offsetWidth === maxWidthNumber && isMultiLine)) {
|
|
1881
|
+
newWidth_1 = maxWidthNumber + 'px';
|
|
1882
|
+
newWhiteSpace_1 = 'normal';
|
|
1883
|
+
}
|
|
1884
|
+
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
1885
|
+
}
|
|
1886
|
+
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
1887
|
+
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip },
|
|
1888
|
+
children,
|
|
1889
|
+
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))));
|
|
1890
|
+
}
|
|
1891
|
+
Tooltip.defaultProps = {
|
|
1892
|
+
delay: 400,
|
|
1893
|
+
direction: 'top',
|
|
1894
|
+
maxWidth: '300',
|
|
1895
|
+
};
|
|
1896
|
+
Tooltip.defaultProps = {};
|
|
1897
|
+
|
|
1898
|
+
var FormLabel = function (_a) {
|
|
1899
|
+
var children = _a.children, className = _a.className, htmlFor = _a.htmlFor, readOnly = _a.readOnly, required = _a.required;
|
|
1900
|
+
var labelClass = readOnly ? 'pointer-events-none' : '';
|
|
1901
|
+
return (React.createElement(Tooltip, { content: "Required", delay: 2000, direction: "right" },
|
|
1902
|
+
React.createElement("label", { htmlFor: htmlFor, className: "bianic-form-label group/formlabel text-xs font-semibold ".concat(labelClass, " ").concat(className) },
|
|
1903
|
+
children,
|
|
1904
|
+
required && (React.createElement("span", { className: "p-1 text-bia-coolgrey group-hover/form:text-bia-red group-hover/formlabel:text-bia-red" }, "*")))));
|
|
1905
|
+
};
|
|
1906
|
+
FormLabel.defaultProps = {
|
|
1907
|
+
className: '',
|
|
1908
|
+
htmlFor: undefined,
|
|
1909
|
+
required: false,
|
|
1910
|
+
readOnly: false,
|
|
1911
|
+
};
|
|
1912
|
+
|
|
1913
|
+
function PasswordIcon(_a) {
|
|
1914
|
+
var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, disabled = _a.disabled;
|
|
1915
|
+
var iconColor = disabled ? '#8b8ba6' : '#5E5EEA';
|
|
1916
|
+
if (isShow) {
|
|
1917
|
+
return (React.createElement(TbEye, { onClick: function () { return showHandler(false); }, style: {
|
|
1918
|
+
fontSize: iconSize,
|
|
1919
|
+
color: iconColor,
|
|
1920
|
+
} }));
|
|
1921
|
+
}
|
|
1922
|
+
return (React.createElement(TbEyeOff, { onClick: function () { return showHandler(true); }, style: { fontSize: iconSize, color: iconColor } }));
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
function ValidationIcon(_a) {
|
|
1926
|
+
var isValid = _a.isValid, iconSize = _a.iconSize;
|
|
1927
|
+
if (isValid) {
|
|
1928
|
+
return (React.createElement(TbCheck, { className: "text-bia-green", style: { fontSize: iconSize } }));
|
|
1929
|
+
}
|
|
1930
|
+
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
var sizeConfig$c = {
|
|
1797
1934
|
md: {
|
|
1798
1935
|
fieldSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
1799
1936
|
iconPosition: 'right-[10px]',
|
|
@@ -1828,34 +1965,14 @@ var styleConfig = {
|
|
|
1828
1965
|
},
|
|
1829
1966
|
};
|
|
1830
1967
|
|
|
1831
|
-
function ValidationIcon(_a) {
|
|
1832
|
-
var isValid = _a.isValid, iconSize = _a.iconSize;
|
|
1833
|
-
if (isValid) {
|
|
1834
|
-
return (React.createElement(TbCheck, { className: "text-bia-green", style: { fontSize: iconSize } }));
|
|
1835
|
-
}
|
|
1836
|
-
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
function PasswordIcon(_a) {
|
|
1840
|
-
var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, disabled = _a.disabled;
|
|
1841
|
-
var iconColor = disabled ? '#8b8ba6' : '#5E5EEA';
|
|
1842
|
-
if (isShow) {
|
|
1843
|
-
return (React.createElement(TbEye, { onClick: function () { return showHandler(false); }, style: {
|
|
1844
|
-
fontSize: iconSize,
|
|
1845
|
-
color: iconColor,
|
|
1846
|
-
} }));
|
|
1847
|
-
}
|
|
1848
|
-
return (React.createElement(TbEyeOff, { onClick: function () { return showHandler(true); }, style: { fontSize: iconSize, color: iconColor } }));
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
1968
|
function TextInput(_a) {
|
|
1852
1969
|
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"]);
|
|
1853
1970
|
var isTransparent = variant.includes('transparent');
|
|
1854
1971
|
var _r = React.useState(false), isShow = _r[0], setIsShow = _r[1];
|
|
1855
1972
|
var _s = styleConfig[variant], fieldStyle = _s.fieldStyle, iconStyle = _s.iconStyle;
|
|
1856
1973
|
var _t = isTransparent
|
|
1857
|
-
? __assign(__assign({}, sizeConfig$
|
|
1858
|
-
" pe-[".concat(9 + sizeConfig$
|
|
1974
|
+
? __assign(__assign({}, sizeConfig$c[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$c[size].fieldSize +
|
|
1975
|
+
" pe-[".concat(9 + sizeConfig$c[size].iconSize, "px]") }) : sizeConfig$c[size], iconSize = _t.iconSize, fieldSize = _t.fieldSize, iconPosition = _t.iconPosition;
|
|
1859
1976
|
var borderStyle = isTransparent
|
|
1860
1977
|
? 'border-transparent bg-transparent' // customize border rule for transparent variant
|
|
1861
1978
|
: 'border border-bia-grey-dark-10 bg-primary-white';
|
|
@@ -1888,11 +2005,8 @@ function TextInput(_a) {
|
|
|
1888
2005
|
if (variant === 'date')
|
|
1889
2006
|
iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
|
|
1890
2007
|
var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
label && (React.createElement("label", { htmlFor: id, className: "bianic-text-input-label text-xs font-semibold ".concat(labelStatus) },
|
|
1894
|
-
label,
|
|
1895
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*"))),
|
|
2008
|
+
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" },
|
|
2009
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
1896
2010
|
React.createElement("div", { className: "relative w-full" },
|
|
1897
2011
|
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)),
|
|
1898
2012
|
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(actionElement ? '' : iconStyle, " ").concat(iconPosition, " ").concat(iconSizing) }, iconElement)),
|
|
@@ -1921,7 +2035,7 @@ TextInput.defaultProps = {
|
|
|
1921
2035
|
};
|
|
1922
2036
|
|
|
1923
2037
|
// Desc: Radio button size configuration
|
|
1924
|
-
var sizeConfig$
|
|
2038
|
+
var sizeConfig$b = {
|
|
1925
2039
|
md: {
|
|
1926
2040
|
checkSize: 'w-[22px] h-[22px]',
|
|
1927
2041
|
labelSize: 'text-size-base',
|
|
@@ -1936,7 +2050,7 @@ var sizeUnion$4 = ['md', 'sm'];
|
|
|
1936
2050
|
function Radio(_a) {
|
|
1937
2051
|
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;
|
|
1938
2052
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
1939
|
-
var _f = sizeConfig$
|
|
2053
|
+
var _f = sizeConfig$b[validatedSize], checkSize = _f.checkSize, labelSize = _f.labelSize;
|
|
1940
2054
|
return (React.createElement("div", { className: "flex items-center" },
|
|
1941
2055
|
React.createElement("div", { className: "bg-white rounded-full flex flex-shrink-0 justify-center items-center relative ".concat(checkSize) },
|
|
1942
2056
|
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 }),
|
|
@@ -1952,15 +2066,6 @@ Radio.defaultProps = {
|
|
|
1952
2066
|
checked: false,
|
|
1953
2067
|
};
|
|
1954
2068
|
|
|
1955
|
-
var sizeConfig$9 = {
|
|
1956
|
-
md: {
|
|
1957
|
-
inputClass: 'text-size-base font-[350] min-h-10',
|
|
1958
|
-
},
|
|
1959
|
-
sm: {
|
|
1960
|
-
inputClass: 'text-size-sm min-h-[30px]',
|
|
1961
|
-
},
|
|
1962
|
-
};
|
|
1963
|
-
|
|
1964
2069
|
var ResizeIcon = function (_a) {
|
|
1965
2070
|
var className = _a.className;
|
|
1966
2071
|
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) },
|
|
@@ -1972,16 +2077,23 @@ var ResizeIcon = function (_a) {
|
|
|
1972
2077
|
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" })));
|
|
1973
2078
|
};
|
|
1974
2079
|
|
|
2080
|
+
var sizeConfig$a = {
|
|
2081
|
+
md: {
|
|
2082
|
+
inputClass: 'text-size-base font-[350] min-h-10',
|
|
2083
|
+
},
|
|
2084
|
+
sm: {
|
|
2085
|
+
inputClass: 'text-size-sm min-h-[30px]',
|
|
2086
|
+
},
|
|
2087
|
+
};
|
|
2088
|
+
|
|
1975
2089
|
function TextArea(_a) {
|
|
1976
2090
|
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"]);
|
|
1977
2091
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
1978
|
-
var inputClass = sizeConfig$
|
|
2092
|
+
var inputClass = sizeConfig$a[size].inputClass;
|
|
1979
2093
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
1980
|
-
return (React.createElement("div", { className: "field-group flex w-full flex-col" },
|
|
1981
|
-
React.createElement(
|
|
1982
|
-
|
|
1983
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
1984
|
-
React.createElement("div", { className: "relative h-full w-full min-w-[250px]" },
|
|
2094
|
+
return (React.createElement("div", { className: "field-group group/form flex w-full flex-col gap-y-2" },
|
|
2095
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2096
|
+
React.createElement("div", { className: "relative h-fit w-full min-w-[250px]" },
|
|
1985
2097
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
1986
2098
|
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))),
|
|
1987
2099
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs text-primary-cool" },
|
|
@@ -2005,7 +2117,7 @@ TextArea.defaultProps = {
|
|
|
2005
2117
|
value: '',
|
|
2006
2118
|
};
|
|
2007
2119
|
|
|
2008
|
-
var sizeConfig$
|
|
2120
|
+
var sizeConfig$9 = {
|
|
2009
2121
|
md: {
|
|
2010
2122
|
checkClass: 'w-[22px] h-[22px]',
|
|
2011
2123
|
labelClass: 'text-size-base font-[350]',
|
|
@@ -2019,7 +2131,7 @@ var sizeConfig$8 = {
|
|
|
2019
2131
|
var sizeUnion$3 = ['md', 'sm'];
|
|
2020
2132
|
function Checkbox(_a) {
|
|
2021
2133
|
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"]);
|
|
2022
|
-
var _e = sizeConfig$
|
|
2134
|
+
var _e = sizeConfig$9[validUnion(size, sizeUnion$3)], checkClass = _e.checkClass, labelClass = _e.labelClass;
|
|
2023
2135
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2024
2136
|
React.createElement("div", { className: "relative flex flex-shrink-0 items-center justify-center rounded-full bg-white ".concat(checkClass) },
|
|
2025
2137
|
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)),
|
|
@@ -2037,7 +2149,7 @@ Checkbox.defaultProps = {
|
|
|
2037
2149
|
onChange: function () { },
|
|
2038
2150
|
};
|
|
2039
2151
|
|
|
2040
|
-
var sizeConfig$
|
|
2152
|
+
var sizeConfig$8 = {
|
|
2041
2153
|
md: {
|
|
2042
2154
|
searchSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2043
2155
|
iconSize: 'right-[10px] text-[18px]',
|
|
@@ -2048,7 +2160,7 @@ var sizeConfig$7 = {
|
|
|
2048
2160
|
},
|
|
2049
2161
|
};
|
|
2050
2162
|
|
|
2051
|
-
var sizeConfig$
|
|
2163
|
+
var sizeConfig$7 = {
|
|
2052
2164
|
md: {
|
|
2053
2165
|
container: 'text-size-base font-[350] py-[3px] first:pt-[8px] last:pb-[8px]',
|
|
2054
2166
|
item: 'min-h-[34px] p-2.5',
|
|
@@ -2066,7 +2178,7 @@ function CustomDropdownItem(_a) {
|
|
|
2066
2178
|
var _f = React.useState(false), isHoveredSubMenu = _f[0], setIsHoveredSubMenu = _f[1];
|
|
2067
2179
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2068
2180
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2069
|
-
var _g = sizeConfig$
|
|
2181
|
+
var _g = sizeConfig$7[size], containerClass = _g.container, item = _g.item;
|
|
2070
2182
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2071
2183
|
var isExistSubDropdown = options.length !== 0;
|
|
2072
2184
|
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 () { } },
|
|
@@ -2093,7 +2205,7 @@ function DefaultDropdownItem(_a) {
|
|
|
2093
2205
|
var _g = React.useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
2094
2206
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2095
2207
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2096
|
-
var _h = sizeConfig$
|
|
2208
|
+
var _h = sizeConfig$7[size], containerClass = _h.container, item = _h.item;
|
|
2097
2209
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2098
2210
|
var isExistSubDropdown = options.length !== 0;
|
|
2099
2211
|
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 () { } },
|
|
@@ -2204,7 +2316,7 @@ function SelectInput(_a) {
|
|
|
2204
2316
|
var _k = React.useState(false), isOpen = _k[0], setIsOpen = _k[1];
|
|
2205
2317
|
var _l = React.useState(false), isDropUp = _l[0], setIsDropUp = _l[1];
|
|
2206
2318
|
var validatedSize = validUnion(size, sizeUnion$2);
|
|
2207
|
-
var _m = sizeConfig$
|
|
2319
|
+
var _m = sizeConfig$8[validatedSize], searchSize = _m.searchSize, iconSize = _m.iconSize;
|
|
2208
2320
|
var inputRef = React.useRef(null);
|
|
2209
2321
|
var dropdownContRef = React.useRef(null);
|
|
2210
2322
|
var handleOutsideClick = function (e) {
|
|
@@ -2298,7 +2410,7 @@ SelectInput.defaultProps = {
|
|
|
2298
2410
|
setSelected: function () { },
|
|
2299
2411
|
};
|
|
2300
2412
|
|
|
2301
|
-
var sizeConfig$
|
|
2413
|
+
var sizeConfig$6 = {
|
|
2302
2414
|
md: {
|
|
2303
2415
|
iconClass: 'right-[10px]',
|
|
2304
2416
|
iconSize: '18',
|
|
@@ -2317,7 +2429,7 @@ function LiveSearch(_a) {
|
|
|
2317
2429
|
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;
|
|
2318
2430
|
var _l = React.useState(false), isOpen = _l[0], setIsOpen = _l[1];
|
|
2319
2431
|
var _m = React.useState(value.label || ''), searchTerm = _m[0], setSearchTerm = _m[1];
|
|
2320
|
-
var _o = sizeConfig$
|
|
2432
|
+
var _o = sizeConfig$6[size], iconClass = _o.iconClass, iconSize = _o.iconSize, inputClass = _o.inputClass;
|
|
2321
2433
|
var dropContClassName = dropContProps.className, restDropContProps = __rest(dropContProps, ["className"]);
|
|
2322
2434
|
var isValueExist = value && value.label !== undefined && value.label !== '';
|
|
2323
2435
|
var inputRef = React.useRef(null);
|
|
@@ -2424,10 +2536,8 @@ function LiveSearch(_a) {
|
|
|
2424
2536
|
React.Children.toArray(renderedChildren).filter(Boolean).length > 0; // Should always be true if there are initial children
|
|
2425
2537
|
}
|
|
2426
2538
|
var dropdownPosition = isDropUp ? 'bottom-full' : 'top-full';
|
|
2427
|
-
return (React.createElement("div", { className: "bianic-livesearch field-group flex w-full flex-col gap-y-2", ref: inputRef },
|
|
2428
|
-
React.createElement(
|
|
2429
|
-
label,
|
|
2430
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
|
|
2539
|
+
return (React.createElement("div", { className: "bianic-livesearch field-group group/form flex w-full flex-col gap-y-2 ", ref: inputRef },
|
|
2540
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2431
2541
|
React.createElement("div", { className: "group relative w-full" },
|
|
2432
2542
|
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) {
|
|
2433
2543
|
onChangeText(e);
|
|
@@ -2452,7 +2562,7 @@ function LiveSearch(_a) {
|
|
|
2452
2562
|
? renderedChildren
|
|
2453
2563
|
: // If no results and searchTerm is present
|
|
2454
2564
|
searchTerm.length > 0 && (React.createElement(DropdownItem, { content: React.createElement("div", { className: "px-4 py-2 text-gray-500" }, "Tidak ada hasil ditemukan.") }))))),
|
|
2455
|
-
React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText)));
|
|
2565
|
+
descText && (React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText))));
|
|
2456
2566
|
}
|
|
2457
2567
|
LiveSearch.defaultProps = {
|
|
2458
2568
|
descText: '',
|
|
@@ -2468,7 +2578,7 @@ LiveSearch.defaultProps = {
|
|
|
2468
2578
|
readonly: false,
|
|
2469
2579
|
};
|
|
2470
2580
|
|
|
2471
|
-
var sizeConfig$
|
|
2581
|
+
var sizeConfig$5 = {
|
|
2472
2582
|
md: {
|
|
2473
2583
|
containerSize: 'w-[42px] h-[22px]',
|
|
2474
2584
|
checkSize: 'p-2',
|
|
@@ -2483,7 +2593,7 @@ var sizeConfig$4 = {
|
|
|
2483
2593
|
|
|
2484
2594
|
function Toggle(_a) {
|
|
2485
2595
|
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;
|
|
2486
|
-
var _h = sizeConfig$
|
|
2596
|
+
var _h = sizeConfig$5[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
|
|
2487
2597
|
return (React.createElement("div", { className: "flex items-center" },
|
|
2488
2598
|
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 },
|
|
2489
2599
|
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" }),
|
|
@@ -2509,7 +2619,7 @@ var roundedConfig = {
|
|
|
2509
2619
|
sm: 'first:rounded-l-radius-sm last:rounded-r-radius-sm',
|
|
2510
2620
|
tn: 'first:rounded-l-radius-tn last:rounded-r-radius-tn',
|
|
2511
2621
|
};
|
|
2512
|
-
var sizeConfig$
|
|
2622
|
+
var sizeConfig$4 = {
|
|
2513
2623
|
lg: 'text-size-md leading-[23.94px] px-[13px] py-[11px] ',
|
|
2514
2624
|
md: 'text-size-base leading-[21px] px-[11px] py-[8.5px] ',
|
|
2515
2625
|
sm: 'text-size-sm leading-[15.96px] px-[7px] py-[6px] ',
|
|
@@ -2532,8 +2642,8 @@ function SegmentButtonItem(_a) {
|
|
|
2532
2642
|
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;
|
|
2533
2643
|
var isSelected = selected ? 'selected' : 'notSelected';
|
|
2534
2644
|
var sizingStyle = isfitContent
|
|
2535
|
-
? "".concat(sizeConfig$
|
|
2536
|
-
: "".concat(sizeConfig$
|
|
2645
|
+
? "".concat(sizeConfig$4[size], " ").concat(minHeightConfig[size])
|
|
2646
|
+
: "".concat(sizeConfig$4[size], " ").concat(minWidthConfig[size], " ").concat(minHeightConfig[size]);
|
|
2537
2647
|
var radiusStyle = "".concat(roundedConfig[size]);
|
|
2538
2648
|
var selectedStyle = "".concat(isSelectedConfig[isSelected]);
|
|
2539
2649
|
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));
|
|
@@ -2581,7 +2691,7 @@ var todayValue = Date.now() -
|
|
|
2581
2691
|
(Date.now() % oneDayValue) +
|
|
2582
2692
|
new Date().getTimezoneOffset() * 1000 * 60; // today in milliseconds
|
|
2583
2693
|
var PickerCalendar = function (_a) {
|
|
2584
|
-
var
|
|
2694
|
+
var _b = _a.selectedDate, selectedDate = _b === void 0 ? null : _b, onDateChange = _a.onDateChange, ref = _a.ref;
|
|
2585
2695
|
// Constants
|
|
2586
2696
|
var daysMap = [
|
|
2587
2697
|
'Monday',
|
|
@@ -2608,8 +2718,8 @@ var PickerCalendar = function (_a) {
|
|
|
2608
2718
|
];
|
|
2609
2719
|
var modeMap = ['date', 'year', 'month'];
|
|
2610
2720
|
// Mode Controller
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2721
|
+
var _c = React.useState(modeMap[0]), pickerMode = _c[0], setPickerMode = _c[1];
|
|
2722
|
+
var _d = React.useState(''), prevMode = _d[0], setPrevMode = _d[1];
|
|
2613
2723
|
// styling constants and functions
|
|
2614
2724
|
var chevronButtonStyle = 'text-bia-coolgrey';
|
|
2615
2725
|
var selectedDateStyle = function (date, dateSelected) {
|
|
@@ -2725,9 +2835,9 @@ var PickerCalendar = function (_a) {
|
|
|
2725
2835
|
});
|
|
2726
2836
|
};
|
|
2727
2837
|
// View Date Logic
|
|
2728
|
-
var
|
|
2729
|
-
var
|
|
2730
|
-
var
|
|
2838
|
+
var _e = React.useState(new Date(selectedDate || todayValue).getMonth()), viewMonthValue = _e[0], setViewMonthValue = _e[1]; // get the month of the selected date
|
|
2839
|
+
var _f = React.useState(new Date(selectedDate || todayValue).getFullYear()), viewYearValue = _f[0], setViewYearValue = _f[1]; // get the year of the selected date
|
|
2840
|
+
var _g = React.useState(new Date(selectedDate || todayValue).getFullYear()), viewDecadeValue = _g[0], setViewDecadeValue = _g[1]; // get the year for decaderange
|
|
2731
2841
|
// Month view logic
|
|
2732
2842
|
var monthStartDay = new Date("".concat(viewYearValue, "-").concat(viewMonthValue + 1, "-01")).getDay() === 0
|
|
2733
2843
|
? 6
|
|
@@ -2739,7 +2849,7 @@ var PickerCalendar = function (_a) {
|
|
|
2739
2849
|
var viewLastDate = new Date(viewFirstDate);
|
|
2740
2850
|
viewLastDate.setDate(viewLastDate.getDate() + monthCalenderView - 1); // get the last date of the view
|
|
2741
2851
|
// Generate the view days array
|
|
2742
|
-
var
|
|
2852
|
+
var _h = React.useState([]), displayDays = _h[0], setDisplayDays = _h[1];
|
|
2743
2853
|
function getDecadeRange(year) {
|
|
2744
2854
|
// Calculate the start of the decade
|
|
2745
2855
|
var startOfDecade = Math.floor(year / 10) * 10;
|
|
@@ -2755,13 +2865,13 @@ var PickerCalendar = function (_a) {
|
|
|
2755
2865
|
var yearDisplayRange = getDecadeRange(viewDecadeValue);
|
|
2756
2866
|
// Variable display
|
|
2757
2867
|
var dateDisplay = (React.createElement("div", { className: "".concat(pickerMode === 'date' ? '' : 'hidden') },
|
|
2758
|
-
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" },
|
|
2868
|
+
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" },
|
|
2759
2869
|
React.createElement(Text, { variant: "small-text" }, day.slice(0, 3)))); })),
|
|
2760
2870
|
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 () {
|
|
2761
2871
|
// Handle date selection logic here
|
|
2762
2872
|
handleSetSelectedDate(date);
|
|
2763
2873
|
} },
|
|
2764
|
-
React.createElement(Text, { variant: "small-text" }, date.getDate()))); }))));
|
|
2874
|
+
React.createElement(Text, { variant: "small-text", extended: checkDateEquals(date, selectedDate) ? 'text-bia-white' : '' }, date.getDate()))); }))));
|
|
2765
2875
|
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); } },
|
|
2766
2876
|
React.createElement(Text, { variant: "small-text" }, month.slice(0, 3)))); })));
|
|
2767
2877
|
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); } },
|
|
@@ -2810,20 +2920,20 @@ var monthMap = [
|
|
|
2810
2920
|
'December',
|
|
2811
2921
|
];
|
|
2812
2922
|
function DatePicker(_a) {
|
|
2813
|
-
var value = _a.value, onChange = _a.onChange;
|
|
2923
|
+
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;
|
|
2814
2924
|
// State and Ref
|
|
2815
2925
|
var inputRef = React.useRef(null);
|
|
2816
2926
|
var wrapperRef = React.useRef(null);
|
|
2817
2927
|
var pickerRef = React.useRef(null);
|
|
2818
|
-
var
|
|
2928
|
+
var _c = useDetectOutsideClick(wrapperRef, false, pickerRef), isPickerOpen = _c[0], setIsPickerOpen = _c[1];
|
|
2819
2929
|
return (React.createElement("div", { className: "bianic-datepicker-container relative", ref: wrapperRef },
|
|
2820
2930
|
React.createElement("div", { className: "bianic-datepicker-field-container" },
|
|
2821
|
-
React.createElement(DateInput, { ref: inputRef, placeholder:
|
|
2931
|
+
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 })),
|
|
2822
2932
|
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" },
|
|
2823
2933
|
React.createElement(PickerCalendar, { selectedDate: new Date(value), onDateChange: onChange, ref: pickerRef })))));
|
|
2824
2934
|
}
|
|
2825
2935
|
var DateInput = function (_a) {
|
|
2826
|
-
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"]);
|
|
2936
|
+
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"]);
|
|
2827
2937
|
var editDateFormatter = function (date) {
|
|
2828
2938
|
var localString = date.toLocaleDateString().split('/');
|
|
2829
2939
|
return localString.reverse().join('-');
|
|
@@ -2833,41 +2943,13 @@ var DateInput = function (_a) {
|
|
|
2833
2943
|
};
|
|
2834
2944
|
// Convert Date to string for display
|
|
2835
2945
|
var formattedValue = value instanceof Date ? displayDateFormatter(value) : value;
|
|
2836
|
-
var
|
|
2946
|
+
var _e = React.useState(formattedValue), viewValue = _e[0], setViewValue = _e[1];
|
|
2837
2947
|
React.useRef(null);
|
|
2838
|
-
var
|
|
2839
|
-
var
|
|
2840
|
-
var
|
|
2948
|
+
var _f = React.useState(0); _f[0]; _f[1];
|
|
2949
|
+
var _g = styleConfig['text'], fieldStyle = _g.fieldStyle;
|
|
2950
|
+
var _h = sizeConfig$c[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
2841
2951
|
var borderStyle = 'border border-bia-grey-dark-10 bg-primary-white';
|
|
2842
2952
|
var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(borderStyle, " ").concat(className);
|
|
2843
|
-
var labelStatus = props.readOnly ? 'read-only:pointer-events-none' : '';
|
|
2844
|
-
// Don't remove this, it will be used later
|
|
2845
|
-
// Helper function to format the cleaned input with specific group sizes
|
|
2846
|
-
// const formatInput = (cleanedValue: string, separator: string = '-') => {
|
|
2847
|
-
// let formattedValue = ''
|
|
2848
|
-
// // Define the group lengths: 4, 2, 2
|
|
2849
|
-
// const groupLengths = [4, 2, 2]
|
|
2850
|
-
// let currentIndex = 0
|
|
2851
|
-
// for (let i = 0; i < groupLengths.length; i++) {
|
|
2852
|
-
// const groupLength = groupLengths[i]
|
|
2853
|
-
// const nextSegment = cleanedValue.substring(
|
|
2854
|
-
// currentIndex,
|
|
2855
|
-
// currentIndex + groupLength
|
|
2856
|
-
// )
|
|
2857
|
-
// if (nextSegment.length > 0) {
|
|
2858
|
-
// formattedValue += nextSegment
|
|
2859
|
-
// currentIndex += groupLength
|
|
2860
|
-
// // Add separator if there are more groups to follow and we have enough characters
|
|
2861
|
-
// if (i < groupLengths.length - 1 && currentIndex < cleanedValue.length) {
|
|
2862
|
-
// formattedValue += separator
|
|
2863
|
-
// }
|
|
2864
|
-
// } else {
|
|
2865
|
-
// // Stop if there are no more characters for the current group
|
|
2866
|
-
// break
|
|
2867
|
-
// }
|
|
2868
|
-
// }
|
|
2869
|
-
// return formattedValue
|
|
2870
|
-
// }
|
|
2871
2953
|
var validateAndFormatDate = function (value) {
|
|
2872
2954
|
// 1. validate separator
|
|
2873
2955
|
var splittedDate = value.split('-');
|
|
@@ -2920,56 +3002,6 @@ var DateInput = function (_a) {
|
|
|
2920
3002
|
onChange(date); // Update the value if it's a valid date
|
|
2921
3003
|
}
|
|
2922
3004
|
};
|
|
2923
|
-
// Handle input change will develop later don't remove
|
|
2924
|
-
// const handleChange = (event) => {
|
|
2925
|
-
// const inputElement = event.target
|
|
2926
|
-
// const rawValue = inputElement.value
|
|
2927
|
-
// const currentCursorPos = inputElement.selectionStart
|
|
2928
|
-
// const cleaned = cleanInput(rawValue)
|
|
2929
|
-
// // Max total digits for XXXX-XX-XX is 4 + 2 + 2 = 8
|
|
2930
|
-
// const maxDigits = 8
|
|
2931
|
-
// const truncatedCleaned = cleaned.substring(0, maxDigits)
|
|
2932
|
-
// const formatted = formatInput(truncatedCleaned)
|
|
2933
|
-
// // --- Cursor Position Adjustment Logic ---
|
|
2934
|
-
// let newCursorPos = currentCursorPos
|
|
2935
|
-
// const prevFormattedLength = viewValue.length // Length of the string *before* update
|
|
2936
|
-
// const currentFormattedLength = formatted.length // Length of the string *after* update
|
|
2937
|
-
// // If text was added and formatted length increased
|
|
2938
|
-
// if (currentFormattedLength > prevFormattedLength) {
|
|
2939
|
-
// // Count how many separators are now *before* the cursor in the new string
|
|
2940
|
-
// // We'll compare the raw cursor position with the formatted string to adjust
|
|
2941
|
-
// let separatorCountBeforeCursor = 0
|
|
2942
|
-
// let originalCleanedValue = cleanInput(viewValue) // Clean value before this change
|
|
2943
|
-
// // If a character was inserted, estimate new cursor position
|
|
2944
|
-
// if (cleaned.length > originalCleanedValue.length) {
|
|
2945
|
-
// // Count separators in the *new* formatted string up to the currentCursorPos
|
|
2946
|
-
// for (let i = 0; i < currentCursorPos; i++) {
|
|
2947
|
-
// if (formatted.charAt(i) === '-') {
|
|
2948
|
-
// separatorCountBeforeCursor++
|
|
2949
|
-
// }
|
|
2950
|
-
// }
|
|
2951
|
-
// newCursorPos = currentCursorPos + separatorCountBeforeCursor
|
|
2952
|
-
// } else {
|
|
2953
|
-
// // If characters were deleted (backspace/delete)
|
|
2954
|
-
// newCursorPos = currentCursorPos
|
|
2955
|
-
// // More sophisticated logic for backspace/delete on separators can go here.
|
|
2956
|
-
// // For example, if you backspace a digit and it causes a separator to disappear,
|
|
2957
|
-
// // the cursor might need to jump back an extra position.
|
|
2958
|
-
// // This basic setup often works acceptably for most cases.
|
|
2959
|
-
// }
|
|
2960
|
-
// } else {
|
|
2961
|
-
// // If text was deleted or no change in length
|
|
2962
|
-
// newCursorPos = currentCursorPos
|
|
2963
|
-
// }
|
|
2964
|
-
// const handleKeyDown = (event) => {
|
|
2965
|
-
// if (event.key === 'Enter') {
|
|
2966
|
-
// // Prevent default form submission if the input is inside a <form>
|
|
2967
|
-
// // event.preventDefault();
|
|
2968
|
-
// }
|
|
2969
|
-
// }
|
|
2970
|
-
// setViewValue(formatted)
|
|
2971
|
-
// setLastCursorPos(newCursorPos)
|
|
2972
|
-
// }
|
|
2973
3005
|
var handleChange = function (event) {
|
|
2974
3006
|
var value = event.target.value;
|
|
2975
3007
|
// Regular expression to allow only numbers (0-9) and hyphens (-)
|
|
@@ -2980,25 +3012,16 @@ var DateInput = function (_a) {
|
|
|
2980
3012
|
setViewValue(value);
|
|
2981
3013
|
}
|
|
2982
3014
|
};
|
|
2983
|
-
// Will Develop later
|
|
2984
|
-
// useEffect to set cursor position after render
|
|
2985
|
-
// useEffect(() => {
|
|
2986
|
-
// if (inputRef.current) {
|
|
2987
|
-
// inputRef.current.setSelectionRange(lastCursorPos, lastCursorPos)
|
|
2988
|
-
// }
|
|
2989
|
-
// }, [viewValue, lastCursorPos]) // Re-run when viewValue or lastCursorPos changes
|
|
2990
3015
|
React.useEffect(function () {
|
|
2991
3016
|
setViewValue(formattedValue);
|
|
2992
3017
|
}, [value]);
|
|
2993
|
-
return (React.createElement("div", { className: "bianic-date-input-container bianic-fgc-container flex w-full flex-col gap-y-2 text-bia-black" },
|
|
2994
|
-
label && (React.createElement(
|
|
2995
|
-
label,
|
|
2996
|
-
required && React.createElement("span", { className: "p-1 text-bia-red" }, "*"))),
|
|
3018
|
+
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 " },
|
|
3019
|
+
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2997
3020
|
React.createElement("div", { className: "relative w-full" },
|
|
2998
|
-
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
|
|
3021
|
+
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 () {
|
|
2999
3022
|
setIsActive && setIsActive(true);
|
|
3000
3023
|
setViewValue(editDateFormatter(value));
|
|
3001
|
-
},
|
|
3024
|
+
}, onBlur: function () {
|
|
3002
3025
|
var _a = validateAndFormatDate(viewValue), status = _a[0], validatedValue = _a[1];
|
|
3003
3026
|
setViewValue(displayDateFormatter(value));
|
|
3004
3027
|
if (status !== 0) ;
|
|
@@ -3006,11 +3029,12 @@ var DateInput = function (_a) {
|
|
|
3006
3029
|
updateValue(validatedValue);
|
|
3007
3030
|
}
|
|
3008
3031
|
}, maxLength: 10 })),
|
|
3009
|
-
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 text-
|
|
3010
|
-
React.createElement("button", { className: "bianic-datepicker-toggle-button", onClick: function () {
|
|
3032
|
+
React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 text-bia-coolgrey ".concat(iconPosition) },
|
|
3033
|
+
React.createElement("button", { className: "bianic-datepicker-toggle-button", disabled: disabled, onClick: function () {
|
|
3011
3034
|
buttonAction && buttonAction();
|
|
3012
3035
|
} },
|
|
3013
|
-
React.createElement(TbCalendar,
|
|
3036
|
+
React.createElement(TbCalendar, { size: iconSize })))),
|
|
3037
|
+
descText && (React.createElement("span", { className: "desc text-xs text-primary-cool" }, descText))));
|
|
3014
3038
|
};
|
|
3015
3039
|
|
|
3016
3040
|
var Node = function (_a) {
|
|
@@ -3178,9 +3202,9 @@ var Outlet = function (_a) {
|
|
|
3178
3202
|
};
|
|
3179
3203
|
|
|
3180
3204
|
var Inlet = function (_a) {
|
|
3181
|
-
_a.className
|
|
3205
|
+
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
3182
3206
|
var numericSize = Number(size);
|
|
3183
|
-
return (React.createElement("svg", { width: numericSize * 2, height: numericSize, viewBox: "0 0 48 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
3207
|
+
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" },
|
|
3184
3208
|
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" }),
|
|
3185
3209
|
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" })));
|
|
3186
3210
|
};
|
|
@@ -3189,8 +3213,35 @@ var Neutral = function (_a) {
|
|
|
3189
3213
|
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
3190
3214
|
var numericSize = Number(size);
|
|
3191
3215
|
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" },
|
|
3192
|
-
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: "
|
|
3193
|
-
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: "
|
|
3216
|
+
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" }),
|
|
3217
|
+
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" })));
|
|
3218
|
+
};
|
|
3219
|
+
|
|
3220
|
+
var colorConfig$1 = {
|
|
3221
|
+
yellow: 'bg-bia-yellow-light-80',
|
|
3222
|
+
blue: 'bg-bia-sky-light-90',
|
|
3223
|
+
grey: 'bg-bia-grey-light-80',
|
|
3224
|
+
white: 'bg-bia-white border border-bia-grey',
|
|
3225
|
+
};
|
|
3226
|
+
var sizeConfig$3 = {
|
|
3227
|
+
container: 'min-h-fit p-5 text-wrap',
|
|
3228
|
+
'form-sm': 'h-[30px] whitespace-nowrap px-2.5',
|
|
3229
|
+
'form-md': 'h-10 whitespace-nowrap px-2.5',
|
|
3230
|
+
};
|
|
3231
|
+
|
|
3232
|
+
var InfoPanel = function (_a) {
|
|
3233
|
+
var variant = _a.variant, color = _a.color, className = _a.className, textClassName = _a.textClassName;
|
|
3234
|
+
var sizeClass = sizeConfig$3[variant || 'container'];
|
|
3235
|
+
var colorClass = colorConfig$1[color || 'yellow'];
|
|
3236
|
+
var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
|
|
3237
|
+
return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) },
|
|
3238
|
+
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.")));
|
|
3239
|
+
};
|
|
3240
|
+
InfoPanel.defaultProps = {
|
|
3241
|
+
variant: 'container',
|
|
3242
|
+
color: 'yellow',
|
|
3243
|
+
className: '',
|
|
3244
|
+
textClassName: '',
|
|
3194
3245
|
};
|
|
3195
3246
|
|
|
3196
3247
|
function Modal(_a) {
|
|
@@ -3318,7 +3369,7 @@ Pills.defaultProps = {
|
|
|
3318
3369
|
iconRight: null,
|
|
3319
3370
|
};
|
|
3320
3371
|
|
|
3321
|
-
var classConfig
|
|
3372
|
+
var classConfig = {
|
|
3322
3373
|
top: {
|
|
3323
3374
|
tooltipContainer: 'bottom-[calc(100%+10px)] left-1/2 -translate-x-1/2',
|
|
3324
3375
|
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
@@ -3365,7 +3416,7 @@ function Popover(_a) {
|
|
|
3365
3416
|
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;
|
|
3366
3417
|
var wrapperRef = React.useRef(null);
|
|
3367
3418
|
var _e = useDetectOutsideClick(wrapperRef, false), isOpen = _e[0], setIsOpen = _e[1];
|
|
3368
|
-
var _f = classConfig
|
|
3419
|
+
var _f = classConfig[direction], tooltipContainer = _f.tooltipContainer, triangleContainer = _f.triangleContainer, triangleShape = _f.triangleShape;
|
|
3369
3420
|
return (React.createElement("div", { className: "Bianic-popover-Wrapper relative block h-fit w-fit", role: "button", ref: wrapperRef, onClick: function () { return setIsOpen(true); } },
|
|
3370
3421
|
children,
|
|
3371
3422
|
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) },
|
|
@@ -3853,111 +3904,6 @@ TagLabel.defaultProps = {
|
|
|
3853
3904
|
isDark: false,
|
|
3854
3905
|
};
|
|
3855
3906
|
|
|
3856
|
-
var classConfig = {
|
|
3857
|
-
top: {
|
|
3858
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
3859
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3860
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3861
|
-
},
|
|
3862
|
-
right: {
|
|
3863
|
-
tooltipContainer: 'left-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
3864
|
-
triangleContainer: '-left-[4px] bottom-0 flex items-center w-auto h-full',
|
|
3865
|
-
triangleShape: 'border-t-[8px] border-t-transparent border-r-[5px] border-r-primary-black border-b-[8px] border-b-transparent',
|
|
3866
|
-
},
|
|
3867
|
-
bottom: {
|
|
3868
|
-
tooltipContainer: 'top-[calc(100%+5px)] left-1/2 -translate-x-1/2',
|
|
3869
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3870
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3871
|
-
},
|
|
3872
|
-
left: {
|
|
3873
|
-
tooltipContainer: 'right-[calc(100%+5px)] top-1/2 -translate-y-1/2',
|
|
3874
|
-
triangleContainer: '-right-[4px] bottom-0 flex items-center w-auto h-full',
|
|
3875
|
-
triangleShape: 'border-t-[8px] border-t-transparent border-l-[5px] border-l-primary-black border-b-[8px] border-b-transparent',
|
|
3876
|
-
},
|
|
3877
|
-
'top-right': {
|
|
3878
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] right-0',
|
|
3879
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3880
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3881
|
-
},
|
|
3882
|
-
'top-left': {
|
|
3883
|
-
tooltipContainer: 'bottom-[calc(100%+5px)] left-0',
|
|
3884
|
-
triangleContainer: 'left-0 -bottom-[4px] flex justify-center w-full h-auto',
|
|
3885
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-t-[5px] border-t-primary-black border-r-[8px] border-r-transparent',
|
|
3886
|
-
},
|
|
3887
|
-
'bottom-right': {
|
|
3888
|
-
tooltipContainer: 'top-[calc(100%+5px)] right-0',
|
|
3889
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3890
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3891
|
-
},
|
|
3892
|
-
'bottom-left': {
|
|
3893
|
-
tooltipContainer: 'top-[calc(100%+5px)] left-0',
|
|
3894
|
-
triangleContainer: 'left-0 -top-[4px] flex justify-center w-full h-auto',
|
|
3895
|
-
triangleShape: 'border-l-[8px] border-l-transparent border-b-[5px] border-b-primary-black border-r-[8px] border-r-transparent',
|
|
3896
|
-
},
|
|
3897
|
-
};
|
|
3898
|
-
|
|
3899
|
-
function Tooltip(props) {
|
|
3900
|
-
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;
|
|
3901
|
-
var timeout;
|
|
3902
|
-
var _c = React.useState(false), active = _c[0], setActive = _c[1];
|
|
3903
|
-
var showTip = function () {
|
|
3904
|
-
timeout = setTimeout(function () {
|
|
3905
|
-
setActive(true);
|
|
3906
|
-
}, delay || 400);
|
|
3907
|
-
};
|
|
3908
|
-
var hideTip = function () {
|
|
3909
|
-
clearInterval(timeout);
|
|
3910
|
-
setActive(false);
|
|
3911
|
-
};
|
|
3912
|
-
var _d = classConfig[direction], tooltipContainer = _d.tooltipContainer; _d.triangleContainer; _d.triangleShape;
|
|
3913
|
-
var tooltipContainerRef = React.useRef(null);
|
|
3914
|
-
var _e = React.useState({
|
|
3915
|
-
maxWidth: maxWidth + 'px',
|
|
3916
|
-
whiteSpace: 'nowrap',
|
|
3917
|
-
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
3918
|
-
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
3919
|
-
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
3920
|
-
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
3921
|
-
var offsetHeight = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetHeight;
|
|
3922
|
-
React.useEffect(function () {
|
|
3923
|
-
if (scrollWidth && offsetWidth) {
|
|
3924
|
-
var maxWidthNumber = Number(maxWidth);
|
|
3925
|
-
var isMultiLine = offsetHeight > 23; // 23 pixels is the approximate height of one line of text
|
|
3926
|
-
// Tooltip Width and Whitespace Determination Rules:
|
|
3927
|
-
// 1. Default Condition:
|
|
3928
|
-
// - width: fit-content
|
|
3929
|
-
// - whiteSpace: nowrap
|
|
3930
|
-
// 2. When maxWidth is Set:
|
|
3931
|
-
// * Text Exceeds maxWidth:
|
|
3932
|
-
// - width: maxWidth
|
|
3933
|
-
// - whiteSpace: normal
|
|
3934
|
-
// * Text Equals maxWidth (Multi-line):
|
|
3935
|
-
// - width: maxWidth
|
|
3936
|
-
// - whiteSpace: normal
|
|
3937
|
-
// * Text Less Than maxWidth:
|
|
3938
|
-
// - width: fit-content
|
|
3939
|
-
// - whiteSpace: nowrap
|
|
3940
|
-
var newWidth_1 = 'fit-content';
|
|
3941
|
-
var newWhiteSpace_1 = 'nowrap';
|
|
3942
|
-
if (scrollWidth > maxWidthNumber ||
|
|
3943
|
-
(offsetWidth === maxWidthNumber && isMultiLine)) {
|
|
3944
|
-
newWidth_1 = maxWidthNumber + 'px';
|
|
3945
|
-
newWhiteSpace_1 = 'normal';
|
|
3946
|
-
}
|
|
3947
|
-
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
3948
|
-
}
|
|
3949
|
-
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
3950
|
-
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip },
|
|
3951
|
-
children,
|
|
3952
|
-
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))));
|
|
3953
|
-
}
|
|
3954
|
-
Tooltip.defaultProps = {
|
|
3955
|
-
delay: 400,
|
|
3956
|
-
direction: 'top',
|
|
3957
|
-
maxWidth: '300',
|
|
3958
|
-
};
|
|
3959
|
-
Tooltip.defaultProps = {};
|
|
3960
|
-
|
|
3961
3907
|
var colorConfigs = {
|
|
3962
3908
|
default: 'bg-bia-black',
|
|
3963
3909
|
info: 'bg-bia-teal',
|
|
@@ -3978,7 +3924,7 @@ function Toaster(_a) {
|
|
|
3978
3924
|
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]" },
|
|
3979
3925
|
icon && React.createElement("div", { className: "bianic-toaster-icon-area" }, icon),
|
|
3980
3926
|
React.createElement("div", { className: "bianic-toaster-description-area text-[12px] font-normal leading-[134%]" }, children)));
|
|
3981
|
-
return (React.createElement("div", { className: "bianic-toaster flex
|
|
3927
|
+
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) },
|
|
3982
3928
|
React.createElement("span", { className: "mr-[10px] flex min-w-[3px] rounded-r-[10px] bg-bia-white/50" }),
|
|
3983
3929
|
content,
|
|
3984
3930
|
React.createElement("div", { className: "flex items-start pr-[11px] pt-[1px]" },
|
|
@@ -4057,6 +4003,7 @@ exports.FormGroup = FormGroup;
|
|
|
4057
4003
|
exports.FormGroupButton = FormGroupButton;
|
|
4058
4004
|
exports.FormGroupLabel = FormGroupLabel;
|
|
4059
4005
|
exports.Heading = Heading;
|
|
4006
|
+
exports.InfoPanel = InfoPanel;
|
|
4060
4007
|
exports.Link = Link;
|
|
4061
4008
|
exports.LiveSearch = LiveSearch;
|
|
4062
4009
|
exports.MenuContainer = MenuContainer;
|