bianic-ui 1.9.0-beta.2 → 1.9.0

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 (29) hide show
  1. package/dist/cjs/index.js +61 -15
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Forms/TextInput/index.d.ts +1 -0
  4. package/dist/cjs/types/components/Progress/Bar/index.d.ts +3 -1
  5. package/dist/cjs/types/components/Window/index.d.ts +3 -4
  6. package/dist/cjs/types/components/index.d.ts +1 -0
  7. package/dist/cjs/types/stories/Button/Button.stories.d.ts +1 -1
  8. package/dist/cjs/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +38 -0
  9. package/dist/cjs/types/stories/Form/SelectInput/SelectInput.stories.d.ts +0 -1
  10. package/dist/cjs/types/stories/Progress/Bar/ProgressBar.stories.d.ts +2 -0
  11. package/dist/cjs/types/stories/Window/Window.stories.d.ts +2 -1
  12. package/dist/esm/index.js +61 -16
  13. package/dist/esm/lib.css +1 -1
  14. package/dist/esm/types/components/Forms/TextInput/index.d.ts +1 -0
  15. package/dist/esm/types/components/Progress/Bar/index.d.ts +3 -1
  16. package/dist/esm/types/components/Window/index.d.ts +3 -4
  17. package/dist/esm/types/components/index.d.ts +1 -0
  18. package/dist/esm/types/stories/Button/Button.stories.d.ts +1 -1
  19. package/dist/esm/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +38 -0
  20. package/dist/esm/types/stories/Form/SelectInput/SelectInput.stories.d.ts +0 -1
  21. package/dist/esm/types/stories/Progress/Bar/ProgressBar.stories.d.ts +2 -0
  22. package/dist/esm/types/stories/Window/Window.stories.d.ts +2 -1
  23. package/dist/index.d.ts +12 -2
  24. package/package.json +5 -6
  25. package/src/style/scrollbar.css +9 -1
  26. package/dist/cjs/types/stories/Form/LiveSearch/LiveSearch.stories.d.ts +0 -15
  27. package/dist/cjs/types/stories/Menu/MenuContainer.stories.d.ts +0 -13
  28. package/dist/esm/types/stories/Form/LiveSearch/LiveSearch.stories.d.ts +0 -15
  29. package/dist/esm/types/stories/Menu/MenuContainer.stories.d.ts +0 -13
package/dist/cjs/index.js CHANGED
@@ -90,6 +90,8 @@ function TbCircleCheckFilled (props) {
90
90
  return GenIcon({"tag":"svg","attr":{"viewBox":"0 0 24 24","fill":"currentColor"},"child":[{"tag":"path","attr":{"d":"M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z"},"child":[]}]})(props);
91
91
  }function TbAlertTriangle (props) {
92
92
  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);
93
+ }function TbCalendar (props) {
94
+ 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);
93
95
  }function TbCheck (props) {
94
96
  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 12l5 5l10 -10"},"child":[]}]})(props);
95
97
  }function TbChevronDown (props) {
@@ -1875,6 +1877,8 @@ function TextInput(_a) {
1875
1877
  if (variant === 'password') {
1876
1878
  iconElement = (React.createElement(PasswordIcon, { isShow: isShow, showHandler: setIsShow, iconSize: iconSize, disabled: disabled }));
1877
1879
  }
1880
+ if (variant === 'date')
1881
+ iconElement = React.createElement(TbCalendar, { className: "text-bia-coolgrey", size: 18 });
1878
1882
  var extendedInputClassName = "".concat(fieldStyle, " ").concat(fieldSize, " ").concat(bottomBorderColor, " ").concat(inputClassName, " ").concat(borderStyle);
1879
1883
  var labelStatus = readOnly ? 'read-only:pointer-events-none' : '';
1880
1884
  return (React.createElement("div", { className: "bianic-text-input-container bianic-fgc-container flex w-full flex-col gap-y-2 text-bia-black" },
@@ -2370,7 +2374,7 @@ function LiveSearch(_a) {
2370
2374
  React.createElement("div", { className: "absolute inset-y-0 z-20 hidden pl-3 group-hover:block ".concat(iconClass) },
2371
2375
  React.createElement("button", { onClick: function () { return setValue({ id: null, label: '' }); }, className: "flex h-full w-full items-center" },
2372
2376
  React.createElement(TbX, { className: "text-primary-black", style: { fontSize: iconSize } }))),
2373
- children !== undefined && isOpen && (React.createElement("div", { className: "border-grey-100 absolute z-10 max-h-60 w-full overflow-y-auto rounded-b-md border bg-primary-white shadow-lg", onClick: onClickDropdown }, filteredOptions.map(function (option) {
2377
+ children === undefined && isOpen && (React.createElement("div", { className: "border-grey-100 absolute z-10 max-h-60 w-full overflow-y-auto rounded-b-md border bg-primary-white shadow-lg", onClick: onClickDropdown }, filteredOptions.map(function (option) {
2374
2378
  var isSelected = value && value.id && option.id === value.id;
2375
2379
  return option.custom ? (React.createElement(CustomDropdownItem, { size: size, isSelected: isSelected, className: dropdownClassName, onClick: function () {
2376
2380
  setValue(option);
@@ -2906,35 +2910,49 @@ var SpinnerIcon = function (_a) {
2906
2910
 
2907
2911
  var config = {
2908
2912
  success: {
2909
- progress: 'bg-bia-green',
2913
+ progress: 'bg-bia-green outline-bia-green',
2910
2914
  statusIcon: React.createElement(TbCircleCheckFilled, { className: "text-[16px] text-bia-green" }),
2911
2915
  },
2912
2916
  failed: {
2913
- progress: 'bg-bia-red',
2917
+ progress: 'bg-bia-red outline-bia-red',
2914
2918
  statusIcon: React.createElement(TbPlaystationX, { className: "text-[16px] text-bia-red" }),
2915
2919
  },
2916
2920
  loading: {
2917
- progress: 'bg-bia-blue',
2921
+ progress: 'bg-bia-blue outline-bia-blue ',
2918
2922
  statusIcon: React.createElement(SpinnerIcon, { className: "text-[16px] text-bia-grey-dark-10" }),
2919
2923
  },
2920
2924
  };
2921
2925
 
2922
2926
  function ProgressBar(_a) {
2923
- var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.percentage, percentage = _c === void 0 ? 0 : _c, caption = _a.caption, _d = _a.variant, variant = _d === void 0 ? 'loading' : _d;
2924
- var persentageVal = percentage;
2927
+ var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.percentage, percentage = _c === void 0 ? 0 : _c, caption = _a.caption, _d = _a.variant, variant = _d === void 0 ? 'loading' : _d, _e = _a.icon, icon = _e === void 0 ? true : _e, barColor = _a.barColor;
2928
+ var percentageVal = percentage;
2929
+ if (percentageVal === 0)
2930
+ percentageVal = 0.5;
2925
2931
  if (percentage > 100)
2926
- persentageVal = 100;
2927
- var _e = config[variant], progress = _e.progress, statusIcon = _e.statusIcon;
2932
+ percentageVal = 100;
2933
+ var _f = config[variant], progress = _f.progress, statusIcon = _f.statusIcon;
2934
+ var barColorRules = barColor
2935
+ ? "outline-bia-".concat(barColor, " bg-bia-").concat(barColor)
2936
+ : progress; // Use the provided barColor or fallback to the default progress color
2937
+ var iconElement = null;
2938
+ if (icon) {
2939
+ if (typeof icon === 'boolean') {
2940
+ iconElement = statusIcon; // Use the default icon based on the variant
2941
+ }
2942
+ else {
2943
+ iconElement = icon; // Use the provided icon
2944
+ }
2945
+ }
2928
2946
  return (React.createElement("div", { className: "bianic-progress-bar-container flex w-[320px] flex-col rounded-radius-lg bg-bia-grey-light-80 p-[10px] " },
2929
2947
  React.createElement("div", { className: "flex items-center justify-between text-primary-black" },
2930
2948
  React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-title" }, title),
2931
2949
  React.createElement("div", { className: "flex gap-1" },
2932
- React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-persentage" },
2933
- persentageVal,
2950
+ React.createElement(Text, { variant: "small-text-semibold", extended: "bianic-progress-bar-percentage" },
2951
+ percentage,
2934
2952
  "%"),
2935
- statusIcon)),
2953
+ iconElement)),
2936
2954
  React.createElement("div", { className: "bianic-progress-bar mb-1 mt-2 w-full rounded-radius-lg bg-bia-white p-[3px]" },
2937
- React.createElement("div", { className: "h-1 w-full rounded-radius-lg ".concat(progress), style: { width: "".concat(persentageVal, "%") } })),
2955
+ React.createElement("div", { className: "h-[1px] rounded-radius-lg outline outline-[1.5px] ".concat(barColorRules), style: { width: "".concat(percentageVal, "%") } })),
2938
2956
  caption && (React.createElement(Text, { variant: "small-text-semibold", extended: "text-bia-coolgrey-dark-10" }, caption))));
2939
2957
  }
2940
2958
 
@@ -3109,7 +3127,7 @@ var alternativeConfigs = {
3109
3127
  false: 'cursor-pointer bg-bia-verdantgreen-dark-40 hover:bg-bia-verdantgreen-dark-50 text-primary-white overflow-hidden',
3110
3128
  };
3111
3129
  var alternativeButtonConfigs = {
3112
- true: 'absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
3130
+ true: 'absolute px-[5px] opacity-0 group-hover/container:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-primary-white from-50% to-primary-white/[.0] inset-y-0 right-0',
3113
3131
  false: ' absolute px-[5px] opacity-0 hover:opacity-100 grid-cols-2 gap-[2px] bg-gradient-to-l from-bia-verdantgreen-dark-50 from-50% to-bia-verdantgreen-dark-50/[.0] inset-y-0 right-0',
3114
3132
  };
3115
3133
  var actionButtonConfig = {
@@ -3138,11 +3156,11 @@ var TabMenu = function (_a) {
3138
3156
  usedButtonConfig = defaultButtonConfigs[isActive];
3139
3157
  usedActionButtonConfig = '';
3140
3158
  }
3141
- return (React.createElement("div", __assign({ className: "tab-menu flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(usedBaseConfig, " ").concat(rest.className) }, rest),
3159
+ return (React.createElement("div", __assign({ className: "tab-menu group/container flex flex-row font-arial text-size-tiny font-normal ".concat(radiusConfig[validatedRadius], " ").concat(variantConfig[validatedVariant], " ").concat(usedBaseConfig, " ").concat(rest.className) }, rest),
3142
3160
  text,
3143
3161
  React.createElement("div", { className: "grid ".concat(usedButtonConfig, " ") },
3144
3162
  validatedVariant === 'alternative' && React.createElement("div", { className: "order-first" }),
3145
- React.createElement("button", { className: "group order-last ", onClick: onClose },
3163
+ React.createElement("button", { className: "group order-last", onClick: onClose },
3146
3164
  React.createElement(TbX, { className: "rounded-radius-sm ".concat(usedActionButtonConfig), size: 14 })))));
3147
3165
  };
3148
3166
 
@@ -3444,6 +3462,33 @@ function Toaster(_a) {
3444
3462
  React.createElement(TbX, { size: 14 })))));
3445
3463
  }
3446
3464
 
3465
+ function Window(_a) {
3466
+ var _b = _a.size, size = _b === void 0 ? 'sm' : _b, title = _a.title; _a.zIndex; var onClose = _a.onClose, rest = __rest(_a, ["size", "title", "zIndex", "onClose"]);
3467
+ var windowSize;
3468
+ // sizing logic
3469
+ switch (size) {
3470
+ case 'sm':
3471
+ windowSize = 'w-[300px]';
3472
+ break;
3473
+ case 'md':
3474
+ windowSize = 'w-[540px]';
3475
+ break;
3476
+ case 'lg':
3477
+ windowSize = 'w-[800px]';
3478
+ break;
3479
+ case 'xl':
3480
+ windowSize = 'w-[1140px]';
3481
+ break;
3482
+ default:
3483
+ windowSize = 'w-[540px]';
3484
+ }
3485
+ return (React.createElement("div", { className: "bianic-window drag-handle flex flex-col gap-[20px] rounded-[5px] bg-white ".concat(windowSize, " shadow-[0px_3px_20px_0px_rgba(0,0,0,0.10)]") },
3486
+ React.createElement("div", { className: "bianic-window-header flex cursor-move justify-between px-[20px] pt-[20px]" },
3487
+ React.createElement("div", { className: " text-wrap text-left font-humnst777 text-[18px] font-bold leading-[21.85px] text-primary-black" }, title),
3488
+ React.createElement(Button, { variant: "subtle", radius: "full-rounded", iconLeft: React.createElement(TbX, null), size: "tn", onClick: function () { return onClose(); } })),
3489
+ React.createElement("div", { className: "bianic-window-content flex w-full flex-col items-start gap-[20px] px-[20px] pb-[20px] text-primary-black" }, rest.children)));
3490
+ }
3491
+
3447
3492
  exports.Accordions = Accordions;
3448
3493
  exports.Alert = Alert;
3449
3494
  exports.Avatar = Avatar;
@@ -3514,3 +3559,4 @@ exports.TextInput = TextInput;
3514
3559
  exports.Toaster = Toaster;
3515
3560
  exports.Toggle = Toggle;
3516
3561
  exports.Tooltip = Tooltip;
3562
+ exports.Window = Window;