@metamask-previews/design-system-react-native 0.16.0-preview.d854123 → 0.18.0-preview.9d477a9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs +1 -2
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs +1 -2
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.types.cjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.types.d.cts +5 -7
- package/dist/components/AvatarFavicon/AvatarFavicon.types.d.cts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.types.d.mts +5 -7
- package/dist/components/AvatarFavicon/AvatarFavicon.types.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.types.mjs.map +1 -1
- package/dist/components/AvatarFavicon/index.cjs +2 -2
- package/dist/components/AvatarFavicon/index.cjs.map +1 -1
- package/dist/components/AvatarFavicon/index.d.cts +1 -1
- package/dist/components/AvatarFavicon/index.d.cts.map +1 -1
- package/dist/components/AvatarFavicon/index.d.mts +1 -1
- package/dist/components/AvatarFavicon/index.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/index.mjs +1 -1
- package/dist/components/AvatarFavicon/index.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +3 -3
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +2 -2
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +1 -6
- package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts +1 -6
- package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.cts +2 -28
- package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.mts +2 -28
- package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +281 -282
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +281 -282
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/Icon.types.cjs.map +1 -1
- package/dist/components/Icon/Icon.types.d.cts +1 -18
- package/dist/components/Icon/Icon.types.d.cts.map +1 -1
- package/dist/components/Icon/Icon.types.d.mts +1 -18
- package/dist/components/Icon/Icon.types.d.mts.map +1 -1
- package/dist/components/Icon/Icon.types.mjs.map +1 -1
- package/dist/components/IconAlert/IconAlert.cjs +16 -0
- package/dist/components/IconAlert/IconAlert.cjs.map +1 -0
- package/dist/components/IconAlert/IconAlert.constants.cjs +23 -0
- package/dist/components/IconAlert/IconAlert.constants.cjs.map +1 -0
- package/dist/components/IconAlert/IconAlert.constants.d.cts +6 -0
- package/dist/components/IconAlert/IconAlert.constants.d.cts.map +1 -0
- package/dist/components/IconAlert/IconAlert.constants.d.mts +6 -0
- package/dist/components/IconAlert/IconAlert.constants.d.mts.map +1 -0
- package/dist/components/IconAlert/IconAlert.constants.mjs +20 -0
- package/dist/components/IconAlert/IconAlert.constants.mjs.map +1 -0
- package/dist/components/IconAlert/IconAlert.d.cts +7 -0
- package/dist/components/IconAlert/IconAlert.d.cts.map +1 -0
- package/dist/components/IconAlert/IconAlert.d.mts +7 -0
- package/dist/components/IconAlert/IconAlert.d.mts.map +1 -0
- package/dist/components/IconAlert/IconAlert.mjs +16 -0
- package/dist/components/IconAlert/IconAlert.mjs.map +1 -0
- package/dist/components/IconAlert/IconAlert.types.cjs +3 -0
- package/dist/components/IconAlert/IconAlert.types.cjs.map +1 -0
- package/dist/components/IconAlert/IconAlert.types.d.cts +4 -0
- package/dist/components/IconAlert/IconAlert.types.d.cts.map +1 -0
- package/dist/components/IconAlert/IconAlert.types.d.mts +4 -0
- package/dist/components/IconAlert/IconAlert.types.d.mts.map +1 -0
- package/dist/components/IconAlert/IconAlert.types.mjs +2 -0
- package/dist/components/IconAlert/IconAlert.types.mjs.map +1 -0
- package/dist/components/IconAlert/index.cjs +8 -0
- package/dist/components/IconAlert/index.cjs.map +1 -0
- package/dist/components/IconAlert/index.d.cts +4 -0
- package/dist/components/IconAlert/index.d.cts.map +1 -0
- package/dist/components/IconAlert/index.d.mts +4 -0
- package/dist/components/IconAlert/index.d.mts.map +1 -0
- package/dist/components/IconAlert/index.mjs +3 -0
- package/dist/components/IconAlert/index.mjs.map +1 -0
- package/dist/components/Input/Input.cjs +4 -4
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.constants.cjs +15 -15
- package/dist/components/Input/Input.constants.cjs.map +1 -1
- package/dist/components/Input/Input.constants.d.cts +1 -1
- package/dist/components/Input/Input.constants.d.cts.map +1 -1
- package/dist/components/Input/Input.constants.d.mts +1 -1
- package/dist/components/Input/Input.constants.d.mts.map +1 -1
- package/dist/components/Input/Input.constants.mjs +1 -1
- package/dist/components/Input/Input.constants.mjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -1
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +1 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +3 -3
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/Input.types.cjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +1 -1
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +1 -1
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/Input/Input.types.mjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs +9 -8
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +2 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +8 -8
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +2 -2
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/Text/Text.cjs +5 -5
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs +20 -25
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts +2 -2
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts +2 -2
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs +16 -21
- package/dist/components/Text/Text.constants.mjs.map +1 -1
- package/dist/components/Text/Text.d.cts.map +1 -1
- package/dist/components/Text/Text.d.mts.map +1 -1
- package/dist/components/Text/Text.mjs +3 -3
- package/dist/components/Text/Text.mjs.map +1 -1
- package/dist/components/Text/Text.types.cjs.map +1 -1
- package/dist/components/Text/Text.types.d.cts +3 -35
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +3 -35
- package/dist/components/Text/Text.types.d.mts.map +1 -1
- package/dist/components/Text/Text.types.mjs.map +1 -1
- package/dist/components/Text/index.cjs +7 -7
- package/dist/components/Text/index.cjs.map +1 -1
- package/dist/components/Text/index.d.cts +1 -1
- package/dist/components/Text/index.d.cts.map +1 -1
- package/dist/components/Text/index.d.mts +1 -1
- package/dist/components/Text/index.d.mts.map +1 -1
- package/dist/components/Text/index.mjs +1 -1
- package/dist/components/Text/index.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.cjs +3 -3
- package/dist/components/TextButton/TextButton.cjs.map +1 -1
- package/dist/components/TextButton/TextButton.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.d.mts.map +1 -1
- package/dist/components/TextButton/TextButton.mjs +1 -1
- package/dist/components/TextButton/TextButton.mjs.map +1 -1
- package/dist/components/TextField/TextField.cjs +2 -2
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +1 -1
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/index.cjs +5 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +2 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +1 -0
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +5 -118
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +0 -100
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +0 -100
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +0 -109
- package/dist/types/index.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -24,17 +24,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Text = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
27
28
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
28
29
|
const react_1 = __importStar(require("react"));
|
|
29
30
|
const react_native_1 = require("react-native/index.js");
|
|
30
|
-
const types_1 = require("../../types/index.cjs");
|
|
31
31
|
const Text_constants_1 = require("./Text.constants.cjs");
|
|
32
|
-
const Text = ({ variant =
|
|
32
|
+
const Text = ({ variant = design_system_shared_1.TextVariant.BodyMd, color = design_system_shared_1.TextColor.TextDefault, style, children, fontWeight, fontFamily = design_system_shared_1.FontFamily.Default, fontStyle = design_system_shared_1.FontStyle.Normal, twClassName, ...props }) => {
|
|
33
33
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
34
|
-
const finalFontWeight = fontWeight ?? Text_constants_1.
|
|
34
|
+
const finalFontWeight = fontWeight ?? Text_constants_1.TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant];
|
|
35
35
|
const textStyle = (0, react_1.useMemo)(() => {
|
|
36
|
-
const isItalic = fontStyle ===
|
|
37
|
-
const fontSuffix = `${Text_constants_1.TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${isItalic && fontFamily ===
|
|
36
|
+
const isItalic = fontStyle === design_system_shared_1.FontStyle.Italic;
|
|
37
|
+
const fontSuffix = `${Text_constants_1.TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${isItalic && fontFamily === design_system_shared_1.FontFamily.Default ? '-italic' : ''}`;
|
|
38
38
|
const fontClass = `font-${fontFamily}${fontSuffix}`;
|
|
39
39
|
return tw.style(`text-${variant}`, fontClass, color, twClassName);
|
|
40
40
|
}, [variant, color, finalFontWeight, fontFamily, fontStyle, twClassName, tw]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAuC;AACvC,wDAA8C;AAE9C,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAKiD;AACjD,8FAA4E;AAC5E,+CAAuC;AACvC,wDAA8C;AAE9C,yDAG0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,kCAAW,CAAC,MAAM,EAC5B,KAAK,GAAG,gCAAS,CAAC,WAAW,EAC7B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,UAAU,GAAG,iCAAU,CAAC,OAAO,EAC/B,SAAS,GAAG,gCAAS,CAAC,MAAM,EAC5B,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,eAAe,GACnB,UAAU,IAAI,mDAAkC,CAAC,OAAO,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC7B,MAAM,QAAQ,GAAG,SAAS,KAAK,gCAAS,CAAC,MAAM,CAAC;QAChD,MAAM,UAAU,GAAG,GAAG,2CAA0B,CAAC,eAAe,CAAC,GAC/D,QAAQ,IAAI,UAAU,KAAK,iCAAU,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC9D,EAAE,CAAC;QACH,MAAM,SAAS,GAAG,QAAQ,UAAU,GAAG,UAAU,EAAE,CAAC;QACpD,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,OAAO,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IAE9E,OAAO,CACL,CAAC,mBAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACpE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC;AA7BW,QAAA,IAAI,QA6Bf","sourcesContent":["import {\n FontFamily,\n FontStyle,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { Text as RNText } from 'react-native';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n color = TextColor.TextDefault,\n style,\n children,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle = FontStyle.Normal,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const finalFontWeight =\n fontWeight ?? TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant];\n\n const textStyle = useMemo(() => {\n const isItalic = fontStyle === FontStyle.Italic;\n const fontSuffix = `${TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${\n isItalic && fontFamily === FontFamily.Default ? '-italic' : ''\n }`;\n const fontClass = `font-${fontFamily}${fontSuffix}`;\n return tw.style(`text-${variant}`, fontClass, color, twClassName);\n }, [variant, color, finalFontWeight, fontFamily, fontStyle, twClassName, tw]);\n\n return (\n <RNText accessibilityRole=\"text\" {...props} style={[textStyle, style]}>\n {children}\n </RNText>\n );\n};\n"]}
|
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
5
|
-
const types_1 = require("../../types/index.cjs");
|
|
3
|
+
exports.TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT = exports.TWCLASSMAP_TEXT_FONTWEIGHT = void 0;
|
|
4
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
6
5
|
// Mappings
|
|
7
6
|
exports.TWCLASSMAP_TEXT_FONTWEIGHT = {
|
|
8
|
-
[
|
|
9
|
-
[
|
|
10
|
-
[
|
|
7
|
+
[design_system_shared_1.FontWeight.Regular]: '-regular',
|
|
8
|
+
[design_system_shared_1.FontWeight.Medium]: '-medium',
|
|
9
|
+
[design_system_shared_1.FontWeight.Bold]: '-bold',
|
|
11
10
|
};
|
|
12
|
-
exports.
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
|
|
25
|
-
[
|
|
26
|
-
|
|
27
|
-
[types_1.TextVariant.ButtonLabelLg]: design_tokens_1.typography.sButtonLabelLg
|
|
28
|
-
.fontWeight,
|
|
29
|
-
[types_1.TextVariant.AmountDisplayLg]: design_tokens_1.typography.sAmountDisplayLg
|
|
30
|
-
.fontWeight,
|
|
11
|
+
exports.TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
12
|
+
[design_system_shared_1.TextVariant.DisplayLg]: design_system_shared_1.FontWeight.Bold,
|
|
13
|
+
[design_system_shared_1.TextVariant.DisplayMd]: design_system_shared_1.FontWeight.Bold,
|
|
14
|
+
[design_system_shared_1.TextVariant.HeadingLg]: design_system_shared_1.FontWeight.Bold,
|
|
15
|
+
[design_system_shared_1.TextVariant.HeadingMd]: design_system_shared_1.FontWeight.Bold,
|
|
16
|
+
[design_system_shared_1.TextVariant.HeadingSm]: design_system_shared_1.FontWeight.Bold,
|
|
17
|
+
[design_system_shared_1.TextVariant.BodyLg]: design_system_shared_1.FontWeight.Medium,
|
|
18
|
+
[design_system_shared_1.TextVariant.BodyMd]: design_system_shared_1.FontWeight.Regular,
|
|
19
|
+
[design_system_shared_1.TextVariant.BodySm]: design_system_shared_1.FontWeight.Regular,
|
|
20
|
+
[design_system_shared_1.TextVariant.BodyXs]: design_system_shared_1.FontWeight.Regular,
|
|
21
|
+
[design_system_shared_1.TextVariant.PageHeading]: design_system_shared_1.FontWeight.Bold,
|
|
22
|
+
[design_system_shared_1.TextVariant.SectionHeading]: design_system_shared_1.FontWeight.Bold,
|
|
23
|
+
[design_system_shared_1.TextVariant.ButtonLabelMd]: design_system_shared_1.FontWeight.Medium,
|
|
24
|
+
[design_system_shared_1.TextVariant.ButtonLabelLg]: design_system_shared_1.FontWeight.Medium,
|
|
25
|
+
[design_system_shared_1.TextVariant.AmountDisplayLg]: design_system_shared_1.FontWeight.Bold,
|
|
31
26
|
};
|
|
32
27
|
//# sourceMappingURL=Text.constants.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Text.constants.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":";;;AAAA,kFAAkF;AAElF,WAAW;AACE,QAAA,0BAA0B,GAEnC;IACF,CAAC,iCAAU,CAAC,OAAO,CAAC,EAAE,UAAU;IAChC,CAAC,iCAAU,CAAC,MAAM,CAAC,EAAE,SAAS;IAC9B,CAAC,iCAAU,CAAC,IAAI,CAAC,EAAE,OAAO;CAC3B,CAAC;AAEW,QAAA,kCAAkC,GAE3C;IACF,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,iCAAU,CAAC,IAAI;IACxC,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,iCAAU,CAAC,IAAI;IACxC,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,iCAAU,CAAC,IAAI;IACxC,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,iCAAU,CAAC,IAAI;IACxC,CAAC,kCAAW,CAAC,SAAS,CAAC,EAAE,iCAAU,CAAC,IAAI;IACxC,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,iCAAU,CAAC,MAAM;IACvC,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,iCAAU,CAAC,OAAO;IACxC,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,iCAAU,CAAC,OAAO;IACxC,CAAC,kCAAW,CAAC,MAAM,CAAC,EAAE,iCAAU,CAAC,OAAO;IACxC,CAAC,kCAAW,CAAC,WAAW,CAAC,EAAE,iCAAU,CAAC,IAAI;IAC1C,CAAC,kCAAW,CAAC,cAAc,CAAC,EAAE,iCAAU,CAAC,IAAI;IAC7C,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,iCAAU,CAAC,MAAM;IAC9C,CAAC,kCAAW,CAAC,aAAa,CAAC,EAAE,iCAAU,CAAC,MAAM;IAC9C,CAAC,kCAAW,CAAC,eAAe,CAAC,EAAE,iCAAU,CAAC,IAAI;CAC/C,CAAC","sourcesContent":["import { FontWeight, TextVariant } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: {\n [key in FontWeight]: string;\n} = {\n [FontWeight.Regular]: '-regular',\n [FontWeight.Medium]: '-medium',\n [FontWeight.Bold]: '-bold',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: {\n [key in TextVariant]: FontWeight;\n} = {\n [TextVariant.DisplayLg]: FontWeight.Bold,\n [TextVariant.DisplayMd]: FontWeight.Bold,\n [TextVariant.HeadingLg]: FontWeight.Bold,\n [TextVariant.HeadingMd]: FontWeight.Bold,\n [TextVariant.HeadingSm]: FontWeight.Bold,\n [TextVariant.BodyLg]: FontWeight.Medium,\n [TextVariant.BodyMd]: FontWeight.Regular,\n [TextVariant.BodySm]: FontWeight.Regular,\n [TextVariant.BodyXs]: FontWeight.Regular,\n [TextVariant.PageHeading]: FontWeight.Bold,\n [TextVariant.SectionHeading]: FontWeight.Bold,\n [TextVariant.ButtonLabelMd]: FontWeight.Medium,\n [TextVariant.ButtonLabelLg]: FontWeight.Medium,\n [TextVariant.AmountDisplayLg]: FontWeight.Bold,\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FontWeight, TextVariant } from "
|
|
1
|
+
import { FontWeight, TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_TEXT_FONTWEIGHT: {
|
|
3
3
|
[key in FontWeight]: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: {
|
|
6
6
|
[key in TextVariant]: FontWeight;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=Text.constants.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gDAAgD;AAGlF,eAAO,MAAM,0BAA0B,EAAE;KACtC,GAAG,IAAI,UAAU,GAAG,MAAM;CAK5B,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE;KAC9C,GAAG,IAAI,WAAW,GAAG,UAAU;CAgBjC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FontWeight, TextVariant } from "
|
|
1
|
+
import { FontWeight, TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export declare const TWCLASSMAP_TEXT_FONTWEIGHT: {
|
|
3
3
|
[key in FontWeight]: string;
|
|
4
4
|
};
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: {
|
|
6
6
|
[key in TextVariant]: FontWeight;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=Text.constants.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gDAAgD;AAGlF,eAAO,MAAM,0BAA0B,EAAE;KACtC,GAAG,IAAI,UAAU,GAAG,MAAM;CAK5B,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE;KAC9C,GAAG,IAAI,WAAW,GAAG,UAAU;CAgBjC,CAAC"}
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FontWeight, TextVariant } from "../../types/index.mjs";
|
|
1
|
+
import { FontWeight, TextVariant } from "@metamask-previews/design-system-shared";
|
|
3
2
|
// Mappings
|
|
4
3
|
export const TWCLASSMAP_TEXT_FONTWEIGHT = {
|
|
5
4
|
[FontWeight.Regular]: '-regular',
|
|
6
5
|
[FontWeight.Medium]: '-medium',
|
|
7
6
|
[FontWeight.Bold]: '-bold',
|
|
8
7
|
};
|
|
9
|
-
export const
|
|
10
|
-
[TextVariant.DisplayLg]:
|
|
11
|
-
[TextVariant.DisplayMd]:
|
|
12
|
-
[TextVariant.HeadingLg]:
|
|
13
|
-
[TextVariant.HeadingMd]:
|
|
14
|
-
[TextVariant.HeadingSm]:
|
|
15
|
-
[TextVariant.BodyLg]:
|
|
16
|
-
[TextVariant.BodyMd]:
|
|
17
|
-
[TextVariant.BodySm]:
|
|
18
|
-
[TextVariant.BodyXs]:
|
|
19
|
-
[TextVariant.PageHeading]:
|
|
20
|
-
[TextVariant.SectionHeading]:
|
|
21
|
-
|
|
22
|
-
[TextVariant.
|
|
23
|
-
|
|
24
|
-
[TextVariant.ButtonLabelLg]: typography.sButtonLabelLg
|
|
25
|
-
.fontWeight,
|
|
26
|
-
[TextVariant.AmountDisplayLg]: typography.sAmountDisplayLg
|
|
27
|
-
.fontWeight,
|
|
8
|
+
export const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
9
|
+
[TextVariant.DisplayLg]: FontWeight.Bold,
|
|
10
|
+
[TextVariant.DisplayMd]: FontWeight.Bold,
|
|
11
|
+
[TextVariant.HeadingLg]: FontWeight.Bold,
|
|
12
|
+
[TextVariant.HeadingMd]: FontWeight.Bold,
|
|
13
|
+
[TextVariant.HeadingSm]: FontWeight.Bold,
|
|
14
|
+
[TextVariant.BodyLg]: FontWeight.Medium,
|
|
15
|
+
[TextVariant.BodyMd]: FontWeight.Regular,
|
|
16
|
+
[TextVariant.BodySm]: FontWeight.Regular,
|
|
17
|
+
[TextVariant.BodyXs]: FontWeight.Regular,
|
|
18
|
+
[TextVariant.PageHeading]: FontWeight.Bold,
|
|
19
|
+
[TextVariant.SectionHeading]: FontWeight.Bold,
|
|
20
|
+
[TextVariant.ButtonLabelMd]: FontWeight.Medium,
|
|
21
|
+
[TextVariant.ButtonLabelLg]: FontWeight.Medium,
|
|
22
|
+
[TextVariant.AmountDisplayLg]: FontWeight.Bold,
|
|
28
23
|
};
|
|
29
24
|
//# sourceMappingURL=Text.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gDAAgD;AAElF,WAAW;AACX,MAAM,CAAC,MAAM,0BAA0B,GAEnC;IACF,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU;IAChC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,SAAS;IAC9B,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,kCAAkC,GAE3C;IACF,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,IAAI;IACxC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,IAAI;IACxC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,IAAI;IACxC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,IAAI;IACxC,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,IAAI;IACxC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,MAAM;IACvC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO;IACxC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO;IACxC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO;IACxC,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,IAAI;IAC1C,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,IAAI;IAC7C,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,MAAM;IAC9C,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,MAAM;IAC9C,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,IAAI;CAC/C,CAAC","sourcesContent":["import { FontWeight, TextVariant } from '@metamask-previews/design-system-shared';\n\n// Mappings\nexport const TWCLASSMAP_TEXT_FONTWEIGHT: {\n [key in FontWeight]: string;\n} = {\n [FontWeight.Regular]: '-regular',\n [FontWeight.Medium]: '-medium',\n [FontWeight.Bold]: '-bold',\n};\n\nexport const TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT: {\n [key in TextVariant]: FontWeight;\n} = {\n [TextVariant.DisplayLg]: FontWeight.Bold,\n [TextVariant.DisplayMd]: FontWeight.Bold,\n [TextVariant.HeadingLg]: FontWeight.Bold,\n [TextVariant.HeadingMd]: FontWeight.Bold,\n [TextVariant.HeadingSm]: FontWeight.Bold,\n [TextVariant.BodyLg]: FontWeight.Medium,\n [TextVariant.BodyMd]: FontWeight.Regular,\n [TextVariant.BodySm]: FontWeight.Regular,\n [TextVariant.BodyXs]: FontWeight.Regular,\n [TextVariant.PageHeading]: FontWeight.Bold,\n [TextVariant.SectionHeading]: FontWeight.Bold,\n [TextVariant.ButtonLabelMd]: FontWeight.Medium,\n [TextVariant.ButtonLabelLg]: FontWeight.Medium,\n [TextVariant.AmountDisplayLg]: FontWeight.Bold,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAOvC,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA6BpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAOvC,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA6BpC,CAAC"}
|
|
@@ -4,15 +4,15 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { FontFamily, FontStyle, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
8
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
9
|
import $React, { useMemo } from "react";
|
|
9
10
|
const React = $importDefault($React);
|
|
10
11
|
import { Text as RNText } from "react-native/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import { MAP_TEXT_VARIANT_FONTWEIGHT, TWCLASSMAP_TEXT_FONTWEIGHT } from "./Text.constants.mjs";
|
|
12
|
+
import { TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT, TWCLASSMAP_TEXT_FONTWEIGHT } from "./Text.constants.mjs";
|
|
13
13
|
export const Text = ({ variant = TextVariant.BodyMd, color = TextColor.TextDefault, style, children, fontWeight, fontFamily = FontFamily.Default, fontStyle = FontStyle.Normal, twClassName, ...props }) => {
|
|
14
14
|
const tw = useTailwind();
|
|
15
|
-
const finalFontWeight = fontWeight ??
|
|
15
|
+
const finalFontWeight = fontWeight ?? TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant];
|
|
16
16
|
const textStyle = useMemo(() => {
|
|
17
17
|
const isItalic = fontStyle === FontStyle.Italic;
|
|
18
18
|
const fontSuffix = `${TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${isItalic && fontFamily === FontFamily.Default ? '-italic' : ''}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AACvC,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,8BAAqB;AAE9C,OAAO,
|
|
1
|
+
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AACvC,OAAO,EAAE,IAAI,IAAI,MAAM,EAAE,8BAAqB;AAE9C,OAAO,EACL,kCAAkC,EAClC,0BAA0B,EAC3B,6BAAyB;AAG1B,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,KAAK,GAAG,SAAS,CAAC,WAAW,EAC7B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,UAAU,GAAG,UAAU,CAAC,OAAO,EAC/B,SAAS,GAAG,SAAS,CAAC,MAAM,EAC5B,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,eAAe,GACnB,UAAU,IAAI,kCAAkC,CAAC,OAAO,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,MAAM,QAAQ,GAAG,SAAS,KAAK,SAAS,CAAC,MAAM,CAAC;QAChD,MAAM,UAAU,GAAG,GAAG,0BAA0B,CAAC,eAAe,CAAC,GAC/D,QAAQ,IAAI,UAAU,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAC9D,EAAE,CAAC;QACH,MAAM,SAAS,GAAG,QAAQ,UAAU,GAAG,UAAU,EAAE,CAAC;QACpD,OAAO,EAAE,CAAC,KAAK,CAAC,QAAQ,OAAO,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;IAE9E,OAAO,CACL,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACpE;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n FontFamily,\n FontStyle,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { Text as RNText } from 'react-native';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from './Text.constants';\nimport type { TextProps } from './Text.types';\n\nexport const Text: React.FC<TextProps> = ({\n variant = TextVariant.BodyMd,\n color = TextColor.TextDefault,\n style,\n children,\n fontWeight,\n fontFamily = FontFamily.Default,\n fontStyle = FontStyle.Normal,\n twClassName,\n ...props\n}) => {\n const tw = useTailwind();\n const finalFontWeight =\n fontWeight ?? TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[variant];\n\n const textStyle = useMemo(() => {\n const isItalic = fontStyle === FontStyle.Italic;\n const fontSuffix = `${TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${\n isItalic && fontFamily === FontFamily.Default ? '-italic' : ''\n }`;\n const fontClass = `font-${fontFamily}${fontSuffix}`;\n return tw.style(`text-${variant}`, fontClass, color, twClassName);\n }, [variant, color, finalFontWeight, fontFamily, fontStyle, twClassName, tw]);\n\n return (\n <RNText accessibilityRole=\"text\" {...props} style={[textStyle, style]}>\n {children}\n </RNText>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Text.types.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\nimport type { TextProps as RNTextProps } from 'react-native';\n\n/**\n * Text component props.\n */\nexport type TextProps = TextPropsShared &\n RNTextProps & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -1,44 +1,12 @@
|
|
|
1
|
+
import type { TextPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { TextProps as RNTextProps } from "react-native/index.js";
|
|
2
|
-
import type { TextVariant, TextColor, FontWeight, FontFamily, FontStyle } from "../../types/index.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Text component props.
|
|
5
5
|
*/
|
|
6
|
-
export type TextProps = {
|
|
7
|
-
/**
|
|
8
|
-
* Optional enum to select between Typography variants.
|
|
9
|
-
*
|
|
10
|
-
* @default BodyMD
|
|
11
|
-
*/
|
|
12
|
-
variant?: TextVariant;
|
|
13
|
-
/**
|
|
14
|
-
* Text to be displayed.
|
|
15
|
-
*/
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Optional prop to add color to text.
|
|
19
|
-
*/
|
|
20
|
-
color?: TextColor;
|
|
21
|
-
/**
|
|
22
|
-
* Optional prop to control the font weight of the text.
|
|
23
|
-
* Normal: 400
|
|
24
|
-
* Medium: 500
|
|
25
|
-
* Bold: 600
|
|
26
|
-
*/
|
|
27
|
-
fontWeight?: FontWeight;
|
|
28
|
-
/**
|
|
29
|
-
* Optional prop to adjust the font family.
|
|
30
|
-
* Default: Geist
|
|
31
|
-
* Accent: MM Sans
|
|
32
|
-
* Hero: MM Poly
|
|
33
|
-
*/
|
|
34
|
-
fontFamily?: FontFamily;
|
|
35
|
-
/**
|
|
36
|
-
* Optional prop to adjust the style of the font.
|
|
37
|
-
*/
|
|
38
|
-
fontStyle?: FontStyle;
|
|
6
|
+
export type TextProps = TextPropsShared & RNTextProps & {
|
|
39
7
|
/**
|
|
40
8
|
* Optional prop to add twrnc overriding classNames.
|
|
41
9
|
*/
|
|
42
10
|
twClassName?: string;
|
|
43
|
-
}
|
|
11
|
+
};
|
|
44
12
|
//# sourceMappingURL=Text.types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.types.d.cts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gDAAgD;AAC/E,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,8BAAqB;AAE7D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GACrC,WAAW,GAAG;IACZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,44 +1,12 @@
|
|
|
1
|
+
import type { TextPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { TextProps as RNTextProps } from "react-native/index.js";
|
|
2
|
-
import type { TextVariant, TextColor, FontWeight, FontFamily, FontStyle } from "../../types/index.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Text component props.
|
|
5
5
|
*/
|
|
6
|
-
export type TextProps = {
|
|
7
|
-
/**
|
|
8
|
-
* Optional enum to select between Typography variants.
|
|
9
|
-
*
|
|
10
|
-
* @default BodyMD
|
|
11
|
-
*/
|
|
12
|
-
variant?: TextVariant;
|
|
13
|
-
/**
|
|
14
|
-
* Text to be displayed.
|
|
15
|
-
*/
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Optional prop to add color to text.
|
|
19
|
-
*/
|
|
20
|
-
color?: TextColor;
|
|
21
|
-
/**
|
|
22
|
-
* Optional prop to control the font weight of the text.
|
|
23
|
-
* Normal: 400
|
|
24
|
-
* Medium: 500
|
|
25
|
-
* Bold: 600
|
|
26
|
-
*/
|
|
27
|
-
fontWeight?: FontWeight;
|
|
28
|
-
/**
|
|
29
|
-
* Optional prop to adjust the font family.
|
|
30
|
-
* Default: Geist
|
|
31
|
-
* Accent: MM Sans
|
|
32
|
-
* Hero: MM Poly
|
|
33
|
-
*/
|
|
34
|
-
fontFamily?: FontFamily;
|
|
35
|
-
/**
|
|
36
|
-
* Optional prop to adjust the style of the font.
|
|
37
|
-
*/
|
|
38
|
-
fontStyle?: FontStyle;
|
|
6
|
+
export type TextProps = TextPropsShared & RNTextProps & {
|
|
39
7
|
/**
|
|
40
8
|
* Optional prop to add twrnc overriding classNames.
|
|
41
9
|
*/
|
|
42
10
|
twClassName?: string;
|
|
43
|
-
}
|
|
11
|
+
};
|
|
44
12
|
//# sourceMappingURL=Text.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Text.types.d.mts","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gDAAgD;AAC/E,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,8BAAqB;AAE7D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GACrC,WAAW,GAAG;IACZ;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"Text.types.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextPropsShared } from '@metamask-previews/design-system-shared';\nimport type { TextProps as RNTextProps } from 'react-native';\n\n/**\n * Text component props.\n */\nexport type TextProps = TextPropsShared &\n RNTextProps & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Text = exports.FontStyle = exports.FontFamily = exports.FontWeight = exports.
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "
|
|
6
|
-
Object.defineProperty(exports, "
|
|
7
|
-
Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return
|
|
8
|
-
Object.defineProperty(exports, "FontFamily", { enumerable: true, get: function () { return
|
|
9
|
-
Object.defineProperty(exports, "FontStyle", { enumerable: true, get: function () { return
|
|
3
|
+
exports.Text = exports.FontStyle = exports.FontFamily = exports.FontWeight = exports.TextVariant = exports.TextColor = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "TextColor", { enumerable: true, get: function () { return design_system_shared_1.TextColor; } });
|
|
6
|
+
Object.defineProperty(exports, "TextVariant", { enumerable: true, get: function () { return design_system_shared_1.TextVariant; } });
|
|
7
|
+
Object.defineProperty(exports, "FontWeight", { enumerable: true, get: function () { return design_system_shared_1.FontWeight; } });
|
|
8
|
+
Object.defineProperty(exports, "FontFamily", { enumerable: true, get: function () { return design_system_shared_1.FontFamily; } });
|
|
9
|
+
Object.defineProperty(exports, "FontStyle", { enumerable: true, get: function () { return design_system_shared_1.FontStyle; } });
|
|
10
10
|
var Text_1 = require("./Text.cjs");
|
|
11
11
|
Object.defineProperty(exports, "Text", { enumerable: true, get: function () { return Text_1.Text; } });
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":";;;AAAA,gFAOiD;AAN/C,iHAAA,SAAS,OAAA;AACT,mHAAA,WAAW,OAAA;AACX,kHAAA,UAAU,OAAA;AACV,kHAAA,UAAU,OAAA;AACV,iHAAA,SAAS,OAAA;AAGX,mCAA8B;AAArB,4FAAA,IAAI,OAAA","sourcesContent":["export {\n TextColor,\n TextVariant,\n FontWeight,\n FontFamily,\n FontStyle,\n type TextPropsShared,\n} from '@metamask-previews/design-system-shared';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { TextColor, TextVariant, FontWeight, FontFamily, FontStyle, type TextPropsShared, } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { Text } from "./Text.cjs";
|
|
3
3
|
export type { TextProps } from "./Text.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,eAAe,GACrB,gDAAgD;AACjD,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { TextColor, TextVariant, FontWeight, FontFamily, FontStyle, type TextPropsShared, } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { Text } from "./Text.mjs";
|
|
3
3
|
export type { TextProps } from "./Text.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EACT,KAAK,eAAe,GACrB,gDAAgD;AACjD,OAAO,EAAE,IAAI,EAAE,mBAAe;AAC9B,YAAY,EAAE,SAAS,EAAE,yBAAqB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { TextColor, TextVariant, FontWeight, FontFamily, FontStyle } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { Text } from "./Text.mjs";
|
|
3
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/Text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,UAAU,EACV,SAAS,EAEV,gDAAgD;AACjD,OAAO,EAAE,IAAI,EAAE,mBAAe","sourcesContent":["export {\n TextColor,\n TextVariant,\n FontWeight,\n FontFamily,\n FontStyle,\n type TextPropsShared,\n} from '@metamask-previews/design-system-shared';\nexport { Text } from './Text';\nexport type { TextProps } from './Text.types';\n"]}
|
|
@@ -24,10 +24,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.TextButton = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
27
28
|
const react_1 = __importStar(require("react"));
|
|
28
|
-
const types_1 = require("../../types/index.cjs");
|
|
29
29
|
const Text_1 = require("../Text/index.cjs");
|
|
30
|
-
const TextButton = ({ children, variant =
|
|
30
|
+
const TextButton = ({ children, variant = design_system_shared_1.TextVariant.BodyMd, fontWeight = Text_1.FontWeight.Medium, twClassName, accessibilityRole = 'link', onPress, onPressIn, onPressOut, suppressHighlighting = true, ...rest }) => {
|
|
31
31
|
const [pressed, setPressed] = (0, react_1.useState)(false);
|
|
32
32
|
const handlePressIn = (e) => {
|
|
33
33
|
setPressed(true);
|
|
@@ -37,7 +37,7 @@ const TextButton = ({ children, variant = types_1.TextVariant.BodyMd, fontWeight
|
|
|
37
37
|
setPressed(false);
|
|
38
38
|
onPressOut?.(e);
|
|
39
39
|
};
|
|
40
|
-
return (<Text_1.Text {...rest} accessibilityRole={accessibilityRole} variant={variant} fontWeight={fontWeight} color={pressed ?
|
|
40
|
+
return (<Text_1.Text {...rest} accessibilityRole={accessibilityRole} variant={variant} fontWeight={fontWeight} color={pressed ? design_system_shared_1.TextColor.PrimaryDefaultPressed : design_system_shared_1.TextColor.PrimaryDefault} twClassName={twClassName} onPress={onPress} onPressIn={handlePressIn} onPressOut={handlePressOut} suppressHighlighting={suppressHighlighting}>
|
|
41
41
|
{children}
|
|
42
42
|
</Text_1.Text>);
|
|
43
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"TextButton.cjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAAiF;AACjF,+CAAwC;AAExC,4CAA2C;AAIpC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,OAAO,GAAG,kCAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,iBAAU,CAAC,MAAM,EAC9B,WAAW,EACX,iBAAiB,GAAG,MAAM,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,oBAAoB,GAAG,IAAI,EAC3B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAA8C,CAAC,CAAC,EAAE,EAAE;QACrE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,cAAc,GAA+C,CAAC,CAAC,EAAE,EAAE;QACvE,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,WAAI,CACH,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,OAAO,CAAC,CAAC,CAAC,gCAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,gCAAS,CAAC,cAAc,CACrE,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,aAAa,CAAC,CACzB,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAE3C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,WAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,UAAU,cA0CrB","sourcesContent":["import { TextColor, TextVariant } from '@metamask-previews/design-system-shared';\nimport React, { useState } from 'react';\n\nimport { Text, FontWeight } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n twClassName,\n accessibilityRole = 'link',\n onPress,\n onPressIn,\n onPressOut,\n suppressHighlighting = true,\n ...rest\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn: NonNullable<TextButtonProps['onPressIn']> = (e) => {\n setPressed(true);\n onPressIn?.(e);\n };\n\n const handlePressOut: NonNullable<TextButtonProps['onPressOut']> = (e) => {\n setPressed(false);\n onPressOut?.(e);\n };\n\n return (\n <Text\n {...rest}\n accessibilityRole={accessibilityRole}\n variant={variant}\n fontWeight={fontWeight}\n color={\n pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault\n }\n twClassName={twClassName}\n onPress={onPress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting={suppressHighlighting}\n >\n {children}\n </Text>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextButton.d.cts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAIxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0ChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextButton.d.mts","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAIxC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA0ChD,CAAC"}
|
|
@@ -4,9 +4,9 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
8
|
import $React, { useState } from "react";
|
|
8
9
|
const React = $importDefault($React);
|
|
9
|
-
import { TextVariant, TextColor } from "../../types/index.mjs";
|
|
10
10
|
import { Text, FontWeight } from "../Text/index.mjs";
|
|
11
11
|
export const TextButton = ({ children, variant = TextVariant.BodyMd, fontWeight = FontWeight.Medium, twClassName, accessibilityRole = 'link', onPress, onPressIn, onPressOut, suppressHighlighting = true, ...rest }) => {
|
|
12
12
|
const [pressed, setPressed] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"TextButton.mjs","sourceRoot":"","sources":["../../../src/components/TextButton/TextButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,gDAAgD;AACjF,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAExC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,0BAAgB;AAI3C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,QAAQ,EACR,OAAO,GAAG,WAAW,CAAC,MAAM,EAC5B,UAAU,GAAG,UAAU,CAAC,MAAM,EAC9B,WAAW,EACX,iBAAiB,GAAG,MAAM,EAC1B,OAAO,EACP,SAAS,EACT,UAAU,EACV,oBAAoB,GAAG,IAAI,EAC3B,GAAG,IAAI,EACR,EAAE,EAAE;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,MAAM,aAAa,GAA8C,CAAC,CAAC,EAAE,EAAE;QACrE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC,CAAC;IAEF,MAAM,cAAc,GAA+C,CAAC,CAAC,EAAE,EAAE;QACvE,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CACH,IAAI,IAAI,CAAC,CACT,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,KAAK,CAAC,CACJ,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CACrE,CACD,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,SAAS,CAAC,CAAC,aAAa,CAAC,CACzB,UAAU,CAAC,CAAC,cAAc,CAAC,CAC3B,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAE3C;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { TextColor, TextVariant } from '@metamask-previews/design-system-shared';\nimport React, { useState } from 'react';\n\nimport { Text, FontWeight } from '../Text';\n\nimport type { TextButtonProps } from './TextButton.types';\n\nexport const TextButton: React.FC<TextButtonProps> = ({\n children,\n variant = TextVariant.BodyMd,\n fontWeight = FontWeight.Medium,\n twClassName,\n accessibilityRole = 'link',\n onPress,\n onPressIn,\n onPressOut,\n suppressHighlighting = true,\n ...rest\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handlePressIn: NonNullable<TextButtonProps['onPressIn']> = (e) => {\n setPressed(true);\n onPressIn?.(e);\n };\n\n const handlePressOut: NonNullable<TextButtonProps['onPressOut']> = (e) => {\n setPressed(false);\n onPressOut?.(e);\n };\n\n return (\n <Text\n {...rest}\n accessibilityRole={accessibilityRole}\n variant={variant}\n fontWeight={fontWeight}\n color={\n pressed ? TextColor.PrimaryDefaultPressed : TextColor.PrimaryDefault\n }\n twClassName={twClassName}\n onPress={onPress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n suppressHighlighting={suppressHighlighting}\n >\n {children}\n </Text>\n );\n};\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextField = void 0;
|
|
4
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
4
5
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const react_native_1 = require("react-native/index.js");
|
|
7
|
-
const types_1 = require("../../types/index.cjs");
|
|
8
8
|
const Input_1 = require("../Input/index.cjs");
|
|
9
9
|
function getContainerBorderColorClass(isDisabled, isFocused, isError) {
|
|
10
10
|
if (isDisabled) {
|
|
@@ -45,7 +45,7 @@ exports.TextField = (0, react_1.forwardRef)(({ style, startAccessory, endAccesso
|
|
|
45
45
|
return (<react_native_1.Pressable testID={testID} style={[containerStyle, style]} onPress={onPressHandler} accessible={false}>
|
|
46
46
|
{startAccessory}
|
|
47
47
|
<react_native_1.View style={tw.style('min-h-0 flex-1 justify-center')}>
|
|
48
|
-
{inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={
|
|
48
|
+
{inputElement ?? (<Input_1.Input {...props} ref={inputRef} textVariant={design_system_shared_1.TextVariant.BodyMd} isDisabled={isDisabled} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler} isStateStylesDisabled
|
|
49
49
|
// Row is `h-12` (48px) with `border` on the Pressable (1px top + bottom). Inner TextInput
|
|
50
50
|
// uses 46px height so the field matches a 48px-tall control without vertical overflow.
|
|
51
51
|
twClassName="h-[46px] bg-transparent border-0" numberOfLines={1} multiline={false}/>)}
|