File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
SLDSButton/SLDSButtonStateful Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ class SLDSButtonStateful extends React.Component {
80
80
else if ( this . props . type === "icon" ) {
81
81
return (
82
82
< button className = { this . getClassName ( ) } onClick = { this . handleClick . bind ( this ) } >
83
- < ButtonIcon disabled = { this . props . disabled } name = "like" size = "large" className = "slds-button__icon--stateful" />
83
+ < ButtonIcon disabled = { this . props . disabled } name = { this . props . iconName } size = { this . props . iconSize } assistiveText = { this . props . assistiveText } className = "slds-button__icon--stateful" />
84
84
</ button >
85
85
)
86
86
}
Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ import SLDSUtilityIcon from './SLDSUtilityIcon';
17
17
export const ButtonIcon = React . createClass ( {
18
18
19
19
getDefaultProps ( ) {
20
-
21
20
return {
22
21
category : 'utility' , // Utility Icon Reference: https://www.lightningdesignsystem.com/resources/icons#utility
23
22
} ;
24
23
} ,
25
24
26
25
render ( ) {
27
-
28
26
let className = 'slds-button__icon' ;
27
+ let label = null ;
28
+
29
29
if ( this . props . position ) {
30
30
//If no position prop given, default to left
31
31
className += ' slds-button__icon--' + this . props . position ;
@@ -36,13 +36,15 @@ export const ButtonIcon = React.createClass({
36
36
if ( this . props . destructive ) {
37
37
className += ' slds-button__icon--destructive' ;
38
38
}
39
- /*
40
- if(this.props.category === 'utility'){
41
- return <SLDSUtilityIcon name={this.props.name} aria-hidden='true' className={className} />;
39
+ if ( this . props . assistiveText ) {
40
+ label = < span className = "slds-assistive-text" > { this . props . assistiveText } </ span > ;
42
41
}
43
- return <svg aria-hidden='true' className={className} dangerouslySetInnerHTML={{__html: useTag }} />;
44
- */
45
- return < SLDSUtilityIcon name = { this . props . name } category = { this . props . category } aria-hidden = 'true' className = { className } /> ;
42
+ return (
43
+ < span >
44
+ { label }
45
+ < SLDSUtilityIcon name = { this . props . name } category = { this . props . category } aria-hidden = 'true' className = { className } />
46
+ </ span >
47
+ )
46
48
47
49
48
50
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import React from 'react';
14
14
import SLDSButtonGroup from '../../../components/SLDSButtonGroup' ;
15
15
import SLDSDropdownBase from '../../../components/SLDSDropdownBase' ;
16
16
import SLDSButton from '../../../components/SLDSButton' ;
17
+ import SLDSButtonStateful from '../../../components/SLDSButton/SLDSButtonStateful' ;
17
18
import { ButtonIcon , Icon } from "./../../../components/SLDSIcons" ;
18
19
import { default as PrismCode } from "react-prism/lib/PrismCode" ;
19
20
@@ -80,8 +81,8 @@ module.exports = React.createClass( {
80
81
81
82
< div className = 'slds-p-vertical--small' >
82
83
< SLDSButtonGroup >
83
- < SLDSButton label = 'Chart' variant = 'icon' iconName = 'chart' iconVariant = 'border' />
84
- < SLDSButton label = 'Filter' variant = 'icon' iconName = 'filter' iconVariant = 'border' />
84
+ < SLDSButtonStateful type = "icon" assistiveText = "View Reports" label = 'Chart' variant = 'icon' iconName = 'chart' />
85
+ < SLDSButtonStateful type = "icon" assistiveText = "Filter Data" label = 'Filter' variant = 'icon' iconName = 'filter' />
85
86
< SLDSButton label = 'Sort' variant = 'icon' iconName = 'sort' iconVariant = 'more' />
86
87
</ SLDSButtonGroup >
87
88
</ div >
You can’t perform that action at this time.
0 commit comments