1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

deprecation notice (#18859)

This commit is contained in:
Garrett Bear 2023-04-27 16:28:39 -07:00 committed by GitHub
parent 576eee7adf
commit 89d4038351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 18 deletions

View File

@ -4,12 +4,12 @@ import {
DISPLAY, DISPLAY,
BackgroundColor, BackgroundColor,
BorderColor, BorderColor,
FONT_WEIGHT, FontWeight,
FONT_STYLE, FontStyle,
TextColor, TextColor,
TEXT_ALIGN, TextAlign,
OVERFLOW_WRAP, OverflowWrap,
TEXT_TRANSFORM, TextTransform,
FRACTIONS, FRACTIONS,
FLEX_DIRECTION, FLEX_DIRECTION,
TextVariant, TextVariant,
@ -113,9 +113,9 @@ export const ColorStory: ComponentStory<typeof Text> = (args) => {
}; };
ColorStory.storyName = 'Color'; ColorStory.storyName = 'Color';
export const FontWeight: ComponentStory<typeof Text> = (args) => ( export const FontWeightStory: ComponentStory<typeof Text> = (args) => (
<> <>
{Object.values(FONT_WEIGHT).map((weight) => ( {Object.values(FontWeight).map((weight) => (
<Text {...args} fontWeight={weight} key={weight}> <Text {...args} fontWeight={weight} key={weight}>
{weight} {weight}
</Text> </Text>
@ -123,9 +123,11 @@ export const FontWeight: ComponentStory<typeof Text> = (args) => (
</> </>
); );
export const FontStyle: ComponentStory<typeof Text> = (args) => ( FontWeightStory.storyName = 'Font Weight';
export const FontStyleStory: ComponentStory<typeof Text> = (args) => (
<> <>
{Object.values(FONT_STYLE).map((style) => ( {Object.values(FontStyle).map((style) => (
<Text {...args} fontStyle={style} key={style}> <Text {...args} fontStyle={style} key={style}>
{style} {style}
</Text> </Text>
@ -133,9 +135,11 @@ export const FontStyle: ComponentStory<typeof Text> = (args) => (
</> </>
); );
export const TextTransform: ComponentStory<typeof Text> = (args) => ( FontStyleStory.storyName = 'Font Style';
export const TextTransformStory: ComponentStory<typeof Text> = (args) => (
<> <>
{Object.values(TEXT_TRANSFORM).map((transform) => ( {Object.values(TextTransform).map((transform) => (
<Text {...args} textTransform={transform} key={transform}> <Text {...args} textTransform={transform} key={transform}>
{transform} {transform}
</Text> </Text>
@ -143,9 +147,11 @@ export const TextTransform: ComponentStory<typeof Text> = (args) => (
</> </>
); );
export const TextAlign: ComponentStory<typeof Text> = (args) => ( TextTransformStory.storyName = 'Text Transform';
export const TextAlignStory: ComponentStory<typeof Text> = (args) => (
<> <>
{Object.values(TEXT_ALIGN).map((align) => ( {Object.values(TextAlign).map((align) => (
<Text {...args} textAlign={align} key={align}> <Text {...args} textAlign={align} key={align}>
{align} {align}
</Text> </Text>
@ -153,21 +159,25 @@ export const TextAlign: ComponentStory<typeof Text> = (args) => (
</> </>
); );
export const OverflowWrap: ComponentStory<typeof Text> = (args) => ( TextAlignStory.storyName = 'Text Align';
export const OverflowWrapStory: ComponentStory<typeof Text> = (args) => (
<Box <Box
borderColor={BorderColor.warningDefault} borderColor={BorderColor.warningDefault}
display={DISPLAY.BLOCK} display={DISPLAY.BLOCK}
style={{ width: 200 }} style={{ width: 200 }}
> >
<Text {...args} overflowWrap={OVERFLOW_WRAP.NORMAL}> <Text {...args} overflowWrap={OverflowWrap.Normal}>
{OVERFLOW_WRAP.NORMAL}: 0x39013f961c378f02c2b82a6e1d31e9812786fd9d {OverflowWrap.Normal}: 0x39013f961c378f02c2b82a6e1d31e9812786fd9d
</Text> </Text>
<Text {...args} overflowWrap={OVERFLOW_WRAP.BREAK_WORD}> <Text {...args} overflowWrap={OverflowWrap.BreakWord}>
{OVERFLOW_WRAP.BREAK_WORD}: 0x39013f961c378f02c2b82a6e1d31e9812786fd9d {OverflowWrap.BreakWord}: 0x39013f961c378f02c2b82a6e1d31e9812786fd9d
</Text> </Text>
</Box> </Box>
); );
OverflowWrapStory.storyName = 'Overflow Wrap';
export const Ellipsis: ComponentStory<typeof Text> = (args) => ( export const Ellipsis: ComponentStory<typeof Text> = (args) => (
<Box <Box
borderColor={BorderColor.primaryDefault} borderColor={BorderColor.primaryDefault}

View File

@ -306,6 +306,11 @@ export enum TextAlign {
Start = 'start', Start = 'start',
} }
/**
* @deprecated `TEXT_ALIGN` const has been deprecated in favour of the `TextAlign` enum which can still be imported from `ui/helpers/constants/design-system.ts`
*
* Help to replace `TEXT_ALIGN` with `TextAlign` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/18714
*/
export const TEXT_ALIGN = { export const TEXT_ALIGN = {
LEFT: 'left', LEFT: 'left',
CENTER: 'center', CENTER: 'center',
@ -324,6 +329,11 @@ export enum TextTransform {
Capitalize = 'capitalize', Capitalize = 'capitalize',
} }
/**
* @deprecated `TEXT_TRANSFORM` const has been deprecated in favour of the `TextTransform` enum which can still be imported from `ui/helpers/constants/design-system.ts`
*
* Help to replace `TEXT_TRANSFORM` with `TextTransform` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/18714
*/
export const TEXT_TRANSFORM = { export const TEXT_TRANSFORM = {
UPPERCASE: 'uppercase', UPPERCASE: 'uppercase',
LOWERCASE: 'lowercase', LOWERCASE: 'lowercase',
@ -336,6 +346,11 @@ export enum FontWeight {
Normal = 'normal', Normal = 'normal',
} }
/**
* @deprecated `FONT_WEIGHT` const has been deprecated in favour of the `FontWeight` enum which can still be imported from `ui/helpers/constants/design-system.ts`
*
* Help to replace `FONT_WEIGHT` with `FontWeight` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/18714
*/
export const FONT_WEIGHT = { export const FONT_WEIGHT = {
BOLD: 'bold', BOLD: 'bold',
MEDIUM: 'medium', MEDIUM: 'medium',
@ -348,6 +363,11 @@ export enum OverflowWrap {
Normal = 'normal', Normal = 'normal',
} }
/**
* @deprecated `OVERFLOW_WRAP` const has been deprecated in favour of the `OverflowWrap` enum which can still be imported from `ui/helpers/constants/design-system.ts`
*
* Help to replace `OVERFLOW_WRAP` with `OverflowWrap` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/18714
*/
export const OVERFLOW_WRAP = { export const OVERFLOW_WRAP = {
BREAK_WORD: 'break-word', BREAK_WORD: 'break-word',
ANYWHERE: 'anywhere', ANYWHERE: 'anywhere',
@ -359,6 +379,11 @@ export enum FontStyle {
Normal = 'normal', Normal = 'normal',
} }
/**
* @deprecated `FONT_STYLE` const has been deprecated in favour of the `FontStyle` enum which can still be imported from `ui/helpers/constants/design-system.ts`
*
* Help to replace `FONT_STYLE` with `FontStyle` by submitting PRs against https://github.com/MetaMask/metamask-extension/issues/18714
*/
export const FONT_STYLE = { export const FONT_STYLE = {
ITALIC: 'italic', ITALIC: 'italic',
NORMAL: 'normal', NORMAL: 'normal',