@@ -22,10 +22,12 @@ npm test
22
22
### Table of Contents
23
23
* [ Buttons] ( #buttons )
24
24
* [ Button Groups] ( #button-groups )
25
+ * [ Dropdowns] ( #dropdowns )
26
+ * [ Icons] ( #icons )
25
27
* [ Lookups] ( #lookups )
26
28
* [ Modals] ( #modals )
29
+ * [ Notifications] ( #notifications )
27
30
* [ Picklists] ( #picklists )
28
- * [ Utility Icons] ( #utility-icons )
29
31
30
32
31
33
### [ Buttons] ( https://www.lightningdesignsystem.com/components/buttons )
@@ -35,37 +37,46 @@ npm test
35
37
import {SLDSButton } from ' design-system-react' ;
36
38
37
39
...
38
-
39
40
1. < SLDSButton label= ' Neutral' variant= ' neutral' onClick= {this .handleNeutralClick } / >
40
41
2. < SLDSButton label= ' Neutral Icon' variant= ' neutral' iconName= ' download' iconSize= ' small' iconPosition= ' right' onClick= {this .handleNeutralClick } / >
41
42
3. < SLDSButton label= ' Disabled' variant= ' neutral' disabled= {true } onClick= {this .handleDisabledClick } / >
42
43
4. < SLDSButton label= ' Brand' variant= ' brand' onClick= {this .handleBrandClick } / >
43
44
5. < SLDSButton label= ' Settings' variant= ' icon' iconName= ' settings' iconSize= ' large' onClick= {this .handleIconClick } / >
44
45
6. < SLDSButton label= ' User' variant= ' icon' inverse= {true } iconName= ' user' iconSize= ' large' onClick= {this .handleIconClick } / >
45
46
7. < SLDSButton label= ' Edit' variant= ' icon' hint= {true } iconName= ' edit' iconSize= ' large' onClick= {this .handleIconClick } / >
47
+ 8. < SLDSButton label= ' Follow' variant= ' neutral' stateful= {true } notSelectedIcon= ' add' notSelectedLabel= ' Follow' selectedIcon= ' check' selectedLabel= ' Following' selectedFocusIcon= ' close' selectedFocusLabel= ' Unfollow' onClick= {this .handleStatefulClick } / >
46
48
47
- Required Prop
48
- * Only label is required
49
-
50
- Default Props Prop Values
51
- * label= ' ' Required Prop
49
+ Default Props Prop Values
52
50
* variant= ' base' [' base' , ' neutral' , ' brand' , ' destructive' , ' icon' ] Use icon if you want an icon only button
53
- * disabled= {false }
54
- * tabindex= ' '
55
- * inverse= {false }
56
- * stateful= {false }
57
- * responsive= {false }
58
- * iconName= ' ' see https: // www.lightningdesignsystem.com/resources/icons#utility for names
59
- * iconVariant= ' bare' [' bare' , ' container' , ' border' , ' border-filled' , ' small' , ' more' ]
60
- * iconSize= ' medium' [' x-small' , ' medium' , ' small' , ' large' ]
61
- * iconPosition= ' left' [' left' , ' right' , ' large' ]
62
- * className = ' ' custom classes on the button tag
51
+ * label= undefined Required Prop . If variant is icon, the label will be invisible but still readable by assistive technology.
52
+ * disabled= false
53
+ * tabindex= undefined
54
+ * inverse= false
55
+ * stateful= false
56
+ * responsive= false
57
+ * iconName= undefined see https: // www.lightningdesignsystem.com/resources/icons#utility for names
58
+ * className= undefined custom classes on the button tag
59
+
60
+ ** If iconName exists
61
+ * iconVariant= ' bare' [' bare' , ' container' , ' border' , ' border-filled' , ' small' , ' more' ]
62
+ * iconSize= ' medium' [' x-small' , ' medium' , ' small' , ' large' ]
63
+ * iconPosition= ' left' [' left' , ' right' , ' large' ]
64
+
65
+ ** If stateful= true
66
+ * notSelectedIcon= undefined
67
+ * notSelectedLabel= undefined
68
+ * selectedIcon= undefined
69
+ * selectedLabel= undefined
70
+ * selectedFocusIcon= undefined
71
+ * selectedFocusLabel= undefined
63
72
64
73
```
65
74
66
75
[ ![ browser support] ( /readme-assets/SLDSButtons.png )] ( /readme-assets/SLDSButtons.png )
67
76
68
77
78
+
79
+
69
80
### [ Button Groups] ( https://www.lightningdesignsystem.com/components/button-groups )
70
81
71
82
``` jsx
@@ -86,12 +97,70 @@ import {SLDSButtonGroup} from 'design-system-react';
86
97
< SLDSButton label= ' Filter' variant= ' icon' iconName= ' filter' iconVariant= ' border' / >
87
98
< SLDSButton label= ' Sort' variant= ' icon' iconName= ' sort' iconVariant= ' more' / >
88
99
< / SLDSButtonGroup>
89
-
90
100
```
91
101
92
102
[ ![ browser support] ( /readme-assets/SLDSButtonGroups.png )] ( /readme-assets/SLDSButtonGroups.png )
93
103
94
104
105
+
106
+
107
+ ### [ Dropdowns] ( https://design-system-dev.herokuapp.com/components/menus#dropdown )
108
+
109
+ ``` jsx
110
+
111
+ import {SLDSDropdownBase } from ' design-system-react' ;
112
+
113
+ ...
114
+ const options = [
115
+ {label: ' A Option Option Super Super Long' ,value: ' A0' },
116
+ {label: ' B Option' ,value: ' B0' },
117
+ {label: ' C Option' ,value: ' C0' },
118
+ {label: ' D Option' ,value: ' D0' },
119
+ {label: ' E Option' ,value: ' E0' },
120
+ {label: ' A1 Option' ,value: ' A1' },
121
+ {label: ' B2 Option' ,value: ' B1' },
122
+ {label: ' C2 Option' ,value: ' C1' },
123
+ {label: ' D2 Option' ,value: ' D1' },
124
+ {label: ' E2 Option Super Super Long' ,value: ' E1' },
125
+ ];
126
+
127
+ < SLDSDropdownBase
128
+ options= {options}
129
+ value= ' C0'
130
+ label= " Contacts"
131
+ modal= {true }
132
+ placeholder= " Select a contact"
133
+ onSelect= {this .handleOnSelect }
134
+ onClick= {this .handleOnClick }
135
+ onUpdateHighlighted= {this .handleOnUpdateHighlighted }
136
+ / >
137
+
138
+ ```
139
+
140
+ [ ![ browser support] ( /readme-assets/SLDSDropdownBase.gif )] ( /readme-assets/SLDSDropdownBase.gif )
141
+
142
+
143
+
144
+
145
+
146
+ ### [ Icons] ( https://www.lightningdesignsystem.com/resources/icons#utility )
147
+
148
+ ``` jsx
149
+
150
+ import {SLDSIcons } from ' design-system-react' ;
151
+
152
+ ...
153
+
154
+ < SLDSIcons .Icon name= ' open_folder' category= ' utility' className= ' slds-input__icon slds-icon-text-default' / >
155
+
156
+ ```
157
+
158
+ [ ![ browser support] ( /readme-assets/SLDSUtilityIcons.png )] ( /readme-assets/SLDSUtilityIcons.png )
159
+
160
+
161
+
162
+
163
+
95
164
### [ Lookups] ( https://www.lightningdesignsystem.com/components/lookups )
96
165
#### * Base, single select only. Other variants coming soon.
97
166
@@ -110,13 +179,27 @@ const items = [
110
179
{label: ' Acme Construction' }
111
180
];
112
181
113
- < SLDSLookup items= {items} label= " Accounts" type= " account" onNewItem= {this .newItem } onSearchRecords= {this .searchRecords } / >
182
+ < SLDSLookup
183
+ items= {items}
184
+ label= " Account"
185
+ type= " account"
186
+ iconCategory= ' standard'
187
+ iconName= ' account'
188
+ headerRenderer= {SLDSLookup .DefaultHeader }
189
+ footerRenderer= {SLDSLookup .DefaultFooter }
190
+ onChange= {this .onChange }
191
+ onItemSelect= {this .selectItem }
192
+ hasError= {false }
193
+ / >
114
194
115
195
```
116
196
117
197
[ ![ browser support] ( /readme-assets/SLDSLookups.gif )] ( /readme-assets/SLDSLookups.gif )
118
198
119
199
200
+
201
+
202
+
120
203
### [ Modals] ( https://www.lightningdesignsystem.com/components/modals )
121
204
122
205
``` jsx
@@ -126,24 +209,51 @@ import {SLDSModal} from 'design-system-react';
126
209
127
210
...
128
211
129
- < SLDSButton label= ' Open Modal' variant= ' brand' onClick= {this .openModal } / >
212
+ < SLDSButton
213
+ label= ' Open Modal'
214
+ variant= ' brand'
215
+ onClick= {this .openModal }
216
+ / >
130
217
131
218
< SLDSModal
132
219
isOpen= {this .state .modalIsOpen }
133
220
title= {< span> Lightning Design System: Style with Ease< / span> }
134
221
footer= {[
135
- < SLDSButton key= ' cancelBtn ' label= ' Cancel ' variant= ' neutral' onClick= {this .closeModal } / > ,
136
- < SLDSButton key= ' saveBtn ' label= ' Save ' variant= ' brand' onClick= {this .handleSubmitModal } / >
222
+ < SLDSButton key= ' backBtn ' label= ' Back ' variant= ' neutral' onClick= {this .closeModal } / > ,
223
+ < SLDSButton key= ' nextBtn ' label= ' Next ' variant= ' brand' onClick= {this .handleSubmitModal } / >
137
224
]}
138
- onRequestClose= {this .closeModal }>
225
+ onRequestClose= {this .closeModal }
226
+ >
139
227
{this .getModalContent ()}
140
228
< / SLDSModal>
141
229
230
+ Default Props Prop Values
231
+ * size= ' medium' [' medium' , ' large' ]
232
+ * directional= false [true , false ] If true , aligns buttons left and right in Footer
233
+ * tagline= ' ' Optional tagline underneath Header title
142
234
```
143
235
144
236
[ ![ browser support] ( /readme-assets/SLDSModals.gif )] ( /readme-assets/SLDSModals.gif )
145
237
146
238
239
+
240
+
241
+
242
+ ### [ Notifications] ( https://www.lightningdesignsystem.com/components/notifications )
243
+
244
+ ``` jsx
245
+
246
+ import {SLDSNotification } from ' design-system-react' ;
247
+
248
+ ...
249
+
250
+ < SLDSNotification variant= ' alert' theme= ' success' icon= ' notification' texture= {true } content= {successMsg} onDismiss= {this .dismissToast } / >
251
+ < SLDSNotification variant= ' alert' theme= ' error' icon= ' warning' texture= {true } content= {errorMsg} onDismiss= {this .dismissToast } / >
252
+ < SLDSNotification variant= ' toast' theme= ' success' icon= ' notification' content= {successMsg} / >
253
+ ```
254
+
255
+ [ ![ browser support] ( /readme-assets/SLDSNotifications.png )] ( /readme-assets/SLDSNotifications.png )
256
+
147
257
### [ PickLists] ( http://www.lightningdesignsystem.com/components/picklists#base&role=regular&status=all )
148
258
#### * Base only. Other variants coming soon.
149
259
@@ -160,26 +270,23 @@ const options = [
160
270
{label: ' D Option' ,value: ' D0' },
161
271
];
162
272
163
- < SLDSPicklistBase options= {options} label= " Contacts" placeholder= " Select a contact" / >
273
+ < SLDSPicklistBase
274
+ options= {options}
275
+ value= ' C0'
276
+ label= " Contacts"
277
+ modal= {true }
278
+ placeholder = " Select a contact"
279
+ onSelect= {this .handleOnSelect }
280
+ onClick= {this .handleOnClick }
281
+ onUpdateHighlighted= {this .handleOnUpdateHighlighted }
282
+ / >
164
283
165
284
```
166
285
167
286
[ ![ browser support] ( /readme-assets/SLDSPicklistBase.gif )] ( /readme-assets/SLDSPicklistBase.gif )
168
287
169
288
170
- ### [ Utility Icons] ( https://www.lightningdesignsystem.com/resources/icons#utility )
171
-
172
- ``` jsx
173
289
174
- import {SLDSUtilityIcon } from ' design-system-react' ;
175
-
176
- ...
177
-
178
- < SLDSUtilityIcon name= ' adduser' className= ' slds-input__icon slds-icon-text-default' / >
179
-
180
- ```
181
-
182
- [ ![ browser support] ( /readme-assets/SLDSUtilityIcons.png )] ( /readme-assets/SLDSUtilityIcons.png )
183
290
184
291
185
292
## Work in progress
@@ -189,7 +296,4 @@ import {SLDSUtilityIcon} from 'design-system-react';
189
296
[ ![ browser support] ( /readme-assets/SLDSDatePickerBase.gif )] ( /readme-assets/SLDSDatePickerBase.gif )
190
297
191
298
192
- ### Future Pipeline
193
- * Button - stateful variant
194
- * Lookup - multi-select, multi-scope variants
195
299
0 commit comments