From 8dde9edcdeeb068acee96d54ae739a898466565c Mon Sep 17 00:00:00 2001 From: ButuzGOL Date: Mon, 10 Apr 2017 13:51:34 +0300 Subject: [PATCH] Small changes & fixes 1. Button icon style 2. ButtonGroup Check for valid element in items prevent null 3. Icon fix for IE & Edge and new prop assestiveText 4. util isIE func --- src/scripts/Button.js | 46 ++++++++++++++++++++++++++++---------- src/scripts/ButtonGroup.js | 1 + src/scripts/Icon.js | 40 +++++++++++++++++++++++++++------ src/scripts/util.js | 3 +++ stories/IconStories.js | 3 +++ test/button-spec.js | 6 +++-- 6 files changed, 78 insertions(+), 21 deletions(-) diff --git a/src/scripts/Button.js b/src/scripts/Button.js index 2f76b95f1..fc5b134d9 100644 --- a/src/scripts/Button.js +++ b/src/scripts/Button.js @@ -16,16 +16,31 @@ export default class Button extends Component { } renderIcon(iconSize, inv) { - const { icon, iconAlign, type } = this.props; + const { icon, iconAlign, type, iconStyle } = this.props; const inverse = inv || /\-?inverse$/.test(type); - return ; + return ( + + ); } renderIconMore() { - const { iconMore, icon, iconAlign, label, children } = this.props; + const { iconMore, icon, iconAlign, iconStyle, label, children } = this.props; const adjoining = icon && (iconAlign === 'right' || !(label || children)); const iconMoreSize = this.props.iconMoreSize || adjoining ? 'x-small' : 'small'; - return ; + return ( + + ); } render() { @@ -41,14 +56,11 @@ export default class Button extends Component { typeClassName, { 'slds-is-selected': selected, - [`slds-button--${size}`]: size && !/^icon-/.test(type), - [`slds-button--icon-${size}`]: /^(x-small|small)$/.test(size) && /^icon-/.test(type), + [`slds-button--${size}`]: size && !/^icon/.test(type), + [`slds-button--icon-${size}`]: /^(x-small|small)$/.test(size) && /^icon/.test(type), } ); - delete props.component; - delete props.items; - return (