bianic-ui 0.5.18 → 1.0.0-beta.10

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.
Files changed (60) hide show
  1. package/dist/cjs/index.js +148 -75
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Banner/index.d.ts +5 -5
  4. package/dist/cjs/types/components/Button/Button.d.ts +12 -0
  5. package/dist/cjs/types/components/Dump/Dump.d.ts +3 -0
  6. package/dist/cjs/types/components/Dump/index.d.ts +1 -0
  7. package/dist/cjs/types/components/Forms/Checkbox.d.ts +7 -0
  8. package/dist/cjs/types/components/Forms/LiveSearch.d.ts +13 -0
  9. package/dist/cjs/types/components/Forms/Radio/index.d.ts +3 -3
  10. package/dist/cjs/types/components/Forms/Radio.d.ts +8 -0
  11. package/dist/cjs/types/components/Forms/SelectInput/SelectedInput.d.ts +5 -5
  12. package/dist/cjs/types/components/Forms/SelectInput.d.ts +13 -0
  13. package/dist/cjs/types/components/Forms/TextArea.d.ts +10 -0
  14. package/dist/cjs/types/components/Forms/TextInput/PasswordIcon.d.ts +2 -2
  15. package/dist/cjs/types/components/Forms/TextInput/TextInput.d.ts +3 -3
  16. package/dist/cjs/types/components/Forms/TextInput.d.ts +14 -0
  17. package/dist/cjs/types/components/Forms/Toggle.d.ts +8 -0
  18. package/dist/cjs/types/components/Modal/Modal.d.ts +3 -3
  19. package/dist/cjs/types/components/Modal/ModalBody.d.ts +10 -0
  20. package/dist/cjs/types/components/Modal/ModalFooter.d.ts +7 -0
  21. package/dist/cjs/types/components/Modal/index.d.ts +3 -0
  22. package/dist/cjs/types/components/Popover/index.d.ts +2 -2
  23. package/dist/cjs/types/components/Tag/TagLabel.d.ts +14 -0
  24. package/dist/cjs/types/components/Tag/index.d.ts +1 -0
  25. package/dist/cjs/types/components/TagLabel/index.d.ts +4 -4
  26. package/dist/cjs/types/components/Typography/Text.d.ts +7 -0
  27. package/dist/cjs/types/stories/Badge/BadgeDemo.stories.d.ts +2 -1
  28. package/dist/cjs/types/stories/Badge/BadgeDemoHeading.stories.d.ts +2 -1
  29. package/dist/cjs/types/utility/helper.d.ts +3 -0
  30. package/dist/esm/index.js +148 -75
  31. package/dist/esm/lib.css +1 -1
  32. package/dist/esm/types/components/Banner/index.d.ts +5 -5
  33. package/dist/esm/types/components/Button/Button.d.ts +12 -0
  34. package/dist/esm/types/components/Dump/Dump.d.ts +3 -0
  35. package/dist/esm/types/components/Dump/index.d.ts +1 -0
  36. package/dist/esm/types/components/Forms/Checkbox.d.ts +7 -0
  37. package/dist/esm/types/components/Forms/LiveSearch.d.ts +13 -0
  38. package/dist/esm/types/components/Forms/Radio/index.d.ts +3 -3
  39. package/dist/esm/types/components/Forms/Radio.d.ts +8 -0
  40. package/dist/esm/types/components/Forms/SelectInput/SelectedInput.d.ts +5 -5
  41. package/dist/esm/types/components/Forms/SelectInput.d.ts +13 -0
  42. package/dist/esm/types/components/Forms/TextArea.d.ts +10 -0
  43. package/dist/esm/types/components/Forms/TextInput/PasswordIcon.d.ts +2 -2
  44. package/dist/esm/types/components/Forms/TextInput/TextInput.d.ts +3 -3
  45. package/dist/esm/types/components/Forms/TextInput.d.ts +14 -0
  46. package/dist/esm/types/components/Forms/Toggle.d.ts +8 -0
  47. package/dist/esm/types/components/Modal/Modal.d.ts +3 -3
  48. package/dist/esm/types/components/Modal/ModalBody.d.ts +10 -0
  49. package/dist/esm/types/components/Modal/ModalFooter.d.ts +7 -0
  50. package/dist/esm/types/components/Modal/index.d.ts +3 -0
  51. package/dist/esm/types/components/Popover/index.d.ts +2 -2
  52. package/dist/esm/types/components/Tag/TagLabel.d.ts +14 -0
  53. package/dist/esm/types/components/Tag/index.d.ts +1 -0
  54. package/dist/esm/types/components/TagLabel/index.d.ts +4 -4
  55. package/dist/esm/types/components/Typography/Text.d.ts +7 -0
  56. package/dist/esm/types/stories/Badge/BadgeDemo.stories.d.ts +2 -1
  57. package/dist/esm/types/stories/Badge/BadgeDemoHeading.stories.d.ts +2 -1
  58. package/dist/esm/types/utility/helper.d.ts +3 -0
  59. package/dist/index.d.ts +126 -569
  60. package/package.json +1 -1
package/dist/cjs/index.js CHANGED
@@ -246,9 +246,39 @@ var textClasses = {
246
246
  'tiny-text-bold': 'text-size-tiny font-bold font-["Arial"]',
247
247
  };
248
248
 
249
+ var childrenElement = function (element) {
250
+ if (element === undefined)
251
+ return '';
252
+ if (typeof element === 'object')
253
+ return '';
254
+ return element;
255
+ };
256
+ var validUnion = function (value, union) {
257
+ return union.includes(value) ? value : union[0];
258
+ };
259
+
260
+ var variantUnion$2 = [
261
+ 'large-text',
262
+ 'large-text-semibold',
263
+ 'medium-text',
264
+ 'medium-text-semibold',
265
+ 'caption',
266
+ 'caption-semibold',
267
+ 'normal-text',
268
+ 'normal-text-semilight',
269
+ 'normal-text-semibold',
270
+ 'normal-text-bold',
271
+ 'small-text',
272
+ 'small-text-semibold',
273
+ 'tiny-text',
274
+ 'tiny-text-bold',
275
+ 'script',
276
+ 'link',
277
+ ];
249
278
  function Text(_a) {
250
279
  var _b = _a.extended, extended = _b === void 0 ? '' : _b, variant = _a.variant, children = _a.children;
251
- return (React.createElement("span", { className: "text ".concat(textClasses[variant], " ").concat(extended) }, children));
280
+ var validatedVariant = validUnion(variant, variantUnion$2);
281
+ return (React.createElement("span", { className: "text ".concat(textClasses[validatedVariant], " ").concat(extended) }, childrenElement(children)));
252
282
  }
253
283
  Text.defaultProps = {
254
284
  extended: '',
@@ -380,12 +410,38 @@ var variantConfig$1 = {
380
410
  'danger-outlined': "\n text-bia-red \n border-solid \n border \n border-bia-red \n bg-primary-white \n active:text-bia-red-dark-10 \n active:border-bia-red-active \n active:bg-bia-red-light-90 \n active:border-bia-red-disabled \n hover:text-bia-red-hover \n hover:border-bia-red-hover \n disabled:cursor-not-allowed \n disabled:border-[1px]\n disabled:border-bia-red-light-50 \n disabled:text-bia-red-light-50\n focus-visible:outline-none \n focus-visible:outline-offset-0 \n focus-visible:outline-[3px] \n focus-visible:rounded-md \n focus-visible:outline-bia-red-light-50 \n focus-visible:border-none \n \n ",
381
411
  };
382
412
 
413
+ var variantUnion$1 = [
414
+ 'default',
415
+ 'danger',
416
+ 'info',
417
+ 'link',
418
+ 'primary',
419
+ 'subtle',
420
+ 'subtle-link',
421
+ 'success',
422
+ 'warning',
423
+ 'default-outlined',
424
+ 'danger-outlined',
425
+ 'info-outlined',
426
+ 'primary-outlined',
427
+ 'success-outlined',
428
+ 'warning-outlined',
429
+ ];
430
+ var radiusUnion = ['default', 'full-rounded'];
431
+ var sizeUnion$4 = ['md', 'lg', 'sm', 'tn'];
383
432
  function Button(_a) {
384
433
  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, props = __rest(_a, ["label", "className", "disabled", "radius", "size", "variant", "iconLeft", "iconRight"]);
385
- return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(variantConfig$1[variant], " ").concat(label ? sizeConfig$a[size] : iconOnlySizeConfig[size], " ").concat(radiusConfig[radius][size], " ").concat(className), disabled: disabled }, props),
386
- iconLeft,
387
- label,
388
- iconRight));
434
+ var validatedVariant = validUnion(variant, variantUnion$1);
435
+ var validatedSize = validUnion(size, sizeUnion$4);
436
+ var validatedRadius = validUnion(radius, radiusUnion);
437
+ var sizeClass = label
438
+ ? sizeConfig$a[validatedSize]
439
+ : iconOnlySizeConfig[validatedSize];
440
+ var classString = "\n ".concat(variantConfig$1[validatedVariant], " \n ").concat(sizeClass, " \n ").concat(radiusConfig[validatedRadius][validatedSize], " \n ").concat(className, "\n ");
441
+ return (React.createElement("button", __assign({ type: "button", className: "button flex justify-center items-center ".concat(classString), disabled: disabled }, props),
442
+ childrenElement(iconLeft),
443
+ childrenElement(label),
444
+ childrenElement(iconRight)));
389
445
  }
390
446
  Button.defaultProps = {
391
447
  label: null,
@@ -529,19 +585,17 @@ var variantConfig = {
529
585
  };
530
586
 
531
587
  function Banner(_a) {
532
- var children = _a.children, _b = _a.isCloseable, isCloseable = _b === void 0 ? true : _b, _c = _a.variant, variant = _c === void 0 ? 'black' : _c, isShow = _a.isShow, setIsShow = _a.setIsShow;
533
- if (isShow) {
588
+ var children = _a.children, _b = _a.closeable, closeable = _b === void 0 ? true : _b, _c = _a.variant, variant = _c === void 0 ? 'black' : _c, open = _a.open, onClose = _a.onClose;
589
+ if (open) {
534
590
  return (React.createElement("div", { className: "w-full h-[42px] py-[22px] text-size-base font-semibold flex justify-center items-center text-white relative ".concat(variantConfig[variant].bg) },
535
591
  React.createElement("div", { className: "w-full flex justify-center items-center gap-[10px]" },
536
592
  React.createElement("div", { className: "font-semibold font-segoe text-[14px] leading-[21px]" }, children),
537
- React.createElement("div", { className: "flex items-center justify-center" }, isCloseable && (React.createElement("button", { className: "ml-auto text-xs outline-2 text-white absolute right-4 w-[18px] h-[18px] flex justify-center items-center ".concat(variantConfig[variant].focus), type: "button", onClick: function () {
538
- setIsShow(false);
539
- } },
593
+ React.createElement("div", { className: "flex items-center justify-center" }, closeable && (React.createElement("button", { className: "ml-auto text-xs outline-2 text-white absolute right-4 w-[18px] h-[18px] flex justify-center items-center ".concat(variantConfig[variant].focus), type: "button", onClick: function () { return onClose(false); } },
540
594
  React.createElement(TbX, { className: "text-[18px] ".concat(variantConfig[variant].hover, " ").concat(variantConfig[variant].active) })))))));
541
595
  }
542
596
  }
543
597
  Banner.defaultProps = {
544
- isCloseable: true,
598
+ closeable: true,
545
599
  variant: 'black',
546
600
  };
547
601
 
@@ -1463,8 +1517,8 @@ function ValidationIcon(_a) {
1463
1517
  }
1464
1518
 
1465
1519
  function PasswordIcon(_a) {
1466
- var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, isDisabled = _a.isDisabled;
1467
- var iconColor = isDisabled ? '#8b8ba6' : '#5E5EEA';
1520
+ var isShow = _a.isShow, _b = _a.showHandler, showHandler = _b === void 0 ? function () { } : _b, iconSize = _a.iconSize, disabled = _a.disabled;
1521
+ var iconColor = disabled ? '#8b8ba6' : '#5E5EEA';
1468
1522
  if (isShow) {
1469
1523
  return (React.createElement(TbEye, { onClick: function () { return showHandler(false); }, style: {
1470
1524
  fontSize: iconSize,
@@ -1475,7 +1529,7 @@ function PasswordIcon(_a) {
1475
1529
  }
1476
1530
 
1477
1531
  function TextInput(_a) {
1478
- var descText = _a.descText, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l;
1532
+ var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, icon = _a.icon, _c = _a.id, id = _c === void 0 ? '' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, _e = _a.isValid, isValid = _e === void 0 ? false : _e, label = _a.label, _f = _a.placeholder, placeholder = _f === void 0 ? '' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.variant, variant = _j === void 0 ? 'text' : _j, _k = _a.value, value = _k === void 0 ? '' : _k, _l = _a.onChange, onChange = _l === void 0 ? function () { } : _l;
1479
1533
  var _m = React.useState(false), isShow = _m[0], setIsShow = _m[1];
1480
1534
  var _o = styleConfig[variant], fieldStyle = _o.fieldStyle, iconStyle = _o.iconStyle;
1481
1535
  var _p = sizeConfig$9[size], iconSize = _p.iconSize, fieldSize = _p.fieldSize, iconPosition = _p.iconPosition;
@@ -1484,35 +1538,35 @@ function TextInput(_a) {
1484
1538
  typeVariant = isShow ? 'text' : 'password';
1485
1539
  var isExistValidation = isValid !== null;
1486
1540
  var descColor = 'text-primary-cool';
1487
- if (!isDisabled && isExistValidation && isValid)
1541
+ if (!disabled && isExistValidation && isValid)
1488
1542
  descColor = 'text-bia-green';
1489
- if (!isDisabled && isExistValidation && !isValid)
1543
+ if (!disabled && isExistValidation && !isValid)
1490
1544
  descColor = 'text-bia-red';
1491
1545
  var bottomBorderColor = 'hover:border-b-bia-blue focus:border-b-bia-blue';
1492
- if (!isDisabled && isExistValidation && isValid)
1546
+ if (!disabled && isExistValidation && isValid)
1493
1547
  bottomBorderColor = 'border-b-bia-green';
1494
- if (!isDisabled && isExistValidation && !isValid)
1548
+ if (!disabled && isExistValidation && !isValid)
1495
1549
  bottomBorderColor = 'border-b-bia-red';
1496
1550
  var iconElement = null;
1497
- if (!isDisabled && isExistValidation)
1551
+ if (!disabled && isExistValidation)
1498
1552
  iconElement = React.createElement(ValidationIcon, { isValid: isValid, iconSize: iconSize });
1499
1553
  if (icon)
1500
1554
  iconElement = icon;
1501
1555
  if (variant === 'password') {
1502
- iconElement = (React.createElement(PasswordIcon, { isShow: isShow, showHandler: setIsShow, iconSize: iconSize, isDisabled: isDisabled }));
1556
+ iconElement = (React.createElement(PasswordIcon, { isShow: isShow, showHandler: setIsShow, iconSize: iconSize, disabled: disabled }));
1503
1557
  }
1504
1558
  return (React.createElement("div", { className: "field-group w-full flex flex-col gap-y-2" },
1505
1559
  React.createElement("label", { htmlFor: id, className: "label text-xs font-semibold" },
1506
1560
  label,
1507
1561
  required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
1508
1562
  React.createElement("div", { className: "w-full relative" },
1509
- React.createElement("input", { className: "field bg-primary-white disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active read-only:border-bia-grey-light-50 read-only:pointer-events-none w-full border border-bia-grey-dark-10 disabled:border-bia-grey-dark-10 focus:rounded-b-none hover:rounded-b-none focus-visible:outline-none rounded ".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor), disabled: isDisabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); } }),
1563
+ React.createElement("input", { className: "field bg-primary-white disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active read-only:border-bia-grey-light-50 read-only:pointer-events-none w-full border border-bia-grey-dark-10 disabled:border-bia-grey-dark-10 focus:rounded-b-none hover:rounded-b-none focus-visible:outline-none rounded ".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor), disabled: disabled, id: id, placeholder: placeholder || label, readOnly: readOnly, required: required, type: typeVariant, value: value, onChange: function (e) { return onChange(e); } }),
1510
1564
  React.createElement("div", { className: "absolute inset-y-0 pl-3 flex items-center ".concat(iconStyle, " ").concat(iconPosition) }, iconElement)),
1511
1565
  React.createElement("span", { className: "desc text-xs ".concat(descColor) }, descText)));
1512
1566
  }
1513
1567
  TextInput.defaultProps = {
1514
1568
  descText: '',
1515
- isDisabled: false,
1569
+ disabled: false,
1516
1570
  icon: null,
1517
1571
  id: '',
1518
1572
  size: 'md',
@@ -1546,21 +1600,23 @@ var sizeConfig$8 = {
1546
1600
  },
1547
1601
  };
1548
1602
 
1603
+ var sizeUnion$3 = ['md', 'sm'];
1549
1604
  function Radio(_a) {
1550
- var label = _a.label, _b = _a.size, size = _b === void 0 ? 'md' : _b, id = _a.id, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.checked, checked = _e === void 0 ? false : _e;
1551
- var _f = sizeConfig$8[size], checkSize = _f.checkSize, labelSize = _f.labelSize;
1605
+ var label = _a.label, _b = _a.size, size = _b === void 0 ? 'md' : _b, id = _a.id, _c = _a.onClick, onClick = _c === void 0 ? function () { } : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.checked, checked = _e === void 0 ? false : _e;
1606
+ var validatedSize = validUnion(size, sizeUnion$3);
1607
+ var _f = sizeConfig$8[validatedSize], checkSize = _f.checkSize, labelSize = _f.labelSize;
1552
1608
  return (React.createElement("div", { className: "flex items-center" },
1553
1609
  React.createElement("div", { className: "bg-white rounded-full flex flex-shrink-0 justify-center items-center relative ".concat(checkSize) },
1554
- React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "peer checkbox box-content appearance-none focus:opacity-100 focus:ring-1 focus:ring-offset-2 checked:disabled:border-bia-blue-disabled focus:ring-bia-blue focus:outline-none rounded-full border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover disabled:border-bia-grey-dark-10 border-2 absolute cursor-pointer w-full h-full", onClick: function (e) { return onClick(e); }, checked: checked, disabled: isDisabled }),
1610
+ React.createElement("input", { id: id, "aria-labelledby": "label1", type: "radio", className: "peer checkbox box-content appearance-none focus:opacity-100 focus:ring-1 focus:ring-offset-2 checked:disabled:border-bia-blue-disabled focus:ring-bia-blue focus:outline-none rounded-full border-bia-coolgrey-light-50 checked:border-bia-blue hover:border-bia-blue-hover disabled:border-bia-grey-dark-10 border-2 absolute cursor-pointer w-full h-full", onClick: function (e) { return onClick(e); }, checked: checked, disabled: disabled }),
1555
1611
  React.createElement("div", { className: "check-icon flex text-bia-grey group justify-center border-2 border-primary-white peer-disabled:bg-bia-grey-light-80 peer-disabled:border-transparent peer-disabled:peer-checked:border-primary-white peer-checked:peer-disabled:bg-bia-blue-disabled peer-checked:hover:border-bia-blue-hover peer-checked:bg-bia-blue peer-checked:peer-hover:bg-bia-blue-hover outline-2 peer-checked:hover:outline-bia-blue-hover outline-bia-blue rounded-full w-full h-full z-1" })),
1556
- React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 font-[350] ".concat(labelSize), style: { color: isDisabled ? '#8C8CA6' : '#2f2f2f' } }, label)));
1612
+ React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 font-[350] ".concat(labelSize), style: { color: disabled ? '#8C8CA6' : '#2f2f2f' } }, childrenElement(label))));
1557
1613
  }
1558
1614
  Radio.defaultProps = {
1559
1615
  label: '',
1560
1616
  size: 'md',
1561
1617
  id: '',
1562
1618
  onClick: function () { },
1563
- isDisabled: false,
1619
+ disabled: false,
1564
1620
  checked: false,
1565
1621
  };
1566
1622
 
@@ -1607,16 +1663,17 @@ var sizeConfig$6 = {
1607
1663
  },
1608
1664
  };
1609
1665
 
1666
+ var sizeUnion$2 = ['md', 'sm'];
1610
1667
  function Checkbox(_a) {
1611
1668
  var _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, _d = _a.checked, checked = _d === void 0 ? false : _d, label = _a.label, _e = _a.onChange, onChange = _e === void 0 ? function () { } : _e, value = _a.value;
1612
- var _f = sizeConfig$6[size], checkClass = _f.checkClass, labelClass = _f.labelClass;
1669
+ var _f = sizeConfig$6[validUnion(size, sizeUnion$2)], checkClass = _f.checkClass, labelClass = _f.labelClass;
1613
1670
  return (React.createElement("div", { className: "flex items-center" },
1614
1671
  React.createElement("div", { className: "bg-white rounded-full flex flex-shrink-0 justify-center items-center relative ".concat(checkClass) },
1615
1672
  React.createElement("input", { id: id, type: "checkbox", className: "peer checkbox box-content appearance-none focus-visible:opacity-100 focus-visible:ring-1 focus-visible:ring-offset-2 focus-visible:ring-bia-blue focus-visible:outline-none rounded-full border-bia-coolgrey-light-50 checked:border-bia-blue disabled:border-bia-coolgrey-light-50 hover:border-bia-blue-hover disabled:checked:border-bia-blue-light-50 border-2 absolute cursor-pointer w-full h-full", checked: checked, onChange: function (e) { return onChange(e); }, disabled: disabled, value: value }),
1616
1673
  React.createElement("div", { className: "check-icon flex text-bia-grey group justify-center peer-checked:border-2 peer-checked:border-primary-white peer-checked:hover:border-bia-blue-hover peer-checked:bg-bia-blue peer-checked:peer-hover:bg-bia-blue-hover outline-2 peer-checked:hover:outline-bia-blue-hover outline-bia-blue peer-disabled:bg-bia-grey-light-80 peer-disabled:peer-checked:outline-bia-blue-light-50 peer-disabled:peer-checked:bg-bia-blue-light-50 rounded-full w-full h-full z-1" },
1617
1674
  React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", className: " fill-bia-grey-dark-10 peer-checked:group-[]:fill-primary-white peer-checked:peer-hover:group-[]:fill-primary-white peer-hover:group-[]:fill-bia-blue-hover peer-disabled:group-[]:fill-bia-grey-dark-10 peer-disabled:peer-checked:group-[]:fill-primary-white", viewBox: "-5 -7 24 24", width: "24" },
1618
1675
  React.createElement("path", { d: "M5.486 9.73a.997.997 0 0 1-.707-.292L.537 5.195A1 1 0 1 1 1.95 3.78l3.535 3.535L11.85.952a1 1 0 0 1 1.415 1.414L6.193 9.438a.997.997 0 0 1-.707.292z" })))),
1619
- React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 text-grey-800 ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, label)));
1676
+ React.createElement("label", { htmlFor: id, className: "ml-2 leading-4 text-grey-800 ".concat(labelClass), style: { color: disabled ? '#8C8CA6' : '' } }, childrenElement(label))));
1620
1677
  }
1621
1678
  Checkbox.defaultProps = {
1622
1679
  disabled: false,
@@ -1709,10 +1766,12 @@ DefaultDropdownItem.defaultProps = {
1709
1766
  };
1710
1767
 
1711
1768
  /* eslint-disable @typescript-eslint/no-explicit-any */
1769
+ var sizeUnion$1 = ['md', 'sm'];
1712
1770
  function SelectInput(_a) {
1713
- var descText = _a.descText, _b = _a.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, id = _a.id, label = _a.label, options = _a.options, _d = _a.isRequired, isRequired = _d === void 0 ? false : _d, selected = _a.selected, setSelected = _a.setSelected;
1771
+ 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, label = _a.label, options = _a.options, _d = _a.required, required = _d === void 0 ? false : _d, selected = _a.selected, setSelected = _a.setSelected;
1714
1772
  var _e = React.useState(false), isOpen = _e[0], setIsOpen = _e[1];
1715
- var _f = sizeConfig$5[size], searchSize = _f.searchSize, iconSize = _f.iconSize;
1773
+ var validatedSize = validUnion(size, sizeUnion$1);
1774
+ var _f = sizeConfig$5[validatedSize], searchSize = _f.searchSize, iconSize = _f.iconSize;
1716
1775
  var inputRef = React.useRef(null);
1717
1776
  var handleOutsideClick = function (e) {
1718
1777
  if (inputRef.current && !inputRef.current.contains(e.target)) {
@@ -1727,14 +1786,14 @@ function SelectInput(_a) {
1727
1786
  });
1728
1787
  return (React.createElement("div", { className: "field-group w-full flex flex-col", ref: inputRef },
1729
1788
  React.createElement("label", { htmlFor: id, className: "label text-xs pb-2 font-semibold" },
1730
- label,
1731
- isRequired && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
1789
+ childrenElement(label),
1790
+ required && React.createElement("span", { className: "p-1 text-bia-red" }, "*")),
1732
1791
  React.createElement("div", { className: "group w-full relative" },
1733
- React.createElement("input", { className: "field bg-primary-white disabled:bg-bia-grey-light-80 pe-8 w-full border border-bia-grey-dark-10 enabled:hover:border-b-bia-blue enabled:hover:rounded-b-none enabled:focus:border-b-bia-blue enabled:focus:rounded-b-none focus-visible:outline-none cursor-pointer rounded disabled:text-bia-coolgrey peer ".concat(searchSize), onClick: function () { return setIsOpen(!isOpen); }, value: selected === null || selected === void 0 ? void 0 : selected.label, readOnly: true, id: id, disabled: isDisabled }),
1792
+ React.createElement("input", { className: "field bg-primary-white disabled:bg-bia-grey-light-80 pe-8 w-full border border-bia-grey-dark-10 enabled:hover:border-b-bia-blue enabled:hover:rounded-b-none enabled:focus:border-b-bia-blue enabled:focus:rounded-b-none focus-visible:outline-none cursor-pointer rounded disabled:text-bia-coolgrey peer ".concat(searchSize), onClick: function () { return setIsOpen(!isOpen); }, value: selected === null || selected === void 0 ? void 0 : selected.label, readOnly: true, id: id, disabled: disabled }),
1734
1793
  React.createElement("div", { className: "absolute inset-y-0 pl-3 flex items-center pointer-events-none text-bia-coolgrey peer-disabled:text-bia-coolgrey-light-50 ".concat(iconSize) }, isOpen ? (React.createElement(TbChevronUp, { className: "" })) : (React.createElement(TbChevronDown, { className: "" }))),
1735
1794
  isOpen && (React.createElement("div", { className: "absolute border w-full bg-primary-white border-bia-grey-dark-10 rounded-b-md shadow-lg z-10" }, options.map(function (option) {
1736
1795
  var isSelected = selected && selected.id && option.id === selected.id;
1737
- return (React.createElement(DefaultDropdownItem, { label: option.label, size: size, isSelected: isSelected, onClick: function () {
1796
+ return (React.createElement(DefaultDropdownItem, { label: option.label, size: validatedSize, isSelected: isSelected, onClick: function () {
1738
1797
  setSelected(option);
1739
1798
  setIsOpen(false);
1740
1799
  } }));
@@ -1743,11 +1802,11 @@ function SelectInput(_a) {
1743
1802
  }
1744
1803
  SelectInput.defaultProps = {
1745
1804
  descText: '',
1746
- isDisabled: false,
1805
+ disabled: false,
1747
1806
  id: '',
1748
1807
  size: 'md',
1749
1808
  label: '',
1750
- isRequired: false,
1809
+ required: false,
1751
1810
  selected: {},
1752
1811
  setSelected: function () { },
1753
1812
  };
@@ -1913,33 +1972,33 @@ function SegmentButtonSimulation(_a) {
1913
1972
  var SegmentButtonArr = [
1914
1973
  {
1915
1974
  content: 'Segment Button A',
1916
- isDisabled: false,
1975
+ disabled: false,
1917
1976
  handleClick: function (index) { return setActiveButton(index); },
1918
1977
  },
1919
1978
  {
1920
1979
  content: 'Segment Button B',
1921
- isDisabled: false,
1980
+ disabled: false,
1922
1981
  handleClick: function (index) { return setActiveButton(index); },
1923
1982
  },
1924
1983
  {
1925
1984
  content: 'Segment Button C (Disabled)',
1926
- isDisabled: true,
1985
+ disabled: true,
1927
1986
  handleClick: function (index) { return setActiveButton(index); },
1928
1987
  },
1929
1988
  {
1930
1989
  content: 'Segment Button D',
1931
- isDisabled: false,
1990
+ disabled: false,
1932
1991
  handleClick: function (index) { return setActiveButton(index); },
1933
1992
  },
1934
1993
  {
1935
1994
  content: 'Segment Button E',
1936
- isDisabled: false,
1995
+ disabled: false,
1937
1996
  handleClick: function (index) { return setActiveButton(index); },
1938
1997
  },
1939
1998
  ];
1940
1999
  return (React.createElement(SegmentButtonGroup, null, SegmentButtonArr.map(function (_a, index) {
1941
- var content = _a.content, isDisabled = _a.isDisabled, handleClick = _a.handleClick;
1942
- return (React.createElement(SegmentButtonItem, { active: activeButton === index, size: size, disabled: isDisabled, onClick: function () { return handleClick(index); } },
2000
+ var content = _a.content, disabled = _a.disabled, handleClick = _a.handleClick;
2001
+ return (React.createElement(SegmentButtonItem, { selected: activeButton === index, size: size, disabled: disabled, onClick: function () { return handleClick(index); } },
1943
2002
  React.createElement("div", { className: "flex items-center justify-center" },
1944
2003
  React.createElement("div", { className: "mt-[1px] mr-[5px]" },
1945
2004
  React.createElement(TbCheck$1, null)),
@@ -1948,7 +2007,7 @@ function SegmentButtonSimulation(_a) {
1948
2007
  }
1949
2008
 
1950
2009
  function Modal(_a) {
1951
- var size = _a.size, title = _a.title, isShow = _a.isShow, setIsShow = _a.setIsShow, rest = __rest(_a, ["size", "title", "isShow", "setIsShow"]);
2010
+ var size = _a.size, title = _a.title, open = _a.open, onClose = _a.onClose, rest = __rest(_a, ["size", "title", "open", "onClose"]);
1952
2011
  var modalSize;
1953
2012
  if (size === 'sm') {
1954
2013
  modalSize = 'w-[300px]';
@@ -1964,19 +2023,17 @@ function Modal(_a) {
1964
2023
  }
1965
2024
  var handleClose = function (e) {
1966
2025
  if (e && e.target && e.target.id === 'wrapper') {
1967
- setIsShow(false);
2026
+ onClose();
1968
2027
  }
1969
2028
  };
1970
- if (isShow) {
2029
+ if (open) {
1971
2030
  return (
1972
2031
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
1973
2032
  React.createElement("div", { className: "fixed inset-0 flex justify-center items-center bg-bia-black-transparent-75", id: "wrapper", onClick: handleClose },
1974
2033
  React.createElement("div", { className: "modal flex flex-col gap-[20px] bg-white rounded-[5px] p-[20px] ".concat(modalSize) },
1975
2034
  React.createElement("div", { className: "flex justify-between" },
1976
2035
  React.createElement("div", { className: " font-humnst777 font-bold text-[18px] leading-[21.85px] text-primary-black w-[260px] text-wrap" }, title),
1977
- React.createElement("button", { type: "button", title: "button", className: "w-[22px] h-[22px] rounded-radius-full flex items-center justify-center bg-bia-grey-light-50 hover:bg-bia-grey-light-30 cursor-pointer", onClick: function () {
1978
- setIsShow(false);
1979
- } },
2036
+ React.createElement("button", { type: "button", title: "button", className: "w-[22px] h-[22px] rounded-radius-full flex items-center justify-center bg-bia-grey-light-50 hover:bg-bia-grey-light-30 cursor-pointer", onClick: function () { return onClose(); } },
1980
2037
  React.createElement(TbX, { className: "text-bia-coolgrey text-[14px]" }))),
1981
2038
  React.createElement("div", { className: "flex flex-col gap-[20px]" }, rest.children))));
1982
2039
  }
@@ -2096,16 +2153,16 @@ var classConfig$1 = {
2096
2153
  };
2097
2154
 
2098
2155
  function Popover(_a) {
2099
- var children = _a.children, content = _a.content, _b = _a.delay, delay = _b === void 0 ? 400 : _b, _c = _a.direction, direction = _c === void 0 ? 'bottom' : _c, _d = _a.title, title = _d === void 0 ? '' : _d, open = _a.open, setIsActive = _a.setIsActive;
2156
+ var children = _a.children, content = _a.content, _b = _a.delay, delay = _b === void 0 ? 400 : _b, _c = _a.direction, direction = _c === void 0 ? 'bottom' : _c, _d = _a.title, title = _d === void 0 ? '' : _d, open = _a.open, setOpen = _a.setOpen;
2100
2157
  var timeout;
2101
2158
  var showPopover = function () {
2102
2159
  timeout = setTimeout(function () {
2103
- setIsActive(true);
2160
+ setOpen(true);
2104
2161
  }, delay);
2105
2162
  };
2106
2163
  var hidePopover = function () {
2107
2164
  clearInterval(timeout);
2108
- setIsActive(false);
2165
+ setOpen(false);
2109
2166
  };
2110
2167
  var _e = classConfig$1[direction], tooltipContainer = _e.tooltipContainer, triangleContainer = _e.triangleContainer, triangleShape = _e.triangleShape;
2111
2168
  return (React.createElement("div", { className: "Popover-Wrapper relative block w-fit h-fit", onMouseEnter: showPopover, onMouseLeave: hidePopover },
@@ -3134,10 +3191,25 @@ CloseIcon.defaultProps = {
3134
3191
  size: 'md',
3135
3192
  };
3136
3193
 
3194
+ var colorUnion = [
3195
+ 'default',
3196
+ 'blue',
3197
+ 'teal',
3198
+ 'green',
3199
+ 'yellow',
3200
+ 'red',
3201
+ 'black',
3202
+ 'white',
3203
+ ];
3204
+ var sizeUnion = ['md', 'sm', 'tn'];
3205
+ var variantUnion = ['label', 'icon', 'closeable'];
3137
3206
  function TagLabel(_a) {
3138
- var children = _a.children, _b = _a.closeHandler, closeHandler = _b === void 0 ? undefined : _b, _c = _a.size, size = _c === void 0 ? 'sm' : _c, _d = _a.variant, variant = _d === void 0 ? 'label' : _d, isShow = _a.isShow, color = _a.color, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon;
3139
- var config = TagLabelConfig[color][size][variant];
3140
- var configIcon = TagLabelConfig[color][size];
3207
+ var text = _a.text, _b = _a.closeHandler, closeHandler = _b === void 0 ? undefined : _b, _c = _a.size, size = _c === void 0 ? 'sm' : _c, _d = _a.variant, variant = _d === void 0 ? 'label' : _d, open = _a.open, color = _a.color, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon;
3208
+ var validatedColor = validUnion(color, colorUnion);
3209
+ var validatedSize = validUnion(size, sizeUnion);
3210
+ var validatedVariant = validUnion(variant, variantUnion);
3211
+ var config = TagLabelConfig[validatedColor][validatedSize][validatedVariant];
3212
+ var configIcon = TagLabelConfig[validatedColor][validatedSize];
3141
3213
  var configbg = config.bg;
3142
3214
  var configtext = config.text;
3143
3215
  var configpadding = config.padding;
@@ -3157,70 +3229,71 @@ function TagLabel(_a) {
3157
3229
  }
3158
3230
  var IconComponent = icon;
3159
3231
  var textSize;
3160
- if (size === 'md') {
3232
+ if (validatedSize === 'md') {
3161
3233
  textSize = 'text-[20px]';
3162
3234
  }
3163
- else if (size === 'sm' || size === 'tn') {
3235
+ else if (validatedSize === 'sm' || validatedSize === 'tn') {
3164
3236
  textSize = 'text-[14px]';
3165
3237
  }
3166
3238
  else {
3167
3239
  textSize = 'text-[14px]';
3168
3240
  }
3169
3241
  var fillColor;
3170
- if (color === 'blue') {
3242
+ if (validatedColor === 'blue') {
3171
3243
  fillColor = '#5d5dea';
3172
3244
  }
3173
- else if (color === 'green') {
3245
+ else if (validatedColor === 'green') {
3174
3246
  fillColor = '#21ba4c';
3175
3247
  }
3176
- else if (color === 'teal') {
3248
+ else if (validatedColor === 'teal') {
3177
3249
  fillColor = '#00b5ad';
3178
3250
  }
3179
- else if (color === 'yellow') {
3251
+ else if (validatedColor === 'yellow') {
3180
3252
  fillColor = '#ff7b00';
3181
3253
  }
3182
- else if (color === 'red') {
3254
+ else if (validatedColor === 'red') {
3183
3255
  fillColor = '#db2828';
3184
3256
  }
3185
- else if (color === 'black') {
3257
+ else if (validatedColor === 'black') {
3186
3258
  fillColor = '#2f2f2f';
3187
3259
  }
3188
3260
  else {
3189
3261
  fillColor = '#ffffff';
3190
3262
  }
3191
- return (React.createElement(IconComponent, { className: "".concat(textSize, " ").concat(variant === 'icon' ? configXcolor : configXcolorV), color: fillColor }));
3263
+ return (React.createElement(IconComponent, { className: "".concat(textSize, " ").concat(validatedVariant === 'icon' ? configXcolor : configXcolorV), color: fillColor }));
3192
3264
  };
3193
3265
  // const containerClass = `${container} ${capitalize && 'capitalize'}`;
3194
3266
  // const closeableMode = variant === 'closeable';
3195
3267
  // const iconMode = variant === 'icon';
3196
3268
  var closeButtonException;
3197
- if (size === 'md') {
3269
+ if (validatedSize === 'md') {
3198
3270
  closeButtonException = '-mr-[2px]';
3199
3271
  }
3200
3272
  else {
3201
3273
  closeButtonException = '-mr-[5px]';
3202
3274
  }
3203
3275
  var outlineColor;
3204
- if (color === 'default' || color === 'white') {
3276
+ if (validatedColor === 'default' || validatedColor === 'white') {
3205
3277
  outlineColor = 'outline-primary-black';
3206
3278
  }
3207
3279
  else {
3208
3280
  outlineColor = 'outline-white';
3209
3281
  }
3210
- if (!isShow)
3282
+ if (!open)
3211
3283
  return null;
3212
3284
  return (React.createElement("div", { className: "flex items-center font-segoe font-normal justify-center ".concat(configradius, " ").concat(configtext, " ").concat(configbg, " ").concat(configpadding) },
3213
- variant === 'icon' ? (React.createElement("div", { className: "flex justify-center items-center ".concat(IconContainer[size]) }, leftIcon || renderIcon(configX))) : (React.createElement(React.Fragment, null,
3214
- React.createElement("span", null, leftIcon),
3215
- React.createElement("div", { className: "flex justify-center items-center ".concat(size === 'md' && 'min-h-[20px] px-[5px]', " ").concat(size === 'sm' && 'min-h-[18px] px-[3px]', " ").concat(size === 'tn' && 'min-h-[14px] px-[3px] -mt-[2px]') }, children))),
3216
- variant === 'label' && rightIcon && (React.createElement("div", { className: "flex justify-center items-center ".concat(IconContainer[size]) }, rightIcon)),
3217
- variant === 'closeable' && closeHandler && (React.createElement("button", { type: "button", className: "flex justify-center items-center ".concat(size === 'tn' ? 'p-[1px]' : 'p-[2px]', " ").concat(outlineColor, " ").concat(iconColor, " ").concat(color === 'white' || color === 'default' ? 'bg-black/[.3]' : 'bg-white/[.5]', " focus:outline ").concat(size === 'tn' ? 'outline-[1.5px]' : 'outline-[2px]', " ").concat(closeButtonException, " rounded-full group"), onClick: function () { return closeHandler(); } },
3218
- React.createElement(CloseIcon, { size: size })))));
3285
+ validatedVariant === 'icon' ? (React.createElement("div", { className: "flex justify-center items-center ".concat(IconContainer[validatedSize]) }, childrenElement(leftIcon) ||
3286
+ renderIcon(configX))) : (React.createElement(React.Fragment, null,
3287
+ React.createElement("span", null, childrenElement(leftIcon)),
3288
+ React.createElement("div", { className: "flex justify-center items-center ".concat(validatedSize === 'md' && 'min-h-[20px] px-[5px]', " ").concat(validatedSize === 'sm' && 'min-h-[18px] px-[3px]', " ").concat(validatedSize === 'tn' && 'min-h-[14px] px-[3px] -mt-[2px]') }, childrenElement(text)))),
3289
+ validatedVariant === 'label' && rightIcon && (React.createElement("div", { className: "flex justify-center items-center ".concat(IconContainer[validatedSize]) }, childrenElement(rightIcon))),
3290
+ validatedVariant === 'closeable' && closeHandler && (React.createElement("button", { type: "button", className: "flex justify-center items-center ".concat(validatedSize === 'tn' ? 'p-[1px]' : 'p-[2px]', " ").concat(outlineColor, " ").concat(iconColor, " ").concat(validatedColor === 'white' || validatedColor === 'default' ? 'bg-black/[.3]' : 'bg-white/[.5]', " focus:outline ").concat(validatedSize === 'tn' ? 'outline-[1.5px]' : 'outline-[2px]', " ").concat(closeButtonException, " rounded-full group"), onClick: function () { return closeHandler(); } },
3291
+ React.createElement(CloseIcon, { size: validatedSize })))));
3219
3292
  }
3220
3293
  TagLabel.defaultProps = {
3221
3294
  variant: 'default',
3222
3295
  size: 'sm',
3223
- isShow: true,
3296
+ open: true,
3224
3297
  closeHandler: function () { },
3225
3298
  rightIcon: null,
3226
3299
  leftIcon: null,