From 131321af00a79a25d4e92222df82157a9ee347cf Mon Sep 17 00:00:00 2001
From: Subhajit Ghosh <99127578+subhajit20@users.noreply.github.com>
Date: Wed, 30 Aug 2023 08:08:20 +0530
Subject: [PATCH] Declared as deprecated (#20640)
* Declared as deprecated
* Declared as deprecated
---
.../ui/text-field/text-field.component.js | 9 +++
.../ui/text-field/text-field.stories.js | 61 ++++++++++++++++---
2 files changed, 63 insertions(+), 7 deletions(-)
diff --git a/ui/components/ui/text-field/text-field.component.js b/ui/components/ui/text-field/text-field.component.js
index 18a7103a8..34f8effea 100644
--- a/ui/components/ui/text-field/text-field.component.js
+++ b/ui/components/ui/text-field/text-field.component.js
@@ -3,6 +3,15 @@ import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import MaterialTextField from '@material-ui/core/TextField';
+/**
+ * @deprecated The `` component has been deprecated in favor of the new `` component from the component-library.
+ * Please update your code to use the new `` 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 = {
transform: 'none',
transition: 'none',
diff --git a/ui/components/ui/text-field/text-field.stories.js b/ui/components/ui/text-field/text-field.stories.js
index 66e65cb2b..6a71c1b6f 100644
--- a/ui/components/ui/text-field/text-field.stories.js
+++ b/ui/components/ui/text-field/text-field.stories.js
@@ -1,7 +1,26 @@
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 TextField from '.';
+const Deprecated = ({ children }) => (
+ <>
+
+ {children}
+ >
+);
+
+Deprecated.propTypes = {
+ children: PropTypes.node,
+};
+
export default {
title: 'Components/UI/TextField',
@@ -27,46 +46,74 @@ export default {
},
};
-export const DefaultStory = (args) => ;
+export const DefaultStory = (args) => (
+
+
+
+);
DefaultStory.storyName = 'Default';
DefaultStory.args = {
label: 'Text',
type: 'text',
};
-export const Password = (args) => ;
+export const Password = (args) => (
+
+
+
+);
Password.args = {
label: 'Password',
type: 'password',
};
-export const TextError = (args) => ;
+export const TextError = (args) => (
+
+
+
+);
TextError.args = {
type: 'text',
label: 'Name',
error: 'Invalid Value',
};
-export const MascaraText = (args) => ;
+export const MascaraText = (args) => (
+
+
+
+);
MascaraText.args = {
label: 'Text',
type: 'text',
largeLabel: true,
};
-export const MaterialText = (args) => ;
+export const MaterialText = (args) => (
+
+
+
+);
MaterialText.args = {
label: 'Text',
type: 'text',
theme: 'material',
};
-export const MaterialPassword = (args) => ;
+export const MaterialPassword = (args) => (
+
+
+
+);
MaterialPassword.args = {
label: 'Password',
type: 'password',
theme: 'material',
};
-export const MaterialError = (args) => ;
+export const MaterialError = (args) => (
+
+
+
+);
MaterialError.args = {
type: 'text',
label: 'Name',