-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release commit for 0.1.1-commonjs [ci skip]
- Loading branch information
David Brainer-Banker
committed
Jul 19, 2016
0 parents
commit 0fbc0f7
Showing
114 changed files
with
47,729 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# filesystem | ||
.DS_Store | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# gh-pages | ||
_site/* | ||
|
||
# Editors / IDEs | ||
.idea | ||
*.sublime-project | ||
*.sublime-workspace | ||
|
||
# node_module cache for TravisCI, etc. | ||
node_modules.tar.gz | ||
|
||
npm-debug.log | ||
.esformatter | ||
.npm | ||
.tmp* | ||
server/node_modules | ||
server/public/assets/bundle | ||
scripts/pre-commit.sh | ||
coverage/ | ||
storybook/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Contributing Code | ||
|
||
1. Create a new issue before starting your project so that we can keep track of what you are trying to add/fix. That way, we can also offer suggestions or let you know if there is already an effort in progress. | ||
2. Fork off this repository. | ||
3. Create a topic branch for the issue that you are trying to add. | ||
4. Edit the code in your fork. | ||
5. Send us a well documented pull request when you are done. | ||
|
||
**GitHub pull requests** should meet the following criteria: | ||
|
||
- descriptive title | ||
- brief summary | ||
- @mention several relevant people to review the code | ||
- add helpful GitHub comments on lines where you have questions or concerns | ||
|
||
We'll review your code, suggest any needed changes, and merge it in. Thank you. | ||
|
||
## Code Guidelines | ||
|
||
1. We use es6 and make use of a [shared eslint repository](https://github.com/salesforce-ux/eslint-config-slds) based on [Airbnb's Code guidelines](https://github.com/airbnb/javascript). You can refer to our [.eslintrc](https://github.com/salesforce-ux/design-system-react/blob/master/.eslintrc). | ||
|
||
2. `displayName`, `propTypes`, and `defaultProps` should be in that order. | ||
|
||
3. Component lifecyle methods (`componentDidMount`, `componentWillUnmount`, etc.) should be near the top so that developers know where to look for them and don't create duplicate methods. | ||
|
||
4. Below is a react component template. Note that `displayName`, `propTypes`, and `defaultProps` are required. | ||
|
||
```jsx | ||
const MyComponent = React.createClass({ | ||
displayName: 'MyComponent', | ||
|
||
propTypes: { | ||
... | ||
}, | ||
|
||
defaultProps: { | ||
... | ||
}, | ||
|
||
render () { | ||
return ( | ||
<div>My Component here</div> | ||
); | ||
} | ||
}); | ||
|
||
export default MyComponent; | ||
``` | ||
|
||
## Finalize new component/features | ||
|
||
1. Write tests for your new component/feature. | ||
2. Run `npm test`. | ||
3. After your PR is merged, make sure it appears here: [https://design-system-react-components.herokuapp.com](https://preview:8f2924b3d2232a37f63c32f70d9b3aba@design-system-react-components.herokuapp.com/). If it doesn't, reach out to one of the following people: | ||
* [Donielle Berg](https://github.com/donnieberg) | ||
* [Ivan Bogdanov](https://github.com/madpotato) | ||
* [David Brainer](https://github.com/tweettypography) | ||
4. Get your component/feature approved by the UX Accessibility Team (refer to the link above). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Copyright (c) 2015, Salesforce.com, Inc. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
* 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. | ||
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
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 HOLDER 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
Welcome to [Design System React](https://react.lightningdesignsystem.com/). | ||
|
||
Presented here are Javascript components based on [Lightning Design System](https://www.lightningdesignsystem.com/) and designed for React. | ||
|
||
* Tailored for building Salesforce apps: Using Design System React ensures that your app's UI reflect the Salesforce Lightning look, feel, and behaviors. | ||
* Continuously updated: As long as you’re using the latest version of Design System React, your pages are always up to date with Salesforce UI changes. | ||
|
||
## Documentation | ||
|
||
[Design System React website](https://react.lightningdesignsystem.com/) | ||
|
||
[Salesforce Lightning Design System website](https://www.lightningdesignsystem.com/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
Copyright (c) 2015, salesforce.com, inc. All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
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. | ||
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. | ||
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. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
var _reactModal = require('react-modal'); | ||
|
||
var _reactModal2 = _interopRequireDefault(_reactModal); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var assetsPath = 'assets/'; | ||
var appRoot = void 0; | ||
module.exports = { | ||
setAssetsPath: function setAssetsPath(path) { | ||
if (path) { | ||
assetsPath = path; | ||
} | ||
}, | ||
getAssetsPath: function getAssetsPath() { | ||
return String(assetsPath); | ||
}, | ||
setAppElement: function setAppElement(el) { | ||
if (el) { | ||
appRoot = el; | ||
_reactModal2.default.setAppElement(el); | ||
} | ||
}, | ||
getAppElement: function getAppElement() { | ||
return appRoot; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use strict'; | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _constants = require('../../utilities/constants'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
/** | ||
* Use breadcrumbs to note the path of a record and help the user to navigate back to the parent.Breadcrumb based on SLDS 2.1.0-dev | ||
*/ | ||
/* | ||
Copyright (c) 2015, salesforce.com, inc. All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
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. | ||
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. | ||
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. | ||
*/ | ||
|
||
// # Breadcrumbs | ||
|
||
// Implements the [Breadcrumbs design pattern](https://www.lightningdesignsystem.com/components/breadcrumbs) in React. | ||
// Based on SLDS v2.1.0-rc.2 | ||
|
||
// ## Dependencies | ||
|
||
// ### React | ||
var BreadCrumb = function BreadCrumb(props) { | ||
var assistiveText = props.assistiveText; | ||
var trail = props.trail; | ||
|
||
|
||
return _react2.default.createElement( | ||
'nav', | ||
{ role: 'navigation', 'aria-label': assistiveText }, | ||
_react2.default.createElement( | ||
'ol', | ||
{ className: 'slds-breadcrumb slds-list--horizontal' }, | ||
trail.map(function (crumb, index) { | ||
return _react2.default.createElement( | ||
'li', | ||
{ | ||
key: 'BreadCrumb.' + index, | ||
className: 'slds-breadcrumb__item slds-text-title--caps' | ||
}, | ||
crumb | ||
); | ||
}) | ||
) | ||
); | ||
}; | ||
|
||
// ## Constants | ||
|
||
|
||
BreadCrumb.displayName = _constants.BREAD_CRUMB; | ||
|
||
BreadCrumb.propTypes = { | ||
/** | ||
* The assistive text for the breadcrumb trail | ||
*/ | ||
assistiveText: _react2.default.PropTypes.string, | ||
/** | ||
* An array of react elements presumably anchor elements. | ||
*/ | ||
trail: _react2.default.PropTypes.array | ||
}; | ||
|
||
BreadCrumb.defaultProps = { | ||
assistiveText: 'Breadcrumbs' | ||
}; | ||
|
||
module.exports = BreadCrumb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
'use strict'; | ||
|
||
var _react = require('react'); | ||
|
||
var _react2 = _interopRequireDefault(_react); | ||
|
||
var _classnames = require('classnames'); | ||
|
||
var _classnames2 = _interopRequireDefault(_classnames); | ||
|
||
var _constants = require('../../utilities/constants'); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var propTypes = { | ||
/** | ||
* Children are expected to be components. If last button triggers a dropdown menu, use Dropdown instead of Button. | ||
*/ | ||
children: _react2.default.PropTypes.node.isRequired, | ||
className: _react2.default.PropTypes.string | ||
}; | ||
|
||
/** | ||
* The ButtonGroup component wraps other components (ie. Button, MenuDropdown, PopoverTooltip, etc). | ||
*/ | ||
/* | ||
Copyright (c) 2015, salesforce.com, inc. All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
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. | ||
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. | ||
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. | ||
*/ | ||
|
||
var ButtonGroup = function ButtonGroup(props) { | ||
return _react2.default.createElement( | ||
'div', | ||
{ className: (0, _classnames2.default)('slds-button-group', props.className), role: 'group' }, | ||
props.children | ||
); | ||
}; | ||
|
||
ButtonGroup.displayName = _constants.BUTTON_GROUP; | ||
ButtonGroup.propTypes = propTypes; | ||
|
||
module.exports = ButtonGroup; |
Oops, something went wrong.