@metamask-previews/design-system-react-native 0.14.0-preview.4ce710b → 0.15.0-preview.a73a010
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 +13 -1
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -8
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +2 -2
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +4 -4
- 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/Box/Box.constants.cjs.map +1 -1
- package/dist/components/Box/Box.constants.d.cts +1 -1
- package/dist/components/Box/Box.constants.d.cts.map +1 -1
- package/dist/components/Box/Box.constants.d.mts +1 -1
- package/dist/components/Box/Box.constants.d.mts.map +1 -1
- package/dist/components/Box/Box.constants.mjs.map +1 -1
- package/dist/components/Box/Box.types.cjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +3 -107
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +3 -107
- package/dist/components/Box/Box.types.d.mts.map +1 -1
- package/dist/components/Box/Box.types.mjs.map +1 -1
- package/dist/components/Box/index.cjs +7 -7
- package/dist/components/Box/index.cjs.map +1 -1
- package/dist/components/Box/index.d.cts +1 -2
- package/dist/components/Box/index.d.cts.map +1 -1
- package/dist/components/Box/index.d.mts +1 -2
- package/dist/components/Box/index.d.mts.map +1 -1
- package/dist/components/Box/index.mjs +1 -1
- package/dist/components/Box/index.mjs.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs +2 -2
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.d.cts.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.d.mts.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.cjs +2 -2
- package/dist/components/BoxVertical/BoxVertical.cjs.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.d.cts.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.d.mts.map +1 -1
- package/dist/components/BoxVertical/BoxVertical.mjs +1 -1
- package/dist/components/BoxVertical/BoxVertical.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +2 -0
- 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 +2 -0
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/assets/no-photography.svg +1 -0
- package/dist/components/Input/Input.cjs +3 -3
- 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 +1 -1
- 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 +43 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts +7 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts +7 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +43 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.cjs +3 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.cjs.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts +17 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts +17 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts.map +1 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.mjs +2 -0
- package/dist/components/KeyValueColumn/KeyValueColumn.types.mjs.map +1 -0
- package/dist/components/KeyValueColumn/index.cjs +6 -0
- package/dist/components/KeyValueColumn/index.cjs.map +1 -0
- package/dist/components/KeyValueColumn/index.d.cts +3 -0
- package/dist/components/KeyValueColumn/index.d.cts.map +1 -0
- package/dist/components/KeyValueColumn/index.d.mts +3 -0
- package/dist/components/KeyValueColumn/index.d.mts.map +1 -0
- package/dist/components/KeyValueColumn/index.mjs +2 -0
- package/dist/components/KeyValueColumn/index.mjs.map +1 -0
- package/dist/components/Text/Text.cjs +4 -4
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs +23 -18
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts +1 -1
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts +1 -1
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs +20 -15
- 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 +1 -1
- 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 +35 -3
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +35 -3
- 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 +4 -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 +109 -173
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +99 -174
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +99 -174
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +108 -172
- package/dist/types/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextInputProps } from 'react-native';\n\nimport type { TextVariant } from '../../types';\n\nexport type InputProps = Omit<\n TextInputProps,\n 'editable' | 'value' | 'defaultValue'\n> & {\n /**\n * Controlled value for Input.\n */\n value: string;\n /**\n * Optional enum to select between Typography variants.\n *\n * @default BodyMd\n */\n textVariant?: TextVariant;\n /**\n * Optional boolean to disable Input.\n *\n * @default false\n */\n isDisabled?: boolean;\n /**\n * Optional boolean to show readonly input.\n *\n * @default false\n */\n isReadonly?: boolean;\n /**\n * Optional boolean to disable state styles.\n *\n * @default false\n */\n isStateStylesDisabled?: boolean;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n};\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.KeyValueColumn = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const types_1 = require("../../types/index.cjs");
|
|
9
|
+
const BoxHorizontal_1 = require("../BoxHorizontal/index.cjs");
|
|
10
|
+
const BoxVertical_1 = require("../BoxVertical/index.cjs");
|
|
11
|
+
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
12
|
+
const KeyValueColumn = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, twClassName, ...viewProps }) => {
|
|
13
|
+
const keyEndAccessoryNode = keyEndButtonIconProps?.iconName !== undefined &&
|
|
14
|
+
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={types_1.ButtonIconSize.Sm} iconProps={{ color: types_1.IconColor.IconAlternative }} {...keyEndButtonIconProps} iconName={keyEndButtonIconProps.iconName}/>) : (keyEndAccessory);
|
|
15
|
+
const valueEndAccessoryNode = valueEndButtonIconProps?.iconName !== undefined &&
|
|
16
|
+
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={types_1.ButtonIconSize.Sm} iconProps={{ color: types_1.IconColor.IconDefault }} {...valueEndButtonIconProps} iconName={valueEndButtonIconProps.iconName}/>) : (valueEndAccessory);
|
|
17
|
+
const keyBox = (<BoxHorizontal_1.BoxHorizontal startAccessory={keyStartAccessory} endAccessory={keyEndAccessoryNode} textProps={{
|
|
18
|
+
variant: types_1.TextVariant.BodyMd,
|
|
19
|
+
fontWeight: types_1.FontWeight.Medium,
|
|
20
|
+
color: types_1.TextColor.TextAlternative,
|
|
21
|
+
numberOfLines: 1,
|
|
22
|
+
ellipsizeMode: 'tail',
|
|
23
|
+
...keyTextProps,
|
|
24
|
+
}} twClassName="w-full min-w-0">
|
|
25
|
+
{keyContent}
|
|
26
|
+
</BoxHorizontal_1.BoxHorizontal>);
|
|
27
|
+
const valueBox = (<BoxHorizontal_1.BoxHorizontal startAccessory={valueStartAccessory} endAccessory={valueEndAccessoryNode} textProps={{
|
|
28
|
+
variant: types_1.TextVariant.BodyMd,
|
|
29
|
+
fontWeight: types_1.FontWeight.Medium,
|
|
30
|
+
color: types_1.TextColor.TextDefault,
|
|
31
|
+
numberOfLines: 1,
|
|
32
|
+
ellipsizeMode: 'tail',
|
|
33
|
+
...valueTextProps,
|
|
34
|
+
}} twClassName="w-full min-w-0">
|
|
35
|
+
{valueContent}
|
|
36
|
+
</BoxHorizontal_1.BoxHorizontal>);
|
|
37
|
+
return (<BoxVertical_1.BoxVertical bottomAccessory={valueBox} twClassName={twClassName} {...viewProps}>
|
|
38
|
+
{keyBox}
|
|
39
|
+
</BoxVertical_1.BoxVertical>);
|
|
40
|
+
};
|
|
41
|
+
exports.KeyValueColumn = KeyValueColumn;
|
|
42
|
+
exports.KeyValueColumn.displayName = 'KeyValueColumn';
|
|
43
|
+
//# sourceMappingURL=KeyValueColumn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,iDAMqB;AACrB,8DAAiD;AACjD,0DAA6C;AAC7C,wDAA2C;AAIpC,MAAM,cAAc,GAAG,CAAC,EAC7B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,EAAE,YAAY,EACnB,cAAc,EACd,WAAW,EACX,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,mBAAmB,GACvB,qBAAqB,EAAE,QAAQ,KAAK,SAAS;QAC7C,qBAAqB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CACxC,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,sBAAc,CAAC,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,eAAe,EAAE,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,QAAQ,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EACzC,CACH,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,CAAC;IAEJ,MAAM,qBAAqB,GACzB,uBAAuB,EAAE,QAAQ,KAAK,SAAS;QAC/C,uBAAuB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CAC1C,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,sBAAc,CAAC,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,WAAW,EAAE,CAAC,CAC5C,IAAI,uBAAuB,CAAC,CAC5B,QAAQ,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAC3C,CACH,CAAC,CAAC,CAAC,CACF,iBAAiB,CAClB,CAAC;IAEJ,MAAM,MAAM,GAAG,CACb,CAAC,6BAAa,CACZ,cAAc,CAAC,CAAC,iBAAiB,CAAC,CAClC,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,mBAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,kBAAU,CAAC,MAAM;YAC7B,KAAK,EAAE,iBAAS,CAAC,eAAe;YAChC,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,YAAY;SAChB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,UAAU,CACb;IAAA,EAAE,6BAAa,CAAC,CACjB,CAAC;IAEF,MAAM,QAAQ,GAAG,CACf,CAAC,6BAAa,CACZ,cAAc,CAAC,CAAC,mBAAmB,CAAC,CACpC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CACpC,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,mBAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,kBAAU,CAAC,MAAM;YAC7B,KAAK,EAAE,iBAAS,CAAC,WAAW;YAC5B,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,cAAc;SAClB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,6BAAa,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,CAAC,yBAAW,CACV,eAAe,CAAC,CAAC,QAAQ,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,MAAM,CACT;IAAA,EAAE,yBAAW,CAAC,CACf,CAAC;AACJ,CAAC,CAAC;AArFW,QAAA,cAAc,kBAqFzB;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import React from 'react';\n\nimport {\n ButtonIconSize,\n FontWeight,\n IconColor,\n TextColor,\n TextVariant,\n} from '../../types';\nimport { BoxHorizontal } from '../BoxHorizontal';\nimport { BoxVertical } from '../BoxVertical';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueColumnProps } from './KeyValueColumn.types';\n\nexport const KeyValueColumn = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n twClassName,\n ...viewProps\n}: KeyValueColumnProps) => {\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconAlternative }}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconDefault }}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxHorizontal\n startAccessory={keyStartAccessory}\n endAccessory={keyEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...keyTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {keyContent}\n </BoxHorizontal>\n );\n\n const valueBox = (\n <BoxHorizontal\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...valueTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {valueContent}\n </BoxHorizontal>\n );\n\n return (\n <BoxVertical\n bottomAccessory={valueBox}\n twClassName={twClassName}\n {...viewProps}\n >\n {keyBox}\n </BoxVertical>\n );\n};\n\nKeyValueColumn.displayName = 'KeyValueColumn';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueColumnProps } from "./KeyValueColumn.types.cjs";
|
|
3
|
+
export declare const KeyValueColumn: {
|
|
4
|
+
({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, twClassName, ...viewProps }: KeyValueColumnProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=KeyValueColumn.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAa1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc;yOAaxB,mBAAmB;;CAwErB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueColumnProps } from "./KeyValueColumn.types.mjs";
|
|
3
|
+
export declare const KeyValueColumn: {
|
|
4
|
+
({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, twClassName, ...viewProps }: KeyValueColumnProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=KeyValueColumn.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAa1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc;yOAaxB,mBAAmB;;CAwErB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { ButtonIconSize, FontWeight, IconColor, TextColor, TextVariant } from "../../types/index.mjs";
|
|
10
|
+
import { BoxHorizontal } from "../BoxHorizontal/index.mjs";
|
|
11
|
+
import { BoxVertical } from "../BoxVertical/index.mjs";
|
|
12
|
+
import { ButtonIcon } from "../ButtonIcon/index.mjs";
|
|
13
|
+
export const KeyValueColumn = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, twClassName, ...viewProps }) => {
|
|
14
|
+
const keyEndAccessoryNode = keyEndButtonIconProps?.iconName !== undefined &&
|
|
15
|
+
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon size={ButtonIconSize.Sm} iconProps={{ color: IconColor.IconAlternative }} {...keyEndButtonIconProps} iconName={keyEndButtonIconProps.iconName}/>) : (keyEndAccessory);
|
|
16
|
+
const valueEndAccessoryNode = valueEndButtonIconProps?.iconName !== undefined &&
|
|
17
|
+
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon size={ButtonIconSize.Sm} iconProps={{ color: IconColor.IconDefault }} {...valueEndButtonIconProps} iconName={valueEndButtonIconProps.iconName}/>) : (valueEndAccessory);
|
|
18
|
+
const keyBox = (<BoxHorizontal startAccessory={keyStartAccessory} endAccessory={keyEndAccessoryNode} textProps={{
|
|
19
|
+
variant: TextVariant.BodyMd,
|
|
20
|
+
fontWeight: FontWeight.Medium,
|
|
21
|
+
color: TextColor.TextAlternative,
|
|
22
|
+
numberOfLines: 1,
|
|
23
|
+
ellipsizeMode: 'tail',
|
|
24
|
+
...keyTextProps,
|
|
25
|
+
}} twClassName="w-full min-w-0">
|
|
26
|
+
{keyContent}
|
|
27
|
+
</BoxHorizontal>);
|
|
28
|
+
const valueBox = (<BoxHorizontal startAccessory={valueStartAccessory} endAccessory={valueEndAccessoryNode} textProps={{
|
|
29
|
+
variant: TextVariant.BodyMd,
|
|
30
|
+
fontWeight: FontWeight.Medium,
|
|
31
|
+
color: TextColor.TextDefault,
|
|
32
|
+
numberOfLines: 1,
|
|
33
|
+
ellipsizeMode: 'tail',
|
|
34
|
+
...valueTextProps,
|
|
35
|
+
}} twClassName="w-full min-w-0">
|
|
36
|
+
{valueContent}
|
|
37
|
+
</BoxHorizontal>);
|
|
38
|
+
return (<BoxVertical bottomAccessory={valueBox} twClassName={twClassName} {...viewProps}>
|
|
39
|
+
{keyBox}
|
|
40
|
+
</BoxVertical>);
|
|
41
|
+
};
|
|
42
|
+
KeyValueColumn.displayName = 'KeyValueColumn';
|
|
43
|
+
//# sourceMappingURL=KeyValueColumn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAE1B,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACZ,8BAAoB;AACrB,OAAO,EAAE,aAAa,EAAE,mCAAyB;AACjD,OAAO,EAAE,WAAW,EAAE,iCAAuB;AAC7C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,EAAE,YAAY,EACnB,cAAc,EACd,WAAW,EACX,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,mBAAmB,GACvB,qBAAqB,EAAE,QAAQ,KAAK,SAAS;QAC7C,qBAAqB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CACxC,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,eAAe,EAAE,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,QAAQ,CAAC,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EACzC,CACH,CAAC,CAAC,CAAC,CACF,eAAe,CAChB,CAAC;IAEJ,MAAM,qBAAqB,GACzB,uBAAuB,EAAE,QAAQ,KAAK,SAAS;QAC/C,uBAAuB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CAC1C,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,WAAW,EAAE,CAAC,CAC5C,IAAI,uBAAuB,CAAC,CAC5B,QAAQ,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAC3C,CACH,CAAC,CAAC,CAAC,CACF,iBAAiB,CAClB,CAAC;IAEJ,MAAM,MAAM,GAAG,CACb,CAAC,aAAa,CACZ,cAAc,CAAC,CAAC,iBAAiB,CAAC,CAClC,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;YAC7B,KAAK,EAAE,SAAS,CAAC,eAAe;YAChC,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,YAAY;SAChB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,UAAU,CACb;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;IAEF,MAAM,QAAQ,GAAG,CACf,CAAC,aAAa,CACZ,cAAc,CAAC,CAAC,mBAAmB,CAAC,CACpC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CACpC,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;YAC7B,KAAK,EAAE,SAAS,CAAC,WAAW;YAC5B,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,cAAc;SAClB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,aAAa,CAAC,CACjB,CAAC;IAEF,OAAO,CACL,CAAC,WAAW,CACV,eAAe,CAAC,CAAC,QAAQ,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,MAAM,CACT;IAAA,EAAE,WAAW,CAAC,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import React from 'react';\n\nimport {\n ButtonIconSize,\n FontWeight,\n IconColor,\n TextColor,\n TextVariant,\n} from '../../types';\nimport { BoxHorizontal } from '../BoxHorizontal';\nimport { BoxVertical } from '../BoxVertical';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueColumnProps } from './KeyValueColumn.types';\n\nexport const KeyValueColumn = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n twClassName,\n ...viewProps\n}: KeyValueColumnProps) => {\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconAlternative }}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconDefault }}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxHorizontal\n startAccessory={keyStartAccessory}\n endAccessory={keyEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...keyTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {keyContent}\n </BoxHorizontal>\n );\n\n const valueBox = (\n <BoxHorizontal\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...valueTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {valueContent}\n </BoxHorizontal>\n );\n\n return (\n <BoxVertical\n bottomAccessory={valueBox}\n twClassName={twClassName}\n {...viewProps}\n >\n {keyBox}\n </BoxVertical>\n );\n};\n\nKeyValueColumn.displayName = 'KeyValueColumn';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.types.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueColumnPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { TextProps } from '../Text/Text.types';\n\nexport type KeyValueColumnProps = KeyValueColumnPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n /** Optional props for the value Text when value is a string. */\n valueTextProps?: Partial<Omit<TextProps, 'children'>>;\n /** Optional Tailwind class names applied to the outer BoxVertical. Merged with base styles. */\n twClassName?: string;\n /** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */\n keyEndButtonIconProps?: Partial<ButtonIconProps>;\n /** When set, renders a ButtonIcon as the value endAccessory (takes precedence over valueEndAccessory). */\n valueEndButtonIconProps?: Partial<ButtonIconProps>;\n };\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KeyValueColumnPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.cjs";
|
|
4
|
+
import type { TextProps } from "../Text/Text.types.cjs";
|
|
5
|
+
export type KeyValueColumnProps = KeyValueColumnPropsShared & Omit<ViewProps, 'children'> & {
|
|
6
|
+
/** Optional props for the key Text when key is a string. */
|
|
7
|
+
keyTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
8
|
+
/** Optional props for the value Text when value is a string. */
|
|
9
|
+
valueTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
10
|
+
/** Optional Tailwind class names applied to the outer BoxVertical. Merged with base styles. */
|
|
11
|
+
twClassName?: string;
|
|
12
|
+
/** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */
|
|
13
|
+
keyEndButtonIconProps?: Partial<ButtonIconProps>;
|
|
14
|
+
/** When set, renders a ButtonIcon as the value endAccessory (takes precedence over valueEndAccessory). */
|
|
15
|
+
valueEndButtonIconProps?: Partial<ButtonIconProps>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=KeyValueColumn.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.types.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gDAAgD;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACtD,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,qBAAqB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjD,0GAA0G;IAC1G,uBAAuB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { KeyValueColumnPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ViewProps } from "react-native/index.js";
|
|
3
|
+
import type { ButtonIconProps } from "../ButtonIcon/ButtonIcon.types.mjs";
|
|
4
|
+
import type { TextProps } from "../Text/Text.types.mjs";
|
|
5
|
+
export type KeyValueColumnProps = KeyValueColumnPropsShared & Omit<ViewProps, 'children'> & {
|
|
6
|
+
/** Optional props for the key Text when key is a string. */
|
|
7
|
+
keyTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
8
|
+
/** Optional props for the value Text when value is a string. */
|
|
9
|
+
valueTextProps?: Partial<Omit<TextProps, 'children'>>;
|
|
10
|
+
/** Optional Tailwind class names applied to the outer BoxVertical. Merged with base styles. */
|
|
11
|
+
twClassName?: string;
|
|
12
|
+
/** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */
|
|
13
|
+
keyEndButtonIconProps?: Partial<ButtonIconProps>;
|
|
14
|
+
/** When set, renders a ButtonIcon as the value endAccessory (takes precedence over valueEndAccessory). */
|
|
15
|
+
valueEndButtonIconProps?: Partial<ButtonIconProps>;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=KeyValueColumn.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.types.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,gDAAgD;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B,4DAA4D;IAC5D,YAAY,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACpD,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACtD,+FAA+F;IAC/F,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,qBAAqB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjD,0GAA0G;IAC1G,uBAAuB,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.types.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { KeyValueColumnPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\nimport type { ButtonIconProps } from '../ButtonIcon/ButtonIcon.types';\nimport type { TextProps } from '../Text/Text.types';\n\nexport type KeyValueColumnProps = KeyValueColumnPropsShared &\n Omit<ViewProps, 'children'> & {\n /** Optional props for the key Text when key is a string. */\n keyTextProps?: Partial<Omit<TextProps, 'children'>>;\n /** Optional props for the value Text when value is a string. */\n valueTextProps?: Partial<Omit<TextProps, 'children'>>;\n /** Optional Tailwind class names applied to the outer BoxVertical. Merged with base styles. */\n twClassName?: string;\n /** When set, renders a ButtonIcon as the key endAccessory (takes precedence over keyEndAccessory). */\n keyEndButtonIconProps?: Partial<ButtonIconProps>;\n /** When set, renders a ButtonIcon as the value endAccessory (takes precedence over valueEndAccessory). */\n valueEndButtonIconProps?: Partial<ButtonIconProps>;\n };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyValueColumn = void 0;
|
|
4
|
+
var KeyValueColumn_1 = require("./KeyValueColumn.cjs");
|
|
5
|
+
Object.defineProperty(exports, "KeyValueColumn", { enumerable: true, get: function () { return KeyValueColumn_1.KeyValueColumn; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/index.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAAzC,gHAAA,cAAc,OAAA","sourcesContent":["export { KeyValueColumn } from './KeyValueColumn';\nexport type { KeyValueColumnProps } from './KeyValueColumn.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB;AAClD,YAAY,EAAE,mBAAmB,EAAE,mCAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB;AAClD,YAAY,EAAE,mBAAmB,EAAE,mCAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,6BAAyB","sourcesContent":["export { KeyValueColumn } from './KeyValueColumn';\nexport type { KeyValueColumnProps } from './KeyValueColumn.types';\n"]}
|
|
@@ -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");
|
|
28
27
|
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
29
28
|
const react_1 = __importStar(require("react"));
|
|
30
29
|
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 = types_1.TextVariant.BodyMd, color = types_1.TextColor.TextDefault, style, children, fontWeight, fontFamily = types_1.FontFamily.Default, fontStyle = types_1.FontStyle.Normal, twClassName, ...props }) => {
|
|
33
33
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
34
34
|
const finalFontWeight = fontWeight ?? Text_constants_1.MAP_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 === types_1.FontStyle.Italic;
|
|
37
|
+
const fontSuffix = `${Text_constants_1.TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight]}${isItalic && fontFamily === types_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,
|
|
1
|
+
{"version":3,"file":"Text.cjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAAuC;AACvC,wDAA8C;AAE9C,iDAA4E;AAE5E,yDAG0B;AAGnB,MAAM,IAAI,GAAwB,CAAC,EACxC,OAAO,GAAG,mBAAW,CAAC,MAAM,EAC5B,KAAK,GAAG,iBAAS,CAAC,WAAW,EAC7B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,UAAU,GAAG,kBAAU,CAAC,OAAO,EAC/B,SAAS,GAAG,iBAAS,CAAC,MAAM,EAC5B,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,eAAe,GAAG,UAAU,IAAI,4CAA2B,CAAC,OAAO,CAAC,CAAC;IAE3E,MAAM,SAAS,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAC7B,MAAM,QAAQ,GAAG,SAAS,KAAK,iBAAS,CAAC,MAAM,CAAC;QAChD,MAAM,UAAU,GAAG,GAAG,2CAA0B,CAAC,eAAe,CAAC,GAC/D,QAAQ,IAAI,UAAU,KAAK,kBAAU,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;AA5BW,QAAA,IAAI,QA4Bf","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { Text as RNText } from 'react-native';\n\nimport { FontFamily, FontStyle, TextVariant, TextColor } from '../../types';\n\nimport {\n MAP_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 = fontWeight ?? MAP_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,27 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MAP_TEXT_VARIANT_FONTWEIGHT = exports.TWCLASSMAP_TEXT_FONTWEIGHT = void 0;
|
|
4
|
-
const
|
|
4
|
+
const design_tokens_1 = require("@metamask-previews/design-tokens");
|
|
5
|
+
const types_1 = require("../../types/index.cjs");
|
|
5
6
|
// Mappings
|
|
6
7
|
exports.TWCLASSMAP_TEXT_FONTWEIGHT = {
|
|
7
|
-
[
|
|
8
|
-
[
|
|
9
|
-
[
|
|
8
|
+
[types_1.FontWeight.Regular]: '-regular',
|
|
9
|
+
[types_1.FontWeight.Medium]: '-medium',
|
|
10
|
+
[types_1.FontWeight.Bold]: '-bold',
|
|
10
11
|
};
|
|
11
12
|
exports.MAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
20
|
-
[
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
|
|
24
|
-
[
|
|
25
|
-
|
|
13
|
+
[types_1.TextVariant.DisplayLg]: design_tokens_1.typography.sDisplayLG.fontWeight,
|
|
14
|
+
[types_1.TextVariant.DisplayMd]: design_tokens_1.typography.sDisplayMD.fontWeight,
|
|
15
|
+
[types_1.TextVariant.HeadingLg]: design_tokens_1.typography.sHeadingLG.fontWeight,
|
|
16
|
+
[types_1.TextVariant.HeadingMd]: design_tokens_1.typography.sHeadingMD.fontWeight,
|
|
17
|
+
[types_1.TextVariant.HeadingSm]: design_tokens_1.typography.sHeadingSM.fontWeight,
|
|
18
|
+
[types_1.TextVariant.BodyLg]: design_tokens_1.typography.sBodyLGMedium.fontWeight,
|
|
19
|
+
[types_1.TextVariant.BodyMd]: design_tokens_1.typography.sBodyMD.fontWeight,
|
|
20
|
+
[types_1.TextVariant.BodySm]: design_tokens_1.typography.sBodySM.fontWeight,
|
|
21
|
+
[types_1.TextVariant.BodyXs]: design_tokens_1.typography.sBodyXS.fontWeight,
|
|
22
|
+
[types_1.TextVariant.PageHeading]: design_tokens_1.typography.sPageHeading.fontWeight,
|
|
23
|
+
[types_1.TextVariant.SectionHeading]: design_tokens_1.typography.sSectionHeading
|
|
24
|
+
.fontWeight,
|
|
25
|
+
[types_1.TextVariant.ButtonLabelMd]: design_tokens_1.typography.sButtonLabelMd
|
|
26
|
+
.fontWeight,
|
|
27
|
+
[types_1.TextVariant.ButtonLabelLg]: design_tokens_1.typography.sButtonLabelLg
|
|
28
|
+
.fontWeight,
|
|
29
|
+
[types_1.TextVariant.AmountDisplayLg]: design_tokens_1.typography.sAmountDisplayLg
|
|
30
|
+
.fontWeight,
|
|
26
31
|
};
|
|
27
32
|
//# 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,oEAA8D;AAE9D,iDAAsD;AAEtD,WAAW;AACE,QAAA,0BAA0B,GAEnC;IACF,CAAC,kBAAU,CAAC,OAAO,CAAC,EAAE,UAAU;IAChC,CAAC,kBAAU,CAAC,MAAM,CAAC,EAAE,SAAS;IAC9B,CAAC,kBAAU,CAAC,IAAI,CAAC,EAAE,OAAO;CAC3B,CAAC;AAEW,QAAA,2BAA2B,GAEpC;IACF,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,SAAS,CAAC,EAAE,0BAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,0BAAU,CAAC,aAAa,CAAC,UAAwB;IACvE,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,0BAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,0BAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,mBAAW,CAAC,MAAM,CAAC,EAAE,0BAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,mBAAW,CAAC,WAAW,CAAC,EAAE,0BAAU,CAAC,YAAY,CAAC,UAAwB;IAC3E,CAAC,mBAAW,CAAC,cAAc,CAAC,EAAE,0BAAU,CAAC,eAAe;SACrD,UAAwB;IAC3B,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,0BAAU,CAAC,cAAc;SACnD,UAAwB;IAC3B,CAAC,mBAAW,CAAC,aAAa,CAAC,EAAE,0BAAU,CAAC,cAAc;SACnD,UAAwB;IAC3B,CAAC,mBAAW,CAAC,eAAe,CAAC,EAAE,0BAAU,CAAC,gBAAgB;SACvD,UAAwB;CAC5B,CAAC","sourcesContent":["import { typography } from '@metamask-previews/design-tokens';\n\nimport { FontWeight, TextVariant } from '../../types';\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 MAP_TEXT_VARIANT_FONTWEIGHT: {\n [key in TextVariant]: FontWeight;\n} = {\n [TextVariant.DisplayLg]: typography.sDisplayLG.fontWeight as FontWeight,\n [TextVariant.DisplayMd]: typography.sDisplayMD.fontWeight as FontWeight,\n [TextVariant.HeadingLg]: typography.sHeadingLG.fontWeight as FontWeight,\n [TextVariant.HeadingMd]: typography.sHeadingMD.fontWeight as FontWeight,\n [TextVariant.HeadingSm]: typography.sHeadingSM.fontWeight as FontWeight,\n [TextVariant.BodyLg]: typography.sBodyLGMedium.fontWeight as FontWeight,\n [TextVariant.BodyMd]: typography.sBodyMD.fontWeight as FontWeight,\n [TextVariant.BodySm]: typography.sBodySM.fontWeight as FontWeight,\n [TextVariant.BodyXs]: typography.sBodyXS.fontWeight as FontWeight,\n [TextVariant.PageHeading]: typography.sPageHeading.fontWeight as FontWeight,\n [TextVariant.SectionHeading]: typography.sSectionHeading\n .fontWeight as FontWeight,\n [TextVariant.ButtonLabelMd]: typography.sButtonLabelMd\n .fontWeight as FontWeight,\n [TextVariant.ButtonLabelLg]: typography.sButtonLabelLg\n .fontWeight as FontWeight,\n [TextVariant.AmountDisplayLg]: typography.sAmountDisplayLg\n .fontWeight as FontWeight,\n};\n"]}
|
|
@@ -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":"AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AAGtD,eAAO,MAAM,0BAA0B,EAAE;KACtC,GAAG,IAAI,UAAU,GAAG,MAAM;CAK5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE;KACvC,GAAG,IAAI,WAAW,GAAG,UAAU;CAoBjC,CAAC"}
|
|
@@ -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":"AAEA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AAGtD,eAAO,MAAM,0BAA0B,EAAE;KACtC,GAAG,IAAI,UAAU,GAAG,MAAM;CAK5B,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE;KACvC,GAAG,IAAI,WAAW,GAAG,UAAU;CAoBjC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { typography } from "@metamask-previews/design-tokens";
|
|
2
|
+
import { FontWeight, TextVariant } from "../../types/index.mjs";
|
|
2
3
|
// Mappings
|
|
3
4
|
export const TWCLASSMAP_TEXT_FONTWEIGHT = {
|
|
4
5
|
[FontWeight.Regular]: '-regular',
|
|
@@ -6,19 +7,23 @@ export const TWCLASSMAP_TEXT_FONTWEIGHT = {
|
|
|
6
7
|
[FontWeight.Bold]: '-bold',
|
|
7
8
|
};
|
|
8
9
|
export const MAP_TEXT_VARIANT_FONTWEIGHT = {
|
|
9
|
-
[TextVariant.DisplayLg]:
|
|
10
|
-
[TextVariant.DisplayMd]:
|
|
11
|
-
[TextVariant.HeadingLg]:
|
|
12
|
-
[TextVariant.HeadingMd]:
|
|
13
|
-
[TextVariant.HeadingSm]:
|
|
14
|
-
[TextVariant.BodyLg]:
|
|
15
|
-
[TextVariant.BodyMd]:
|
|
16
|
-
[TextVariant.BodySm]:
|
|
17
|
-
[TextVariant.BodyXs]:
|
|
18
|
-
[TextVariant.PageHeading]:
|
|
19
|
-
[TextVariant.SectionHeading]:
|
|
20
|
-
|
|
21
|
-
[TextVariant.
|
|
22
|
-
|
|
10
|
+
[TextVariant.DisplayLg]: typography.sDisplayLG.fontWeight,
|
|
11
|
+
[TextVariant.DisplayMd]: typography.sDisplayMD.fontWeight,
|
|
12
|
+
[TextVariant.HeadingLg]: typography.sHeadingLG.fontWeight,
|
|
13
|
+
[TextVariant.HeadingMd]: typography.sHeadingMD.fontWeight,
|
|
14
|
+
[TextVariant.HeadingSm]: typography.sHeadingSM.fontWeight,
|
|
15
|
+
[TextVariant.BodyLg]: typography.sBodyLGMedium.fontWeight,
|
|
16
|
+
[TextVariant.BodyMd]: typography.sBodyMD.fontWeight,
|
|
17
|
+
[TextVariant.BodySm]: typography.sBodySM.fontWeight,
|
|
18
|
+
[TextVariant.BodyXs]: typography.sBodyXS.fontWeight,
|
|
19
|
+
[TextVariant.PageHeading]: typography.sPageHeading.fontWeight,
|
|
20
|
+
[TextVariant.SectionHeading]: typography.sSectionHeading
|
|
21
|
+
.fontWeight,
|
|
22
|
+
[TextVariant.ButtonLabelMd]: typography.sButtonLabelMd
|
|
23
|
+
.fontWeight,
|
|
24
|
+
[TextVariant.ButtonLabelLg]: typography.sButtonLabelLg
|
|
25
|
+
.fontWeight,
|
|
26
|
+
[TextVariant.AmountDisplayLg]: typography.sAmountDisplayLg
|
|
27
|
+
.fontWeight,
|
|
23
28
|
};
|
|
24
29
|
//# 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,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"Text.constants.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yCAAyC;AAE9D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AAEtD,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,2BAA2B,GAEpC;IACF,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,UAAwB;IACvE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,UAAwB;IACjE,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,UAAwB;IAC3E,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,eAAe;SACrD,UAAwB;IAC3B,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,cAAc;SACnD,UAAwB;IAC3B,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,cAAc;SACnD,UAAwB;IAC3B,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC,gBAAgB;SACvD,UAAwB;CAC5B,CAAC","sourcesContent":["import { typography } from '@metamask-previews/design-tokens';\n\nimport { FontWeight, TextVariant } from '../../types';\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 MAP_TEXT_VARIANT_FONTWEIGHT: {\n [key in TextVariant]: FontWeight;\n} = {\n [TextVariant.DisplayLg]: typography.sDisplayLG.fontWeight as FontWeight,\n [TextVariant.DisplayMd]: typography.sDisplayMD.fontWeight as FontWeight,\n [TextVariant.HeadingLg]: typography.sHeadingLG.fontWeight as FontWeight,\n [TextVariant.HeadingMd]: typography.sHeadingMD.fontWeight as FontWeight,\n [TextVariant.HeadingSm]: typography.sHeadingSM.fontWeight as FontWeight,\n [TextVariant.BodyLg]: typography.sBodyLGMedium.fontWeight as FontWeight,\n [TextVariant.BodyMd]: typography.sBodyMD.fontWeight as FontWeight,\n [TextVariant.BodySm]: typography.sBodySM.fontWeight as FontWeight,\n [TextVariant.BodyXs]: typography.sBodyXS.fontWeight as FontWeight,\n [TextVariant.PageHeading]: typography.sPageHeading.fontWeight as FontWeight,\n [TextVariant.SectionHeading]: typography.sSectionHeading\n .fontWeight as FontWeight,\n [TextVariant.ButtonLabelMd]: typography.sButtonLabelMd\n .fontWeight as FontWeight,\n [TextVariant.ButtonLabelLg]: typography.sButtonLabelLg\n .fontWeight as FontWeight,\n [TextVariant.AmountDisplayLg]: typography.sAmountDisplayLg\n .fontWeight as FontWeight,\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":"AACA,OAAO,KAAkB,cAAc;AASvC,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA4BpC,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":"AACA,OAAO,KAAkB,cAAc;AASvC,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAE9C,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CA4BpC,CAAC"}
|
|
@@ -4,11 +4,11 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { FontFamily, FontStyle, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
7
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
8
|
import $React, { useMemo } from "react";
|
|
10
9
|
const React = $importDefault($React);
|
|
11
10
|
import { Text as RNText } from "react-native/index.js";
|
|
11
|
+
import { FontFamily, FontStyle, TextVariant, TextColor } from "../../types/index.mjs";
|
|
12
12
|
import { MAP_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();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.mjs","sourceRoot":"","sources":["../../../src/components/Text/Text.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,
|
|
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,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,8BAAoB;AAE5E,OAAO,EACL,2BAA2B,EAC3B,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,GAAG,UAAU,IAAI,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAE3E,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 { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { Text as RNText } from 'react-native';\n\nimport { FontFamily, FontStyle, TextVariant, TextColor } from '../../types';\n\nimport {\n MAP_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 = fontWeight ?? MAP_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":["// Third party dependencies.\nimport type { TextProps as RNTextProps } from 'react-native';\n\nimport type {\n TextVariant,\n TextColor,\n FontWeight,\n FontFamily,\n FontStyle,\n} from '../../types';\n\n/**\n * Text component props.\n */\nexport type TextProps = {\n /**\n * Optional enum to select between Typography variants.\n *\n * @default BodyMD\n */\n variant?: TextVariant;\n /**\n * Text to be displayed.\n */\n children: React.ReactNode;\n /**\n * Optional prop to add color to text.\n */\n color?: TextColor;\n /**\n * Optional prop to control the font weight of the text.\n * Normal: 400\n * Medium: 500\n * Bold: 600\n */\n fontWeight?: FontWeight;\n /**\n * Optional prop to adjust the font family.\n * Default: Geist\n * Accent: MM Sans\n * Hero: MM Poly\n */\n fontFamily?: FontFamily;\n /**\n * Optional prop to adjust the style of the font.\n */\n fontStyle?: FontStyle;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n} & RNTextProps;\n"]}
|
|
@@ -1,12 +1,44 @@
|
|
|
1
|
-
import type { TextPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
1
|
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 =
|
|
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;
|
|
7
39
|
/**
|
|
8
40
|
* Optional prop to add twrnc overriding classNames.
|
|
9
41
|
*/
|
|
10
42
|
twClassName?: string;
|
|
11
|
-
};
|
|
43
|
+
} & RNTextProps;
|
|
12
44
|
//# 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":"AACA,OAAO,KAAK,EAAE,SAAS,IAAI,WAAW,EAAE,8BAAqB;AAE7D,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,EACV,8BAAoB;AAErB;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,WAAW,CAAC"}
|