@hyphen/hyphen-components 4.1.1 → 4.1.3

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.
@@ -39,6 +39,11 @@ export interface BaseButtonProps {
39
39
  * Size of the button.
40
40
  */
41
41
  size?: ButtonSize | ResponsiveProp<ButtonSize>;
42
+ /**
43
+ * The type of button
44
+ *
45
+ */
46
+ type?: 'button' | 'submit' | 'reset';
42
47
  /**
43
48
  * Visual variant of the button
44
49
  */
@@ -752,7 +752,7 @@ var Spinner = function Spinner(_ref) {
752
752
 
753
753
  var styles$s = {"button":"Button-module_button__18Bed","size-sm":"Button-module_size-sm__6Xrjw","size-md":"Button-module_size-md__BkuGu","size-lg":"Button-module_size-lg__JVYWV","primary":"Button-module_primary__st6yY","secondary":"Button-module_secondary__j-3rj","tertiary":"Button-module_tertiary__Nd7xM","danger":"Button-module_danger__Hxs5n","size-sm-tablet":"Button-module_size-sm-tablet__9XaSx","size-md-tablet":"Button-module_size-md-tablet__YQxaI","size-lg-tablet":"Button-module_size-lg-tablet__h3l97","size-sm-desktop":"Button-module_size-sm-desktop__8tTsg","size-md-desktop":"Button-module_size-md-desktop__OCdDi","size-lg-desktop":"Button-module_size-lg-desktop__uFc4f","size-sm-hd":"Button-module_size-sm-hd__INFfD","size-md-hd":"Button-module_size-md-hd__8e2mW","size-lg-hd":"Button-module_size-lg-hd__DH60l","loading":"Button-module_loading__QfItr","label":"Button-module_label__1PsXG","full-width":"Button-module_full-width__qDri6","spinner-wrapper":"Button-module_spinner-wrapper__rALNw"};
754
754
 
755
- var _excluded$I = ["asChild", "children", "className", "fullWidth", "iconPrefix", "iconSuffix", "isDisabled", "isLoading", "onClick", "onBlur", "onFocus", "shadow", "size", "variant"];
755
+ var _excluded$I = ["asChild", "children", "className", "fullWidth", "iconPrefix", "iconSuffix", "isDisabled", "isLoading", "onClick", "onBlur", "onFocus", "shadow", "size", "type", "variant"];
756
756
  var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
757
757
  var _classNames;
758
758
  var asChild = _ref.asChild,
@@ -769,6 +769,8 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
769
769
  shadow = _ref.shadow,
770
770
  _ref$size = _ref.size,
771
771
  size = _ref$size === void 0 ? 'md' : _ref$size,
772
+ _ref$type = _ref.type,
773
+ type = _ref$type === void 0 ? 'button' : _ref$type,
772
774
  _ref$variant = _ref.variant,
773
775
  variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
774
776
  restProps = _objectWithoutPropertiesLoose(_ref, _excluded$I);
@@ -790,6 +792,8 @@ var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
790
792
  onBlur: handleBlur,
791
793
  onFocus: handleFocus,
792
794
  ref: ref
795
+ }, !asChild && {
796
+ type: type
793
797
  }, restProps), isLoading && React.createElement(Spinner, {
794
798
  className: styles$s['spinner-wrapper']
795
799
  }), iconPrefix && React.createElement(Icon, {
@@ -2119,7 +2123,7 @@ var DropdownMenuItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
2119
2123
  props = _objectWithoutPropertiesLoose(_ref, _excluded$q);
2120
2124
  return React.createElement(DropdownMenuPrimitive__namespace.Item, _extends({
2121
2125
  ref: ref,
2122
- className: classNames('font-size-sm position-relative cursor-default display-flex br-sm align-items-center p-sm g-sm outline-none hover:background-color-secondary focus:background-color-secondary', inset && 'p-left-md', className)
2126
+ className: classNames('font-size-sm position-relative cursor-default display-flex br-sm align-items-center p-sm g-sm outline-none', inset && 'p-left-md', !props.disabled && 'hover:background-color-secondary focus:background-color-secondary', props.disabled && 'cursor-not-allowed font-color-disabled', className)
2123
2127
  }, props));
2124
2128
  });
2125
2129
  DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;