@helpdice/ui 1.6.0 → 1.6.2

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.
@@ -1280,7 +1280,7 @@ var withScale = function withScale(Render) {
1280
1280
  return ScaleFC;
1281
1281
  };
1282
1282
 
1283
- var _excluded$2 = ["label", "labelRight", "type", "error", "htmlType", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1283
+ var _excluded$2 = ["label", "labelRight", "color", "error", "type", "icon", "iconRight", "iconClickable", "onIconClick", "initialValue", "onChange", "readOnly", "value", "onClearClick", "clearable", "className", "onBlur", "onFocus", "autoComplete", "placeholder", "children", "disabled"];
1284
1284
  var simulateChangeEvent = function simulateChangeEvent(el, event) {
1285
1285
  return _objectSpread2(_objectSpread2({}, event), {}, {
1286
1286
  target: el,
@@ -1290,11 +1290,11 @@ var simulateChangeEvent = function simulateChangeEvent(el, event) {
1290
1290
  var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1291
1291
  var label = _ref.label,
1292
1292
  labelRight = _ref.labelRight,
1293
- _ref$type = _ref.type,
1294
- type = _ref$type === void 0 ? 'default' : _ref$type,
1293
+ _ref$color = _ref.color,
1294
+ _color = _ref$color === void 0 ? 'default' : _ref$color,
1295
1295
  error = _ref.error,
1296
- _ref$htmlType = _ref.htmlType,
1297
- htmlType = _ref$htmlType === void 0 ? 'text' : _ref$htmlType,
1296
+ _ref$type = _ref.type,
1297
+ type = _ref$type === void 0 ? 'text' : _ref$type,
1298
1298
  icon = _ref.icon,
1299
1299
  iconRight = _ref.iconRight,
1300
1300
  _ref$iconClickable = _ref.iconClickable,
@@ -1346,7 +1346,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1346
1346
  return iconRight ? 'right-icon' : icon ? 'left-icon' : '';
1347
1347
  }, [icon, iconRight]);
1348
1348
  var _useMemo = React.useMemo(function () {
1349
- return getColors(theme.palette, type);
1349
+ return getColors(theme.palette, _color);
1350
1350
  }, [theme.palette, type]),
1351
1351
  color = _useMemo.color,
1352
1352
  borderColor = _useMemo.borderColor,
@@ -1407,7 +1407,7 @@ var InputComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1407
1407
  }, icon && /*#__PURE__*/React.createElement(InputIcon, _extends({
1408
1408
  icon: icon
1409
1409
  }, iconProps)), /*#__PURE__*/React.createElement("input", _extends({
1410
- type: htmlType,
1410
+ type: type,
1411
1411
  ref: inputRef,
1412
1412
  placeholder: placeholder,
1413
1413
  disabled: disabled,
@@ -1611,7 +1611,7 @@ var InputPasswordComponent = /*#__PURE__*/React.forwardRef(function (_ref, ref)
1611
1611
  ref: inputRef,
1612
1612
  iconClickable: true,
1613
1613
  onIconClick: iconClickHandler,
1614
- htmlType: visible ? 'text' : 'password'
1614
+ type: visible ? 'text' : 'password'
1615
1615
  });
1616
1616
  }, [props, iconClickHandler, visible, inputRef]);
1617
1617
  var icon = React.useMemo(function () {
@@ -4,8 +4,8 @@ export type InputTypes = NormalTypes;
4
4
  export interface Props {
5
5
  initialValue?: string;
6
6
  placeholder?: string;
7
- type?: InputTypes;
8
- htmlType?: string;
7
+ color?: InputTypes;
8
+ type?: string;
9
9
  readOnly?: boolean;
10
10
  disabled?: boolean;
11
11
  label?: string;
@@ -6,8 +6,8 @@ interface PasswordProps extends Props {
6
6
  readOnly: boolean;
7
7
  clearable: boolean;
8
8
  iconClickable: boolean;
9
- type: InputTypes;
10
- htmlType: string;
9
+ color: InputTypes;
10
+ type: string;
11
11
  autoComplete: string;
12
12
  className: string;
13
13
  placeholder: string;
@@ -1592,7 +1592,7 @@ var addColorAlpha = function addColorAlpha(color, alpha) {
1592
1592
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(safeAlpha, ")");
1593
1593
  };
1594
1594
 
1595
- var getButtonGhostColors = function getButtonGhostColors(palette, type) {
1595
+ var getButtonGhostColors = function getButtonGhostColors(palette, _color) {
1596
1596
  var colors = {
1597
1597
  secondary: {
1598
1598
  bg: palette.background,
@@ -1615,10 +1615,10 @@ var getButtonGhostColors = function getButtonGhostColors(palette, type) {
1615
1615
  color: palette.error
1616
1616
  }
1617
1617
  };
1618
- return colors[type] || null;
1618
+ return colors[_color] || null;
1619
1619
  };
1620
1620
  var getButtonColors = function getButtonColors(palette, props) {
1621
- var type = props.type,
1621
+ var color = props.color,
1622
1622
  disabled = props.disabled,
1623
1623
  ghost = props.ghost;
1624
1624
  var colors = {
@@ -1666,12 +1666,12 @@ var getButtonColors = function getButtonColors(palette, props) {
1666
1666
  * Color['success'] === Color['success-light']
1667
1667
  * Color['warning'] === Color['warning-light']
1668
1668
  */
1669
- var withoutLightType = type === null || type === void 0 ? void 0 : type.replace('-light', '');
1669
+ var withoutLightType = color === null || color === void 0 ? void 0 : color.replace('-light', '');
1670
1670
  var defaultColor = colors["default"];
1671
1671
  if (ghost) return getButtonGhostColors(palette, withoutLightType) || defaultColor;
1672
1672
  return colors[withoutLightType] || defaultColor;
1673
1673
  };
1674
- var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type) {
1674
+ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, _color) {
1675
1675
  var colors = {
1676
1676
  secondary: {
1677
1677
  bg: palette.foreground,
@@ -1694,11 +1694,11 @@ var getButtonGhostHoverColors = function getButtonGhostHoverColors(palette, type
1694
1694
  color: 'white'
1695
1695
  }
1696
1696
  };
1697
- var withoutLightType = type.replace('-light', '');
1697
+ var withoutLightType = _color.replace('-light', '');
1698
1698
  return colors[withoutLightType] || null;
1699
1699
  };
1700
1700
  var getButtonHoverColors = function getButtonHoverColors(palette, props) {
1701
- var type = props.type,
1701
+ var color = props.color,
1702
1702
  disabled = props.disabled,
1703
1703
  loading = props.loading,
1704
1704
  shadow = props.shadow,
@@ -1753,7 +1753,7 @@ var getButtonHoverColors = function getButtonHoverColors(palette, props) {
1753
1753
  color: 'transparent'
1754
1754
  });
1755
1755
  if (shadow) return defaultColor;
1756
- var hoverColor = (ghost ? getButtonGhostHoverColors(palette, type) : colors[type]) || colors["default"];
1756
+ var hoverColor = (ghost ? getButtonGhostHoverColors(palette, color) : colors[color]) || colors["default"];
1757
1757
  return _objectSpread2(_objectSpread2({}, hoverColor), {}, {
1758
1758
  color: hoverColor.color || hoverColor.border
1759
1759
  });
@@ -1779,7 +1779,7 @@ var getButtonDripColor = function getButtonDripColor(palette, props) {
1779
1779
  return isLightHover ? addColorAlpha(hoverColors.bg, 0.65) : addColorAlpha(palette.accents_2, 0.65);
1780
1780
  };
1781
1781
 
1782
- var _excluded$6 = ["children", "disabled", "type", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "htmlType", "iconRight", "className", "crossOrigin"];
1782
+ var _excluded$6 = ["children", "disabled", "color", "loading", "shadow", "ghost", "effect", "round", "onClick", "auto", "icon", "type", "iconRight", "className", "crossOrigin"];
1783
1783
  var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1784
1784
  var theme = useTheme();
1785
1785
  var _useScale = useScale(),
@@ -1806,7 +1806,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1806
1806
  var children = filteredProps.children,
1807
1807
  _filteredProps$disabl = filteredProps.disabled,
1808
1808
  disabled = _filteredProps$disabl === void 0 ? false : _filteredProps$disabl;
1809
- filteredProps.type;
1809
+ filteredProps.color;
1810
1810
  var _filteredProps$loadin = filteredProps.loading,
1811
1811
  loading = _filteredProps$loadin === void 0 ? false : _filteredProps$loadin,
1812
1812
  _filteredProps$shadow = filteredProps.shadow,
@@ -1821,8 +1821,8 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1821
1821
  _filteredProps$auto = filteredProps.auto,
1822
1822
  auto = _filteredProps$auto === void 0 ? false : _filteredProps$auto,
1823
1823
  icon = filteredProps.icon,
1824
- _filteredProps$htmlTy = filteredProps.htmlType,
1825
- htmlType = _filteredProps$htmlTy === void 0 ? 'button' : _filteredProps$htmlTy,
1824
+ _filteredProps$type = filteredProps.type,
1825
+ type = _filteredProps$type === void 0 ? 'button' : _filteredProps$type,
1826
1826
  iconRight = filteredProps.iconRight,
1827
1827
  _filteredProps$classN = filteredProps.className,
1828
1828
  className = _filteredProps$classN === void 0 ? '' : _filteredProps$classN;
@@ -1876,7 +1876,7 @@ var ButtonComponent = /*#__PURE__*/React.forwardRef(function (btnProps, ref) {
1876
1876
  paddingRight = auto ? SCALES.pr(1.15) : SCALES.pr(1.375);
1877
1877
  return /*#__PURE__*/React.createElement("button", _extends({
1878
1878
  ref: buttonRef,
1879
- type: htmlType,
1879
+ type: type,
1880
1880
  disabled: disabled,
1881
1881
  onClick: clickHandler
1882
1882
  }, props, {