Skip to content

Commit

Permalink
chore: deprecate ControlledPasswordInput
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Apr 22, 2021
1 parent 6e08ebd commit 9e1d205
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 218 deletions.

This file was deleted.

11 changes: 11 additions & 0 deletions packages/react/src/components/TextInput/ControlledPasswordInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import PropTypes from 'prop-types';
import { settings } from 'carbon-components';
import { View16, ViewOff16, WarningFilled16 } from '@carbon/icons-react';
import { textInputProps } from './util';
import { warning } from '../../internal/warning';

const { prefix } = settings;

let didWarnAboutDeprecation = false;

const ControlledPasswordInput = React.forwardRef(
function ControlledPasswordInput(
{
Expand Down Expand Up @@ -34,6 +37,14 @@ const ControlledPasswordInput = React.forwardRef(
},
ref
) {
if (__DEV__) {
warning(
didWarnAboutDeprecation,
'`<TextInput.ControlledPasswordInput>` has been deprecated in favor of `<TextInput.PasswordInput />` and will be removed in the next major release of `carbon-components-react`'
);
didWarnAboutDeprecation = true;
}

const errorId = id + '-error-msg';
const textInputClasses = classNames(
`${prefix}--text-input`,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/TextInput/TextInput-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const ControlledPasswordInputApp = React.forwardRef(
};
return (
<>
<TextInput.ControlledPasswordInput
<TextInput.PasswordInput
type={type}
togglePasswordVisibility={togglePasswordVisibility}
ref={ref}
Expand Down Expand Up @@ -115,7 +115,7 @@ export default {
},
subcomponents: {
TextInputSkeleton,
'TextInput.ControlledPasswordInput': TextInput.ControlledPasswordInput,
'TextInput.PasswordInput': TextInput.PasswordInput,
},
},
};
Expand Down

0 comments on commit 9e1d205

Please sign in to comment.