Skip to content

Commit 134ddc1

Browse files
authored
Merge pull request salesforce#1513 from interactivellama/constants-fix
Fix CommonJS constant import
2 parents 773e6d9 + c52c02a commit 134ddc1

File tree

12 files changed

+34
-34
lines changed

12 files changed

+34
-34
lines changed

components/checkbox/__docs__/storybook-stories.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { storiesOf } from '@storybook/react';
33
import { action } from '@storybook/addon-actions';
44
import IconSettings from '../../icon-settings';
55

6-
import { FORMS_CHECKBOX } from '../../../utilities/constants';
6+
import { CHECKBOX } from '../../../utilities/constants';
77
import Checkbox from '../';
88
import Button from '../../button';
99

1010
import DefaultCheckbox from '../__examples__/default';
1111

1212
class CheckboxIndeterminate extends React.Component {
13-
static displayName = `${FORMS_CHECKBOX}_INDETERMINATE`;
13+
static displayName = `${CHECKBOX}_INDETERMINATE`;
1414

1515
state = {
1616
indeterminate: true,
@@ -106,7 +106,7 @@ class CheckboxIndeterminate extends React.Component {
106106
}
107107
}
108108

109-
storiesOf(FORMS_CHECKBOX, module)
109+
storiesOf(CHECKBOX, module)
110110
.addDecorator((getStory) => (
111111
<div className="slds-p-around--medium">
112112
<IconSettings iconPath="/assets/icons">{getStory()}</IconSettings>

components/checkbox/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import EventUtil from '../../utilities/event';
2222
// This component's `checkProps` which issues warnings to developers about properties when in development mode (similar to React's built in development tools)
2323
import checkProps from './check-props';
2424

25-
import { FORMS_CHECKBOX } from '../../utilities/constants';
25+
import { CHECKBOX } from '../../utilities/constants';
2626

2727
const propTypes = {
2828
/**
@@ -159,7 +159,7 @@ const defaultProps = {
159159
*/
160160
class Checkbox extends React.Component {
161161
componentWillMount () {
162-
checkProps(FORMS_CHECKBOX, this.props);
162+
checkProps(CHECKBOX, this.props);
163163
this.generatedId = shortid.generate();
164164
}
165165

@@ -384,7 +384,7 @@ class Checkbox extends React.Component {
384384
}
385385
}
386386

387-
Checkbox.displayName = FORMS_CHECKBOX;
387+
Checkbox.displayName = CHECKBOX;
388388
Checkbox.propTypes = propTypes;
389389
Checkbox.defaultProps = defaultProps;
390390

components/input/__docs__/search/storybook-stories.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22
import { storiesOf, action } from '@storybook/react';
33
import IconSettings from '../../../icon-settings';
44

5-
import { FORMS_SEARCH } from '../../../../utilities/constants';
5+
import { SEARCH } from '../../../../utilities/constants';
66
import Search from '../../search';
77

8-
storiesOf(FORMS_SEARCH, module)
8+
storiesOf(SEARCH, module)
99
.addDecorator((getStory) => (
1010
<div className="slds-p-around--medium">
1111
<IconSettings iconPath="/assets/icons">{getStory()}</IconSettings>

components/input/__docs__/storybook-stories.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { storiesOf, action } from '@storybook/react';
33

4-
import { FORMS_INPUT } from '../../../utilities/constants';
4+
import { INPUT } from '../../../utilities/constants';
55
import Button from '../../button';
66
import IconSettings from '../../icon-settings';
77
import Input from '../';
@@ -38,7 +38,7 @@ const searchIconClickable = (
3838
/>
3939
);
4040

41-
storiesOf(FORMS_INPUT, module)
41+
storiesOf(INPUT, module)
4242
.addDecorator((getStory) => (
4343
<div className="slds-p-around--medium">{getStory()}</div>
4444
))

components/input/check-props.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import sunsetProperty from '../../utilities/warning/sunset-property';
88
// import oneOfRequiredProperty from '../../../utilities/warning/one-of-required-property';
99
import onlyOneOfProperties from '../../utilities/warning/only-one-of-properties';
1010

11-
import { FORMS_INPUT, FORMS_SEARCH } from '../../utilities/constants';
11+
import { INPUT, SEARCH } from '../../utilities/constants';
1212

1313
let checkProps = function () {};
1414

1515
if (process.env.NODE_ENV !== 'production') {
1616
checkProps = function (COMPONENT, props) {
17-
if (COMPONENT === FORMS_INPUT) {
17+
if (COMPONENT === INPUT) {
1818
// Deprecated and changed to another property
1919
deprecatedProperty(
2020
COMPONENT,
@@ -81,7 +81,7 @@ if (process.env.NODE_ENV !== 'production') {
8181
});
8282
}
8383
*/
84-
} else if (COMPONENT === FORMS_SEARCH) {
84+
} else if (COMPONENT === SEARCH) {
8585
if (typeof props.assistiveText === 'string') {
8686
sunsetProperty(
8787
COMPONENT,

components/input/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import Label from '../utilities/label';
3434
// This component's `checkProps` which issues warnings to developers about properties when in development mode (similar to React's built in development tools)
3535
import checkProps from './check-props';
3636

37-
import { FORMS_INPUT } from '../../utilities/constants';
37+
import { INPUT } from '../../utilities/constants';
3838

3939
const defaultProps = {
4040
assistiveText: {
@@ -47,7 +47,7 @@ const defaultProps = {
4747
* The HTML `input` with a label and error messaging.
4848
*/
4949
const Input = createReactClass({
50-
displayName: FORMS_INPUT,
50+
displayName: INPUT,
5151

5252
propTypes: {
5353
/**
@@ -279,7 +279,7 @@ const Input = createReactClass({
279279

280280
componentWillMount () {
281281
// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)
282-
checkProps(FORMS_INPUT, this.props);
282+
checkProps(INPUT, this.props);
283283

284284
this.generatedId = shortid.generate();
285285
if (this.props.errorText) {

components/input/search.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import KEYS from '../../utilities/key-code';
2222
import EventUtil from '../../utilities/event';
2323

2424
// ## Constants
25-
import { FORMS_SEARCH } from '../../utilities/constants';
25+
import { SEARCH } from '../../utilities/constants';
2626

2727
const handleKeyDown = (event, onSearch) => {
2828
if (event.keyCode === KEYS.ENTER) {
@@ -39,7 +39,7 @@ const defaultProps = {
3939
* A `Search` is an `Input` which renders the search icon by default. It can be cleared, too. All `Input` props not specified as props already may be used with this component and will override defaults.
4040
*/
4141
const Search = ({ clearable, onClear, onSearch, placeholder, ...props }) => {
42-
checkProps(FORMS_SEARCH, props);
42+
checkProps(SEARCH, props);
4343
const assistiveText =
4444
typeof props.assistiveText === 'string'
4545
? props.assistiveText
@@ -75,7 +75,7 @@ const Search = ({ clearable, onClear, onSearch, placeholder, ...props }) => {
7575
);
7676
};
7777

78-
Search.displayName = FORMS_SEARCH;
78+
Search.displayName = SEARCH;
7979

8080
Search.propTypes = {
8181
/**

components/navigation/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// Alias
55
import VerticalNavigation from '../vertical-navigation';
66
import componentHasMoved from '../../utilities/warning/component-has-moved';
7-
import { NAVIGATION } from '../../utilities/constants';
7+
import { VERTICAL_NAVIGATION } from '../../utilities/constants';
88

9-
componentHasMoved(NAVIGATION, {
9+
componentHasMoved(VERTICAL_NAVIGATION, {
1010
oldFileLocation: 'components/navigation',
1111
newFileLocation: 'components/vertical-navigation',
1212
});

components/textarea/__docs__/storybook-stories.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import IconSettings from '../../icon-settings';
44

5-
import { FORMS_TEXTAREA } from '../../../utilities/constants';
5+
import { TEXTAREA } from '../../../utilities/constants';
66
import Textarea from '../';
77

8-
storiesOf(FORMS_TEXTAREA, module)
8+
storiesOf(TEXTAREA, module)
99
.addDecorator((getStory) => (
1010
<div className="slds-p-around--medium">
1111
<IconSettings iconPath="/assets/icons">{getStory()}</IconSettings>

components/textarea/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import shortid from 'shortid';
2929
// This component's `checkProps` which issues warnings to developers about properties when in development mode (similar to React's built in development tools)
3030
import checkProps from './check-props';
3131

32-
import { FORMS_TEXTAREA } from '../../utilities/constants';
32+
import { TEXTAREA } from '../../utilities/constants';
3333

3434
/**
3535
* A multi-line plain-text editing control.
3636
*/
3737
const Textarea = createReactClass({
38-
displayName: FORMS_TEXTAREA,
38+
displayName: TEXTAREA,
3939

4040
propTypes: {
4141
/**
@@ -206,7 +206,7 @@ const Textarea = createReactClass({
206206

207207
componentWillMount () {
208208
// `checkProps` issues warnings to developers about properties (similar to React's built in development tools)
209-
checkProps(FORMS_TEXTAREA, this.props);
209+
checkProps(TEXTAREA, this.props);
210210

211211
this.generatedId = shortid.generate();
212212
if (this.props.errorText) {

utilities/constants.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export const DATA_TABLE_ROW = 'SLDSDataTableRow';
3333
export const DATE_PICKER = 'SLDSDatePicker';
3434
export const DIALOG = 'SLDSDialog';
3535
export const FILTER = 'SLDSFilter';
36-
export const FORMS_CHECKBOX = 'SLDSCheckbox';
36+
export const CHECKBOX = 'SLDSCheckbox';
3737
export const FORMS_INLINE_EDIT = 'SLDSInlineEdit';
38-
export const FORMS_INPUT = 'SLDSInput';
39-
export const FORMS_TEXTAREA = 'SLDSTextarea';
40-
export const FORMS_SEARCH = 'SLDSSearch';
38+
export const INPUT = 'SLDSInput';
39+
export const TEXTAREA = 'SLDSTextarea';
40+
export const SEARCH = 'SLDSSearch';
4141
export const GLOBAL_HEADER = 'SLDSGlobalHeader';
4242
export const GLOBAL_HEADER_PROFILE = 'SLDSGlobalHeaderProfile';
4343
export const GLOBAL_HEADER_SEARCH = 'SLDSGlobalHeaderSearch';

utilities/warning/is-trigger-tabbable.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import {
1010
BUTTON,
1111
BUTTON_STATEFUL,
1212
BUTTON_GROUP,
13-
FORMS_CHECKBOX,
13+
CHECKBOX,
1414
DATE_PICKER,
15-
FORMS_INPUT,
15+
INPUT,
1616
LOOKUP,
1717
TIME_PICKER,
1818
} from '../../utilities/constants';
@@ -40,9 +40,9 @@ if (process.env.NODE_ENV !== 'production') {
4040
trigger.type.displayName !== BUTTON &&
4141
trigger.type.displayName !== BUTTON_STATEFUL &&
4242
trigger.type.displayName !== BUTTON_GROUP &&
43-
trigger.type.displayName !== FORMS_CHECKBOX &&
43+
trigger.type.displayName !== CHECKBOX &&
4444
trigger.type.displayName !== DATE_PICKER &&
45-
trigger.type.displayName !== FORMS_INPUT &&
45+
trigger.type.displayName !== INPUT &&
4646
trigger.type.displayName !== LOOKUP &&
4747
trigger.type.displayName !== TIME_PICKER
4848
) {

0 commit comments

Comments
 (0)