ui-beyable 1.1.0-beta.28 → 1.1.0-beta.29

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.
@@ -1,10 +1,11 @@
1
1
  /// <reference types="react" />
2
+ type sizeType = 'xxl' | 'xl' | 'l' | 'm' | 's' | 'xs';
2
3
  interface IIconBtn {
3
4
  icon?: string;
4
5
  customIcon?: React.ReactElement;
5
6
  lucideIcon?: React.ReactElement;
6
7
  fixedWidth?: boolean;
7
- size?: string;
8
+ size?: sizeType;
8
9
  className?: string;
9
10
  theme?: string;
10
11
  hoverColor?: string;
@@ -19,4 +20,4 @@ interface IIconBtn {
19
20
  isActive?: boolean;
20
21
  rel?: string;
21
22
  }
22
- export { IIconBtn };
23
+ export { IIconBtn, sizeType };
package/lib/cjs/index.js CHANGED
@@ -2779,9 +2779,22 @@ var css_248z$n = ".IconBtn-module_btn__lnSG6{border-radius:40px;cursor:pointer;d
2779
2779
  var s = {"btn":"IconBtn-module_btn__lnSG6","btn_disabled":"IconBtn-module_btn_disabled__n1xzU","btn_readonly":"IconBtn-module_btn_readonly__v5-PS","btn_theme_darker":"IconBtn-module_btn_theme_darker__SojXY","btn_hoverable":"IconBtn-module_btn_hoverable__ne7bi","btn_theme_dark":"IconBtn-module_btn_theme_dark__TB1cI","btn_theme_medium":"IconBtn-module_btn_theme_medium__Hx6Rz","btn_theme_light":"IconBtn-module_btn_theme_light__WzM-B","btn_color_primary":"IconBtn-module_btn_color_primary__ULBf-","btn_active":"IconBtn-module_btn_active__wuoV7","btn_color_alert":"IconBtn-module_btn_color_alert__6UsMK","btn_color_success":"IconBtn-module_btn_color_success__WGmRO","btn_color_yellow":"IconBtn-module_btn_color_yellow__v6Pnk","btn_xxl":"IconBtn-module_btn_xxl__ieWlh","btn_xl":"IconBtn-module_btn_xl__LPDio","btn_l":"IconBtn-module_btn_l__a3gDu","btn_m":"IconBtn-module_btn_m__PjqLG","btn_s":"IconBtn-module_btn_s__ToEtP","btn_xs":"IconBtn-module_btn_xs__Sh5-5","icon_custom":"IconBtn-module_icon_custom__01L86","btnDisabled":"IconBtn-module_btn_disabled__n1xzU","btnReadonly":"IconBtn-module_btn_readonly__v5-PS","btnThemeDarker":"IconBtn-module_btn_theme_darker__SojXY","btnHoverable":"IconBtn-module_btn_hoverable__ne7bi","btnThemeDark":"IconBtn-module_btn_theme_dark__TB1cI","btnThemeMedium":"IconBtn-module_btn_theme_medium__Hx6Rz","btnThemeLight":"IconBtn-module_btn_theme_light__WzM-B","btnColorPrimary":"IconBtn-module_btn_color_primary__ULBf-","btnActive":"IconBtn-module_btn_active__wuoV7","btnColorAlert":"IconBtn-module_btn_color_alert__6UsMK","btnColorSuccess":"IconBtn-module_btn_color_success__WGmRO","btnColorYellow":"IconBtn-module_btn_color_yellow__v6Pnk","btnXxl":"IconBtn-module_btn_xxl__ieWlh","btnXl":"IconBtn-module_btn_xl__LPDio","btnL":"IconBtn-module_btn_l__a3gDu","btnM":"IconBtn-module_btn_m__PjqLG","btnS":"IconBtn-module_btn_s__ToEtP","btnXs":"IconBtn-module_btn_xs__Sh5-5","iconCustom":"IconBtn-module_icon_custom__01L86"};
2780
2780
  styleInject(css_248z$n);
2781
2781
 
2782
+ var lucideIconSizes = {
2783
+ 'xxl': 25,
2784
+ 'xl': 22,
2785
+ 'l': 21,
2786
+ 'm': 20,
2787
+ 's': 18,
2788
+ 'xs': 14,
2789
+ };
2782
2790
  var IconBtn = React.forwardRef(function (_a, ref) {
2783
2791
  var icon = _a.icon, customIcon = _a.customIcon, lucideIcon = _a.lucideIcon, _b = _a.fixedWidth, fixedWidth = _b === void 0 ? true : _b, _c = _a.size, size = _c === void 0 ? 'm' : _c, _d = _a.className, className = _d === void 0 ? '' : _d, _e = _a.theme, theme = _e === void 0 ? 'medium' : _e, _f = _a.hoverColor, hoverColor = _f === void 0 ? 'primary' : _f, tooltip = _a.tooltip, tooltipHTML = _a.tooltipHTML, onClick = _a.onClick, onMouseDown = _a.onMouseDown, href = _a.href, target = _a.target, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.readonly, readonly = _h === void 0 ? false : _h, _j = _a.isActive, isActive = _j === void 0 ? false : _j, rel = _a.rel;
2784
2792
  var tooltipID = v4();
2793
+ var getLucideIconSize = function (size) {
2794
+ if (size in lucideIconSizes)
2795
+ return lucideIconSizes[size];
2796
+ return 20;
2797
+ };
2785
2798
  var sizeClass = {
2786
2799
  xxl: s.btn_xxl,
2787
2800
  xl: s.btn_xl,
@@ -2847,7 +2860,7 @@ var IconBtn = React.forwardRef(function (_a, ref) {
2847
2860
  }
2848
2861
  if (lucideIcon) {
2849
2862
  customIcon = React.cloneElement(lucideIcon, {
2850
- size: lucideIcon.props.size || 20,
2863
+ size: lucideIcon.props.size || getLucideIconSize(size),
2851
2864
  strokeWidth: 1.5,
2852
2865
  absoluteStrokeWidth: true
2853
2866
  });