|
1 | | -import { typography } from '@metamask/design-tokens'; |
2 | | - |
3 | | -import { TextVariant } from '../../types'; |
| 1 | +import { MAP_TEXT_VARIANT_INPUT_METRICS } from '../Input/Input.constants'; |
4 | 2 |
|
5 | 3 | /** |
6 | 4 | * Typographic metrics for Textarea: same tokens as `text-*` utilities but **without** `lineHeight`. |
7 | 5 | * React Native `TextInput` with multiline aligns text more predictably when line height is not set |
8 | 6 | * from the design-system paragraph specs. |
9 | 7 | */ |
10 | | -export const MAP_TEXT_VARIANT_TEXTAREA_METRICS: Record< |
11 | | - TextVariant, |
12 | | - { fontSize: number; letterSpacing: number } |
13 | | -> = { |
14 | | - [TextVariant.DisplayLg]: { |
15 | | - fontSize: typography.sDisplayLG.fontSize, |
16 | | - letterSpacing: typography.sDisplayLG.letterSpacing, |
17 | | - }, |
18 | | - [TextVariant.DisplayMd]: { |
19 | | - fontSize: typography.sDisplayMD.fontSize, |
20 | | - letterSpacing: typography.sDisplayMD.letterSpacing, |
21 | | - }, |
22 | | - [TextVariant.HeadingLg]: { |
23 | | - fontSize: typography.sHeadingLG.fontSize, |
24 | | - letterSpacing: typography.sHeadingLG.letterSpacing, |
25 | | - }, |
26 | | - [TextVariant.HeadingMd]: { |
27 | | - fontSize: typography.sHeadingMD.fontSize, |
28 | | - letterSpacing: typography.sHeadingMD.letterSpacing, |
29 | | - }, |
30 | | - [TextVariant.HeadingSm]: { |
31 | | - fontSize: typography.sHeadingSM.fontSize, |
32 | | - letterSpacing: typography.sHeadingSM.letterSpacing, |
33 | | - }, |
34 | | - [TextVariant.BodyLg]: { |
35 | | - fontSize: typography.sBodyLGMedium.fontSize, |
36 | | - letterSpacing: typography.sBodyLGMedium.letterSpacing, |
37 | | - }, |
38 | | - [TextVariant.BodyMd]: { |
39 | | - fontSize: typography.sBodyMD.fontSize, |
40 | | - letterSpacing: typography.sBodyMD.letterSpacing, |
41 | | - }, |
42 | | - [TextVariant.BodySm]: { |
43 | | - fontSize: typography.sBodySM.fontSize, |
44 | | - letterSpacing: typography.sBodySM.letterSpacing, |
45 | | - }, |
46 | | - [TextVariant.BodyXs]: { |
47 | | - fontSize: typography.sBodyXS.fontSize, |
48 | | - letterSpacing: typography.sBodyXS.letterSpacing, |
49 | | - }, |
50 | | - [TextVariant.PageHeading]: { |
51 | | - fontSize: typography.sPageHeading.fontSize, |
52 | | - letterSpacing: typography.sPageHeading.letterSpacing, |
53 | | - }, |
54 | | - [TextVariant.SectionHeading]: { |
55 | | - fontSize: typography.sSectionHeading.fontSize, |
56 | | - letterSpacing: typography.sSectionHeading.letterSpacing, |
57 | | - }, |
58 | | - [TextVariant.ButtonLabelMd]: { |
59 | | - fontSize: typography.sButtonLabelMd.fontSize, |
60 | | - letterSpacing: typography.sButtonLabelMd.letterSpacing, |
61 | | - }, |
62 | | - [TextVariant.ButtonLabelLg]: { |
63 | | - fontSize: typography.sButtonLabelLg.fontSize, |
64 | | - letterSpacing: typography.sButtonLabelLg.letterSpacing, |
65 | | - }, |
66 | | - [TextVariant.AmountDisplayLg]: { |
67 | | - fontSize: typography.sAmountDisplayLg.fontSize, |
68 | | - letterSpacing: typography.sAmountDisplayLg.letterSpacing, |
69 | | - }, |
70 | | -}; |
| 8 | +export const MAP_TEXT_VARIANT_TEXTAREA_METRICS = MAP_TEXT_VARIANT_INPUT_METRICS; |
71 | 9 |
|
72 | 10 | /** |
73 | 11 | * Default number of lines displayed in the Textarea. |
|
0 commit comments