bianic-ui 2.12.0-alpha.0 → 2.12.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 +678 -219
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Button/Button.d.ts +1 -0
- package/dist/cjs/types/components/Button/PropInterfaceButton.d.ts +15 -10
- package/dist/cjs/types/components/Countdown/index.d.ts +11 -0
- package/dist/cjs/types/components/Forms/FileUploader/DropzoneFileUploader.d.ts +11 -0
- package/dist/cjs/types/components/Forms/FileUploader/SimpleFileUploader.d.ts +11 -0
- package/dist/cjs/types/components/Forms/FileUploader/index.d.ts +2 -0
- package/dist/cjs/types/components/Forms/FileUploader/useFileHandler.d.ts +35 -0
- package/dist/cjs/types/components/Forms/Radio/configs.d.ts +11 -6
- package/dist/cjs/types/components/Forms/Radio/index.d.ts +9 -14
- package/dist/cjs/types/components/Forms/TagLabelInput/configs.d.ts +13 -0
- package/dist/cjs/types/components/Forms/TagLabelInput/hooks/useLiveSearch.d.ts +9 -0
- package/dist/cjs/types/components/Forms/TagLabelInput/index.d.ts +31 -0
- package/dist/cjs/types/components/Forms/TagLabelInput/utils/dropdownUtils.d.ts +9 -0
- package/dist/cjs/types/components/Forms/TextArea/index.d.ts +1 -15
- package/dist/cjs/types/components/Forms/index.d.ts +2 -0
- package/dist/cjs/types/components/Stepper/Horizontal/index.d.ts +21 -0
- package/dist/cjs/types/components/Tooltip/PropsInterface.d.ts +1 -1
- package/dist/cjs/types/components/index.d.ts +1 -1
- package/dist/cjs/types/stories/Form/FileUploader/DropzoneFileUploader.stories.d.ts +12 -0
- package/dist/cjs/types/stories/Form/FileUploader/SimpleFileUploader.stories.d.ts +10 -0
- package/dist/cjs/types/stories/Form/Radio.stories.d.ts +1 -2
- package/dist/cjs/types/stories/Form/TagLabelInput/TagLabelInput.stories.d.ts +48 -0
- package/dist/cjs/types/stories/Form/TextArea/TextArea.stories.d.ts +1 -2
- package/dist/cjs/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +9 -0
- package/dist/cjs/types/stories/Table/TableCell.stories.d.ts +17 -1
- package/dist/esm/index.js +677 -221
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Button/Button.d.ts +1 -0
- package/dist/esm/types/components/Button/PropInterfaceButton.d.ts +15 -10
- package/dist/esm/types/components/Countdown/index.d.ts +11 -0
- package/dist/esm/types/components/Forms/FileUploader/DropzoneFileUploader.d.ts +11 -0
- package/dist/esm/types/components/Forms/FileUploader/SimpleFileUploader.d.ts +11 -0
- package/dist/esm/types/components/Forms/FileUploader/index.d.ts +2 -0
- package/dist/esm/types/components/Forms/FileUploader/useFileHandler.d.ts +35 -0
- package/dist/esm/types/components/Forms/Radio/configs.d.ts +11 -6
- package/dist/esm/types/components/Forms/Radio/index.d.ts +9 -14
- package/dist/esm/types/components/Forms/TagLabelInput/configs.d.ts +13 -0
- package/dist/esm/types/components/Forms/TagLabelInput/hooks/useLiveSearch.d.ts +9 -0
- package/dist/esm/types/components/Forms/TagLabelInput/index.d.ts +31 -0
- package/dist/esm/types/components/Forms/TagLabelInput/utils/dropdownUtils.d.ts +9 -0
- package/dist/esm/types/components/Forms/TextArea/index.d.ts +1 -15
- package/dist/esm/types/components/Forms/index.d.ts +2 -0
- package/dist/esm/types/components/Stepper/Horizontal/index.d.ts +21 -0
- package/dist/esm/types/components/Tooltip/PropsInterface.d.ts +1 -1
- package/dist/esm/types/components/index.d.ts +1 -1
- package/dist/esm/types/stories/Form/FileUploader/DropzoneFileUploader.stories.d.ts +12 -0
- package/dist/esm/types/stories/Form/FileUploader/SimpleFileUploader.stories.d.ts +10 -0
- package/dist/esm/types/stories/Form/Radio.stories.d.ts +1 -2
- package/dist/esm/types/stories/Form/TagLabelInput/TagLabelInput.stories.d.ts +48 -0
- package/dist/esm/types/stories/Form/TextArea/TextArea.stories.d.ts +1 -2
- package/dist/esm/types/stories/HorizontalStepper/HorizontalStepper.stories.d.ts +9 -0
- package/dist/esm/types/stories/Table/TableCell.stories.d.ts +17 -1
- package/dist/index.d.ts +119 -40
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -97,18 +97,28 @@ function TbCircleFilled (props) {
|
|
|
97
97
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M12 21a9 9 0 0 0 9 -9a9 9 0 0 0 -9 -9a9 9 0 0 0 -9 9a9 9 0 0 0 9 9z"},"child":[]},{"tag":"path","attr":{"d":"M9 8l6 8"},"child":[]},{"tag":"path","attr":{"d":"M15 8l-6 8"},"child":[]}]})(props);
|
|
98
98
|
}function TbX (props) {
|
|
99
99
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M18 6l-12 12"},"child":[]},{"tag":"path","attr":{"d":"M6 6l12 12"},"child":[]}]})(props);
|
|
100
|
+
}function TbTrash (props) {
|
|
101
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 7l16 0"},"child":[]},{"tag":"path","attr":{"d":"M10 11l0 6"},"child":[]},{"tag":"path","attr":{"d":"M14 11l0 6"},"child":[]},{"tag":"path","attr":{"d":"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"},"child":[]},{"tag":"path","attr":{"d":"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"},"child":[]}]})(props);
|
|
100
102
|
}function TbRefresh (props) {
|
|
101
103
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},"child":[]},{"tag":"path","attr":{"d":"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},"child":[]}]})(props);
|
|
102
104
|
}function TbPlaystationX (props) {
|
|
103
105
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M12 21a9 9 0 0 0 9 -9a9 9 0 0 0 -9 -9a9 9 0 0 0 -9 9a9 9 0 0 0 9 9z"},"child":[]},{"tag":"path","attr":{"d":"M8.5 8.5l7 7"},"child":[]},{"tag":"path","attr":{"d":"M8.5 15.5l7 -7"},"child":[]}]})(props);
|
|
106
|
+
}function TbPhotoUp (props) {
|
|
107
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M15 8h.01"},"child":[]},{"tag":"path","attr":{"d":"M12.5 21h-6.5a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v6.5"},"child":[]},{"tag":"path","attr":{"d":"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l3.5 3.5"},"child":[]},{"tag":"path","attr":{"d":"M14 14l1 -1c.679 -.653 1.473 -.829 2.214 -.526"},"child":[]},{"tag":"path","attr":{"d":"M19 22v-6"},"child":[]},{"tag":"path","attr":{"d":"M22 19l-3 -3l-3 3"},"child":[]}]})(props);
|
|
104
108
|
}function TbMinus (props) {
|
|
105
109
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M5 12l14 0"},"child":[]}]})(props);
|
|
106
110
|
}function TbLoader2 (props) {
|
|
107
111
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M12 3a9 9 0 1 0 9 9"},"child":[]}]})(props);
|
|
112
|
+
}function TbFolderOpen (props) {
|
|
113
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2"},"child":[]}]})(props);
|
|
114
|
+
}function TbFile (props) {
|
|
115
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M14 3v4a1 1 0 0 0 1 1h4"},"child":[]},{"tag":"path","attr":{"d":"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"},"child":[]}]})(props);
|
|
108
116
|
}function TbEye (props) {
|
|
109
117
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"},"child":[]},{"tag":"path","attr":{"d":"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"},"child":[]}]})(props);
|
|
110
118
|
}function TbEyeOff (props) {
|
|
111
119
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M10.585 10.587a2 2 0 0 0 2.829 2.828"},"child":[]},{"tag":"path","attr":{"d":"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"},"child":[]},{"tag":"path","attr":{"d":"M3 3l18 18"},"child":[]}]})(props);
|
|
120
|
+
}function TbDownload (props) {
|
|
121
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},"child":[]},{"tag":"path","attr":{"d":"M7 11l5 5l5 -5"},"child":[]},{"tag":"path","attr":{"d":"M12 4l0 12"},"child":[]}]})(props);
|
|
112
122
|
}function TbDots (props) {
|
|
113
123
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},"child":[]},{"tag":"path","attr":{"d":"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},"child":[]},{"tag":"path","attr":{"d":"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},"child":[]}]})(props);
|
|
114
124
|
}function TbCrop11 (props) {
|
|
@@ -133,6 +143,8 @@ function TbCircleFilled (props) {
|
|
|
133
143
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z"},"child":[]},{"tag":"path","attr":{"d":"M16 3v4"},"child":[]},{"tag":"path","attr":{"d":"M8 3v4"},"child":[]},{"tag":"path","attr":{"d":"M4 11h16"},"child":[]},{"tag":"path","attr":{"d":"M11 15h1"},"child":[]},{"tag":"path","attr":{"d":"M12 15v3"},"child":[]}]})(props);
|
|
134
144
|
}function TbAlertTriangle (props) {
|
|
135
145
|
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M12 9v4"},"child":[]},{"tag":"path","attr":{"d":"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z"},"child":[]},{"tag":"path","attr":{"d":"M12 16h.01"},"child":[]}]})(props);
|
|
146
|
+
}function TbAlertCircle (props) {
|
|
147
|
+
return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":"2","strokeLinecap":"round","strokeLinejoin":"round"},"child":[{"tag":"path","attr":{"d":"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0"},"child":[]},{"tag":"path","attr":{"d":"M12 8v4"},"child":[]},{"tag":"path","attr":{"d":"M12 16h.01"},"child":[]}]})(props);
|
|
136
148
|
}
|
|
137
149
|
|
|
138
150
|
function InfoIcon() {
|
|
@@ -317,7 +329,7 @@ var useDetectOutsideClick = function (ref, initialState, ignoreRef, event) {
|
|
|
317
329
|
return [isActive, setIsActive];
|
|
318
330
|
};
|
|
319
331
|
|
|
320
|
-
var variantUnion$
|
|
332
|
+
var variantUnion$1 = [
|
|
321
333
|
'normal-text', // default
|
|
322
334
|
'large-text',
|
|
323
335
|
'large-text-semibold',
|
|
@@ -337,7 +349,7 @@ var variantUnion$2 = [
|
|
|
337
349
|
];
|
|
338
350
|
function Text(_a) {
|
|
339
351
|
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children, _c = _a.className, className = _c === void 0 ? '' : _c;
|
|
340
|
-
var validatedVariant = validUnion(variant, variantUnion$
|
|
352
|
+
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
341
353
|
var defaultColor = extended.includes('text-bia') || (className === null || className === void 0 ? void 0 : className.includes('text-bia'))
|
|
342
354
|
? ''
|
|
343
355
|
: 'text-bia-black';
|
|
@@ -467,7 +479,7 @@ var radiusConfig$1 = {
|
|
|
467
479
|
tn: 'rounded-radius-full focus-visible:rounded-radius-full',
|
|
468
480
|
},
|
|
469
481
|
};
|
|
470
|
-
var sizeConfig$
|
|
482
|
+
var sizeConfig$f = {
|
|
471
483
|
lg: 'py-[10.5px] h-[48px] flex items-center justify-center gap-[10px] text-size-md ',
|
|
472
484
|
md: 'py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base ',
|
|
473
485
|
sm: 'py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm ',
|
|
@@ -517,7 +529,7 @@ var variantConfig$3 = {
|
|
|
517
529
|
'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 ",
|
|
518
530
|
};
|
|
519
531
|
|
|
520
|
-
var
|
|
532
|
+
var BUTTON_VARIANT_UNION = [
|
|
521
533
|
'default',
|
|
522
534
|
'danger',
|
|
523
535
|
'info',
|
|
@@ -535,13 +547,29 @@ var variantUnion$1 = [
|
|
|
535
547
|
'warning-outlined',
|
|
536
548
|
'form-group',
|
|
537
549
|
];
|
|
538
|
-
var
|
|
539
|
-
var
|
|
550
|
+
var RADIUS_UNION = ['default', 'full-rounded'];
|
|
551
|
+
var SIZE_UNION = ['md', 'lg', 'sm', 'tn'];
|
|
540
552
|
var Button = React.forwardRef(function (_a, ref) {
|
|
541
553
|
var label = _a.label, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.radius, radius = _d === void 0 ? 'default' : _d, _e = _a.size, size = _e === void 0 ? 'md' : _e, _f = _a.variant, variant = _f === void 0 ? 'default' : _f, _g = _a.iconLeft, iconLeft = _g === void 0 ? null : _g, _h = _a.iconRight, iconRight = _h === void 0 ? null : _h, _j = _a.left, left = _j === void 0 ? null : _j, _k = _a.right, right = _k === void 0 ? null : _k, minWidth = _a.minWidth, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight", "left", "right", "minWidth"]);
|
|
542
|
-
var validatedVariant = validUnion(variant,
|
|
543
|
-
var validatedSize = validUnion(size,
|
|
544
|
-
var validatedRadius = validUnion(radius,
|
|
554
|
+
var validatedVariant = validUnion(variant, BUTTON_VARIANT_UNION);
|
|
555
|
+
var validatedSize = validUnion(size, SIZE_UNION);
|
|
556
|
+
var validatedRadius = validUnion(radius, RADIUS_UNION);
|
|
557
|
+
var variantTextColorClasses = variantConfig$3[validatedVariant]
|
|
558
|
+
.split(/\s+/)
|
|
559
|
+
.filter(function (className) { return className.startsWith('text-'); });
|
|
560
|
+
var renderIcon = function (element) {
|
|
561
|
+
if (!element)
|
|
562
|
+
return null;
|
|
563
|
+
if (React.isValidElement(element)) {
|
|
564
|
+
var iconProps = element.props;
|
|
565
|
+
var existingClassName = iconProps.className || '';
|
|
566
|
+
return React.cloneElement(element, {
|
|
567
|
+
className: __spreadArray(__spreadArray([], variantTextColorClasses, true), [existingClassName], false).filter(Boolean)
|
|
568
|
+
.join(' '),
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
return element;
|
|
572
|
+
};
|
|
545
573
|
var minWidthRules = minWidthConfig$1[validatedSize];
|
|
546
574
|
if (minWidth !== undefined) {
|
|
547
575
|
minWidthRules = "min-w-[".concat(minWidth, "px]");
|
|
@@ -551,10 +579,10 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
551
579
|
}
|
|
552
580
|
var sizingRules;
|
|
553
581
|
if (variant.includes('link')) {
|
|
554
|
-
sizingRules = "".concat(sizeConfig$
|
|
582
|
+
sizingRules = "".concat(sizeConfig$f[validatedSize]);
|
|
555
583
|
}
|
|
556
584
|
else {
|
|
557
|
-
sizingRules = "".concat(sizeConfig$
|
|
585
|
+
sizingRules = "".concat(sizeConfig$f[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
|
|
558
586
|
}
|
|
559
587
|
var hasDoubleIcon = iconRight && iconLeft;
|
|
560
588
|
var isVariantLink = variant.includes('link')
|
|
@@ -567,9 +595,9 @@ var Button = React.forwardRef(function (_a, ref) {
|
|
|
567
595
|
: "".concat(iconOnlySizeConfig$1[validatedSize], " ").concat(isVariantLink, " ").concat(isVariantLink);
|
|
568
596
|
var classString = "\n ".concat(variantConfig$3[validatedVariant], "\n ").concat(sizeClass, "\n ").concat(radiusConfig$1[validatedRadius][validatedSize], "\n ").concat(className, "\n ");
|
|
569
597
|
return (React.createElement("button", __assign({ ref: ref, type: "button", className: "bianic-button bianic-fgc-target flex items-center justify-center font-semibold ".concat(classString), disabled: disabled }, props),
|
|
570
|
-
childrenElement(iconLeft || left),
|
|
598
|
+
childrenElement(renderIcon(iconLeft || left)),
|
|
571
599
|
childrenElement(label),
|
|
572
|
-
childrenElement(iconRight || right)));
|
|
600
|
+
childrenElement(renderIcon(iconRight || right))));
|
|
573
601
|
});
|
|
574
602
|
Button.defaultProps = {
|
|
575
603
|
label: undefined,
|
|
@@ -747,7 +775,7 @@ function Banner(_a) {
|
|
|
747
775
|
return function () { return observer.disconnect(); };
|
|
748
776
|
}, [children]);
|
|
749
777
|
if (open) {
|
|
750
|
-
return (React.createElement("div", { className: "relative flex min-h-fit w-full justify-center gap-x-[15px] py-[
|
|
778
|
+
return (React.createElement("div", { className: "relative flex min-h-fit w-full justify-center gap-x-[15px] py-[6px] pl-[15px] pr-[48px] text-size-base font-semibold text-white ".concat(variantConfig$2[variant].bg, " ").concat(isMultiLine ? 'items-start' : 'items-center') },
|
|
751
779
|
React.createElement("div", { className: "font-segoe text-[14px] font-semibold leading-[21px]", ref: textRef }, children),
|
|
752
780
|
React.createElement("div", { className: "absolute right-[15px]", style: { display: closeable ? 'block' : 'none' } },
|
|
753
781
|
React.createElement("button", { className: "flex h-[18px] w-[18px] items-center justify-center text-xs text-white outline-2 ".concat(variantConfig$2[variant].focus), type: "button", onClick: function () { return onClose(false); } },
|
|
@@ -759,7 +787,7 @@ Banner.defaultProps = {
|
|
|
759
787
|
variant: 'black',
|
|
760
788
|
};
|
|
761
789
|
|
|
762
|
-
var sizeConfig$
|
|
790
|
+
var sizeConfig$e = {
|
|
763
791
|
md: 'h-[16px] text-[11px]',
|
|
764
792
|
sm: 'h-[14px] text-[9px]',
|
|
765
793
|
};
|
|
@@ -783,7 +811,7 @@ var colorConfig$3 = {
|
|
|
783
811
|
|
|
784
812
|
var MonospaceBadge = function (_a) {
|
|
785
813
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.color, color = _c === void 0 ? 'blue' : _c;
|
|
786
|
-
var sizeClass = sizeConfig$
|
|
814
|
+
var sizeClass = sizeConfig$e[size];
|
|
787
815
|
var colorClass = colorConfig$3[color];
|
|
788
816
|
var variantClass = "".concat(sizeClass, " ").concat(colorClass);
|
|
789
817
|
return (React.createElement("div", { className: "relative -top-[1px] inline-flex w-fit items-center justify-center rounded-[2px] px-[3px] ".concat(variantClass) },
|
|
@@ -1770,9 +1798,21 @@ function Color() {
|
|
|
1770
1798
|
}))));
|
|
1771
1799
|
}
|
|
1772
1800
|
|
|
1801
|
+
/**
|
|
1802
|
+
* State Progression & Visualization Lifecycle (e.g., maxSeconds = 4):
|
|
1803
|
+
*
|
|
1804
|
+
* Timeline Step | Initial | T = 1s | T = 2s | T = 3s | T = 4s (End)
|
|
1805
|
+
* ----------------------|---------|--------|--------|--------|-------------
|
|
1806
|
+
* countdownPlaceholder | 4 | 4 | 3 | 2 | 1
|
|
1807
|
+
* strokeDashoffset Ratio| 4 | 3 | 2 | 1 | 0 (Complete)
|
|
1808
|
+
*
|
|
1809
|
+
* Note: `maxSeconds` is displayed twice initially to account for the 1-second
|
|
1810
|
+
* delay before the first numeric tick while the SVG stroke animation begins.
|
|
1811
|
+
*/
|
|
1773
1812
|
var Countdown = React.forwardRef(function (_a, ref) {
|
|
1774
1813
|
var seconds = _a.seconds, maxSeconds = _a.maxSeconds, _b = _a.variant, variant = _b === void 0 ? 'countdown' : _b, className = _a.className, props = __rest(_a, ["seconds", "maxSeconds", "variant", "className"]);
|
|
1775
1814
|
var isCountdown = variant === 'countdown';
|
|
1815
|
+
var secondsPlaceholder = seconds === maxSeconds ? maxSeconds : seconds + 1;
|
|
1776
1816
|
var strokeWidth = 3;
|
|
1777
1817
|
var size = 120;
|
|
1778
1818
|
var radius = (size - strokeWidth) / 2;
|
|
@@ -1783,11 +1823,11 @@ var Countdown = React.forwardRef(function (_a, ref) {
|
|
|
1783
1823
|
React.createElement("svg", { className: "absolute left-0 top-0 -rotate-90 transform" // Rotates SVG so progress starts at 12 o'clock
|
|
1784
1824
|
, width: size, height: size },
|
|
1785
1825
|
React.createElement("circle", { className: "text-bia-blue-light-90", stroke: "currentColor", fill: "transparent", strokeWidth: strokeWidth, cx: size / 2, cy: size / 2, r: radius }),
|
|
1786
|
-
isCountdown && (React.createElement("circle", { className: "text-bia-blue transition-all ease-linear ".concat(seconds
|
|
1826
|
+
isCountdown && (React.createElement("circle", { className: "text-bia-blue transition-all ease-linear ".concat(seconds < maxSeconds ? 'duration-1000' : 'duration-0'), stroke: "currentColor", fill: "transparent", strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: strokeDashoffset, strokeLinecap: "round", cx: size / 2, cy: size / 2, r: radius })),
|
|
1787
1827
|
React.createElement("circle", { className: "origin-center scale-y-[-1] text-bia-green transition-all ease-linear ".concat(isCountdown ? 'duration-0' : 'duration-1000'), stroke: "currentColor", fill: "transparent", strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: circumference - (isCountdown ? 0 : 1 / 1) * circumference, strokeLinecap: "round", cx: size / 2, cy: size / 2, r: radius })),
|
|
1788
1828
|
isCountdown ? (React.createElement(React.Fragment, null,
|
|
1789
|
-
React.createElement(Heading, { key:
|
|
1790
|
-
React.createElement(Text, { variant: "small-text", className: "font-segoe text-bia-coolgrey" },
|
|
1829
|
+
React.createElement(Heading, { key: secondsPlaceholder, variant: "2", className: "animate-number-drop" }, secondsPlaceholder),
|
|
1830
|
+
React.createElement(Text, { variant: "small-text", className: "font-segoe text-bia-coolgrey" }, secondsPlaceholder <= 1 ? 'second' : 'seconds'))) : (React.createElement(TbCheck, { size: 46, className: "text-bia-green", "aria-label": "Countdown complete" }))));
|
|
1791
1831
|
});
|
|
1792
1832
|
Countdown.displayName = 'Countdown';
|
|
1793
1833
|
|
|
@@ -2224,10 +2264,6 @@ function Tooltip(props) {
|
|
|
2224
2264
|
var _d = React.useState(false), active = _d[0], setActive = _d[1];
|
|
2225
2265
|
var anchorRef = React.useRef(null);
|
|
2226
2266
|
var tooltipContainerRef = React.useRef(null);
|
|
2227
|
-
var _e = React.useState({
|
|
2228
|
-
maxWidth: maxWidth + 'px',
|
|
2229
|
-
whiteSpace: 'nowrap',
|
|
2230
|
-
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
2231
2267
|
var showTip = function () {
|
|
2232
2268
|
timeout = setTimeout(function () {
|
|
2233
2269
|
setActive(true);
|
|
@@ -2237,6 +2273,17 @@ function Tooltip(props) {
|
|
|
2237
2273
|
clearInterval(timeout);
|
|
2238
2274
|
setActive(false);
|
|
2239
2275
|
};
|
|
2276
|
+
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
|
|
2277
|
+
children,
|
|
2278
|
+
active && (React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, bgColor: bgColor, textColor: textColor, zIndex: zIndex, className: className, style: style, active: active, maxWidth: maxWidth }))));
|
|
2279
|
+
}
|
|
2280
|
+
var TooltipItem = function (_a) {
|
|
2281
|
+
var anchorRef = _a.anchorRef, className = _a.className, content = _a.content, direction = _a.direction, style = _a.style, tooltipContainerRef = _a.tooltipContainerRef, _b = _a.bgColor, bgColor = _b === void 0 ? 'bia-black' : _b, _c = _a.textColor, textColor = _c === void 0 ? 'bia-white' : _c, zIndex = _a.zIndex; _a.active; var maxWidth = _a.maxWidth;
|
|
2282
|
+
var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
|
|
2283
|
+
var _e = React.useState({
|
|
2284
|
+
maxWidth: maxWidth + 'px',
|
|
2285
|
+
whiteSpace: 'nowrap',
|
|
2286
|
+
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
2240
2287
|
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
2241
2288
|
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
2242
2289
|
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
@@ -2269,14 +2316,7 @@ function Tooltip(props) {
|
|
|
2269
2316
|
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
2270
2317
|
}
|
|
2271
2318
|
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
2272
|
-
return (React.createElement("div", { className: "tooltip-
|
|
2273
|
-
children,
|
|
2274
|
-
React.createElement(TooltipItem, { anchorRef: anchorRef, direction: direction, content: content, tooltipContainerRef: tooltipContainerRef, tooltipContainerStyle: tooltipContainerStyle, bgColor: bgColor, textColor: textColor, zIndex: zIndex, className: className, style: style, active: active })));
|
|
2275
|
-
}
|
|
2276
|
-
var TooltipItem = function (_a) {
|
|
2277
|
-
var anchorRef = _a.anchorRef, className = _a.className, content = _a.content, direction = _a.direction, style = _a.style, tooltipContainerRef = _a.tooltipContainerRef, tooltipContainerStyle = _a.tooltipContainerStyle, _b = _a.bgColor, bgColor = _b === void 0 ? 'bia-black' : _b, _c = _a.textColor, textColor = _c === void 0 ? 'bia-white' : _c, zIndex = _a.zIndex, _d = _a.active, active = _d === void 0 ? false : _d;
|
|
2278
|
-
var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
|
|
2279
|
-
return reactDom.createPortal(React.createElement("div", { className: "tooltip-container break-word absolute inline-block break-all rounded-[4px] bg-".concat(bgColor, " px-[7px] py-[4px] text-size-sm text-").concat(textColor, " ").concat(className), style: __assign(__assign(__assign(__assign({ zIndex: zIndex }, positionStyle), tooltipContainerStyle), style), { visibility: active ? 'visible' : 'hidden' }), ref: tooltipContainerRef }, content), document.body);
|
|
2319
|
+
return reactDom.createPortal(React.createElement("div", { className: "tooltip-container break-word absolute inline-block break-all rounded-[4px] bg-".concat(bgColor, " px-[7px] py-[4px] text-size-sm text-").concat(textColor, " ").concat(className), style: __assign(__assign(__assign({ zIndex: zIndex }, positionStyle), tooltipContainerStyle), style), ref: tooltipContainerRef }, content), document.body);
|
|
2280
2320
|
};
|
|
2281
2321
|
Tooltip.defaultProps = {
|
|
2282
2322
|
delay: 400,
|
|
@@ -2327,7 +2367,7 @@ function ValidationIcon(_a) {
|
|
|
2327
2367
|
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
2328
2368
|
}
|
|
2329
2369
|
|
|
2330
|
-
var sizeConfig$
|
|
2370
|
+
var sizeConfig$d = {
|
|
2331
2371
|
md: {
|
|
2332
2372
|
fieldSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2333
2373
|
iconPosition: 'right-[10px]',
|
|
@@ -2368,8 +2408,8 @@ var TextInput = React.forwardRef(function (_a, ref) {
|
|
|
2368
2408
|
var _r = React.useState(false), isShow = _r[0], setIsShow = _r[1];
|
|
2369
2409
|
var _s = styleConfig[variant], fieldStyle = _s.fieldStyle, iconStyle = _s.iconStyle;
|
|
2370
2410
|
var _t = isTransparent
|
|
2371
|
-
? __assign(__assign({}, sizeConfig$
|
|
2372
|
-
" pe-[".concat(9 + sizeConfig$
|
|
2411
|
+
? __assign(__assign({}, sizeConfig$d[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$d[size].fieldSize +
|
|
2412
|
+
" pe-[".concat(9 + sizeConfig$d[size].iconSize, "px]") }) : sizeConfig$d[size], iconSize = _t.iconSize, fieldSize = _t.fieldSize, iconPosition = _t.iconPosition;
|
|
2373
2413
|
var borderStyle = isTransparent
|
|
2374
2414
|
? 'border-transparent bg-transparent' // customize border rule for transparent variant
|
|
2375
2415
|
: 'border border-bia-grey-dark-10 bg-primary-white';
|
|
@@ -2437,7 +2477,7 @@ TextInput.defaultProps = {
|
|
|
2437
2477
|
};
|
|
2438
2478
|
|
|
2439
2479
|
// Desc: Radio button size configuration
|
|
2440
|
-
var sizeConfig$
|
|
2480
|
+
var sizeConfig$c = {
|
|
2441
2481
|
md: {
|
|
2442
2482
|
checkSize: 'w-[22px] h-[22px]',
|
|
2443
2483
|
labelSize: 'text-size-base',
|
|
@@ -2446,27 +2486,43 @@ var sizeConfig$b = {
|
|
|
2446
2486
|
checkSize: 'w-4 h-4',
|
|
2447
2487
|
labelSize: 'text-size-sm',
|
|
2448
2488
|
},
|
|
2489
|
+
tn: {
|
|
2490
|
+
checkSize: 'w-3 h-3',
|
|
2491
|
+
labelSize: 'text-size-sm',
|
|
2492
|
+
},
|
|
2449
2493
|
};
|
|
2450
2494
|
|
|
2451
|
-
var sizeUnion$4 = ['md', 'sm'];
|
|
2452
|
-
function Radio(_a) {
|
|
2453
|
-
var
|
|
2495
|
+
var sizeUnion$4 = ['md', 'sm', 'tn'];
|
|
2496
|
+
var Radio = React.forwardRef(function Radio(_a, ref) {
|
|
2497
|
+
var _b = _a.label, label = _b === void 0 ? '' : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.id, id = _d === void 0 ? '' : _d, _e = _a.onChange, onChange = _e === void 0 ? function () { } : _e, _f = _a.onClick, onClick = _f === void 0 ? function () { } : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.checked, checked = _h === void 0 ? false : _h, _j = _a.containerClassName, containerClassName = _j === void 0 ? '' : _j, _k = _a.inputClassName, inputClassName = _k === void 0 ? '' : _k, _l = _a.labelClassName, labelClassName = _l === void 0 ? '' : _l, className = _a.className, name = _a.name, value = _a.value, _m = _a.required, required = _m === void 0 ? false : _m, _o = _a.readOnly, readOnly = _o === void 0 ? false : _o, autoComplete = _a.autoComplete, tabIndex = _a.tabIndex, role = _a.role, ariaLabel = _a["aria-label"], ariaLabelledby = _a["aria-labelledby"], onFocus = _a.onFocus, onBlur = _a.onBlur, onKeyDown = _a.onKeyDown, defaultChecked = _a.defaultChecked;
|
|
2454
2498
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
2455
|
-
var
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2499
|
+
var _p = sizeConfig$c[validatedSize], checkSize = _p.checkSize, labelSize = _p.labelSize;
|
|
2500
|
+
var backgroundClass = size === 'tn' && checked ? 'bg-bia-blue' : 'bg-bia-white';
|
|
2501
|
+
var peerCheckedClass = size === 'tn'
|
|
2502
|
+
? 'peer-checked:border-bia-blue peer-checked:bg-bia-white peer-checked:peer-hover:border-bia-blue-hover'
|
|
2503
|
+
: 'peer-checked:peer-hover:bg-bia-blue-hover';
|
|
2504
|
+
var inputFocusClass = size === 'tn'
|
|
2505
|
+
? 'focus-visible:ring-offset-1'
|
|
2506
|
+
: 'focus-visible:ring-offset-2';
|
|
2507
|
+
return (React.createElement("div", { className: cn('flex items-center', containerClassName) },
|
|
2508
|
+
React.createElement("div", { className: cn('relative flex flex-shrink-0 items-center justify-center rounded-full', checkSize, backgroundClass) },
|
|
2509
|
+
React.createElement("input", { ref: ref, id: id, type: "radio", className: cn('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 disabled:cursor-not-allowed disabled:border-bia-coolgrey-light-50 disabled:checked:border-bia-blue-light-50', inputFocusClass, inputClassName, className), name: name, value: value, required: required, readOnly: readOnly, autoComplete: autoComplete, tabIndex: tabIndex, role: role, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, onChange: onChange, onClick: onClick, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, checked: checked, defaultChecked: defaultChecked, disabled: disabled }),
|
|
2510
|
+
React.createElement("div", { className: cn('check-icon z-1 group flex h-full w-full justify-center rounded-full border-2 border-primary-white text-bia-grey outline-2 outline-bia-blue peer-checked:bg-bia-blue peer-checked:hover:border-bia-blue-hover peer-checked:hover:outline-bia-blue-hover peer-disabled:border-transparent peer-disabled:bg-bia-grey-light-80 peer-disabled:peer-checked:border-primary-white peer-disabled:peer-checked:bg-bia-blue-disabled', peerCheckedClass) })),
|
|
2511
|
+
React.createElement("label", { htmlFor: id, className: cn('ml-2 leading-4', disabled ? 'text-bia-coolgrey' : 'text-bia-black', labelSize, labelClassName) }, childrenElement(label))));
|
|
2512
|
+
});
|
|
2462
2513
|
Radio.defaultProps = {
|
|
2463
2514
|
label: '',
|
|
2464
2515
|
size: 'md',
|
|
2465
2516
|
id: '',
|
|
2517
|
+
onChange: function () { },
|
|
2466
2518
|
onClick: function () { },
|
|
2467
2519
|
disabled: false,
|
|
2468
2520
|
checked: false,
|
|
2521
|
+
containerClassName: '',
|
|
2522
|
+
inputClassName: '',
|
|
2523
|
+
labelClassName: '',
|
|
2469
2524
|
};
|
|
2525
|
+
Radio.displayName = 'Radio';
|
|
2470
2526
|
|
|
2471
2527
|
var ResizeIcon = function (_a) {
|
|
2472
2528
|
var className = _a.className;
|
|
@@ -2479,7 +2535,7 @@ var ResizeIcon = function (_a) {
|
|
|
2479
2535
|
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" })));
|
|
2480
2536
|
};
|
|
2481
2537
|
|
|
2482
|
-
var sizeConfig$
|
|
2538
|
+
var sizeConfig$b = {
|
|
2483
2539
|
md: {
|
|
2484
2540
|
inputClass: 'text-size-base font-[350] min-h-10',
|
|
2485
2541
|
},
|
|
@@ -2488,10 +2544,10 @@ var sizeConfig$a = {
|
|
|
2488
2544
|
},
|
|
2489
2545
|
};
|
|
2490
2546
|
|
|
2491
|
-
|
|
2492
|
-
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, _h = _a.isValid, isValid = _h === void 0 ? null : _h, props = __rest(_a, ["descText", "disabled", "id", "size", "label", "placeholder", "required", "rows", "maxLength", "value", "readOnly", "autoComplete", "isValid"]);
|
|
2547
|
+
var TextArea = React.forwardRef(function (_a, ref) {
|
|
2548
|
+
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, _h = _a.isValid, isValid = _h === void 0 ? null : _h; _a.children; var textAreaClassName = _a.className, props = __rest(_a, ["descText", "disabled", "id", "size", "label", "placeholder", "required", "rows", "maxLength", "value", "readOnly", "autoComplete", "isValid", "children", "className"]);
|
|
2493
2549
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
2494
|
-
var inputClass = sizeConfig$
|
|
2550
|
+
var inputClass = sizeConfig$b[size].inputClass;
|
|
2495
2551
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
2496
2552
|
var isExistValidation = isValid !== null;
|
|
2497
2553
|
var descColor = 'text-primary-cool';
|
|
@@ -2507,12 +2563,12 @@ function TextArea(_a) {
|
|
|
2507
2563
|
bottomBorderColor =
|
|
2508
2564
|
'enabled:hover:border-b-bia-red enabled:focus:border-b-bia-red';
|
|
2509
2565
|
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2510
|
-
var extendedInputClassName =
|
|
2511
|
-
return (React.createElement("div", { className:
|
|
2566
|
+
var extendedInputClassName = cn(inputClass, bottomBorderColor);
|
|
2567
|
+
return (React.createElement("div", { className: cn('field-group group/form flex w-full flex-col gap-y-2', textAreaClassName) },
|
|
2512
2568
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2513
2569
|
React.createElement("div", { className: "relative h-fit w-full min-w-[250px] ".concat(disabledClass) },
|
|
2514
2570
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
2515
|
-
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:focus:rounded-b-none disabled:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value, autoComplete: autoComplete, readOnly: readOnly }, props))),
|
|
2571
|
+
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:focus:rounded-b-none disabled:cursor-not-allowed disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName), rows: inputRow, id: id, placeholder: placeholder, disabled: disabled, maxLength: maxLength, value: value, autoComplete: autoComplete, readOnly: readOnly, ref: ref }, props))),
|
|
2516
2572
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs ".concat(descColor) },
|
|
2517
2573
|
descText && React.createElement("span", null, descText),
|
|
2518
2574
|
maxLength && (React.createElement("span", null,
|
|
@@ -2520,7 +2576,7 @@ function TextArea(_a) {
|
|
|
2520
2576
|
"/",
|
|
2521
2577
|
maxLength,
|
|
2522
2578
|
' ')))));
|
|
2523
|
-
}
|
|
2579
|
+
});
|
|
2524
2580
|
TextArea.defaultProps = {
|
|
2525
2581
|
disabled: false,
|
|
2526
2582
|
descText: '',
|
|
@@ -2534,7 +2590,7 @@ TextArea.defaultProps = {
|
|
|
2534
2590
|
value: '',
|
|
2535
2591
|
};
|
|
2536
2592
|
|
|
2537
|
-
var sizeConfig$
|
|
2593
|
+
var sizeConfig$a = {
|
|
2538
2594
|
md: {
|
|
2539
2595
|
checkClass: 'w-[22px] h-[22px]',
|
|
2540
2596
|
labelClass: 'text-size-base font-[350]',
|
|
@@ -2552,7 +2608,7 @@ var sizeConfig$9 = {
|
|
|
2552
2608
|
var sizeUnion$3 = ['md', 'sm', 'tn'];
|
|
2553
2609
|
function Checkbox(_a) {
|
|
2554
2610
|
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, _e = _a.isIndeterminate, isIndeterminate = _e === void 0 ? false : _e, props = __rest(_a, ["disabled", "id", "size", "label", "onChange", "isIndeterminate"]);
|
|
2555
|
-
var _f = sizeConfig$
|
|
2611
|
+
var _f = sizeConfig$a[validUnion(size, sizeUnion$3)], checkClass = _f.checkClass, labelClass = _f.labelClass;
|
|
2556
2612
|
var isValidIndeterminate = isIndeterminate && props.checked;
|
|
2557
2613
|
var backgroundClass = size === 'tn' && props.checked ? 'bg-bia-blue' : 'bg-bia-white';
|
|
2558
2614
|
var peerCheckedClass = size === 'tn' ? '' : 'peer-checked:border-2';
|
|
@@ -2571,7 +2627,7 @@ Checkbox.defaultProps = {
|
|
|
2571
2627
|
onChange: function () { },
|
|
2572
2628
|
};
|
|
2573
2629
|
|
|
2574
|
-
var sizeConfig$
|
|
2630
|
+
var sizeConfig$9 = {
|
|
2575
2631
|
md: {
|
|
2576
2632
|
searchSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2577
2633
|
iconSize: 'right-[10px] text-[18px]',
|
|
@@ -2582,7 +2638,7 @@ var sizeConfig$8 = {
|
|
|
2582
2638
|
},
|
|
2583
2639
|
};
|
|
2584
2640
|
|
|
2585
|
-
var sizeConfig$
|
|
2641
|
+
var sizeConfig$8 = {
|
|
2586
2642
|
md: {
|
|
2587
2643
|
container: 'text-size-base font-[350] py-[3px] first:pt-[8px] last:pb-[8px]',
|
|
2588
2644
|
item: 'min-h-[34px] p-2.5',
|
|
@@ -2600,7 +2656,7 @@ function CustomDropdownItem(_a) {
|
|
|
2600
2656
|
var _f = React.useState(false), isHoveredSubMenu = _f[0], setIsHoveredSubMenu = _f[1];
|
|
2601
2657
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2602
2658
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2603
|
-
var _g = sizeConfig$
|
|
2659
|
+
var _g = sizeConfig$8[size], containerClass = _g.container, item = _g.item;
|
|
2604
2660
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2605
2661
|
var isExistSubDropdown = options.length !== 0;
|
|
2606
2662
|
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 () { } },
|
|
@@ -2627,7 +2683,7 @@ function DefaultDropdownItem(_a) {
|
|
|
2627
2683
|
var _g = React.useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
2628
2684
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2629
2685
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2630
|
-
var _h = sizeConfig$
|
|
2686
|
+
var _h = sizeConfig$8[size], containerClass = _h.container, item = _h.item;
|
|
2631
2687
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2632
2688
|
var isExistSubDropdown = options.length !== 0;
|
|
2633
2689
|
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 () { } },
|
|
@@ -2654,7 +2710,7 @@ function SelectInput(_a) {
|
|
|
2654
2710
|
var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, id = _a.id, _d = _a.isValid, isValid = _d === void 0 ? null : _d, label = _a.label, _e = _a.options, options = _e === void 0 ? [] : _e, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, _g = _a.required, required = _g === void 0 ? false : _g, selected = _a.selected, setSelected = _a.setSelected, _h = _a.onClickDropdown, onClickDropdown = _h === void 0 ? function () { } : _h, children = _a.children, _j = _a.dropContProps, _k = _j === void 0 ? {} : _j, _l = _k.className, dropContClassName = _l === void 0 ? '' : _l, restDropContProps = __rest(_k, ["className"]), props = __rest(_a, ["descText", "disabled", "size", "id", "isValid", "label", "options", "readOnly", "required", "selected", "setSelected", "onClickDropdown", "children", "dropContProps"]);
|
|
2655
2711
|
var _m = React.useState(false), isOpen = _m[0], setIsOpen = _m[1];
|
|
2656
2712
|
var validatedSize = validUnion(size, sizeUnion$2);
|
|
2657
|
-
var _o = sizeConfig$
|
|
2713
|
+
var _o = sizeConfig$9[validatedSize], searchSize = _o.searchSize, iconSize = _o.iconSize;
|
|
2658
2714
|
var inputRef = React.useRef(null);
|
|
2659
2715
|
var isObjectOptionItem = false;
|
|
2660
2716
|
if (options.every(function (item) { return typeof item === 'object' && item !== null; }))
|
|
@@ -2712,7 +2768,7 @@ SelectInput.defaultProps = {
|
|
|
2712
2768
|
setSelected: function () { },
|
|
2713
2769
|
};
|
|
2714
2770
|
|
|
2715
|
-
var sizeConfig$
|
|
2771
|
+
var sizeConfig$7 = {
|
|
2716
2772
|
md: {
|
|
2717
2773
|
iconClass: 'right-[10px]',
|
|
2718
2774
|
iconSize: '18',
|
|
@@ -2893,7 +2949,7 @@ var getItemLabel = function (value) {
|
|
|
2893
2949
|
var _a;
|
|
2894
2950
|
return isObjectWithLabel(value) ? (_a = value.label) !== null && _a !== void 0 ? _a : '' : String(value !== null && value !== void 0 ? value : '');
|
|
2895
2951
|
};
|
|
2896
|
-
var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick) {
|
|
2952
|
+
var processDropdownChildren$1 = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick) {
|
|
2897
2953
|
if (searchVariant === void 0) { searchVariant = 'include'; }
|
|
2898
2954
|
return React.Children.map(nodes, function (child) {
|
|
2899
2955
|
if (!React.isValidElement(child) || child.type !== DropdownItem) {
|
|
@@ -2915,7 +2971,7 @@ var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNo
|
|
|
2915
2971
|
}
|
|
2916
2972
|
// Process Nested Children
|
|
2917
2973
|
var clonedChildren = itemProps.children
|
|
2918
|
-
? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick)
|
|
2974
|
+
? processDropdownChildren$1(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick)
|
|
2919
2975
|
: null;
|
|
2920
2976
|
// Clone and Inject Click Handler
|
|
2921
2977
|
return React.cloneElement(child, {
|
|
@@ -2937,23 +2993,23 @@ var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNo
|
|
|
2937
2993
|
});
|
|
2938
2994
|
});
|
|
2939
2995
|
};
|
|
2940
|
-
var processRenderedChildren = function (children, searchTerm, searchVariant, handleDropdownItemClick) {
|
|
2996
|
+
var processRenderedChildren$1 = function (children, searchTerm, searchVariant, handleDropdownItemClick) {
|
|
2941
2997
|
var renderedChildren = null;
|
|
2942
2998
|
var hasFilteredResults = false;
|
|
2943
2999
|
if (searchTerm) {
|
|
2944
|
-
renderedChildren = processDropdownChildren(children, searchTerm, false, searchVariant, handleDropdownItemClick);
|
|
3000
|
+
renderedChildren = processDropdownChildren$1(children, searchTerm, false, searchVariant, handleDropdownItemClick);
|
|
2945
3001
|
hasFilteredResults =
|
|
2946
3002
|
React.Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
2947
3003
|
}
|
|
2948
3004
|
else {
|
|
2949
|
-
renderedChildren = processDropdownChildren(children, '', true, searchVariant, handleDropdownItemClick);
|
|
3005
|
+
renderedChildren = processDropdownChildren$1(children, '', true, searchVariant, handleDropdownItemClick);
|
|
2950
3006
|
hasFilteredResults =
|
|
2951
3007
|
React.Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
2952
3008
|
}
|
|
2953
3009
|
return { renderedChildren: renderedChildren, hasFilteredResults: hasFilteredResults };
|
|
2954
3010
|
};
|
|
2955
3011
|
|
|
2956
|
-
var useLiveSearch = function (_a) {
|
|
3012
|
+
var useLiveSearch$1 = function (_a) {
|
|
2957
3013
|
var value = _a.value, setValue = _a.setValue, onChangeText = _a.onChangeText, dropContOnClickItem = _a.dropContOnClickItem;
|
|
2958
3014
|
var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
2959
3015
|
var _c = React.useState(String(value.label || '')), searchTerm = _c[0], setSearchTerm = _c[1];
|
|
@@ -2987,13 +3043,13 @@ var useLiveSearch = function (_a) {
|
|
|
2987
3043
|
function LiveSearch(_a) {
|
|
2988
3044
|
var _b = _a.autoComplete, autoComplete = _b === void 0 ? 'off' : _b, _c = _a.children, children = _c === void 0 ? undefined : _c, descText = _a.descText, _d = _a.disabled, disabled = _d === void 0 ? false : _d, dropContProps = _a.dropContProps, id = _a.id, label = _a.label, _e = _a.onChangeText, onChangeText = _e === void 0 ? function () { } : _e, _f = _a.onClickDropdown, onClickDropdown = _f === void 0 ? function () { } : _f, options = _a.options, placeholder = _a.placeholder, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.searchVariant, searchVariant = _j === void 0 ? 'include' : _j, setValue = _a.setValue, _k = _a.size, size = _k === void 0 ? 'md' : _k, _l = _a.isValid, isValid = _l === void 0 ? null : _l, value = _a.value;
|
|
2989
3045
|
var inputRef = React.useRef(null);
|
|
2990
|
-
var _m = useLiveSearch({
|
|
3046
|
+
var _m = useLiveSearch$1({
|
|
2991
3047
|
value: value,
|
|
2992
3048
|
setValue: setValue,
|
|
2993
3049
|
onChangeText: onChangeText,
|
|
2994
3050
|
dropContOnClickItem: dropContProps === null || dropContProps === void 0 ? void 0 : dropContProps.onClickItem,
|
|
2995
3051
|
}), isOpen = _m.isOpen, setIsOpen = _m.setIsOpen, searchTerm = _m.searchTerm, handleInputChange = _m.handleInputChange, handleDropdownItemClick = _m.handleDropdownItemClick;
|
|
2996
|
-
var _o = sizeConfig$
|
|
3052
|
+
var _o = sizeConfig$7[size], iconClass = _o.iconClass, iconSize = _o.iconSize, inputClass = _o.inputClass;
|
|
2997
3053
|
var _p = dropContProps || {}, dropContClassName = _p.className; _p.onClickItem; _p.anchorRef; var restDropContProps = __rest(_p, ["className", "onClickItem", "anchorRef"]);
|
|
2998
3054
|
var isSearchTermExist = searchTerm && searchTerm !== '';
|
|
2999
3055
|
var descColor = 'text-primary-cool';
|
|
@@ -3003,7 +3059,7 @@ function LiveSearch(_a) {
|
|
|
3003
3059
|
if (!disabled && isExistValidation && !isValid)
|
|
3004
3060
|
descColor = 'text-bia-red';
|
|
3005
3061
|
var filteredOptions = filterOptions(options || [], value.label);
|
|
3006
|
-
var _q = processRenderedChildren(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3062
|
+
var _q = processRenderedChildren$1(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3007
3063
|
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
3008
3064
|
return (React.createElement("div", { className: "bianic-livesearch bianic-fgc-container bianic-text-input-container field-group group/form flex w-full flex-col gap-y-2" },
|
|
3009
3065
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
@@ -3046,7 +3102,348 @@ LiveSearch.defaultProps = {
|
|
|
3046
3102
|
readonly: false,
|
|
3047
3103
|
};
|
|
3048
3104
|
|
|
3105
|
+
var sizeConfig$6 = {
|
|
3106
|
+
md: {
|
|
3107
|
+
inputClass: 'text-size-base font-[350]',
|
|
3108
|
+
paddingClass: 'p-2',
|
|
3109
|
+
resizePosition: 'bottom-2 right-2',
|
|
3110
|
+
},
|
|
3111
|
+
sm: {
|
|
3112
|
+
inputClass: 'text-size-sm',
|
|
3113
|
+
paddingClass: 'p-1',
|
|
3114
|
+
resizePosition: 'bottom-1 right-1',
|
|
3115
|
+
},
|
|
3116
|
+
};
|
|
3117
|
+
|
|
3118
|
+
var isMatchValue = function (existingValue, optionValue) {
|
|
3119
|
+
var isValueObject = typeof optionValue === 'object';
|
|
3120
|
+
if (isValueObject) {
|
|
3121
|
+
return existingValue === null || existingValue === void 0 ? void 0 : existingValue.some(function (value) { return (value === null || value === void 0 ? void 0 : value.label) === (optionValue === null || optionValue === void 0 ? void 0 : optionValue.label); });
|
|
3122
|
+
}
|
|
3123
|
+
return existingValue === null || existingValue === void 0 ? void 0 : existingValue.includes(optionValue);
|
|
3124
|
+
};
|
|
3125
|
+
var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick, existingValues) {
|
|
3126
|
+
if (searchVariant === void 0) { searchVariant = 'include'; }
|
|
3127
|
+
return React.Children.map(nodes, function (child) {
|
|
3128
|
+
if (!React.isValidElement(child) || child.type !== DropdownItem) {
|
|
3129
|
+
return child;
|
|
3130
|
+
}
|
|
3131
|
+
var itemProps = child.props;
|
|
3132
|
+
var itemContent = typeof itemProps.content === 'string' ? itemProps.content : '';
|
|
3133
|
+
var itemValue = itemProps.value;
|
|
3134
|
+
var isDisabled = itemProps.disabled;
|
|
3135
|
+
// Filtering Logic
|
|
3136
|
+
var itemValueStr = typeof itemValue === 'object' ? itemValue === null || itemValue === void 0 ? void 0 : itemValue.label : String(itemValue || '');
|
|
3137
|
+
if ((existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0 && isMatchValue(existingValues, itemValue)) {
|
|
3138
|
+
return null;
|
|
3139
|
+
}
|
|
3140
|
+
if (!includeAllIfNoSearch) {
|
|
3141
|
+
if (currentSearchTerm &&
|
|
3142
|
+
!matchSearchTerm(itemValueStr, currentSearchTerm, searchVariant)) {
|
|
3143
|
+
return null;
|
|
3144
|
+
}
|
|
3145
|
+
}
|
|
3146
|
+
// Process Nested Children
|
|
3147
|
+
var clonedChildren = itemProps.children
|
|
3148
|
+
? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick, existingValues)
|
|
3149
|
+
: null;
|
|
3150
|
+
// Clone and Inject Click Handler
|
|
3151
|
+
return React.cloneElement(child, {
|
|
3152
|
+
onClick: function (e) {
|
|
3153
|
+
if (!isDisabled) {
|
|
3154
|
+
if (itemValue === undefined &&
|
|
3155
|
+
typeof itemProps.content === 'string') {
|
|
3156
|
+
return handleDropdownItemClick(e, itemContent);
|
|
3157
|
+
}
|
|
3158
|
+
if (typeof itemValue === 'object' || itemValue !== undefined) {
|
|
3159
|
+
return handleDropdownItemClick(e, itemValue);
|
|
3160
|
+
}
|
|
3161
|
+
}
|
|
3162
|
+
if (itemProps.onClickItem) {
|
|
3163
|
+
itemProps.onClickItem(e, itemValue !== undefined ? itemValue : itemContent);
|
|
3164
|
+
}
|
|
3165
|
+
},
|
|
3166
|
+
children: clonedChildren,
|
|
3167
|
+
});
|
|
3168
|
+
});
|
|
3169
|
+
};
|
|
3170
|
+
var processRenderedChildren = function (children, searchTerm, searchVariant, handleDropdownItemClick, existingValues) {
|
|
3171
|
+
var renderedChildren = null;
|
|
3172
|
+
var hasFilteredResults = false;
|
|
3173
|
+
if ((existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0) ;
|
|
3174
|
+
if (searchTerm || (existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0) {
|
|
3175
|
+
renderedChildren = processDropdownChildren(children, searchTerm, false, searchVariant, handleDropdownItemClick, existingValues);
|
|
3176
|
+
}
|
|
3177
|
+
else {
|
|
3178
|
+
renderedChildren = processDropdownChildren(children, '', true, searchVariant, handleDropdownItemClick, []);
|
|
3179
|
+
}
|
|
3180
|
+
hasFilteredResults =
|
|
3181
|
+
React.Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
3182
|
+
return { renderedChildren: renderedChildren, hasFilteredResults: hasFilteredResults };
|
|
3183
|
+
};
|
|
3184
|
+
|
|
3185
|
+
var useLiveSearch = function (_a) {
|
|
3186
|
+
var value = _a.value, setValue = _a.setValue, onChangeText = _a.onChangeText, dropContOnClickItem = _a.dropContOnClickItem;
|
|
3187
|
+
var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
3188
|
+
var _c = React.useState(''), searchTerm = _c[0], setSearchTerm = _c[1];
|
|
3189
|
+
var handleInputChange = function (e) {
|
|
3190
|
+
var newSearchTerm = e.target.value;
|
|
3191
|
+
setSearchTerm(newSearchTerm);
|
|
3192
|
+
setIsOpen(true);
|
|
3193
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(e);
|
|
3194
|
+
};
|
|
3195
|
+
var handleDropdownItemClick = React.useCallback(function (event, clickedValue) {
|
|
3196
|
+
dropContOnClickItem === null || dropContOnClickItem === void 0 ? void 0 : dropContOnClickItem(event, clickedValue);
|
|
3197
|
+
setSearchTerm('');
|
|
3198
|
+
setValue(__spreadArray(__spreadArray([], value, true), [clickedValue], false));
|
|
3199
|
+
setIsOpen(false);
|
|
3200
|
+
}, [setValue, dropContOnClickItem]);
|
|
3201
|
+
return {
|
|
3202
|
+
isOpen: isOpen,
|
|
3203
|
+
setIsOpen: setIsOpen,
|
|
3204
|
+
searchTerm: searchTerm,
|
|
3205
|
+
handleInputChange: handleInputChange,
|
|
3206
|
+
handleDropdownItemClick: handleDropdownItemClick,
|
|
3207
|
+
};
|
|
3208
|
+
};
|
|
3209
|
+
|
|
3210
|
+
var colorConfig$1 = {
|
|
3211
|
+
default: 'bg-bia-grey-light-50 text-primary-black',
|
|
3212
|
+
blue: 'bg-bia-blue text-primary-white',
|
|
3213
|
+
teal: 'bg-bia-teal text-primary-white',
|
|
3214
|
+
green: 'bg-bia-green text-primary-white',
|
|
3215
|
+
// yellow: 'bg-bia-yellow text-primary-black',
|
|
3216
|
+
orange: 'bg-bia-orange text-primary-white',
|
|
3217
|
+
red: 'bg-bia-red text-primary-white',
|
|
3218
|
+
black: 'bg-primary-black text-primary-white',
|
|
3219
|
+
white: 'bg-primary-white text-primary-black border border-primary-black',
|
|
3220
|
+
};
|
|
3049
3221
|
var sizeConfig$5 = {
|
|
3222
|
+
md: 'px-[10px] py-[7px] h-[34px] text-size-base',
|
|
3223
|
+
sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
|
|
3224
|
+
tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
|
|
3225
|
+
};
|
|
3226
|
+
var iconOnlySizeConfig = {
|
|
3227
|
+
md: 'p-[7px]',
|
|
3228
|
+
sm: 'p-[4px]',
|
|
3229
|
+
tn: 'p-[2px]',
|
|
3230
|
+
};
|
|
3231
|
+
var closeColorConfig = {
|
|
3232
|
+
default: 'bg-bia-grey-dark-30 text-primary-white',
|
|
3233
|
+
blue: 'bg-bia-white-transparent-50 text-bia-blue',
|
|
3234
|
+
teal: 'bg-bia-white-transparent-50 text-bia-teal',
|
|
3235
|
+
green: 'bg-bia-white-transparent-50 text-bia-green',
|
|
3236
|
+
yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
|
|
3237
|
+
red: 'bg-bia-white-transparent-50 text-bia-red',
|
|
3238
|
+
black: 'bg-bia-white-transparent-50 text-primary-black',
|
|
3239
|
+
white: 'bg-bia-grey-dark-30 text-primary-white',
|
|
3240
|
+
};
|
|
3241
|
+
var closeSizeConfig = {
|
|
3242
|
+
md: 'w-[18px] h-[18px] text-[14px]',
|
|
3243
|
+
sm: 'w-[12px] h-[12px] text-[9.33px]',
|
|
3244
|
+
tn: 'w-[12px] h-[12px] text-[9.33px]',
|
|
3245
|
+
};
|
|
3246
|
+
var rightPaddingConfig = {
|
|
3247
|
+
md: 'pr-[8px]',
|
|
3248
|
+
sm: 'pr-[5px]',
|
|
3249
|
+
tn: 'pr-[3px]',
|
|
3250
|
+
};
|
|
3251
|
+
|
|
3252
|
+
var colorUnion = [
|
|
3253
|
+
'default',
|
|
3254
|
+
'blue',
|
|
3255
|
+
'teal',
|
|
3256
|
+
'green',
|
|
3257
|
+
'orange',
|
|
3258
|
+
'red',
|
|
3259
|
+
'black',
|
|
3260
|
+
'white',
|
|
3261
|
+
'custom',
|
|
3262
|
+
];
|
|
3263
|
+
var sizeUnion$1 = ['md', 'sm', 'tn'];
|
|
3264
|
+
var variantUnion = ['label', 'icon', 'closeable', 'monospace'];
|
|
3265
|
+
var TagLabel = function (_a) {
|
|
3266
|
+
var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var _c = _a.bgColor, bgColor = _c === void 0 ? 'grey-light-50' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'black' : _d, outlineColor = _a.outlineColor, isBlock = _a.isBlock, maxWidth = _a.maxWidth, isDark = _a.isDark; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
|
|
3267
|
+
var validatedColor = validUnion(color, colorUnion);
|
|
3268
|
+
var validatedSize = validUnion(size, sizeUnion$1);
|
|
3269
|
+
var validatedVariant = validUnion(variant, variantUnion);
|
|
3270
|
+
var containerRef = React.useRef(null);
|
|
3271
|
+
var _e = React.useState(null), sizeCount = _e[0], setSizeCount = _e[1];
|
|
3272
|
+
React.useEffect(function () {
|
|
3273
|
+
if (variant === 'icon') {
|
|
3274
|
+
// Get the size of the icon
|
|
3275
|
+
// and set the size of the container
|
|
3276
|
+
// to the one with the biggest size (width or height icon)
|
|
3277
|
+
// in order to make the container square
|
|
3278
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
3279
|
+
var width = rect.width;
|
|
3280
|
+
var height = rect.height;
|
|
3281
|
+
if (width > height)
|
|
3282
|
+
setSizeCount(width);
|
|
3283
|
+
else
|
|
3284
|
+
setSizeCount(height);
|
|
3285
|
+
}
|
|
3286
|
+
}, []);
|
|
3287
|
+
var isCloseable = validatedVariant === 'closeable';
|
|
3288
|
+
var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
|
|
3289
|
+
var borderColorRules = outlineColor || bgColor;
|
|
3290
|
+
var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
|
|
3291
|
+
var sizeClass = validatedVariant === 'icon'
|
|
3292
|
+
? iconOnlySizeConfig[validatedSize]
|
|
3293
|
+
: sizeConfig$5[validatedSize];
|
|
3294
|
+
var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
|
|
3295
|
+
var colorClass = validatedColor === 'custom'
|
|
3296
|
+
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
|
|
3297
|
+
: colorConfig$1[validatedColor];
|
|
3298
|
+
var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
|
|
3299
|
+
var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
|
|
3300
|
+
var alignTextClass = isBlock ? 'text-center' : 'text-left';
|
|
3301
|
+
var fontClass = validatedVariant === 'monospace' ? 'font-sans-code' : 'font-segoe pb-[1px]';
|
|
3302
|
+
var textClass = "".concat(alignTextClass, " ").concat(fontClass);
|
|
3303
|
+
var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
|
|
3304
|
+
var closeColor = validatedColor === 'custom'
|
|
3305
|
+
? isDark
|
|
3306
|
+
? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
|
|
3307
|
+
: "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
|
|
3308
|
+
: closeColorConfig[validatedColor];
|
|
3309
|
+
var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
|
|
3310
|
+
var isOpen = isCloseable ? open : true;
|
|
3311
|
+
return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
|
|
3312
|
+
maxWidth: maxWidthStyle,
|
|
3313
|
+
} }, props),
|
|
3314
|
+
leftIcon && (React.createElement("div", { style: {
|
|
3315
|
+
width: sizeCount + 'px',
|
|
3316
|
+
height: sizeCount + 'px',
|
|
3317
|
+
}, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
|
|
3318
|
+
(validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
|
|
3319
|
+
validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate ".concat(textClass) }, text)),
|
|
3320
|
+
validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
|
|
3321
|
+
" ",
|
|
3322
|
+
rightIcon,
|
|
3323
|
+
" ")),
|
|
3324
|
+
isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
|
|
3325
|
+
React.createElement(TbX, null))))));
|
|
3326
|
+
};
|
|
3327
|
+
TagLabel.defaultProps = {
|
|
3328
|
+
variant: 'default',
|
|
3329
|
+
size: 'sm',
|
|
3330
|
+
open: true,
|
|
3331
|
+
closeHandler: function () { },
|
|
3332
|
+
leftIcon: null,
|
|
3333
|
+
rightIcon: null,
|
|
3334
|
+
left: null,
|
|
3335
|
+
right: null,
|
|
3336
|
+
bgColor: 'grey-light-50',
|
|
3337
|
+
textColor: 'black',
|
|
3338
|
+
isBlock: false,
|
|
3339
|
+
maxWidth: 300,
|
|
3340
|
+
isDark: false,
|
|
3341
|
+
};
|
|
3342
|
+
|
|
3343
|
+
var TagLabelInputInner = function (_a, ref) {
|
|
3344
|
+
var children = _a.children, className = _a.className, description = _a.description, _b = _a.disabled, disabled = _b === void 0 ? false : _b, _c = _a.dropContProps, dropContProps = _c === void 0 ? {} : _c, customId = _a.id, _d = _a.isValid, isValid = _d === void 0 ? null : _d, _e = _a.label, label = _e === void 0 ? '' : _e, onBlur = _a.onBlur, onChange = _a.onChange, onChangeText = _a.onChangeText, onFocus = _a.onFocus, placeholder = _a.placeholder, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, _g = _a.required, required = _g === void 0 ? false : _g, _h = _a.size, size = _h === void 0 ? 'md' : _h, _j = _a.value, value = _j === void 0 ? [] : _j, restInputProps = __rest(_a, ["children", "className", "description", "disabled", "dropContProps", "id", "isValid", "label", "onBlur", "onChange", "onChangeText", "onFocus", "placeholder", "readOnly", "required", "size", "value"]);
|
|
3345
|
+
var generatedId = React.useId();
|
|
3346
|
+
var inputId = customId || generatedId;
|
|
3347
|
+
var _k = React.useState(false), isFocused = _k[0], setIsFocused = _k[1];
|
|
3348
|
+
var _l = React.useState(false), isHovered = _l[0], setIsHovered = _l[1];
|
|
3349
|
+
var internalInputRef = React.useRef(null);
|
|
3350
|
+
var containerRef = React.useRef(null);
|
|
3351
|
+
React.useImperativeHandle(ref, function () { return internalInputRef.current; });
|
|
3352
|
+
var isExistValidation = isValid !== null;
|
|
3353
|
+
var getTagLabel = function (item) {
|
|
3354
|
+
return typeof item === 'object' ? item.label : String(item);
|
|
3355
|
+
};
|
|
3356
|
+
var getTagStyles = function (item) {
|
|
3357
|
+
if (typeof item !== 'object')
|
|
3358
|
+
return { color: 'default' };
|
|
3359
|
+
return {
|
|
3360
|
+
color: item.color || 'default',
|
|
3361
|
+
bgColor: item.bgColor,
|
|
3362
|
+
textColor: item.textColor,
|
|
3363
|
+
outlineColor: item.outlineColor,
|
|
3364
|
+
};
|
|
3365
|
+
};
|
|
3366
|
+
var handleRemoveTag = function (indexToRemove) {
|
|
3367
|
+
if (disabled || readOnly)
|
|
3368
|
+
return;
|
|
3369
|
+
var updatedValues = value.filter(function (_, idx) { return idx !== indexToRemove; });
|
|
3370
|
+
onChange(updatedValues);
|
|
3371
|
+
};
|
|
3372
|
+
var _m = useLiveSearch({
|
|
3373
|
+
value: value,
|
|
3374
|
+
setValue: onChange,
|
|
3375
|
+
onChangeText: onChangeText,
|
|
3376
|
+
dropContOnClickItem: dropContProps === null || dropContProps === void 0 ? void 0 : dropContProps.onClickItem,
|
|
3377
|
+
}), isOpen = _m.isOpen, setIsOpen = _m.setIsOpen, searchTerm = _m.searchTerm, handleInputChange = _m.handleInputChange, handleDropdownItemClick = _m.handleDropdownItemClick;
|
|
3378
|
+
var handleKeyDown = function (e) {
|
|
3379
|
+
var _a;
|
|
3380
|
+
if (e.key === 'Backspace' && searchTerm === '' && value.length > 0) {
|
|
3381
|
+
handleRemoveTag(value.length - 1);
|
|
3382
|
+
}
|
|
3383
|
+
(_a = restInputProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(restInputProps, e);
|
|
3384
|
+
};
|
|
3385
|
+
var handleContainerClick = function () {
|
|
3386
|
+
var _a;
|
|
3387
|
+
if (!disabled && !readOnly) {
|
|
3388
|
+
(_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3389
|
+
}
|
|
3390
|
+
};
|
|
3391
|
+
var handleBlur = function (e) {
|
|
3392
|
+
var _a;
|
|
3393
|
+
if ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
|
|
3394
|
+
return;
|
|
3395
|
+
setIsFocused(false);
|
|
3396
|
+
};
|
|
3397
|
+
var getBottomBorderColor = function () {
|
|
3398
|
+
if (disabled || readOnly || (!isHovered && !isFocused))
|
|
3399
|
+
return '';
|
|
3400
|
+
if (isExistValidation && isValid)
|
|
3401
|
+
return 'border-b-bia-green';
|
|
3402
|
+
if (isExistValidation && !isValid)
|
|
3403
|
+
return 'border-b-bia-red';
|
|
3404
|
+
return 'border-b-bia-blue';
|
|
3405
|
+
};
|
|
3406
|
+
var descColor = !disabled && isExistValidation
|
|
3407
|
+
? isValid
|
|
3408
|
+
? 'text-bia-green'
|
|
3409
|
+
: 'text-bia-red'
|
|
3410
|
+
: 'text-primary-cool';
|
|
3411
|
+
var _o = sizeConfig$6[size], inputClass = _o.inputClass, paddingClass = _o.paddingClass, resizePosition = _o.resizePosition;
|
|
3412
|
+
var _p = dropContProps || {}, dropContClassName = _p.dropContClassName, restDropContProps = __rest(_p, ["dropContClassName"]);
|
|
3413
|
+
var _q = processRenderedChildren(children, searchTerm, 'include', handleDropdownItemClick, value), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3414
|
+
var showPlaceholder = !disabled && !readOnly && value.length === 0;
|
|
3415
|
+
console.log('showPlaceholder', showPlaceholder);
|
|
3416
|
+
return (React.createElement("div", { className: cn('relative w-full', className) },
|
|
3417
|
+
label && (React.createElement(FormLabel, { htmlFor: inputId, readOnly: readOnly, required: required }, label)),
|
|
3418
|
+
React.createElement("div", { ref: containerRef, onClick: handleContainerClick, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onFocus: function (e) {
|
|
3419
|
+
if (!disabled && !readOnly) {
|
|
3420
|
+
setIsFocused(true);
|
|
3421
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
3422
|
+
}
|
|
3423
|
+
}, onBlur: function (e) {
|
|
3424
|
+
handleBlur(e);
|
|
3425
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
3426
|
+
}, className: cn('field bianic-text-area relative flex w-full flex-wrap items-center gap-1.5 rounded border border-bia-grey-dark-10 bg-primary-white align-top transition-all', readOnly && 'pointer-events-none', disabled
|
|
3427
|
+
? 'cursor-not-allowed bg-bia-grey-light-80 text-bia-grey-active'
|
|
3428
|
+
: 'cursor-text', !disabled &&
|
|
3429
|
+
!readOnly &&
|
|
3430
|
+
'focus-within:rounded-b-none hover:rounded-b-none', isFocused && !disabled && !readOnly && 'rounded-b-none', getBottomBorderColor(), paddingClass) },
|
|
3431
|
+
value.map(function (tag, index) { return (React.createElement(TagLabel, __assign({ key: typeof tag === 'object' ? tag.id || tag.label : "".concat(tag, "-").concat(index), variant: "closeable", size: size, text: getTagLabel(tag), open: true, closeHandler: function () { return handleRemoveTag(index); } }, getTagStyles(tag)))); }),
|
|
3432
|
+
React.createElement("input", __assign({}, restInputProps, { "aria-autocomplete": "list", "aria-expanded": isOpen, "aria-haspopup": "listbox", disabled: disabled, id: inputId, onChange: function (e) {
|
|
3433
|
+
if (disabled || readOnly)
|
|
3434
|
+
return;
|
|
3435
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(e);
|
|
3436
|
+
handleInputChange(e);
|
|
3437
|
+
}, onKeyDown: handleKeyDown, placeholder: showPlaceholder ? placeholder || 'Select options...' : '', readOnly: readOnly, ref: internalInputRef, role: "combobox", type: "text", value: disabled || readOnly ? '' : searchTerm, className: cn(inputClass, 'min-w-[80px] flex-1 border-none bg-transparent p-0 outline-none focus:ring-0', disabled && 'cursor-not-allowed', readOnly && 'pointer-events-none') })),
|
|
3438
|
+
React.createElement(ResizeIcon, { className: cn('absolute', resizePosition) })),
|
|
3439
|
+
description && (React.createElement("p", { className: cn('mt-1.5 text-xs transition-colors', descColor) }, description)),
|
|
3440
|
+
children && (React.createElement(DropdownContainer, __assign({ anchorRef: containerRef, className: cn('bianic-livesearch-dropdown w-full overflow-hidden bg-white shadow-lg', dropContClassName), isTopFlat: true, matchAnchorWidth: "min", onClose: function () { return setIsOpen(false); }, open: isOpen && !disabled && !readOnly, size: size, zIndex: 10 }, restDropContProps), hasFilteredResults
|
|
3441
|
+
? renderedChildren
|
|
3442
|
+
: searchTerm.length > 0 && (React.createElement(DropdownItem, { content: React.createElement("div", { className: "px-4 py-2 text-gray-500" }, "Tidak ada hasil ditemukan.") }))))));
|
|
3443
|
+
};
|
|
3444
|
+
var TagLabelInput = React.forwardRef(TagLabelInputInner);
|
|
3445
|
+
|
|
3446
|
+
var sizeConfig$4 = {
|
|
3050
3447
|
md: {
|
|
3051
3448
|
containerSize: 'w-[42px] h-[22px]',
|
|
3052
3449
|
checkSize: 'p-2',
|
|
@@ -3061,7 +3458,7 @@ var sizeConfig$5 = {
|
|
|
3061
3458
|
|
|
3062
3459
|
function Toggle(_a) {
|
|
3063
3460
|
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;
|
|
3064
|
-
var _h = sizeConfig$
|
|
3461
|
+
var _h = sizeConfig$4[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
|
|
3065
3462
|
var checkedClass = checked ? 'justify-end' : 'justify-start';
|
|
3066
3463
|
var containerClass = "".concat(checkedClass, " ").concat(containerSize);
|
|
3067
3464
|
return (React.createElement("div", { className: "flex items-center" },
|
|
@@ -3089,7 +3486,7 @@ var roundedConfig = {
|
|
|
3089
3486
|
sm: 'first:rounded-l-radius-sm last:rounded-r-radius-sm',
|
|
3090
3487
|
tn: 'first:rounded-l-radius-tn last:rounded-r-radius-tn',
|
|
3091
3488
|
};
|
|
3092
|
-
var sizeConfig$
|
|
3489
|
+
var sizeConfig$3 = {
|
|
3093
3490
|
lg: 'text-size-md leading-[23.94px] px-[13px] py-[11px] ',
|
|
3094
3491
|
md: 'text-size-base leading-[21px] px-[11px] py-[8.5px] ',
|
|
3095
3492
|
sm: 'text-size-sm leading-[15.96px] px-[7px] py-[6px] ',
|
|
@@ -3112,8 +3509,8 @@ function SegmentButtonItem(_a) {
|
|
|
3112
3509
|
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;
|
|
3113
3510
|
var isSelected = selected ? 'selected' : 'notSelected';
|
|
3114
3511
|
var sizingStyle = isfitContent
|
|
3115
|
-
? "".concat(sizeConfig$
|
|
3116
|
-
: "".concat(sizeConfig$
|
|
3512
|
+
? "".concat(sizeConfig$3[size], " ").concat(minHeightConfig[size])
|
|
3513
|
+
: "".concat(sizeConfig$3[size], " ").concat(minWidthConfig[size], " ").concat(minHeightConfig[size]);
|
|
3117
3514
|
var radiusStyle = "".concat(roundedConfig[size]);
|
|
3118
3515
|
var selectedStyle = "".concat(isSelectedConfig[isSelected]);
|
|
3119
3516
|
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));
|
|
@@ -3124,10 +3521,10 @@ function SegmentButtonGroup(_a) {
|
|
|
3124
3521
|
return React.createElement("div", { className: "flex" }, children);
|
|
3125
3522
|
}
|
|
3126
3523
|
|
|
3127
|
-
var sizeUnion
|
|
3524
|
+
var sizeUnion = ['md', 'sm'];
|
|
3128
3525
|
var FormGroup = function (_a) {
|
|
3129
3526
|
var children = _a.children, size = _a.size;
|
|
3130
|
-
var validSize = validUnion(size, sizeUnion
|
|
3527
|
+
var validSize = validUnion(size, sizeUnion);
|
|
3131
3528
|
return (React.createElement("div", { className: "bianic-form-group flex items-end" }, React.Children.map(children, function (child) {
|
|
3132
3529
|
var _a;
|
|
3133
3530
|
if (!React.isValidElement(child))
|
|
@@ -3868,7 +4265,7 @@ var DateInputDisplay = React.forwardRef(function (_a, ref) {
|
|
|
3868
4265
|
var _e = React.useState(false), isEditing = _e[0], setIsEditing = _e[1];
|
|
3869
4266
|
var _f = React.useState(inputValue), dateString = _f[0], setDateString = _f[1];
|
|
3870
4267
|
var _g = styleConfig['text'], fieldStyle = _g.fieldStyle;
|
|
3871
|
-
var _h = sizeConfig$
|
|
4268
|
+
var _h = sizeConfig$d[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
3872
4269
|
var borderStyle = 'border border-bia-grey-dark-10 bg-primary-white';
|
|
3873
4270
|
var extendedInputClassName = "w-full ".concat(fieldStyle, " ").concat(fieldSize, " ").concat(borderStyle, " ").concat(className);
|
|
3874
4271
|
props.readOnly ? 'read-only:pointer-events-none' : '';
|
|
@@ -4014,7 +4411,7 @@ var YearPickerDisplay = React.forwardRef(function (_a, ref) {
|
|
|
4014
4411
|
}
|
|
4015
4412
|
}
|
|
4016
4413
|
};
|
|
4017
|
-
var _h = sizeConfig$
|
|
4414
|
+
var _h = sizeConfig$d[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
4018
4415
|
var fieldStyle = styleConfig['text'].fieldStyle;
|
|
4019
4416
|
var displayError = customErrorMessage || internalError;
|
|
4020
4417
|
var borderStyle = displayError
|
|
@@ -4130,6 +4527,198 @@ var YearPicker = function (_a) {
|
|
|
4130
4527
|
React.createElement(PickerYear, { maxYear: maxYear, minYear: minYear, zIndex: zIndexCalendar, anchorRef: inputRef, selectedYear: value, setSelectedYear: onChange, isOpen: isPickerOpen, onClose: function () { return setIsPickerOpen(false); } })));
|
|
4131
4528
|
};
|
|
4132
4529
|
|
|
4530
|
+
/**
|
|
4531
|
+
* Comprehensive MIME type & file extension validator
|
|
4532
|
+
*/
|
|
4533
|
+
var isValidFileType = function (file, accept) {
|
|
4534
|
+
if (!accept)
|
|
4535
|
+
return true;
|
|
4536
|
+
var acceptedTypes = accept
|
|
4537
|
+
.split(',')
|
|
4538
|
+
.map(function (type) { return type.trim().toLowerCase(); })
|
|
4539
|
+
.filter(Boolean);
|
|
4540
|
+
var fileName = file.name.toLowerCase();
|
|
4541
|
+
var fileType = file.type.toLowerCase();
|
|
4542
|
+
return acceptedTypes.some(function (pattern) {
|
|
4543
|
+
// 1. File Extension Matching (e.g., '.docx', '.pdf')
|
|
4544
|
+
if (pattern.startsWith('.')) {
|
|
4545
|
+
return fileName.endsWith(pattern);
|
|
4546
|
+
}
|
|
4547
|
+
// 2. Wildcard MIME Matching (e.g., 'image/*', 'application/*')
|
|
4548
|
+
if (pattern.endsWith('/*')) {
|
|
4549
|
+
var mainType = pattern.split('/')[0];
|
|
4550
|
+
return fileType.startsWith("".concat(mainType, "/"));
|
|
4551
|
+
}
|
|
4552
|
+
// 3. Exact MIME Matching (e.g., 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')
|
|
4553
|
+
return fileType === pattern;
|
|
4554
|
+
});
|
|
4555
|
+
};
|
|
4556
|
+
var useFileHandler = function (_a) {
|
|
4557
|
+
var accept = _a.accept, _b = _a.multiple, multiple = _b === void 0 ? false : _b, maxSize = _a.maxSize, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.value, value = _d === void 0 ? [] : _d, onChange = _a.onChange, onError = _a.onError;
|
|
4558
|
+
var _e = React.useState(false), isDragging = _e[0], setIsDragging = _e[1];
|
|
4559
|
+
var _f = React.useState(null), internalError = _f[0], setInternalError = _f[1];
|
|
4560
|
+
var inputRef = React.useRef(null);
|
|
4561
|
+
var processFiles = function (incomingFiles) {
|
|
4562
|
+
if (!incomingFiles || disabled)
|
|
4563
|
+
return;
|
|
4564
|
+
setInternalError(null);
|
|
4565
|
+
var validFiles = [];
|
|
4566
|
+
Array.from(incomingFiles).forEach(function (file) {
|
|
4567
|
+
// Step 1: Enforce File Extension / MIME Validation (Applies to both Click and Drag & Drop)
|
|
4568
|
+
if (!isValidFileType(file, accept)) {
|
|
4569
|
+
setInternalError("\"".concat(file.name, "\" is not an accepted format (").concat(accept, ")."));
|
|
4570
|
+
onError === null || onError === void 0 ? void 0 : onError({ file: file, reason: 'INVALID_FILE_TYPE' });
|
|
4571
|
+
return;
|
|
4572
|
+
}
|
|
4573
|
+
// Step 2: Enforce Max Size Validation
|
|
4574
|
+
if (maxSize && file.size > maxSize) {
|
|
4575
|
+
var maxSizeMb = (maxSize / (1024 * 1024)).toFixed(0);
|
|
4576
|
+
setInternalError("\"".concat(file.name, "\" exceeds the limit of ").concat(maxSizeMb, " MB."));
|
|
4577
|
+
onError === null || onError === void 0 ? void 0 : onError({ file: file, reason: 'MAX_SIZE_EXCEEDED' });
|
|
4578
|
+
return;
|
|
4579
|
+
}
|
|
4580
|
+
validFiles.push({
|
|
4581
|
+
id: "".concat(file.name, "-").concat(Date.now(), "-").concat(Math.random().toString(36).substring(2, 9)),
|
|
4582
|
+
file: file,
|
|
4583
|
+
progress: 100,
|
|
4584
|
+
});
|
|
4585
|
+
});
|
|
4586
|
+
// If zero dropped files passed validation, halt state update
|
|
4587
|
+
if (validFiles.length === 0)
|
|
4588
|
+
return;
|
|
4589
|
+
var updated = multiple ? __spreadArray(__spreadArray([], value, true), validFiles, true) : validFiles;
|
|
4590
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(updated);
|
|
4591
|
+
};
|
|
4592
|
+
var handleDragOver = function (e) {
|
|
4593
|
+
e.preventDefault();
|
|
4594
|
+
e.stopPropagation();
|
|
4595
|
+
if (!disabled)
|
|
4596
|
+
setIsDragging(true);
|
|
4597
|
+
};
|
|
4598
|
+
var handleDragLeave = function (e) {
|
|
4599
|
+
e.preventDefault();
|
|
4600
|
+
e.stopPropagation();
|
|
4601
|
+
setIsDragging(false);
|
|
4602
|
+
};
|
|
4603
|
+
var handleDrop = function (e) {
|
|
4604
|
+
e.preventDefault();
|
|
4605
|
+
e.stopPropagation();
|
|
4606
|
+
setIsDragging(false);
|
|
4607
|
+
if (!disabled && e.dataTransfer.files) {
|
|
4608
|
+
// Explicitly pass dragged files through our validator
|
|
4609
|
+
processFiles(e.dataTransfer.files);
|
|
4610
|
+
}
|
|
4611
|
+
};
|
|
4612
|
+
var handleInputChange = function (e) {
|
|
4613
|
+
processFiles(e.target.files || []);
|
|
4614
|
+
if (inputRef.current)
|
|
4615
|
+
inputRef.current.value = '';
|
|
4616
|
+
};
|
|
4617
|
+
var triggerClick = function () {
|
|
4618
|
+
var _a;
|
|
4619
|
+
if (!disabled)
|
|
4620
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
4621
|
+
};
|
|
4622
|
+
return {
|
|
4623
|
+
inputRef: inputRef,
|
|
4624
|
+
isDragging: isDragging,
|
|
4625
|
+
internalError: internalError,
|
|
4626
|
+
handleDragOver: handleDragOver,
|
|
4627
|
+
handleDragLeave: handleDragLeave,
|
|
4628
|
+
handleDrop: handleDrop,
|
|
4629
|
+
handleInputChange: handleInputChange,
|
|
4630
|
+
triggerClick: triggerClick,
|
|
4631
|
+
};
|
|
4632
|
+
};
|
|
4633
|
+
|
|
4634
|
+
var SimpleFileUploader = function (_a) {
|
|
4635
|
+
var _b = _a.size, size = _b === void 0 ? 'md' : _b, accept = _a.accept, _c = _a.multiple, multiple = _c === void 0 ? false : _c, maxSize = _a.maxSize, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.label, label = _e === void 0 ? 'Choose File' : _e, _f = _a.variant, variant = _f === void 0 ? 'form-group' : _f, errorMessage = _a.errorMessage, _g = _a.value, value = _g === void 0 ? [] : _g, onChange = _a.onChange, onError = _a.onError, className = _a.className;
|
|
4636
|
+
var _h = useFileHandler({
|
|
4637
|
+
accept: accept,
|
|
4638
|
+
multiple: multiple,
|
|
4639
|
+
maxSize: maxSize,
|
|
4640
|
+
disabled: disabled,
|
|
4641
|
+
value: value,
|
|
4642
|
+
onChange: onChange,
|
|
4643
|
+
onError: onError,
|
|
4644
|
+
}), inputRef = _h.inputRef, internalError = _h.internalError, handleInputChange = _h.handleInputChange, triggerClick = _h.triggerClick;
|
|
4645
|
+
var activeError = errorMessage || internalError;
|
|
4646
|
+
var iconSizes = {
|
|
4647
|
+
tn: 14,
|
|
4648
|
+
sm: 14,
|
|
4649
|
+
md: 18,
|
|
4650
|
+
lg: 22,
|
|
4651
|
+
}[size];
|
|
4652
|
+
return (React.createElement("div", { className: cn('inline-flex flex-col items-start gap-1.5', className) },
|
|
4653
|
+
React.createElement("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, onChange: handleInputChange, className: "hidden", "aria-label": "File input" }),
|
|
4654
|
+
React.createElement(Button, { label: label, onClick: triggerClick, disabled: disabled, size: size, variant: variant, iconLeft: React.createElement(TbFolderOpen, { size: iconSizes, className: "shrink-0 text-bia-black" }) }),
|
|
4655
|
+
activeError && (React.createElement("div", { className: "flex items-center gap-1 text-xs font-medium text-bia-red" },
|
|
4656
|
+
React.createElement(TbAlertCircle, { size: 14, className: "shrink-0" }),
|
|
4657
|
+
React.createElement("span", null, activeError)))));
|
|
4658
|
+
};
|
|
4659
|
+
|
|
4660
|
+
var DropzoneFileUploader = function (_a) {
|
|
4661
|
+
var _b = _a.variant, variant = _b === void 0 ? 'general' : _b, accept = _a.accept, _c = _a.multiple, multiple = _c === void 0 ? false : _c, maxSize = _a.maxSize, _d = _a.disabled, disabled = _d === void 0 ? false : _d, label = _a.label, helperText = _a.helperText, errorMessage = _a.errorMessage, _e = _a.value, value = _e === void 0 ? [] : _e, onChange = _a.onChange, onRemove = _a.onRemove, onError = _a.onError, onDownload = _a.onDownload, className = _a.className;
|
|
4662
|
+
var effectiveAccept = accept || (variant === 'image' ? 'image/*' : undefined);
|
|
4663
|
+
var _f = useFileHandler({
|
|
4664
|
+
accept: effectiveAccept,
|
|
4665
|
+
multiple: multiple,
|
|
4666
|
+
maxSize: maxSize,
|
|
4667
|
+
disabled: disabled,
|
|
4668
|
+
value: value,
|
|
4669
|
+
onChange: onChange,
|
|
4670
|
+
onError: onError,
|
|
4671
|
+
}), inputRef = _f.inputRef, isDragging = _f.isDragging, internalError = _f.internalError, handleDragOver = _f.handleDragOver, handleDragLeave = _f.handleDragLeave, handleDrop = _f.handleDrop, handleInputChange = _f.handleInputChange, triggerClick = _f.triggerClick;
|
|
4672
|
+
var isImageVariant = variant === 'image';
|
|
4673
|
+
var defaultTitle = isImageVariant
|
|
4674
|
+
? 'Drag & Drop your Image here'
|
|
4675
|
+
: 'Click or drag and drop to upload your file';
|
|
4676
|
+
var formattedMaxSize = maxSize
|
|
4677
|
+
? "".concat((maxSize / (1024 * 1024)).toFixed(0), " MB")
|
|
4678
|
+
: undefined;
|
|
4679
|
+
var defaultSubtext = helperText ||
|
|
4680
|
+
(formattedMaxSize ? "Maximum upload file size ".concat(formattedMaxSize) : '');
|
|
4681
|
+
var activeError = errorMessage || internalError;
|
|
4682
|
+
return (React.createElement("div", { className: cn('flex w-full flex-col gap-3', className) },
|
|
4683
|
+
React.createElement("input", { ref: inputRef, type: "file", accept: effectiveAccept, multiple: multiple, disabled: disabled, onChange: handleInputChange, className: "peer hidden", "aria-label": "File upload dropzone" }),
|
|
4684
|
+
React.createElement("div", { onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: triggerClick, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: function (e) {
|
|
4685
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
4686
|
+
e.preventDefault();
|
|
4687
|
+
triggerClick();
|
|
4688
|
+
}
|
|
4689
|
+
}, className: cn('relative flex cursor-pointer select-none flex-col items-center justify-center rounded-xl border border-dashed bg-bia-white pb-5 pt-4 text-center transition-all', disabled && 'cursor-not-allowed bg-bia-grey-light-50 opacity-60', activeError ? 'border-red-500 bg-red-50/20' : '', isDragging
|
|
4690
|
+
? 'bg-blue-50/50 border-bia-blue'
|
|
4691
|
+
: !activeError &&
|
|
4692
|
+
'border-bia-grey-dark-10 hover:border-bia-blue hover:bg-gray-50') },
|
|
4693
|
+
React.createElement(TbPhotoUp, { size: 36, className: "mb-2 text-bia-coolgrey" }),
|
|
4694
|
+
React.createElement("div", { className: "mb-3 flex flex-col items-center justify-center" },
|
|
4695
|
+
React.createElement(Text, { variant: "normal-text-semibold", className: "text-bia-coolgrey" }, label || defaultTitle),
|
|
4696
|
+
React.createElement(Text, { variant: "small-text", className: "text-xs text-bia-coolgrey" }, defaultSubtext)),
|
|
4697
|
+
React.createElement(Button, { label: "Browse File", size: "md", variant: "subtle-link", disabled: disabled })),
|
|
4698
|
+
activeError && (React.createElement("div", { className: "flex items-center gap-1.5 text-xs font-medium text-bia-red" },
|
|
4699
|
+
React.createElement(TbAlertCircle, { size: 16, className: "shrink-0" }),
|
|
4700
|
+
React.createElement("span", null, activeError))),
|
|
4701
|
+
value.length > 0 && (React.createElement("ul", { className: "mt-1 flex flex-col gap-2" }, value.map(function (item) { return (React.createElement("li", { key: item.id, className: "flex items-center justify-between rounded-lg border border-gray-200 bg-white p-3 shadow-sm" },
|
|
4702
|
+
React.createElement("div", { className: "flex items-center gap-3 truncate" },
|
|
4703
|
+
React.createElement("div", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded bg-gray-100 text-gray-500" }, isImageVariant ? (React.createElement(TbPhotoUp, { size: 20 })) : (React.createElement(TbFile, { size: 20 }))),
|
|
4704
|
+
React.createElement("div", { className: "flex flex-col truncate" },
|
|
4705
|
+
React.createElement("span", { className: "truncate text-sm font-medium text-gray-800" }, item.file.name),
|
|
4706
|
+
React.createElement("span", { className: "text-xs text-gray-400" },
|
|
4707
|
+
(item.file.size / (1024 * 1024)).toFixed(1),
|
|
4708
|
+
" MB"))),
|
|
4709
|
+
React.createElement("div", { className: "flex items-center gap-1" },
|
|
4710
|
+
onDownload && (React.createElement("button", { type: "button", onClick: function (e) {
|
|
4711
|
+
e.stopPropagation();
|
|
4712
|
+
onDownload(item.id);
|
|
4713
|
+
}, className: "rounded-full p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-700", "aria-label": "Download ".concat(item.file.name) },
|
|
4714
|
+
React.createElement(TbDownload, { size: 18 }))),
|
|
4715
|
+
onRemove && (React.createElement("button", { type: "button", onClick: function (e) {
|
|
4716
|
+
e.stopPropagation();
|
|
4717
|
+
onRemove(item.id);
|
|
4718
|
+
}, className: "rounded-full p-1.5 text-gray-400 hover:bg-gray-100 hover:text-red-500", "aria-label": "Remove ".concat(item.file.name) },
|
|
4719
|
+
React.createElement(TbTrash, { size: 18 })))))); })))));
|
|
4720
|
+
};
|
|
4721
|
+
|
|
4133
4722
|
var AlertRoundedSquare = function (_a) {
|
|
4134
4723
|
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
4135
4724
|
return (React.createElement("svg", { className: className, width: size, height: size, viewBox: "0 0 24 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -4325,13 +4914,13 @@ var VirtualPort = function (_a) {
|
|
|
4325
4914
|
React.createElement("path", { d: "M16.909 3.81818C17.777 3.81818 18.6097 4.16341 19.2234 4.77717C19.8369 5.39083 20.1814 6.2229 20.1815 7.09064V16.909C20.1815 17.777 19.8372 18.6097 19.2234 19.2235C18.6097 19.8372 17.777 20.1815 16.909 20.1815H7.09064C6.2229 20.1814 5.39082 19.837 4.77716 19.2235C4.16341 18.6097 3.81818 17.777 3.81818 16.909V7.09064C3.81825 6.22276 4.16347 5.39086 4.77716 4.77717C5.39085 4.16347 6.22275 3.81825 7.09064 3.81818H16.909ZM12.0008 7.09064C11.7838 7.09064 11.5751 7.17744 11.4217 7.33088C11.2684 7.48427 11.1825 7.69214 11.1824 7.909V11.1815H7.909C7.69216 11.1816 7.48421 11.2684 7.33087 11.4217C7.17755 11.5751 7.09166 11.783 7.09161 11.9998C7.09161 12.2168 7.17743 12.4255 7.33087 12.5789C7.48419 12.7321 7.69224 12.8181 7.909 12.8182H11.1824V16.0906C11.1824 16.3076 11.2683 16.5163 11.4217 16.6697C11.5751 16.8231 11.7838 16.909 12.0008 16.909C12.2176 16.9089 12.4256 16.823 12.5789 16.6697C12.7324 16.5163 12.8182 16.3076 12.8182 16.0906V12.8182H16.0916C16.3084 12.8181 16.5164 12.7321 16.6697 12.5789C16.8232 12.4255 16.909 12.2168 16.909 11.9998C16.9089 11.7829 16.8231 11.5751 16.6697 11.4217C16.5164 11.2683 16.3085 11.1816 16.0916 11.1815H12.8182V7.909C12.8182 7.69213 12.7322 7.48428 12.5789 7.33088C12.4256 7.17755 12.2176 7.09076 12.0008 7.09064Z", fill: "inherit" })));
|
|
4326
4915
|
};
|
|
4327
4916
|
|
|
4328
|
-
var colorConfig
|
|
4917
|
+
var colorConfig = {
|
|
4329
4918
|
yellow: 'bg-bia-yellow-light-80',
|
|
4330
4919
|
blue: 'bg-bia-sky-light-90',
|
|
4331
4920
|
grey: 'bg-bia-grey-light-80',
|
|
4332
4921
|
white: 'bg-bia-white border border-bia-grey',
|
|
4333
4922
|
};
|
|
4334
|
-
var sizeConfig$
|
|
4923
|
+
var sizeConfig$2 = {
|
|
4335
4924
|
container: 'min-h-fit p-5 text-wrap',
|
|
4336
4925
|
'form-sm': 'min-h-[30px] h-fit whitespace-nowrap p-[7px]',
|
|
4337
4926
|
'form-md': 'min-h-[40px] h-fit whitespace-nowrap px-2.5 py-[9.5px]',
|
|
@@ -4339,8 +4928,8 @@ var sizeConfig$3 = {
|
|
|
4339
4928
|
|
|
4340
4929
|
var InfoPanel = function (_a) {
|
|
4341
4930
|
var variant = _a.variant, color = _a.color, className = _a.className, children = _a.children;
|
|
4342
|
-
var sizeClass = sizeConfig$
|
|
4343
|
-
var colorClass = colorConfig
|
|
4931
|
+
var sizeClass = sizeConfig$2[variant || 'container'];
|
|
4932
|
+
var colorClass = colorConfig[color || 'yellow'];
|
|
4344
4933
|
var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
|
|
4345
4934
|
return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) }, children));
|
|
4346
4935
|
};
|
|
@@ -4395,7 +4984,7 @@ var Notification = function (props) {
|
|
|
4395
4984
|
children));
|
|
4396
4985
|
};
|
|
4397
4986
|
|
|
4398
|
-
var sizeConfig$
|
|
4987
|
+
var sizeConfig$1 = {
|
|
4399
4988
|
md: 'min-w-[40px] h-[40px] text-[14px] font-semibold',
|
|
4400
4989
|
sm: 'min-w-[30px] h-[30px] text-[12px] font-normal',
|
|
4401
4990
|
};
|
|
@@ -4464,7 +5053,7 @@ function PaginationBar(_a) {
|
|
|
4464
5053
|
}
|
|
4465
5054
|
return (React.createElement(Button, { key: page, variant: "subtle", size: size, type: "button", onClick: function () {
|
|
4466
5055
|
handlePageChange(page);
|
|
4467
|
-
}, className: "cursor-pointer ".concat(sizeConfig$
|
|
5056
|
+
}, className: "cursor-pointer ".concat(sizeConfig$1[size]), label: page.toString(), minWidth: buttonSizingStyle }));
|
|
4468
5057
|
}),
|
|
4469
5058
|
React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
|
|
4470
5059
|
handlePageChange(currentPage + 1);
|
|
@@ -4817,7 +5406,7 @@ var SidebarMenu = function (_a) {
|
|
|
4817
5406
|
var _f = React.useState(false), isAllExpanded = _f[0], setIsAllExpanded = _f[1];
|
|
4818
5407
|
var minimizedMenuClass = isMinimized
|
|
4819
5408
|
? 'opacity-100 h-1 w-full delay-[600ms] duration-300 ease-[cubic-bezier(0.68,-0.1,0.32,2)]'
|
|
4820
|
-
: 'opacity-0 h-1 duration-500 ease-[cubic-bezier(0.32,-1,0.68,1)]';
|
|
5409
|
+
: 'opacity-0 h-1 w-full duration-500 ease-[cubic-bezier(0.32,-1,0.68,1)]';
|
|
4821
5410
|
return (React.createElement("div", null,
|
|
4822
5411
|
React.createElement("div", { className: "relative flex h-[60px] w-full text-bia-white" },
|
|
4823
5412
|
React.createElement("div", { className: "absolute left-0 top-[27.5px] px-[17px] ".concat(minimizedMenuClass) },
|
|
@@ -4842,139 +5431,6 @@ var SidebarMenu = function (_a) {
|
|
|
4842
5431
|
})));
|
|
4843
5432
|
};
|
|
4844
5433
|
|
|
4845
|
-
var colorConfig = {
|
|
4846
|
-
default: 'bg-bia-grey-light-50 text-primary-black',
|
|
4847
|
-
blue: 'bg-bia-blue text-primary-white',
|
|
4848
|
-
teal: 'bg-bia-teal text-primary-white',
|
|
4849
|
-
green: 'bg-bia-green text-primary-white',
|
|
4850
|
-
// yellow: 'bg-bia-yellow text-primary-black',
|
|
4851
|
-
orange: 'bg-bia-orange text-primary-white',
|
|
4852
|
-
red: 'bg-bia-red text-primary-white',
|
|
4853
|
-
black: 'bg-primary-black text-primary-white',
|
|
4854
|
-
white: 'bg-primary-white text-primary-black border border-primary-black',
|
|
4855
|
-
};
|
|
4856
|
-
var sizeConfig$1 = {
|
|
4857
|
-
md: 'px-[10px] py-[7px] h-[34px] text-size-base',
|
|
4858
|
-
sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
|
|
4859
|
-
tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
|
|
4860
|
-
};
|
|
4861
|
-
var iconOnlySizeConfig = {
|
|
4862
|
-
md: 'p-[7px]',
|
|
4863
|
-
sm: 'p-[4px]',
|
|
4864
|
-
tn: 'p-[2px]',
|
|
4865
|
-
};
|
|
4866
|
-
var closeColorConfig = {
|
|
4867
|
-
default: 'bg-bia-grey-dark-30 text-primary-white',
|
|
4868
|
-
blue: 'bg-bia-white-transparent-50 text-bia-blue',
|
|
4869
|
-
teal: 'bg-bia-white-transparent-50 text-bia-teal',
|
|
4870
|
-
green: 'bg-bia-white-transparent-50 text-bia-green',
|
|
4871
|
-
yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
|
|
4872
|
-
red: 'bg-bia-white-transparent-50 text-bia-red',
|
|
4873
|
-
black: 'bg-bia-white-transparent-50 text-primary-black',
|
|
4874
|
-
white: 'bg-bia-grey-dark-30 text-primary-white',
|
|
4875
|
-
};
|
|
4876
|
-
var closeSizeConfig = {
|
|
4877
|
-
md: 'w-[18px] h-[18px] text-[14px]',
|
|
4878
|
-
sm: 'w-[12px] h-[12px] text-[9.33px]',
|
|
4879
|
-
tn: 'w-[12px] h-[12px] text-[9.33px]',
|
|
4880
|
-
};
|
|
4881
|
-
var rightPaddingConfig = {
|
|
4882
|
-
md: 'pr-[8px]',
|
|
4883
|
-
sm: 'pr-[5px]',
|
|
4884
|
-
tn: 'pr-[3px]',
|
|
4885
|
-
};
|
|
4886
|
-
|
|
4887
|
-
var colorUnion = [
|
|
4888
|
-
'default',
|
|
4889
|
-
'blue',
|
|
4890
|
-
'teal',
|
|
4891
|
-
'green',
|
|
4892
|
-
'orange',
|
|
4893
|
-
'red',
|
|
4894
|
-
'black',
|
|
4895
|
-
'white',
|
|
4896
|
-
'custom',
|
|
4897
|
-
];
|
|
4898
|
-
var sizeUnion = ['md', 'sm', 'tn'];
|
|
4899
|
-
var variantUnion = ['label', 'icon', 'closeable', 'monospace'];
|
|
4900
|
-
var TagLabel = function (_a) {
|
|
4901
|
-
var color = _a.color, _b = _a.size, size = _b === void 0 ? 'md' : _b, variant = _a.variant, closeHandler = _a.closeHandler, open = _a.open, text = _a.text, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon; _a.left; _a.right; var _c = _a.bgColor, bgColor = _c === void 0 ? 'grey-light-50' : _c, _d = _a.textColor, textColor = _d === void 0 ? 'black' : _d, outlineColor = _a.outlineColor, isBlock = _a.isBlock, maxWidth = _a.maxWidth, isDark = _a.isDark; _a.style; var props = __rest(_a, ["color", "size", "variant", "closeHandler", "open", "text", "leftIcon", "rightIcon", "left", "right", "bgColor", "textColor", "outlineColor", "isBlock", "maxWidth", "isDark", "style"]);
|
|
4902
|
-
var validatedColor = validUnion(color, colorUnion);
|
|
4903
|
-
var validatedSize = validUnion(size, sizeUnion);
|
|
4904
|
-
var validatedVariant = validUnion(variant, variantUnion);
|
|
4905
|
-
var containerRef = React.useRef(null);
|
|
4906
|
-
var _e = React.useState(null), sizeCount = _e[0], setSizeCount = _e[1];
|
|
4907
|
-
React.useEffect(function () {
|
|
4908
|
-
if (variant === 'icon') {
|
|
4909
|
-
// Get the size of the icon
|
|
4910
|
-
// and set the size of the container
|
|
4911
|
-
// to the one with the biggest size (width or height icon)
|
|
4912
|
-
// in order to make the container square
|
|
4913
|
-
var rect = containerRef.current.getBoundingClientRect();
|
|
4914
|
-
var width = rect.width;
|
|
4915
|
-
var height = rect.height;
|
|
4916
|
-
if (width > height)
|
|
4917
|
-
setSizeCount(width);
|
|
4918
|
-
else
|
|
4919
|
-
setSizeCount(height);
|
|
4920
|
-
}
|
|
4921
|
-
}, []);
|
|
4922
|
-
var isCloseable = validatedVariant === 'closeable';
|
|
4923
|
-
var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
|
|
4924
|
-
var borderColorRules = outlineColor || bgColor;
|
|
4925
|
-
var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
|
|
4926
|
-
var sizeClass = validatedVariant === 'icon'
|
|
4927
|
-
? iconOnlySizeConfig[validatedSize]
|
|
4928
|
-
: sizeConfig$1[validatedSize];
|
|
4929
|
-
var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
|
|
4930
|
-
var colorClass = validatedColor === 'custom'
|
|
4931
|
-
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
|
|
4932
|
-
: colorConfig[validatedColor];
|
|
4933
|
-
var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
|
|
4934
|
-
var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
|
|
4935
|
-
var alignTextClass = isBlock ? 'text-center' : 'text-left';
|
|
4936
|
-
var fontClass = validatedVariant === 'monospace' ? 'font-sans-code' : 'font-segoe pb-[1px]';
|
|
4937
|
-
var textClass = "".concat(alignTextClass, " ").concat(fontClass);
|
|
4938
|
-
var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
|
|
4939
|
-
var closeColor = validatedColor === 'custom'
|
|
4940
|
-
? isDark
|
|
4941
|
-
? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
|
|
4942
|
-
: "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
|
|
4943
|
-
: closeColorConfig[validatedColor];
|
|
4944
|
-
var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
|
|
4945
|
-
var isOpen = isCloseable ? open : true;
|
|
4946
|
-
return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
|
|
4947
|
-
maxWidth: maxWidthStyle,
|
|
4948
|
-
} }, props),
|
|
4949
|
-
leftIcon && (React.createElement("div", { style: {
|
|
4950
|
-
width: sizeCount + 'px',
|
|
4951
|
-
height: sizeCount + 'px',
|
|
4952
|
-
}, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
|
|
4953
|
-
(validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
|
|
4954
|
-
validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate ".concat(textClass) }, text)),
|
|
4955
|
-
validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
|
|
4956
|
-
" ",
|
|
4957
|
-
rightIcon,
|
|
4958
|
-
" ")),
|
|
4959
|
-
isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
|
|
4960
|
-
React.createElement(TbX, null))))));
|
|
4961
|
-
};
|
|
4962
|
-
TagLabel.defaultProps = {
|
|
4963
|
-
variant: 'default',
|
|
4964
|
-
size: 'sm',
|
|
4965
|
-
open: true,
|
|
4966
|
-
closeHandler: function () { },
|
|
4967
|
-
leftIcon: null,
|
|
4968
|
-
rightIcon: null,
|
|
4969
|
-
left: null,
|
|
4970
|
-
right: null,
|
|
4971
|
-
bgColor: 'grey-light-50',
|
|
4972
|
-
textColor: 'black',
|
|
4973
|
-
isBlock: false,
|
|
4974
|
-
maxWidth: 300,
|
|
4975
|
-
isDark: false,
|
|
4976
|
-
};
|
|
4977
|
-
|
|
4978
5434
|
var SidebarItem = React.forwardRef(function (_a, ref) {
|
|
4979
5435
|
var id = _a.id, title = _a.title, icon = _a.icon; _a.active; var onClick = _a.onClick, children = _a.children, _c = _a.isMinimized, isMinimized = _c === void 0 ? false : _c, _d = _a.isExpand, isExpand = _d === void 0 ? false : _d, notificationCount = _a.notificationCount, _e = _a.level, level = _e === void 0 ? 0 : _e, _f = _a.activeId, activeId = _f === void 0 ? null : _f, _g = _a.setActiveId, setActiveId = _g === void 0 ? function () { } : _g, _h = _a.className, className = _h === void 0 ? '' : _h, _j = _a.color, color = _j === void 0 ? 'blue' : _j, restProps = __rest(_a, ["id", "title", "icon", "active", "onClick", "children", "isMinimized", "isExpand", "notificationCount", "level", "activeId", "setActiveId", "className", "color"]);
|
|
4980
5436
|
var childDropdownRef = React.useRef(null);
|
|
@@ -5402,7 +5858,7 @@ function TableCell(_a) {
|
|
|
5402
5858
|
if (variant === 'head') {
|
|
5403
5859
|
return (React.createElement("th", __assign({ className: "bianic-table-cell table-head bg-bia-grey-light-80 ".concat(columnClass) }, props), children));
|
|
5404
5860
|
}
|
|
5405
|
-
return (React.createElement("td", __assign({ className: "bianic-table-cell table-col ".concat(columnClass) }, props), children));
|
|
5861
|
+
return (React.createElement("td", __assign({ className: "bianic-table-cell table-col ".concat(columnClass, " break-words") }, props), children));
|
|
5406
5862
|
}
|
|
5407
5863
|
TableCell.defaultProps = {
|
|
5408
5864
|
lined: false,
|
|
@@ -5783,6 +6239,7 @@ exports.Display = Display;
|
|
|
5783
6239
|
exports.Divider = Divider;
|
|
5784
6240
|
exports.DropdownContainer = DropdownContainer;
|
|
5785
6241
|
exports.DropdownItem = DropdownItem;
|
|
6242
|
+
exports.DropzoneFileUploader = DropzoneFileUploader;
|
|
5786
6243
|
exports.EmptyTable = EmptyTable;
|
|
5787
6244
|
exports.FileTree = FileTree;
|
|
5788
6245
|
exports.FormGroup = FormGroup;
|
|
@@ -5814,6 +6271,7 @@ exports.SidebarContainer = SidebarContainer;
|
|
|
5814
6271
|
exports.SidebarItem = SidebarItem;
|
|
5815
6272
|
exports.SidebarMenu = SidebarMenu;
|
|
5816
6273
|
exports.SidebarProfile = SidebarProfile;
|
|
6274
|
+
exports.SimpleFileUploader = SimpleFileUploader;
|
|
5817
6275
|
exports.Slider = Slider;
|
|
5818
6276
|
exports.Spinner = Spinner;
|
|
5819
6277
|
exports.Tab = Tab;
|
|
@@ -5827,6 +6285,7 @@ exports.TableHeaderController = TableHeaderController;
|
|
|
5827
6285
|
exports.TableRow = TableRow;
|
|
5828
6286
|
exports.TableSearchInput = TableSearchInput;
|
|
5829
6287
|
exports.TagLabel = TagLabel;
|
|
6288
|
+
exports.TagLabelInput = TagLabelInput;
|
|
5830
6289
|
exports.Text = Text;
|
|
5831
6290
|
exports.TextArea = TextArea;
|
|
5832
6291
|
exports.TextInput = TextInput;
|