{
,
);
@@ -115,7 +115,7 @@ describe('ButtonIcon', () => {
>,
@@ -128,7 +128,7 @@ describe('ButtonIcon', () => {
const { getByTestId } = render(
,
@@ -139,7 +139,7 @@ describe('ButtonIcon', () => {
it('should render with aria-label', () => {
const { getByLabelText } = render(
- ,
+ ,
);
expect(getByLabelText('add')).toBeDefined();
diff --git a/ui/components/component-library/button-link/button-link.stories.js b/ui/components/component-library/button-link/button-link.stories.js
index b9eacd3ed..2ceaf4851 100644
--- a/ui/components/component-library/button-link/button-link.stories.js
+++ b/ui/components/component-library/button-link/button-link.stories.js
@@ -9,7 +9,7 @@ import {
TextColor,
} from '../../../helpers/constants/design-system';
import Box from '../../ui/box/box';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { Text } from '../text';
import { ButtonLink } from './button-link';
import { BUTTON_LINK_SIZES } from './button-link.constants';
@@ -73,12 +73,12 @@ export default {
},
startIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
endIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
startIconProps: {
diff --git a/ui/components/component-library/button-link/button-link.test.js b/ui/components/component-library/button-link/button-link.test.js
index 5c1b68579..0f82c7652 100644
--- a/ui/components/component-library/button-link/button-link.test.js
+++ b/ui/components/component-library/button-link/button-link.test.js
@@ -2,7 +2,7 @@
import { render } from '@testing-library/react';
import React from 'react';
import { Size } from '../../../helpers/constants/design-system';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { ButtonLink } from './button-link';
import { BUTTON_LINK_SIZES } from './button-link.constants';
@@ -82,7 +82,7 @@ describe('ButtonLink', () => {
});
it('should render with icon', () => {
const { container } = render(
- ,
+ ,
);
const icons = container.getElementsByClassName('mm-icon').length;
diff --git a/ui/components/component-library/button-primary/button-primary.stories.js b/ui/components/component-library/button-primary/button-primary.stories.js
index d3a0bb3ff..c668153ee 100644
--- a/ui/components/component-library/button-primary/button-primary.stories.js
+++ b/ui/components/component-library/button-primary/button-primary.stories.js
@@ -5,7 +5,7 @@ import {
Size,
} from '../../../helpers/constants/design-system';
import Box from '../../ui/box/box';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { ButtonPrimary } from './button-primary';
import README from './README.mdx';
@@ -63,12 +63,12 @@ export default {
},
startIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
endIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
startIconProps: {
diff --git a/ui/components/component-library/button-primary/button-primary.test.js b/ui/components/component-library/button-primary/button-primary.test.js
index b16c7c36f..192e872dd 100644
--- a/ui/components/component-library/button-primary/button-primary.test.js
+++ b/ui/components/component-library/button-primary/button-primary.test.js
@@ -1,7 +1,7 @@
/* eslint-disable jest/require-top-level-describe */
import { render } from '@testing-library/react';
import React from 'react';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { ButtonPrimary } from './button-primary';
import { BUTTON_PRIMARY_SIZES } from './button-primary.constants';
@@ -90,10 +90,7 @@ describe('ButtonPrimary', () => {
});
it('should render with icon', () => {
const { container } = render(
- ,
+ ,
);
const icons = container.getElementsByClassName('mm-icon').length;
diff --git a/ui/components/component-library/button-secondary/button-secondary.stories.js b/ui/components/component-library/button-secondary/button-secondary.stories.js
index 6e4a0c445..94166d359 100644
--- a/ui/components/component-library/button-secondary/button-secondary.stories.js
+++ b/ui/components/component-library/button-secondary/button-secondary.stories.js
@@ -5,7 +5,7 @@ import {
Size,
} from '../../../helpers/constants/design-system';
import Box from '../../ui/box/box';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { ButtonSecondary } from './button-secondary';
import { BUTTON_SECONDARY_SIZES } from './button-secondary.constants';
import README from './README.mdx';
@@ -62,12 +62,12 @@ export default {
},
startIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
endIconName: {
control: 'select',
- options: Object.values(ICON_NAMES),
+ options: Object.values(IconName),
table: { category: 'button base props' },
},
startIconProps: {
diff --git a/ui/components/component-library/button-secondary/button-secondary.test.js b/ui/components/component-library/button-secondary/button-secondary.test.js
index 06a331a59..0529664cd 100644
--- a/ui/components/component-library/button-secondary/button-secondary.test.js
+++ b/ui/components/component-library/button-secondary/button-secondary.test.js
@@ -1,7 +1,7 @@
/* eslint-disable jest/require-top-level-describe */
import { render } from '@testing-library/react';
import React from 'react';
-import { ICON_NAMES } from '../icon/deprecated';
+import { IconName } from '..';
import { ButtonSecondary } from './button-secondary';
import { BUTTON_SECONDARY_SIZES } from './button-secondary.constants';
@@ -94,10 +94,7 @@ describe('ButtonSecondary', () => {
});
it('should render with icon', () => {
const { container } = render(
- ,
+ ,
);
const icons = container.getElementsByClassName('mm-icon').length;
diff --git a/ui/components/component-library/button/README.mdx b/ui/components/component-library/button/README.mdx
index 59d869f5d..0e1527ff7 100644
--- a/ui/components/component-library/button/README.mdx
+++ b/ui/components/component-library/button/README.mdx
@@ -175,7 +175,7 @@ import { Button } from '../ui/component-library';
### Icon Name
-Use the `startIconName` and/or `endIconName` prop and the `ICON_NAMES` object from `./ui/components/component-library/icon` to select icon.
+Use the `startIconName` and/or `endIconName` prop and the `IconName` enum from `./ui/components/component-library/icon` to select icon.
Use the [IconSearch](/story/components-componentlibrary-icon--default-story) story to find the icon you want to use.
@@ -185,9 +185,9 @@ Use the [IconSearch](/story/components-componentlibrary-icon--default-story) sto
```jsx
import { Button } from '../ui/component-library';
-import { ICON_NAMES } from '../icon';
+import { IconName } from '../icon';
-;
+;
```
```jsx
-import { TextField, Icon, ICON_NAMES } from '../../component-library';
+import { TextField, Icon, IconName } from '../../component-library';
// should map the props to the custom input component
const CustomInputComponent = () => {/* Custom input component */}
;
@@ -216,7 +216,7 @@ const TextFieldCustomInput = (args) => (
size={SIZES.LG}
InputComponent={CustomInputComponent}
startAccessory={
-
+
}
/>
);
diff --git a/ui/components/component-library/text-field/text-field.stories.js b/ui/components/component-library/text-field/text-field.stories.js
index 0ea5d6f06..b266ebb94 100644
--- a/ui/components/component-library/text-field/text-field.stories.js
+++ b/ui/components/component-library/text-field/text-field.stories.js
@@ -21,10 +21,11 @@ import {
Button,
ButtonIcon,
Text,
+ IconName,
+ Icon,
+ IconSize,
} from '..';
-import { ICON_NAMES, Icon } from '../icon/deprecated';
-
import { TEXT_FIELD_SIZES, TEXT_FIELD_TYPES } from './text-field.constants';
import { TextField } from './text-field';
@@ -240,7 +241,7 @@ export const StartAccessoryEndAccessory = (args) => {
name="search"
onChange={handleOnChange}
startAccessory={
-
+
}
/>
{
onChange={handleOnChange}
endAccessory={
@@ -281,9 +282,9 @@ export const StartAccessoryEndAccessory = (args) => {
/>
ETH
}
@@ -314,7 +315,7 @@ export const StartAccessoryEndAccessory = (args) => {
}
endAccessory={
value.accountAddress.length === 42 && (
-
+
)
}
/>
@@ -464,7 +465,7 @@ export const InputComponent = (args) => (
size={Size.LG}
InputComponent={CustomInputComponent}
startAccessory={
-
+
}
/>
);