From 229f5a269111be27518f41587bc598880e78d45e Mon Sep 17 00:00:00 2001 From: georgewrmarshall Date: Mon, 17 Jul 2023 21:57:25 -0700 Subject: [PATCH] Updating Text import paths --- ui/components/ui/box/box.stories.tsx | 2 +- ui/components/ui/callout/callout.js | 3 +-- ui/components/ui/callout/callout.stories.js | 2 +- .../deprecated-test-networks.js | 3 +-- .../ui/editable-label/editable-label.js | 10 ++++++--- .../export-text-container.component.js | 4 +--- ui/components/ui/form-field/form-field.js | 3 +-- .../ui/form-field/form-field.stories.js | 3 +-- ui/components/ui/icon-button/icon-button.js | 2 +- ui/components/ui/logo/logo.stories.js | 3 +-- ui/components/ui/menu/menu-item.js | 3 +-- .../ui/metafox-logo/metafox-logo.stories.js | 2 +- .../ui/new-network-info/new-network-info.js | 3 +-- ui/components/ui/nft-info/nft-info.js | 21 ++++++------------- .../numeric-input/numeric-input.component.js | 2 +- ui/components/ui/popover/popover.component.js | 9 ++++++-- .../ui/radio-group/radio-group.component.js | 2 +- .../review-spending-cap.js | 10 +++++++-- ui/components/ui/slider/slider.component.js | 2 +- .../tabs/snaps/dropdown-tab/dropdown-tab.js | 3 +-- 20 files changed, 44 insertions(+), 48 deletions(-) diff --git a/ui/components/ui/box/box.stories.tsx b/ui/components/ui/box/box.stories.tsx index 1450fce89dd5..1491ae6e2b2d 100644 --- a/ui/components/ui/box/box.stories.tsx +++ b/ui/components/ui/box/box.stories.tsx @@ -16,7 +16,7 @@ import { FlexWrap, } from '../../../helpers/constants/design-system'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; import Box from './box'; diff --git a/ui/components/ui/callout/callout.js b/ui/components/ui/callout/callout.js index 6010129ed7d2..c2a8f671da14 100644 --- a/ui/components/ui/callout/callout.js +++ b/ui/components/ui/callout/callout.js @@ -4,8 +4,7 @@ import classnames from 'classnames'; import InfoIconInverted from '../icon/info-icon-inverted.component'; import { Severity, TextColor } from '../../../helpers/constants/design-system'; import { MILLISECOND } from '../../../../shared/constants/time'; -import { ButtonIcon, IconName, IconSize } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { ButtonIcon, IconName, IconSize, Text } from '../../component-library'; /** * @deprecated `` has been deprecated in favor of the `` diff --git a/ui/components/ui/callout/callout.stories.js b/ui/components/ui/callout/callout.stories.js index 386ae05bfbdd..505533bc39e5 100644 --- a/ui/components/ui/callout/callout.stories.js +++ b/ui/components/ui/callout/callout.stories.js @@ -5,7 +5,7 @@ import { TextVariant, } from '../../../helpers/constants/design-system'; import Box from '../box'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; import Callout from './callout'; export default { diff --git a/ui/components/ui/deprecated-test-networks/deprecated-test-networks.js b/ui/components/ui/deprecated-test-networks/deprecated-test-networks.js index a2107f34223c..3c2bed230c6a 100644 --- a/ui/components/ui/deprecated-test-networks/deprecated-test-networks.js +++ b/ui/components/ui/deprecated-test-networks/deprecated-test-networks.js @@ -12,8 +12,7 @@ import Box from '../box/box'; import ActionableMessage from '../actionable-message/actionable-message'; import { getCurrentChainId } from '../../../selectors'; import { getCompletedOnboarding } from '../../../ducks/metamask/metamask'; -import { Icon, IconName, IconSize } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { Icon, IconName, IconSize, Text } from '../../component-library'; export default function DeprecatedTestNetworks() { const currentChainID = useSelector(getCurrentChainId); diff --git a/ui/components/ui/editable-label/editable-label.js b/ui/components/ui/editable-label/editable-label.js index 651897afac40..ec0f18df7770 100644 --- a/ui/components/ui/editable-label/editable-label.js +++ b/ui/components/ui/editable-label/editable-label.js @@ -8,9 +8,13 @@ import { TextVariant, } from '../../../helpers/constants/design-system'; import { getAccountNameErrorMessage } from '../../../helpers/utils/accounts'; -import { ButtonIcon, FormTextField, IconName } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; -import Box from '../box/box'; +import { + ButtonIcon, + FormTextField, + IconName, + Text, + Box, +} from '../../component-library'; export default class EditableLabel extends Component { static propTypes = { diff --git a/ui/components/ui/export-text-container/export-text-container.component.js b/ui/components/ui/export-text-container/export-text-container.component.js index 85f1f1943e60..52fa18f00f37 100644 --- a/ui/components/ui/export-text-container/export-text-container.component.js +++ b/ui/components/ui/export-text-container/export-text-container.component.js @@ -11,9 +11,7 @@ import { JustifyContent, TextVariant, } from '../../../helpers/constants/design-system'; -import Box from '../box/box'; -import { ButtonSecondary } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { ButtonSecondary, Text, Box } from '../../component-library'; function ExportTextContainer({ text = '', onClickCopy = null }) { const ONE_MINUTE = 1000 * 60; diff --git a/ui/components/ui/form-field/form-field.js b/ui/components/ui/form-field/form-field.js index ba522fa4b8de..a23c3dffe5fa 100644 --- a/ui/components/ui/form-field/form-field.js +++ b/ui/components/ui/form-field/form-field.js @@ -12,8 +12,7 @@ import { import NumericInput from '../numeric-input/numeric-input.component'; import InfoTooltip from '../info-tooltip/info-tooltip'; -import { Box } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { Box, Text } from '../../component-library'; /** * @deprecated The `` component has been deprecated in favor of the new `` component from the component-library. diff --git a/ui/components/ui/form-field/form-field.stories.js b/ui/components/ui/form-field/form-field.stories.js index 1a4f6bc9d2b3..16022af64f6a 100644 --- a/ui/components/ui/form-field/form-field.stories.js +++ b/ui/components/ui/form-field/form-field.stories.js @@ -3,8 +3,7 @@ import React, { useState } from 'react'; import Tooltip from '../tooltip'; -import { Icon, IconName } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { Icon, IconName, Text } from '../../component-library'; import { AlignItems } from '../../../helpers/constants/design-system'; import README from './README.mdx'; import FormField from '.'; diff --git a/ui/components/ui/icon-button/icon-button.js b/ui/components/ui/icon-button/icon-button.js index 1e4acfffed29..cc95d8343cf1 100644 --- a/ui/components/ui/icon-button/icon-button.js +++ b/ui/components/ui/icon-button/icon-button.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; import { TextVariant } from '../../../helpers/constants/design-system'; import Tooltip from '../tooltip/tooltip'; diff --git a/ui/components/ui/logo/logo.stories.js b/ui/components/ui/logo/logo.stories.js index 802ac739a7d2..cc50d92aba81 100644 --- a/ui/components/ui/logo/logo.stories.js +++ b/ui/components/ui/logo/logo.stories.js @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import React from 'react'; import { BackgroundColor } from '../../../helpers/constants/design-system'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; import Card from '../card'; import Box from '../box'; @@ -16,7 +16,6 @@ import README from './README.mdx'; export default { title: 'Components/UI/Logo', - parameters: { docs: { page: README, diff --git a/ui/components/ui/menu/menu-item.js b/ui/components/ui/menu/menu-item.js index a22d1ad4805b..6e91b4e296c3 100644 --- a/ui/components/ui/menu/menu-item.js +++ b/ui/components/ui/menu/menu-item.js @@ -2,8 +2,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; -import { Icon, IconSize } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { Icon, IconSize, Text } from '../../component-library'; import { TextVariant } from '../../../helpers/constants/design-system'; const MenuItem = React.forwardRef( diff --git a/ui/components/ui/metafox-logo/metafox-logo.stories.js b/ui/components/ui/metafox-logo/metafox-logo.stories.js index f059e822a55d..859954144b31 100644 --- a/ui/components/ui/metafox-logo/metafox-logo.stories.js +++ b/ui/components/ui/metafox-logo/metafox-logo.stories.js @@ -1,6 +1,6 @@ import React from 'react'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; import MetaFoxLogo from '.'; export default { diff --git a/ui/components/ui/new-network-info/new-network-info.js b/ui/components/ui/new-network-info/new-network-info.js index 778955dc3ff1..0d449c443855 100644 --- a/ui/components/ui/new-network-info/new-network-info.js +++ b/ui/components/ui/new-network-info/new-network-info.js @@ -25,8 +25,7 @@ import { IMPORT_TOKEN_ROUTE } from '../../../helpers/constants/routes'; import Chip from '../chip/chip'; import { setFirstTimeUsedNetwork } from '../../../store/actions'; import { NETWORK_TYPES } from '../../../../shared/constants/network'; -import { Icon, IconName } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { Icon, IconName, Text } from '../../component-library'; import { getNetworkLabelKey } from '../../../helpers/utils/i18n-helper'; const NewNetworkInfo = () => { diff --git a/ui/components/ui/nft-info/nft-info.js b/ui/components/ui/nft-info/nft-info.js index 7e04db323cb6..c762ebc2d603 100644 --- a/ui/components/ui/nft-info/nft-info.js +++ b/ui/components/ui/nft-info/nft-info.js @@ -1,27 +1,25 @@ import React, { useContext } from 'react'; import PropTypes from 'prop-types'; import { I18nContext } from '../../../contexts/i18n'; -import Box from '../box'; import { BackgroundColor, - DISPLAY, + Display, TextColor, TextVariant, } from '../../../helpers/constants/design-system'; import Identicon from '../identicon'; -import Button from '../button'; -import { Text } from '../../component-library/text/deprecated'; +import { Text, Button, Box, BUTTON_VARIANT } from '../../component-library'; export default function NftInfo({ assetName, tokenAddress, tokenId }) { const t = useContext(I18nContext); return ( - + @@ -40,15 +38,8 @@ export default function NftInfo({ assetName, tokenAddress, tokenId }) { - diff --git a/ui/components/ui/numeric-input/numeric-input.component.js b/ui/components/ui/numeric-input/numeric-input.component.js index 9ae1756d8b39..8eba851be209 100644 --- a/ui/components/ui/numeric-input/numeric-input.component.js +++ b/ui/components/ui/numeric-input/numeric-input.component.js @@ -6,7 +6,7 @@ import { TextVariant, } from '../../../helpers/constants/design-system'; import { DECIMAL_REGEX } from '../../../../shared/constants/tokens'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; export default function NumericInput({ detailText = '', diff --git a/ui/components/ui/popover/popover.component.js b/ui/components/ui/popover/popover.component.js index 51c32f71545e..261883c5666c 100644 --- a/ui/components/ui/popover/popover.component.js +++ b/ui/components/ui/popover/popover.component.js @@ -19,8 +19,13 @@ import { BLOCK_SIZES, } from '../../../helpers/constants/design-system'; -import { ButtonIcon, Icon, IconName, IconSize } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { + ButtonIcon, + Icon, + IconName, + IconSize, + Text, +} from '../../component-library'; const defaultHeaderProps = { padding: [6, 4, 4], diff --git a/ui/components/ui/radio-group/radio-group.component.js b/ui/components/ui/radio-group/radio-group.component.js index c63e199d106d..3a4b4329dbf0 100644 --- a/ui/components/ui/radio-group/radio-group.component.js +++ b/ui/components/ui/radio-group/radio-group.component.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import { I18nContext } from '../../../contexts/i18n'; import { Color, TextVariant } from '../../../helpers/constants/design-system'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; function Connector({ isFirst, isLast }) { if (isFirst) { diff --git a/ui/components/ui/review-spending-cap/review-spending-cap.js b/ui/components/ui/review-spending-cap/review-spending-cap.js index c6e700bae4d6..e3d99f5e875b 100644 --- a/ui/components/ui/review-spending-cap/review-spending-cap.js +++ b/ui/components/ui/review-spending-cap/review-spending-cap.js @@ -3,8 +3,14 @@ import PropTypes from 'prop-types'; import { I18nContext } from '../../../contexts/i18n'; import Box from '../box'; import Tooltip from '../tooltip'; -import { ButtonLink, Icon, IconName, IconSize } from '../../component-library'; -import { Text } from '../../component-library/text/deprecated'; +import { + ButtonLink, + Icon, + IconName, + IconSize, + Text, +} from '../../component-library'; + import { AlignItems, DISPLAY, diff --git a/ui/components/ui/slider/slider.component.js b/ui/components/ui/slider/slider.component.js index 4bb101809b5a..58166506235e 100644 --- a/ui/components/ui/slider/slider.component.js +++ b/ui/components/ui/slider/slider.component.js @@ -9,7 +9,7 @@ import { } from '../../../helpers/constants/design-system'; import InfoTooltip from '../info-tooltip/info-tooltip'; -import { Text } from '../../component-library/text/deprecated'; +import { Text } from '../../component-library'; const styles = { root: { diff --git a/ui/components/ui/tabs/snaps/dropdown-tab/dropdown-tab.js b/ui/components/ui/tabs/snaps/dropdown-tab/dropdown-tab.js index 6b8f26e84ad5..bbb48602c70f 100644 --- a/ui/components/ui/tabs/snaps/dropdown-tab/dropdown-tab.js +++ b/ui/components/ui/tabs/snaps/dropdown-tab/dropdown-tab.js @@ -14,8 +14,7 @@ import { FLEX_WRAP, TextVariant, } from '../../../../../helpers/constants/design-system'; -import { Icon, IconName, IconSize } from '../../../../component-library'; -import { Text } from '../../../../component-library/text/deprecated'; +import { Icon, IconName, IconSize, Text } from '../../../../component-library'; export const DropdownTab = ({ activeClassName,