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/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect, forwardRef, isValidElement, cloneElement, useRef, useLayoutEffect, Children, useMemo, useCallback, useImperativeHandle } from 'react';
|
|
1
|
+
import React, { useState, useEffect, forwardRef, isValidElement, cloneElement, useRef, useLayoutEffect, Children, useMemo, useCallback, useId, useImperativeHandle } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
|
|
4
4
|
function Accordions(_a) {
|
|
@@ -95,18 +95,28 @@ function TbCircleFilled (props) {
|
|
|
95
95
|
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);
|
|
96
96
|
}function TbX (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":"M18 6l-12 12"},"child":[]},{"tag":"path","attr":{"d":"M6 6l12 12"},"child":[]}]})(props);
|
|
98
|
+
}function TbTrash (props) {
|
|
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":"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);
|
|
98
100
|
}function TbRefresh (props) {
|
|
99
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":"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);
|
|
100
102
|
}function TbPlaystationX (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":"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);
|
|
104
|
+
}function TbPhotoUp (props) {
|
|
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":"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);
|
|
102
106
|
}function TbMinus (props) {
|
|
103
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":"M5 12l14 0"},"child":[]}]})(props);
|
|
104
108
|
}function TbLoader2 (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":"M12 3a9 9 0 1 0 9 9"},"child":[]}]})(props);
|
|
110
|
+
}function TbFolderOpen (props) {
|
|
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":"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);
|
|
112
|
+
}function TbFile (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":"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);
|
|
106
114
|
}function TbEye (props) {
|
|
107
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":"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);
|
|
108
116
|
}function TbEyeOff (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.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);
|
|
118
|
+
}function TbDownload (props) {
|
|
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":"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);
|
|
110
120
|
}function TbDots (props) {
|
|
111
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":"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);
|
|
112
122
|
}function TbCrop11 (props) {
|
|
@@ -131,6 +141,8 @@ function TbCircleFilled (props) {
|
|
|
131
141
|
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);
|
|
132
142
|
}function TbAlertTriangle (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":"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);
|
|
144
|
+
}function TbAlertCircle (props) {
|
|
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":"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);
|
|
134
146
|
}
|
|
135
147
|
|
|
136
148
|
function InfoIcon() {
|
|
@@ -315,7 +327,7 @@ var useDetectOutsideClick = function (ref, initialState, ignoreRef, event) {
|
|
|
315
327
|
return [isActive, setIsActive];
|
|
316
328
|
};
|
|
317
329
|
|
|
318
|
-
var variantUnion$
|
|
330
|
+
var variantUnion$1 = [
|
|
319
331
|
'normal-text', // default
|
|
320
332
|
'large-text',
|
|
321
333
|
'large-text-semibold',
|
|
@@ -335,7 +347,7 @@ var variantUnion$2 = [
|
|
|
335
347
|
];
|
|
336
348
|
function Text(_a) {
|
|
337
349
|
var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children, _c = _a.className, className = _c === void 0 ? '' : _c;
|
|
338
|
-
var validatedVariant = validUnion(variant, variantUnion$
|
|
350
|
+
var validatedVariant = validUnion(variant, variantUnion$1);
|
|
339
351
|
var defaultColor = extended.includes('text-bia') || (className === null || className === void 0 ? void 0 : className.includes('text-bia'))
|
|
340
352
|
? ''
|
|
341
353
|
: 'text-bia-black';
|
|
@@ -465,7 +477,7 @@ var radiusConfig$1 = {
|
|
|
465
477
|
tn: 'rounded-radius-full focus-visible:rounded-radius-full',
|
|
466
478
|
},
|
|
467
479
|
};
|
|
468
|
-
var sizeConfig$
|
|
480
|
+
var sizeConfig$f = {
|
|
469
481
|
lg: 'py-[10.5px] h-[48px] flex items-center justify-center gap-[10px] text-size-md ',
|
|
470
482
|
md: 'py-[9px] h-[40px] flex items-center justify-center gap-[5px] text-size-base ',
|
|
471
483
|
sm: 'py-[6px] h-[30px] flex items-center justify-center gap-[5px] text-size-sm ',
|
|
@@ -515,7 +527,7 @@ var variantConfig$3 = {
|
|
|
515
527
|
'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 ",
|
|
516
528
|
};
|
|
517
529
|
|
|
518
|
-
var
|
|
530
|
+
var BUTTON_VARIANT_UNION = [
|
|
519
531
|
'default',
|
|
520
532
|
'danger',
|
|
521
533
|
'info',
|
|
@@ -533,13 +545,29 @@ var variantUnion$1 = [
|
|
|
533
545
|
'warning-outlined',
|
|
534
546
|
'form-group',
|
|
535
547
|
];
|
|
536
|
-
var
|
|
537
|
-
var
|
|
548
|
+
var RADIUS_UNION = ['default', 'full-rounded'];
|
|
549
|
+
var SIZE_UNION = ['md', 'lg', 'sm', 'tn'];
|
|
538
550
|
var Button = forwardRef(function (_a, ref) {
|
|
539
551
|
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"]);
|
|
540
|
-
var validatedVariant = validUnion(variant,
|
|
541
|
-
var validatedSize = validUnion(size,
|
|
542
|
-
var validatedRadius = validUnion(radius,
|
|
552
|
+
var validatedVariant = validUnion(variant, BUTTON_VARIANT_UNION);
|
|
553
|
+
var validatedSize = validUnion(size, SIZE_UNION);
|
|
554
|
+
var validatedRadius = validUnion(radius, RADIUS_UNION);
|
|
555
|
+
var variantTextColorClasses = variantConfig$3[validatedVariant]
|
|
556
|
+
.split(/\s+/)
|
|
557
|
+
.filter(function (className) { return className.startsWith('text-'); });
|
|
558
|
+
var renderIcon = function (element) {
|
|
559
|
+
if (!element)
|
|
560
|
+
return null;
|
|
561
|
+
if (React.isValidElement(element)) {
|
|
562
|
+
var iconProps = element.props;
|
|
563
|
+
var existingClassName = iconProps.className || '';
|
|
564
|
+
return React.cloneElement(element, {
|
|
565
|
+
className: __spreadArray(__spreadArray([], variantTextColorClasses, true), [existingClassName], false).filter(Boolean)
|
|
566
|
+
.join(' '),
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
return element;
|
|
570
|
+
};
|
|
543
571
|
var minWidthRules = minWidthConfig$1[validatedSize];
|
|
544
572
|
if (minWidth !== undefined) {
|
|
545
573
|
minWidthRules = "min-w-[".concat(minWidth, "px]");
|
|
@@ -549,10 +577,10 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
549
577
|
}
|
|
550
578
|
var sizingRules;
|
|
551
579
|
if (variant.includes('link')) {
|
|
552
|
-
sizingRules = "".concat(sizeConfig$
|
|
580
|
+
sizingRules = "".concat(sizeConfig$f[validatedSize]);
|
|
553
581
|
}
|
|
554
582
|
else {
|
|
555
|
-
sizingRules = "".concat(sizeConfig$
|
|
583
|
+
sizingRules = "".concat(sizeConfig$f[validatedSize], " ").concat(sidePaddingConfig[validatedSize]);
|
|
556
584
|
}
|
|
557
585
|
var hasDoubleIcon = iconRight && iconLeft;
|
|
558
586
|
var isVariantLink = variant.includes('link')
|
|
@@ -565,9 +593,9 @@ var Button = forwardRef(function (_a, ref) {
|
|
|
565
593
|
: "".concat(iconOnlySizeConfig$1[validatedSize], " ").concat(isVariantLink, " ").concat(isVariantLink);
|
|
566
594
|
var classString = "\n ".concat(variantConfig$3[validatedVariant], "\n ").concat(sizeClass, "\n ").concat(radiusConfig$1[validatedRadius][validatedSize], "\n ").concat(className, "\n ");
|
|
567
595
|
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),
|
|
568
|
-
childrenElement(iconLeft || left),
|
|
596
|
+
childrenElement(renderIcon(iconLeft || left)),
|
|
569
597
|
childrenElement(label),
|
|
570
|
-
childrenElement(iconRight || right)));
|
|
598
|
+
childrenElement(renderIcon(iconRight || right))));
|
|
571
599
|
});
|
|
572
600
|
Button.defaultProps = {
|
|
573
601
|
label: undefined,
|
|
@@ -745,7 +773,7 @@ function Banner(_a) {
|
|
|
745
773
|
return function () { return observer.disconnect(); };
|
|
746
774
|
}, [children]);
|
|
747
775
|
if (open) {
|
|
748
|
-
return (React.createElement("div", { className: "relative flex min-h-fit w-full justify-center gap-x-[15px] py-[
|
|
776
|
+
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') },
|
|
749
777
|
React.createElement("div", { className: "font-segoe text-[14px] font-semibold leading-[21px]", ref: textRef }, children),
|
|
750
778
|
React.createElement("div", { className: "absolute right-[15px]", style: { display: closeable ? 'block' : 'none' } },
|
|
751
779
|
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); } },
|
|
@@ -757,7 +785,7 @@ Banner.defaultProps = {
|
|
|
757
785
|
variant: 'black',
|
|
758
786
|
};
|
|
759
787
|
|
|
760
|
-
var sizeConfig$
|
|
788
|
+
var sizeConfig$e = {
|
|
761
789
|
md: 'h-[16px] text-[11px]',
|
|
762
790
|
sm: 'h-[14px] text-[9px]',
|
|
763
791
|
};
|
|
@@ -781,7 +809,7 @@ var colorConfig$3 = {
|
|
|
781
809
|
|
|
782
810
|
var MonospaceBadge = function (_a) {
|
|
783
811
|
var text = _a.text, _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.color, color = _c === void 0 ? 'blue' : _c;
|
|
784
|
-
var sizeClass = sizeConfig$
|
|
812
|
+
var sizeClass = sizeConfig$e[size];
|
|
785
813
|
var colorClass = colorConfig$3[color];
|
|
786
814
|
var variantClass = "".concat(sizeClass, " ").concat(colorClass);
|
|
787
815
|
return (React.createElement("div", { className: "relative -top-[1px] inline-flex w-fit items-center justify-center rounded-[2px] px-[3px] ".concat(variantClass) },
|
|
@@ -1768,9 +1796,21 @@ function Color() {
|
|
|
1768
1796
|
}))));
|
|
1769
1797
|
}
|
|
1770
1798
|
|
|
1799
|
+
/**
|
|
1800
|
+
* State Progression & Visualization Lifecycle (e.g., maxSeconds = 4):
|
|
1801
|
+
*
|
|
1802
|
+
* Timeline Step | Initial | T = 1s | T = 2s | T = 3s | T = 4s (End)
|
|
1803
|
+
* ----------------------|---------|--------|--------|--------|-------------
|
|
1804
|
+
* countdownPlaceholder | 4 | 4 | 3 | 2 | 1
|
|
1805
|
+
* strokeDashoffset Ratio| 4 | 3 | 2 | 1 | 0 (Complete)
|
|
1806
|
+
*
|
|
1807
|
+
* Note: `maxSeconds` is displayed twice initially to account for the 1-second
|
|
1808
|
+
* delay before the first numeric tick while the SVG stroke animation begins.
|
|
1809
|
+
*/
|
|
1771
1810
|
var Countdown = React.forwardRef(function (_a, ref) {
|
|
1772
1811
|
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"]);
|
|
1773
1812
|
var isCountdown = variant === 'countdown';
|
|
1813
|
+
var secondsPlaceholder = seconds === maxSeconds ? maxSeconds : seconds + 1;
|
|
1774
1814
|
var strokeWidth = 3;
|
|
1775
1815
|
var size = 120;
|
|
1776
1816
|
var radius = (size - strokeWidth) / 2;
|
|
@@ -1781,11 +1821,11 @@ var Countdown = React.forwardRef(function (_a, ref) {
|
|
|
1781
1821
|
React.createElement("svg", { className: "absolute left-0 top-0 -rotate-90 transform" // Rotates SVG so progress starts at 12 o'clock
|
|
1782
1822
|
, width: size, height: size },
|
|
1783
1823
|
React.createElement("circle", { className: "text-bia-blue-light-90", stroke: "currentColor", fill: "transparent", strokeWidth: strokeWidth, cx: size / 2, cy: size / 2, r: radius }),
|
|
1784
|
-
isCountdown && (React.createElement("circle", { className: "text-bia-blue transition-all ease-linear ".concat(seconds
|
|
1824
|
+
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 })),
|
|
1785
1825
|
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 })),
|
|
1786
1826
|
isCountdown ? (React.createElement(React.Fragment, null,
|
|
1787
|
-
React.createElement(Heading, { key:
|
|
1788
|
-
React.createElement(Text, { variant: "small-text", className: "font-segoe text-bia-coolgrey" },
|
|
1827
|
+
React.createElement(Heading, { key: secondsPlaceholder, variant: "2", className: "animate-number-drop" }, secondsPlaceholder),
|
|
1828
|
+
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" }))));
|
|
1789
1829
|
});
|
|
1790
1830
|
Countdown.displayName = 'Countdown';
|
|
1791
1831
|
|
|
@@ -2222,10 +2262,6 @@ function Tooltip(props) {
|
|
|
2222
2262
|
var _d = useState(false), active = _d[0], setActive = _d[1];
|
|
2223
2263
|
var anchorRef = useRef(null);
|
|
2224
2264
|
var tooltipContainerRef = useRef(null);
|
|
2225
|
-
var _e = useState({
|
|
2226
|
-
maxWidth: maxWidth + 'px',
|
|
2227
|
-
whiteSpace: 'nowrap',
|
|
2228
|
-
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
2229
2265
|
var showTip = function () {
|
|
2230
2266
|
timeout = setTimeout(function () {
|
|
2231
2267
|
setActive(true);
|
|
@@ -2235,6 +2271,17 @@ function Tooltip(props) {
|
|
|
2235
2271
|
clearInterval(timeout);
|
|
2236
2272
|
setActive(false);
|
|
2237
2273
|
};
|
|
2274
|
+
return (React.createElement("div", { className: "tooltip-wrapper relative inline-flex h-fit w-fit flex-col", onMouseEnter: showTip, onMouseLeave: hideTip, ref: anchorRef },
|
|
2275
|
+
children,
|
|
2276
|
+
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 }))));
|
|
2277
|
+
}
|
|
2278
|
+
var TooltipItem = function (_a) {
|
|
2279
|
+
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;
|
|
2280
|
+
var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
|
|
2281
|
+
var _e = useState({
|
|
2282
|
+
maxWidth: maxWidth + 'px',
|
|
2283
|
+
whiteSpace: 'nowrap',
|
|
2284
|
+
}), tooltipContainerStyle = _e[0], setTooltipContainerStyle = _e[1];
|
|
2238
2285
|
var tooltipContainerElement = tooltipContainerRef === null || tooltipContainerRef === void 0 ? void 0 : tooltipContainerRef.current;
|
|
2239
2286
|
var scrollWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.scrollWidth; // Mendapatkan lebar konten aktual
|
|
2240
2287
|
var offsetWidth = tooltipContainerElement === null || tooltipContainerElement === void 0 ? void 0 : tooltipContainerElement.offsetWidth;
|
|
@@ -2267,14 +2314,7 @@ function Tooltip(props) {
|
|
|
2267
2314
|
setTooltipContainerStyle(function (prev) { return (__assign(__assign({}, prev), { width: newWidth_1, whiteSpace: newWhiteSpace_1 })); });
|
|
2268
2315
|
}
|
|
2269
2316
|
}, [content, maxWidth, scrollWidth, offsetHeight]);
|
|
2270
|
-
return (React.createElement("div", { className: "tooltip-
|
|
2271
|
-
children,
|
|
2272
|
-
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 })));
|
|
2273
|
-
}
|
|
2274
|
-
var TooltipItem = function (_a) {
|
|
2275
|
-
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;
|
|
2276
|
-
var positionStyle = usePopupPosition(anchorRef, tooltipContainerRef, direction)[0];
|
|
2277
|
-
return 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);
|
|
2317
|
+
return 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);
|
|
2278
2318
|
};
|
|
2279
2319
|
Tooltip.defaultProps = {
|
|
2280
2320
|
delay: 400,
|
|
@@ -2325,7 +2365,7 @@ function ValidationIcon(_a) {
|
|
|
2325
2365
|
return React.createElement(TbX, { className: "text-bia-red", style: { fontSize: iconSize } });
|
|
2326
2366
|
}
|
|
2327
2367
|
|
|
2328
|
-
var sizeConfig$
|
|
2368
|
+
var sizeConfig$d = {
|
|
2329
2369
|
md: {
|
|
2330
2370
|
fieldSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2331
2371
|
iconPosition: 'right-[10px]',
|
|
@@ -2366,8 +2406,8 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
2366
2406
|
var _r = useState(false), isShow = _r[0], setIsShow = _r[1];
|
|
2367
2407
|
var _s = styleConfig[variant], fieldStyle = _s.fieldStyle, iconStyle = _s.iconStyle;
|
|
2368
2408
|
var _t = isTransparent
|
|
2369
|
-
? __assign(__assign({}, sizeConfig$
|
|
2370
|
-
" pe-[".concat(9 + sizeConfig$
|
|
2409
|
+
? __assign(__assign({}, sizeConfig$d[size]), { iconPosition: "right-0 ", fieldSize: sizeConfig$d[size].fieldSize +
|
|
2410
|
+
" pe-[".concat(9 + sizeConfig$d[size].iconSize, "px]") }) : sizeConfig$d[size], iconSize = _t.iconSize, fieldSize = _t.fieldSize, iconPosition = _t.iconPosition;
|
|
2371
2411
|
var borderStyle = isTransparent
|
|
2372
2412
|
? 'border-transparent bg-transparent' // customize border rule for transparent variant
|
|
2373
2413
|
: 'border border-bia-grey-dark-10 bg-primary-white';
|
|
@@ -2435,7 +2475,7 @@ TextInput.defaultProps = {
|
|
|
2435
2475
|
};
|
|
2436
2476
|
|
|
2437
2477
|
// Desc: Radio button size configuration
|
|
2438
|
-
var sizeConfig$
|
|
2478
|
+
var sizeConfig$c = {
|
|
2439
2479
|
md: {
|
|
2440
2480
|
checkSize: 'w-[22px] h-[22px]',
|
|
2441
2481
|
labelSize: 'text-size-base',
|
|
@@ -2444,27 +2484,43 @@ var sizeConfig$b = {
|
|
|
2444
2484
|
checkSize: 'w-4 h-4',
|
|
2445
2485
|
labelSize: 'text-size-sm',
|
|
2446
2486
|
},
|
|
2487
|
+
tn: {
|
|
2488
|
+
checkSize: 'w-3 h-3',
|
|
2489
|
+
labelSize: 'text-size-sm',
|
|
2490
|
+
},
|
|
2447
2491
|
};
|
|
2448
2492
|
|
|
2449
|
-
var sizeUnion$4 = ['md', 'sm'];
|
|
2450
|
-
function Radio(_a) {
|
|
2451
|
-
var
|
|
2493
|
+
var sizeUnion$4 = ['md', 'sm', 'tn'];
|
|
2494
|
+
var Radio = forwardRef(function Radio(_a, ref) {
|
|
2495
|
+
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;
|
|
2452
2496
|
var validatedSize = validUnion(size, sizeUnion$4);
|
|
2453
|
-
var
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2497
|
+
var _p = sizeConfig$c[validatedSize], checkSize = _p.checkSize, labelSize = _p.labelSize;
|
|
2498
|
+
var backgroundClass = size === 'tn' && checked ? 'bg-bia-blue' : 'bg-bia-white';
|
|
2499
|
+
var peerCheckedClass = size === 'tn'
|
|
2500
|
+
? 'peer-checked:border-bia-blue peer-checked:bg-bia-white peer-checked:peer-hover:border-bia-blue-hover'
|
|
2501
|
+
: 'peer-checked:peer-hover:bg-bia-blue-hover';
|
|
2502
|
+
var inputFocusClass = size === 'tn'
|
|
2503
|
+
? 'focus-visible:ring-offset-1'
|
|
2504
|
+
: 'focus-visible:ring-offset-2';
|
|
2505
|
+
return (React.createElement("div", { className: cn('flex items-center', containerClassName) },
|
|
2506
|
+
React.createElement("div", { className: cn('relative flex flex-shrink-0 items-center justify-center rounded-full', checkSize, backgroundClass) },
|
|
2507
|
+
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 }),
|
|
2508
|
+
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) })),
|
|
2509
|
+
React.createElement("label", { htmlFor: id, className: cn('ml-2 leading-4', disabled ? 'text-bia-coolgrey' : 'text-bia-black', labelSize, labelClassName) }, childrenElement(label))));
|
|
2510
|
+
});
|
|
2460
2511
|
Radio.defaultProps = {
|
|
2461
2512
|
label: '',
|
|
2462
2513
|
size: 'md',
|
|
2463
2514
|
id: '',
|
|
2515
|
+
onChange: function () { },
|
|
2464
2516
|
onClick: function () { },
|
|
2465
2517
|
disabled: false,
|
|
2466
2518
|
checked: false,
|
|
2519
|
+
containerClassName: '',
|
|
2520
|
+
inputClassName: '',
|
|
2521
|
+
labelClassName: '',
|
|
2467
2522
|
};
|
|
2523
|
+
Radio.displayName = 'Radio';
|
|
2468
2524
|
|
|
2469
2525
|
var ResizeIcon = function (_a) {
|
|
2470
2526
|
var className = _a.className;
|
|
@@ -2477,7 +2533,7 @@ var ResizeIcon = function (_a) {
|
|
|
2477
2533
|
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" })));
|
|
2478
2534
|
};
|
|
2479
2535
|
|
|
2480
|
-
var sizeConfig$
|
|
2536
|
+
var sizeConfig$b = {
|
|
2481
2537
|
md: {
|
|
2482
2538
|
inputClass: 'text-size-base font-[350] min-h-10',
|
|
2483
2539
|
},
|
|
@@ -2486,10 +2542,10 @@ var sizeConfig$a = {
|
|
|
2486
2542
|
},
|
|
2487
2543
|
};
|
|
2488
2544
|
|
|
2489
|
-
|
|
2490
|
-
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"]);
|
|
2545
|
+
var TextArea = forwardRef(function (_a, ref) {
|
|
2546
|
+
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"]);
|
|
2491
2547
|
var inputRow = rows !== null && rows !== void 0 ? rows : 4;
|
|
2492
|
-
var inputClass = sizeConfig$
|
|
2548
|
+
var inputClass = sizeConfig$b[size].inputClass;
|
|
2493
2549
|
var remainWords = maxLength ? maxLength - (value ? value.length : 0) : 0;
|
|
2494
2550
|
var isExistValidation = isValid !== null;
|
|
2495
2551
|
var descColor = 'text-primary-cool';
|
|
@@ -2505,12 +2561,12 @@ function TextArea(_a) {
|
|
|
2505
2561
|
bottomBorderColor =
|
|
2506
2562
|
'enabled:hover:border-b-bia-red enabled:focus:border-b-bia-red';
|
|
2507
2563
|
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
2508
|
-
var extendedInputClassName =
|
|
2509
|
-
return (React.createElement("div", { className:
|
|
2564
|
+
var extendedInputClassName = cn(inputClass, bottomBorderColor);
|
|
2565
|
+
return (React.createElement("div", { className: cn('field-group group/form flex w-full flex-col gap-y-2', textAreaClassName) },
|
|
2510
2566
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
2511
2567
|
React.createElement("div", { className: "relative h-fit w-full min-w-[250px] ".concat(disabledClass) },
|
|
2512
2568
|
React.createElement(ResizeIcon, { className: "absolute bottom-[11px] right-[5px]" }),
|
|
2513
|
-
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))),
|
|
2569
|
+
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))),
|
|
2514
2570
|
React.createElement("div", { className: "desc flex justify-between gap-1 text-xs ".concat(descColor) },
|
|
2515
2571
|
descText && React.createElement("span", null, descText),
|
|
2516
2572
|
maxLength && (React.createElement("span", null,
|
|
@@ -2518,7 +2574,7 @@ function TextArea(_a) {
|
|
|
2518
2574
|
"/",
|
|
2519
2575
|
maxLength,
|
|
2520
2576
|
' ')))));
|
|
2521
|
-
}
|
|
2577
|
+
});
|
|
2522
2578
|
TextArea.defaultProps = {
|
|
2523
2579
|
disabled: false,
|
|
2524
2580
|
descText: '',
|
|
@@ -2532,7 +2588,7 @@ TextArea.defaultProps = {
|
|
|
2532
2588
|
value: '',
|
|
2533
2589
|
};
|
|
2534
2590
|
|
|
2535
|
-
var sizeConfig$
|
|
2591
|
+
var sizeConfig$a = {
|
|
2536
2592
|
md: {
|
|
2537
2593
|
checkClass: 'w-[22px] h-[22px]',
|
|
2538
2594
|
labelClass: 'text-size-base font-[350]',
|
|
@@ -2550,7 +2606,7 @@ var sizeConfig$9 = {
|
|
|
2550
2606
|
var sizeUnion$3 = ['md', 'sm', 'tn'];
|
|
2551
2607
|
function Checkbox(_a) {
|
|
2552
2608
|
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"]);
|
|
2553
|
-
var _f = sizeConfig$
|
|
2609
|
+
var _f = sizeConfig$a[validUnion(size, sizeUnion$3)], checkClass = _f.checkClass, labelClass = _f.labelClass;
|
|
2554
2610
|
var isValidIndeterminate = isIndeterminate && props.checked;
|
|
2555
2611
|
var backgroundClass = size === 'tn' && props.checked ? 'bg-bia-blue' : 'bg-bia-white';
|
|
2556
2612
|
var peerCheckedClass = size === 'tn' ? '' : 'peer-checked:border-2';
|
|
@@ -2569,7 +2625,7 @@ Checkbox.defaultProps = {
|
|
|
2569
2625
|
onChange: function () { },
|
|
2570
2626
|
};
|
|
2571
2627
|
|
|
2572
|
-
var sizeConfig$
|
|
2628
|
+
var sizeConfig$9 = {
|
|
2573
2629
|
md: {
|
|
2574
2630
|
searchSize: 'text-size-base p-2.5 font-[350] h-10',
|
|
2575
2631
|
iconSize: 'right-[10px] text-[18px]',
|
|
@@ -2580,7 +2636,7 @@ var sizeConfig$8 = {
|
|
|
2580
2636
|
},
|
|
2581
2637
|
};
|
|
2582
2638
|
|
|
2583
|
-
var sizeConfig$
|
|
2639
|
+
var sizeConfig$8 = {
|
|
2584
2640
|
md: {
|
|
2585
2641
|
container: 'text-size-base font-[350] py-[3px] first:pt-[8px] last:pb-[8px]',
|
|
2586
2642
|
item: 'min-h-[34px] p-2.5',
|
|
@@ -2598,7 +2654,7 @@ function CustomDropdownItem(_a) {
|
|
|
2598
2654
|
var _f = useState(false), isHoveredSubMenu = _f[0], setIsHoveredSubMenu = _f[1];
|
|
2599
2655
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2600
2656
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2601
|
-
var _g = sizeConfig$
|
|
2657
|
+
var _g = sizeConfig$8[size], containerClass = _g.container, item = _g.item;
|
|
2602
2658
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2603
2659
|
var isExistSubDropdown = options.length !== 0;
|
|
2604
2660
|
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 () { } },
|
|
@@ -2625,7 +2681,7 @@ function DefaultDropdownItem(_a) {
|
|
|
2625
2681
|
var _g = useState(false), isHoveredSubMenu = _g[0], setIsHoveredSubMenu = _g[1];
|
|
2626
2682
|
var isOpenDropdown = isHovered || isHoveredSubMenu;
|
|
2627
2683
|
var selectedClass = isSelected ? 'font-semibold' : 'font-normal';
|
|
2628
|
-
var _h = sizeConfig$
|
|
2684
|
+
var _h = sizeConfig$8[size], containerClass = _h.container, item = _h.item;
|
|
2629
2685
|
var itemClass = "".concat(item, " ").concat(selectedClass, " ").concat(className);
|
|
2630
2686
|
var isExistSubDropdown = options.length !== 0;
|
|
2631
2687
|
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 () { } },
|
|
@@ -2652,7 +2708,7 @@ function SelectInput(_a) {
|
|
|
2652
2708
|
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"]);
|
|
2653
2709
|
var _m = useState(false), isOpen = _m[0], setIsOpen = _m[1];
|
|
2654
2710
|
var validatedSize = validUnion(size, sizeUnion$2);
|
|
2655
|
-
var _o = sizeConfig$
|
|
2711
|
+
var _o = sizeConfig$9[validatedSize], searchSize = _o.searchSize, iconSize = _o.iconSize;
|
|
2656
2712
|
var inputRef = useRef(null);
|
|
2657
2713
|
var isObjectOptionItem = false;
|
|
2658
2714
|
if (options.every(function (item) { return typeof item === 'object' && item !== null; }))
|
|
@@ -2710,7 +2766,7 @@ SelectInput.defaultProps = {
|
|
|
2710
2766
|
setSelected: function () { },
|
|
2711
2767
|
};
|
|
2712
2768
|
|
|
2713
|
-
var sizeConfig$
|
|
2769
|
+
var sizeConfig$7 = {
|
|
2714
2770
|
md: {
|
|
2715
2771
|
iconClass: 'right-[10px]',
|
|
2716
2772
|
iconSize: '18',
|
|
@@ -2891,7 +2947,7 @@ var getItemLabel = function (value) {
|
|
|
2891
2947
|
var _a;
|
|
2892
2948
|
return isObjectWithLabel(value) ? (_a = value.label) !== null && _a !== void 0 ? _a : '' : String(value !== null && value !== void 0 ? value : '');
|
|
2893
2949
|
};
|
|
2894
|
-
var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick) {
|
|
2950
|
+
var processDropdownChildren$1 = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick) {
|
|
2895
2951
|
if (searchVariant === void 0) { searchVariant = 'include'; }
|
|
2896
2952
|
return Children.map(nodes, function (child) {
|
|
2897
2953
|
if (!isValidElement(child) || child.type !== DropdownItem) {
|
|
@@ -2913,7 +2969,7 @@ var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNo
|
|
|
2913
2969
|
}
|
|
2914
2970
|
// Process Nested Children
|
|
2915
2971
|
var clonedChildren = itemProps.children
|
|
2916
|
-
? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick)
|
|
2972
|
+
? processDropdownChildren$1(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick)
|
|
2917
2973
|
: null;
|
|
2918
2974
|
// Clone and Inject Click Handler
|
|
2919
2975
|
return cloneElement(child, {
|
|
@@ -2935,23 +2991,23 @@ var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNo
|
|
|
2935
2991
|
});
|
|
2936
2992
|
});
|
|
2937
2993
|
};
|
|
2938
|
-
var processRenderedChildren = function (children, searchTerm, searchVariant, handleDropdownItemClick) {
|
|
2994
|
+
var processRenderedChildren$1 = function (children, searchTerm, searchVariant, handleDropdownItemClick) {
|
|
2939
2995
|
var renderedChildren = null;
|
|
2940
2996
|
var hasFilteredResults = false;
|
|
2941
2997
|
if (searchTerm) {
|
|
2942
|
-
renderedChildren = processDropdownChildren(children, searchTerm, false, searchVariant, handleDropdownItemClick);
|
|
2998
|
+
renderedChildren = processDropdownChildren$1(children, searchTerm, false, searchVariant, handleDropdownItemClick);
|
|
2943
2999
|
hasFilteredResults =
|
|
2944
3000
|
Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
2945
3001
|
}
|
|
2946
3002
|
else {
|
|
2947
|
-
renderedChildren = processDropdownChildren(children, '', true, searchVariant, handleDropdownItemClick);
|
|
3003
|
+
renderedChildren = processDropdownChildren$1(children, '', true, searchVariant, handleDropdownItemClick);
|
|
2948
3004
|
hasFilteredResults =
|
|
2949
3005
|
Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
2950
3006
|
}
|
|
2951
3007
|
return { renderedChildren: renderedChildren, hasFilteredResults: hasFilteredResults };
|
|
2952
3008
|
};
|
|
2953
3009
|
|
|
2954
|
-
var useLiveSearch = function (_a) {
|
|
3010
|
+
var useLiveSearch$1 = function (_a) {
|
|
2955
3011
|
var value = _a.value, setValue = _a.setValue, onChangeText = _a.onChangeText, dropContOnClickItem = _a.dropContOnClickItem;
|
|
2956
3012
|
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
2957
3013
|
var _c = useState(String(value.label || '')), searchTerm = _c[0], setSearchTerm = _c[1];
|
|
@@ -2985,13 +3041,13 @@ var useLiveSearch = function (_a) {
|
|
|
2985
3041
|
function LiveSearch(_a) {
|
|
2986
3042
|
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;
|
|
2987
3043
|
var inputRef = useRef(null);
|
|
2988
|
-
var _m = useLiveSearch({
|
|
3044
|
+
var _m = useLiveSearch$1({
|
|
2989
3045
|
value: value,
|
|
2990
3046
|
setValue: setValue,
|
|
2991
3047
|
onChangeText: onChangeText,
|
|
2992
3048
|
dropContOnClickItem: dropContProps === null || dropContProps === void 0 ? void 0 : dropContProps.onClickItem,
|
|
2993
3049
|
}), isOpen = _m.isOpen, setIsOpen = _m.setIsOpen, searchTerm = _m.searchTerm, handleInputChange = _m.handleInputChange, handleDropdownItemClick = _m.handleDropdownItemClick;
|
|
2994
|
-
var _o = sizeConfig$
|
|
3050
|
+
var _o = sizeConfig$7[size], iconClass = _o.iconClass, iconSize = _o.iconSize, inputClass = _o.inputClass;
|
|
2995
3051
|
var _p = dropContProps || {}, dropContClassName = _p.className; _p.onClickItem; _p.anchorRef; var restDropContProps = __rest(_p, ["className", "onClickItem", "anchorRef"]);
|
|
2996
3052
|
var isSearchTermExist = searchTerm && searchTerm !== '';
|
|
2997
3053
|
var descColor = 'text-primary-cool';
|
|
@@ -3001,7 +3057,7 @@ function LiveSearch(_a) {
|
|
|
3001
3057
|
if (!disabled && isExistValidation && !isValid)
|
|
3002
3058
|
descColor = 'text-bia-red';
|
|
3003
3059
|
var filteredOptions = filterOptions(options || [], value.label);
|
|
3004
|
-
var _q = processRenderedChildren(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3060
|
+
var _q = processRenderedChildren$1(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3005
3061
|
var disabledClass = disabled ? 'cursor-not-allowed' : '';
|
|
3006
3062
|
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" },
|
|
3007
3063
|
label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
|
|
@@ -3044,7 +3100,348 @@ LiveSearch.defaultProps = {
|
|
|
3044
3100
|
readonly: false,
|
|
3045
3101
|
};
|
|
3046
3102
|
|
|
3103
|
+
var sizeConfig$6 = {
|
|
3104
|
+
md: {
|
|
3105
|
+
inputClass: 'text-size-base font-[350]',
|
|
3106
|
+
paddingClass: 'p-2',
|
|
3107
|
+
resizePosition: 'bottom-2 right-2',
|
|
3108
|
+
},
|
|
3109
|
+
sm: {
|
|
3110
|
+
inputClass: 'text-size-sm',
|
|
3111
|
+
paddingClass: 'p-1',
|
|
3112
|
+
resizePosition: 'bottom-1 right-1',
|
|
3113
|
+
},
|
|
3114
|
+
};
|
|
3115
|
+
|
|
3116
|
+
var isMatchValue = function (existingValue, optionValue) {
|
|
3117
|
+
var isValueObject = typeof optionValue === 'object';
|
|
3118
|
+
if (isValueObject) {
|
|
3119
|
+
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); });
|
|
3120
|
+
}
|
|
3121
|
+
return existingValue === null || existingValue === void 0 ? void 0 : existingValue.includes(optionValue);
|
|
3122
|
+
};
|
|
3123
|
+
var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick, existingValues) {
|
|
3124
|
+
if (searchVariant === void 0) { searchVariant = 'include'; }
|
|
3125
|
+
return Children.map(nodes, function (child) {
|
|
3126
|
+
if (!isValidElement(child) || child.type !== DropdownItem) {
|
|
3127
|
+
return child;
|
|
3128
|
+
}
|
|
3129
|
+
var itemProps = child.props;
|
|
3130
|
+
var itemContent = typeof itemProps.content === 'string' ? itemProps.content : '';
|
|
3131
|
+
var itemValue = itemProps.value;
|
|
3132
|
+
var isDisabled = itemProps.disabled;
|
|
3133
|
+
// Filtering Logic
|
|
3134
|
+
var itemValueStr = typeof itemValue === 'object' ? itemValue === null || itemValue === void 0 ? void 0 : itemValue.label : String(itemValue || '');
|
|
3135
|
+
if ((existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0 && isMatchValue(existingValues, itemValue)) {
|
|
3136
|
+
return null;
|
|
3137
|
+
}
|
|
3138
|
+
if (!includeAllIfNoSearch) {
|
|
3139
|
+
if (currentSearchTerm &&
|
|
3140
|
+
!matchSearchTerm(itemValueStr, currentSearchTerm, searchVariant)) {
|
|
3141
|
+
return null;
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
// Process Nested Children
|
|
3145
|
+
var clonedChildren = itemProps.children
|
|
3146
|
+
? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick, existingValues)
|
|
3147
|
+
: null;
|
|
3148
|
+
// Clone and Inject Click Handler
|
|
3149
|
+
return cloneElement(child, {
|
|
3150
|
+
onClick: function (e) {
|
|
3151
|
+
if (!isDisabled) {
|
|
3152
|
+
if (itemValue === undefined &&
|
|
3153
|
+
typeof itemProps.content === 'string') {
|
|
3154
|
+
return handleDropdownItemClick(e, itemContent);
|
|
3155
|
+
}
|
|
3156
|
+
if (typeof itemValue === 'object' || itemValue !== undefined) {
|
|
3157
|
+
return handleDropdownItemClick(e, itemValue);
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
if (itemProps.onClickItem) {
|
|
3161
|
+
itemProps.onClickItem(e, itemValue !== undefined ? itemValue : itemContent);
|
|
3162
|
+
}
|
|
3163
|
+
},
|
|
3164
|
+
children: clonedChildren,
|
|
3165
|
+
});
|
|
3166
|
+
});
|
|
3167
|
+
};
|
|
3168
|
+
var processRenderedChildren = function (children, searchTerm, searchVariant, handleDropdownItemClick, existingValues) {
|
|
3169
|
+
var renderedChildren = null;
|
|
3170
|
+
var hasFilteredResults = false;
|
|
3171
|
+
if ((existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0) ;
|
|
3172
|
+
if (searchTerm || (existingValues === null || existingValues === void 0 ? void 0 : existingValues.length) > 0) {
|
|
3173
|
+
renderedChildren = processDropdownChildren(children, searchTerm, false, searchVariant, handleDropdownItemClick, existingValues);
|
|
3174
|
+
}
|
|
3175
|
+
else {
|
|
3176
|
+
renderedChildren = processDropdownChildren(children, '', true, searchVariant, handleDropdownItemClick, []);
|
|
3177
|
+
}
|
|
3178
|
+
hasFilteredResults =
|
|
3179
|
+
Children.toArray(renderedChildren).filter(Boolean).length > 0;
|
|
3180
|
+
return { renderedChildren: renderedChildren, hasFilteredResults: hasFilteredResults };
|
|
3181
|
+
};
|
|
3182
|
+
|
|
3183
|
+
var useLiveSearch = function (_a) {
|
|
3184
|
+
var value = _a.value, setValue = _a.setValue, onChangeText = _a.onChangeText, dropContOnClickItem = _a.dropContOnClickItem;
|
|
3185
|
+
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
3186
|
+
var _c = useState(''), searchTerm = _c[0], setSearchTerm = _c[1];
|
|
3187
|
+
var handleInputChange = function (e) {
|
|
3188
|
+
var newSearchTerm = e.target.value;
|
|
3189
|
+
setSearchTerm(newSearchTerm);
|
|
3190
|
+
setIsOpen(true);
|
|
3191
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(e);
|
|
3192
|
+
};
|
|
3193
|
+
var handleDropdownItemClick = useCallback(function (event, clickedValue) {
|
|
3194
|
+
dropContOnClickItem === null || dropContOnClickItem === void 0 ? void 0 : dropContOnClickItem(event, clickedValue);
|
|
3195
|
+
setSearchTerm('');
|
|
3196
|
+
setValue(__spreadArray(__spreadArray([], value, true), [clickedValue], false));
|
|
3197
|
+
setIsOpen(false);
|
|
3198
|
+
}, [setValue, dropContOnClickItem]);
|
|
3199
|
+
return {
|
|
3200
|
+
isOpen: isOpen,
|
|
3201
|
+
setIsOpen: setIsOpen,
|
|
3202
|
+
searchTerm: searchTerm,
|
|
3203
|
+
handleInputChange: handleInputChange,
|
|
3204
|
+
handleDropdownItemClick: handleDropdownItemClick,
|
|
3205
|
+
};
|
|
3206
|
+
};
|
|
3207
|
+
|
|
3208
|
+
var colorConfig$1 = {
|
|
3209
|
+
default: 'bg-bia-grey-light-50 text-primary-black',
|
|
3210
|
+
blue: 'bg-bia-blue text-primary-white',
|
|
3211
|
+
teal: 'bg-bia-teal text-primary-white',
|
|
3212
|
+
green: 'bg-bia-green text-primary-white',
|
|
3213
|
+
// yellow: 'bg-bia-yellow text-primary-black',
|
|
3214
|
+
orange: 'bg-bia-orange text-primary-white',
|
|
3215
|
+
red: 'bg-bia-red text-primary-white',
|
|
3216
|
+
black: 'bg-primary-black text-primary-white',
|
|
3217
|
+
white: 'bg-primary-white text-primary-black border border-primary-black',
|
|
3218
|
+
};
|
|
3047
3219
|
var sizeConfig$5 = {
|
|
3220
|
+
md: 'px-[10px] py-[7px] h-[34px] text-size-base',
|
|
3221
|
+
sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
|
|
3222
|
+
tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
|
|
3223
|
+
};
|
|
3224
|
+
var iconOnlySizeConfig = {
|
|
3225
|
+
md: 'p-[7px]',
|
|
3226
|
+
sm: 'p-[4px]',
|
|
3227
|
+
tn: 'p-[2px]',
|
|
3228
|
+
};
|
|
3229
|
+
var closeColorConfig = {
|
|
3230
|
+
default: 'bg-bia-grey-dark-30 text-primary-white',
|
|
3231
|
+
blue: 'bg-bia-white-transparent-50 text-bia-blue',
|
|
3232
|
+
teal: 'bg-bia-white-transparent-50 text-bia-teal',
|
|
3233
|
+
green: 'bg-bia-white-transparent-50 text-bia-green',
|
|
3234
|
+
yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
|
|
3235
|
+
red: 'bg-bia-white-transparent-50 text-bia-red',
|
|
3236
|
+
black: 'bg-bia-white-transparent-50 text-primary-black',
|
|
3237
|
+
white: 'bg-bia-grey-dark-30 text-primary-white',
|
|
3238
|
+
};
|
|
3239
|
+
var closeSizeConfig = {
|
|
3240
|
+
md: 'w-[18px] h-[18px] text-[14px]',
|
|
3241
|
+
sm: 'w-[12px] h-[12px] text-[9.33px]',
|
|
3242
|
+
tn: 'w-[12px] h-[12px] text-[9.33px]',
|
|
3243
|
+
};
|
|
3244
|
+
var rightPaddingConfig = {
|
|
3245
|
+
md: 'pr-[8px]',
|
|
3246
|
+
sm: 'pr-[5px]',
|
|
3247
|
+
tn: 'pr-[3px]',
|
|
3248
|
+
};
|
|
3249
|
+
|
|
3250
|
+
var colorUnion = [
|
|
3251
|
+
'default',
|
|
3252
|
+
'blue',
|
|
3253
|
+
'teal',
|
|
3254
|
+
'green',
|
|
3255
|
+
'orange',
|
|
3256
|
+
'red',
|
|
3257
|
+
'black',
|
|
3258
|
+
'white',
|
|
3259
|
+
'custom',
|
|
3260
|
+
];
|
|
3261
|
+
var sizeUnion$1 = ['md', 'sm', 'tn'];
|
|
3262
|
+
var variantUnion = ['label', 'icon', 'closeable', 'monospace'];
|
|
3263
|
+
var TagLabel = function (_a) {
|
|
3264
|
+
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"]);
|
|
3265
|
+
var validatedColor = validUnion(color, colorUnion);
|
|
3266
|
+
var validatedSize = validUnion(size, sizeUnion$1);
|
|
3267
|
+
var validatedVariant = validUnion(variant, variantUnion);
|
|
3268
|
+
var containerRef = useRef(null);
|
|
3269
|
+
var _e = useState(null), sizeCount = _e[0], setSizeCount = _e[1];
|
|
3270
|
+
useEffect(function () {
|
|
3271
|
+
if (variant === 'icon') {
|
|
3272
|
+
// Get the size of the icon
|
|
3273
|
+
// and set the size of the container
|
|
3274
|
+
// to the one with the biggest size (width or height icon)
|
|
3275
|
+
// in order to make the container square
|
|
3276
|
+
var rect = containerRef.current.getBoundingClientRect();
|
|
3277
|
+
var width = rect.width;
|
|
3278
|
+
var height = rect.height;
|
|
3279
|
+
if (width > height)
|
|
3280
|
+
setSizeCount(width);
|
|
3281
|
+
else
|
|
3282
|
+
setSizeCount(height);
|
|
3283
|
+
}
|
|
3284
|
+
}, []);
|
|
3285
|
+
var isCloseable = validatedVariant === 'closeable';
|
|
3286
|
+
var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
|
|
3287
|
+
var borderColorRules = outlineColor || bgColor;
|
|
3288
|
+
var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
|
|
3289
|
+
var sizeClass = validatedVariant === 'icon'
|
|
3290
|
+
? iconOnlySizeConfig[validatedSize]
|
|
3291
|
+
: sizeConfig$5[validatedSize];
|
|
3292
|
+
var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
|
|
3293
|
+
var colorClass = validatedColor === 'custom'
|
|
3294
|
+
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
|
|
3295
|
+
: colorConfig$1[validatedColor];
|
|
3296
|
+
var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
|
|
3297
|
+
var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
|
|
3298
|
+
var alignTextClass = isBlock ? 'text-center' : 'text-left';
|
|
3299
|
+
var fontClass = validatedVariant === 'monospace' ? 'font-sans-code' : 'font-segoe pb-[1px]';
|
|
3300
|
+
var textClass = "".concat(alignTextClass, " ").concat(fontClass);
|
|
3301
|
+
var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
|
|
3302
|
+
var closeColor = validatedColor === 'custom'
|
|
3303
|
+
? isDark
|
|
3304
|
+
? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
|
|
3305
|
+
: "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
|
|
3306
|
+
: closeColorConfig[validatedColor];
|
|
3307
|
+
var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
|
|
3308
|
+
var isOpen = isCloseable ? open : true;
|
|
3309
|
+
return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
|
|
3310
|
+
maxWidth: maxWidthStyle,
|
|
3311
|
+
} }, props),
|
|
3312
|
+
leftIcon && (React.createElement("div", { style: {
|
|
3313
|
+
width: sizeCount + 'px',
|
|
3314
|
+
height: sizeCount + 'px',
|
|
3315
|
+
}, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
|
|
3316
|
+
(validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
|
|
3317
|
+
validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate ".concat(textClass) }, text)),
|
|
3318
|
+
validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
|
|
3319
|
+
" ",
|
|
3320
|
+
rightIcon,
|
|
3321
|
+
" ")),
|
|
3322
|
+
isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
|
|
3323
|
+
React.createElement(TbX, null))))));
|
|
3324
|
+
};
|
|
3325
|
+
TagLabel.defaultProps = {
|
|
3326
|
+
variant: 'default',
|
|
3327
|
+
size: 'sm',
|
|
3328
|
+
open: true,
|
|
3329
|
+
closeHandler: function () { },
|
|
3330
|
+
leftIcon: null,
|
|
3331
|
+
rightIcon: null,
|
|
3332
|
+
left: null,
|
|
3333
|
+
right: null,
|
|
3334
|
+
bgColor: 'grey-light-50',
|
|
3335
|
+
textColor: 'black',
|
|
3336
|
+
isBlock: false,
|
|
3337
|
+
maxWidth: 300,
|
|
3338
|
+
isDark: false,
|
|
3339
|
+
};
|
|
3340
|
+
|
|
3341
|
+
var TagLabelInputInner = function (_a, ref) {
|
|
3342
|
+
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"]);
|
|
3343
|
+
var generatedId = useId();
|
|
3344
|
+
var inputId = customId || generatedId;
|
|
3345
|
+
var _k = useState(false), isFocused = _k[0], setIsFocused = _k[1];
|
|
3346
|
+
var _l = useState(false), isHovered = _l[0], setIsHovered = _l[1];
|
|
3347
|
+
var internalInputRef = useRef(null);
|
|
3348
|
+
var containerRef = useRef(null);
|
|
3349
|
+
useImperativeHandle(ref, function () { return internalInputRef.current; });
|
|
3350
|
+
var isExistValidation = isValid !== null;
|
|
3351
|
+
var getTagLabel = function (item) {
|
|
3352
|
+
return typeof item === 'object' ? item.label : String(item);
|
|
3353
|
+
};
|
|
3354
|
+
var getTagStyles = function (item) {
|
|
3355
|
+
if (typeof item !== 'object')
|
|
3356
|
+
return { color: 'default' };
|
|
3357
|
+
return {
|
|
3358
|
+
color: item.color || 'default',
|
|
3359
|
+
bgColor: item.bgColor,
|
|
3360
|
+
textColor: item.textColor,
|
|
3361
|
+
outlineColor: item.outlineColor,
|
|
3362
|
+
};
|
|
3363
|
+
};
|
|
3364
|
+
var handleRemoveTag = function (indexToRemove) {
|
|
3365
|
+
if (disabled || readOnly)
|
|
3366
|
+
return;
|
|
3367
|
+
var updatedValues = value.filter(function (_, idx) { return idx !== indexToRemove; });
|
|
3368
|
+
onChange(updatedValues);
|
|
3369
|
+
};
|
|
3370
|
+
var _m = useLiveSearch({
|
|
3371
|
+
value: value,
|
|
3372
|
+
setValue: onChange,
|
|
3373
|
+
onChangeText: onChangeText,
|
|
3374
|
+
dropContOnClickItem: dropContProps === null || dropContProps === void 0 ? void 0 : dropContProps.onClickItem,
|
|
3375
|
+
}), isOpen = _m.isOpen, setIsOpen = _m.setIsOpen, searchTerm = _m.searchTerm, handleInputChange = _m.handleInputChange, handleDropdownItemClick = _m.handleDropdownItemClick;
|
|
3376
|
+
var handleKeyDown = function (e) {
|
|
3377
|
+
var _a;
|
|
3378
|
+
if (e.key === 'Backspace' && searchTerm === '' && value.length > 0) {
|
|
3379
|
+
handleRemoveTag(value.length - 1);
|
|
3380
|
+
}
|
|
3381
|
+
(_a = restInputProps.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(restInputProps, e);
|
|
3382
|
+
};
|
|
3383
|
+
var handleContainerClick = function () {
|
|
3384
|
+
var _a;
|
|
3385
|
+
if (!disabled && !readOnly) {
|
|
3386
|
+
(_a = internalInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
3387
|
+
}
|
|
3388
|
+
};
|
|
3389
|
+
var handleBlur = function (e) {
|
|
3390
|
+
var _a;
|
|
3391
|
+
if ((_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.relatedTarget))
|
|
3392
|
+
return;
|
|
3393
|
+
setIsFocused(false);
|
|
3394
|
+
};
|
|
3395
|
+
var getBottomBorderColor = function () {
|
|
3396
|
+
if (disabled || readOnly || (!isHovered && !isFocused))
|
|
3397
|
+
return '';
|
|
3398
|
+
if (isExistValidation && isValid)
|
|
3399
|
+
return 'border-b-bia-green';
|
|
3400
|
+
if (isExistValidation && !isValid)
|
|
3401
|
+
return 'border-b-bia-red';
|
|
3402
|
+
return 'border-b-bia-blue';
|
|
3403
|
+
};
|
|
3404
|
+
var descColor = !disabled && isExistValidation
|
|
3405
|
+
? isValid
|
|
3406
|
+
? 'text-bia-green'
|
|
3407
|
+
: 'text-bia-red'
|
|
3408
|
+
: 'text-primary-cool';
|
|
3409
|
+
var _o = sizeConfig$6[size], inputClass = _o.inputClass, paddingClass = _o.paddingClass, resizePosition = _o.resizePosition;
|
|
3410
|
+
var _p = dropContProps || {}, dropContClassName = _p.dropContClassName, restDropContProps = __rest(_p, ["dropContClassName"]);
|
|
3411
|
+
var _q = processRenderedChildren(children, searchTerm, 'include', handleDropdownItemClick, value), renderedChildren = _q.renderedChildren, hasFilteredResults = _q.hasFilteredResults;
|
|
3412
|
+
var showPlaceholder = !disabled && !readOnly && value.length === 0;
|
|
3413
|
+
console.log('showPlaceholder', showPlaceholder);
|
|
3414
|
+
return (React.createElement("div", { className: cn('relative w-full', className) },
|
|
3415
|
+
label && (React.createElement(FormLabel, { htmlFor: inputId, readOnly: readOnly, required: required }, label)),
|
|
3416
|
+
React.createElement("div", { ref: containerRef, onClick: handleContainerClick, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onFocus: function (e) {
|
|
3417
|
+
if (!disabled && !readOnly) {
|
|
3418
|
+
setIsFocused(true);
|
|
3419
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
3420
|
+
}
|
|
3421
|
+
}, onBlur: function (e) {
|
|
3422
|
+
handleBlur(e);
|
|
3423
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
3424
|
+
}, 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
|
|
3425
|
+
? 'cursor-not-allowed bg-bia-grey-light-80 text-bia-grey-active'
|
|
3426
|
+
: 'cursor-text', !disabled &&
|
|
3427
|
+
!readOnly &&
|
|
3428
|
+
'focus-within:rounded-b-none hover:rounded-b-none', isFocused && !disabled && !readOnly && 'rounded-b-none', getBottomBorderColor(), paddingClass) },
|
|
3429
|
+
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)))); }),
|
|
3430
|
+
React.createElement("input", __assign({}, restInputProps, { "aria-autocomplete": "list", "aria-expanded": isOpen, "aria-haspopup": "listbox", disabled: disabled, id: inputId, onChange: function (e) {
|
|
3431
|
+
if (disabled || readOnly)
|
|
3432
|
+
return;
|
|
3433
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(e);
|
|
3434
|
+
handleInputChange(e);
|
|
3435
|
+
}, 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') })),
|
|
3436
|
+
React.createElement(ResizeIcon, { className: cn('absolute', resizePosition) })),
|
|
3437
|
+
description && (React.createElement("p", { className: cn('mt-1.5 text-xs transition-colors', descColor) }, description)),
|
|
3438
|
+
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
|
|
3439
|
+
? renderedChildren
|
|
3440
|
+
: searchTerm.length > 0 && (React.createElement(DropdownItem, { content: React.createElement("div", { className: "px-4 py-2 text-gray-500" }, "Tidak ada hasil ditemukan.") }))))));
|
|
3441
|
+
};
|
|
3442
|
+
var TagLabelInput = forwardRef(TagLabelInputInner);
|
|
3443
|
+
|
|
3444
|
+
var sizeConfig$4 = {
|
|
3048
3445
|
md: {
|
|
3049
3446
|
containerSize: 'w-[42px] h-[22px]',
|
|
3050
3447
|
checkSize: 'p-2',
|
|
@@ -3059,7 +3456,7 @@ var sizeConfig$5 = {
|
|
|
3059
3456
|
|
|
3060
3457
|
function Toggle(_a) {
|
|
3061
3458
|
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;
|
|
3062
|
-
var _h = sizeConfig$
|
|
3459
|
+
var _h = sizeConfig$4[size], containerSize = _h.containerSize, checkSize = _h.checkSize, labelClass = _h.labelClass;
|
|
3063
3460
|
var checkedClass = checked ? 'justify-end' : 'justify-start';
|
|
3064
3461
|
var containerClass = "".concat(checkedClass, " ").concat(containerSize);
|
|
3065
3462
|
return (React.createElement("div", { className: "flex items-center" },
|
|
@@ -3087,7 +3484,7 @@ var roundedConfig = {
|
|
|
3087
3484
|
sm: 'first:rounded-l-radius-sm last:rounded-r-radius-sm',
|
|
3088
3485
|
tn: 'first:rounded-l-radius-tn last:rounded-r-radius-tn',
|
|
3089
3486
|
};
|
|
3090
|
-
var sizeConfig$
|
|
3487
|
+
var sizeConfig$3 = {
|
|
3091
3488
|
lg: 'text-size-md leading-[23.94px] px-[13px] py-[11px] ',
|
|
3092
3489
|
md: 'text-size-base leading-[21px] px-[11px] py-[8.5px] ',
|
|
3093
3490
|
sm: 'text-size-sm leading-[15.96px] px-[7px] py-[6px] ',
|
|
@@ -3110,8 +3507,8 @@ function SegmentButtonItem(_a) {
|
|
|
3110
3507
|
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;
|
|
3111
3508
|
var isSelected = selected ? 'selected' : 'notSelected';
|
|
3112
3509
|
var sizingStyle = isfitContent
|
|
3113
|
-
? "".concat(sizeConfig$
|
|
3114
|
-
: "".concat(sizeConfig$
|
|
3510
|
+
? "".concat(sizeConfig$3[size], " ").concat(minHeightConfig[size])
|
|
3511
|
+
: "".concat(sizeConfig$3[size], " ").concat(minWidthConfig[size], " ").concat(minHeightConfig[size]);
|
|
3115
3512
|
var radiusStyle = "".concat(roundedConfig[size]);
|
|
3116
3513
|
var selectedStyle = "".concat(isSelectedConfig[isSelected]);
|
|
3117
3514
|
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));
|
|
@@ -3122,10 +3519,10 @@ function SegmentButtonGroup(_a) {
|
|
|
3122
3519
|
return React.createElement("div", { className: "flex" }, children);
|
|
3123
3520
|
}
|
|
3124
3521
|
|
|
3125
|
-
var sizeUnion
|
|
3522
|
+
var sizeUnion = ['md', 'sm'];
|
|
3126
3523
|
var FormGroup = function (_a) {
|
|
3127
3524
|
var children = _a.children, size = _a.size;
|
|
3128
|
-
var validSize = validUnion(size, sizeUnion
|
|
3525
|
+
var validSize = validUnion(size, sizeUnion);
|
|
3129
3526
|
return (React.createElement("div", { className: "bianic-form-group flex items-end" }, Children.map(children, function (child) {
|
|
3130
3527
|
var _a;
|
|
3131
3528
|
if (!React.isValidElement(child))
|
|
@@ -3866,7 +4263,7 @@ var DateInputDisplay = forwardRef(function (_a, ref) {
|
|
|
3866
4263
|
var _e = useState(false), isEditing = _e[0], setIsEditing = _e[1];
|
|
3867
4264
|
var _f = useState(inputValue), dateString = _f[0], setDateString = _f[1];
|
|
3868
4265
|
var _g = styleConfig['text'], fieldStyle = _g.fieldStyle;
|
|
3869
|
-
var _h = sizeConfig$
|
|
4266
|
+
var _h = sizeConfig$d[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
3870
4267
|
var borderStyle = 'border border-bia-grey-dark-10 bg-primary-white';
|
|
3871
4268
|
var extendedInputClassName = "w-full ".concat(fieldStyle, " ").concat(fieldSize, " ").concat(borderStyle, " ").concat(className);
|
|
3872
4269
|
props.readOnly ? 'read-only:pointer-events-none' : '';
|
|
@@ -4012,7 +4409,7 @@ var YearPickerDisplay = forwardRef(function (_a, ref) {
|
|
|
4012
4409
|
}
|
|
4013
4410
|
}
|
|
4014
4411
|
};
|
|
4015
|
-
var _h = sizeConfig$
|
|
4412
|
+
var _h = sizeConfig$d[size], iconSize = _h.iconSize, fieldSize = _h.fieldSize, iconPosition = _h.iconPosition;
|
|
4016
4413
|
var fieldStyle = styleConfig['text'].fieldStyle;
|
|
4017
4414
|
var displayError = customErrorMessage || internalError;
|
|
4018
4415
|
var borderStyle = displayError
|
|
@@ -4128,6 +4525,198 @@ var YearPicker = function (_a) {
|
|
|
4128
4525
|
React.createElement(PickerYear, { maxYear: maxYear, minYear: minYear, zIndex: zIndexCalendar, anchorRef: inputRef, selectedYear: value, setSelectedYear: onChange, isOpen: isPickerOpen, onClose: function () { return setIsPickerOpen(false); } })));
|
|
4129
4526
|
};
|
|
4130
4527
|
|
|
4528
|
+
/**
|
|
4529
|
+
* Comprehensive MIME type & file extension validator
|
|
4530
|
+
*/
|
|
4531
|
+
var isValidFileType = function (file, accept) {
|
|
4532
|
+
if (!accept)
|
|
4533
|
+
return true;
|
|
4534
|
+
var acceptedTypes = accept
|
|
4535
|
+
.split(',')
|
|
4536
|
+
.map(function (type) { return type.trim().toLowerCase(); })
|
|
4537
|
+
.filter(Boolean);
|
|
4538
|
+
var fileName = file.name.toLowerCase();
|
|
4539
|
+
var fileType = file.type.toLowerCase();
|
|
4540
|
+
return acceptedTypes.some(function (pattern) {
|
|
4541
|
+
// 1. File Extension Matching (e.g., '.docx', '.pdf')
|
|
4542
|
+
if (pattern.startsWith('.')) {
|
|
4543
|
+
return fileName.endsWith(pattern);
|
|
4544
|
+
}
|
|
4545
|
+
// 2. Wildcard MIME Matching (e.g., 'image/*', 'application/*')
|
|
4546
|
+
if (pattern.endsWith('/*')) {
|
|
4547
|
+
var mainType = pattern.split('/')[0];
|
|
4548
|
+
return fileType.startsWith("".concat(mainType, "/"));
|
|
4549
|
+
}
|
|
4550
|
+
// 3. Exact MIME Matching (e.g., 'application/vnd.openxmlformats-officedocument.wordprocessingml.document')
|
|
4551
|
+
return fileType === pattern;
|
|
4552
|
+
});
|
|
4553
|
+
};
|
|
4554
|
+
var useFileHandler = function (_a) {
|
|
4555
|
+
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;
|
|
4556
|
+
var _e = useState(false), isDragging = _e[0], setIsDragging = _e[1];
|
|
4557
|
+
var _f = useState(null), internalError = _f[0], setInternalError = _f[1];
|
|
4558
|
+
var inputRef = useRef(null);
|
|
4559
|
+
var processFiles = function (incomingFiles) {
|
|
4560
|
+
if (!incomingFiles || disabled)
|
|
4561
|
+
return;
|
|
4562
|
+
setInternalError(null);
|
|
4563
|
+
var validFiles = [];
|
|
4564
|
+
Array.from(incomingFiles).forEach(function (file) {
|
|
4565
|
+
// Step 1: Enforce File Extension / MIME Validation (Applies to both Click and Drag & Drop)
|
|
4566
|
+
if (!isValidFileType(file, accept)) {
|
|
4567
|
+
setInternalError("\"".concat(file.name, "\" is not an accepted format (").concat(accept, ")."));
|
|
4568
|
+
onError === null || onError === void 0 ? void 0 : onError({ file: file, reason: 'INVALID_FILE_TYPE' });
|
|
4569
|
+
return;
|
|
4570
|
+
}
|
|
4571
|
+
// Step 2: Enforce Max Size Validation
|
|
4572
|
+
if (maxSize && file.size > maxSize) {
|
|
4573
|
+
var maxSizeMb = (maxSize / (1024 * 1024)).toFixed(0);
|
|
4574
|
+
setInternalError("\"".concat(file.name, "\" exceeds the limit of ").concat(maxSizeMb, " MB."));
|
|
4575
|
+
onError === null || onError === void 0 ? void 0 : onError({ file: file, reason: 'MAX_SIZE_EXCEEDED' });
|
|
4576
|
+
return;
|
|
4577
|
+
}
|
|
4578
|
+
validFiles.push({
|
|
4579
|
+
id: "".concat(file.name, "-").concat(Date.now(), "-").concat(Math.random().toString(36).substring(2, 9)),
|
|
4580
|
+
file: file,
|
|
4581
|
+
progress: 100,
|
|
4582
|
+
});
|
|
4583
|
+
});
|
|
4584
|
+
// If zero dropped files passed validation, halt state update
|
|
4585
|
+
if (validFiles.length === 0)
|
|
4586
|
+
return;
|
|
4587
|
+
var updated = multiple ? __spreadArray(__spreadArray([], value, true), validFiles, true) : validFiles;
|
|
4588
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(updated);
|
|
4589
|
+
};
|
|
4590
|
+
var handleDragOver = function (e) {
|
|
4591
|
+
e.preventDefault();
|
|
4592
|
+
e.stopPropagation();
|
|
4593
|
+
if (!disabled)
|
|
4594
|
+
setIsDragging(true);
|
|
4595
|
+
};
|
|
4596
|
+
var handleDragLeave = function (e) {
|
|
4597
|
+
e.preventDefault();
|
|
4598
|
+
e.stopPropagation();
|
|
4599
|
+
setIsDragging(false);
|
|
4600
|
+
};
|
|
4601
|
+
var handleDrop = function (e) {
|
|
4602
|
+
e.preventDefault();
|
|
4603
|
+
e.stopPropagation();
|
|
4604
|
+
setIsDragging(false);
|
|
4605
|
+
if (!disabled && e.dataTransfer.files) {
|
|
4606
|
+
// Explicitly pass dragged files through our validator
|
|
4607
|
+
processFiles(e.dataTransfer.files);
|
|
4608
|
+
}
|
|
4609
|
+
};
|
|
4610
|
+
var handleInputChange = function (e) {
|
|
4611
|
+
processFiles(e.target.files || []);
|
|
4612
|
+
if (inputRef.current)
|
|
4613
|
+
inputRef.current.value = '';
|
|
4614
|
+
};
|
|
4615
|
+
var triggerClick = function () {
|
|
4616
|
+
var _a;
|
|
4617
|
+
if (!disabled)
|
|
4618
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
4619
|
+
};
|
|
4620
|
+
return {
|
|
4621
|
+
inputRef: inputRef,
|
|
4622
|
+
isDragging: isDragging,
|
|
4623
|
+
internalError: internalError,
|
|
4624
|
+
handleDragOver: handleDragOver,
|
|
4625
|
+
handleDragLeave: handleDragLeave,
|
|
4626
|
+
handleDrop: handleDrop,
|
|
4627
|
+
handleInputChange: handleInputChange,
|
|
4628
|
+
triggerClick: triggerClick,
|
|
4629
|
+
};
|
|
4630
|
+
};
|
|
4631
|
+
|
|
4632
|
+
var SimpleFileUploader = function (_a) {
|
|
4633
|
+
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;
|
|
4634
|
+
var _h = useFileHandler({
|
|
4635
|
+
accept: accept,
|
|
4636
|
+
multiple: multiple,
|
|
4637
|
+
maxSize: maxSize,
|
|
4638
|
+
disabled: disabled,
|
|
4639
|
+
value: value,
|
|
4640
|
+
onChange: onChange,
|
|
4641
|
+
onError: onError,
|
|
4642
|
+
}), inputRef = _h.inputRef, internalError = _h.internalError, handleInputChange = _h.handleInputChange, triggerClick = _h.triggerClick;
|
|
4643
|
+
var activeError = errorMessage || internalError;
|
|
4644
|
+
var iconSizes = {
|
|
4645
|
+
tn: 14,
|
|
4646
|
+
sm: 14,
|
|
4647
|
+
md: 18,
|
|
4648
|
+
lg: 22,
|
|
4649
|
+
}[size];
|
|
4650
|
+
return (React.createElement("div", { className: cn('inline-flex flex-col items-start gap-1.5', className) },
|
|
4651
|
+
React.createElement("input", { ref: inputRef, type: "file", accept: accept, multiple: multiple, disabled: disabled, onChange: handleInputChange, className: "hidden", "aria-label": "File input" }),
|
|
4652
|
+
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" }) }),
|
|
4653
|
+
activeError && (React.createElement("div", { className: "flex items-center gap-1 text-xs font-medium text-bia-red" },
|
|
4654
|
+
React.createElement(TbAlertCircle, { size: 14, className: "shrink-0" }),
|
|
4655
|
+
React.createElement("span", null, activeError)))));
|
|
4656
|
+
};
|
|
4657
|
+
|
|
4658
|
+
var DropzoneFileUploader = function (_a) {
|
|
4659
|
+
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;
|
|
4660
|
+
var effectiveAccept = accept || (variant === 'image' ? 'image/*' : undefined);
|
|
4661
|
+
var _f = useFileHandler({
|
|
4662
|
+
accept: effectiveAccept,
|
|
4663
|
+
multiple: multiple,
|
|
4664
|
+
maxSize: maxSize,
|
|
4665
|
+
disabled: disabled,
|
|
4666
|
+
value: value,
|
|
4667
|
+
onChange: onChange,
|
|
4668
|
+
onError: onError,
|
|
4669
|
+
}), inputRef = _f.inputRef, isDragging = _f.isDragging, internalError = _f.internalError, handleDragOver = _f.handleDragOver, handleDragLeave = _f.handleDragLeave, handleDrop = _f.handleDrop, handleInputChange = _f.handleInputChange, triggerClick = _f.triggerClick;
|
|
4670
|
+
var isImageVariant = variant === 'image';
|
|
4671
|
+
var defaultTitle = isImageVariant
|
|
4672
|
+
? 'Drag & Drop your Image here'
|
|
4673
|
+
: 'Click or drag and drop to upload your file';
|
|
4674
|
+
var formattedMaxSize = maxSize
|
|
4675
|
+
? "".concat((maxSize / (1024 * 1024)).toFixed(0), " MB")
|
|
4676
|
+
: undefined;
|
|
4677
|
+
var defaultSubtext = helperText ||
|
|
4678
|
+
(formattedMaxSize ? "Maximum upload file size ".concat(formattedMaxSize) : '');
|
|
4679
|
+
var activeError = errorMessage || internalError;
|
|
4680
|
+
return (React.createElement("div", { className: cn('flex w-full flex-col gap-3', className) },
|
|
4681
|
+
React.createElement("input", { ref: inputRef, type: "file", accept: effectiveAccept, multiple: multiple, disabled: disabled, onChange: handleInputChange, className: "peer hidden", "aria-label": "File upload dropzone" }),
|
|
4682
|
+
React.createElement("div", { onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, onClick: triggerClick, role: "button", tabIndex: disabled ? -1 : 0, onKeyDown: function (e) {
|
|
4683
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
4684
|
+
e.preventDefault();
|
|
4685
|
+
triggerClick();
|
|
4686
|
+
}
|
|
4687
|
+
}, 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
|
|
4688
|
+
? 'bg-blue-50/50 border-bia-blue'
|
|
4689
|
+
: !activeError &&
|
|
4690
|
+
'border-bia-grey-dark-10 hover:border-bia-blue hover:bg-gray-50') },
|
|
4691
|
+
React.createElement(TbPhotoUp, { size: 36, className: "mb-2 text-bia-coolgrey" }),
|
|
4692
|
+
React.createElement("div", { className: "mb-3 flex flex-col items-center justify-center" },
|
|
4693
|
+
React.createElement(Text, { variant: "normal-text-semibold", className: "text-bia-coolgrey" }, label || defaultTitle),
|
|
4694
|
+
React.createElement(Text, { variant: "small-text", className: "text-xs text-bia-coolgrey" }, defaultSubtext)),
|
|
4695
|
+
React.createElement(Button, { label: "Browse File", size: "md", variant: "subtle-link", disabled: disabled })),
|
|
4696
|
+
activeError && (React.createElement("div", { className: "flex items-center gap-1.5 text-xs font-medium text-bia-red" },
|
|
4697
|
+
React.createElement(TbAlertCircle, { size: 16, className: "shrink-0" }),
|
|
4698
|
+
React.createElement("span", null, activeError))),
|
|
4699
|
+
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" },
|
|
4700
|
+
React.createElement("div", { className: "flex items-center gap-3 truncate" },
|
|
4701
|
+
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 }))),
|
|
4702
|
+
React.createElement("div", { className: "flex flex-col truncate" },
|
|
4703
|
+
React.createElement("span", { className: "truncate text-sm font-medium text-gray-800" }, item.file.name),
|
|
4704
|
+
React.createElement("span", { className: "text-xs text-gray-400" },
|
|
4705
|
+
(item.file.size / (1024 * 1024)).toFixed(1),
|
|
4706
|
+
" MB"))),
|
|
4707
|
+
React.createElement("div", { className: "flex items-center gap-1" },
|
|
4708
|
+
onDownload && (React.createElement("button", { type: "button", onClick: function (e) {
|
|
4709
|
+
e.stopPropagation();
|
|
4710
|
+
onDownload(item.id);
|
|
4711
|
+
}, className: "rounded-full p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-700", "aria-label": "Download ".concat(item.file.name) },
|
|
4712
|
+
React.createElement(TbDownload, { size: 18 }))),
|
|
4713
|
+
onRemove && (React.createElement("button", { type: "button", onClick: function (e) {
|
|
4714
|
+
e.stopPropagation();
|
|
4715
|
+
onRemove(item.id);
|
|
4716
|
+
}, className: "rounded-full p-1.5 text-gray-400 hover:bg-gray-100 hover:text-red-500", "aria-label": "Remove ".concat(item.file.name) },
|
|
4717
|
+
React.createElement(TbTrash, { size: 18 })))))); })))));
|
|
4718
|
+
};
|
|
4719
|
+
|
|
4131
4720
|
var AlertRoundedSquare = function (_a) {
|
|
4132
4721
|
var className = _a.className, _b = _a.fill, fill = _b === void 0 ? 'currentColor' : _b, _c = _a.size, size = _c === void 0 ? 20 : _c;
|
|
4133
4722
|
return (React.createElement("svg", { className: className, width: size, height: size, viewBox: "0 0 24 24", fill: fill, xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -4323,13 +4912,13 @@ var VirtualPort = function (_a) {
|
|
|
4323
4912
|
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" })));
|
|
4324
4913
|
};
|
|
4325
4914
|
|
|
4326
|
-
var colorConfig
|
|
4915
|
+
var colorConfig = {
|
|
4327
4916
|
yellow: 'bg-bia-yellow-light-80',
|
|
4328
4917
|
blue: 'bg-bia-sky-light-90',
|
|
4329
4918
|
grey: 'bg-bia-grey-light-80',
|
|
4330
4919
|
white: 'bg-bia-white border border-bia-grey',
|
|
4331
4920
|
};
|
|
4332
|
-
var sizeConfig$
|
|
4921
|
+
var sizeConfig$2 = {
|
|
4333
4922
|
container: 'min-h-fit p-5 text-wrap',
|
|
4334
4923
|
'form-sm': 'min-h-[30px] h-fit whitespace-nowrap p-[7px]',
|
|
4335
4924
|
'form-md': 'min-h-[40px] h-fit whitespace-nowrap px-2.5 py-[9.5px]',
|
|
@@ -4337,8 +4926,8 @@ var sizeConfig$3 = {
|
|
|
4337
4926
|
|
|
4338
4927
|
var InfoPanel = function (_a) {
|
|
4339
4928
|
var variant = _a.variant, color = _a.color, className = _a.className, children = _a.children;
|
|
4340
|
-
var sizeClass = sizeConfig$
|
|
4341
|
-
var colorClass = colorConfig
|
|
4929
|
+
var sizeClass = sizeConfig$2[variant || 'container'];
|
|
4930
|
+
var colorClass = colorConfig[color || 'yellow'];
|
|
4342
4931
|
var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
|
|
4343
4932
|
return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) }, children));
|
|
4344
4933
|
};
|
|
@@ -4393,7 +4982,7 @@ var Notification = function (props) {
|
|
|
4393
4982
|
children));
|
|
4394
4983
|
};
|
|
4395
4984
|
|
|
4396
|
-
var sizeConfig$
|
|
4985
|
+
var sizeConfig$1 = {
|
|
4397
4986
|
md: 'min-w-[40px] h-[40px] text-[14px] font-semibold',
|
|
4398
4987
|
sm: 'min-w-[30px] h-[30px] text-[12px] font-normal',
|
|
4399
4988
|
};
|
|
@@ -4462,7 +5051,7 @@ function PaginationBar(_a) {
|
|
|
4462
5051
|
}
|
|
4463
5052
|
return (React.createElement(Button, { key: page, variant: "subtle", size: size, type: "button", onClick: function () {
|
|
4464
5053
|
handlePageChange(page);
|
|
4465
|
-
}, className: "cursor-pointer ".concat(sizeConfig$
|
|
5054
|
+
}, className: "cursor-pointer ".concat(sizeConfig$1[size]), label: page.toString(), minWidth: buttonSizingStyle }));
|
|
4466
5055
|
}),
|
|
4467
5056
|
React.createElement(Button, { variant: "subtle", size: size, type: "button", onClick: function () {
|
|
4468
5057
|
handlePageChange(currentPage + 1);
|
|
@@ -4815,7 +5404,7 @@ var SidebarMenu = function (_a) {
|
|
|
4815
5404
|
var _f = useState(false), isAllExpanded = _f[0], setIsAllExpanded = _f[1];
|
|
4816
5405
|
var minimizedMenuClass = isMinimized
|
|
4817
5406
|
? 'opacity-100 h-1 w-full delay-[600ms] duration-300 ease-[cubic-bezier(0.68,-0.1,0.32,2)]'
|
|
4818
|
-
: 'opacity-0 h-1 duration-500 ease-[cubic-bezier(0.32,-1,0.68,1)]';
|
|
5407
|
+
: 'opacity-0 h-1 w-full duration-500 ease-[cubic-bezier(0.32,-1,0.68,1)]';
|
|
4819
5408
|
return (React.createElement("div", null,
|
|
4820
5409
|
React.createElement("div", { className: "relative flex h-[60px] w-full text-bia-white" },
|
|
4821
5410
|
React.createElement("div", { className: "absolute left-0 top-[27.5px] px-[17px] ".concat(minimizedMenuClass) },
|
|
@@ -4840,139 +5429,6 @@ var SidebarMenu = function (_a) {
|
|
|
4840
5429
|
})));
|
|
4841
5430
|
};
|
|
4842
5431
|
|
|
4843
|
-
var colorConfig = {
|
|
4844
|
-
default: 'bg-bia-grey-light-50 text-primary-black',
|
|
4845
|
-
blue: 'bg-bia-blue text-primary-white',
|
|
4846
|
-
teal: 'bg-bia-teal text-primary-white',
|
|
4847
|
-
green: 'bg-bia-green text-primary-white',
|
|
4848
|
-
// yellow: 'bg-bia-yellow text-primary-black',
|
|
4849
|
-
orange: 'bg-bia-orange text-primary-white',
|
|
4850
|
-
red: 'bg-bia-red text-primary-white',
|
|
4851
|
-
black: 'bg-primary-black text-primary-white',
|
|
4852
|
-
white: 'bg-primary-white text-primary-black border border-primary-black',
|
|
4853
|
-
};
|
|
4854
|
-
var sizeConfig$1 = {
|
|
4855
|
-
md: 'px-[10px] py-[7px] h-[34px] text-size-base',
|
|
4856
|
-
sm: 'px-[10px] py-[4px] h-[22px] text-size-sm',
|
|
4857
|
-
tn: 'px-[8px] py-[2px] h-[18px] text-size-sm',
|
|
4858
|
-
};
|
|
4859
|
-
var iconOnlySizeConfig = {
|
|
4860
|
-
md: 'p-[7px]',
|
|
4861
|
-
sm: 'p-[4px]',
|
|
4862
|
-
tn: 'p-[2px]',
|
|
4863
|
-
};
|
|
4864
|
-
var closeColorConfig = {
|
|
4865
|
-
default: 'bg-bia-grey-dark-30 text-primary-white',
|
|
4866
|
-
blue: 'bg-bia-white-transparent-50 text-bia-blue',
|
|
4867
|
-
teal: 'bg-bia-white-transparent-50 text-bia-teal',
|
|
4868
|
-
green: 'bg-bia-white-transparent-50 text-bia-green',
|
|
4869
|
-
yellow: 'bg-bia-white-transparent-50 text-bia-yellow',
|
|
4870
|
-
red: 'bg-bia-white-transparent-50 text-bia-red',
|
|
4871
|
-
black: 'bg-bia-white-transparent-50 text-primary-black',
|
|
4872
|
-
white: 'bg-bia-grey-dark-30 text-primary-white',
|
|
4873
|
-
};
|
|
4874
|
-
var closeSizeConfig = {
|
|
4875
|
-
md: 'w-[18px] h-[18px] text-[14px]',
|
|
4876
|
-
sm: 'w-[12px] h-[12px] text-[9.33px]',
|
|
4877
|
-
tn: 'w-[12px] h-[12px] text-[9.33px]',
|
|
4878
|
-
};
|
|
4879
|
-
var rightPaddingConfig = {
|
|
4880
|
-
md: 'pr-[8px]',
|
|
4881
|
-
sm: 'pr-[5px]',
|
|
4882
|
-
tn: 'pr-[3px]',
|
|
4883
|
-
};
|
|
4884
|
-
|
|
4885
|
-
var colorUnion = [
|
|
4886
|
-
'default',
|
|
4887
|
-
'blue',
|
|
4888
|
-
'teal',
|
|
4889
|
-
'green',
|
|
4890
|
-
'orange',
|
|
4891
|
-
'red',
|
|
4892
|
-
'black',
|
|
4893
|
-
'white',
|
|
4894
|
-
'custom',
|
|
4895
|
-
];
|
|
4896
|
-
var sizeUnion = ['md', 'sm', 'tn'];
|
|
4897
|
-
var variantUnion = ['label', 'icon', 'closeable', 'monospace'];
|
|
4898
|
-
var TagLabel = function (_a) {
|
|
4899
|
-
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"]);
|
|
4900
|
-
var validatedColor = validUnion(color, colorUnion);
|
|
4901
|
-
var validatedSize = validUnion(size, sizeUnion);
|
|
4902
|
-
var validatedVariant = validUnion(variant, variantUnion);
|
|
4903
|
-
var containerRef = useRef(null);
|
|
4904
|
-
var _e = useState(null), sizeCount = _e[0], setSizeCount = _e[1];
|
|
4905
|
-
useEffect(function () {
|
|
4906
|
-
if (variant === 'icon') {
|
|
4907
|
-
// Get the size of the icon
|
|
4908
|
-
// and set the size of the container
|
|
4909
|
-
// to the one with the biggest size (width or height icon)
|
|
4910
|
-
// in order to make the container square
|
|
4911
|
-
var rect = containerRef.current.getBoundingClientRect();
|
|
4912
|
-
var width = rect.width;
|
|
4913
|
-
var height = rect.height;
|
|
4914
|
-
if (width > height)
|
|
4915
|
-
setSizeCount(width);
|
|
4916
|
-
else
|
|
4917
|
-
setSizeCount(height);
|
|
4918
|
-
}
|
|
4919
|
-
}, []);
|
|
4920
|
-
var isCloseable = validatedVariant === 'closeable';
|
|
4921
|
-
var defaultIconSize = validatedSize === 'md' ? 'text-xl' : 'text-sm';
|
|
4922
|
-
var borderColorRules = outlineColor || bgColor;
|
|
4923
|
-
var roundedClass = validatedVariant === 'icon' ? 'rounded-full' : 'rounded-[50px]';
|
|
4924
|
-
var sizeClass = validatedVariant === 'icon'
|
|
4925
|
-
? iconOnlySizeConfig[validatedSize]
|
|
4926
|
-
: sizeConfig$1[validatedSize];
|
|
4927
|
-
var isCloseableClass = isCloseable && rightPaddingConfig[validatedSize];
|
|
4928
|
-
var colorClass = validatedColor === 'custom'
|
|
4929
|
-
? "bg-bia-".concat(bgColor, " text-bia-").concat(textColor, " border border-bia-").concat(borderColorRules)
|
|
4930
|
-
: colorConfig[validatedColor];
|
|
4931
|
-
var blockclass = isBlock && validatedVariant !== 'icon' ? 'w-full' : "w-fit";
|
|
4932
|
-
var maxWidthStyle = !isBlock ? maxWidth + 'px' : '';
|
|
4933
|
-
var alignTextClass = isBlock ? 'text-center' : 'text-left';
|
|
4934
|
-
var fontClass = validatedVariant === 'monospace' ? 'font-sans-code' : 'font-segoe pb-[1px]';
|
|
4935
|
-
var textClass = "".concat(alignTextClass, " ").concat(fontClass);
|
|
4936
|
-
var containerClass = "".concat(sizeClass, " ").concat(colorClass, " ").concat(roundedClass, " ").concat(isCloseableClass, " ").concat(blockclass);
|
|
4937
|
-
var closeColor = validatedColor === 'custom'
|
|
4938
|
-
? isDark
|
|
4939
|
-
? "bg-bia-white-transparent-50 text-bia-".concat(bgColor)
|
|
4940
|
-
: "bg-bia-grey-dark-30 text-bia-".concat(bgColor)
|
|
4941
|
-
: closeColorConfig[validatedColor];
|
|
4942
|
-
var closeClass = "".concat(closeColor, " ").concat(closeSizeConfig[validatedSize]);
|
|
4943
|
-
var isOpen = isCloseable ? open : true;
|
|
4944
|
-
return (isOpen && (React.createElement("div", __assign({ className: "tag-label flex items-center gap-x-[5px] text-size-base ".concat(containerClass), style: {
|
|
4945
|
-
maxWidth: maxWidthStyle,
|
|
4946
|
-
} }, props),
|
|
4947
|
-
leftIcon && (React.createElement("div", { style: {
|
|
4948
|
-
width: sizeCount + 'px',
|
|
4949
|
-
height: sizeCount + 'px',
|
|
4950
|
-
}, className: "flex items-center justify-center", ref: containerRef }, leftIcon ||
|
|
4951
|
-
(validatedVariant === 'icon' && (React.createElement(TbCheck, { className: defaultIconSize }))))),
|
|
4952
|
-
validatedVariant !== 'icon' && text && (React.createElement("span", { className: "w-full truncate ".concat(textClass) }, text)),
|
|
4953
|
-
validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "block" },
|
|
4954
|
-
" ",
|
|
4955
|
-
rightIcon,
|
|
4956
|
-
" ")),
|
|
4957
|
-
isCloseable && (React.createElement("button", { type: "button", onClick: closeHandler, className: "flex aspect-square items-center justify-center rounded-full pt-[1px] ".concat(closeClass) },
|
|
4958
|
-
React.createElement(TbX, null))))));
|
|
4959
|
-
};
|
|
4960
|
-
TagLabel.defaultProps = {
|
|
4961
|
-
variant: 'default',
|
|
4962
|
-
size: 'sm',
|
|
4963
|
-
open: true,
|
|
4964
|
-
closeHandler: function () { },
|
|
4965
|
-
leftIcon: null,
|
|
4966
|
-
rightIcon: null,
|
|
4967
|
-
left: null,
|
|
4968
|
-
right: null,
|
|
4969
|
-
bgColor: 'grey-light-50',
|
|
4970
|
-
textColor: 'black',
|
|
4971
|
-
isBlock: false,
|
|
4972
|
-
maxWidth: 300,
|
|
4973
|
-
isDark: false,
|
|
4974
|
-
};
|
|
4975
|
-
|
|
4976
5432
|
var SidebarItem = forwardRef(function (_a, ref) {
|
|
4977
5433
|
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"]);
|
|
4978
5434
|
var childDropdownRef = useRef(null);
|
|
@@ -5400,7 +5856,7 @@ function TableCell(_a) {
|
|
|
5400
5856
|
if (variant === 'head') {
|
|
5401
5857
|
return (React.createElement("th", __assign({ className: "bianic-table-cell table-head bg-bia-grey-light-80 ".concat(columnClass) }, props), children));
|
|
5402
5858
|
}
|
|
5403
|
-
return (React.createElement("td", __assign({ className: "bianic-table-cell table-col ".concat(columnClass) }, props), children));
|
|
5859
|
+
return (React.createElement("td", __assign({ className: "bianic-table-cell table-col ".concat(columnClass, " break-words") }, props), children));
|
|
5404
5860
|
}
|
|
5405
5861
|
TableCell.defaultProps = {
|
|
5406
5862
|
lined: false,
|
|
@@ -5737,4 +6193,4 @@ var useTableDataHandler = function (initialData, options) {
|
|
|
5737
6193
|
};
|
|
5738
6194
|
};
|
|
5739
6195
|
|
|
5740
|
-
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, Rhombus as BCRhombus, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, Unlinked as BCUnlinked, VirtualPort as BCVirtualPort, Badge, Banner, BlockLoading, Brand, Breadcrumb, Button, ButtonApp, Card, Checkbox, Color, ContextualButton, Countdown, DatePicker, Display, Divider, DropdownContainer, DropdownItem, EmptyTable, FileTree, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, MonospaceBadge, Notification, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, SidebarContainer, SidebarItem, SidebarMenu, SidebarProfile, Slider, Spinner, Tab, TabMenu, Table, TableBody, TableCell, TableFooterController, TableHead, TableHeaderController, TableRow, TableSearchInput, TagLabel, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, TreeItem, StepperItem as VerticalStepper, Window, YearPicker, getRelativeTime, useFileTree, useTableDataHandler };
|
|
6196
|
+
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, Rhombus as BCRhombus, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, Unlinked as BCUnlinked, VirtualPort as BCVirtualPort, Badge, Banner, BlockLoading, Brand, Breadcrumb, Button, ButtonApp, Card, Checkbox, Color, ContextualButton, Countdown, DatePicker, Display, Divider, DropdownContainer, DropdownItem, DropzoneFileUploader, EmptyTable, FileTree, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, MonospaceBadge, Notification, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, SidebarContainer, SidebarItem, SidebarMenu, SidebarProfile, SimpleFileUploader, Slider, Spinner, Tab, TabMenu, Table, TableBody, TableCell, TableFooterController, TableHead, TableHeaderController, TableRow, TableSearchInput, TagLabel, TagLabelInput, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, TreeItem, StepperItem as VerticalStepper, Window, YearPicker, getRelativeTime, useFileTree, useTableDataHandler };
|