mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Declared <TextField/> as deprecated (#20640)
* Declared <TextField/> as deprecated * Declared <TextField/> as deprecated
This commit is contained in:
parent
827c2fb741
commit
131321af00
@ -3,6 +3,15 @@ import PropTypes from 'prop-types';
|
|||||||
import { withStyles } from '@material-ui/core/styles';
|
import { withStyles } from '@material-ui/core/styles';
|
||||||
import MaterialTextField from '@material-ui/core/TextField';
|
import MaterialTextField from '@material-ui/core/TextField';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated The `<TextField />` component has been deprecated in favor of the new `<TextField>` component from the component-library.
|
||||||
|
* Please update your code to use the new `<TextField>` component instead, which can be found at ui/components/component-library/text-field/text-field.js.
|
||||||
|
* You can find documentation for the new `TextField` component in the MetaMask Storybook:
|
||||||
|
* {@link https://metamask.github.io/metamask-storybook/?path=/docs/components-componentlibrary-textfield--docs}
|
||||||
|
* If you would like to help with the replacement of the old `TextField` component, please submit a pull request against this GitHub issue:
|
||||||
|
* {@link https://github.com/MetaMask/metamask-extension/issues/20483}
|
||||||
|
*/
|
||||||
|
|
||||||
const inputLabelBase = {
|
const inputLabelBase = {
|
||||||
transform: 'none',
|
transform: 'none',
|
||||||
transition: 'none',
|
transition: 'none',
|
||||||
|
@ -1,7 +1,26 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import { BannerAlert } from '../../component-library';
|
||||||
|
import { Severity } from '../../../helpers/constants/design-system';
|
||||||
import README from './README.mdx';
|
import README from './README.mdx';
|
||||||
import TextField from '.';
|
import TextField from '.';
|
||||||
|
|
||||||
|
const Deprecated = ({ children }) => (
|
||||||
|
<>
|
||||||
|
<BannerAlert
|
||||||
|
severity={Severity.Warning}
|
||||||
|
title="Deprecated"
|
||||||
|
description="<TextField/> has been deprecated in favor of <TextField/>"
|
||||||
|
marginBottom={4}
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
Deprecated.propTypes = {
|
||||||
|
children: PropTypes.node,
|
||||||
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
title: 'Components/UI/TextField',
|
title: 'Components/UI/TextField',
|
||||||
|
|
||||||
@ -27,46 +46,74 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DefaultStory = (args) => <TextField {...args} />;
|
export const DefaultStory = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
DefaultStory.storyName = 'Default';
|
DefaultStory.storyName = 'Default';
|
||||||
DefaultStory.args = {
|
DefaultStory.args = {
|
||||||
label: 'Text',
|
label: 'Text',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Password = (args) => <TextField {...args} />;
|
export const Password = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
Password.args = {
|
Password.args = {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
};
|
};
|
||||||
export const TextError = (args) => <TextField {...args} />;
|
export const TextError = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
TextError.args = {
|
TextError.args = {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
error: 'Invalid Value',
|
error: 'Invalid Value',
|
||||||
};
|
};
|
||||||
export const MascaraText = (args) => <TextField {...args} />;
|
export const MascaraText = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
MascaraText.args = {
|
MascaraText.args = {
|
||||||
label: 'Text',
|
label: 'Text',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
largeLabel: true,
|
largeLabel: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MaterialText = (args) => <TextField {...args} />;
|
export const MaterialText = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
MaterialText.args = {
|
MaterialText.args = {
|
||||||
label: 'Text',
|
label: 'Text',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
theme: 'material',
|
theme: 'material',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MaterialPassword = (args) => <TextField {...args} />;
|
export const MaterialPassword = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
MaterialPassword.args = {
|
MaterialPassword.args = {
|
||||||
label: 'Password',
|
label: 'Password',
|
||||||
type: 'password',
|
type: 'password',
|
||||||
theme: 'material',
|
theme: 'material',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MaterialError = (args) => <TextField {...args} />;
|
export const MaterialError = (args) => (
|
||||||
|
<Deprecated>
|
||||||
|
<TextField {...args} />
|
||||||
|
</Deprecated>
|
||||||
|
);
|
||||||
MaterialError.args = {
|
MaterialError.args = {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: 'Name',
|
label: 'Name',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user