Skip to content

Commit a665957

Browse files
Merge branch 'master' of github.com:salesforce-ux/design-system-react into GH-626---checkbox-needs-an-indeterminate-state-21
2 parents 749540d + 4bd8c4a commit a665957

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2342
-154
lines changed

.babelrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"presets": ["react", "es2015", "stage-1"]
2+
"presets": ["react", "es2015", "stage-1"],
3+
"env": {
4+
"amd": {
5+
"plugins": ["import-noop"]
6+
},
7+
"commonjs": {
8+
"plugins": ["import-noop"]
9+
}
10+
}
311
}

.eslintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "eslint-config-slds",
3-
"parser": "babel-eslint",
2+
"extends": "eslint-config-slds",
3+
"parser": "babel-eslint",
44
"rules": {}
5-
}
5+
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "4.4"
3+
- "5.6"
44
install:
55
- npm install npm -g
66
- npm install

CONTRIBUTING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ We'll review your code, suggest any needed changes, and merge it in. Thank you.
3535
- <a name="boolean-prop-prefix" href="#boolean-prop-prefix">#</a> If a prop is a boolean, please prefix with `is` or `can` or suffix it with `-able`. Never default a prop to `true`.
3636
- <a name="use-checkprops" href="#use-checkprops">#</a> Add as many prop checking tests that will _only run in development_ as needed via `checkProp`. If the test can become an independent module and work in multiple components, add it to the `utilities` folder.
3737
- <a name="all-text-can-be-internationalized" href="#all-text-can-be-internationalized">#</a> Any text the user can read (including text for screenreaders) should be able to be set via a prop for internationalization.
38+
- <a name="avoid-css" href="#avoid-css">#</a> Avoid use of inline styles and additional CSS classes not present in SLDS.
3839
- <a name="different-react-component-hierarchy" href="#different-react-component-hierarchy">#</a> React component hierarchy doesn't always mean HTML tag hierarchy. Sometimes children become the wrapping component.
3940
- <a name="classnames" href="#classnames">#</a> This library makes extensive use of the [classnames](https://github.com/JedWatson/classnames) library for feeding conditional CSS classes into `className` attributes and allows a variety of types such as `string`, `object`, and `arrays`. Please review the libary's API.
4041
- <a name="props-in-get-initial-state" href="#props-in-get-initial-state">#</a> [Props in getInitialState is an anti-pattern.](https://facebook.github.io/react/tips/props-in-getInitialState-as-anti-pattern.html)
@@ -349,9 +350,9 @@ from the [Planning Center](https://github.com/planningcenter/react-patterns)
349350

350351

351352
# Releasing
352-
1. [Add to release notes](https://github.com/salesforce-ux/design-system-react/blob/master/RELEASENOTES.md).
353+
1. [Write the release notes](https://github.com/salesforce-ux/design-system-react/blob/master/RELEASENOTES.md) that cover everything that has changed since the last release. You don't have to commit your release notes changes though. The following script will do that for you.
353354
1. Run `npm prune` and `npm install` to clean up node modules in preparation for build.
354-
1. **Choose one**: `npm run release-patch` or `npm run release-minor` This script pulls from upstream, bumps the version, commits changes, and publishes tags to your upstream repo (that is this repo).
355+
1. **Choose one**: `npm run release-patch` or `npm run release-minor` This script pulls from upstream, bumps the version, commits changes, and publishes tags to your `upstream` repository (that is this repo).
355356
1. Copy and paste your release notes into the [Github Draft Release UI](https://github.com/salesforce-ux/design-system-react/releases) and publish.
356357

357358
_If you are timid about releasing or need your pull request in review "pre-released," you can publish to origin (your fork) with `npm run publish-to-git` and then test and review the tag on your fork. This is just the publish step though, any other tasks you will need to do manually to test publishing._

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
### Salesforce Design System: Interactive accessible components for React
1+
# Salesforce Design System
2+
### Interactive and accessible components for React
23

34
[![Build Status](https://travis-ci.com/salesforce-ux/design-system-react.svg?token=BMXxPFKR5GZuYsqAFsEf&branch=master)](https://travis-ci.com/salesforce-ux/design-system-react)
45

@@ -8,7 +9,7 @@ Please visit [Design System React](https://react.lightningdesignsystem.com/) for
89
The Design System React library is the [React](https://facebook.github.io/react/) implementation of the [Lightning Design System](https://www.lightningdesignsystem.com/). Each Design System React component is a specific variant of a component from Lightning Design System. For example, `SLDSMenuDropdown` represents [Lightning Design System Menu > Dropdown](http://www.lightningdesignsystem.com/components/menus/#dropdown),
910
and `SLDSLookup` represents [Lightning Design System Lookup > Base](http://www.lightningdesignsystem.com/components/lookups/#base).
1011

11-
If you are using the ECMAScript 6 source files in `./components/`, you will need to enable your ES5 transpiler to allow [stage-1 and higher proposed features](https://babeljs.io/docs/plugins/preset-stage-1/). If you are using Babel, it may be helpful to install the [NPM module](https://www.npmjs.com/package/babel-preset-stage-1) `babel-preset-stage-1` into your project and review the `.babelrc` file in this project.
12+
_It is highly recommended that you `npm install` the `-es` suffixed package tag and import the individual [ECMAScript 6](https://github.com/lukehoban/es6features/blob/master/README.md) source files in `./components/`._ If you do this, you will need to enable your ES5 transpiler to allow [stage-1 and higher proposed features](https://babeljs.io/docs/plugins/preset-stage-1/). If you are using Babel, it may be helpful to install the [NPM module](https://www.npmjs.com/package/babel-preset-stage-1) `babel-preset-stage-1` into your project and review the `.babelrc` file in this project. If you are looking for a a [CommonJS](https://nodejs.org/docs/latest/api/modules.html)-compatible package, use the package tag that does not have a suffix.
1213

1314
### Run local development and testing server
1415

@@ -33,7 +34,7 @@ npm run dist
3334

3435
## Getting Started
3536

36-
Note: `design-system-react` is optimized for React 0.14.x and uses Lightning Design System 2.1.0-rc.4. You can find a more complete [getting started guide](https://react.lightningdesignsystem.com/getting-started) on the documentation site.
37+
Note: `design-system-react` is optimized for React 0.14.x and uses Lightning Design System 2.1.3. You can find a more complete [getting started guide](https://react.lightningdesignsystem.com/getting-started) on the documentation site.
3738

3839
### New to React?
3940

RELEASENOTES.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,112 @@
1-
# Salesforce Lightning Design System
2-
# React Components: design-system-react
31
# Release notes
2+
_Salesforce Lightning Design System :: React Components :: design-system-react_
3+
4+
## Future Breaking Changes
5+
6+
These are changes that have backwards-compatible solutions present and that compatibiity will be removed at a breaking change release in the future.
7+
8+
- `TabsPane` has be replaced with `TabsPanel`.
9+
- `Input`'s props: `iconPosition`, `iconAssistiveText`, `iconCategory`, `iconName`, `onIconClick` are deprecated. An `Icon` component should be used instead.
10+
- `DataTable`'s' `collection`, `onSelect`, `onDeselect` are deprecated.
11+
- The prop `modal` in `DatePicker`, `Lookup`, `MenuDropdown`, `MenuPicklist`, `TimePicker` is deprecated
12+
- Remove `openByDefault` from `PopoverTooltip`.
13+
14+
---
15+
16+
## Release 0.4.4
17+
18+
**BUG FIX**
19+
20+
- Tabs' `Panel` changed to `TabsPanel` to align with other component names.
21+
22+
## Release 0.4.3
23+
24+
**BUG FIX**
25+
26+
- Manages CSS imports better for ES6, CommonJS and AMD packages. Previously, CSS imports would fail if a CSS file imports were present in the ECMAScript. This will remove the CSS imports from CommonJS and AMD packages.
27+
- Changes Tabs' `Pane` to `Panel`
28+
- Removes prototype status from Tabs
29+
30+
## Release 0.4.1
31+
32+
**BUG FIX**
33+
34+
- Fixes bugs in allowing parent to control state of dropdown.
35+
36+
37+
## Release 0.4.0
38+
39+
**BREAKING CHANGES**
40+
41+
- Replaces `modal` with `isInline` for all dropdown-like components.
42+
43+
**MAJOR CHANGES**
44+
45+
- Adds a Tabs component.
46+
- Allow parent to control state of dropdown.
47+
48+
**BUG FIX**
49+
50+
- Tweaks the class names on dropdown trigger to match SLDS.
51+
452

553
## Release 0.3.16
654

755
**BUG FIX**
856

957
- Due to deprecations in v0.3.15 of `Input`'s `onIconClick`, an `onSearch` callback has been added to `Search`.
1058

59+
1160
## Release 0.3.15
1261

1362
**MAJOR CHANGES**
1463

15-
- Allow icon on the left and right of inputs.
64+
- Allow icon on the left and right of inputs.
1665
- Search can be `clearable` now with right clear icon.
1766
- Input now uses `iconRight` and `iconLeft` and [accepts](https://github.com/salesforce-ux/design-system-react/blob/master/stories/forms/input/index.jsx#L36) an `InputIcon` component. Use of `onClick` [makes it clickable](https://github.com/salesforce-ux/design-system-react/blob/master/stories/forms/input/index.jsx#L11).
1867
- The wrapping span has been removed from `ButtonIcon`. `ButtonIcon` is just a CSS customization of `UtilityIcon` now.
1968
- Be sure to check inputs for deprecation notices.
2069

70+
2171
## Release 0.3.14
2272

2373
- Remove top divider as default of `MenuDropdown` list menu heading items.
24-
- Adds `divider` key with values `top` and `bottom` to `MenuDropdown` options to allow for a divider to be added to a heading.
74+
- Adds `divider` key with values `top` and `bottom` to `MenuDropdown` options to allow for a divider to be added to a heading.
75+
2576

2677
## Release 0.3.13
2778

2879
**BUG FIX**
2980
- In App Launcher, Tile Truncate utility uses new props to prevent UI state from being out-of-sync with props.
3081

82+
3183
## Release 0.3.12
3284

3385
**BUG FIX**
3486
- In Picklist, pressing enter now triggers the `onClick` prop
3587
- Add Dropdown wrapping `div` to align with SLDS and allow menu nubbins to be positioned with default CSS. [DOM change]
3688
- Make Global Header dropdowns inline instead of "modal"
3789

90+
3891
## Release 0.3.11
3992

4093
**BUG FIX**
4194
- In Picklist, tabbing moves focus to the next tabbable DOM element, instead of opening the menu.
4295
- In Dropdown, an `onCLick` prop is passed down to all custom content children, so that they can close the menu.
4396

97+
4498
## Release 0.3.10
4599

46100
**MAJOR CHANGES**
47101
- Adds `hybrid` to `openOn` options. This allows a click to open and hover out to close in case one does not have control of the DOM outside of the navigation.
48102

103+
49104
## Release 0.3.9
50105

51106
**Bug Fix**
52107
- Prevent Global Nav menus from flipping up at small screen heights
53108

109+
54110
## Release 0.3.8
55111

56112
**Bug Fix**
@@ -59,9 +115,10 @@
59115
- Make DatePicker and TimePicker value prop the source of future state
60116

61117
**Documentation**
62-
- Add mention of classnames library to `contributing.md`
118+
- Add mention of classnames library to `contributing.md`
63119
- Add test coverage comments, surfacing in-browser tests
64120

121+
65122
## Release 0.3.7
66123

67124
**MAJOR CHANGES**
@@ -74,6 +131,7 @@
74131
- Sends correct `href` to App Launcher Tile click callback
75132
- Corrects markup for menu separators and headers in Global Navigation
76133

134+
77135
## Release 0.3.6
78136

79137
**MAJOR CHANGES**
@@ -83,12 +141,14 @@
83141
**Bug Fix**
84142
- Detect PageHeader detail field truncation on update instead of mount.
85143

144+
86145
## Release 0.3.5
87146

88147
**MAJOR CHANGES**
89148
- Add `style` and `bodyClassName` props to Card to allow overflow on Card body.
90149
- Add `length` prop to GlobalNavigationMenuDropdown. It can be set to `null` to remove scrolling.
91150

151+
92152
## Release 0.3.4
93153

94154
**MAJOR CHANGES - SLDSPageHeader**
@@ -101,6 +161,7 @@
101161
- No longer renders a close button if modal type is prompt.
102162
- Lookup search icon default should be on right side.
103163

164+
104165
## Release 0.3.2
105166

106167
**MAJOR CHANGES**

components/app-launcher/index.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,21 @@ const AppLauncher = React.createClass({
8080
*/
8181
isOpen: PropTypes.bool,
8282
/**
83-
* Button that exists in the upper right hand corner of the App Launcher modal
83+
* CSS classes to be added to App Launcher Modal.
8484
*/
85-
modalHeaderButton: PropTypes.node,
85+
modalClassName: PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string]),
8686
/**
87-
* Callback when the App Launcher Modal is closed
87+
* Button that exists in the upper right hand corner of the App Launcher modal
8888
*/
89-
onClose: PropTypes.func,
89+
modalHeaderButton: PropTypes.node,
9090
/**
9191
* Allows longer application names without truncating them.
9292
*/
9393
noTruncate: PropTypes.bool,
94+
/**
95+
* Callback when the App Launcher Modal is closed
96+
*/
97+
onClose: PropTypes.func,
9498
/**
9599
* Search bar for the Modal's header. Will typically be an instance of `design-system-react/forms/input/search`
96100
*/
@@ -230,7 +234,7 @@ const AppLauncher = React.createClass({
230234
contentStyle={{ minHeight: modalContentStaticHeight }}
231235
isOpen={isOpen}
232236
onRequestClose={this.closeAppLauncher}
233-
containerClassName="app-launcher"
237+
containerClassName={classNames('app-launcher', this.props.modalClassName)}
234238
size="large"
235239
header={customModalHeader}
236240
headerClassName="slds-app-launcher__header"

components/data-table/column.jsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,26 @@ const DataTableColumn = React.createClass({
2828

2929
// ### Prop Types
3030
propTypes: {
31+
/**
32+
* Use a _higher-order component_ to customize a data table cell that will override the default cell rendering. `CustomDataTableCell` must have the same `displayName` as `DataTableCell` or it will be ignored. If you want complete control of the HTML, including the wrapping `td`, you don't have to use `DataTableCell`.
33+
* ```
34+
* import DataTableCell from 'design-system-react/data-table/cell';
35+
* const CustomDataTableCell = ({ children, ...props }) => (
36+
* <DataTableCell {...props} >
37+
* <a href="javascript:void(0);">{children}</a>
38+
* </DataTableCell>
39+
* );
40+
* CustomDataTableCell.displayName = DataTableCell.displayName;
41+
*
42+
* <DataTable>
43+
* <DataTableColumn />
44+
* <DataTableColumn>
45+
* <DataTableCustomCell />
46+
* </DataTableColumn>
47+
* <DataTableRowActions />
48+
* </DataTable>
49+
* ```
50+
*/
3151
children: React.PropTypes.element,
3252
/**
3353
* The column label.

components/data-table/index.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,16 @@ const DataTable = React.createClass({
7676
*/
7777
buffered: PropTypes.bool,
7878
/**
79-
* Provide children of the type `<DataTableColumn />` to define the structure of the data being represented and children of the type `<DataTableRowActions />` to define a menu which will be rendered for each item in the grid. Custom `<DataTableCell />` implementations may also be passed in to override cell rendering.
79+
* Provide children of the type `<DataTableColumn />` to define the structure of the data being represented and children of the type `<DataTableRowActions />` to define a menu which will be rendered for each item in the grid. Use a _higher-order component_ to customize a data table cell that will override the default cell rendering. `CustomDataTableCell` must have the same `displayName` as `DataTableCell` or it will be ignored. If you want complete control of the HTML, including the wrapping `td`, you don't have to use `DataTableCell`.
8080
* ```
81+
* import DataTableCell from 'design-system-react/data-table/cell';
82+
* const CustomDataTableCell = ({ children, ...props }) => (
83+
* <DataTableCell {...props} >
84+
* <a href="javascript:void(0);">{children}</a>
85+
* </DataTableCell>
86+
* );
87+
* CustomDataTableCell.displayName = DataTableCell.displayName;
88+
*
8189
* <DataTable>
8290
* <DataTableColumn />
8391
* <DataTableColumn>

components/forms/input/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const Input = React.createClass({
216216
// Using [object destructuring](https://facebook.github.io/react/docs/transferring-props.html#transferring-with-...-in-jsx) to pass on any properties which are not explicitly defined.
217217
...props
218218
} = this.props;
219-
219+
220220
const labelText = label || assistiveText; // One of these is required to pass accessibility tests
221221

222222
// this is a hack to make left the default prop unless overwritten by `iconPosition="right"`

components/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,16 @@ export Spinner from './spinner';
120120
export SLDSTimepicker from './time-picker';
121121
export Timepicker from './time-picker';
122122

123+
export SLDSTabs from './tabs';
124+
export Tabs from './tabs';
125+
export SLDSTabsPanel from './tabs/panel';
126+
export TabsPanel from './tabs/panel';
127+
128+
// This is just an alias, Sydney Bristow. Remove at next breaking release.
129+
export SLDSPanel from './tabs/panel';
130+
export Panel from './tabs/panel';
131+
export SLDSPane from './tabs/panel';
132+
export Pane from './tabs/panel';
133+
123134
export SLDSUtilityIcon from './utilities/utility-icon';
124135
export UtilityIcon from './utilities/utility-icon';

components/menu-dropdown/button-trigger.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ const Trigger = React.createClass({
5555
* A unique ID is needed in order to support keyboard navigation, ARIA support, and connect the dropdown to the triggering button. This is provided by the `MenuDropdown`. Please use `MenuDropdown` to set.
5656
*/
5757
id: PropTypes.string,
58+
/**
59+
* Renders menu within the wrapping trigger as a sibling of the button. By default, you will have an absolutely positioned container at an elevated z-index.
60+
*/
61+
isInline: PropTypes.bool,
5862
/**
5963
* Informs the trigger on the open/close state of the dropdown menu
6064
*/
@@ -108,6 +112,7 @@ const Trigger = React.createClass({
108112
children, // eslint-disable-line no-unused-vars
109113
className,
110114
id,
115+
isInline, // eslint-disable-line no-unused-vars
111116
isOpen,
112117
onBlur,
113118
menu,
@@ -118,6 +123,7 @@ const Trigger = React.createClass({
118123
onMouseEnter,
119124
onMouseLeave,
120125
openOn,
126+
triggerRef,
121127
...deprecatedPropsFromMenuDropdown
122128
} = this.props;
123129

@@ -155,7 +161,7 @@ const Trigger = React.createClass({
155161
aria-haspopup="true"
156162
{...deprecatedPropsFromMenuDropdown}
157163
{...propsFromGrandchildButton}
158-
ref={this.props.triggerRef}
164+
ref={triggerRef}
159165
/>
160166
{menu}
161167
</div>

0 commit comments

Comments
 (0)