Skip to content

Commit 832aad6

Browse files
committed
Merge branch 'documentation'
2 parents 1da5d22 + 63129c2 commit 832aad6

File tree

4 files changed

+104
-0
lines changed

4 files changed

+104
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/*
2+
Copyright (c) 2015, salesforce.com, inc. All rights reserved.
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
5+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
6+
Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
7+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8+
*/
9+
10+
'use strict';
11+
12+
import React from 'react';
13+
import SLDSButton from '../../../components/SLDSButton';
14+
import {ButtonIcon, Icon} from "./../../../components/SLDSIcons";
15+
import {default as PrismCode} from "react-prism/lib/PrismCode";
16+
17+
18+
19+
20+
21+
module.exports = React.createClass( {
22+
23+
getDefaultProps () {
24+
return {};
25+
},
26+
27+
getInitialState () {
28+
return {};
29+
},
30+
31+
handleNeutralClick () {
32+
alert('Neutral Button Clicked');
33+
},
34+
35+
handleBrandClick () {
36+
alert('Brand Button Clicked');
37+
},
38+
39+
handleDisabledClick () {
40+
alert('Disabled Button Clicked');
41+
},
42+
43+
handleIconClick(){
44+
alert('Icon Button Clicked');
45+
},
46+
47+
handleStatefulClick(e){
48+
console.log('the click event is ', e);
49+
},
50+
51+
52+
render() {
53+
let hintBtnParent = {display: 'inline-block', backgroundColor: '#7fdbff', padding: '10px 20px', margin: '0 20px'};
54+
let inverseBtnParent = {display: 'inline-block', backgroundColor: '#0074d9', padding: '10px 20px', margin: '0 20px'};
55+
return (
56+
57+
<div className='slds-p-around--medium'>
58+
<h3 className='slds-text-heading--medium slds-truncate'>
59+
Button README
60+
</h3>
61+
62+
<div className='slds-p-vertical--large'>
63+
1. <SLDSButton label='Neutral' variant='neutral' onClick={this.handleNeutralClick} />
64+
<span className="slds-p-horizontal--medium"></span>
65+
2. <SLDSButton label='Neutral Icon' variant='neutral' iconName='download' iconSize='small' iconPosition='right' onClick={this.handleNeutralClick} />
66+
<span className="slds-p-horizontal--medium"></span>
67+
3. <SLDSButton label='Disabled' variant='neutral' disabled={true} onClick={this.handleDisabledClick} />
68+
<span className="slds-p-horizontal--medium"></span>
69+
4. <SLDSButton label='Brand' variant='brand' onClick={this.handleBrandClick} />
70+
71+
<div className="slds-p-vertical--medium"></div>
72+
73+
<span className=""></span>
74+
5. <SLDSButton label='Settings' variant='icon' iconName='settings' iconSize='large' onClick={this.handleIconClick} />
75+
76+
<div className='slds-p-horizontal--medium' style={inverseBtnParent}>
77+
6. <SLDSButton label='User' variant='icon' inverse={true} iconName='user' iconSize='large' onClick={this.handleIconClick} />
78+
</div>
79+
80+
<div className='slds-p-horizontal--medium slds-hint-parent' style={hintBtnParent}>
81+
7. <SLDSButton label='Edit' variant='icon' hint={true} iconName='edit' iconSize='large' onClick={this.handleIconClick} />
82+
</div>
83+
84+
<span className=""></span>
85+
8. <SLDSButton
86+
label='Follow'
87+
variant='neutral'
88+
stateful={true}
89+
notSelectedIcon='add'
90+
notSelectedLabel='Follow'
91+
selectedIcon='check'
92+
selectedLabel='Following'
93+
selectedFocusIcon='close'
94+
selectedFocusLabel='Unfollow'
95+
onClick={this.handleStatefulClick} />
96+
97+
</div>
98+
</div>
99+
100+
101+
);
102+
}
103+
});

demo/pages/HomePage/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const { Route, DefaultRoute, RouteHandler, Link } = Router;
1616
import SLDSGrid from '../../../components/SLDSGrid';
1717
import {ButtonIcon, Icon} from "./../../../components/SLDSIcons";
1818

19+
import ButtonSectionREADME from './ButtonSectionREADME';
1920
import ButtonSection from './ButtonSection';
2021
import ButtonGroupSection from './ButtonGroupSection';
2122

readme-assets/SLDSButtons.png

2.16 KB
Loading

readme-assets/SLDSNotifications.png

12.1 KB
Loading

0 commit comments

Comments
 (0)