Skip to content

Commit e66b699

Browse files
committed
Merge pull request #46 from salesforce-ux/button
Button
2 parents 5faf65d + 6be0741 commit e66b699

File tree

2 files changed

+38
-16
lines changed

2 files changed

+38
-16
lines changed

demo/code-snippets/SLDSButton.txt

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11

22
Default Props Prop Values
3-
* label='' Required Prop
3+
* label=undefined Required Prop
44
* variant='base' ['base', 'neutral', 'brand', 'destructive', 'icon'] Use icon if you want an icon only button
5-
* disabled={false}
6-
* tabindex=''
7-
* inverse={false}
8-
* stateful={false}
9-
* responsive={false}
10-
* iconName='' see https://www.lightningdesignsystem.com/resources/icons#utility for names
11-
* iconVariant='bare' ['bare', 'container', 'border', 'border-filled', 'small', 'more']
12-
* iconSize='medium' ['x-small', 'medium', 'small', 'large']
13-
* iconPosition='left' ['left', 'right', 'large']
14-
* className = '' custom classes on the button tag
5+
* disabled=false
6+
* tabindex=undefined
7+
* inverse=false
8+
* stateful=false
9+
* responsive=false
10+
* iconName=undefined see https://www.lightningdesignsystem.com/resources/icons#utility for names
11+
* className=undefined custom classes on the button tag
12+
13+
** If iconName exists
14+
* iconVariant='bare' ['bare', 'container', 'border', 'border-filled', 'small', 'more']
15+
* iconSize='medium' ['x-small', 'medium', 'small', 'large']
16+
* iconPosition='left' ['left', 'right', 'large']
17+
18+
** If stateful=true
19+
* notSelectedIcon=undefined
20+
* notSelectedLabel=undefined
21+
* selectedIcon=undefined
22+
* selectedLabel=undefined
23+
* selectedFocusIcon=undefined
24+
* selectedFocusLabel=undefined
1525

1626
1. <SLDSButton label='Neutral' variant='neutral' onClick={this.handleNeutralClick} />
1727
2. <SLDSButton label='Neutral Icon' variant='neutral' iconName='download' iconSize='small' iconPosition='right' onClick={this.handleNeutralClick} />
@@ -20,3 +30,14 @@ Default Props Prop Values
2030
5. <SLDSButton label='Settings' variant='icon' iconName='settings' iconSize='large' onClick={this.handleIconClick} />
2131
6. <SLDSButton label='User' variant='icon' inverse={true} iconName='user' iconSize='large' onClick={this.handleIconClick} />
2232
7. <SLDSButton label='Edit' variant='icon' hint={true} iconName='edit' iconSize='large' onClick={this.handleIconClick} />
33+
8. <SLDSButton
34+
label='Follow'
35+
variant='neutral'
36+
stateful={true}
37+
notSelectedIcon='add'
38+
notSelectedLabel='Follow'
39+
selectedIcon='check'
40+
selectedLabel='Following'
41+
selectedFocusIcon='close'
42+
selectedFocusLabel='Unfollow'
43+
onClick={this.handleStatefulClick} />

demo/pages/HomePage/index.jsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
1010
'use strict';
1111

1212
import React from 'react';
13+
import Router from 'react-router';
14+
const { Route, DefaultRoute, RouteHandler, Link } = Router;
15+
1316
import SLDSGrid from '../../../components/SLDSGrid';
1417
import {ButtonIcon, Icon} from "./../../../components/SLDSIcons";
1518

16-
1719
import ButtonSection from './ButtonSection';
1820
import ButtonGroupSection from './ButtonGroupSection';
19-
import LookupBaseSection from './LookupBaseSection';
2021

22+
import LookupBaseSection from './LookupBaseSection';
2123
import LookupBaseDynamicSection from './LookupBaseDynamicSection';
2224

23-
2425
import PicklistBaseSection from './PicklistBaseSection';
2526
import PicklistBaseCustomSection from './PicklistBaseCustomSection';
2627

@@ -42,7 +43,6 @@ module.exports = React.createClass( {
4243
return {};
4344
},
4445

45-
4646
render() {
4747
return (
4848
<SLDSGrid flavor='vertical' className='stage slds-nowrap'>
@@ -66,10 +66,11 @@ module.exports = React.createClass( {
6666
</SLDSGrid>
6767
</div>
6868
</div>
69+
6970
<main className='stage-main slds-grid slds-wrap slds-grow' role='main'>
7071
<div className='region region--main slds-grow slds-size--1-of-1 slds-medium-size--1-of-2 slds-large-size--8-of-12 slds-col-rule--right slds-p-around--large'>
7172

72-
<ButtonSection />
73+
<ButtonSection/>
7374

7475
<ButtonGroupSection />
7576

0 commit comments

Comments
 (0)