Skip to content

Commit

Permalink
refactor(text-input): update text-input to 7.x (carbon-design-system#512
Browse files Browse the repository at this point in the history
)

* refactor(text-input): update text-input to 7.x

* refactor(text-input): wrap input in bx--form-item
  • Loading branch information
tw15egan authored and Christopher A. Dhanaraj committed Apr 3, 2017
1 parent 8e93275 commit 8262e57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions components/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ const TextInput = ({ labelText, className, id, placeholder, type, onChange, onCl
};

const textInputClasses = classNames(
'bx--text__input',
'bx--text-input',
className,
);
const labelClasses = classNames('bx--form__label', { 'bx--visually-hidden': hideLabel });
const labelClasses = classNames('bx--label', { 'bx--visually-hidden': hideLabel });

const label = labelText ? (
<label htmlFor={id} className={labelClasses}>
Expand All @@ -59,7 +59,7 @@ const TextInput = ({ labelText, className, id, placeholder, type, onChange, onCl
) : null;

return (
<div>
<div className="bx--form-item">
{label}
<input {...other} {...textInputProps} className={textInputClasses} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/__tests__/TextInput-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('TextInput', () => {
});

it('has the expected classes', () => {
expect(textInput.hasClass('bx--text__input')).toEqual(true);
expect(textInput.hasClass('bx--text-input')).toEqual(true);
});

it('should add extra classes that are passed via className', () => {
Expand Down Expand Up @@ -62,7 +62,7 @@ describe('TextInput', () => {
});

it('has the expected classes', () => {
expect(renderedLabel.hasClass('bx--form__label')).toEqual(true);
expect(renderedLabel.hasClass('bx--label')).toEqual(true);
});

it('should set label as expected', () => {
Expand Down

0 comments on commit 8262e57

Please sign in to comment.