Skip to content

Commit 2a7da17

Browse files
Merge branch 'master' of github.com:salesforce/design-system-react into DanFerro-slider-value-fix
2 parents ba700b3 + c0c49f5 commit 2a7da17

File tree

25 files changed

+156
-20
lines changed

25 files changed

+156
-20
lines changed

RELEASENOTES.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ These are changes that have backwards-compatible solutions present and that comp
3131

3232
### Latest Release
3333

34+
## Release 0.8.18
35+
36+
**Bugfixes**
37+
* `Icon` uses new values for `name` and `category` when changed.
38+
* Fixes console error that appears when using keyboard navigation to navigate the tree.
39+
40+
**Maintenance**
41+
* `url-exists` utility uses `fetch` instead of `xmlHttpRequest`.
42+
3443
## Release 0.8.17
3544

3645
**Bugfixes**
@@ -140,7 +149,7 @@ Adds new script storyshots:start that allows interactive viewing of what is bein
140149
## Release 0.8.10
141150

142151
**Minor features**
143-
* Combobox supports error messages.
152+
* Combobox supports error messages.
144153

145154
**Outside SLDS pattern added**
146155
* Multiple selection Combobox error messages should be placed after pillboxes with an additional `slds-has-error` wrapping div.

components/alert/__examples__/error.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Example extends React.Component {
1010
<IconSettings iconPath="/assets/icons">
1111
<AlertContainer>
1212
<Alert
13-
icon={<Icon category="utility" name="ban" />}
13+
icon={<Icon category="utility" name="error" />}
1414
labels={{
1515
heading:
1616
'Your browser is currently not supported. Your Salesforce may be degraded.',

components/alert/__tests__/__snapshots__/alert.snapshot-test.jsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ exports[`Alert Error DOM Snapshot 1`] = `
137137
className="slds-icon slds-icon--x-small"
138138
>
139139
<use
140-
xlinkHref="/assets/icons/utility-sprite/svg/symbols.svg#ban"
140+
xlinkHref="/assets/icons/utility-sprite/svg/symbols.svg#error"
141141
/>
142142
</svg>
143143
@@ -158,7 +158,7 @@ exports[`Alert Error DOM Snapshot 1`] = `
158158

159159
exports[`Alert Error HTML Snapshot 1`] = `
160160
"<div class=\\"slds-notify-container\\">
161-
<div class=\\"slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_error\\" role=\\"alert\\"><span class=\\"slds-assistive-text\\">error</span><span class=\\"slds-m-right--x-small\\"><svg aria-hidden=\\"true\\" class=\\"slds-icon slds-icon--x-small\\"><use xlink:href=\\"/assets/icons/utility-sprite/svg/symbols.svg#ban\\"></use></svg></span>
161+
<div class=\\"slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_error\\" role=\\"alert\\"><span class=\\"slds-assistive-text\\">error</span><span class=\\"slds-m-right--x-small\\"><svg aria-hidden=\\"true\\" class=\\"slds-icon slds-icon--x-small\\"><use xlink:href=\\"/assets/icons/utility-sprite/svg/symbols.svg#error\\"></use></svg></span>
162162
<h2>Your browser is currently not supported. Your Salesforce may be degraded. <a href=\\"javascript:void(0);\\">More Information</a></h2>
163163
</div>
164164
</div>"

components/tree/private/branch.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,7 @@ const handleKeyDownUp = (event, props) => {
114114

115115
const handleKeyDownRight = (event, props) => {
116116
if (props.node.expanded) {
117-
if (
118-
this.props.getNodes(props.node) &&
119-
this.props.getNodes(props.node).length > 0
120-
) {
117+
if (props.getNodes(props.node) && props.getNodes(props.node).length > 0) {
121118
handleKeyDownDown(event, props);
122119
}
123120
} else {
@@ -134,11 +131,14 @@ const handleKeyDownLeft = (event, props) => {
134131
);
135132
const index = nodes.indexOf(props.parent);
136133
if (index !== -1) {
137-
props.onExpand(event, {
138-
node: props.parent,
139-
select: true,
140-
expand: !props.parent.expanded,
141-
treeIndex: props.flattenedNodes[index].treeIndex,
134+
props.onExpand({
135+
event,
136+
data: {
137+
node: props.parent,
138+
select: true,
139+
expand: !props.parent.expanded,
140+
treeIndex: props.flattenedNodes[index].treeIndex,
141+
},
142142
});
143143
}
144144
}

components/utilities/utility-icon/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const UtilityIcon = (
6868
return inlineData ? (
6969
<Svg data={inlineData} name={name} {...rest} />
7070
) : (
71-
<svg {...rest}>
71+
<svg key={`${name}_${category}`} {...rest}>
7272
<use xlinkHref={modifiedPath} />
7373
</svg>
7474
);

docs/PULL_REQUEST_TEMPLATE.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@ Fixes #
44

55
---
66

7-
### Pull Request Review checklist (do not remove)
7+
### CONTRIBUTOR checklist (do not remove)
8+
Please complete for every pull request
89

10+
* [ ] First-time contributors should sign the Contributor License Agreement. It's a fancy way of saying that you are giving away your contribution to this project. If you haven't before, wait a few minutes and a bot will comment on this pull request with instructions.
911
* [ ] `npm run lint:fix` has been run and linting passes.
1012
* [ ] Mocha, Jest (Storyshots), and `components/component-docs.json` CI tests pass (`npm test`).
1113
* [ ] Tests have been added for new props to prevent regressions in the future. See [readme](https://github.com/salesforce/design-system-react/blob/master/tests/README.md).
1214
* [ ] Review the appropriate Storybook stories. Open [http://localhost:9001/](http://localhost:9001/).
1315
* [ ] The Accessibility panel of each Storybook story has 0 violations (aXe). Open [http://localhost:9001/](http://localhost:9001/).
1416
* [ ] Review tests are passing in the browser. Open [http://localhost:8001/](http://localhost:8001/).
1517
* [ ] Review markup conforms to [SLDS](https://www.lightningdesignsystem.com/) by looking at [DOM snapshot strings](https://facebook.github.io/jest/docs/en/snapshot-testing.html).
18+
19+
### REVIEWER checklist (do not remove)
20+
21+
* [ ] TravisCI tests pass. This includes linting, Mocha, Jest, Storyshots, and `components/component-docs.json` tests.
22+
* [ ] Tests have been added for new props to prevent regressions in the future. See [readme](https://github.com/salesforce/design-system-react/blob/master/tests/README.md).
23+
* [ ] Review the appropriate Storybook stories. Open [http://localhost:9001/](http://localhost:9001/).
24+
* [ ] The Accessibility panel of each Storybook story has 0 violations (aXe). Open [http://localhost:9001/](http://localhost:9001/).
25+
* [ ] Review tests are passing in the browser. Open [http://localhost:8001/](http://localhost:8001/).
26+
* [ ] Review markup conforms to [SLDS](https://www.lightningdesignsystem.com/) by looking at [DOM snapshot strings](https://facebook.github.io/jest/docs/en/snapshot-testing.html).
1627
* [ ] Add year-first date and commit SHA to `last-slds-markup-review` in `package.json` and push.
1728
* [ ] Request a review of the deployed Heroku app by the Salesforce UX Accessibility Team.
1829
* [ ] Add year-first review date, and commit SHA, `last-accessibility-review`, to `package.json` and push.

docs/browser-compatibility.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ The eventual goal is to remove all polyfills (such as [lodash](https://lodash.co
88

99
**Please add any additional polyfills that you need to the list below** when you discover them. This library uses the following ECMAScript features:
1010

11-
* findIndex - use [core-js library](https://github.com/zloirock/core-js#commonjs)
12-
* classList - use [classList.js](https://github.com/eligrey/classList.js)
11+
* `Array.prototype.findIndex` - use [core-js library](https://github.com/zloirock/core-js#commonjs)
12+
* `Element.classList` - use [classList.js](https://github.com/eligrey/classList.js)
13+
* `Object.assign` - use [core-js library](https://github.com/zloirock/core-js#commonjs)
1314

1415
### Internet Explorer 11 Support
1516

docs/codebase-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ Some props accept an existing Design System React component such as the `dropdow
315315

316316
In a way, this is "grandparent control" in that it surfaces the internal API of sub-components to the consuming developer in a way that the parent of the parent can control it. The parent component (such as `DataTableRowActions`) shallow merges the props from itself with the component props provided from the developer. The developers or the "grandparent" takes precedence and merges in last.
317317

318-
This pattern creates a separation of concern and a more declarative approach that relies on child components with their own props instead of additional props on the parent component such as `<Button iconClassName />`. Passing in <Dropdown options={} /> to a dropdown prop limits the aliasing of props for child components that already exist and reduces duplication of `PropType` documentation and increases library maintainability.
318+
This pattern creates a separation of concern and a more declarative approach that relies on child components with their own props instead of additional props on the parent component such as `<Button iconClassName />`. Passing in `<Dropdown options={} />` to a `dropdown` prop limits the aliasing of props for child components that already exist and reduces duplication of `PropType` documentation and increases library maintainability.
319319

320320
## Prefer Ternary to Sub-render
321321

docs/create-react-app.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ The following tasks will help you get started using Design System React within C
1212
* `/node_modules/@salesforce-ux/design-system/assets/styles/salesforce-lightning-design-system.min.css`
1313
1. Copy SLDS icons folder to `public` folder
1414
* `/node_modules/@salesforce-ux/design-system/assets/icons`
15+
1. Copy SLDS fonts folder to `public` folder
16+
* `/node_modules/@salesforce-ux/design-system/assets/fonts`
1517
1. Add CSS file to `index.html`
1618
* `<link rel="stylesheet" type="text/css" href="/salesforce-lightning-design-system.min.css">`
1719
1. Copy examples from [Design System React website](https://react.lightningdesignsystem.com/) into `app.js`.

docs/getting-started.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Getting Started
2+
3+
## Install
4+
5+
```
6+
$ npm install @salesforce-ux/design-system @salesforce/design-system-react
7+
```
8+
9+
## Project Overview
10+
11+
Design System React is an implementation of the [Lightning Design System](http://www.lightningdesignsystem.com/) where each Design System React component is a specific variant of a component from Lightning Design System. For example, [Combobox](components/comboboxes) represents [Lightning Design System Menu > Dropdown](http://www.lightningdesignsystem.com/components/combobox).
12+
13+
If you are new to React or an application state container like Redux, please review the tips and tutorials on the [Resources](/resources/) page along with the Concepts and Best Practices section of the [Contributing](/contributing/) page.
14+
15+
The easiest way to get started with Design System React is to click through to any of our [examples](/components) where you can play with it live.
16+
17+
Design System React is currently optimized for React ${reactVersion} and Lightning Design System ${sldsVersion}.
18+
19+
### Quick Setup (CommonJS)
20+
21+
A CommonJS-compatible version has been included within the NPM package to allows usage without transpiling. Use the following named `import` syntax to access CommonJS components from `/lib/index.js`:
22+
23+
```
24+
import { Button } from '@salesforce/design-system-react';
25+
26+
<Button label="Hello Button" />
27+
```
28+
29+
### Recommended Usage (ES6 modules)
30+
31+
Recommended usage requires that your babel presets are set up correctly. `create-react-app` and environments that do not transpile code within `node_modules` are not compatible with the component import below. All the examples on the [documentation site](https://react.lightningdesignsystem.com/) use this syntax. You can use the Babel preset, `@salesforce/babel-preset-design-system-react`, to get started. [This preset](https://npmjs.com/package/@salesforce/babel-preset-design-system-react) will keep Babel compatible with Design System React and allow ES6 module benefits such as tree-shaking.
32+
33+
```
34+
import Button from '@salesforce/design-system-react/components/button';
35+
36+
<Button label="Hello Button" />
37+
```
38+
39+
#### Transpile with `.babelrc` settings
40+
41+
```json
42+
{
43+
"presets": ["@salesforce/babel-preset-design-system-react"]
44+
}
45+
```
46+
47+
Assuming you’re using the [babel loader for Webpack](https://github.com/babel/babel-loader), you’ll also want to tell the loader to go ahead and include the design-system-react folders in `node_modules`. Instead of excluding all of node_modules, which some tutorials have you do, we’d recommend explicitly including each directory where you have ES2015 code that you want Babel to process. Something like the following **Webpack v1** file:
48+
49+
```js
50+
onst path = require('path');
51+
const webpack = require('webpack');
52+
const ExtractTextPlugin = require('extract-text-webpack-plugin');
53+
54+
module.exports = {
55+
entry: {
56+
bundle: './public/src/index.js'
57+
},
58+
resolve: {
59+
extensions: [
60+
'',
61+
'.js',
62+
'.jsx'
63+
]
64+
},
65+
devtool: 'source-map',
66+
output: {
67+
path: path.join(__dirname, 'build'),
68+
filename: '[name].js',
69+
publicPath: '/'
70+
},
71+
module: {
72+
loaders: [
73+
{
74+
test: /\.jsx?$/,
75+
loaders: ['babel'],
76+
include: [
77+
path.join(__dirname, 'public/src'),
78+
path.join(__dirname, 'node_modules/@salesforce/design-system-react'),
79+
]
80+
},
81+
{
82+
test: /\.css$/,
83+
loader: ExtractTextPlugin.extract(
84+
'style-loader',
85+
'css-loader?url=false&outputStyle=expanded&sourceMap=true&sourceMapContents=true'
86+
)
87+
},
88+
{
89+
test: /\.(svg|gif|jpe?g|png)$/,
90+
loader: 'url-loader?limit=10000'
91+
},
92+
{
93+
test: /\.(eot|woff|woff2|ttf)$/,
94+
loader: 'url-loader?limit=30&name=assets/fonts/webfonts/[name].[ext]'
95+
}
96+
]
97+
},
98+
plugins: [
99+
new webpack.DefinePlugin({
100+
'process.env': { NODE_ENV: JSON.stringify('production') }
101+
}),
102+
new ExtractTextPlugin('[name].css')
103+
]
104+
};```
105+
106+
## CDN / Bundle
107+
108+
A [bundled version of Design System React](https://github.com/salesforce/design-system-react/archive/v${dsrVersion}.zip) is available for download, but is not the recommended method for including the components in a project and should only be used for quick prototyping efforts.
109+
110+
## Have fun!
111+
112+
If you have support questions, please post a question to [StackOverflow](https://stackoverflow.com/questions/tagged/design-system-react) and tag with `design-system-react`. If you find any bugs, create a [GitHub Issue](https://github.com/salesforce/design-system-react/issues).

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "design-system-react",
3-
"version": "0.8.17",
3+
"version": "0.8.18",
44
"description": "Salesforce Lightning Design System for React",
55
"license": "SEE LICENSE IN README.md",
66
"engines": {

scripts/dist.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ echo "## Cloning additional files"
3636
cp .gitignore .tmp/.gitignore
3737
cp LICENSE.txt .tmp/LICENSE.txt
3838
cp package.json .tmp/package.json
39+
cp -r docs .tmp/docs
3940
cp docs/README-dist.md .tmp/README.md
4041

4142
echo "## Running JS steps"

0 commit comments

Comments
 (0)