Skip to content

Commit ab2d69e

Browse files
Fix CommonJS constant import
INPUT and NAVIGATION CHECKBOX and TEXTAREA imports/exports
1 parent 41ffa47 commit ab2d69e

File tree

9 files changed

+23
-23
lines changed

9 files changed

+23
-23
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__/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/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/index.jsx

Lines changed: 2 additions & 2 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
/**

utilities/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const DIALOG = 'SLDSDialog';
3535
export const FILTER = 'SLDSFilter';
3636
export const FORMS_CHECKBOX = 'SLDSCheckbox';
3737
export const FORMS_INLINE_EDIT = 'SLDSInlineEdit';
38-
export const FORMS_INPUT = 'SLDSInput';
38+
export const INPUT = 'SLDSInput';
3939
export const FORMS_TEXTAREA = 'SLDSTextarea';
4040
export const FORMS_SEARCH = 'SLDSSearch';
4141
export const GLOBAL_HEADER = 'SLDSGlobalHeader';

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)