react-magma-dom 5.1.0-rc.8 → 5.1.0-rc.9

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.
@@ -5697,6 +5697,15 @@
5697
5697
  "defaultValue": "false",
5698
5698
  "deprecated": false
5699
5699
  },
5700
+ "leadingIcon": {
5701
+ "name": "leadingIcon",
5702
+ "required": false,
5703
+ "type": {
5704
+ "name": "ReactElement"
5705
+ },
5706
+ "description": "Leading icon to display on the left side within the component",
5707
+ "deprecated": false
5708
+ },
5700
5709
  "onClick": {
5701
5710
  "name": "onClick",
5702
5711
  "required": false,
@@ -9624,7 +9624,7 @@ var DropdownMenuNavItem = /*#__PURE__*/React.forwardRef(function (props, forward
9624
9624
  });
9625
9625
  DropdownMenuNavItem.displayName = 'DropdownMenuNavItem';
9626
9626
 
9627
- var _excluded$U = ["aria-label", "children", "id", "variant", "onClick"];
9627
+ var _excluded$U = ["aria-label", "children", "id", "variant", "onClick", "leadingIcon"];
9628
9628
  var DropdownSplitButton = /*#__PURE__*/React.forwardRef(function (props, forwardedRef) {
9629
9629
  var context = React.useContext(DropdownContext);
9630
9630
  var buttonGroupContext = React.useContext(ButtonGroupContext);
@@ -9637,6 +9637,7 @@ var DropdownSplitButton = /*#__PURE__*/React.forwardRef(function (props, forward
9637
9637
  _resolvedProps$varian = resolvedProps.variant,
9638
9638
  variant = _resolvedProps$varian === void 0 ? exports.ButtonVariant.solid : _resolvedProps$varian,
9639
9639
  onClick = resolvedProps.onClick,
9640
+ leadingIcon = resolvedProps.leadingIcon,
9640
9641
  other = _objectWithoutPropertiesLoose(resolvedProps, _excluded$U);
9641
9642
  var ref = useForkedRef(forwardedRef, resolvedContext.toggleRef);
9642
9643
  var splitButtonRef = React.useRef(null);
@@ -9672,21 +9673,26 @@ var DropdownSplitButton = /*#__PURE__*/React.forwardRef(function (props, forward
9672
9673
  }
9673
9674
  return theme.spaceScale.spacing01;
9674
9675
  }
9676
+ var sharedButtonProps = React.useMemo(function () {
9677
+ return _extends({}, other, {
9678
+ id: resolvedContext.dropdownButtonId.current,
9679
+ isInverse: resolvedContext.isInverse,
9680
+ onClick: handleButtonClick,
9681
+ shape: exports.ButtonShape.leftCap,
9682
+ style: {
9683
+ borderRight: 0,
9684
+ marginRight: 0
9685
+ },
9686
+ variant: variant,
9687
+ tabIndex: 0,
9688
+ ref: splitButtonRef
9689
+ });
9690
+ }, [props]);
9675
9691
  return /*#__PURE__*/React.createElement("div", {
9676
9692
  ref: context.setReference
9677
- }, /*#__PURE__*/React.createElement(Button, Object.assign({}, other, {
9678
- id: resolvedContext.dropdownButtonId.current,
9679
- isInverse: resolvedContext.isInverse,
9680
- onClick: handleButtonClick,
9681
- shape: exports.ButtonShape.leftCap,
9682
- style: {
9683
- borderRight: 0,
9684
- marginRight: 0
9685
- },
9686
- variant: variant,
9687
- tabIndex: 0,
9688
- ref: splitButtonRef
9689
- }), children), /*#__PURE__*/React.createElement(IconButton, Object.assign({}, other, {
9693
+ }, leadingIcon ? (/*#__PURE__*/React.createElement(IconButton, Object.assign({}, sharedButtonProps, {
9694
+ icon: leadingIcon
9695
+ }), children)) : (/*#__PURE__*/React.createElement(Button, Object.assign({}, sharedButtonProps), children)), /*#__PURE__*/React.createElement(IconButton, Object.assign({}, other, {
9690
9696
  "aria-expanded": resolvedContext.isOpen,
9691
9697
  "aria-label": ariaLabel || i18n.dropdown.toggleMenuAriaLabel,
9692
9698
  "aria-haspopup": "true",