Skip to content

Commit 8410c30

Browse files
Merge pull request #1 from futuremint/interactivellama-es6-module-npm
Merges master
2 parents 6d9e480 + ea88cb8 commit 8410c30

Some content is hidden

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

54 files changed

+20543
-18124
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ $ npm install @salesforce-ux/design-system @salesforce/design-system-react
1515
Welcome to the project! :wave: This library is the [React](https://facebook.github.io/react/) implementation of the [Salesforce Lightning Design System](https://www.lightningdesignsystem.com/). This library has a peer dependency on `@salesforce-ux/design-system`, `react`, and `react-dom`. It has been tested with React >=15.4.1 <16 and is stable despite its version number. Please polyfill this library in order to meet your target environment needs.
1616

1717
* [Usage](#usage)
18-
* [Getting Started](https://react.lightningdesignsystem.com/getting-started/)
18+
* [Getting started](https://react.lightningdesignsystem.com/getting-started/)
1919
* [Documentation and interactive examples](https://react.lightningdesignsystem.com)
2020
* [Contributing](CONTRIBUTING.md)
21-
* [Codebase Overview](docs/codebase-overview.md)
21+
* [Codebase overview](docs/codebase-overview.md)
22+
* [Browser compatiblity and polyfills](docs/browser-compatibility.md)
2223
* [Usage with Webpack](docs/webpack.md)
24+
* [Open Sourcing Design System React](https://engineering.salesforce.com/open-sourcing-design-system-react-9be45b8bb127) - Medium article
2325

2426
## Usage
2527

RELEASENOTES.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,49 @@ These are changes that have backwards-compatible solutions present and that comp
3131

3232
### Latest Release
3333

34+
## Release 0.8.12
35+
36+
**Minor features**
37+
* Affix position of Dialogs with `hasStaticAlignment` prop. Allows greater control of Tooltip, Popover, and dialog components.
38+
* Set Datepicker's initial year dropdown menu highlight selection to current selected date.
39+
40+
## Release 0.8.11
41+
42+
**Minor features**
43+
* Allow `input` label of combobox to show as required
44+
* Input, Checkbox, and Radio support initial state (uncontrolled) in order to support applications with server-side form submission that are transitioning to atomic state.
45+
46+
**Maintenance**
47+
* Lint warnings from a third-party package have been removed from CI tests.
48+
49+
**Documentation**
50+
* Prop doc typos:
51+
* replaced rendered input block to code block
52+
* fixed broken link to source of Inline Edit Inputs
53+
54+
## Release 0.8.10
55+
56+
**Minor features**
57+
* Combobox supports error messages.
58+
59+
**Outside SLDS pattern added**
60+
* Multiple selection Combobox error messages should be placed after pillboxes with an additional `slds-has-error` wrapping div.
61+
62+
**Maintenance**
63+
* Update Dropdown Menu children description
64+
* Update SLDS peer dependency to allow 2.6.0-alphas
65+
* Remove plus-plus (`var++`) instances from library for clarity
66+
67+
**Notice**
68+
`package.module` has been removed from the NPM module until a transpiled ES6 module build can be published to support it. The current `package.module` is considered broken already for Create React Apps--for instance, so this is not considered a breaking change. Your module bundler will just use the CommonJS build unless you are already transpiling the source code, so no changes should be need to be made.
69+
3470
## Release 0.8.9
3571

3672
**Minor features**
3773

3874
* Combobox menu supports subheadings and line separators.
75+
76+
**Outside SLDS pattern added**
3977
* UX pattern created for Combobox autocomplete that limits subheadings to those that have "child" matching items.
4078

4179
## Release 0.8.8

components/button-group/__tests__/__snapshots__/button-group.snapshot-test.jsx.snap

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ exports[`Button Group Checkbox DOM Snapshot 1`] = `
2424
aria-owns={undefined}
2525
aria-required={undefined}
2626
checked={undefined}
27+
defaultChecked={undefined}
2728
disabled={undefined}
2829
id="ButtonGroupExampleMon"
2930
name={undefined}
@@ -57,6 +58,7 @@ exports[`Button Group Checkbox DOM Snapshot 1`] = `
5758
aria-owns={undefined}
5859
aria-required={undefined}
5960
checked={undefined}
61+
defaultChecked={undefined}
6062
disabled={undefined}
6163
id="ButtonGroupExampleTue"
6264
name={undefined}
@@ -90,6 +92,7 @@ exports[`Button Group Checkbox DOM Snapshot 1`] = `
9092
aria-owns={undefined}
9193
aria-required={undefined}
9294
checked={undefined}
95+
defaultChecked={undefined}
9396
disabled={undefined}
9497
id="ButtonGroupExampleWed"
9598
name={undefined}
@@ -123,6 +126,7 @@ exports[`Button Group Checkbox DOM Snapshot 1`] = `
123126
aria-owns={undefined}
124127
aria-required={undefined}
125128
checked={undefined}
129+
defaultChecked={undefined}
126130
disabled={undefined}
127131
id="ButtonGroupExampleThu"
128132
name={undefined}
@@ -156,6 +160,7 @@ exports[`Button Group Checkbox DOM Snapshot 1`] = `
156160
aria-owns={undefined}
157161
aria-required={undefined}
158162
checked={undefined}
163+
defaultChecked={undefined}
159164
disabled={undefined}
160165
id="ButtonGroupExampleFri"
161166
name={undefined}
@@ -209,6 +214,7 @@ exports[`Button Group Checkbox Error DOM Snapshot 1`] = `
209214
aria-owns={undefined}
210215
aria-required={undefined}
211216
checked={undefined}
217+
defaultChecked={undefined}
212218
disabled={undefined}
213219
id="ButtonGroupExampleMon"
214220
name={undefined}
@@ -242,6 +248,7 @@ exports[`Button Group Checkbox Error DOM Snapshot 1`] = `
242248
aria-owns={undefined}
243249
aria-required={undefined}
244250
checked={undefined}
251+
defaultChecked={undefined}
245252
disabled={undefined}
246253
id="ButtonGroupExampleTue"
247254
name={undefined}
@@ -275,6 +282,7 @@ exports[`Button Group Checkbox Error DOM Snapshot 1`] = `
275282
aria-owns={undefined}
276283
aria-required={undefined}
277284
checked={undefined}
285+
defaultChecked={undefined}
278286
disabled={undefined}
279287
id="ButtonGroupExampleWed"
280288
name={undefined}
@@ -308,6 +316,7 @@ exports[`Button Group Checkbox Error DOM Snapshot 1`] = `
308316
aria-owns={undefined}
309317
aria-required={undefined}
310318
checked={undefined}
319+
defaultChecked={undefined}
311320
disabled={undefined}
312321
id="ButtonGroupExampleThu"
313322
name={undefined}
@@ -341,6 +350,7 @@ exports[`Button Group Checkbox Error DOM Snapshot 1`] = `
341350
aria-owns={undefined}
342351
aria-required={undefined}
343352
checked={undefined}
353+
defaultChecked={undefined}
344354
disabled={undefined}
345355
id="ButtonGroupExampleFri"
346356
name={undefined}

components/combobox/__docs__/site-stories.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const siteStories = [
1212
require('raw-loader!@salesforce/design-system-react/components/combobox/__examples__/inline-single.jsx'),
1313
require('raw-loader!@salesforce/design-system-react/components/combobox/__examples__/readonly-single.jsx'),
1414
require('raw-loader!@salesforce/design-system-react/components/combobox/__examples__/readonly-multiple.jsx'),
15+
require('raw-loader!@salesforce/design-system-react/components/combobox/__examples__/required-input-error-state.jsx'),
1516
];
1617

1718
module.exports = siteStories;

components/combobox/__docs__/storybook-stories.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Base from '../__examples__/base';
77
import BaseMenuSubHeader from '../__examples__/base-menu-subheader';
88
import BaseMenuSeparator from '../__examples__/base-menu-separator';
99
import BaseInheritMenuWidth from '../__examples__/base-inherit-menu-width.jsx';
10+
import RequiredInputErrorState from '../__examples__/required-input-error-state';
1011
import PredefinedOptionsOnly from '../__examples__/base-predefined-options-only';
1112
import InlineSingle from '../__examples__/inline-single';
1213
import InlineMultiple from '../__examples__/inline-multiple';
@@ -30,6 +31,7 @@ import SnapshotReadonlyMultipleSelection from '../__examples__/snapshot/readonly
3031
import SnapshotReadonlyMultipleSelectionSingleItemSelected from '../__examples__/snapshot/readonly-multiple-selection-single-item-selected';
3132
import SnapshotReadonlyMultipleSelectionMultipleItemsSelected from '../__examples__/snapshot/readonly-multiple-selection-multiple-items-selected';
3233
import SnapshotReadonlySingleSelectionCustomMenuItemOpen from '../__examples__/snapshot/readonly-single-selection-custom-menu-item';
34+
import SnapshotBaseLabelRequired from '../__examples__/snapshot/base-label-required';
3335

3436
storiesOf(COMBOBOX, module)
3537
.addDecorator((getStory) => (
@@ -54,11 +56,17 @@ storiesOf(COMBOBOX, module)
5456
.add('Readonly Single Selection Custom Menu Item', () => (
5557
<ReadOnlySingleSelectionCustomMenuItem action={action} />
5658
))
59+
.add('Required Input in Error State', () => (
60+
<RequiredInputErrorState action={action} />
61+
))
5762
.add('Snapshot Base Open', () => <SnapshotBaseOpen action={action} />)
5863
.add('Snapshot Base Custom Menu Item Open', () => (
5964
<SnapshotBaseCustomMenuItemOpen action={action} />
6065
))
6166
.add('Snapshot Base Selected', () => <SnapshotBaseSelected action={action} />)
67+
.add('Snapshot Base Label Required', () => (
68+
<SnapshotBaseLabelRequired action={action} />
69+
))
6270
.add('Snapshot Base Open Menu Sub Header Separator', () => (
6371
<SnapshotBaseOpenMenuSubHeaderSeparator action={action} />
6472
))
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/* eslint-disable no-console, react/prop-types */
2+
import React from 'react';
3+
import Combobox from '~/components/combobox';
4+
import Icon from '~/components/icon';
5+
import comboboxFilterAndLimit from '~/components/combobox/filter';
6+
import IconSettings from '~/components/icon-settings';
7+
8+
const accounts = [
9+
{
10+
id: '1',
11+
label: 'Acme',
12+
subTitle: 'Account • San Francisco',
13+
type: 'account',
14+
},
15+
{
16+
id: '2',
17+
label: 'Salesforce.com, Inc.',
18+
subTitle: 'Account • San Francisco',
19+
type: 'account',
20+
},
21+
{
22+
id: '3',
23+
label: "Paddy's Pub",
24+
subTitle: 'Account • Boston, MA',
25+
type: 'account',
26+
},
27+
{
28+
id: '4',
29+
label: 'Tyrell Corp',
30+
subTitle: 'Account • San Francisco, CA',
31+
type: 'account',
32+
},
33+
{
34+
id: '5',
35+
label: 'Paper St. Soap Company',
36+
subTitle: 'Account • Beloit, WI',
37+
type: 'account',
38+
},
39+
{
40+
id: '6',
41+
label: 'Nakatomi Investments',
42+
subTitle: 'Account • Chicago, IL',
43+
type: 'account',
44+
},
45+
{ id: '7', label: 'Acme Landscaping', subTitle: '\u00A0', type: 'account' },
46+
{
47+
id: '8',
48+
label: 'Acme Construction',
49+
subTitle: 'Account • Grand Marais, MN',
50+
type: 'account',
51+
},
52+
];
53+
54+
const accountsWithIcon = accounts.map((elem) =>
55+
Object.assign(elem, {
56+
icon: <Icon assistiveText="Account" category="standard" name={elem.type} />,
57+
})
58+
);
59+
60+
class Example extends React.Component {
61+
constructor (props) {
62+
super(props);
63+
64+
this.state = {
65+
inputValue: '',
66+
selection: [],
67+
};
68+
}
69+
70+
render () {
71+
return (
72+
<IconSettings iconPath="/assets/icons">
73+
<Combobox
74+
aria-describedby="description-unique-id"
75+
id="combobox-unique-id"
76+
disabled={this.props.disabled}
77+
events={{
78+
onChange: (event, { value }) => {
79+
if (this.props.action) {
80+
this.props.action('onChange')(event, value);
81+
} else if (console) {
82+
console.log('onChange', event, value);
83+
}
84+
this.setState({ inputValue: value });
85+
},
86+
onRequestRemoveSelectedOption: (event, data) => {
87+
this.setState({
88+
inputValue: '',
89+
selection: data.selection,
90+
});
91+
},
92+
onSubmit: (event, { value }) => {
93+
if (this.props.action) {
94+
this.props.action('onChange')(event, value);
95+
} else if (console) {
96+
console.log('onChange', event, value);
97+
}
98+
this.setState({
99+
inputValue: 'input not found',
100+
selection: [
101+
...this.state.selection,
102+
{
103+
label: value,
104+
icon: (
105+
<Icon
106+
assistiveText="Account"
107+
category="standard"
108+
name="account"
109+
/>
110+
),
111+
},
112+
],
113+
});
114+
},
115+
onSelect: (event, data) => {
116+
if (this.props.action) {
117+
this.props.action('onSelect')(
118+
event,
119+
...Object.keys(data).map((key) => data[key])
120+
);
121+
} else if (console) {
122+
console.log('onSelect', event, data);
123+
}
124+
this.setState({
125+
inputValue: '',
126+
selection: data.selection,
127+
});
128+
},
129+
}}
130+
errorText="This field is required"
131+
labels={{
132+
label: 'Search',
133+
placeholder: 'Search Salesforce',
134+
}}
135+
multiple
136+
options={comboboxFilterAndLimit({
137+
inputValue: this.state.inputValue,
138+
limit: 10,
139+
options: accountsWithIcon,
140+
selection: this.state.selection,
141+
})}
142+
required
143+
selection={this.state.selection}
144+
value={this.state.inputValue}
145+
/>
146+
</IconSettings>
147+
);
148+
}
149+
}
150+
151+
Example.displayName = 'ComboboxExample';
152+
export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable no-console, react/prop-types */
2+
import React from 'react';
3+
import RequiredInputErrorStateComponent from '../required-input-error-state';
4+
5+
class Example extends React.Component {
6+
render () {
7+
return <RequiredInputErrorStateComponent />;
8+
}
9+
}
10+
11+
Example.displayName = 'ComboboxExample';
12+
export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime

0 commit comments

Comments
 (0)